[prev in list] [next in list] [prev in thread] [next in thread] 

List:       helix-datatype-cvs
Subject:    [Datatype-cvs] mp4/payload mp4apyld.cpp, 1.32, 1.33 mp4gpyld.cpp,
From:       xiaochengli () helixcommunity ! org
Date:       2011-12-23 11:50:26
[Download RAW message or body]

Update of /cvsroot/datatype/mp4/payload
In directory cvs01.internal.helixcommunity.org:/tmp/cvs-serv21505

Modified Files:
	mp4apyld.cpp mp4gpyld.cpp 
Log Message:

Synopsis:
=========
This fix is for PR269464: iphone segments stop streaming after 24hrs or more uptime \
on Solaris

Branch: HEAD, SERVER_14_3_RN
Suggested Reviewers: Chytanya, Anyone
Reviewed by: Chytanya

Description:
=========
This description reports that rtp live feed can't work for HLS client after 24hr, \
actually if we add RTP time from RTPBCStreamsObject::PacketReady to make it repro \
easier, on both windows and solaris we can't see correct picture/audio on iPad.  \
There're another PR262104, which has a similar roll-over for h264. The original \
check-in description is: 

" In the h264 depacketizer, we use rtp2hxa to calculate the media time.  This assumes \
that the packets starting from (rtp = 0, media time = 0), and is okay for on-demand \
content.  But for live packets, the rtp time rolls over in a few hours and everything \
falls apart. The bug shows up in the flash live playback where the delta between \
composition(presentation, media, whatever:-) time and decode(delivery) time is huge \
because the incorrect rtp time conversion. Since live packets are only from the \
server, the fix is to query the IHXServerPacketExt and get the media time, instead of \
doing the conversion. "


This fix includes: 
Porting the same code from h264pyld to mp4apyld and mp4gpyld as PR262104, to use \
milliseconds from packet directly if available. 

Files affected:
=========
datatype/mp4/payload/mp4apyld.cpp
datatype/mp4/payload/pub/mp4apyld.h
datatype/mp4/payload/mp4gpyld.cpp
datatype/mp4/payload/pub/mp4gpyld.h
datatype_rn/mpeg2/ts/muxer/tsmux.cpp

Testing Performed:
=========
Unit Tests: N/A
Integration Tests: 
Test on windows/solaris, after changing RTPTime in RTPBCStreamsObject::PacketReady, \
it can work well for packets/feeds with big RTP time.  I'm running a long time \
testing and check if it can insist more than 24 hrs. 

Leak Tests: None
Performance Tests: N/A

Platforms Tested: win-x86_64-vc10, Solaris 64 Builds Verified: win-x86_64-vc10, \
Solaris 64

QA Hints
========
Need to test live feeds from RBS/rtpencoder/rtmp to HLS for a long time(e.p, 13hr, \
24hr, 27hr). 



Index: mp4apyld.cpp
===================================================================
RCS file: /cvsroot/datatype/mp4/payload/mp4apyld.cpp,v
retrieving revision 1.32
retrieving revision 1.33
diff -u -d -r1.32 -r1.33
--- mp4apyld.cpp	29 Sep 2011 01:13:52 -0000	1.32
+++ mp4apyld.cpp	23 Dec 2011 11:50:23 -0000	1.33
@@ -78,6 +78,7 @@
     , m_bFlushed            (FALSE)
     , m_bUsesRTPPackets     (FALSE)
     , m_bRTPPacketTested    (FALSE)
+    , m_bUsesServerPacketExt(FALSE)
     , m_bPacketize          (FALSE)
     , m_bPriorLoss          (FALSE)
 #if defined(HELIX_FEATURE_AUDIO_MPEG4_DEPACK_LATM)
