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

List:       helix-datatype-cvs
Subject:    [Datatype-cvs] mdf/video/format/wmv mdfwmvpayloadformat.cpp, 1.6,
From:       vgondi () helixcommunity ! org
Date:       2007-11-30 21:29:28
Message-ID: 200711302129.lAULThct025388 () mailer ! progressive-comp ! com
[Download RAW message or body]

Update of /cvsroot/datatype/mdf/video/format/wmv
In directory cvs01.internal.helixcommunity.org:/tmp/cvs-serv19977/format/wmv

Modified Files:
	mdfwmvpayloadformat.cpp 
Log Message:
"Nokia submits this code under the terms of a commercial contribution agreement
with RealNetworks, and I am authorized to contribute this code under said agreement."

Modified by: vijay.gondi@nokia.com
	 
Reviewed by: gwright@real.com; john.wei@nokia.com 

Date: 30-Nov-2007
	 
Project: SymbianMmf_Rel 

TSW: VGOI-796NQ4

Synopsis: Helix mdf renderer requires changes to support the new MDF WMV \
specification from symbian

Overview: The current FillBuffer function in mdfpayload format passes a reference to \
a data member of TVideoInputBuffer. To support MDF WMV specification from symbian, \
access to other variables is required, an update is performed on FillBuffer function.

	 
Files Modified:
/cvsroot/datatype/mdf/video/format/common/mdfpayloadformat.cpp,v
/cvsroot/datatype/mdf/video/format/common/pub/mdfpayloadformat.h,v
/cvsroot/datatype/mdf/video/format/h264/mdfh264payloadformat.cpp,v
/cvsroot/datatype/mdf/video/format/h264/pub/mdfh264payloadformat.h,v
/cvsroot/datatype/mdf/video/format/mp4/mdfmp4payloadformat.cpp,v
/cvsroot/datatype/mdf/video/format/mp4/pub/mdfmp4payloadformat.h,v
/cvsroot/datatype/mdf/video/format/rm/mdfrvxpayloadformat.cpp,v
/cvsroot/datatype/mdf/video/format/rm/pub/mdfrvxpayloadformat.h,v
/cvsroot/datatype/mdf/video/format/wmv/mdfwmvpayloadformat.cpp,v
/cvsroot/datatype/mdf/video/format/wmv/pub/mdfwmvpayloadformat.h,v
/cvsroot/datatype/mdf/video/renderer/mdfvideoadapter.cpp,v
	
Image Size and Heap Use impact: None
	 
Module Release testing (STIF) : Pass
	 
Test case(s) Added  :  No

Memory leak check performed : No new leaks introduced.  

Platforms and Profiles Build Verified: 
Profile -> helix-client-s60-32-mmf-mdf-arm
BIF branch  -> helix_restricted
SYSTEM_ID -> symbian-91-armv5
Target -> symbianMmf_wm
 
Platforms and Profiles Functionality verified: armv5, winscw
	 
Branch: 210CayS and Head


Index: mdfwmvpayloadformat.cpp
===================================================================
RCS file: /cvsroot/datatype/mdf/video/format/wmv/mdfwmvpayloadformat.cpp,v
retrieving revision 1.6
retrieving revision 1.7
diff -u -d -r1.6 -r1.7
--- mdfwmvpayloadformat.cpp	5 Sep 2007 22:23:45 -0000	1.6
+++ mdfwmvpayloadformat.cpp	30 Nov 2007 21:29:25 -0000	1.7
@@ -229,22 +229,14 @@
                 UINT32 ulTimeStamp   = pPayloadData->GetTime();
                 UINT32 ulPayloadSize = pBuffer->GetSize();
 
-                // Substream index [4] + KEY:RES:FRAMESIZE [4] + TIMESTAMP[4]
-                // 12 bytes of Header data + Payload
-                UINT32 ulFrameSize = ulPayloadSize + 12 ;
+                // KEY:RES:FRAMESIZE [4] + TIMESTAMP[4]
+                // 8 bytes of Header data + Payload               
+                UINT32 ulFrameSize = ulPayloadSize + 8 ;
                 BYTE*  pFrameData  = pBuffer->GetBuffer();
 
                 // Key Frame Indicator
                 HXBOOL bKeyFrame = ulASMFlags & HX_ASM_SWITCH_ON ? TRUE : FALSE;
 
