diff options
author | PacketVideo CM <engbuild@pv.com> | 2010-02-01 21:51:05 -0800 |
---|---|---|
committer | PacketVideo CM <engbuild@pv.com> | 2010-02-01 21:51:05 -0800 |
commit | 5f89e096b0818577f1091d3ded70f13885aa7df0 (patch) | |
tree | 0e243d072a3bf1f2c023a27849015cbdc2d94e9d /protocols | |
parent | f388d0ce433f4cc7e2e8362d464e7bde533a59b2 (diff) | |
download | opencore-5f89e096b0818577f1091d3ded70f13885aa7df0.tar.gz |
RIO-7773: Choppy audio after pausing and resuming 2way call
Diffstat (limited to 'protocols')
13 files changed, 766 insertions, 283 deletions
diff --git a/protocols/systems/3g-324m_pvterminal/h223/include/cpvh223multiplex.h b/protocols/systems/3g-324m_pvterminal/h223/include/cpvh223multiplex.h index 3e0bda761..9df8b5c64 100644 --- a/protocols/systems/3g-324m_pvterminal/h223/include/cpvh223multiplex.h +++ b/protocols/systems/3g-324m_pvterminal/h223/include/cpvh223multiplex.h @@ -131,6 +131,19 @@ class CPVH223Multiplex : public LowerLayerObserver, TPVStatusCode CloseChannel(TPVDirection direction, TPVChannelId channel_id); PVMFStatus GetOutgoingChannel(TPVChannelId id, H223OutgoingChannelPtr& channel); PVMFStatus GetIncomingChannel(TPVChannelId id, H223IncomingChannelPtr& channel); + + /** + * Get pointer to logical channel + * + * @param aDirection Incoming/outgoing channel + * @param aChannelId Channel id of the wanted channel + * @param appChannel Pointer to logical channel pointer + * + * @returns PVMFStatus PVMFSuccess if succesful + **/ + PVMFStatus GetLogicalChannel(TPVDirection aDirection, + TPVChannelId aChannelId, + H223LogicalChannel** apChannel); TPVStatusCode StopChannel(TPVDirection /*direction*/, TPVChannelId /*channel_id*/); TPVStatusCode FlushChannel(TPVDirection /*direction*/, TPVChannelId /*channel_id*/); bool IsValid(TPVDirection /*direction*/, TPVChannelId /*channel_id*/) diff --git a/protocols/systems/3g-324m_pvterminal/h223/include/logicalchannel.h b/protocols/systems/3g-324m_pvterminal/h223/include/logicalchannel.h index 7bf83502e..4c0053b58 100644 --- a/protocols/systems/3g-324m_pvterminal/h223/include/logicalchannel.h +++ b/protocols/systems/3g-324m_pvterminal/h223/include/logicalchannel.h @@ -75,6 +75,10 @@ #include "pvmi_config_and_capability_utils.h" #endif +#ifndef OSCL_TIMER_H_INCLUDED +#include "oscl_timer.h" +#endif + #define INVALID_MUX_CODE 0xFF #define DEF_NUM_MEDIA_DATA 100 #define SKEW_CHECK_INTERVAL 2000 @@ -215,12 +219,6 @@ class H223LogicalChannel : public PvmfPortBaseImpl, // Set format specific information PVMFStatus SetFormatSpecificInfo(uint8* info, uint32 info_len); - void SetTimestampOffset(uint32 offset) - { - iIncomingSkew = offset; - } - void SetDatapathLatency(uint32 aLatency); - void SetClock(PVMFMediaClock* aClock) { iClock = aClock; @@ -448,7 +446,7 @@ class H223OutgoingControlChannel : public H223OutgoingChannel #define NUM_INCOMING_SDU_BUFFERS 8 /* For incoming (from the remote terminal) A/V/C */ -class H223IncomingChannel : public H223LogicalChannel +class H223IncomingChannel : public H223LogicalChannel, public OsclTimerObserver { public: H223IncomingChannel(TPVChannelId num, @@ -462,6 +460,9 @@ class H223IncomingChannel : public H223LogicalChannel ~H223IncomingChannel(); void Init(); + // from OsclTimerObserver + void TimeoutOccurred(int32 aTimerID, int32 aTimeoutInfo); + TPVDirection GetDirection() { return INCOMING; @@ -513,6 +514,9 @@ class H223IncomingChannel : public H223LogicalChannel // overload Connect to send out format specific info if available PVMFStatus Connect(PVMFPortInterface* aPort); + // H223LogicalChannel + void Pause(); + void Resume(); // Implement pure virtuals from PvmiCapabilityAndConfig interface OSCL_IMPORT_REF void setObserver(PvmiConfigAndCapabilityCmdObserver* aObserver); @@ -556,6 +560,7 @@ class H223IncomingChannel : public H223LogicalChannel /** * Add audio media data queue and smoothens timestamps * and send oldest audio frame to the output port + * If aMediaDataPtr is null queue is flushed * * @param aMediaDataPtr * @@ -563,7 +568,39 @@ class H223IncomingChannel : public H223LogicalChannel **/ PVMFStatus SendAudioFrame(PVMFSharedMediaDataPtr aMediaDataPtr); - void SetSampleTimestamps(PVMFTimestamp& aTSOffset); + /** + * Gets current time and puts it into timestamp (iCurTimestamp) + * + * @returns void + **/ + void UpdateCurrentTimestamp(); + + /** + * Dispatch media data to outgoing port if bos message is already sent. + * + * @param arMediaDataPtr media data + * + * @returns PVMFStatus PVMFSuccess if succesful + **/ + PVMFStatus DispatchMessage(PVMFSharedMediaDataPtr& arMediaDataPtr); + + /** + * Check if bos message is already sent. + * Tries to send bos message if sent. + * + * @returns bool true if bos was sent. + **/ + bool IsResumable(); + + /** + * Creates audio NO_DATA frame + * + * @param PVMFSharedMediaDataPtr media data pointer to NO_DATA frame + * + * @returns PVMFStatus PVMFSuccess if succesful + **/ + PVMFStatus CreateNoDataAudioFrame(PVMFSharedMediaDataPtr &arMediaDataPtr); + PVMFBufferPoolAllocator iMemFragmentAlloc; OsclMemPoolFixedChunkAllocator* iMediaMsgMemoryPool; PVMFMediaFragGroupCombinedAlloc<OsclMemAllocator>* iMediaFragGroupAlloc; @@ -590,7 +627,6 @@ class H223IncomingChannel : public H223LogicalChannel friend class TSC_324m; PVLogger* iIncomingAudioLogger; PVLogger* iIncomingVideoLogger; - int32 iRenderingSkew; uint32 iVideoFrameNum; uint32 iMax_Chunk_Size; PVMFSharedMediaDataPtr iVideoFrame; @@ -605,6 +641,12 @@ class H223IncomingChannel : public H223LogicalChannel // frame number for audio frame uint32 iAudioFrameNum; + + // timer to be used to detect missing audio frames + OsclTimer<OsclMemAllocator>* ipAudioDtxTimer; + + // bos message is needed when playing is started. + bool iBosMessageSent; }; class MuxSduData diff --git a/protocols/systems/3g-324m_pvterminal/h223/src/cpvh223multiplex.cpp b/protocols/systems/3g-324m_pvterminal/h223/src/cpvh223multiplex.cpp index a14379482..c2168f283 100644 --- a/protocols/systems/3g-324m_pvterminal/h223/src/cpvh223multiplex.cpp +++ b/protocols/systems/3g-324m_pvterminal/h223/src/cpvh223multiplex.cpp @@ -602,6 +602,50 @@ PVMFStatus CPVH223Multiplex::GetIncomingChannel(TPVChannelId id, H223IncomingCha return PVMFErrArgument; } +PVMFStatus CPVH223Multiplex::GetLogicalChannel(TPVDirection aDirection, + TPVChannelId aChannelId, + H223LogicalChannel** appChannel) +{ + *appChannel = NULL; + if (aDirection == OUTGOING) + { + H223OutgoingChannelPtr pOutgoingChannel; + if (GetOutgoingChannel(aChannelId, pOutgoingChannel) != PVMFSuccess) + { + PVLOGGER_LOGMSG(PVLOGMSG_INST_HLDBG, iLogger, PVLOGMSG_ERR, + (0, "CPVH223Multiplex::GetLogicalChannel - Error: id(%d)", aChannelId)); + return PVMFErrArgument; + } + *appChannel = OSCL_STATIC_CAST(H223LogicalChannel*, pOutgoingChannel); + } + else if (aDirection == INCOMING) + { + H223IncomingChannelPtr pIncomingChannel; + if (GetIncomingChannel(aChannelId, pIncomingChannel) != PVMFSuccess) + { + PVLOGGER_LOGMSG(PVLOGMSG_INST_HLDBG, iLogger, PVLOGMSG_ERR, + (0, "CPVH223Multiplex::GetLogicalChannel - Error: id(%d)", aChannelId)); + return PVMFErrArgument; + } + *appChannel = OSCL_STATIC_CAST(H223LogicalChannel*, pIncomingChannel); + } + else + { + PVLOGGER_LOGMSG(PVLOGMSG_INST_HLDBG, iLogger, PVLOGMSG_ERR, + (0, "CPVH223Multiplex::GetLogicalChannel - Error: direction")); + return PVMFErrArgument; + } + + if (*appChannel == NULL) + { + PVLOGGER_LOGMSG(PVLOGMSG_INST_HLDBG, iLogger, PVLOGMSG_ERR, + (0, "CPVH223Multiplex::GetLogicalChannel - Error: Null port")); + return PVMFErrArgument; + } + + return PVMFSuccess; +} + TPVStatusCode CPVH223Multiplex::GetAdaptationLayer(OsclSharedPtr<AdaptationLayer> &al, TPVDirection aDirection, PS_H223LogicalChannelParameters aH223lcnParams, diff --git a/protocols/systems/3g-324m_pvterminal/h223/src/logicalchannel.cpp b/protocols/systems/3g-324m_pvterminal/h223/src/logicalchannel.cpp index 48b8cf17a..30177e90c 100644 --- a/protocols/systems/3g-324m_pvterminal/h223/src/logicalchannel.cpp +++ b/protocols/systems/3g-324m_pvterminal/h223/src/logicalchannel.cpp @@ -79,6 +79,11 @@ static const uint16 AMR_FRAME_SIZE_MS = 20; // amr frame size in milliseconds static const uint16 AMR_JITTER = 80; // maximum jitter allocated in timestamps static const uint16 AMR_QUEUE_SIZE = 5; // number of frames used to smoothen timestamps static const uint16 AMR_SID_SIZE = 6; // amr SID_UPDATE frame size in bytes +static const uint16 AMR_SID_UPDATE = 8; // sid update should happen in every 8 frame (3GPP TS 26.093) +static const uint16 AMR_NODATA_SIZE = 1; // amr SID_UPDATE frame size in bytes +static const uint32 AMR_TIMER_FREQUENCY = AMR_FRAME_SIZE_MS * AMR_SID_UPDATE * 1000; // dtx timer frequency in microseconds +static const int32 AMR_TIMER_ID = 0; // dtx timer id +static const uint8 AMR_NO_DATA = 15; // NO_DATA frame type #ifdef LIP_SYNC_TESTING /***********************Outgoing side********************/ @@ -167,7 +172,7 @@ void H223LogicalChannel::Init() PVMFStatus H223LogicalChannel::SetFormatSpecificInfo(uint8* info, uint32 info_len) { - PVLOGGER_LOGMSG(PVLOGMSG_INST_HLDBG, iLogger, PVLOGMSG_STACK_TRACE, (0, "H223LogicalChannel::SetFormatSpecificInfo lcn=%d, info_len=%d, info=%x", lcn, info_len, info)); + PVLOGGER_LOGMSG(PVLOGMSG_INST_HLDBG, iLogger, PVLOGMSG_STACK_TRACE, (0, "H223LogicalChannel(%d)::SetFormatSpecificInfo info_len=%d, info=%x", lcn, info_len, info)); if (iFormatSpecificInfo) { oscl_free(iFormatSpecificInfo); @@ -188,7 +193,7 @@ const uint8* H223LogicalChannel::GetFormatSpecificInfo(uint32* info_len) { if (info_len == NULL) { - PVLOGGER_LOGMSG(PVLOGMSG_INST_HLDBG, iLogger, PVLOGMSG_STACK_TRACE, (0, "H223LogicalChannel::GetFormatSpecificInfo ERROR info_len==NULL")); + PVLOGGER_LOGMSG(PVLOGMSG_INST_HLDBG, iLogger, PVLOGMSG_STACK_TRACE, (0, "H223LogicalChannel(%d)::GetFormatSpecificInfo ERROR info_len==NULL", lcn)); return NULL; } *info_len = iFormatSpecificInfoLen; @@ -215,10 +220,17 @@ OSCL_EXPORT_REF void H223LogicalChannel::QueryInterface(const PVUuid& aUuid, Osc void H223LogicalChannel::Pause() { - PVLOGGER_LOGMSG(PVLOGMSG_INST_HLDBG, iLogger, PVLOGMSG_STACK_TRACE, (0, "H223OutgoingChannel::Pause lcn=%d", lcn)); + if (iPaused) + { + PVLOGGER_LOGMSG(PVLOGMSG_INST_HLDBG, iLogger, PVLOGMSG_STACK_TRACE, (0, "H223LogicalChannel(d%)::Pause - Already paused", lcn)); + return; + } + PVLOGGER_LOGMSG(PVLOGMSG_INST_HLDBG, iLogger, PVLOGMSG_STACK_TRACE, (0, "H223LogicalChannel(d%)::Pause", lcn)); + iPaused = true; // flush any pending media data Flush(); + } void H223LogicalChannel::Resume() @@ -245,8 +257,8 @@ H223OutgoingChannel::H223OutgoingChannel(TPVChannelId num, iOutgoingVideoLogger = PVLogger::GetLoggerObject("datapath.outgoing.video.h223.lcn"); iOutgoingAudioLogger = PVLogger::GetLoggerObject("datapath.outgoing.audio.h223.lcn"); - PVLOGGER_LOGMSG(PVLOGMSG_INST_HLDBG, iLogger, PVLOGMSG_STACK_TRACE, (0, "H223OutgoingChannel::H223OutgoingChannel - num(%d),segmentable(%d)", num, segmentable)); - PVLOGGER_LOGMSG(PVLOGMSG_INST_HLDBG, iLogger, PVLOGMSG_STACK_TRACE, (0, "H223OutgoingChannel::H223OutgoingChannel - AL SDU size(%d), hdr(%d), trlr(%d)", iAl->GetSduSize(), iAl->GetHdrSz(), iAl->GetTrlrSz())); + PVLOGGER_LOGMSG(PVLOGMSG_INST_HLDBG, iLogger, PVLOGMSG_STACK_TRACE, (0, "H223OutgoingChannel::H223OutgoingChannel(%d) - num(%d),segmentable(%d)", lcn , num, segmentable)); + PVLOGGER_LOGMSG(PVLOGMSG_INST_HLDBG, iLogger, PVLOGMSG_STACK_TRACE, (0, "H223OutgoingChannel::H223OutgoingChannel(%d) - AL SDU size(%d), hdr(%d), trlr(%d)", lcn , iAl->GetSduSize(), iAl->GetHdrSz(), iAl->GetTrlrSz())); ResetStats(); lastMediaData = NULL; @@ -323,16 +335,16 @@ void H223OutgoingChannel::BufferMedia(uint16 aMs) { if (iBufferSizeMs && aMs > iBufferSizeMs) { - PVLOGGER_LOGMSG(PVLOGMSG_INST_HLDBG, iLogger, PVLOGMSG_STACK_TRACE, (0, "H223OutgoingChannel::BufferMedia ERROR buffer interval=%d > buffer size=%d", aMs, iBufferSizeMs)); + PVLOGGER_LOGMSG(PVLOGMSG_INST_HLDBG, iLogger, PVLOGMSG_STACK_TRACE, (0, "H223OutgoingChannel(%d)::BufferMedia ERROR buffer interval=%d > buffer size=%d", lcn , aMs, iBufferSizeMs)); } iSetBufferMediaMs = iBufferMediaMs = aMs; iSetBufferMediaBytes = iBufferMediaBytes = ((iBufferSizeMs * iBitrate + 4000) / 8000); - //PVLOGGER_LOGMSG(PVLOGMSG_INST_HLDBG, iLogger, PVLOGMSG_STACK_TRACE, (0,"H223OutgoingChannel::BufferMedia ms=%d,bytes=%d", iBufferMediaMs,iBufferMediaBytes)); + //PVLOGGER_LOGMSG(PVLOGMSG_INST_HLDBG, iLogger, PVLOGMSG_STACK_TRACE, (0,"H223OutgoingChannel(%d)::BufferMedia ms=%d,bytes=%d",lcn, iBufferMediaMs,iBufferMediaBytes)); } void H223OutgoingChannel::Resume() { - PVLOGGER_LOGMSG(PVLOGMSG_INST_HLDBG, iLogger, PVLOGMSG_STACK_TRACE, (0, "H223OutgoingChannel::Resume lcn=%d", lcn)); + PVLOGGER_LOGMSG(PVLOGMSG_INST_HLDBG, iLogger, PVLOGMSG_STACK_TRACE, (0, "H223OutgoingChannel(%d)::Resume", lcn)); H223LogicalChannel::Resume(); iPaused = false; // start muxing on a random access point @@ -341,7 +353,7 @@ void H223OutgoingChannel::Resume() void H223OutgoingChannel::SetBufferSizeMs(uint32 buffer_size_ms) { - PVLOGGER_LOGMSG(PVLOGMSG_INST_HLDBG, iLogger, PVLOGMSG_STACK_TRACE, (0, "H223OutgoingLogicalChannel::SetBufferSizeMs buffer_size_ms=%d", buffer_size_ms)); + PVLOGGER_LOGMSG(PVLOGMSG_INST_HLDBG, iLogger, PVLOGMSG_STACK_TRACE, (0, "H223OutgoingLogicalChannel(%d)::SetBufferSizeMs buffer_size_ms=%d", lcn, buffer_size_ms)); iBufferSizeMs = buffer_size_ms; } @@ -366,22 +378,17 @@ PVMFStatus H223OutgoingChannel::PutData(PVMFSharedMediaMsgPtr media_msg) TimeValue timenow; if (iMediaType.isCompressed() && iMediaType.isAudio()) { - PVMF_OUTGOING_AUDIO_LOGDATATRAFFIC((0, "Outgoing audio frames received. Stats: Entry time=%ud, lcn=%d, size=%d", timenow.to_msec(), lcn, mediaData->getFilledSize())); + PVMF_OUTGOING_AUDIO_LOGDATATRAFFIC((0, "Outgoing audio frames received. Stats: Entry time=%u, ts=%u, lcn=%d, size=%d", timenow.to_msec(), mediaData->getTimestamp(), lcn, mediaData->getFilledSize())); } else if (iMediaType.isCompressed() && iMediaType.isVideo()) { - PVMF_OUTGOING_VIDEO_LOGDATATRAFFIC((0, "Outgoing video frames received.Stats: Entry time=%ud, lcn=%d, size=%d", timenow.to_msec(), lcn, mediaData->getFilledSize())); - } - - if (iNumPacketsIn % 20 == 0) - { - PVLOGGER_LOGMSG(PVLOGMSG_INST_HLDBG, iLogger, PVLOGMSG_STACK_TRACE, (0, "H223OutgoingChannel::PutData lcn=%d, size=%d, ts=%d", lcn, mediaData->getFilledSize(), mediaData->getTimestamp())); + PVMF_OUTGOING_VIDEO_LOGDATATRAFFIC((0, "Outgoing video frames received.Stats: Entry time=%u, ts=%u, lcn=%d, size=%d", timenow.to_msec(), mediaData->getTimestamp(), lcn, mediaData->getFilledSize())); } // Check for FSI so that it can be send with data if (mediaData->getFormatSpecificInfo(iFsiFrag) && iFsiFrag.getMemFragPtr() && iFsiFrag.getMemFragSize()) { - PVLOGGER_LOGMSG(PVLOGMSG_INST_HLDBG, iLogger, PVLOGMSG_STACK_TRACE, (0, "H223OutgoingChannel::PutData Received Format Specific Info, len=%d", iFsiFrag.getMemFragSize())); + PVLOGGER_LOGMSG(PVLOGMSG_INST_HLDBG, iLogger, PVLOGMSG_STACK_TRACE, (0, "H223OutgoingChannel(%d)::PutData Received Format Specific Info, len=%d", lcn, iFsiFrag.getMemFragSize())); PVLOGGER_LOG_USE_ONLY( TestFsi(iFsiFrag); @@ -392,15 +399,15 @@ PVMFStatus H223OutgoingChannel::PutData(PVMFSharedMediaMsgPtr media_msg) { if ((mediaData->getMarkerInfo()&PVMF_MEDIA_DATA_MARKER_INFO_RANDOM_ACCESS_POINT_BIT) == 0) { - PVLOGGER_LOGMSG(PVLOGMSG_INST_HLDBG, iLogger, PVLOGMSG_STACK_TRACE, (0, "H223OutgoingChannel::PutData Not random access point. Dropping media data.")); + PVLOGGER_LOGMSG(PVLOGMSG_INST_HLDBG, iLogger, PVLOGMSG_STACK_TRACE, (0, "H223OutgoingChannel(%d)::PutData Not random access point. Dropping media data.", lcn)); return PVMFErrInvalidState; } - PVLOGGER_LOGMSG(PVLOGMSG_INST_HLDBG, iLogger, PVLOGMSG_STACK_TRACE, (0, "H223OutgoingChannel::PutData Found random access point.")); + PVLOGGER_LOGMSG(PVLOGMSG_INST_HLDBG, iLogger, PVLOGMSG_STACK_TRACE, (0, "H223OutgoingChannel(%d)::PutData Found random access point.", lcn)); iWaitForRandomAccessPoint = false; } else if (iNumPendingPdus == (iNumMediaData - 1)) { - PVLOGGER_LOGMSG(PVLOGMSG_INST_HLDBG, iLogger, PVLOGMSG_STACK_TRACE, (0, "H223OutgoingChannel::PutData - ERROR Overflow, iNumPendingPdus=%u", iNumPendingPdus)); + PVLOGGER_LOGMSG(PVLOGMSG_INST_HLDBG, iLogger, PVLOGMSG_STACK_TRACE, (0, "H223OutgoingChannel(%d)::PutData - ERROR Overflow, iNumPendingPdus=%u", lcn, iNumPendingPdus)); return PVMFErrOverflow; } @@ -418,7 +425,7 @@ PVMFStatus H223OutgoingChannel::PutData(PVMFSharedMediaMsgPtr media_msg) if ((mediaData->getNumFragments() + num_frags_required + iNumPendingPdus) >= (iNumMediaData - 1)) { - PVLOGGER_LOGMSG(PVLOGMSG_INST_HLDBG, iLogger, PVLOGMSG_STACK_TRACE, (0, "H223OutgoingChannel::PutData - ERROR Overflow, iNumPendingPdus=%u, num_frags_required=%d,iNumMediaData=%d", iNumPendingPdus, num_frags_required, iNumMediaData)); + PVLOGGER_LOGMSG(PVLOGMSG_INST_HLDBG, iLogger, PVLOGMSG_STACK_TRACE, (0, "H223OutgoingChannel(%d)::PutData - ERROR Overflow, iNumPendingPdus=%u, num_frags_required=%d,iNumMediaData=%d", lcn, iNumPendingPdus, num_frags_required, iNumMediaData)); Flush(); /* Start re-buffering */ BufferMedia((uint16)iSetBufferMediaMs); @@ -431,7 +438,7 @@ PVMFStatus H223OutgoingChannel::PutData(PVMFSharedMediaMsgPtr media_msg) { if (true != FragmentPacket(mediaData, fragmentedMediaData)) { - PVLOGGER_LOGMSG(PVLOGMSG_INST_HLDBG, iLogger, PVLOGMSG_STACK_TRACE, (0, "H223OutgoingChannel::PutData - Memory allocation failure on Fragment\n")); + PVLOGGER_LOGMSG(PVLOGMSG_INST_HLDBG, iLogger, PVLOGMSG_STACK_TRACE, (0, "H223OutgoingChannel(%d)::PutData - Memory allocation failure on Fragment\n", lcn)); return PVMFErrOverflow; } } @@ -445,7 +452,7 @@ PVMFStatus H223OutgoingChannel::PutData(PVMFSharedMediaMsgPtr media_msg) { if (PVMFSuccess != CompletePdu()) { - PVLOGGER_LOGMSG(PVLOGMSG_INST_HLDBG, iLogger, PVLOGMSG_STACK_TRACE, (0, "H223OutgoingChannel::PutData - Memory allocation failure on CompletePdu\n")); + PVLOGGER_LOGMSG(PVLOGMSG_INST_HLDBG, iLogger, PVLOGMSG_STACK_TRACE, (0, "H223OutgoingChannel(%d)::PutData - Memory allocation failure on CompletePdu\n", lcn)); return PVMFErrOverflow; } if (iMediaType.isCompressed() && iMediaType.isAudio()) @@ -461,12 +468,12 @@ PVMFStatus H223OutgoingChannel::PutData(PVMFSharedMediaMsgPtr media_msg) } if (sdu_size == 0) { - //PVLOGGER_LOGMSG(PVLOGMSG_INST_HLDBG, iLogger, PVLOGMSG_STACK_TRACE, (0,"H223OutgoingChannel::PutData Sdu size == 0")); + //PVLOGGER_LOGMSG(PVLOGMSG_INST_HLDBG, iLogger, PVLOGMSG_STACK_TRACE, (0,"H223OutgoingChannel(%d)::PutData Sdu size == 0", lcn)); iCurPdu = StartAlPdu(); if (!iCurPdu) { PVLOGGER_LOGMSG(PVLOGMSG_INST_HLDBG, iLogger, PVLOGMSG_STACK_TRACE, - (0, "H223OutgoingChannel::PutData - Memory allocation failure on StartAlPdu\n")); + (0, "H223OutgoingChannel(%d)::PutData - Memory allocation failure on StartAlPdu\n", lcn)); return PVMFErrOverflow; } @@ -490,7 +497,7 @@ PVMFStatus H223OutgoingChannel::PutData(PVMFSharedMediaMsgPtr media_msg) { if (PVMFSuccess != CompletePdu()) { - PVLOGGER_LOGMSG(PVLOGMSG_INST_HLDBG, iLogger, PVLOGMSG_STACK_TRACE, (0, "H223OutgoingChannel::PutData - Memory allocation failure on CompletePdu\n")); + PVLOGGER_LOGMSG(PVLOGMSG_INST_HLDBG, iLogger, PVLOGMSG_STACK_TRACE, (0, "H223OutgoingChannel(%d)::PutData - Memory allocation failure on CompletePdu\n", lcn)); return PVMFErrOverflow; } if (iMediaType.isCompressed() && iMediaType.isAudio()) @@ -508,7 +515,7 @@ PVMFStatus H223OutgoingChannel::PutData(PVMFSharedMediaMsgPtr media_msg) if (!iCurPdu) { PVLOGGER_LOGMSG(PVLOGMSG_INST_HLDBG, iLogger, PVLOGMSG_STACK_TRACE, - (0, "H223OutgoingChannel::PutData - Memory allocation failure on StartAlPdu\n")); + (0, "H223OutgoingChannel(%d)::PutData - Memory allocation failure on StartAlPdu\n", lcn)); return PVMFErrOverflow; } } @@ -606,7 +613,7 @@ PVMFStatus H223OutgoingChannel::CompletePdu() PVMFStatus status = iAl->CompletePacket(iCurPdu); if (status != PVMFSuccess) { - PVLOGGER_LOGMSG(PVLOGMSG_INST_HLDBG, iLogger, PVLOGMSG_STACK_TRACE, (0, "H223OutgoingChannel::CompletePdu Memory allocation failedlcn=%d, CompletePacket status=%d", lcn, status)); + PVLOGGER_LOGMSG(PVLOGMSG_INST_HLDBG, iLogger, PVLOGMSG_STACK_TRACE, (0, "H223OutgoingChannel(%d)::CompletePdu Memory allocation failed, CompletePacket status=%d", lcn, status)); return status; } @@ -639,9 +646,6 @@ PVMFStatus H223OutgoingChannel::AppendOutgoingPkt(OsclSharedPtr<PVMFMediaDataImp return PVMFErrNoMemory; } - OsclRefCounterMemFrag frag; - mediaData->getFormatSpecificInfo(frag); - mediaData->setTimestamp(timestamp); if (fsi) { @@ -670,7 +674,7 @@ PVMFStatus H223OutgoingChannel::AppendOutgoingPkt(OsclSharedPtr<PVMFMediaDataImp /* Adjust buffering parameters */ if (iBufferMediaMs) { - PVLOGGER_LOGMSG(PVLOGMSG_INST_HLDBG, iLogger, PVLOGMSG_STACK_TRACE, (0, "H223OutgoingChannel::AppendOutgoingPkt lcn=%d, last ts=%d,cur ts=%d", lcn, lastTS, timestamp)); + PVLOGGER_LOGMSG(PVLOGMSG_INST_HLDBG, iLogger, PVLOGMSG_STACK_TRACE, (0, "H223OutgoingChannel(%d)::AppendOutgoingPkt last ts=%d,cur ts=%d", lcn, lastTS, timestamp)); /* Compute delta_t from last media data */ int32 delta_t = timestamp - lastTS; if (delta_t < 0) @@ -700,14 +704,14 @@ bool H223OutgoingChannel::GetNextPacket(PVMFSharedMediaDataPtr& aMediaData, PVMF } if ((aStatus == PVMFSuccess) && iPaused) { - PVLOGGER_LOGMSG(PVLOGMSG_INST_HLDBG, iLogger, PVLOGMSG_STACK_TRACE, (0, "H223OutgoingChannel::GetNextPacket Logical channel %d paused.", lcn)); + PVLOGGER_LOGMSG(PVLOGMSG_INST_HLDBG, iLogger, PVLOGMSG_STACK_TRACE, (0, "H223OutgoingChannel(%d)::GetNextPacket Logical channel paused.", lcn)); return false; } if ((aStatus == PVMFSuccess) && iBufferMediaMs && iBufferMediaBytes) { /* Still buffering */ - PVLOGGER_LOGMSG(PVLOGMSG_INST_HLDBG, iLogger, PVLOGMSG_STACK_TRACE, (0, "H223OutgoingChannel::GetNextPacket Buffering lcn=%d, ms left=%d", lcn, iBufferMediaMs)); + PVLOGGER_LOGMSG(PVLOGMSG_INST_HLDBG, iLogger, PVLOGMSG_STACK_TRACE, (0, "H223OutgoingChannel(%d)::GetNextPacket Buffering ms left=%d", lcn, iBufferMediaMs)); return false; } @@ -743,7 +747,7 @@ OsclAny H223OutgoingChannel::ReleasePacket(PVMFSharedMediaDataPtr& aMediaData) OsclAny H223OutgoingChannel::Flush() { - //PVLOGGER_LOGMSG(PVLOGMSG_INST_HLDBG, iLogger, PVLOGMSG_STACK_TRACE, (0,"H223OutgoingChannel::Flush\n")); + //PVLOGGER_LOGMSG(PVLOGMSG_INST_HLDBG, iLogger, PVLOGMSG_STACK_TRACE, (0,"H223OutgoingChannel(%d)::Flush\n", lcn)); PVMFSharedMediaDataPtr aMediaData; @@ -798,11 +802,11 @@ OsclAny H223OutgoingChannel::LogStats() OSCL_EXPORT_REF PVMFStatus H223OutgoingChannel::Connect(PVMFPortInterface* aPort) { - PVLOGGER_LOGMSG(PVLOGMSG_INST_HLDBG, iLogger, PVLOGMSG_STACK_TRACE, (0, "H223OutgoingChannel::Connect, aPort=%x", aPort)); + PVLOGGER_LOGMSG(PVLOGMSG_INST_HLDBG, iLogger, PVLOGMSG_STACK_TRACE, (0, "H223OutgoingChannel(%d)::Connect, aPort=%x", lcn, aPort)); if (iConnectedPort) { - PVLOGGER_LOGMSG(PVLOGMSG_INST_HLDBG, iLogger, PVLOGMSG_STACK_TRACE, (0, "H223OutgoingChannel::Connect Error: Already connected")); + PVLOGGER_LOGMSG(PVLOGMSG_INST_HLDBG, iLogger, PVLOGMSG_STACK_TRACE, (0, "H223OutgoingChannel(%d)::Connect Error: Already connected", lcn)); return PVMFFailure; } @@ -813,7 +817,7 @@ OSCL_EXPORT_REF PVMFStatus H223OutgoingChannel::Connect(PVMFPortInterface* aPort config = OSCL_STATIC_CAST(PvmiCapabilityAndConfig*, tempInterface); if (!config) { - PVLOGGER_LOGMSG(PVLOGMSG_INST_HLDBG, iLogger, PVLOGMSG_STACK_TRACE, (0, "H223OutgoingChannel::Connect: Error - Peer port does not support capability interface")); + PVLOGGER_LOGMSG(PVLOGMSG_INST_HLDBG, iLogger, PVLOGMSG_STACK_TRACE, (0, "H223OutgoingChannel(%d)::Connect: Error - Peer port does not support capability interface", lcn)); return PVMFFailure; } @@ -821,14 +825,14 @@ OSCL_EXPORT_REF PVMFStatus H223OutgoingChannel::Connect(PVMFPortInterface* aPort if (status != PVMFSuccess) { - PVLOGGER_LOGMSG(PVLOGMSG_INST_HLDBG, iLogger, PVLOGMSG_STACK_TRACE, (0, "H223OutgoingChannel::Connect: Error - Settings negotiation failed. status=%d", status)); + PVLOGGER_LOGMSG(PVLOGMSG_INST_HLDBG, iLogger, PVLOGMSG_STACK_TRACE, (0, "H223OutgoingChannel(%d)::Connect: Error - Settings negotiation failed. status=%d", lcn, status)); return status; } //Automatically connect the peer. if ((status = aPort->PeerConnect(this)) != PVMFSuccess) { - PVLOGGER_LOGMSG(PVLOGMSG_INST_HLDBG, iLogger, PVLOGMSG_STACK_TRACE, (0, "H223OutgoingChannel::Connect: Error - Peer Connect failed. status=%d", status)); + PVLOGGER_LOGMSG(PVLOGMSG_INST_HLDBG, iLogger, PVLOGMSG_STACK_TRACE, (0, "H223OutgoingChannel(%d)::Connect: Error - Peer Connect failed. status=%d", lcn, status)); return status; } @@ -840,15 +844,15 @@ OSCL_EXPORT_REF PVMFStatus H223OutgoingChannel::Connect(PVMFPortInterface* aPort OSCL_EXPORT_REF PVMFStatus H223OutgoingChannel::PeerConnect(PVMFPortInterface* aPort) { - PVLOGGER_LOGMSG(PVLOGMSG_INST_HLDBG, iLogger, PVLOGMSG_STACK_TRACE, (0, "H223OutgoingChannel::PeerConnect aPort=0x%x", this, aPort)); + PVLOGGER_LOGMSG(PVLOGMSG_INST_HLDBG, iLogger, PVLOGMSG_STACK_TRACE, (0, "H223OutgoingChannel(%d)::PeerConnect aPort=0x%x", lcn, this, aPort)); if (!aPort) { - PVLOGGER_LOGMSG(PVLOGMSG_INST_HLDBG, iLogger, PVLOGMSG_ERR, (0, "0x%x H223OutgoingChannel::PeerConnect: Error - Connecting to invalid port", this)); + PVLOGGER_LOGMSG(PVLOGMSG_INST_HLDBG, iLogger, PVLOGMSG_ERR, (0, "0x%x H223OutgoingChannel(%d)::PeerConnect: Error - Connecting to invalid port", lcn, this)); return PVMFErrArgument; } if (iConnectedPort) { - PVLOGGER_LOGMSG(PVLOGMSG_INST_HLDBG, iLogger, PVLOGMSG_ERR, (0, "0x%x H223OutgoingChannel::PeerConnect: Error - Already connected", this)); + PVLOGGER_LOGMSG(PVLOGMSG_INST_HLDBG, iLogger, PVLOGMSG_ERR, (0, "0x%x H223OutgoingChannel(%d)::PeerConnect: Error - Already connected", lcn, this)); return PVMFFailure; } @@ -856,7 +860,7 @@ OSCL_EXPORT_REF PVMFStatus H223OutgoingChannel::PeerConnect(PVMFPortInterface* a aPort->QueryInterface(PVMI_CAPABILITY_AND_CONFIG_PVUUID, config); if (!config) { - PVLOGGER_LOGMSG(PVLOGMSG_INST_HLDBG, iLogger, PVLOGMSG_ERR, (0, "H223OutgoingChannel::PeerConnect: Error - Peer port does not support capability interface")); + PVLOGGER_LOGMSG(PVLOGMSG_INST_HLDBG, iLogger, PVLOGMSG_ERR, (0, "H223OutgoingChannel(%d)::PeerConnect: Error - Peer port does not support capability interface", lcn)); return PVMFFailure; } @@ -867,7 +871,7 @@ OSCL_EXPORT_REF PVMFStatus H223OutgoingChannel::PeerConnect(PVMFPortInterface* a if (status != PVMFSuccess) { - PVLOGGER_LOGMSG(PVLOGMSG_INST_HLDBG, iLogger, PVLOGMSG_ERR, (0, "H223OutgoingChannel::PeerConnect: Error - Settings negotiation failed. status=%d", status)); + PVLOGGER_LOGMSG(PVLOGMSG_INST_HLDBG, iLogger, PVLOGMSG_ERR, (0, "H223OutgoingChannel(%d)::PeerConnect: Error - Settings negotiation failed. status=%d", lcn, status)); // Ignore errors for now status = PVMFSuccess; } @@ -881,7 +885,7 @@ OSCL_EXPORT_REF PVMFStatus H223OutgoingChannel::PeerConnect(PVMFPortInterface* a PVMFStatus H223OutgoingChannel::NegotiateInputSettings(PvmiCapabilityAndConfig* aConfig) { - PVLOGGER_LOGMSG(PVLOGMSG_INST_HLDBG, iLogger, PVLOGMSG_STACK_TRACE, (0, "H223OutgoingChannel::NegotiateInputSettings, aConfig=%x", aConfig)); + PVLOGGER_LOGMSG(PVLOGMSG_INST_HLDBG, iLogger, PVLOGMSG_STACK_TRACE, (0, "H223OutgoingChannel(%d)::NegotiateInputSettings, aConfig=%x", lcn, aConfig)); PvmiKvp* kvp = NULL; int numParams = 0; @@ -893,7 +897,7 @@ PVMFStatus H223OutgoingChannel::NegotiateInputSettings(PvmiCapabilityAndConfig* kvp, numParams, NULL); if (status != PVMFSuccess || numParams == 0) { - PVLOGGER_LOGMSG(PVLOGMSG_INST_HLDBG, iLogger, PVLOGMSG_ERR, (0, "H223OutgoingChannel::NegotiateInputSettings, Error: getParametersSync failed. status=%d", status)); + PVLOGGER_LOGMSG(PVLOGMSG_INST_HLDBG, iLogger, PVLOGMSG_ERR, (0, "H223OutgoingChannel(%d)::NegotiateInputSettings, Error: getParametersSync failed. status=%d", lcn, status)); return status; } @@ -909,7 +913,7 @@ PVMFStatus H223OutgoingChannel::NegotiateInputSettings(PvmiCapabilityAndConfig* if (!selectedKvp) { - PVLOGGER_LOGMSG(PVLOGMSG_INST_HLDBG, iLogger, PVLOGMSG_ERR, (0, "H223OutgoingChannel::NegotiateInputSettings, Error: Input format not supported by peer")); + PVLOGGER_LOGMSG(PVLOGMSG_INST_HLDBG, iLogger, PVLOGMSG_ERR, (0, "H223OutgoingChannel(%d)::NegotiateInputSettings, Error: Input format not supported by peer", lcn)); return PVMFFailure; } if (PVMFSuccess != setConfigParametersSync(selectedKvp, aConfig)) @@ -939,7 +943,7 @@ OSCL_EXPORT_REF PVMFStatus H223OutgoingChannel::getParametersSync(PvmiMIOSession int& num_parameter_elements, PvmiCapabilityContext context) { - PVLOGGER_LOGMSG(PVLOGMSG_INST_HLDBG, iLogger, PVLOGMSG_STACK_TRACE, (0, "H223OutgoingChannel::getParametersSync")); + PVLOGGER_LOGMSG(PVLOGMSG_INST_HLDBG, iLogger, PVLOGMSG_STACK_TRACE, (0, "H223OutgoingChannel(%d)::getParametersSync", lcn)); OSCL_UNUSED_ARG(session); OSCL_UNUSED_ARG(context); @@ -954,7 +958,7 @@ OSCL_EXPORT_REF PVMFStatus H223OutgoingChannel::getParametersSync(PvmiMIOSession num_parameter_elements); if (status != PVMFSuccess) { - PVLOGGER_LOGMSG(PVLOGMSG_INST_HLDBG, iLogger, PVLOGMSG_WARNING, (0, "H223OutgoingChannel::getParametersSync: Error - AllocateKvp failed. status=%d", status)); + PVLOGGER_LOGMSG(PVLOGMSG_INST_HLDBG, iLogger, PVLOGMSG_WARNING, (0, "H223OutgoingChannel(%d)::getParametersSync: Error - AllocateKvp failed. status=%d", lcn, status)); return status; } PVCodecType_t codec_type = GetCodecType(iDataType); @@ -1038,7 +1042,7 @@ OSCL_EXPORT_REF void H223OutgoingChannel::setParametersSync(PvmiMIOSession sessi status = VerifyAndSetParameter(&(parameters[i]), true); if (status != PVMFSuccess) { - PVLOGGER_LOGMSG(PVLOGMSG_INST_HLDBG, iLogger, PVLOGMSG_WARNING, (0, "H223OutgoingChannel::setParametersSync: Error - VerifiyAndSetParameter failed on parameter #%d", i)); + PVLOGGER_LOGMSG(PVLOGMSG_INST_HLDBG, iLogger, PVLOGMSG_WARNING, (0, "H223OutgoingChannel(%d)::setParametersSync: Error - VerifiyAndSetParameter failed on parameter #%d", lcn, i)); ret_kvp = &(parameters[i]); OSCL_LEAVE(OsclErrArgument); } @@ -1048,17 +1052,17 @@ OSCL_EXPORT_REF void H223OutgoingChannel::setParametersSync(PvmiMIOSession sessi PVMFStatus H223OutgoingChannel::VerifyAndSetParameter(PvmiKvp* aKvp, bool aSetParam) { OSCL_UNUSED_ARG(aSetParam); - PVLOGGER_LOGMSG(PVLOGMSG_INST_HLDBG, iLogger, PVLOGMSG_WARNING, (0, "H223OutgoingChannel::VerifyAndSetParameter: aKvp=0x%x, aSetParam=%d", aKvp, aSetParam)); + PVLOGGER_LOGMSG(PVLOGMSG_INST_HLDBG, iLogger, PVLOGMSG_WARNING, (0, "H223OutgoingChannel(%d)::VerifyAndSetParameter: aKvp=0x%x, aSetParam=%d", lcn, aKvp, aSetParam)); if (!aKvp) { - PVLOGGER_LOGMSG(PVLOGMSG_INST_HLDBG, iLogger, PVLOGMSG_WARNING, (0, "H223OutgoingChannel::VerifyAndSetParameter: Error - Invalid key-value pair")); + PVLOGGER_LOGMSG(PVLOGMSG_INST_HLDBG, iLogger, PVLOGMSG_WARNING, (0, "H223OutgoingChannel(%d)::VerifyAndSetParameter: Error - Invalid key-value pair", lcn)); return PVMFFailure; } if (iDataType == NULL) { - PVLOGGER_LOGMSG(PVLOGMSG_INST_HLDBG, iLogger, PVLOGMSG_WARNING, (0, "H223OutgoingChannel::VerifyAndSetParameter: Error - DataType == NULL")); + PVLOGGER_LOGMSG(PVLOGMSG_INST_HLDBG, iLogger, PVLOGMSG_WARNING, (0, "H223OutgoingChannel(%d)::VerifyAndSetParameter: Error - DataType == NULL", lcn)); return PVMFErrNotSupported; } @@ -1068,7 +1072,7 @@ PVMFStatus H223OutgoingChannel::VerifyAndSetParameter(PvmiKvp* aKvp, bool aSetPa PVMFFormatType lcn_format_type = PVCodecTypeToPVMFFormatType(codec_type); if (pv_mime_strcmp(lcn_format_type.getMIMEStrPtr(), aKvp->value.pChar_value) != 0) { - PVLOGGER_LOGMSG(PVLOGMSG_INST_HLDBG, iLogger, PVLOGMSG_WARNING, (0, "H223OutgoingChannel::VerifyAndSetParameter: Error - Input format %s not supported", aKvp->value.pChar_value)); + PVLOGGER_LOGMSG(PVLOGMSG_INST_HLDBG, iLogger, PVLOGMSG_WARNING, (0, "H223OutgoingChannel(%d)::VerifyAndSetParameter: Error - Input format %s not supported", lcn, aKvp->value.pChar_value)); return PVMFErrNotSupported; } } @@ -1112,42 +1116,42 @@ OSCL_EXPORT_REF PVMFStatus H223OutgoingChannel::verifyParametersSync(PvmiMIOSess void H223OutgoingChannel::HandlePortActivity(const PVMFPortActivity &aActivity) { - PVLOGGER_LOGMSG(PVLOGMSG_INST_HLDBG, iLogger, PVLOGMSG_STACK_TRACE, (0, "H223OutgoingChannel::HandlePortActivity(%d) lcn(%d)", aActivity.iType, lcn)); + PVLOGGER_LOGMSG(PVLOGMSG_INST_HLDBG, iLogger, PVLOGMSG_STACK_TRACE, (0, "H223OutgoingChannel(%d)::HandlePortActivity(%d)", lcn, aActivity.iType)); switch (aActivity.iType) { case PVMF_PORT_ACTIVITY_CREATED: - PVLOGGER_LOGMSG(PVLOGMSG_INST_HLDBG, iLogger, PVLOGMSG_DEBUG, (0, "H223OutgoingChannel::HandlePortActivity created")); + PVLOGGER_LOGMSG(PVLOGMSG_INST_HLDBG, iLogger, PVLOGMSG_DEBUG, (0, "H223OutgoingChannel(%d)::HandlePortActivity created", lcn)); return; case PVMF_PORT_ACTIVITY_DELETED: - PVLOGGER_LOGMSG(PVLOGMSG_INST_HLDBG, iLogger, PVLOGMSG_DEBUG, (0, "H223OutgoingChannel::HandlePortActivity deleted")); + PVLOGGER_LOGMSG(PVLOGMSG_INST_HLDBG, iLogger, PVLOGMSG_DEBUG, (0, "H223OutgoingChannel(%d)::HandlePortActivity deleted", lcn)); return; case PVMF_PORT_ACTIVITY_CONNECT: - PVLOGGER_LOGMSG(PVLOGMSG_INST_HLDBG, iLogger, PVLOGMSG_DEBUG, (0, "H223OutgoingChannel::HandlePortActivity connect")); + PVLOGGER_LOGMSG(PVLOGMSG_INST_HLDBG, iLogger, PVLOGMSG_DEBUG, (0, "H223OutgoingChannel(%d)::HandlePortActivity connect", lcn)); return; case PVMF_PORT_ACTIVITY_DISCONNECT: - PVLOGGER_LOGMSG(PVLOGMSG_INST_HLDBG, iLogger, PVLOGMSG_DEBUG, (0, "H223OutgoingChannel::HandlePortActivity disconnect")); + PVLOGGER_LOGMSG(PVLOGMSG_INST_HLDBG, iLogger, PVLOGMSG_DEBUG, (0, "H223OutgoingChannel(%d)::HandlePortActivity disconnect", lcn)); return; case PVMF_PORT_ACTIVITY_OUTGOING_MSG: - PVLOGGER_LOGMSG(PVLOGMSG_INST_HLDBG, iLogger, PVLOGMSG_DEBUG, (0, "H223OutgoingChannel::HandlePortActivity outgoing msg")); + PVLOGGER_LOGMSG(PVLOGMSG_INST_HLDBG, iLogger, PVLOGMSG_DEBUG, (0, "H223OutgoingChannel(%d)::HandlePortActivity outgoing msg", lcn)); return; case PVMF_PORT_ACTIVITY_INCOMING_MSG: - PVLOGGER_LOGMSG(PVLOGMSG_INST_HLDBG, iLogger, PVLOGMSG_DEBUG, (0, "H223OutgoingChannel::HandlePortActivity incoming msg")); + PVLOGGER_LOGMSG(PVLOGMSG_INST_HLDBG, iLogger, PVLOGMSG_DEBUG, (0, "H223OutgoingChannel(%d)::HandlePortActivity incoming msg", lcn)); break; case PVMF_PORT_ACTIVITY_OUTGOING_QUEUE_BUSY: - PVLOGGER_LOGMSG(PVLOGMSG_INST_HLDBG, iLogger, PVLOGMSG_DEBUG, (0, "H223OutgoingChannel::HandlePortActivity outgoing queue busy")); + PVLOGGER_LOGMSG(PVLOGMSG_INST_HLDBG, iLogger, PVLOGMSG_DEBUG, (0, "H223OutgoingChannel(%d)::HandlePortActivity outgoing queue busy", lcn)); return; case PVMF_PORT_ACTIVITY_OUTGOING_QUEUE_READY: - PVLOGGER_LOGMSG(PVLOGMSG_INST_HLDBG, iLogger, PVLOGMSG_DEBUG, (0, "H223OutgoingChannel::HandlePortActivity outgoing queue ready")); + PVLOGGER_LOGMSG(PVLOGMSG_INST_HLDBG, iLogger, PVLOGMSG_DEBUG, (0, "H223OutgoingChannel(%d)::HandlePortActivity outgoing queue ready", lcn)); return; case PVMF_PORT_ACTIVITY_CONNECTED_PORT_BUSY: - PVLOGGER_LOGMSG(PVLOGMSG_INST_HLDBG, iLogger, PVLOGMSG_DEBUG, (0, "H223OutgoingChannel::HandlePortActivity connected port busy")); + PVLOGGER_LOGMSG(PVLOGMSG_INST_HLDBG, iLogger, PVLOGMSG_DEBUG, (0, "H223OutgoingChannel(%d)::HandlePortActivity connected port busy", lcn)); return; case PVMF_PORT_ACTIVITY_CONNECTED_PORT_READY: - PVLOGGER_LOGMSG(PVLOGMSG_INST_HLDBG, iLogger, PVLOGMSG_DEBUG, (0, "H223OutgoingChannel::HandlePortActivity connected port ready")); + PVLOGGER_LOGMSG(PVLOGMSG_INST_HLDBG, iLogger, PVLOGMSG_DEBUG, (0, "H223OutgoingChannel(%d)::HandlePortActivity connected port ready", lcn)); break; case PVMF_PORT_ACTIVITY_ERROR: - PVLOGGER_LOGMSG(PVLOGMSG_INST_HLDBG, iLogger, PVLOGMSG_ERR, (0, "H223OutgoingChannel::HandlePortActivity error")); + PVLOGGER_LOGMSG(PVLOGMSG_INST_HLDBG, iLogger, PVLOGMSG_ERR, (0, "H223OutgoingChannel(%d)::HandlePortActivity error", lcn)); return; } @@ -1165,12 +1169,12 @@ void H223OutgoingChannel::HandlePortActivity(const PVMFPortActivity &aActivity) } else { - PVLOGGER_LOGMSG(PVLOGMSG_INST_HLDBG, iLogger, PVLOGMSG_WARNING, (0, "H223OutgoingChannel::HandlePortActivity Failed to DeQueue incoming message: %d", aStatus)); + PVLOGGER_LOGMSG(PVLOGMSG_INST_HLDBG, iLogger, PVLOGMSG_WARNING, (0, "H223OutgoingChannel(%d)::HandlePortActivity Failed to DeQueue incoming message: %d", lcn, aStatus)); break; } } - PVLOGGER_LOGMSG(PVLOGMSG_INST_HLDBG, iLogger, PVLOGMSG_STACK_TRACE, (0, "H223OutgoingChannel::HandlePortActivity - out")); + PVLOGGER_LOGMSG(PVLOGMSG_INST_HLDBG, iLogger, PVLOGMSG_STACK_TRACE, (0, "H223OutgoingChannel(%d)::HandlePortActivity - out", lcn)); } PVLOGGER_LOG_USE_ONLY( @@ -1196,16 +1200,16 @@ PVLOGGER_LOG_USE_ONLY( uint8* pMemFrag = OSCL_STATIC_CAST(uint8*, aMemFrag.getMemFragPtr()); - uint16 compSize = OSCL_MIN(fsiLen - iFsiTestIndex, memFragSize); + uint16 compSize = OSCL_STATIC_CAST(uint16, OSCL_MIN(fsiLen - iFsiTestIndex, memFragSize)); // compare and print result if error found if (fsiLen && oscl_memcmp(pMemFrag, &pFsi[iFsiTestIndex], compSize)) { - PVLOGGER_LOGMSG(PVLOGMSG_INST_HLDBG, iLogger, PVLOGMSG_ERR, (0, "H223OutgoingChannel::TestFsi Format Specific Info conflict")); - PVLOGGER_LOGMSG(PVLOGMSG_INST_HLDBG, iLogger, PVLOGMSG_STACK_TRACE, (0, "H223OutgoingChannel::TestFsi FSI BS")); + PVLOGGER_LOGMSG(PVLOGMSG_INST_HLDBG, iLogger, PVLOGMSG_ERR, (0, "H223OutgoingChannel(%d)::TestFsi Format Specific Info conflict", lcn)); + PVLOGGER_LOGMSG(PVLOGMSG_INST_HLDBG, iLogger, PVLOGMSG_STACK_TRACE, (0, "H223OutgoingChannel(%d)::TestFsi FSI BS", lcn)); for (int ii = 0; ii < compSize; ii++) { - PVLOGGER_LOGMSG(PVLOGMSG_INST_HLDBG, iLogger, PVLOGMSG_STACK_TRACE, (0, "H223OutgoingChannel::TestFsi %#x %#x", pFsi[iFsiTestIndex + ii], pMemFrag[ii])); + PVLOGGER_LOGMSG(PVLOGMSG_INST_HLDBG, iLogger, PVLOGMSG_STACK_TRACE, (0, "H223OutgoingChannel(%d)::TestFsi %#x %#x", lcn, pFsi[iFsiTestIndex + ii], pMemFrag[ii])); } } @@ -1216,15 +1220,15 @@ PVLOGGER_LOG_USE_ONLY( OSCL_EXPORT_REF PVMFStatus H223OutgoingControlChannel::PeerConnect(PVMFPortInterface* aPort) { - PVLOGGER_LOGMSG(PVLOGMSG_INST_HLDBG, iLogger, PVLOGMSG_STACK_TRACE, (0, "H223OutgoingControlChannel::PeerConnect aPort=0x%x", this, aPort)); + PVLOGGER_LOGMSG(PVLOGMSG_INST_HLDBG, iLogger, PVLOGMSG_STACK_TRACE, (0, "H223OutgoingControlChannel(%d)::PeerConnect aPort=0x%x", lcn, this, aPort)); if (!aPort) { - PVLOGGER_LOGMSG(PVLOGMSG_INST_HLDBG, iLogger, PVLOGMSG_ERR, (0, "0x%x H223OutgoingControlChannel::PeerConnect: Error - Connecting to invalid port", this)); + PVLOGGER_LOGMSG(PVLOGMSG_INST_HLDBG, iLogger, PVLOGMSG_ERR, (0, "0x%x H223OutgoingControlChannel(%d)::PeerConnect: Error - Connecting to invalid port", lcn, this)); return PVMFErrArgument; } if (iConnectedPort) { - PVLOGGER_LOGMSG(PVLOGMSG_INST_HLDBG, iLogger, PVLOGMSG_ERR, (0, "0x%x H223OutgoingControlChannel::PeerConnect: Error - Already connected", this)); + PVLOGGER_LOGMSG(PVLOGMSG_INST_HLDBG, iLogger, PVLOGMSG_ERR, (0, "0x%x H223OutgoingControlChannel(%d)::PeerConnect: Error - Already connected", lcn, this)); return PVMFFailure; } @@ -1236,7 +1240,7 @@ OSCL_EXPORT_REF PVMFStatus H223OutgoingControlChannel::PeerConnect(PVMFPortInter } PVMFStatus H223OutgoingControlChannel::PutData(PVMFSharedMediaMsgPtr aMsg) { - PVLOGGER_LOGMSG(PVLOGMSG_INST_HLDBG, iLogger, PVLOGMSG_STACK_TRACE, (0, "H223OutgoingControlChannel::PutData - iNumPendingPdus=%u,iNumMediaData=%u\n", iNumPendingPdus, iNumMediaData)); + PVLOGGER_LOGMSG(PVLOGMSG_INST_HLDBG, iLogger, PVLOGMSG_STACK_TRACE, (0, "H223OutgoingControlChannel(%d)::PutData - iNumPendingPdus=%u,iNumMediaData=%u\n", lcn, iNumPendingPdus, iNumMediaData)); PVMFSharedMediaDataPtr mediaData; convertToPVMFMediaData(mediaData, aMsg); @@ -1251,7 +1255,7 @@ PVMFStatus H223OutgoingControlChannel::PutData(PVMFSharedMediaMsgPtr aMsg) if (!pdu) { - PVLOGGER_LOGMSG(PVLOGMSG_INST_HLDBG, iLogger, PVLOGMSG_STACK_TRACE, (0, "H223OutgoingControlChannel::PutData - Memory allocation failure on iMediaFragGroupAlloc->allocate\n")); + PVLOGGER_LOGMSG(PVLOGMSG_INST_HLDBG, iLogger, PVLOGMSG_STACK_TRACE, (0, "H223OutgoingControlChannel(%d)::PutData - Memory allocation failure on iMediaFragGroupAlloc->allocate\n", lcn)); return PVMFErrNoMemory; } @@ -1267,7 +1271,7 @@ PVMFStatus H223OutgoingControlChannel::PutData(PVMFSharedMediaMsgPtr aMsg) PVMFStatus status = iAl->CompletePacket(pdu); if (status != PVMFSuccess) { - PVLOGGER_LOGMSG(PVLOGMSG_INST_HLDBG, iLogger, PVLOGMSG_STACK_TRACE, (0, "H223OutgoingControlChannel::PutData - Memory allocation failure on iAl->CompletePacket()")); + PVLOGGER_LOGMSG(PVLOGMSG_INST_HLDBG, iLogger, PVLOGMSG_STACK_TRACE, (0, "H223OutgoingControlChannel(%d)::PutData - Memory allocation failure on iAl->CompletePacket()", lcn)); return status; } @@ -1276,18 +1280,12 @@ PVMFStatus H223OutgoingControlChannel::PutData(PVMFSharedMediaMsgPtr aMsg) // Add it to the outgoing queue if (PVMFSuccess != AppendOutgoingPkt(pdu, timenow.to_msec(), (fsi_available ? &fsi : NULL))) { - PVLOGGER_LOGMSG(PVLOGMSG_INST_HLDBG, iLogger, PVLOGMSG_STACK_TRACE, (0, "H223OutgoingControlChannel::PutData - Memory allocation failure on AppendOutgoingPkt()")); + PVLOGGER_LOGMSG(PVLOGMSG_INST_HLDBG, iLogger, PVLOGMSG_STACK_TRACE, (0, "H223OutgoingControlChannel(%d)::PutData - Memory allocation failure on AppendOutgoingPkt()", lcn)); return PVMFErrNoMemory; } return PVMFSuccess; } -void H223LogicalChannel::SetDatapathLatency(uint32 aLatency) -{ - PVLOGGER_LOGMSG(PVLOGMSG_INST_HLDBG, iLogger, PVLOGMSG_STACK_TRACE, (0, "H223LogicalChannel::SetDatapathLatency lcn=%d, aLatency=%d", lcn, aLatency)); - iDatapathLatency = aLatency; -} - PVMFStatus H223LogicalChannel::setConfigParametersSync(PvmiKvp* selectedKvp, PvmiCapabilityAndConfig* aConfig, PVMFFormatType lcn_format_type, @@ -1299,7 +1297,7 @@ PVMFStatus H223LogicalChannel::setConfigParametersSync(PvmiKvp* selectedKvp, { OSCL_TRY(err, aConfig->setParametersSync(NULL, selectedKvp, 1, retKvp);); OSCL_FIRST_CATCH_ANY(err, - PVLOGGER_LOGMSG(PVLOGMSG_INST_HLDBG, iLogger, PVLOGMSG_STACK_TRACE, (0, "H223OutgoingChannel::setConfigParametersSync, Error: setParametersSync failed, err=%d", err)); + PVLOGGER_LOGMSG(PVLOGMSG_INST_HLDBG, iLogger, PVLOGMSG_STACK_TRACE, (0, "H223OutgoingChannel(%d)::setConfigParametersSync, Error: setParametersSync failed, err=%d", lcn, err)); return PVMFFailure; ); } @@ -1309,13 +1307,13 @@ PVMFStatus H223LogicalChannel::setConfigParametersSync(PvmiKvp* selectedKvp, OSCL_TRY(err, aConfig->setParametersSync(NULL, selectedKvp, 1, retKvp);); if (err) { - PVLOGGER_LOGMSG(PVLOGMSG_INST_HLDBG, iLogger, PVLOGMSG_STACK_TRACE, (0, "H223IncomingChannel::setConfigParametersSync, Error: setParametersSync failed for pChar value, trying uint32, err=%d", err)); + PVLOGGER_LOGMSG(PVLOGMSG_INST_HLDBG, iLogger, PVLOGMSG_STACK_TRACE, (0, "H223IncomingChannel(%d)::setConfigParametersSync, Error: setParametersSync failed for pChar value, trying uint32, err=%d", lcn, err)); selectedKvp->value.pChar_value = OSCL_STATIC_CAST(mbchar*, lcn_format_type.getMIMEStrPtr()); err = 0; OSCL_TRY(err, aConfig->setParametersSync(NULL, selectedKvp, 1, retKvp);); if (err) { - PVLOGGER_LOGMSG(PVLOGMSG_INST_HLDBG, iLogger, PVLOGMSG_STACK_TRACE, (0, "H223IncomingChannel::setConfigParametersSync, Error: setParametersSync failed, err=%d", err)); + PVLOGGER_LOGMSG(PVLOGMSG_INST_HLDBG, iLogger, PVLOGMSG_STACK_TRACE, (0, "H223IncomingChannel(%d)::setConfigParametersSync, Error: setParametersSync failed, err=%d", lcn, err)); return PVMFFailure; } } @@ -1337,14 +1335,15 @@ H223IncomingChannel::H223IncomingChannel(TPVChannelId num, iMediaDataAlloc(&iMemAlloc), iPduSize(al->GetPduSize()), iCurPduSize(0), - iRenderingSkew(0), iVideoFrameNum(0), iMax_Chunk_Size(0), ipVideoFrameReszMemPool(NULL), ipVideoFrameAlloc(NULL), ipVideoDataMemPool(NULL), iLastAudioTS(0), - iAudioFrameNum(0) + iAudioFrameNum(0), + ipAudioDtxTimer(NULL), + iBosMessageSent(false) { #ifdef LIP_SYNC_TESTING iParam = ShareParams::Instance(); @@ -1362,6 +1361,14 @@ H223IncomingChannel::H223IncomingChannel(TPVChannelId num, H223IncomingChannel::~H223IncomingChannel() { + // clean audio dtx timer + if (ipAudioDtxTimer) + { + ipAudioDtxTimer->Cancel(AMR_TIMER_ID); + ipAudioDtxTimer->Clear(); + OSCL_DELETE(ipAudioDtxTimer); + } + iAudioDataQueue.clear(); Flush(); @@ -1400,7 +1407,7 @@ H223IncomingChannel::~H223IncomingChannel() void H223IncomingChannel::Init() { OsclSharedPtr<PVMFMediaDataImpl> tempImpl; - PVLOGGER_LOGMSG(PVLOGMSG_INST_HLDBG, iLogger, PVLOGMSG_STACK_TRACE, (0, "H223IncomingChannel::Init")); + PVLOGGER_LOGMSG(PVLOGMSG_INST_HLDBG, iLogger, PVLOGMSG_STACK_TRACE, (0, "H223IncomingChannel(%d)::Init")); H223LogicalChannel::Init(); int bitrate = (GetBitrate() > 0) ? GetBitrate() : DEF_CHANNEL_BITRATE; @@ -1450,7 +1457,7 @@ void H223IncomingChannel::Init() 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")); + PVLOGGER_LOGMSG(PVLOGMSG_INST_HLDBG, iLogger, PVLOGMSG_WARNING, (0, "H223IncomingChannel(%d)::Init(), tempImpl Allocation failed\n", lcn)); OSCL_LEAVE(PVMFErrNoMemory); } @@ -1460,6 +1467,21 @@ void H223IncomingChannel::Init() OSCL_LEAVE(PVMFErrNoMemory); } } + else if (iMediaType.isAudio()) + { + PVMFStatus err = PVMFNotSet; + typedef OsclTimer<OsclMemAllocator> timerType; + OSCL_TRY(err, ipAudioDtxTimer = OSCL_NEW(timerType, ("IncomingChannelDTXTimer"));); + // only log the error, we can do without the timer if + OSCL_FIRST_CATCH_ANY(err, + PVLOGGER_LOGMSG(PVLOGMSG_INST_HLDBG, iLogger, PVLOGMSG_ERR, (0, "H223IncomingChannel(%d)::Init(), Error: IncomingChannelDTXTimer allocation failed, err=%d", lcn, err)); + ); + if (ipAudioDtxTimer) + { + ipAudioDtxTimer->SetExactFrequency(AMR_TIMER_FREQUENCY); + ipAudioDtxTimer->SetObserver(this); + } + } ResetAlPdu(); AllocateAlPdu(); @@ -1543,7 +1565,7 @@ uint32 H223IncomingChannel::CopyToCurrentFrag(uint8* buf, uint16 len) PVLOGGER_LOG_USE_ONLY( if (iAlPduMediaData->getFilledSize() > iPduSize) { - PVLOGGER_LOGMSG(PVLOGMSG_INST_HLDBG, iLogger, PVLOGMSG_STACK_TRACE, (0, "H223IncomingChannel::CopyToCurrentFrag WARNING current pdu size=%d > iPduSize=%d", iAlPduMediaData->getFilledSize(), iPduSize)); + PVLOGGER_LOGMSG(PVLOGMSG_INST_HLDBG, iLogger, PVLOGMSG_STACK_TRACE, (0, "H223IncomingChannel(%d)::CopyToCurrentFrag WARNING current pdu size=%d > iPduSize=%d", lcn, iAlPduMediaData->getFilledSize(), iPduSize)); } ); return num_bytes_copied; @@ -1554,7 +1576,7 @@ void H223IncomingChannel::PreAlPduData() { if (iPaused) { - PVLOGGER_LOGMSG(PVLOGMSG_INST_HLDBG, iLogger, PVLOGMSG_STACK_TRACE, (0, "H223IncomingChannel::PreAlPduData Logical channel paused. Dropping media data.")); + PVLOGGER_LOGMSG(PVLOGMSG_INST_HLDBG, iLogger, PVLOGMSG_STACK_TRACE, (0, "H223IncomingChannel(%d)::PreAlPduData Logical channel paused. Dropping media data.", lcn)); return; } } @@ -1568,11 +1590,9 @@ PVMFStatus H223IncomingChannel::AlPduData(uint8* buf, uint16 len) if (iAlPduMediaData.GetRep() == NULL || iAlPduMediaData->getFilledSize() == 0) { - bool overflow = false; - if (lcn != 0 && iClock) + if (lcn != 0) { - // not the control channel - iClock->GetCurrentTime32(iCurTimestamp, overflow, PVMF_MEDIA_CLOCK_MSEC); + UpdateCurrentTimestamp(); } } uint32 copied = CopyAlPduData(buf, len); @@ -1581,19 +1601,19 @@ PVMFStatus H223IncomingChannel::AlPduData(uint8* buf, uint16 len) PVMFStatus H223IncomingChannel::AlDispatch() { - PVLOGGER_LOGMSG(PVLOGMSG_INST_HLDBG, iLogger, PVLOGMSG_STACK_TRACE, (0, "H223IncomingChannel::AlDispatch lcn=%d, iCurPduSize=%d, sn=%d", lcn, iCurPduSize, iNumSdusIn)); + PVLOGGER_LOGMSG(PVLOGMSG_INST_HLDBG, iLogger, PVLOGMSG_STACK_TRACE, (0, "H223IncomingChannel(%d)::AlDispatch, iCurPduSize=%d, sn=%d", lcn, iCurPduSize, iNumSdusIn)); IncomingALPduInfo info; if (iPaused) { - PVLOGGER_LOGMSG(PVLOGMSG_INST_HLDBG, iLogger, PVLOGMSG_STACK_TRACE, (0, "H223IncomingChannel::AlDispatch Logical channel paused.")); + PVLOGGER_LOGMSG(PVLOGMSG_INST_HLDBG, iLogger, PVLOGMSG_STACK_TRACE, (0, "H223IncomingChannel(%d)::AlDispatch Logical channel paused.", lcn)); return PVMFFailure; } /* Nothing to dispatch */ if (!iAlPduMediaData.GetRep()) { - PVLOGGER_LOGMSG(PVLOGMSG_INST_HLDBG, iLogger, PVLOGMSG_STACK_TRACE, (0, "H223IncomingChannel::AlDispatch Nothing to dispatch.")); + PVLOGGER_LOGMSG(PVLOGMSG_INST_HLDBG, iLogger, PVLOGMSG_STACK_TRACE, (0, "H223IncomingChannel(%d)::AlDispatch Nothing to dispatch.", lcn)); ResetAlPdu(); return PVMFSuccess; } @@ -1617,7 +1637,7 @@ PVMFStatus H223IncomingChannel::AlDispatch() int32 len = info.sdu_size; if (len <= 0) { - PVLOGGER_LOGMSG(PVLOGMSG_INST_HLDBG, iLogger, PVLOGMSG_STACK_TRACE, (0, "H223IncomingChannel::AlDispatch Empty SDU lcn=%d, len=%d", lcn, len)); + PVLOGGER_LOGMSG(PVLOGMSG_INST_HLDBG, iLogger, PVLOGMSG_STACK_TRACE, (0, "H223IncomingChannel(%d)::AlDispatch Empty SDU len=%d", lcn, len)); ResetAlPdu(); return PVMFErrCorrupt; } @@ -1631,7 +1651,7 @@ PVMFStatus H223IncomingChannel::AlDispatch() if (info.crc_error) { errorsFlag |= PVMF_MEDIA_DATA_BIT_ERRORS; - PVLOGGER_LOGMSG(PVLOGMSG_INST_HLDBG, iLogger, PVLOGMSG_WARNING, (0, "H223IncomingChannel::AlDispatch CRC error lcn=%d, size=%d", lcn, len)); + PVLOGGER_LOGMSG(PVLOGMSG_INST_HLDBG, iLogger, PVLOGMSG_WARNING, (0, "H223IncomingChannel(%d)::AlDispatch CRC error size=%d", lcn, len)); status = PVMFErrCorrupt; } else @@ -1641,7 +1661,7 @@ PVMFStatus H223IncomingChannel::AlDispatch() if (info.seq_num_error) { errorsFlag |= PVMF_MEDIA_DATA_PACKET_LOSS; - PVLOGGER_LOGMSG(PVLOGMSG_INST_HLDBG, iLogger, PVLOGMSG_WARNING, (0, "H223IncomingChannel::AlDispatch Sequence number error lcn=%d, size=%d", lcn, len)); + PVLOGGER_LOGMSG(PVLOGMSG_INST_HLDBG, iLogger, PVLOGMSG_WARNING, (0, "H223IncomingChannel(%d)::AlDispatch Sequence number error size=%d", lcn, len)); status = PVMFErrCorrupt; } @@ -1651,10 +1671,7 @@ PVMFStatus H223IncomingChannel::AlDispatch() return PVMFErrNoMemory; } - - PVMFTimestamp baseTimestamp = 0; - SetSampleTimestamps(baseTimestamp); - aMediaData->setTimestamp(baseTimestamp); + aMediaData->setTimestamp(iCurTimestamp); aMediaData->setSeqNum(info.seq_num); iAlPduMediaData->setErrorsFlag(errorsFlag); status = DispatchOutgoingMsg(aMediaData); @@ -1666,19 +1683,21 @@ PVMFStatus H223IncomingChannel::AlDispatch() OsclAny H223IncomingChannel::Flush() { + PVLOGGER_LOGMSG(PVLOGMSG_INST_HLDBG, iLogger, PVLOGMSG_STACK_TRACE, (0, "H223IncomingChannel(%d)::Flush()", lcn)); + PV_STAT_INCR(iNumBytesFlushed, (iAlPduFragPos - (uint8*)iAlPduFrag.getMemFragPtr())) PV_STAT_INCR_COND(iNumAbort, 1, (iAlPduFragPos - (uint8*)iAlPduFrag.getMemFragPtr())) iVideoFrame.Unbind(); ResetAlPdu(); - + iAudioDataQueue.clear(); } PVMFStatus H223IncomingChannel::Connect(PVMFPortInterface* aPort) { - PVLOGGER_LOGMSG(PVLOGMSG_INST_HLDBG, iLogger, PVLOGMSG_STACK_TRACE, (0, "H223IncomingChannel::Connect lcn(%d)\n", lcn)); + PVLOGGER_LOGMSG(PVLOGMSG_INST_HLDBG, iLogger, PVLOGMSG_STACK_TRACE, (0, "H223IncomingChannel(%d)::Connect", lcn)); if (iConnectedPort) { - PVLOGGER_LOGMSG(PVLOGMSG_INST_HLDBG, iLogger, PVLOGMSG_STACK_TRACE, (0, "H223IncomingChannel::Connect Error: Already connected")); + PVLOGGER_LOGMSG(PVLOGMSG_INST_HLDBG, iLogger, PVLOGMSG_STACK_TRACE, (0, "H223IncomingChannel(%d)::Connect Error: Already connected", lcn)); return PVMFFailure; } @@ -1689,7 +1708,7 @@ PVMFStatus H223IncomingChannel::Connect(PVMFPortInterface* aPort) config = OSCL_STATIC_CAST(PvmiCapabilityAndConfig*, tempInterface); if (!config) { - PVLOGGER_LOGMSG(PVLOGMSG_INST_HLDBG, iLogger, PVLOGMSG_STACK_TRACE, (0, "H223IncomingChannel::Connect: Error - Peer port does not support capability interface")); + PVLOGGER_LOGMSG(PVLOGMSG_INST_HLDBG, iLogger, PVLOGMSG_STACK_TRACE, (0, "H223IncomingChannel(%d)::Connect: Error - Peer port does not support capability interface", lcn)); return PVMFFailure; } @@ -1697,7 +1716,7 @@ PVMFStatus H223IncomingChannel::Connect(PVMFPortInterface* aPort) if (status != PVMFSuccess) { - PVLOGGER_LOGMSG(PVLOGMSG_INST_HLDBG, iLogger, PVLOGMSG_STACK_TRACE, (0, "H223IncomingChannel::Connect: Error - Settings negotiation failed. status=%d", status)); + PVLOGGER_LOGMSG(PVLOGMSG_INST_HLDBG, iLogger, PVLOGMSG_STACK_TRACE, (0, "H223IncomingChannel(%d)::Connect: Error - Settings negotiation failed. status=%d", lcn, status)); return status; } @@ -1706,14 +1725,14 @@ PVMFStatus H223IncomingChannel::Connect(PVMFPortInterface* aPort) 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")); + , (0, "H223IncomingChannel(%d)::Connect: Error - Unable To Send Format Specific Info To Peer", lcn)); return PVMFFailure; } } //Automatically connect the peer. if ((status = aPort->PeerConnect(this)) != PVMFSuccess) { - PVLOGGER_LOGMSG(PVLOGMSG_INST_HLDBG, iLogger, PVLOGMSG_STACK_TRACE, (0, "H223IncomingChannel::Connect: Error - Peer Connect failed. status=%d", status)); + PVLOGGER_LOGMSG(PVLOGMSG_INST_HLDBG, iLogger, PVLOGMSG_STACK_TRACE, (0, "H223IncomingChannel(%d)::Connect: Error - Peer Connect failed. status=%d", lcn, status)); return status; } @@ -1726,7 +1745,7 @@ PVMFStatus H223IncomingChannel::Connect(PVMFPortInterface* aPort) if (status != PVMFSuccess) { - PVLOGGER_LOGMSG(PVLOGMSG_INST_HLDBG, iLogger, PVLOGMSG_STACK_TRACE, (0, "H223IncomingChannel::Connect: Failed to send BOS message status=%d", status)); + PVLOGGER_LOGMSG(PVLOGMSG_INST_HLDBG, iLogger, PVLOGMSG_STACK_TRACE, (0, "H223IncomingChannel(%d)::Connect: Failed to send BOS message status=%d", lcn, status)); return status; } @@ -1735,6 +1754,29 @@ PVMFStatus H223IncomingChannel::Connect(PVMFPortInterface* aPort) return PVMFSuccess; } +void H223IncomingChannel::Pause() +{ + if (iPaused) + { + PVLOGGER_LOGMSG(PVLOGMSG_INST_HLDBG, iLogger, PVLOGMSG_INFO, (0, "H223IncomingChannel(%d)::Pause - Already paused", lcn)); + return; + } + PVLOGGER_LOGMSG(PVLOGMSG_INST_HLDBG, iLogger, PVLOGMSG_INFO, (0, "H223IncomingChannel(%d)::Pause", lcn)); + H223LogicalChannel::Pause(); + iBosMessageSent = false; +} + +void H223IncomingChannel::Resume() +{ + if (!iPaused) + { + PVLOGGER_LOGMSG(PVLOGMSG_INST_HLDBG, iLogger, PVLOGMSG_INFO, (0, "H223IncomingChannel(%d)::Resume - Already resumed", lcn)); + } + PVLOGGER_LOGMSG(PVLOGMSG_INST_HLDBG, iLogger, PVLOGMSG_INFO, (0, "H223IncomingChannel(%d)::Resume", lcn)); + H223LogicalChannel::Resume(); + SendBeginOfStreamMediaCommand(); +} + OsclAny H223IncomingChannel::ResetStats() { iNumSdusIn = 0; @@ -1766,7 +1808,7 @@ MuxSduData::MuxSduData() } PVMFStatus H223IncomingChannel::NegotiateOutputSettings(PvmiCapabilityAndConfig* aConfig) { - PVLOGGER_LOGMSG(PVLOGMSG_INST_HLDBG, iLogger, PVLOGMSG_STACK_TRACE, (0, "H223IncomingChannel::NegotiateInputSettings, aConfig=%x", aConfig)); + PVLOGGER_LOGMSG(PVLOGMSG_INST_HLDBG, iLogger, PVLOGMSG_STACK_TRACE, (0, "H223IncomingChannel(%d)::NegotiateInputSettings, aConfig=%x", lcn, aConfig)); PvmiKvp* kvp = NULL; int numParams = 0; @@ -1786,7 +1828,7 @@ PVMFStatus H223IncomingChannel::NegotiateOutputSettings(PvmiCapabilityAndConfig* if (status != PVMFSuccess || numParams == 0) { - PVLOGGER_LOGMSG(PVLOGMSG_INST_HLDBG, iLogger, PVLOGMSG_STACK_TRACE, (0, "H223IncomingChannel::NegotiateInputSettings, Error: getParametersSync failed. status=%d", status)); + PVLOGGER_LOGMSG(PVLOGMSG_INST_HLDBG, iLogger, PVLOGMSG_STACK_TRACE, (0, "H223IncomingChannel(%d)::NegotiateInputSettings, Error: getParametersSync failed. status=%d", lcn, status)); return PVMFSuccess; } @@ -1803,7 +1845,7 @@ PVMFStatus H223IncomingChannel::NegotiateOutputSettings(PvmiCapabilityAndConfig* if (!selectedKvp) { - PVLOGGER_LOGMSG(PVLOGMSG_INST_HLDBG, iLogger, PVLOGMSG_STACK_TRACE, (0, "H223IncomingChannel::NegotiateInputSettings, Error: Input format not supported by peer")); + PVLOGGER_LOGMSG(PVLOGMSG_INST_HLDBG, iLogger, PVLOGMSG_STACK_TRACE, (0, "H223IncomingChannel(%d)::NegotiateInputSettings, Error: Input format not supported by peer", lcn)); return PVMFFailure; } @@ -1841,7 +1883,7 @@ OSCL_EXPORT_REF PVMFStatus H223IncomingChannel::getParametersSync(PvmiMIOSession int& num_parameter_elements, PvmiCapabilityContext context) { - PVLOGGER_LOGMSG(PVLOGMSG_INST_HLDBG, iLogger, PVLOGMSG_STACK_TRACE, (0, "H223IncomingChannel::getParametersSync")); + PVLOGGER_LOGMSG(PVLOGMSG_INST_HLDBG, iLogger, PVLOGMSG_STACK_TRACE, (0, "H223IncomingChannel(%d)::getParametersSync", lcn)); OSCL_UNUSED_ARG(session); OSCL_UNUSED_ARG(context); @@ -1857,7 +1899,7 @@ OSCL_EXPORT_REF PVMFStatus H223IncomingChannel::getParametersSync(PvmiMIOSession num_parameter_elements); if (status != PVMFSuccess) { - PVLOGGER_LOGMSG(PVLOGMSG_INST_HLDBG, iLogger, PVLOGMSG_WARNING, (0, "H223IncomingChannel::getParametersSync: Error - AllocateKvp failed. status=%d", status)); + PVLOGGER_LOGMSG(PVLOGMSG_INST_HLDBG, iLogger, PVLOGMSG_WARNING, (0, "H223IncomingChannel(%d)::getParametersSync: Error - AllocateKvp failed. status=%d", lcn, status)); return status; } PVCodecType_t codec_type = GetCodecType(iDataType); @@ -1943,7 +1985,7 @@ OSCL_EXPORT_REF void H223IncomingChannel::setParametersSync(PvmiMIOSession sessi status = VerifyAndSetParameter(&(parameters[i]), true); if (status != PVMFSuccess) { - PVLOGGER_LOGMSG(PVLOGMSG_INST_HLDBG, iLogger, PVLOGMSG_WARNING, (0, "H223IncomingChannel::setParametersSync: Error - VerifiyAndSetParameter failed on parameter #%d", i)); + PVLOGGER_LOGMSG(PVLOGMSG_INST_HLDBG, iLogger, PVLOGMSG_WARNING, (0, "H223IncomingChannel(%d)::setParametersSync: Error - VerifiyAndSetParameter failed on parameter #%d", lcn, i)); ret_kvp = &(parameters[i]); /* Silently ignore unrecognized codecs untill CapEx is supported by peer */ //OSCL_LEAVE(OsclErrArgument); @@ -1954,17 +1996,17 @@ OSCL_EXPORT_REF void H223IncomingChannel::setParametersSync(PvmiMIOSession sessi PVMFStatus H223IncomingChannel::VerifyAndSetParameter(PvmiKvp* aKvp, bool aSetParam) { OSCL_UNUSED_ARG(aSetParam); - PVLOGGER_LOGMSG(PVLOGMSG_INST_HLDBG, iLogger, PVLOGMSG_WARNING, (0, "H223IncomingChannel::VerifyAndSetParameter: aKvp=0x%x, aSetParam=%d", aKvp, aSetParam)); + PVLOGGER_LOGMSG(PVLOGMSG_INST_HLDBG, iLogger, PVLOGMSG_WARNING, (0, "H223IncomingChannel(%d)::VerifyAndSetParameter: aKvp=0x%x, aSetParam=%d", lcn, aKvp, aSetParam)); if (!aKvp) { - PVLOGGER_LOGMSG(PVLOGMSG_INST_HLDBG, iLogger, PVLOGMSG_WARNING, (0, "H223IncomingChannel::VerifyAndSetParameter: Error - Invalid key-value pair")); + PVLOGGER_LOGMSG(PVLOGMSG_INST_HLDBG, iLogger, PVLOGMSG_WARNING, (0, "H223IncomingChannel(%d)::VerifyAndSetParameter: Error - Invalid key-value pair", lcn)); return PVMFFailure; } if (iDataType == NULL) { - PVLOGGER_LOGMSG(PVLOGMSG_INST_HLDBG, iLogger, PVLOGMSG_WARNING, (0, "H223IncomingChannel::VerifyAndSetParameter: Error - DataType == NULL")); + PVLOGGER_LOGMSG(PVLOGMSG_INST_HLDBG, iLogger, PVLOGMSG_WARNING, (0, "H223IncomingChannel(%d)::VerifyAndSetParameter: Error - DataType == NULL", lcn)); return PVMFErrNotSupported; } @@ -1974,7 +2016,7 @@ PVMFStatus H223IncomingChannel::VerifyAndSetParameter(PvmiKvp* aKvp, bool aSetPa PVMFFormatType lcn_format_type = PVCodecTypeToPVMFFormatType(codec_type); if (lcn_format_type != aKvp->value.pChar_value) { - PVLOGGER_LOGMSG(PVLOGMSG_INST_HLDBG, iLogger, PVLOGMSG_WARNING, (0, "H223IncomingChannel::VerifyAndSetParameter: Error - Output format %s not supported", aKvp->value.pChar_value)); + PVLOGGER_LOGMSG(PVLOGMSG_INST_HLDBG, iLogger, PVLOGMSG_WARNING, (0, "H223IncomingChannel(%d)::VerifyAndSetParameter: Error - Output format %s not supported", lcn, aKvp->value.pChar_value)); return PVMFErrNotSupported; } } @@ -2022,7 +2064,7 @@ void H223IncomingChannel::HandlePortActivity(const PVMFPortActivity &aActivity) if (aActivity.iType != PVMF_PORT_ACTIVITY_OUTGOING_MSG && aActivity.iType != PVMF_PORT_ACTIVITY_CONNECTED_PORT_READY) { - PVLOGGER_LOGMSG(PVLOGMSG_INST_HLDBG, iLogger, PVLOGMSG_STACK_TRACE, (0, "H223IncomingChannel::HandlePortActivity Unhandled port activity: %d", aActivity.iType)); + PVLOGGER_LOGMSG(PVLOGMSG_INST_HLDBG, iLogger, PVLOGMSG_STACK_TRACE, (0, "H223IncomingChannel(%d)::HandlePortActivity Unhandled port activity: %d", lcn, aActivity.iType)); return; } PVMFStatus aStatus; @@ -2032,7 +2074,7 @@ void H223IncomingChannel::HandlePortActivity(const PVMFPortActivity &aActivity) aStatus = Send(); if (aStatus != PVMFSuccess) { - PVLOGGER_LOGMSG(PVLOGMSG_INST_HLDBG, iLogger, PVLOGMSG_WARNING, (0, "H223IncomingChannel::HandlePortActivity Failed to DeQueue incoming message: %d", aStatus)); + PVLOGGER_LOGMSG(PVLOGMSG_INST_HLDBG, iLogger, PVLOGMSG_WARNING, (0, "H223IncomingChannel(%d)::HandlePortActivity Failed to DeQueue incoming message: %d", lcn, aStatus)); break; } } @@ -2058,63 +2100,14 @@ PVMFStatus H223IncomingChannel::SendBeginOfStreamMediaCommand() { // Output queue is busy, so wait for the output queue being ready PVLOGGER_LOGMSG(PVLOGMSG_INST_HLDBG, iLogger, PVLOGMSG_WARNING, - (0, "H223IncomingChannel::SendBeginOfMediaStreamCommand: Outgoing queue busy. ")); + (0, "H223IncomingChannel(%d)::SendBeginOfMediaStreamCommand: Outgoing queue busy. ", lcn)); return status; } - PVLOGGER_LOGMSG(PVLOGMSG_INST_HLDBG, iLogger, PVLOGMSG_STACK_TRACE, (0, "H223IncomingChannel::SendBeginOfMediaStreamCommand() BOS Sent StreamId %d ", streamID)); + iBosMessageSent = true; + PVLOGGER_LOGMSG(PVLOGMSG_INST_HLDBG, iLogger, PVLOGMSG_STACK_TRACE, (0, "H223IncomingChannel(%d)::SendBeginOfMediaStreamCommand() BOS Sent StreamId %d ", lcn, streamID)); return status; } -void H223IncomingChannel::SetSampleTimestamps(PVMFTimestamp& aTSOffset) -{ - iRenderingSkew = iAudioLatency - iVideoLatency; - uint32 skewDelta = 0; - if (iRenderingSkew >= (int32)iIncomingSkew) - { - skewDelta = iRenderingSkew - iIncomingSkew; - if (iMediaType.isCompressed() && iMediaType.isAudio()) - { - aTSOffset = (PVMFTimestamp)(iAudioLatency); - } - else if (iMediaType.isCompressed() && iMediaType.isVideo()) - { - aTSOffset = (PVMFTimestamp)(iVideoLatency + skewDelta + PARSING_JITTER_DURATION); - } - } - else if (iRenderingSkew < (int32)iIncomingSkew) - { - skewDelta = iIncomingSkew - iRenderingSkew; - if (iMediaType.isCompressed() && iMediaType.isAudio()) - { - aTSOffset = (PVMFTimestamp)(iAudioLatency + skewDelta); - } - else if (iMediaType.isCompressed() && iMediaType.isVideo()) - { - aTSOffset = (PVMFTimestamp)(iVideoLatency + PARSING_JITTER_DURATION); - } - } - -#ifdef LIP_SYNC_TESTING - - /************************************************************************************************** - this is the check, to get unique sample TS on dummy output node side.So for this purpose, we are - checking the original video TS with the previous TS.If this condition is true then only we are - modifying the value of aTSOffset. - - ***************************************************************************************************/ - - if ((g_CheckSampleTime != g_RecTimeStamp) && (iParam->iCompressed == false)) - { - g_CheckSampleTime = g_RecTimeStamp; - g_Checkcount++; - aTSOffset += g_Checkcount; - - } -#endif - - aTSOffset += iCurTimestamp; -} - /* ***************************************************************************************************** * Function : DetectSkewInd() * Date : 6/15/2009 @@ -2218,7 +2211,7 @@ void H223IncomingChannel::CalculateRMSInfo(uint32 aVideoData, uint32 aAudioData) if (g_TotalCountIncm == 0) { PVLOGGER_LOGMSG(PVLOGMSG_INST_HLDBG, iLogger, PVLOGMSG_STACK_TRACE, - (0, "Not be able to calculate RMS because Total count value is zero TotalCount=%d", g_TotalCountIncm)); + (0, "Not be able to calculate RMS because Total count value is zero TotalCount=%d", lcn, g_TotalCountIncm)); } else @@ -2420,7 +2413,7 @@ PVMFStatus H223IncomingChannel::DispatchOutgoingMsg(PVMFSharedMediaDataPtr aMedi if (CheckFrameBoundary((uint8 *)memFrag.getMemFragPtr(), memFrag.getMemFragSize(), aMediaData->getErrorsFlag())) { - PVLOGGER_LOGMSG(PVLOGMSG_INST_HLDBG, iLogger, PVLOGMSG_DEBUG, (0, "H223IncomingChannel::::DispatchOutgoingMsg, frame found\n")); + PVLOGGER_LOGMSG(PVLOGMSG_INST_HLDBG, iLogger, PVLOGMSG_DEBUG, (0, "H223IncomingChannel(%d)::::DispatchOutgoingMsg, frame found\n", lcn)); //If buffer exists then send it. if (iVideoFrame.GetRep()) { @@ -2436,7 +2429,7 @@ PVMFStatus H223IncomingChannel::DispatchOutgoingMsg(PVMFSharedMediaDataPtr aMedi aMediaData->getMediaFragment(i, memFrag); - PVLOGGER_LOGMSG(PVLOGMSG_INST_HLDBG, iLogger, PVLOGMSG_DEBUG, (0, "H223IncomingChannel::::DispatchOutgoingMsg, frag size %d, idx %d\n", memFrag.getMemFragSize(), i)); + PVLOGGER_LOGMSG(PVLOGMSG_INST_HLDBG, iLogger, PVLOGMSG_DEBUG, (0, "H223IncomingChannel(%d)::::DispatchOutgoingMsg, frag size %d, idx %d\n", lcn, memFrag.getMemFragSize(), i)); @@ -2444,7 +2437,7 @@ PVMFStatus H223IncomingChannel::DispatchOutgoingMsg(PVMFSharedMediaDataPtr aMedi 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")); + PVLOGGER_LOGMSG(PVLOGMSG_INST_HLDBG, iLogger, PVLOGMSG_ERR, (0, "H223IncomingChannel(%d)::::DispatchOutgoingMsg, frag cannot fit into video buffer\n", lcn)); } @@ -2459,7 +2452,7 @@ PVMFStatus H223IncomingChannel::DispatchOutgoingMsg(PVMFSharedMediaDataPtr aMedi if (PVMFSuccess != SendAudioFrame(aMediaData)) { PVLOGGER_LOGMSG(PVLOGMSG_INST_LLDBG, iLogger, PVLOGMSG_INFO, - (0, "H223IncomingChannel::DispatchOutgoingMsg - Sending audio failed, clearing queue")); + (0, "H223IncomingChannel(%d)::DispatchOutgoingMsg - Sending audio failed, clearing queue", lcn)); iAudioDataQueue.clear(); } } @@ -2470,14 +2463,14 @@ PVMFStatus H223IncomingChannel::DispatchOutgoingMsg(PVMFSharedMediaDataPtr aMedi PVMFStatus dispatch_status = QueueOutgoingMsg(mediaMsg); if (dispatch_status != PVMFSuccess) { - PVLOGGER_LOGMSG(PVLOGMSG_INST_HLDBG, iLogger, PVLOGMSG_WARNING, (0, "H223IncomingChannel::DispatchOutgoingMsg Failed to queue outgoing control message lcn=%d, status=%d", lcn, dispatch_status)); + PVLOGGER_LOGMSG(PVLOGMSG_INST_HLDBG, iLogger, PVLOGMSG_WARNING, (0, "H223IncomingChannel(%d)::DispatchOutgoingMsg Failed to queue outgoing control message status=%d", lcn, dispatch_status)); status = dispatch_status; } } else { - PVLOGGER_LOGMSG(PVLOGMSG_INST_HLDBG, iLogger, PVLOGMSG_WARNING, (0, "H223IncomingChannel::DispatchOutgoingMsg lcn=%d Queue not connected", lcn)); + PVLOGGER_LOGMSG(PVLOGMSG_INST_HLDBG, iLogger, PVLOGMSG_WARNING, (0, "H223IncomingChannel(%d)::DispatchOutgoingMsg Queue not connected", lcn)); } return status; @@ -2634,23 +2627,15 @@ PVMFStatus H223IncomingChannel::SendVideoFrame(PVMFSharedMediaDataPtr aMediaData 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)); + DispatchMessage(iVideoFrame); - } #ifdef LIP_SYNC_TESTING g_IncmVideoTS = iVideoFrame->getTimestamp(); CalculateRMSInfo(g_IncmVideoTS, g_IncmAudioTS); #endif - iVideoFrame.Unbind(); } - - ipVideoFrameAlloc->ResizeMemoryFragment(mediaDataImpl); uint32 MediaMsgAllocOverhead = ipVideoFrameAlloc->GetMediaMsgAllocationOverheadBytes(); uint32 LargestAvilableChunk = ipVideoFrameReszMemPool->getLargestContiguousFreeBlockSize(); @@ -2658,14 +2643,14 @@ PVMFStatus H223IncomingChannel::SendVideoFrame(PVMFSharedMediaDataPtr aMediaData 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")); + PVLOGGER_LOGMSG(PVLOGMSG_INST_HLDBG, iLogger, PVLOGMSG_WARNING, (0, "H223IncomingChannel(%d)::SendVideoFrame , Max_Chunk_size Allocation failed\n", lcn)); 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)); + PVLOGGER_LOGMSG(PVLOGMSG_INST_HLDBG, iLogger, PVLOGMSG_STACK_TRACE, (0, "H223IncomingChannel(%d)::SendVideoFrame, Error: createMediaData failed, err=%d", lcn, err)); return PVMFFailure; ); @@ -2679,7 +2664,7 @@ PVMFStatus H223IncomingChannel::CallSendVideoFrame(PVMFSharedMediaDataPtr aMedia 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)); + PVLOGGER_LOGMSG(PVLOGMSG_INST_HLDBG, iLogger, PVLOGMSG_STACK_TRACE, (0, "H223IncomingChannel(%d)::DispatchOutgoingMsg, Error: SendVideoFrame failed, err=%d", lcn, err)); return PVMFFailure; ); return status; @@ -2687,17 +2672,25 @@ PVMFStatus H223IncomingChannel::CallSendVideoFrame(PVMFSharedMediaDataPtr aMedia PVMFStatus H223IncomingChannel::SendAudioFrame(PVMFSharedMediaDataPtr aMediaDataPtr) { - PVLOGGER_LOGMSG(PVLOGMSG_INST_HLDBG, iLogger, PVLOGMSG_STACK_TRACE, (0, "H223IncomingChannel::SendAudioFrame")); + PVLOGGER_LOGMSG(PVLOGMSG_INST_HLDBG, iLogger, PVLOGMSG_STACK_TRACE, (0, "H223IncomingChannel(%d)::SendAudioFrame", lcn)); int32 err = 0; - // push a new frame to queue - OSCL_TRY(err, iAudioDataQueue.push_back(aMediaDataPtr)); - OSCL_FIRST_CATCH_ANY(err, - PVLOGGER_LOGMSG(PVLOGMSG_INST_LLDBG, iLogger, PVLOGMSG_ERR, - (0, "H223IncomingChannel::SendAudioFrame - Error - No Memory")); - return PVMFErrNoMemory; - ); + if (ipAudioDtxTimer) + { + ipAudioDtxTimer->Cancel(AMR_TIMER_ID); + } + + if (aMediaDataPtr) + { + // push a new frame to queue + OSCL_TRY(err, iAudioDataQueue.push_back(aMediaDataPtr)); + OSCL_FIRST_CATCH_ANY(err, + PVLOGGER_LOGMSG(PVLOGMSG_INST_LLDBG, iLogger, PVLOGMSG_ERR, + (0, "H223IncomingChannel(%d)::SendAudioFrame - Error - No Memory", lcn)); + return PVMFErrNoMemory; + ); + } // we keep small buffer filled so we can have more accurate estimation of timestamps // following is based on a fact that we are always receiving data late. @@ -2712,7 +2705,13 @@ PVMFStatus H223IncomingChannel::SendAudioFrame(PVMFSharedMediaDataPtr aMediaData // if it is, send all data from queue if (back->getFilledSize() <= AMR_SID_SIZE) { - PVLOGGER_LOGMSG(PVLOGMSG_INST_HLDBG, iLogger, PVLOGMSG_INFO, (0, "H223IncomingChannel::SendAudioFrame - SID frame detected")); + PVLOGGER_LOGMSG(PVLOGMSG_INST_HLDBG, iLogger, PVLOGMSG_DEBUG, (0, "H223IncomingChannel(%d)::SendAudioFrame - SID frame detected", lcn)); + dataQueueLimit = 1; + } + + if (!aMediaDataPtr) + { + PVLOGGER_LOGMSG(PVLOGMSG_INST_HLDBG, iLogger, PVLOGMSG_DEBUG, (0, "H223IncomingChannel(%d)::SendAudioFrame - Flushing", lcn)); dataQueueLimit = 1; } @@ -2722,7 +2721,7 @@ PVMFStatus H223IncomingChannel::SendAudioFrame(PVMFSharedMediaDataPtr aMediaData // get the smallest from ts and future timestamp // this will remove possible delay of current ts - uint16 size = dataQueueSize * AMR_FRAME_SIZE_MS; + uint16 size = OSCL_STATIC_CAST(uint16, dataQueueSize * AMR_FRAME_SIZE_MS); PVMFTimestamp fts = front->getTimestamp(); PVMFTimestamp bts = back->getTimestamp(); @@ -2740,9 +2739,8 @@ PVMFStatus H223IncomingChannel::SendAudioFrame(PVMFSharedMediaDataPtr aMediaData // it is also more likely to receive less than 50 frame/s than over 50fps. if (ts > (fts + AMR_JITTER)) { - PVLOGGER_LOGMSG(PVLOGMSG_INST_HLDBG, iLogger, PVLOGMSG_INFO, (0, "H223IncomingChannel::RemoveAudioFrame, size(%d) origTS(%d) TS(%d)\n", iAudioDataQueue[0]->getFilledSize(), fts, ts)); + PVLOGGER_LOGMSG(PVLOGMSG_INST_HLDBG, iLogger, PVLOGMSG_INFO, (0, "H223IncomingChannel(%d)::RemoveAudioFrame, size(%d) origTS(%d) TS(%d)\n", lcn, iAudioDataQueue[0]->getFilledSize(), fts, ts)); // remove this frame - iAudioDataQueue[0].Unbind(); iAudioDataQueue.erase(iAudioDataQueue.begin()); } else @@ -2752,19 +2750,14 @@ PVMFStatus H223IncomingChannel::SendAudioFrame(PVMFSharedMediaDataPtr aMediaData // smoothen the time stamp ts = ts - ts % AMR_FRAME_SIZE_MS; - // sending frame here. - OsclSharedPtr<PVMFMediaMsg> mediaMsg; - // set length, marker, timestamp for new media message iAudioDataQueue[0]->setMarkerInfo(PVMF_MEDIA_DATA_MARKER_INFO_M_BIT); - PVLOGGER_LOGMSG(PVLOGMSG_INST_HLDBG, iLogger, PVLOGMSG_INFO, (0, "H223IncomingChannel::SendAudioFrame, size(%d) origTS(%d) TS(%d)\n", iAudioDataQueue[0]->getFilledSize(), fts, ts)); + PVLOGGER_LOGMSG(PVLOGMSG_INST_HLDBG, iLogger, PVLOGMSG_INFO, (0, "H223IncomingChannel(%d)::SendAudioFrame, size(%d) origTS(%d) TS(%d)\n", lcn, iAudioDataQueue[0]->getFilledSize(), fts, ts)); iAudioDataQueue[0]->setTimestamp(ts); iAudioDataQueue[0]->setSeqNum(++iAudioFrameNum); - convertToPVMFMediaMsg(mediaMsg, iAudioDataQueue[0]); - // send message - QueueOutgoingMsg(mediaMsg); + DispatchMessage(iAudioDataQueue[0]); #ifdef LIP_SYNC_TESTING g_IncmAudioTS = ts; @@ -2775,12 +2768,158 @@ PVMFStatus H223IncomingChannel::SendAudioFrame(PVMFSharedMediaDataPtr aMediaData iLastAudioTS = ts; // remove data from queue - iAudioDataQueue[0].Unbind(); iAudioDataQueue.erase(iAudioDataQueue.begin()); } - dataQueueSize = iAudioDataQueue.size(); + dataQueueSize = OSCL_STATIC_CAST(uint16, iAudioDataQueue.size()); + } + + if (ipAudioDtxTimer) + { + PVLOGGER_LOGMSG(PVLOGMSG_INST_HLDBG, iLogger, PVLOGMSG_DEBUG, (0, "H223IncomingChannel(%d)::SendAudioFrame - Start new timer for ts(%d)", lcn, iCurTimestamp)); + ipAudioDtxTimer->Request(AMR_TIMER_ID, OSCL_STATIC_CAST(int32, iCurTimestamp), 1, this); } return PVMFSuccess; } +void H223IncomingChannel::TimeoutOccurred(int32 aTimerID, int32 aTimeoutInfo) +{ + OSCL_UNUSED_ARG(aTimerID); + + PVLOGGER_LOGMSG(PVLOGMSG_INST_HLDBG, iLogger, PVLOGMSG_STACK_TRACE, (0, "H223IncomingChannel(%d)::TimeoutOccurred, TimerId(%d) TimeoutInfo(%d)", lcn, aTimerID, aTimeoutInfo)); + + uint32 timeout = OSCL_STATIC_CAST(uint32, aTimeoutInfo); + // if not no audio is sent during timeout we have problems receiving new data + if (timeout == iCurTimestamp) + { + // if we have data in buffer + if (iAudioDataQueue.size()) + { + PVLOGGER_LOGMSG(PVLOGMSG_INST_HLDBG, iLogger, PVLOGMSG_DEBUG, (0, "H223IncomingChannel(%d)::TimeoutOccurred - Flush audio", lcn)); + PVMFSharedMediaDataPtr mediaData; + + if (iPaused) return; + + SendAudioFrame(mediaData); + } + else + { + PVLOGGER_LOGMSG(PVLOGMSG_INST_HLDBG, iLogger, PVLOGMSG_DEBUG, (0, "H223IncomingChannel(%d)::TimeoutOccurred - Create no data", lcn)); + + if (!iPaused) + { + int leavecode = 0; + PVMFSharedMediaDataPtr mediaData; + if (CreateNoDataAudioFrame(mediaData)) + { + // don't let this leave as mediaData would be leaked + OSCL_TRY(leavecode, SendAudioFrame(mediaData);); + OSCL_FIRST_CATCH_ANY(leavecode, + PVLOGGER_LOGMSG(PVLOGMSG_INST_HLDBG, iLogger, PVLOGMSG_ERR, (0, "H223IncomingChannel(%d)::TimeoutOccurred, Error: SendAudioFrame failed, err=%d", lcn, leavecode)); + ); + } + } + } + } +} + +void H223IncomingChannel::UpdateCurrentTimestamp() +{ + PVLOGGER_LOGMSG(PVLOGMSG_INST_HLDBG, iLogger, PVLOGMSG_STACK_TRACE, (0, "H223IncomingChannel(%d)::UpdateTimestamp", lcn)); + if (!iClock) + { + return; + } + + bool overflow = false; + PVMFTimestamp timestamp; + + // get the current time + iClock->GetCurrentTime32(timestamp, overflow, PVMF_MEDIA_CLOCK_MSEC); + + if (overflow) + { + // we need to clean the queue and send a new bos message as previous clock value was higher than the new one + // best way is to do this is to do pause/resume + Pause(); + Resume(); + } + + // make sure that the new timestamp is not the same as previous one + iCurTimestamp = (iCurTimestamp < timestamp) ? timestamp : iCurTimestamp + 1; + PVLOGGER_LOGMSG(PVLOGMSG_INST_HLDBG, iLogger, PVLOGMSG_DEBUG, (0, "H223IncomingChannel(%d)::UpdateCurrentTimestamp - update current ts(%u)", lcn, iCurTimestamp)); +} + +PVMFStatus H223IncomingChannel::DispatchMessage(PVMFSharedMediaDataPtr& arMediaDataPtr) +{ + PVLOGGER_LOGMSG(PVLOGMSG_INST_HLDBG, iLogger, PVLOGMSG_STACK_TRACE, (0, "H223IncomingChannel(%d)::DispatchMessage", lcn)); + + PVMFStatus dispatchStatus = PVMFNotSet; + OsclSharedPtr<PVMFMediaMsg> mediaMsg; + + // convert to media message + convertToPVMFMediaMsg(mediaMsg, arMediaDataPtr); + + // send media message if bos message is already sent + if (IsResumable()) + { + dispatchStatus = QueueOutgoingMsg(mediaMsg); + } + else + { + dispatchStatus = PVMFErrInvalidState; + } + + if (dispatchStatus != PVMFSuccess) + { + PVLOGGER_LOGMSG(PVLOGMSG_INST_HLDBG, iLogger, PVLOGMSG_WARNING, + (0, "H223IncomingChannel(%d)::DispatchMessage Failed to queue outgoing media message status=%d", lcn, dispatchStatus)); + } + return dispatchStatus; +} + +bool H223IncomingChannel::IsResumable() +{ + PVLOGGER_LOGMSG(PVLOGMSG_INST_HLDBG, iLogger, PVLOGMSG_STACK_TRACE, (0, "H223IncomingChannel(%d)::IsResumable", lcn)); + // Bos message is needed at the beginning of stream + // It is also needed in reposition, like in the case of pause + // Only if bos message is sent media message can be send to port + return (iBosMessageSent || (SendBeginOfStreamMediaCommand() == PVMFSuccess)); +} + +PVMFStatus H223IncomingChannel::CreateNoDataAudioFrame(PVMFSharedMediaDataPtr &arMediaDataPtr) +{ + int leavecode = 0; + + // Create new media data buffer + OsclSharedPtr<PVMFMediaDataImpl> mediaDataImpl = iMediaFragGroupAlloc->allocate(); + + // set no data frame as payload + OsclRefCounterMemFrag memFrag; + + OSCL_TRY(leavecode, memFrag = iMemFragmentAlloc.get()); + OSCL_FIRST_CATCH_ANY(leavecode, + PVLOGGER_LOGMSG(PVLOGMSG_INST_HLDBG, iLogger, PVLOGMSG_ERR, (0, "H223IncomingChannel(%d)::TimeoutOccurred, Error: Mem frag alloc leaved, err=%d", lcn, leavecode)); + return PVMFErrNoMemory; + ); + if (memFrag.getMemFragPtr() == NULL) + { + PVLOGGER_LOGMSG(PVLOGMSG_INST_HLDBG, iLogger, PVLOGMSG_ERR, (0, "H223IncomingChannel(%d)::TimeoutOccurred, Error: Mem frag alloc failed", lcn)); + return PVMFErrNoMemory; + } + *((uint8*)memFrag.getMemFragPtr()) = AMR_NO_DATA; + memFrag.getMemFrag().len = AMR_NODATA_SIZE; + + mediaDataImpl->appendMediaFragment(memFrag); // this does not leave + + OSCL_TRY(leavecode, arMediaDataPtr = PVMFMediaData::createMediaData(mediaDataImpl, iMediaMsgMemoryPool);); + OSCL_FIRST_CATCH_ANY(leavecode, + PVLOGGER_LOGMSG(PVLOGMSG_INST_HLDBG, iLogger, PVLOGMSG_ERR, (0, "H223IncomingChannel(%d)::TimeoutOccurred, Error: Create Media Data, err=%d", lcn, leavecode)); + return PVMFErrNoMemory; + ); + + // set timestamp for no data + UpdateCurrentTimestamp(); + arMediaDataPtr->setTimestamp(iCurTimestamp); + return PVMFSuccess; +} diff --git a/protocols/systems/3g-324m_pvterminal/h324/tsc/include/tsc_constants.h b/protocols/systems/3g-324m_pvterminal/h324/tsc/include/tsc_constants.h index f9db2fa9c..118f5d328 100644 --- a/protocols/systems/3g-324m_pvterminal/h324/tsc/include/tsc_constants.h +++ b/protocols/systems/3g-324m_pvterminal/h324/tsc/include/tsc_constants.h @@ -18,8 +18,6 @@ #ifndef TSC_CONSTANTS_H_INCLUDED #define TSC_CONSTANTS_H_INCLUDED -#define TSC_INCOMING_CHANNEL_MASK (1<<16) - typedef enum _status { Phase0_Idle = 1 , diff --git a/protocols/systems/3g-324m_pvterminal/h324/tsc/include/tsc_h324m_config.h b/protocols/systems/3g-324m_pvterminal/h324/tsc/include/tsc_h324m_config.h index 87e04948b..10d212af5 100644 --- a/protocols/systems/3g-324m_pvterminal/h324/tsc/include/tsc_h324m_config.h +++ b/protocols/systems/3g-324m_pvterminal/h324/tsc/include/tsc_h324m_config.h @@ -91,6 +91,10 @@ class H324MConfig : public OsclActiveObject, OsclAny* aContextData = NULL); PVMFCommandId SendVideoTemporalSpatialTradeoffIndication(TPVChannelId aLogicalChannel, uint8 aTradeoff, OsclAny* aContextData = NULL); + PVMFCommandId SendLogicalChannelActiveIndication(TPVChannelId aLogicalChannel, + OsclAny* aContextData = NULL); + PVMFCommandId SendLogicalChannelInactiveIndication(TPVChannelId aLogicalChannel, + OsclAny* aContextData = NULL); PVMFCommandId SendSkewIndication(TPVChannelId aLogicalChannel1, TPVChannelId aLogicalChannel2, uint16 aSkew, OsclAny* aContextData = NULL); PVMFCommandId SetLogicalChannelBufferingMs(uint32 aInBufferingMs, @@ -113,6 +117,8 @@ class H324MConfig : public OsclActiveObject, void UserInputCapability(int formats); void VideoSpatialTemporalTradeoffCommandReceived(TPVChannelId id, uint8 tradeoff); void VideoSpatialTemporalTradeoffIndicationReceived(TPVChannelId id, uint8 tradeoff); + void LogicalChannelActiveIndicationReceived(TPVChannelId id); + void LogicalChannelInactiveIndicationReceived(TPVChannelId id); void SkewIndicationReceived(TPVChannelId lcn1, TPVChannelId lcn2, uint16 skew); private: void Run(); @@ -187,6 +193,10 @@ class H324MConfigProxied : OsclAny* aContextData = NULL); PVMFCommandId SendVideoTemporalSpatialTradeoffIndication(TPVChannelId aLogicalChannel, uint8 aTradeoff, OsclAny* aContextData = NULL); + PVMFCommandId SendLogicalChannelActiveIndication(TPVChannelId aLogicalChannel, + OsclAny* aContextData = NULL); + PVMFCommandId SendLogicalChannelInactiveIndication(TPVChannelId aLogicalChannel, + OsclAny* aContextData = NULL); PVMFCommandId SendSkewIndication(TPVChannelId aLogicalChannel1, TPVChannelId aLogicalChannel2, uint16 aSkew, OsclAny* aContextData = NULL); PVMFCommandId SetLogicalChannelBufferingMs(uint32 aInBufferingMs, diff --git a/protocols/systems/3g-324m_pvterminal/h324/tsc/include/tsc_h324m_config_interface.h b/protocols/systems/3g-324m_pvterminal/h324/tsc/include/tsc_h324m_config_interface.h index 52ba82f51..2fa303116 100644 --- a/protocols/systems/3g-324m_pvterminal/h324/tsc/include/tsc_h324m_config_interface.h +++ b/protocols/systems/3g-324m_pvterminal/h324/tsc/include/tsc_h324m_config_interface.h @@ -426,6 +426,25 @@ class H324MConfigInterface : public PVInterface uint8 aTradeoff, OsclAny* aContextData = NULL) = 0; /** + * This API allows the user to send a logicalChannelActive indication to the peer. + * It is an indication to the peer that the channel that was paused and + * for which it received logicalChannelInactive indication is now ready to send data + * on the channel defined by Logical channel Id + * + **/ + virtual PVMFCommandId SendLogicalChannelActiveIndication(TPVChannelId aLogicalChannel, + OsclAny* aContextData = NULL) = 0; + + /** + * This API allows the user to send a logicalChannelInactive indication to the peer. + * It is an indication to the peer that the channel has been paused the channel and will + * not send any data on the channel defined by Logical channel Id + * + **/ + virtual PVMFCommandId SendLogicalChannelInactiveIndication(TPVChannelId aLogicalChannel, + OsclAny* aContextData = NULL) = 0; + + /** * This API allows the user to send a SkewIndication to the peer. * Skew is measured in milliseconds, and indicates the maximum number of milliseconds that the data on * logicalChannel2 is delayed from the data on logicalChannel1 as delivered to the network transport. @@ -540,7 +559,20 @@ enum PVH324MIndicationType * All values are in network byte order. * **/ - PV_INDICATION_SKEW + PV_INDICATION_SKEW, + /** + * Indicates a Active Logical Channel message from the remote terminal. The first two bytes of the + * local buffer encode the logical channel number in network byte order. + * + **/ + PV_INDICATION_LOGICAL_CHANNEL_ACTIVE, + /** + * Indicates a Inactive Logical Channel message from the remote terminal. The first two bytes of the + * local buffer encode the logical channel number in network byte order. + * + **/ + PV_INDICATION_LOGICAL_CHANNEL_INACTIVE + }; /** Extension interface to indicate reverse logical channel parameters to the user of the stack node diff --git a/protocols/systems/3g-324m_pvterminal/h324/tsc/include/tscmain.h b/protocols/systems/3g-324m_pvterminal/h324/tsc/include/tscmain.h index 002e021d6..afee64d56 100644 --- a/protocols/systems/3g-324m_pvterminal/h324/tsc/include/tscmain.h +++ b/protocols/systems/3g-324m_pvterminal/h324/tsc/include/tscmain.h @@ -132,7 +132,6 @@ class SimpleStackElement; #define FIRST_MUX_ENTRY_NUMBER TSC_FM_MAX_MTE+1 #define LAST_MUX_ENTRY_NUMBER 14 #define TSC_WNSRP_MUX_ENTRY_NUMBER 15 -#define TSC_INCOMING_CHANNEL_MASK (1<<16) /*---------------------------------------------------------------------------*/ @@ -157,6 +156,8 @@ class TSC_324mObserver virtual void UserInputCapability(int formats) = 0; virtual void VideoSpatialTemporalTradeoffCommandReceived(TPVChannelId id, uint8 tradeoff) = 0; virtual void VideoSpatialTemporalTradeoffIndicationReceived(TPVChannelId id, uint8 tradeoff) = 0; + virtual void LogicalChannelActiveIndicationReceived(TPVChannelId id) = 0; + virtual void LogicalChannelInactiveIndicationReceived(TPVChannelId id) = 0; virtual void SkewIndicationReceived(TPVChannelId lcn1, TPVChannelId lcn2, uint16 skew) = 0; }; @@ -419,6 +420,8 @@ class TSC_324m : public OsclActiveObject, void Tsc_IdcVi(void); void SendVideoTemporalSpatialTradeoffCommand(TPVChannelId aLogicalChannel, uint8 aTradeoff); void SendVideoTemporalSpatialTradeoffIndication(TPVChannelId aLogicalChannel, uint8 aTradeoff); + void SendLogicalChannelActiveIndication(TPVChannelId aLogicalChannel); + void SendLogicalChannelInactiveIndication(TPVChannelId aLogicalChannel); void SendSkewIndication(TPVChannelId aLogicalChannel1, TPVChannelId aLogicalChannel2, uint16 aSkew); OSCL_IMPORT_REF void SetLogicalChannelBufferingMs(uint32 aInBufferingMs, uint32 aOutBufferingMs); @@ -444,6 +447,17 @@ class TSC_324m : public OsclActiveObject, OSCL_IMPORT_REF void SetClock(PVMFMediaClock* aClock); OSCL_IMPORT_REF void SetMioLatency(int32 aLatency, bool aAudio); + /** + * Pauses/Resumes the logical channels + * For outgoing channel an indincation is send to peer about the channel status. + * + * @param apPort port of the channel to be paused/resumed + * @param aPause true is pause, false is resume + * + * @returns TPVStatusCode Fails if channel is not found + **/ + TPVStatusCode SetLogicalChannelPause(TPVChannelId aChannelId, TPVDirection aDir, bool aPause); + private: void Cleanup(); @@ -553,7 +567,16 @@ class TSC_324m : public OsclActiveObject, // H.245 Miscellaneous Indications typedef enum _TIndicationMisc { - EVideoTemporalSpatialTradeOffIdc, + ELogicalChannelActiveIdc = 0, + ELogicalChannelInactiveIdc, + EMultipointConference, + ECancelMultipointConference, + EMultipointZeroComm, + ECancelMultipointZeroComm, + EMultipointSecondaryStatus, + ECancelMultipointSecondaryStatus, + EVideoIndicateReadyToActivate, + EVideoTemporalSpatialTradeOffIdc } TIndicationMisc; void IndicationMisc(TIndicationMisc type, TPVChannelId channelId, uint32 param = 0, OsclAny* param1 = NULL); void Tsc_IdcSkew(TPVChannelId lcn1, TPVChannelId lcn2, uint16 skew); diff --git a/protocols/systems/3g-324m_pvterminal/h324/tsc/src/tsc_component.cpp b/protocols/systems/3g-324m_pvterminal/h324/tsc/src/tsc_component.cpp index c8323e9dc..f835cc1c6 100644 --- a/protocols/systems/3g-324m_pvterminal/h324/tsc/src/tsc_component.cpp +++ b/protocols/systems/3g-324m_pvterminal/h324/tsc/src/tsc_component.cpp @@ -687,8 +687,7 @@ void TSC_component::SetAl2Sn(int width) /*****************************************************************************/ uint32 TSC_component::LcEtbIdc(PS_ControlMsgHeader pReceiveInf) { - TPVChannelId OpenLcn = (TPVChannelId)pReceiveInf->InfSupplement1 + - TSC_INCOMING_CHANNEL_MASK; + TPVChannelId OpenLcn = (TPVChannelId)pReceiveInf->InfSupplement1; PVLOGGER_LOGMSG(PVLOGMSG_INST_HLDBG, iLogger, PVLOGMSG_STACK_TRACE, (0, "TSC_component::LcEtbIdc lcn(%d)", OpenLcn)); PS_ForwardReverseParam pLcParam = (PS_ForwardReverseParam) pReceiveInf->pParameter; @@ -920,7 +919,7 @@ uint32 TSC_component::OpenLogicalChannel(TPVChannelId OpenLcn, /*****************************************************************************/ uint32 TSC_component::BlcEtbIdc(PS_ControlMsgHeader pReceiveInf) { - TPVChannelId OpenLcnB = pReceiveInf->InfSupplement1 + TSC_INCOMING_CHANNEL_MASK; /* incoming lcn */ + TPVChannelId OpenLcnB = pReceiveInf->InfSupplement1; /* incoming lcn */ TPVChannelId OpenLcnF = CHANNEL_ID_UNKNOWN; /* outgoing lcn */ PVLOGGER_LOGMSG(PVLOGMSG_INST_HLDBG, iLogger, PVLOGMSG_STACK_TRACE, (0, "TSC_component::BlcEtbIdc lcn(%d)", OpenLcnB)); @@ -1734,7 +1733,7 @@ OsclAny TSC_component::AcceptBLCRequest(TPVChannelId OpenLcnF, PVLOGGER_LOGMSG(PVLOGMSG_INST_HLDBG, iLogger, PVLOGMSG_STACK_TRACE, (0, "TSC: AcceptBLCRequest reverse(%d), forward(%d)\n", OpenLcnB, OpenLcnF)); /* RvsParameters are okay; accept the OLC */ - iTSCblc.BlcEtbRps(OpenLcnB - TSC_INCOMING_CHANNEL_MASK, OpenLcnF); + iTSCblc.BlcEtbRps(OpenLcnB, OpenLcnF); // Open the incoming and outgoing logical channels in the mux OlcParam* param = OpenLogicalChannel(INCOMING, OpenLcnB, @@ -1779,8 +1778,7 @@ uint32 TSC_component::LcRlsIdc(PS_ControlMsgHeader pReceiveInf) PVLOGGER_LOGMSG(PVLOGMSG_INST_HLDBG, iLogger, PVLOGMSG_STACK_TRACE, (0, "TSC_component::LcRlsIdc dir(%d), lcn(%d).", dir, pReceiveInf->InfSupplement1)); - TPVChannelId lcn = (dir == INCOMING) ? (TPVChannelId)(pReceiveInf->InfSupplement1 + - TSC_INCOMING_CHANNEL_MASK) : (TPVChannelId)pReceiveInf->InfSupplement1; + TPVChannelId lcn = (TPVChannelId)(pReceiveInf->InfSupplement1); PS_SourceCause_LcBlc sourceCause = (PS_SourceCause_LcBlc)pReceiveInf->pParameter; PVLOGGER_LOGMSG(PVLOGMSG_INST_HLDBG, iLogger, PVLOGMSG_STACK_TRACE, (0, "TSC_component::LcRlsIdc sourceCause(%x), cause index(%d)", @@ -1841,7 +1839,6 @@ uint32 TSC_component::BlcRlsIdc(PS_ControlMsgHeader pReceiveInf) if (pReceiveInf->Dir == S_ControlMsgHeader::INCOMING) { dir = INCOMING; - lcn += TSC_INCOMING_CHANNEL_MASK; } PVMFStatus status = PVMFSuccess; @@ -1892,10 +1889,6 @@ uint32 TSC_component::BlcRlsIdc(PS_ControlMsgHeader pReceiveInf) } } } - else if (dir == INCOMING) - { - lcn += TSC_INCOMING_CHANNEL_MASK; - } ChannelReleased(dir, lcn, status); if (to_be_opened_codec == PV_CODEC_TYPE_NONE) @@ -2234,7 +2227,7 @@ uint32 TSC_component::Status08Event19(PS_ControlMsgHeader pReceiveInf) /*****************************************************************************/ uint32 TSC_component::BlcEtbCfm(PS_ControlMsgHeader pReceiveInf) { - TPVChannelId incoming_lcn = pReceiveInf->InfSupplement2 + TSC_INCOMING_CHANNEL_MASK; + TPVChannelId incoming_lcn = pReceiveInf->InfSupplement2; OlcParam* olc_param = iOlcs.FindOlcGivenChannel(OUTGOING, pReceiveInf->InfSupplement1); if (olc_param == NULL) { @@ -2279,7 +2272,7 @@ uint32 TSC_component::BlcEtbCfm2(PS_ControlMsgHeader pReceiveInf) (0, "TSC_component::BlcEtbCfm2 forward(%d), reverse(%d))\n", pReceiveInf->InfSupplement1, pReceiveInf->InfSupplement2)); OlcParam* olc_param = iOlcs.FindOlcGivenChannel(INCOMING, - pReceiveInf->InfSupplement1 + TSC_INCOMING_CHANNEL_MASK); + pReceiveInf->InfSupplement1); if (olc_param == NULL) { PVLOGGER_LOGMSG(PVLOGMSG_INST_HLDBG, iLogger, PVLOGMSG_STACK_TRACE, diff --git a/protocols/systems/3g-324m_pvterminal/h324/tsc/src/tsc_h324m_config.cpp b/protocols/systems/3g-324m_pvterminal/h324/tsc/src/tsc_h324m_config.cpp index d46fe6e1c..9d28d2116 100644 --- a/protocols/systems/3g-324m_pvterminal/h324/tsc/src/tsc_h324m_config.cpp +++ b/protocols/systems/3g-324m_pvterminal/h324/tsc/src/tsc_h324m_config.cpp @@ -49,7 +49,9 @@ enum PVH234MessageType PVT_H324_COMMAND_SET_FAST_CSUP_OPTIONS, PVT_H324_COMMAND_SET_LOGICAL_CHANNEL_BUFFERING_MS, PVT_H324_COMMAND_SEND_USER_INPUT, - PVT_H324_COMMAND_SET_WNSRP + PVT_H324_COMMAND_SET_WNSRP, + PVT_H324_COMMAND_SEND_LOGICAL_CHANNEL_ACTIVE_INDICATION, + PVT_H324_COMMAND_SEND_LOGICAL_CHANNEL_INACTIVE_INDICATION }; class CPVH324InterfaceCmdMessage : public CPVCmnInterfaceCmdMessage @@ -462,6 +464,30 @@ class PVH324MessageSendVideoSpatialTemporalTradeoffIndication : public CPVH324In uint8 iTradeoff; }; +class PVH324MessageSendLogicalChannelActiveIndication : public CPVH324InterfaceCmdMessage +{ + public: + PVH324MessageSendLogicalChannelActiveIndication(TPVChannelId aLogicalChannel, + OsclAny* aContextData, + TPVCmnCommandId aId) + : CPVH324InterfaceCmdMessage(PVT_H324_COMMAND_SEND_LOGICAL_CHANNEL_ACTIVE_INDICATION, aContextData, aId), + iLogicalChannel(aLogicalChannel) + {} + TPVChannelId iLogicalChannel; +}; + +class PVH324MessageSendLogicalChannelInactiveIndication : public CPVH324InterfaceCmdMessage +{ + public: + PVH324MessageSendLogicalChannelInactiveIndication(TPVChannelId aLogicalChannel, + OsclAny* aContextData, + TPVCmnCommandId aId) + : CPVH324InterfaceCmdMessage(PVT_H324_COMMAND_SEND_LOGICAL_CHANNEL_INACTIVE_INDICATION, aContextData, aId), + iLogicalChannel(aLogicalChannel) + {} + TPVChannelId iLogicalChannel; +}; + class PVH324MessageSendSkewIndication : public CPVH324InterfaceCmdMessage { public: @@ -614,6 +640,12 @@ class PVH324MessageUtils case PVT_H324_COMMAND_SEND_VIDEO_SPATIAL_TEMPORAL_TRADEOFF_INDICATION: OSCL_DELETE((PVH324MessageSendVideoSpatialTemporalTradeoffIndication*)aCmd); break; + case PVT_H324_COMMAND_SEND_LOGICAL_CHANNEL_ACTIVE_INDICATION: + OSCL_DELETE((PVH324MessageSendLogicalChannelActiveIndication*)aCmd); + break; + case PVT_H324_COMMAND_SEND_LOGICAL_CHANNEL_INACTIVE_INDICATION: + OSCL_DELETE((PVH324MessageSendLogicalChannelInactiveIndication*)aCmd); + break; case PVT_H324_COMMAND_SEND_SKEW_INDICATION: OSCL_DELETE((PVH324MessageSendSkewIndication*)aCmd); break; @@ -683,7 +715,6 @@ void H324MConfig::Run() PVMFCommandId H324MConfig::SetMultiplexLevel(TPVH223Level aLevel, OsclAny* aContextData) { - OSCL_UNUSED_ARG(aContextData); iH324M->SetMultiplexLevel(aLevel); SendCmdResponse(iCommandId, aContextData, PVMFSuccess); return iCommandId++; @@ -691,7 +722,6 @@ PVMFCommandId H324MConfig::SetMultiplexLevel(TPVH223Level aLevel, OsclAny* aCont PVMFCommandId H324MConfig::SetMaxSduSize(TPVAdaptationLayer aLayer, int32 aSize, OsclAny* aContextData) { - OSCL_UNUSED_ARG(aContextData); iH324M->SetSduSize(OUTGOING, (uint16)aSize, aLayer); SendCmdResponse(iCommandId, aContextData, PVMFSuccess); return iCommandId++; @@ -699,7 +729,6 @@ PVMFCommandId H324MConfig::SetMaxSduSize(TPVAdaptationLayer aLayer, int32 aSize, PVMFCommandId H324MConfig::SetMaxSduSizeR(TPVAdaptationLayer aLayer, int32 aSize, OsclAny* aContextData) { - OSCL_UNUSED_ARG(aContextData); iH324M->SetSduSize(INCOMING, (uint16)aSize, aLayer); SendCmdResponse(iCommandId, aContextData, PVMFSuccess); return iCommandId++; @@ -711,7 +740,6 @@ PVMFCommandId H324MConfig::SetCodecPreference(Oscl_Vector<PVMFFormatType, OsclMe Oscl_Vector<PVMFFormatType, OsclMemAllocator>& aOutgoingVideo, OsclAny* aContextData) { - OSCL_UNUSED_ARG(aContextData); iH324M->SetCodecPreference(aIncomingAudio, aIncomingVideo, aOutgoingAudio, aOutgoingVideo); SendCmdResponse(iCommandId, aContextData, PVMFSuccess); return iCommandId++; @@ -720,7 +748,6 @@ PVMFCommandId H324MConfig::SetCodecPreference(Oscl_Vector<PVMFFormatType, OsclMe PVMFCommandId H324MConfig::SetFormatSpecificInfo(PVMFFormatType aMediaFormat, const uint8* apFormatSpecificInfo, uint32 aFormatSpecificInfoLen, OsclAny* aContextData) { - OSCL_UNUSED_ARG(aContextData); iH324M->SetFormatSpecificInfo(aMediaFormat, apFormatSpecificInfo, aFormatSpecificInfoLen); SendCmdResponse(iCommandId, aContextData, PVMFSuccess); return iCommandId++; @@ -728,7 +755,6 @@ PVMFCommandId H324MConfig::SetFormatSpecificInfo(PVMFFormatType aMediaFormat, co PVMFCommandId H324MConfig::SetAl2SequenceNumbers(int32 aSeqNumWidth, OsclAny* aContextData) { - OSCL_UNUSED_ARG(aContextData); iH324M->SetAl2Sn(aSeqNumWidth); SendCmdResponse(iCommandId, aContextData, PVMFSuccess); return iCommandId++; @@ -736,7 +762,6 @@ PVMFCommandId H324MConfig::SetAl2SequenceNumbers(int32 aSeqNumWidth, OsclAny* aC PVMFCommandId H324MConfig::SetAl3ControlFieldOctets(int32 aCfo, OsclAny* aContextData) { - OSCL_UNUSED_ARG(aContextData); iH324M->SetAl3ControlFieldOctets(aCfo); SendCmdResponse(iCommandId, aContextData, PVMFSuccess); return iCommandId++; @@ -744,7 +769,6 @@ PVMFCommandId H324MConfig::SetAl3ControlFieldOctets(int32 aCfo, OsclAny* aContex PVMFCommandId H324MConfig::SetOutoingPduType(TPVH223MuxPduType aOutgoingPduType, OsclAny* aContextData) { - OSCL_UNUSED_ARG(aContextData); iH324M->SetMaxOutgoingPduSize((uint16)aOutgoingPduType); SendCmdResponse(iCommandId, aContextData, PVMFSuccess); return iCommandId++; @@ -752,7 +776,6 @@ PVMFCommandId H324MConfig::SetOutoingPduType(TPVH223MuxPduType aOutgoingPduType, PVMFCommandId H324MConfig::SetMaxPduSize(int32 aMaxPduSize, OsclAny* aContextData) { - OSCL_UNUSED_ARG(aContextData); iH324M->SetMaxMuxPduSize((uint16)aMaxPduSize); SendCmdResponse(iCommandId, aContextData, PVMFSuccess); return iCommandId++; @@ -760,7 +783,6 @@ PVMFCommandId H324MConfig::SetMaxPduSize(int32 aMaxPduSize, OsclAny* aContextDat PVMFCommandId H324MConfig::SetTerminalType(uint8 aTerminalType, OsclAny* aContextData) { - OSCL_UNUSED_ARG(aContextData); iH324M->SetTerminalType(aTerminalType); SendCmdResponse(iCommandId, aContextData, PVMFSuccess); return iCommandId++; @@ -769,7 +791,6 @@ PVMFCommandId H324MConfig::SetTerminalType(uint8 aTerminalType, OsclAny* aContex PVMFCommandId H324MConfig::SetALConfiguration(TPVMediaType_t aMediaType, TPVAdaptationLayer aLayer, bool aAllow, bool aUse, OsclAny* aContextData) { - OSCL_UNUSED_ARG(aContextData); iH324M->SetAlConfig(aMediaType, aLayer, aAllow, aUse); SendCmdResponse(iCommandId, aContextData, PVMFSuccess); return iCommandId++; @@ -777,7 +798,6 @@ PVMFCommandId H324MConfig::SetALConfiguration(TPVMediaType_t aMediaType, TPVAdap PVMFCommandId H324MConfig::SendRme(OsclAny* aContextData) { - OSCL_UNUSED_ARG(aContextData); iH324M->RmeSendReq(); SendCmdResponse(iCommandId, aContextData, PVMFSuccess); return iCommandId++; @@ -786,7 +806,6 @@ PVMFCommandId H324MConfig::SendRme(OsclAny* aContextData) PVMFCommandId H324MConfig::SetMaxMuxPduSize(int32 aRequestMaxMuxPduSize, OsclAny* aContextData) { - OSCL_UNUSED_ARG(aContextData); iH324M->SetMaxMuxPduSize((uint16)aRequestMaxMuxPduSize); SendCmdResponse(iCommandId, aContextData, PVMFSuccess); return iCommandId++; @@ -794,7 +813,6 @@ PVMFCommandId H324MConfig::SetMaxMuxPduSize(int32 aRequestMaxMuxPduSize, OsclAny PVMFCommandId H324MConfig::SetMaxMuxCcsrlSduSize(int32 aMaxCcsrlSduSize, OsclAny* aContextData) { - OSCL_UNUSED_ARG(aContextData); iH324M->SetMaxCcsrlSduSize(aMaxCcsrlSduSize); SendCmdResponse(iCommandId, aContextData, PVMFSuccess); return iCommandId++; @@ -803,14 +821,12 @@ PVMFCommandId H324MConfig::SetMaxMuxCcsrlSduSize(int32 aMaxCcsrlSduSize, OsclAny PVMFCommandId H324MConfig::FastUpdate(PVMFNodeInterface& aTrack, OsclAny* aContextData) { OSCL_UNUSED_ARG(aTrack); - OSCL_UNUSED_ARG(aContextData); SendCmdResponse(iCommandId, aContextData, PVMFSuccess); return iCommandId++; }; PVMFCommandId H324MConfig::SendRtd(OsclAny* aContextData) { - OSCL_UNUSED_ARG(aContextData); iH324M->RtdTrfReq(); SendCmdResponse(iCommandId, aContextData, PVMFSuccess); return iCommandId++; @@ -821,8 +837,6 @@ PVMFCommandId H324MConfig::SetVendor(uint8 aCc, uint8 aExt, uint32 aMc, const uint8* aVersion, uint16 aVersionLen, OsclAny* aContextData) { - OSCL_UNUSED_ARG(aContextData); - TPVH245Vendor* h245vendor = OSCL_NEW(TPVVendorH221NonStandard, (aCc, aExt, aMc)); iH324M->SetVendorIdInfo(h245vendor, @@ -835,7 +849,6 @@ PVMFCommandId H324MConfig::SetVendor(uint8 aCc, uint8 aExt, uint32 aMc, PVMFCommandId H324MConfig::SendEndSession(OsclAny* aContextData) { - OSCL_UNUSED_ARG(aContextData); iH324M->EndSessionCommand(); SendCmdResponse(iCommandId, aContextData, PVMFSuccess); return iCommandId++; @@ -843,7 +856,6 @@ PVMFCommandId H324MConfig::SendEndSession(OsclAny* aContextData) PVMFCommandId H324MConfig::SetEndSessionTimeout(uint32 aTimeout, OsclAny* aContextData) { - OSCL_UNUSED_ARG(aContextData); iH324M->SetEndSessionTimeout(aTimeout); SendCmdResponse(iCommandId, aContextData, PVMFSuccess); return iCommandId++; @@ -854,7 +866,6 @@ PVMFCommandId H324MConfig::SetTimerCounter(TPVH324TimerCounter aTimerCounter, uint32 aValue, OsclAny* aContextData) { - OSCL_UNUSED_ARG(aContextData); iH324M->SetTimerCounter(aTimerCounter, aSeries, aSeriesOffset, aValue); SendCmdResponse(iCommandId, aContextData, PVMFSuccess); return iCommandId++; @@ -864,7 +875,6 @@ PVMFCommandId H324MConfig::SetVideoResolutions(TPVDirection aDirection, Oscl_Vector<PVMFVideoResolutionRange, OsclMemAllocator>& aResolutions, OsclAny* aContextData) { - OSCL_UNUSED_ARG(aContextData); iH324M->SetVideoResolutions(aDirection, aResolutions); SendCmdResponse(iCommandId, aContextData, PVMFSuccess); return iCommandId++; @@ -872,7 +882,6 @@ PVMFCommandId H324MConfig::SetVideoResolutions(TPVDirection aDirection, PVMFCommandId H324MConfig::SendVendorId(OsclAny* aContextData) { - OSCL_UNUSED_ARG(aContextData); iH324M->Tsc_IdcVi(); SendCmdResponse(iCommandId, aContextData, PVMFSuccess); return iCommandId++; @@ -881,7 +890,6 @@ PVMFCommandId H324MConfig::SendVendorId(OsclAny* aContextData) PVMFCommandId H324MConfig::SendVideoTemporalSpatialTradeoffCommand(TPVChannelId aLogicalChannel, uint8 aTradeoff, OsclAny* aContextData) { - OSCL_UNUSED_ARG(aContextData); iH324M->SendVideoTemporalSpatialTradeoffCommand(aLogicalChannel, aTradeoff); SendCmdResponse(iCommandId, aContextData, PVMFSuccess); return iCommandId++; @@ -890,16 +898,31 @@ PVMFCommandId H324MConfig::SendVideoTemporalSpatialTradeoffCommand(TPVChannelId PVMFCommandId H324MConfig::SendVideoTemporalSpatialTradeoffIndication(TPVChannelId aLogicalChannel, uint8 aTradeoff, OsclAny* aContextData) { - OSCL_UNUSED_ARG(aContextData); iH324M->SendVideoTemporalSpatialTradeoffIndication(aLogicalChannel, aTradeoff); SendCmdResponse(iCommandId, aContextData, PVMFSuccess); return iCommandId++; } +PVMFCommandId H324MConfig::SendLogicalChannelActiveIndication(TPVChannelId aLogicalChannel, + OsclAny* aContextData) +{ + iH324M->SendLogicalChannelActiveIndication(aLogicalChannel); + SendCmdResponse(iCommandId, aContextData, PVMFSuccess); + return iCommandId++; +} + + +PVMFCommandId H324MConfig::SendLogicalChannelInactiveIndication(TPVChannelId aLogicalChannel, + OsclAny* aContextData) +{ + iH324M->SendLogicalChannelInactiveIndication(aLogicalChannel); + SendCmdResponse(iCommandId, aContextData, PVMFSuccess); + return iCommandId++; +} + PVMFCommandId H324MConfig::SendSkewIndication(TPVChannelId aLogicalChannel1, TPVChannelId aLogicalChannel2, uint16 aSkew, OsclAny* aContextData) { - OSCL_UNUSED_ARG(aContextData); iH324M->SendSkewIndication(aLogicalChannel1, aLogicalChannel2, aSkew); SendCmdResponse(iCommandId, aContextData, PVMFSuccess); return iCommandId++; @@ -911,7 +934,6 @@ H324MConfig::SetLogicalChannelBufferingMs(uint32 aInBufferingMs, uint32 aOutBufferingMs, OsclAny* aContextData) { - OSCL_UNUSED_ARG(aContextData); iH324M->SetLogicalChannelBufferingMs(aInBufferingMs, aOutBufferingMs); SendCmdResponse(iCommandId, aContextData, PVMFSuccess); return iCommandId++; @@ -921,7 +943,6 @@ PVMFCommandId H324MConfig::SendUserInput(CPVUserInput* aUserInput, OsclAny* aContextData) { - OSCL_UNUSED_ARG(aContextData); switch (aUserInput->GetType()) { case EAlphanumeric: @@ -958,7 +979,6 @@ H324MConfig::SendUserInput(CPVUserInput* aUserInput, PVMFCommandId H324MConfig::SetWnsrp(const bool aEnableWnsrp, OsclAny* aContextData) { - OSCL_UNUSED_ARG(aContextData); iH324M->SetWnsrp(aEnableWnsrp); SendCmdResponse(iCommandId, aContextData, PVMFSuccess); return iCommandId++; @@ -1075,6 +1095,26 @@ void H324MConfig::VideoSpatialTemporalTradeoffIndicationReceived(TPVChannelId id SendAsyncEvent(event); } + +void H324MConfig::LogicalChannelActiveIndicationReceived(TPVChannelId id) +{ + PVMFAsyncEvent event(PVMFInfoEvent, PV_INDICATION_LOGICAL_CHANNEL_ACTIVE, NULL, NULL); + oscl_memset(event.GetLocalBuffer(), 0, PVMF_ASYNC_EVENT_LOCAL_BUF_SIZE); + event.GetLocalBuffer()[0] = (uint8)((id >> 8) & 0xFF); + event.GetLocalBuffer()[1] = (uint8)(id & 0xFF); + SendAsyncEvent(event); +} + + +void H324MConfig::LogicalChannelInactiveIndicationReceived(TPVChannelId id) +{ + PVMFAsyncEvent event(PVMFInfoEvent, PV_INDICATION_LOGICAL_CHANNEL_INACTIVE, NULL, NULL); + oscl_memset(event.GetLocalBuffer(), 0, PVMF_ASYNC_EVENT_LOCAL_BUF_SIZE); + event.GetLocalBuffer()[0] = (uint8)((id >> 8) & 0xFF); + event.GetLocalBuffer()[1] = (uint8)(id & 0xFF); + SendAsyncEvent(event); +} + void H324MConfig::SkewIndicationReceived(TPVChannelId lcn1, TPVChannelId lcn2, uint16 skew) { PVMFAsyncEvent event(PVMFInfoEvent, PV_INDICATION_SKEW, NULL, NULL); @@ -1418,6 +1458,30 @@ PVMFCommandId H324MConfigProxied::SendVideoTemporalSpatialTradeoffIndication(TPV return iCommandId++; } +PVMFCommandId H324MConfigProxied::SendLogicalChannelActiveIndication(TPVChannelId aLogicalChannel, + OsclAny* aContextData) +{ + PVH324MessageSendLogicalChannelActiveIndication *cmd = NULL; + cmd = OSCL_NEW(PVH324MessageSendLogicalChannelActiveIndication, (aLogicalChannel, aContextData, iCommandId)); + int32 error = 0; + OSCL_TRY(error, iMainProxy->SendCommand(iProxyId, cmd)); + OSCL_FIRST_CATCH_ANY(error, PVH324MessageUtils::DestroyMessage(cmd);); + return iCommandId++; +} + + +PVMFCommandId H324MConfigProxied::SendLogicalChannelInactiveIndication(TPVChannelId aLogicalChannel, + OsclAny* aContextData) +{ + PVH324MessageSendLogicalChannelInactiveIndication *cmd = NULL; + cmd = OSCL_NEW(PVH324MessageSendLogicalChannelInactiveIndication, (aLogicalChannel, aContextData, iCommandId)); + int32 error = 0; + OSCL_TRY(error, iMainProxy->SendCommand(iProxyId, cmd)); + OSCL_FIRST_CATCH_ANY(error, PVH324MessageUtils::DestroyMessage(cmd);); + return iCommandId++; +} + + PVMFCommandId H324MConfigProxied::SendSkewIndication(TPVChannelId aLogicalChannel1, TPVChannelId aLogicalChannel2, uint16 aSkew, OsclAny* aContextData) { @@ -1844,6 +1908,44 @@ void H324MConfigProxied::HandleCommand(TPVProxyMsgId aMsgId, OsclAny *aMsg) } } break; + case PVT_H324_COMMAND_SEND_LOGICAL_CHANNEL_ACTIVE_INDICATION: + PVLOGGER_LOGMSG(PVLOGMSG_INST_HLDBG, iLoggerServer, PVLOGMSG_STACK_TRACE, + (0, "H324MConfigProxied::HandleCommand - Logical Channel Active indication")); + { + PVH324MessageSendLogicalChannelActiveIndication* msg = + OSCL_STATIC_CAST(PVH324MessageSendLogicalChannelActiveIndication*, aMsg); + if (msg) + { + commandId = iH324MConfigIF->SendLogicalChannelActiveIndication(msg->iLogicalChannel, (CPVCmnInterfaceCmdMessage*)aMsg); + } + else + { + PVLOGGER_LOGMSG(PVLOGMSG_INST_HLDBG, iLoggerServer, PVLOGMSG_STACK_TRACE, + (0, "H324MConfigProxied::HandleCommand - Failed to cast")); + } + } + break; + + case PVT_H324_COMMAND_SEND_LOGICAL_CHANNEL_INACTIVE_INDICATION: + PVLOGGER_LOGMSG(PVLOGMSG_INST_HLDBG, iLoggerServer, PVLOGMSG_STACK_TRACE, + (0, "H324MConfigProxied::HandleCommand - Logical Channel inactive indication")); + { + PVH324MessageSendLogicalChannelInactiveIndication* msg = + OSCL_STATIC_CAST(PVH324MessageSendLogicalChannelInactiveIndication*, aMsg); + if (msg) + { + commandId = iH324MConfigIF->SendLogicalChannelInactiveIndication(msg->iLogicalChannel, (CPVCmnInterfaceCmdMessage*)aMsg); + } + else + { + PVLOGGER_LOGMSG(PVLOGMSG_INST_HLDBG, iLoggerServer, PVLOGMSG_STACK_TRACE, + (0, "H324MConfigProxied::HandleCommand - Failed to cast")); + } + } + break; + + + case PVT_H324_COMMAND_SEND_VENDOR_ID: PVLOGGER_LOGMSG(PVLOGMSG_INST_HLDBG, iLoggerServer, PVLOGMSG_STACK_TRACE, (0, "H324MConfigProxied::HandleCommand - Send vendor id")); diff --git a/protocols/systems/3g-324m_pvterminal/h324/tsc/src/tsc_indication.cpp b/protocols/systems/3g-324m_pvterminal/h324/tsc/src/tsc_indication.cpp index 1b0cfdf8d..febbf8dd0 100644 --- a/protocols/systems/3g-324m_pvterminal/h324/tsc/src/tsc_indication.cpp +++ b/protocols/systems/3g-324m_pvterminal/h324/tsc/src/tsc_indication.cpp @@ -341,9 +341,17 @@ void TSC_324m::IndicationMisc(TIndicationMisc type, { case EVideoTemporalSpatialTradeOffIdc: miscellaneousIndication.logicalChannelNumber = (uint16)channelId; - miscellaneousIndication.miType.index = 9; + miscellaneousIndication.miType.index = EVideoTemporalSpatialTradeOffIdc; miscellaneousIndication.miType.videoTemporalSpatialTradeOff = (uint8)param; break; + case ELogicalChannelActiveIdc: + miscellaneousIndication.logicalChannelNumber = (uint16)channelId; + miscellaneousIndication.miType.index = ELogicalChannelActiveIdc; + break; + case ELogicalChannelInactiveIdc: + miscellaneousIndication.logicalChannelNumber = (uint16)channelId; + miscellaneousIndication.miType.index = ELogicalChannelInactiveIdc; + break; default: return; } @@ -380,6 +388,22 @@ uint32 TSC_324m::MiscIndicationRecv(PS_ControlMsgHeader pReceiveInf) indication->logicalChannelNumber, indication->miType.index)); switch (indication->miType.index) { + case 0: + PVLOGGER_LOGMSG(PVLOGMSG_INST_HLDBG, iLogger, PVLOGMSG_STACK_TRACE, + (0, "TSC_324m::MiscIndicationRecv LogicalChannelActive")); + if (iTSC_324mObserver) + { + iTSC_324mObserver->LogicalChannelActiveIndicationReceived(indication->logicalChannelNumber); + } + break; + case 1: + PVLOGGER_LOGMSG(PVLOGMSG_INST_HLDBG, iLogger, PVLOGMSG_STACK_TRACE, + (0, "TSC_324m::MiscIndicationRecv LogicalChannelInactive")); + if (iTSC_324mObserver) + { + iTSC_324mObserver->LogicalChannelInactiveIndicationReceived(indication->logicalChannelNumber); + } + break; case 9: PVLOGGER_LOGMSG(PVLOGMSG_INST_HLDBG, iLogger, PVLOGMSG_STACK_TRACE, (0, "TSC_324m::MiscIndicationRecv videoSpatialTemporalTradeoff(%d)", diff --git a/protocols/systems/3g-324m_pvterminal/h324/tsc/src/tscmain.cpp b/protocols/systems/3g-324m_pvterminal/h324/tsc/src/tscmain.cpp index f7241d3ae..d3a9d6125 100644 --- a/protocols/systems/3g-324m_pvterminal/h324/tsc/src/tscmain.cpp +++ b/protocols/systems/3g-324m_pvterminal/h324/tsc/src/tscmain.cpp @@ -991,6 +991,39 @@ TPVStatusCode TSC_324m::RequestFrameUpdate(PVMFPortInterface* port) return EPVT_Success; } +PVMFStatus TSC_324m::SetLogicalChannelPause(TPVChannelId aChannelId, TPVDirection aDir, bool aPause) +{ + PVLOGGER_LOGMSG(PVLOGMSG_INST_HLDBG, iLogger, PVLOGMSG_STACK_TRACE, + (0, "TSC_324m::SetPause ChannelId(%d), Direction(%d), Pause(%d)", aChannelId, aDir, aPause)); + + H223LogicalChannel* pChannel = NULL; + + if (iH223->GetLogicalChannel(aDir, aChannelId, &pChannel) != PVMFSuccess) + { + PVLOGGER_LOGMSG(PVLOGMSG_INST_HLDBG, iLogger, PVLOGMSG_ERR, + (0, "TSC_324m::SetPause ChannelId(%d), Could not find the channel, Direction(%d)", aChannelId, aDir)); + } + + if (aPause) + { + pChannel->Pause(); + if (aDir == OUTGOING) + { + SendLogicalChannelInactiveIndication(aChannelId); + } + } + else + { + pChannel->Resume(); + if (aDir == OUTGOING) + { + SendLogicalChannelActiveIndication(aChannelId); + } + } + + return PVMFSuccess; +} + TPVStatusCode TSC_324m::RequestMaxMuxPduSize(unsigned aPduSize) { if ((GetTerminalStatus() != PhaseD_CSUP) && (GetTerminalStatus() != PhaseE_Comm)) @@ -2331,6 +2364,34 @@ void TSC_324m::SendVideoTemporalSpatialTradeoffIndication(TPVChannelId aLogicalC aTradeoff); } +void TSC_324m::SendLogicalChannelActiveIndication(TPVChannelId aLogicalChannel) +{ + PVLOGGER_LOGMSG(PVLOGMSG_INST_HLDBG, iLogger, PVLOGMSG_STACK_TRACE, + (0, "TSC_324m::SendLogicalChannelActiveIndication aLogicalChannel=%d", aLogicalChannel)); + if (iTerminalStatus != PhaseE_Comm) + { + PVLOGGER_LOGMSG(PVLOGMSG_INST_HLDBG, iLogger, PVLOGMSG_STACK_TRACE, + (0, "TSC_324m::SendLogicalChannelActiveIndication Ignoring due to invalid state.")); + return; + } + uint32 tradeoff = 0; // dummy tradeoff just for fullfiling the argument list + IndicationMisc(ELogicalChannelActiveIdc, aLogicalChannel, tradeoff); +} + +void TSC_324m::SendLogicalChannelInactiveIndication(TPVChannelId aLogicalChannel) +{ + PVLOGGER_LOGMSG(PVLOGMSG_INST_HLDBG, iLogger, PVLOGMSG_STACK_TRACE, + (0, "TSC_324m::SendLogicalChannelInactiveIndication aLogicalChannel=%d", aLogicalChannel)); + if (iTerminalStatus != PhaseE_Comm) + { + PVLOGGER_LOGMSG(PVLOGMSG_INST_HLDBG, iLogger, PVLOGMSG_STACK_TRACE, + (0, "TSC_324m::SendLogicalChannelInactiveIndication Ignoring due to invalid state.")); + return; + } + uint32 tradeoff = 0; // dummy tradeoff just for fullfiling the argument list + IndicationMisc(ELogicalChannelInactiveIdc, aLogicalChannel, tradeoff); +} + void TSC_324m::SendSkewIndication(TPVChannelId aLogicalChannel1, TPVChannelId aLogicalChannel2, diff --git a/protocols/systems/common/include/pv_2way_basic_types.h b/protocols/systems/common/include/pv_2way_basic_types.h index 2c597cc7e..319b0c794 100644 --- a/protocols/systems/common/include/pv_2way_basic_types.h +++ b/protocols/systems/common/include/pv_2way_basic_types.h @@ -211,16 +211,18 @@ enum TPVTIndicationType **/ PVT_INDICATION_CLOSE_TRACK, /** - * Indicates that the remote terminal has paused an incoming track. Any media sink + * Indicates that local terminal has paused an incoming track. Any media sink * associated with this will be stopped. - * + * The first octet of the local buffer indicates the direction of the track. + * The second and third octets indicates the track id. **/ PVT_INDICATION_PAUSE_TRACK, /** - * Indicates that the remote terminal has resumed an incoming track. Any media sink + * Indicates that local terminal has resumed an incoming track. Any media sink * associated with this will be restarted. - * + * The first octet of the local buffer indicates the direction of the track. + * The second and third octets indicates the track id. **/ PVT_INDICATION_RESUME_TRACK, /** |