void iMX27RtpInterface::FrameReceived(const Sid::Binary & data, int timestamp_ms) { PACKET_DBG("Received frame, len %d, count", data.size(), m_ReceiveFcnt); m_ReceiveFcnt++; m_ReceiveBStat.Update(data.getSize()); if (m_ReceiveBStat.IsValid()) RTP_DBG("Receive bitrate: %s", m_ReceiveBStat.GetStatStr()); if (Configuration::GetCfg()->GetIntVal("UseLoopback")) { if (m_RecordingStarted) { VideoData frame; frame.SetBuf((const uint8_t*)data.data(), data.size()); frame.SetTimestamp(timestamp_ms); TransportSendFrame(frame); } return; } if (m_pReceiveWrapper) { VideoData frame; frame.SetBuf((uint8_t *)data.data(), data.size()); frame.SetTimestamp(timestamp_ms); m_pReceiveWrapper->SubmitFrame(frame); } return; }
void iMX27RtpInterface::RtpPacketReceived(const Sid::Binary & data) { PACKET_DBG("Received rpt packet, len %d, count", data.size(), m_ReceivePcnt); m_ReceivePcnt++; m_ReceiveBStat.Update(data.size()); if (m_ReceiveBStat.IsValid()) RTP_DBG("Receive bitrate: %s", m_ReceiveBStat.GetStatStr()); if (Configuration::GetCfg()->GetIntVal("UseLoopback")) { // if keyframe was requested then pretend that we send keyframe - otherwise the videolib keeps requesting the keyframes if (m_KeyFrameRequested) { ((NalHeader *)((rtph *)(const char *)data)->GetDataPtr())->SetNri(3); if (((rtph *)(const char *)data)->GetMarker()) m_KeyFrameRequested = 0; } if (m_RecordingStarted) { TransportSendRTPPacket((const char *)data, data.size()); } return; } if (m_pReceiveWrapper) { m_pReceiveWrapper->SubmitPacket((uint8_t *)data.data(), data.getSize()); } return; }
bool iMX27RtpInterface::GetBinaryProperty(int prop_id, int index, Sid::Binary & value) { RTP_FUNCLOG; bool ret = false; switch (prop_id) { case GET_H264_SENDER_PARAMETERS: { value.reserve(sizeof(H264SenderParameters)); H264SenderParameters *param = (H264SenderParameters *)value.data(); if (index == 0) { memset(param, 0, sizeof(H264SenderParameters)); param->profile_idc = 66; param->profile_iop = (H264ProfileIop)(PROFILE_IOP_CONSTRAINTS_SET0 | PROFILE_IOP_CONSTRAINTS_SET1 | PROFILE_IOP_CONSTRAINTS_SET2); param->level_idc = 30; ret = true; } break; } case GET_H264_RECEIVER_PARAMETERS: { value.reserve(sizeof(H264ReceiverParameters)); H264ReceiverParameters *param = (H264ReceiverParameters *)value.data(); if (index == 0) { memset(param, 0, sizeof(H264ReceiverParameters)); param->profile_idc = 66; param->profile_iop = (H264ProfileIop)(PROFILE_IOP_CONSTRAINTS_SET0 | PROFILE_IOP_CONSTRAINTS_SET1 | PROFILE_IOP_CONSTRAINTS_SET2); param->level_idc = 30; param->max_br = Configuration::GetCfg()->GetIntVal("LimitReceiveBitrate"); ret = true; } break; } default: break; } return ret; }