@@ -822,6 +823,21 @@
     if (!m_bRTPPacketTested)
     {
         IHXRTPPacket* pRTPPacket = NULL;
+        IHXServerPacketExt* pServerPacketExt = NULL;
+        
+        if(pPacket->QueryInterface(IID_IHXServerPacketExt,
+                                   (void**) &pServerPacketExt) == HXR_OK)
+        {
+            //if the media time is set, we will use it, no need to do rtp time \
conversion +            //most likely this will be a live stream for the server
+    
+            //we need to do this because there may be time rollover in the live \
scenario, +            //and the converter won't get it right after that.
+            UINT32 ulMediaTime = pServerPacketExt->GetMilliSecondTS();
+    
+            m_bUsesServerPacketExt = (ulMediaTime != 0);
+            HX_RELEASE(pServerPacketExt);
+        }
 
         m_bUsesRTPPackets = (pPacket->QueryInterface(
                                 IID_IHXRTPPacket,
@@ -1583,6 +1599,11 @@
     ULONG32 ulTime;
 
     HX_ASSERT(pPacket);
+    
+    if(m_bUsesServerPacketExt)
+    {
+        return ((IHXServerPacketExt*)pPacket)->GetMilliSecondTS();
+    }
 
     if (m_bUsesRTPPackets)
     {

Index: mp4gpyld.cpp
===================================================================
RCS file: /cvsroot/datatype/mp4/payload/mp4gpyld.cpp,v
retrieving revision 1.20
retrieving revision 1.21
diff -u -d -r1.20 -r1.21
--- mp4gpyld.cpp	15 Nov 2011 01:06:42 -0000	1.20
+++ mp4gpyld.cpp	23 Dec 2011 11:50:23 -0000	1.21
@@ -81,19 +81,20 @@
 #include "mp4gpyld.h"
 
 MP4GPayloadFormat::MP4GPayloadFormat()
-    : m_lRefCount	    (0)
+    : m_lRefCount           (0)
     , m_pClassFactory	    (NULL)
     , m_pStreamHeader	    (NULL)
-    , m_bFlushed	    (FALSE)
+    , m_bFlushed            (FALSE)
     , m_bUsesRTPPackets	    (FALSE)
     , m_bRTPPacketTested    (FALSE)
-    , m_bPacketize	    (FALSE)
-    , m_bPriorLoss	    (FALSE)
+    , m_bUsesServerPacketExt(FALSE)
+    , m_bPacketize          (FALSE)
+    , m_bPriorLoss          (FALSE)
     , m_bStartPacket	    (TRUE)
     , m_ulFrameCount	    (0)
     , m_pPacketFragments    (NULL)
     , m_pAUFragments	    (NULL)
-    , m_pAUPackets	    (NULL)
+    , m_pAUPackets          (NULL)
     , m_ulNumPacketFragments(0)
     , m_ulNumAUFragments    (0)
     , m_ulNumAUPackets	    (0)
@@ -664,6 +665,21 @@
     if (!m_bRTPPacketTested)
     {
 	IHXRTPPacket* pRTPPacket = NULL;
+    IHXServerPacketExt* pServerPacketExt = NULL;
+
+    if(pPacket->QueryInterface(IID_IHXServerPacketExt,
+                               (void**) &pServerPacketExt) == HXR_OK)
+    {
+        //if the media time is set, we will use it, no need to do rtp time \
conversion +        //most likely this will be a live stream for the server
+
+        //we need to do this because there may be time rollover in the live \
scenario, +        //and the converter won't get it right after that.
+        UINT32 ulMediaTime = pServerPacketExt->GetMilliSecondTS();
+
+        m_bUsesServerPacketExt = (ulMediaTime != 0);
+        HX_RELEASE(pServerPacketExt);
+    }
 
 	m_bUsesRTPPackets = (pPacket->QueryInterface(
 				IID_IHXRTPPacket,
@@ -1769,13 +1785,18 @@
 
     HX_ASSERT(pPacket);
 
+    if(m_bUsesServerPacketExt)
+    {
+        return ((IHXServerPacketExt*)pPacket)->GetMilliSecondTS();
+    }
+    
     if (m_bUsesRTPPackets)
     {
-	ulTime = ((IHXRTPPacket*) pPacket)->GetRTPTime();
+        ulTime = ((IHXRTPPacket*) pPacket)->GetRTPTime();
     }
     else
     {
-	ulTime = pPacket->GetTime();
+        ulTime = pPacket->GetTime();
     }
 
     ulTime = m_TSConverter.Convert(ulTime);


_______________________________________________
Datatype-cvs mailing list
Datatype-cvs@helixcommunity.org
http://lists.helixcommunity.org/mailman/listinfo/datatype-cvs


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic