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

List:       helix-datatype-cvs
Subject:    [Datatype-cvs] mkv/libmatroska Matroska.cpp,1.1.4.2,1.1.4.3
From:       joeli () helixcommunity ! org
Date:       2010-11-25 2:46:44
Message-ID: 201011250247.oAP2jpTi014724 () mailer ! progressive-comp ! com
[Download RAW message or body]

Update of /cvsroot/datatype/mkv/libmatroska
In directory cvs01.internal.helixcommunity.org:/tmp/cvs-serv22814

Modified Files:
      Tag: hxclient_3_6_2_atlas
	Matroska.cpp 
Log Message:
Project: RealPlayer for Android Smartphones
Bug Number: 12083 12084 12085

Overview: Currently helix mkv doesn ¡ ¯t support eac3 and not support for \
multi-streams, if contents have subtitles embedded, the audio can ¡ ¯t be played. \
about this fix, most of source codes are merged from helix.420 branch. Fix includes \
the follow points: 1.       support the content encoding element for eac3 audio \
format. 2.       handle multi-streams, if It has subtitles, remove the sync header \
from audio packets 3.       some crash issues

Files Added:
NA

Files Modified:
datatype/mkv/fileformat/pub/mkv_file_format.h
datatype/mkv/fileformat/mkv_file_format.cpp
datatype/mkv/libmatroska/libebml/ebml/EbmlBinary.h
datatype/mkv/libmatroska/libebml/src/EbmlBinary.cpp
datatype/mkv/libmatroska/libebml/src/IOCallback.cpp
datatype/mkv/libmatroska/libmatroska/matroska/KaxBlock.h
datatype/mkv/libmatroska/libmatroska/src/KaxBlock.cpp
datatype/mkv/libmatroska/Matroska.cpp
datatype/mkv/libmatroska/mkvtypes.h


Image Size and Heap Use impact (Client-Only):
None

Platforms and Profiles Affected:
Platform: hxclient_3_6_2_atlas 
Profile: helix-client-android and helix-client-all-defines
 
Distribution Libraries Affected:
NA 
 
Distribution library impact and planned action:
NA 

Platforms and Profiles Build Verified:
Platform: hxclient_3_6_2_atlas 
Profile:  helix-client-android and helix-client-all-defines

Platforms and Profiles Functionality verified:
Platform: hxclient_3_6_2_atlas
Profile: helix-client-android and helix-client-all-defines

Branch: hxclient_3_6_2_atlas
Copyright assignment: I am a RealNetworks employee



Index: Matroska.cpp
===================================================================
RCS file: /cvsroot/datatype/mkv/libmatroska/Matroska.cpp,v
retrieving revision 1.1.4.2
retrieving revision 1.1.4.3
diff -u -d -r1.1.4.2 -r1.1.4.3
--- Matroska.cpp	26 Jul 2010 09:36:23 -0000	1.1.4.2
+++ Matroska.cpp	25 Nov 2010 02:46:41 -0000	1.1.4.3
@@ -39,6 +39,7 @@
 
 #define TIMECODESCALE 1000000
 
+#define MKV_AAC3_MIMETYPE "A_AC3"
 //MatroskaSegment
 MatroskaSegment::MatroskaSegment( EbmlStream* & estream )
                                  :m_pSegment(NULL)
@@ -474,6 +475,10 @@
 						if( tk->uExtraData > 0 )
 						{
 							tk->pExtraData = (uint8*)malloc( tk->uExtraData );
+                            if(!tk->pExtraData)
+                            {
+                                return HXR_OUTOFMEMORY;
+                            }
 							memcpy( tk->pExtraData, cpriv.GetBuffer(), tk->uExtraData );
 						}
 					}
@@ -535,7 +540,7 @@
 							else if( EbmlId( *ve ) == KaxVideoFrameRate::ClassInfos->GlobalId )
 							{
 								KaxVideoFrameRate &vfps = *(KaxVideoFrameRate*)ve;
-								tk->video.uFPS = uint32( float(vfps) );
+								tk->video.fFPS = float(vfps);
 							}
 							else if( EbmlId( *ve ) == KaxVideoDisplayUnit::ClassInfos->GlobalId )
 							{
@@ -591,6 +596,118 @@
 							}
 						}
 					}
