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

List:       helix-datatype-cvs
Subject:    [Datatype-cvs] mp4/payload mp4apyld.cpp, 1.14.14.1.22.2,
From:       henryxing () helixcommunity ! org
Date:       2011-09-29 0:46:15
Message-ID: 201109290150.p8T1oDtt008304 () mailer ! progressive-comp ! com
[Download RAW message or body]

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

Modified Files:
      Tag: hxclient_3_6_1_atlas
	mp4apyld.cpp 
Log Message:
dynamic reload aac decoder when meet discontinuity tag in packet

Index: mp4apyld.cpp
===================================================================
RCS file: /cvsroot/datatype/mp4/payload/mp4apyld.cpp,v
retrieving revision 1.14.14.1.22.2
retrieving revision 1.14.14.1.22.3
diff -u -d -r1.14.14.1.22.2 -r1.14.14.1.22.3
--- mp4apyld.cpp	23 Sep 2011 02:58:19 -0000	1.14.14.1.22.2
+++ mp4apyld.cpp	29 Sep 2011 00:46:12 -0000	1.14.14.1.22.3
@@ -88,6 +88,10 @@
     , m_ulRTPSamplesPerSecond(0)
     , m_PayloadID	    (PYID_X_HX_MP4_RAWAU)
     , m_ulADTSCurrentPacketOffset(0)
+    , m_uADTSCurChannels(0)
+    , m_uADTSCurSamplingFreIndex(0)
+    , m_uADTSCurProfile(0)
+    , m_bADTSFirstPacket(TRUE)
 {
     ;
 }
@@ -1133,6 +1137,43 @@
                     UINT32 ulProtectionAbsent = pAU[1]& 1;
                     UINT32 ulFrameLength = ((pAU[3]&0x3) << 11) + (pAU[4] << 3) + \
(pAU[5] >> 5);  
+                    if (m_bADTSFirstPacket)
+                    {
+                        m_bADTSFirstPacket = FALSE;
+                        m_uADTSCurProfile = (pAU[2]&0xC0)>>6;
+                        m_uADTSCurSamplingFreIndex = (pAU[2]&0x3C)>>2;
+                        m_uADTSCurChannels = ((pAU[2]&0x01)<<2) + \
((pAU[3]&0xC0)>>6); +                    }
+                    UINT8  ucASMFlags = pPacket->GetASMFlags();
+                    if (ucASMFlags & HX_ASM_DISCONTINUITY)
+                    {
+                        UINT16 profile = (pAU[2]&0xC0)>>6;
+                        UINT16 uSamplingFrequencyIndex = (pAU[2]&0x3C)>>2;
+                        UINT16 channels = ((pAU[2]&0x01)<<2) + ((pAU[3]&0xC0)>>6);
+                        if(profile != m_uADTSCurProfile || uSamplingFrequencyIndex \
!= m_uADTSCurSamplingFreIndex || channels != m_uADTSCurChannels ) +                   \
{ +                            ulFlags |= MDPCKT_REINIT_CODEC_FLAG_AUDIO;
+                            m_uADTSCurProfile = profile;
+                            m_uADTSCurSamplingFreIndex = uSamplingFrequencyIndex;
+                            m_uADTSCurChannels = channels;
+                            m_ulAudioConfigSize = pBuffer->GetSize();
+                            if (m_ulAudioConfigSize)
+                            {
+                                UCHAR *pBuf = pBuffer->GetBuffer();
+                                m_unAudioConfigType = eAACConfigADTS;
+                                HX_VECTOR_DELETE(m_pAudioConfig);
+                                m_pAudioConfig = new UINT8[m_ulAudioConfigSize];
+                                if (!m_pAudioConfig)
+                                {
+                                    retVal = HXR_OUTOFMEMORY;
+                                }
+                                else
+                                {
+                                    memcpy(m_pAudioConfig, pBuf, \
m_ulAudioConfigSize); +                                }
+                            }
+                        }
+                    }
                     if (ulFrameLength > ulSize)
                     {
                         //error, treat the packet as lost


_______________________________________________
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