diff options
author | PacketVideo CM <engbuild@pv.com> | 2009-12-04 11:48:38 -0800 |
---|---|---|
committer | PacketVideo CM <engbuild@pv.com> | 2009-12-04 11:48:38 -0800 |
commit | 6e2cdc4ef8de5e3b857282f26be57425fbaee18b (patch) | |
tree | 299e7ba10593be7c1a1c8f912aef625f0f164876 /protocols | |
parent | 092f767fb5dee38042fe9a3c44fe80943da6e2b7 (diff) | |
download | opencore-6e2cdc4ef8de5e3b857282f26be57425fbaee18b.tar.gz |
RIO-7861: Removal of 2way VideoParser Node (minor additional change 2)
Diffstat (limited to 'protocols')
-rw-r--r-- | protocols/systems/3g-324m_pvterminal/h223/include/logicalchannel.h | 26 | ||||
-rw-r--r-- | protocols/systems/3g-324m_pvterminal/h223/src/logicalchannel.cpp | 454 |
2 files changed, 74 insertions, 406 deletions
diff --git a/protocols/systems/3g-324m_pvterminal/h223/include/logicalchannel.h b/protocols/systems/3g-324m_pvterminal/h223/include/logicalchannel.h index d8bc9367f..184371da9 100644 --- a/protocols/systems/3g-324m_pvterminal/h223/include/logicalchannel.h +++ b/protocols/systems/3g-324m_pvterminal/h223/include/logicalchannel.h @@ -26,13 +26,6 @@ #include "lipsync_singleton_object.h" #endif -#ifndef PVMF_RESIZABLE_SIMPLE_MEDIAMSG_H_INCLUDED -#include "pvmf_resizable_simple_mediamsg.h" -#endif - -#ifndef PVMF_FORMAT_TYPE_H_INCLUDED -#include "pvmf_format_type.h" -#endif #ifndef OSCL_MEM_MEMPOOL_H_INCLUDED #include "oscl_mem_mempool.h" @@ -534,16 +527,6 @@ class H223IncomingChannel : public H223LogicalChannel /* PVMFPortActivityHandler virtuals */ void HandlePortActivity(const PVMFPortActivity &aActivity); - protected: - - PVMFStatus DispatchOutgoingMsg(PVMFSharedMediaDataPtr aMediaData); - bool CheckFrameBoundary(uint8* aDataPtr, int32 aDataSize, uint32 aCrcError); - bool pvmiSetPortFormatSpecificInfoSync(PvmiCapabilityAndConfig *aPort, - const char* aFormatValType); - PVMFStatus SendVideoFrame(PVMFSharedMediaDataPtr aMediaData); - PVMFStatus CallSendVideoFrame(PVMFSharedMediaDataPtr aMediaData); - - private: void PreAlPduData(); PVMFStatus VerifyAndSetParameter(PvmiKvp* aKvp, bool aSetParam); @@ -551,6 +534,7 @@ class H223IncomingChannel : public H223LogicalChannel OsclAny SendFormatSpecificInfo(); + PVMFStatus DispatchPendingSdus(); PVMFStatus SendBeginOfStreamMediaCommand(); @@ -562,6 +546,7 @@ class H223IncomingChannel : public H223LogicalChannel OsclMemAllocator iMemAlloc; PVMFSimpleMediaBufferCombinedAlloc iMediaDataAlloc; + Oscl_Vector<PVMFSharedMediaMsgPtr, OsclMemAllocator> iPendingSdus; OsclSharedPtr<PVMFMediaDataImpl> iAlPduMediaData; uint8* iAlPduFragPos; OsclRefCounterMemFrag iAlPduFrag; @@ -582,12 +567,7 @@ class H223IncomingChannel : public H223LogicalChannel PVLogger* iIncomingAudioLogger; PVLogger* iIncomingVideoLogger; int32 iRenderingSkew; - uint32 iVideoFrameNum; - uint32 iMax_Chunk_Size; - PVMFSharedMediaDataPtr iVideoFrame; - OsclMemPoolResizableAllocator* ipVideoFrameReszMemPool; - PVMFResizableSimpleMediaMsgAlloc* ipVideoFrameAlloc; - OsclMemPoolFixedChunkAllocator * ipVideoDataMemPool; + }; class MuxSduData diff --git a/protocols/systems/3g-324m_pvterminal/h223/src/logicalchannel.cpp b/protocols/systems/3g-324m_pvterminal/h223/src/logicalchannel.cpp index e04dded9f..cbd376dd3 100644 --- a/protocols/systems/3g-324m_pvterminal/h223/src/logicalchannel.cpp +++ b/protocols/systems/3g-324m_pvterminal/h223/src/logicalchannel.cpp @@ -50,28 +50,18 @@ #define H223_INCOMING_CHANNEL_NUM_FRAGS_IN_MEDIA_DATA (3*1024/128) #define PV2WAY_BPS_TO_BYTES_PER_MSEC_RIGHT_SHIFT 13 #define H223_LCN_IN_TIMESTAMP_BASE 40 -#define MAX_VIDEO_FRAME_PARSE_SIZE (45*1024) -#define MAX_VIDEO_FRAMES 30 -#define PVVIDEOPARSER_MEDIADATA_SIZE 128 -#define MAX_MEMPOOL_BUFFER_NUM_LIMIT 5 - - +#ifdef LIP_SYNC_TESTING #define H263_START_BYTE_1 0x00 #define H263_START_BYTE_2 0x00 #define H263_START_BYTE_3 0x80 -#define H263_START_BYTE_3_MASK 0xFC - #define VOP_START_BYTE_1 0x00 #define VOP_START_BYTE_2 0x00 #define VOP_START_BYTE_3 0x01 #define VOP_START_BYTE_4 0xB6 #define VOP_START_BYTE_5 0xB0 - - - - +#endif #ifdef LIP_SYNC_TESTING /***********************Outgoing side********************/ @@ -147,10 +137,6 @@ H223LogicalChannel::~H223LogicalChannel() iFormatSpecificInfoLen = 0; } - // we need to clear the activity handler, since otherwise the PvmfPortBaseImpl destructor - // ends up calling back onto our HandlePortActivity method, which no longer exists because - // this objects's destructor has already been called. - SetActivityHandler(NULL); } void H223LogicalChannel::Init() @@ -1435,19 +1421,12 @@ H223IncomingChannel::H223IncomingChannel(TPVChannelId num, iMediaDataAlloc(&iMemAlloc), iPduSize(al->GetPduSize()), iCurPduSize(0), - iRenderingSkew(0), - iVideoFrameNum(0), - iMax_Chunk_Size(0), - ipVideoFrameReszMemPool(NULL), - ipVideoFrameAlloc(NULL) - - + iRenderingSkew(0) { #ifdef LIP_SYNC_TESTING iParam = ShareParams::Instance(); #endif - iLogger = PVLogger::GetLoggerObject("3g324m.h223.H223IncomingChannel"); iIncomingAudioLogger = PVLogger::GetLoggerObject("datapath.incoming.audio.h223.lcn"); iIncomingVideoLogger = PVLogger::GetLoggerObject("datapath.incoming.video.h223.lcn"); @@ -1455,7 +1434,6 @@ H223IncomingChannel::H223IncomingChannel(TPVChannelId num, ResetStats(); - } H223IncomingChannel::~H223IncomingChannel() @@ -1475,27 +1453,10 @@ H223IncomingChannel::~H223IncomingChannel() { OSCL_DELETE(iMediaMsgMemoryPool); } - if (iMediaType.isVideo()) - { - if (ipVideoDataMemPool) - { - OSCL_DELETE(ipVideoDataMemPool); - } - if (ipVideoFrameReszMemPool) - { - ipVideoFrameReszMemPool->removeRef(); - ipVideoFrameReszMemPool = NULL; - } - if (ipVideoFrameAlloc) - { - OSCL_DELETE(ipVideoFrameAlloc); - } - } } void H223IncomingChannel::Init() { - OsclSharedPtr<PVMFMediaDataImpl> tempImpl; PVLOGGER_LOGMSG(PVLOGMSG_INST_HLDBG, iLogger, PVLOGMSG_STACK_TRACE, (0, "H223IncomingChannel::Init")); H223LogicalChannel::Init(); @@ -1525,37 +1486,6 @@ void H223IncomingChannel::Init() iMemFragmentAlloc.SetLeaveOnAllocFailure(false); iMemFragmentAlloc.size((uint16)num_fragments, (uint16)H223_INCOMING_CHANNEL_FRAGMENT_SIZE); - if (iMediaType.isVideo()) - { - ipVideoDataMemPool = OSCL_NEW(OsclMemPoolFixedChunkAllocator, (MAX_VIDEO_FRAMES, PVVIDEOPARSER_MEDIADATA_SIZE)); - if (NULL == ipVideoDataMemPool) - { - OSCL_LEAVE(PVMFErrNoMemory); - } - - ipVideoFrameReszMemPool = OSCL_NEW(OsclMemPoolResizableAllocator, (MAX_VIDEO_FRAME_PARSE_SIZE, MAX_MEMPOOL_BUFFER_NUM_LIMIT)); - if (NULL == ipVideoFrameReszMemPool) - { - OSCL_LEAVE(PVMFErrNoMemory); - } - ipVideoFrameAlloc = OSCL_NEW(PVMFResizableSimpleMediaMsgAlloc, (ipVideoFrameReszMemPool)); - if (NULL == ipVideoFrameAlloc) - { - OSCL_LEAVE(PVMFErrNoMemory); - } - tempImpl = ipVideoFrameAlloc->allocate(MAX_VIDEO_FRAME_PARSE_SIZE); - if (!tempImpl) - { - PVLOGGER_LOGMSG(PVLOGMSG_INST_HLDBG, iLogger, PVLOGMSG_WARNING, (0, "H223IncomingChannel::Init(), tempImpl Allocation failed\n")); - OSCL_LEAVE(PVMFErrNoMemory); - } - - iVideoFrame = PVMFMediaData::createMediaData(tempImpl, ipVideoDataMemPool); - if (iVideoFrame.GetRep() == NULL) - { - OSCL_LEAVE(PVMFErrNoMemory); - } - } ResetAlPdu(); AllocateAlPdu(); @@ -1666,7 +1596,10 @@ PVMFStatus H223IncomingChannel::AlPduData(uint8* buf, uint16 len) PV_STAT_SET_TIME(iStartTime, iNumBytesIn) PreAlPduData(); - + if (PVMFSuccess != DispatchPendingSdus()) + { + PVLOGGER_LOGMSG(PVLOGMSG_INST_HLDBG, iLogger, PVLOGMSG_STACK_TRACE, (0, "H223IncomingChannel::AlPduData lcn=%d, Failed to dispatch pending sdus", lcn)); + } if (iAlPduMediaData.GetRep() == NULL || iAlPduMediaData->getFilledSize() == 0) { bool overflow = false; @@ -1759,11 +1692,15 @@ PVMFStatus H223IncomingChannel::AlDispatch() aMediaData->setTimestamp(baseTimestamp); aMediaData->setSeqNum(info.seq_num); iAlPduMediaData->setErrorsFlag(errorsFlag); - status = DispatchOutgoingMsg(aMediaData); - - + PVMFSharedMediaMsgPtr aMediaMsg; + convertToPVMFMediaMsg(aMediaMsg, aMediaData); + if (mediaType.isCompressed() && mediaType.isAudio()) + { + // we are using only full audio frames + aMediaData->setMarkerInfo(PVMF_MEDIA_DATA_MARKER_INFO_M_BIT); + } #ifdef LIP_SYNC_TESTING if (mediaType.isAudio() || mediaType.isVideo()) @@ -1777,6 +1714,33 @@ PVMFStatus H223IncomingChannel::AlDispatch() } #endif + + if (IsConnected()) + { + if (mediaType.isCompressed() && mediaType.isAudio()) + { + PVMF_INCOMING_AUDIO_LOGDATATRAFFIC((0, "Incoming audio SDU received. Stats: Entry time=%d, lcn=%d, size=%d,FmtType=%s", iCurTimestamp, lcn, aMediaData->getFilledSize(), mediaType.getMIMEStrPtr())); + } + else if (mediaType.isCompressed() && mediaType.isVideo()) + { + PVMF_INCOMING_VIDEO_LOGDATATRAFFIC((0, "Incoming video SDU received.Stats: Entry time=%d, lcn=%d, size=%d,FmtType=%s", iCurTimestamp, lcn, aMediaData->getFilledSize(), mediaType.getMIMEStrPtr())); + } + PVMFStatus dispatch_status = QueueOutgoingMsg(aMediaMsg); + if (dispatch_status != PVMFSuccess) + { + PVLOGGER_LOGMSG(PVLOGMSG_INST_HLDBG, iLogger, PVLOGMSG_WARNING, (0, "H223IncomingChannel::AlDispatch Failed to queue outgoing media message lcn=%d, size=%d, status=%d", lcn, len, dispatch_status)); + status = dispatch_status; + } + } + else if (IsSegmentable()) + { + iPendingSdus.push_back(aMediaMsg); + } + else + { + PVLOGGER_LOGMSG(PVLOGMSG_INST_HLDBG, iLogger, PVLOGMSG_STACK_TRACE, (0, "H223IncomingChannel::AlDispatchL Dropping pdu lcn=%d, iCurPduSize=%d", lcn, iCurPduSize)); + status = PVMFErrNotReady; + } ResetAlPdu(); AllocateAlPdu(); return status; @@ -1786,7 +1750,7 @@ OsclAny H223IncomingChannel::Flush() { PV_STAT_INCR(iNumBytesFlushed, (iAlPduFragPos - (uint8*)iAlPduFrag.getMemFragPtr())) PV_STAT_INCR_COND(iNumAbort, 1, (iAlPduFragPos - (uint8*)iAlPduFrag.getMemFragPtr())) - iVideoFrame.Unbind(); + iPendingSdus.clear(); ResetAlPdu(); } @@ -1819,15 +1783,6 @@ PVMFStatus H223IncomingChannel::Connect(PVMFPortInterface* aPort) return status; } - if (config != NULL) - { - if (!(pvmiSetPortFormatSpecificInfoSync(OSCL_STATIC_CAST(PvmiCapabilityAndConfig*, config), PVMF_FORMAT_SPECIFIC_INFO_KEY))) - { - PVLOGGER_LOGMSG(PVLOGMSG_INST_MLDBG, iLogger, PVLOGMSG_INFO - , (0, "H223IncomingChannel::Connect: Error - Unable To Send Format Specific Info To Peer")); - return PVMFFailure; - } - } //Automatically connect the peer. if ((status = aPort->PeerConnect(this)) != PVMFSuccess) { @@ -1835,10 +1790,8 @@ PVMFStatus H223IncomingChannel::Connect(PVMFPortInterface* aPort) return status; } - iConnectedPort = aPort; - //Check the BOS command status status = SendBeginOfStreamMediaCommand(); @@ -1852,7 +1805,7 @@ PVMFStatus H223IncomingChannel::Connect(PVMFPortInterface* aPort) if (iSendFormatSpecificInfo) SendFormatSpecificInfo(); - + DispatchPendingSdus(); PortActivity(PVMF_PORT_ACTIVITY_CONNECT); @@ -1882,6 +1835,31 @@ OsclAny H223IncomingChannel::LogStats() PVLOGGER_LOGMSG(PVLOGMSG_INST_HLDBG, iLogger, PVLOGMSG_STACK_TRACE, (0, "Num bytes aborted - %d\n", iNumBytesFlushed)); } +PVMFStatus H223IncomingChannel::DispatchPendingSdus() +{ + if (!iConnectedPort) + { + PVLOGGER_LOGMSG(PVLOGMSG_INST_HLDBG, iLogger, PVLOGMSG_STACK_TRACE, (0, "H223IncomingChannel::DispatchPendingSdus: Not connected")); + return PVMFFailure; + } + if (iPendingSdus.size()) + { + /* Dispatch any pending sdus */ + for (unsigned i = 0; i < iPendingSdus.size(); i++) + { + PVMFStatus status = QueueOutgoingMsg(iPendingSdus[i]); + if (status != PVMFSuccess) + { + PVLOGGER_LOGMSG(PVLOGMSG_INST_HLDBG, iLogger, PVLOGMSG_STACK_TRACE, (0, "H223IncomingChannel::Connect Error: PutData failed for buffered sdus lcn=%d, status=%d, i=%d", lcn, status, i)); + iObserver->LogicalChannelError(INCOMING, lcn, status); + return PVMFFailure; + } + } + PVLOGGER_LOGMSG(PVLOGMSG_INST_HLDBG, iLogger, PVLOGMSG_STACK_TRACE, (0, "H223IncomingChannel::Connect lcn=%d,num sdus=%d", lcn, iPendingSdus.size())); + iPendingSdus.clear(); + } + return PVMFSuccess; +} OsclAny H223IncomingChannel::SendFormatSpecificInfo() { @@ -2019,7 +1997,6 @@ OSCL_EXPORT_REF PVMFStatus H223IncomingChannel::getParametersSync(PvmiMIOSession parameters = NULL; num_parameter_elements = 0; - if (pv_mime_strcmp(identifier, OUTPUT_FORMATS_CAP_QUERY) == 0) { num_parameter_elements = 1; @@ -2050,8 +2027,6 @@ OSCL_EXPORT_REF PVMFStatus H223IncomingChannel::getParametersSync(PvmiMIOSession } - - return PVMFSuccess; } @@ -2484,7 +2459,7 @@ void H223IncomingChannel::DetectFrameBoundary(uint8* aBuf, uint32 aTimestamp) * Return : NONE * * -* ********************************************************************************************************/ +* *************************************************************************************************/ void H223IncomingChannel::ExtractTimestamp() { PVMFFormatType mediaType = GetFormatType(); @@ -2515,7 +2490,7 @@ void H223IncomingChannel::ExtractTimestamp() } -/* ******************************************************************************************* +/* *********************************************************************************** * Function : AppendLipSyncTS() * Date : 6/15/2009 * Purpose : The purpose of this function is to append four bytes(Video TS) @@ -2526,7 +2501,7 @@ void H223IncomingChannel::ExtractTimestamp() * Return : NONE * * -* *********************************************************************************************/ +* **********************************************************************************/ void H223OutgoingChannel::AppendLipSyncTS() { @@ -2549,292 +2524,5 @@ void H223OutgoingChannel::AppendLipSyncTS() } #endif -/* *********************************************************************************** -* Function : DispatchOutgoingMsg() -* Date : 9/11/2009 -* Purpose : The purpose of this function is to dispatch Audio and Video data. -* Basically for the first new fragment (In Video Case) we are checking -* the frame boundary, and buffering the video fragments in iVideoFrame -* Buffer, until we completed one full video frame.After completing one -* Video frame, we are dispatching the same to next lower node (Decoder). -* -* -* INPUT : aMediaData -* Return : PVMFStatus -* -* -* **********************************************************************************/ - -PVMFStatus H223IncomingChannel::DispatchOutgoingMsg(PVMFSharedMediaDataPtr aMediaData) -{ - - OsclRefCounterMemFrag memFrag; - OsclRefCounterMemFrag curVideoFrag; - OsclSharedPtr<PVMFMediaMsg> mediaMsg; - PVMFStatus status = PVMFSuccess; - - - - if (iMediaType.isVideo()) - { - - aMediaData->getMediaFragment(0, memFrag); - - - OSCL_ASSERT(memFrag.getMemFragSize() > 0); - - if (CheckFrameBoundary((uint8 *)memFrag.getMemFragPtr(), memFrag.getMemFragSize(), aMediaData->getErrorsFlag())) - { - PVLOGGER_LOGMSG(PVLOGMSG_INST_HLDBG, iLogger, PVLOGMSG_DEBUG, (0, "H223IncomingChannel::::DispatchOutgoingMsg, frame found\n")); - //If buffer exists then send it. - if (iVideoFrame.GetRep()) - { - CallSendVideoFrame(aMediaData); - iVideoFrame->setTimestamp(aMediaData->getTimestamp()); - - } - - } - - for (uint32 i = 0; i < aMediaData->getNumFragments(); i++) - { - aMediaData->getMediaFragment(i, memFrag); - - - PVLOGGER_LOGMSG(PVLOGMSG_INST_HLDBG, iLogger, PVLOGMSG_DEBUG, (0, "H223IncomingChannel::::DispatchOutgoingMsg, frag size %d, idx %d\n", memFrag.getMemFragSize(), i)); - - - - //Make sure it can fit in the video buffer. - if (memFrag.getMemFragSize() > iVideoFrame->getCapacity() - iVideoFrame->getFilledSize()) - { - CallSendVideoFrame(aMediaData); - PVLOGGER_LOGMSG(PVLOGMSG_INST_HLDBG, iLogger, PVLOGMSG_ERR, (0, "H223IncomingChannel::::DispatchOutgoingMsg, frag cannot fit into video buffer\n")); - - } - - - - iVideoFrame->getMediaFragment(0, curVideoFrag); - oscl_memcpy((uint8 *)curVideoFrag.getMemFragPtr() + iVideoFrame->getFilledSize(), memFrag.getMemFragPtr(), memFrag.getMemFragSize()); - iVideoFrame->setMediaFragFilledLen(0, iVideoFrame->getFilledSize() + memFrag.getMemFragSize()); - - - } - - } - else - { - // for audio data - aMediaData->setMarkerInfo(PVMF_MEDIA_DATA_MARKER_INFO_M_BIT); - } - - - - if (IsConnected() && !iMediaType.isVideo()) - { - convertToPVMFMediaMsg(mediaMsg, aMediaData); - PVMFStatus dispatch_status = QueueOutgoingMsg(mediaMsg); - if (dispatch_status != PVMFSuccess) - { - PVLOGGER_LOGMSG(PVLOGMSG_INST_HLDBG, iLogger, PVLOGMSG_WARNING, (0, "H223IncomingChannel::DispatchOutgoingMsg Failed to queue outgoing media message lcn=%d, status=%d", lcn, dispatch_status)); - status = dispatch_status; - - } - - } - if (!IsConnected()) - { - PVLOGGER_LOGMSG(PVLOGMSG_INST_HLDBG, iLogger, PVLOGMSG_WARNING, (0, "H223IncomingChannel::DispatchOutgoingMsg lcn=%d Queue not connected Dropping frame for audio", lcn)); - } - - - - - - return status; -} -/* *************************************************************************************************** -* Function : CheckFrameBoundary() -* Date : 9/11/2009 -* Purpose : The purpose of this function is to detect, wether the coming video stream -* is H263 or MPEG-4 format, Very soon we will add the case for H264 also. -* -* -* INPUT : aDataPtr,aDataSize,aCrcError -* Return : bool -* -* -* ******************************************************************************************************/ - -bool H223IncomingChannel::CheckFrameBoundary(uint8* aDataPtr, - int32 aDataSize, - uint32 aCrcError) -{ - - - - //If start of new frame. - if ((aDataSize > 2) && - (aDataPtr[0] == H263_START_BYTE_1) && - (aDataPtr[1] == H263_START_BYTE_2) && - ((aDataPtr[2] & H263_START_BYTE_3_MASK) == H263_START_BYTE_3)) - { - return true; - } - - if (!aCrcError) - { - if (aDataSize >= 3) - { - if ((aDataPtr[0] == VOP_START_BYTE_1) && - (aDataPtr[1] == VOP_START_BYTE_2) && - (aDataPtr[2] == VOP_START_BYTE_3)) - { - return true; - - } - } - - - } - - - - - return false; - - -} -/* ********************************************************************************************************* -* Function : pvmiSetPortFormatSpecificInfoSync() -* Date : 9/11/2009 -* Purpose : The purpose of this function is to set fromat specific Inforamtion -* for MPEG-4 video stream. -* -* -* INPUT : aPort,aFormatValType -* Return : bool -* -* -* **********************************************************************************************************/ - - -bool -H223IncomingChannel::pvmiSetPortFormatSpecificInfoSync(PvmiCapabilityAndConfig *aPort, - const char* aFormatValType) -{ - /* - * Create PvmiKvp for capability settings - */ - if (pv_mime_strcmp(aFormatValType, PVMF_FORMAT_SPECIFIC_INFO_KEY) == 0) - { - OsclMemAllocator alloc; - PvmiKvp kvp; - kvp.key = NULL; - kvp.length = oscl_strlen(aFormatValType) + 1; // +1 for \0 - kvp.key = (PvmiKeyType)alloc.ALLOCATE(kvp.length); - if (kvp.key == NULL) - { - return false; - } - oscl_strncpy(kvp.key, aFormatValType, kvp.length); - if (iFormatSpecificInfoLen == 0) - { - kvp.value.key_specific_value = 0; - kvp.capacity = 0; - } - else - { - kvp.value.key_specific_value = (OsclAny*)iFormatSpecificInfo; - kvp.capacity = iFormatSpecificInfoLen; - } - - PvmiKvp* retKvp = NULL; // for return value - int32 err; - OSCL_TRY(err, aPort->setParametersSync(NULL, &kvp, 1, retKvp);); - /* ignore the error for now */ - alloc.deallocate((OsclAny*)(kvp.key)); - return true; - } - return false; -} -/* ************************************************************************************************************ -* Function : SendVideoFrame() -* Date : 9/11/2009 -* Purpose : The purpose of this function is to send one video frame to its lower (Decoder) node. -* This function is being called from DispatchOutgoingMsg() function. -* -* -* INPUT : aMediaData -* Return : PVMFStatus -* -* -* ************************************************************************************************************/ -PVMFStatus H223IncomingChannel::SendVideoFrame(PVMFSharedMediaDataPtr aMediaData) -{ - OsclSharedPtr<PVMFMediaDataImpl> mediaDataImpl; - OsclSharedPtr<PVMFMediaDataImpl> tempImpl; - OsclRefCounterMemFrag formatSpecificInfo; - PVMFStatus dispatch_status = PVMFSuccess; - OsclSharedPtr<PVMFMediaMsg> mediaMsg; - int32 err = 0; - - - iVideoFrame->getMediaDataImpl(mediaDataImpl); - iVideoFrameNum ++; - iVideoFrame->setSeqNum(iVideoFrameNum); - aMediaData->getFormatSpecificInfo(formatSpecificInfo); - iVideoFrame->setFormatSpecificInfo(formatSpecificInfo); - mediaDataImpl->setMarkerInfo(true); - - if (IsConnected()) - { - convertToPVMFMediaMsg(mediaMsg, iVideoFrame); - PVMFStatus dispatch_status = QueueOutgoingMsg(mediaMsg); - if (dispatch_status != PVMFSuccess) - { - PVLOGGER_LOGMSG(PVLOGMSG_INST_HLDBG, iLogger, PVLOGMSG_WARNING, (0, "H223IncomingChannel::SendVideoFrame Failed to queue outgoing media message lcn=%d, status=%d", lcn, dispatch_status)); - - - } - iVideoFrame.Unbind(); - } - - - - ipVideoFrameAlloc->ResizeMemoryFragment(mediaDataImpl); - uint32 MediaMsgAllocOverhead = ipVideoFrameAlloc->GetMediaMsgAllocationOverheadBytes(); - uint32 LargestAvilableChunk = ipVideoFrameReszMemPool->getLargestContiguousFreeBlockSize(); - iMax_Chunk_Size = (LargestAvilableChunk - MediaMsgAllocOverhead); - tempImpl = ipVideoFrameAlloc->allocate(iMax_Chunk_Size); - if (!tempImpl) - { - PVLOGGER_LOGMSG(PVLOGMSG_INST_HLDBG, iLogger, PVLOGMSG_WARNING, (0, "H223IncomingChannel::SendVideoFrame , Max_Chunk_size Allocation failed\n")); - iVideoFrame.Unbind(); - - } - - OSCL_TRY(err, iVideoFrame = PVMFMediaData::createMediaData(tempImpl, ipVideoDataMemPool);); - OSCL_FIRST_CATCH_ANY(err, - PVLOGGER_LOGMSG(PVLOGMSG_INST_HLDBG, iLogger, PVLOGMSG_STACK_TRACE, (0, "H223IncomingChannel::::SendVideoFrame, Error: createMediaData failed, err=%d", err)); - return PVMFFailure; - ); - - - - return dispatch_status; -} -PVMFStatus H223IncomingChannel::CallSendVideoFrame(PVMFSharedMediaDataPtr aMediaData) -{ - PVMFStatus status = PVMFSuccess; - int32 err = 0; - OSCL_TRY(err, status = SendVideoFrame(aMediaData);); - OSCL_FIRST_CATCH_ANY(err, - PVLOGGER_LOGMSG(PVLOGMSG_INST_HLDBG, iLogger, PVLOGMSG_STACK_TRACE, (0, "H223IncomingChannel::::DispatchOutgoingMsg, Error: SendVideoFrame failed, err=%d", err)); - return PVMFFailure; - ); - return status; -} |