-                // Get the substream from the ASM rule
-                UINT32 ulSubStreamIndex = 0;
-                if (ulASMRule < ((UINT32) m_pRuleToSubStreamMap->num_rules) &&
-                    m_pRuleToSubStreamMap->rule_to_flag_map)
-                {
-                    ulSubStreamIndex = (UINT32) \
                m_pRuleToSubStreamMap->rule_to_flag_map[ulASMRule];
-                }
-
                 // Create an HXCODEC_DATA struct
                 UINT32  ulSize  = sizeof(HXCODEC_DATA) / 4 + 1;
                 UINT32* pulData = new UINT32[ulSize];
@@ -277,8 +269,6 @@
                         // 1st byte indicates keyframe
                         BYTE*  pBuf  = pCodecData->data;
                         UINT32 ulLen = ulFrameSize;
-                        // Write the substream index
-                        PackUINT32LEInc(&pBuf,&ulLen,ulSubStreamIndex);
                         // Advance manually
                         PackUINT32LE(pBuf,ulLen,ulPayloadSize);
                         // Advance by 3 bytes. Payload Size field = 24 bits
@@ -291,6 +281,14 @@
                         ulLen--;
                         PackUINT32LEInc(&pBuf,&ulLen,ulTimeStamp);
                         memcpy(pBuf,pFrameData,ulPayloadSize);
+                        // Create the sample description. We will store it
+                        // in the void* sample description, so no memory has
+                        // to be allocated, so no sample description killer is \
needed. +                        //
+                        // Generate the sample description
+                        UINT32 ulSampDesc = ((ulASMFlags & 0x0000FFFF) << 16) |
+                                             (ulASMRule  & 0x0000FFFF);
+                       
                         // Now create the CMediaPacket object
                         pRet = new CMediaPacket(pCodecData,
                             (UINT8*) pCodecData,
@@ -298,7 +296,7 @@
                             pCodecData->dataLength,
                             pCodecData->timestamp,
                             pCodecData->flags,
-                            (void*) NULL);
+                            (void*) ulSampDesc);
                         if (pRet == NULL)
                         {
                             KillInputBuffer(pCodecData, this);
@@ -328,16 +326,24 @@
 
 }
 
-HX_RESULT CWMVPayloadFormatPluginDevice::FillBuffer( TPtr8& inputBuffer, const \
CMediaPacket* pMediaPacket ) const +HX_RESULT \
CWMVPayloadFormatPluginDevice::FillBuffer( TVideoInputBuffer& pVideoInputBuffer, \
const CMediaPacket* pMediaPacket ) const  {
     MDFVIDEOLOG_ENTERFN4( "FillBuffer" );
-
     HX_RESULT retVal = HXR_FAIL;
+    TPtr8& inputBuffer = pVideoInputBuffer.iData;
     HXCODEC_DATA* pCodecPacket = (HXCODEC_DATA*) pMediaPacket->m_pData;
     if( inputBuffer.MaxLength() >= pCodecPacket->dataLength + inputBuffer.Length() )
     {
         //inputBuffer might already have header inside
         inputBuffer.Append( pCodecPacket->data, pCodecPacket->dataLength );
+        // Get the ASM rule from the sample description
+        UINT32 ulSampDesc = (UINT32) pMediaPacket->m_pSampleDesc;
+        UINT16 usASMRule  = (UINT16) (ulSampDesc & 0x0000FFFF);
+        if (m_pRuleToSubStreamMap && usASMRule < m_pRuleToSubStreamMap->num_rules)
+        {
+            TInt* subStreamId = (TInt*) pVideoInputBuffer.iUser;
+            *subStreamId = (UINT32) \
m_pRuleToSubStreamMap->rule_to_flag_map[usASMRule]; +        }                
         retVal = HXR_OK;
     }
 


_______________________________________________
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