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

List:       helix-datatype-cvs
Subject:    [Datatype-cvs]
From:       sfu () helixcommunity ! org
Date:       2007-05-25 0:39:31
Message-ID: 200705250040.l4P0eEQT000924 () mailer ! progressive-comp ! com
[Download RAW message or body]

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

Modified Files:
      Tag: hxclient_1_5_0_cayenne
	avcsh.cpp mp4sm.cpp 
Log Message:
correct way of detecting and stripping MLTI header

Index: mp4sm.cpp
===================================================================
RCS file: /cvsroot/datatype/mp4/filewriter/Attic/mp4sm.cpp,v
retrieving revision 1.1.2.3
retrieving revision 1.1.2.4
diff -u -d -r1.1.2.3 -r1.1.2.4
--- mp4sm.cpp	24 May 2007 17:02:45 -0000	1.1.2.3
+++ mp4sm.cpp	25 May 2007 00:39:29 -0000	1.1.2.4
@@ -1830,14 +1830,6 @@
 	UCHAR* pBuf = pDecoderInfo->GetBuffer();
 	UINT32 len  = pDecoderInfo->GetSize();
 
-        //FXD -- temporary fix, strip out multi stream header
-        // correct fix should be in handler and parse the header
-        if (pBuf[0] == 'M' && pBuf[1] == 'L' && pBuf[2] == 'T' && pBuf[3] == 'I')
-        {
-            pBuf += 16;
-            len = pBuf[3];
-        }
-	
 	CMP4Atom_avc1* pAVC1 = new CMP4Atom_avc1();
 	if( pAVC1 )
 	{

Index: avcsh.cpp
===================================================================
RCS file: /cvsroot/datatype/mp4/filewriter/Attic/avcsh.cpp,v
retrieving revision 1.1.2.1
retrieving revision 1.1.2.2
diff -u -d -r1.1.2.1 -r1.1.2.2
--- avcsh.cpp	18 May 2007 21:24:25 -0000	1.1.2.1
+++ avcsh.cpp	25 May 2007 00:39:29 -0000	1.1.2.2
@@ -43,6 +43,9 @@
 #include "mp4sm.h"
 #include "avcsh.h"
 
+#include "rmfftype.h"
+#include "netbyte.h"   /* common/util/pub/netbyte.h, dwtohost */
+
 //#include "mp4desc.h"    /* for parsing es descriptor/channel count */
     
 // These are the mime types we support
@@ -157,14 +160,46 @@
     UINT8* ucDecoderInfo = NULL;
     UINT32 ulDSILength;
 
-    // MP4 file format put MP4 stsd avcC box in OpaqueData
-    retVal = pHeader->GetPropertyBuffer( "OpaqueData", pOpaqueData );
+    retVal = pHeader->GetPropertyBuffer("OpaqueData", pOpaqueData);
+
+    UCHAR* pBuffer = pOpaqueData->GetBuffer();
+    UINT32 ulLen = pOpaqueData->GetSize();
+
+    if ( SUCCEEDED(retVal) )
+    {
+        // MP4 file format put MP4 stsd avcC box in OpaqueData.
+        // producer though always attaches a MultiStreamHeader to the front of avcC box
+        // created by h264enc filter plugin. need to strip the MLTI header
+
+        UINT32 ulID = DwToHost(*(UINT32*)(pBuffer));
+        if( RM_MULTIHEADER_OBJECT == ulID )
+        {
+	    MultiStreamHeader multiStreamHeader;
+
+	    pBuffer = multiStreamHeader.unpack( pBuffer, ulLen );
+            
+            //bypass the size of header field, we should be at the avcC box now
+            pBuffer += sizeof(UINT32);
+
+            ulLen = DwToHost(*(UINT32*)(pBuffer));
+        }
+    }
+
+    IHXBuffer* pDecoderInfoBuffer = NULL;
     if (SUCCEEDED(retVal))
     {
-        pHeader->SetPropertyBuffer("DecoderInfo", pOpaqueData );
-        HX_RELEASE(pOpaqueData);
+	retVal = m_pCommonClassFactory->CreateInstance( IID_IHXBuffer, (void**) &pDecoderInfoBuffer );
+    }
+
+    if (SUCCEEDED(retVal))
+    {
+        pDecoderInfoBuffer->Set(pBuffer, ulLen);
+        pHeader->SetPropertyBuffer("DecoderInfo", pDecoderInfoBuffer );
     }
 
+    HX_RELEASE(pDecoderInfoBuffer);
+    HX_RELEASE(pOpaqueData);
+
     if (SUCCEEDED(retVal))
     {
         // Indicate this is a video track with avc1 sample format


_______________________________________________
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