+					else if(  EbmlId( *ee ) == KaxContentEncodings::ClassInfos->GlobalId)
+					{
+					
+						EbmlMaster *tka = static_cast<EbmlMaster*>(ee);
+						for(int k = 0; k < tka->ListSize(); k++ )
+						{
+						    EbmlElement *ce = (*tka)[k];
+						    if( EbmlId( *ce ) == KaxContentEncoding::ClassInfos->GlobalId)
+						    {
+						        EbmlMaster *tkce = static_cast<EbmlMaster*>(ce);
+						        for(int l = 0; l < tkce->ListSize(); l++ )
+						        {
+						            EbmlElement *cc = (*tkce)[l];							
+									if(EbmlId( *cc ) == KaxContentEncodingOrder::ClassInfos->GlobalId) // \
Content Encoding Order +									{
+									    // ignore
+									}
+									else if(EbmlId( *cc ) == KaxContentEncodingScope::ClassInfos->GlobalId) // \
Content Encoding Scope +									{
+									    KaxContentEncodingScope &ces = *(KaxContentEncodingScope*)cc;
+									    tk->eContentCompressionScope =uint8(ces);
+									    switch(tk->eContentCompressionScope)
+									    {
+									        case eALLFRAME: // all frames
+											    tk->eContentCompressionScope=eALLFRAME;
+											    break;
+											case eTRACKCODECPRIVATE: // the track ’s CODECPRIVATE
+											case eCONTENTCOMPRESSION: // the CONTENTCOMPRESSION in the next \
CONTENTENCODING (next as in next in decoding order) +											default:
+											    delete tk;
+											    tk=NULL;
+											    break;
+									    }
+									}
+									else if(EbmlId( *cc ) == KaxContentEncodingType::ClassInfos->GlobalId) // \
Content Encoding Type  +									{
+										KaxContentEncodingType &cetype = *(KaxContentEncodingType*)cc;
+						                uint8 contentencodingtype = uint8( cetype );
+								        if(contentencodingtype == 0) // Content Encoding type is Compression
+                                        {
+										    tk->uContentCompressionType=uint8( cetype );
+								        }
+								        else if(contentencodingtype == 1) // Content Encoding type is \
encryption +								        {
+								            // ignore track. 
+											delete tk;
+											tk=NULL;
+								        }
+									}
+									else if( EbmlId( *cc ) == KaxContentCompression::ClassInfos->GlobalId)
+									{
+									    EbmlMaster *tkcc = static_cast<EbmlMaster*>(cc);
+									    for(int m = 0; m < tkcc->ListSize(); m++ )
+									    {
+									        EbmlElement *cca = (*tkcc)[m];
+									        if( EbmlId( *cca ) == KaxContentCompAlgo::ClassInfos->GlobalId )
+									        {
+									            KaxContentCompAlgo &aalgo = *(KaxContentCompAlgo*)cca;
+									            tk->eCompressionType = uint8(aalgo);
+									            switch(tk->eCompressionType)
+									            {
+									                case eHEADERSTRIPING: // Header striping
+									                    // Supporting only for EAac3 Header Striping
+									                    if(tk->type == TrackAudio &&  (!strncmp(tk->pszCodec, \
MKV_AAC3_MIMETYPE, strlen(MKV_AAC3_MIMETYPE)))) +									                    {
+									                        tk->eCompressionType=eHEADERSTRIPING;
+									                    }
+									                    else  //ignore for other
+									                    {
+									                        delete tk;
+									                        tk=NULL;
+													    }
+												     break;
+												     case eZLIBCOMPRESSION: //Zlib ignore
+												     case eBZLIBCOMPRESSION: // bZlib;
+												     case eIZO1XCOMPRESSION: // izo1x
+												     default: // not expected
+												         delete tk;
+												         tk=NULL;
+												         break;
+									            }
+											}
+									        else if( EbmlId( *cca ) == \
KaxContentCompSettings::ClassInfos->GlobalId ) +									        {
+									            KaxContentCompSettings &ccs = *(KaxContentCompSettings*)cca;
+									            tk->uContentCompressSetting = ccs.GetSize();
+									            if(tk->eCompressionType == eHEADERSTRIPING)
+									            {
+									                \
tk->pContentCompressSetting=(uint8*)malloc(tk->uContentCompressSetting); +									   \
if(!tk->pContentCompressSetting) +									                {
+									                    return HXR_OUTOFMEMORY;
+									                }
+									                if(tk->uContentCompressSetting > 0)
+									                {
+									                    memcpy( tk->pContentCompressSetting, ccs.GetBuffer(), \
tk->uContentCompressSetting ); +									                }
+									            }
+									            else
+									            {
+									                delete tk;
+									                tk=NULL;
+									            }
+											}
+										}
+									}
+								}
+										
+							}
+														
+						}
+					}
 					else
 					{
 						//Unknown Type
@@ -1698,7 +1815,8 @@
 {
     EbmlElement *el;
     int iUpperLevel = 0;
-
+    if (tags)
+    {
     tags->Read( *m_pES, *(tags->Generic().Context), iUpperLevel, el, true );
 
     for( int i = 0; i < tags->ListSize(); i++ )
@@ -1946,7 +2064,7 @@
 			
         }
     }
-
+    }
 	return 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