From alokj at real.com Thu Nov 6 07:22:46 2008
From: alokj at real.com (alokj@real.com)
Date: Thu Nov 6 05:27:47 2008
Subject: [datatype-dev] CR:-To Support the Fix bounds checking in Bitstream
class
Message-ID: <50590.220.226.88.106.1225984966.squirrel@mailone.real.com>
Synopsis:
To Support the Fix bounds checking in Bitstream class.
Overview:
Add the method BitsLeft() inside Bitstream class for Fix bounds checking
and modified all the instance where GetBits() or PeekBits() is used as a
method of Bitstream class.
Files Modified:
/datatype/common/util/bitpack.cpp
/datatype/common/util/bitstream.cpp
/datatype/common/util/pub/bitstream.h
/datatype/common/util/test/tbitpack.cpp
/datatype/aac/fileformat/ADIFfile.cpp
/datatype/aac/fileformat/aacff.cpp
/datatype/aac/fileformat/aacfiletypes.h
/datatype/h263/payload/h263pyld.cpp
/datatype/mp4/payload/amr-depack.cpp
/datatype/mp4/payload/mp4-latm-depack.cpp
/datatype/mp4/payload/mp4a-mux-cfg.cpp
Files Added:
None
Image Size and Heap Use impact (Client -Only):
None.
Platforms and Profiles Affected:
None
Distribution Libraries Affected:
None.
Distribution library impact and planned action:
None.
Platforms and Profiles Build Verified:
Profile: helix-client-all-defines
BIF branch: helix.bif
Target: splay
Branch: HEAD
Thanks
Alok Jain
-------------- next part --------------
Index: h263pyld.cpp
===================================================================
RCS file: /cvsroot/datatype/h263/payload/h263pyld.cpp,v
retrieving revision 1.9
diff -u -r1.9 h263pyld.cpp
--- h263pyld.cpp 6 Jul 2007 22:00:33 -0000 1.9
+++ h263pyld.cpp 6 Nov 2008 12:14:56 -0000
@@ -360,26 +360,48 @@
static HX_RESULT HandleH263Plus(Bitstream& bs, HXxSize &FrameDim)
{
HX_RESULT res = HXR_UNEXPECTED;
-
+ UINT32 ulLeft = bs.BitsLeft();
+ if(ulLeft < 6)
+ {
+ return res;
+ }
if (bs.GetBits(3) == 1) // UFEP
{
- int fmt = bs.GetBits(3); // OPPTYPE (bits 1-3)
-
+ int fmt = bs.GetBits(3); // OPPTYPE (bits 1-3)
+
if (fmt != 0x6)
res = GetH263FrameSize(fmt, FrameDim);
else
{
// This frame has custom dimensions
-
+ ulLeft = bs.BitsLeft();
+ if(ulLeft < 15)
+ {
+ return res;
+ }
bs.GetBits(11) ; // OPPTYPE (bits 4-14)
-
if (bs.GetBits(4) == 0x8) // OPPTYPE (bits 15-18)
{
- bs.GetBits(6); // MPPTYPE (bits 1-6)
- if (bs.GetBits(3) == 0x1) // MPPTYPE (bits 7-9)
- {
+ ulLeft = bs.BitsLeft();
+ if ( ulLeft < 9 )
+ {
+ return res;
+ }
+ bs.GetBits(6); // MPPTYPE (bits 1-6)
+ if (bs.GetBits(3) == 0x1) // MPPTYPE (bits 7-9)
+ {
+ ulLeft = bs.BitsLeft();
+ if(ulLeft < 3)
+ {
+ return res;
+ }
if (bs.GetBits(1)) // CPM
bs.GetBits(2); // PSBI
+ ulLeft = bs.BitsLeft();
+ if(ulLeft < 14)
+ {
+ return res;
+ }
bs.GetBits(4); // CPFMT (bits 1-4)
@@ -387,6 +409,12 @@
if (bs.GetBits(1)) // CPFMT (bit 14)
{
+ ulLeft = bs.BitsLeft();
+ if(ulLeft < 9)
+ {
+ return res;
+ }
+
int phi = (bs.GetBits(9)) * 4;
if ((phi >= 1) && (phi <= 288))
@@ -411,31 +439,39 @@
HX_RESULT res = HXR_UNEXPECTED;
Bitstream bs;
-
+ UINT32 ulLeft = 0;
if (pBuffer->GetSize() >= 5)
{
- bs.SetBuffer(pBuffer->GetBuffer());
-
+ bs.SetBuffer(pBuffer->GetBuffer(), pBuffer->GetSize() );
+ ulLeft =bs.BitsLeft();
+ if(ulLeft < 32)
+ {
+ return res;
+ }
if (bs.GetBits(22) == 0x20) // Check PSC
{
- bs.GetBits(8); // Skip TR
-
- if (bs.GetBits(2) == 0x02) // PTYPE(bits 1 & 2)
- {
- bs.GetBits(3); // PTYPE(bits 3-5)
-
- int fmt = bs.GetBits(3); // Get Format
-
- if (fmt != 0x7)
- {
- res = GetH263FrameSize(fmt, FrameDim);
- }
- else if (pBuffer->GetSize() >= 13)
- {
+ bs.GetBits(8); // Skip TR
+ if (bs.GetBits(2) == 0x02) // PTYPE(bits 1 & 2)
+ {
+ ulLeft =bs.BitsLeft();
+ if(ulLeft < 6)
+ {
+ return res;
+ }
+ bs.GetBits(3); // PTYPE(bits 3-5)
+
+ int fmt = bs.GetBits(3); // Get Format
+
+ if (fmt != 0x7)
+ {
+ res = GetH263FrameSize(fmt, FrameDim);
+ }
+ else if (pBuffer->GetSize() >= 13)
+ {
// This has an extended PTYPE
- res = HandleH263Plus(bs, FrameDim);
- }
- }
+ res = HandleH263Plus(bs, FrameDim);
+ }
+ }
}
}
Index: rfc2190hlpr.cpp
===================================================================
RCS file: /cvsroot/datatype/h263/payload/rfc2190hlpr.cpp,v
retrieving revision 1.4
diff -u -r1.4 rfc2190hlpr.cpp
--- rfc2190hlpr.cpp 6 Jul 2007 22:00:33 -0000 1.4
+++ rfc2190hlpr.cpp 6 Nov 2008 12:14:57 -0000
@@ -130,7 +130,7 @@
{
HX_RESULT res = HXR_FAILED;
- bp.PackBits(m_pPayload, m_ulDataSize, m_ulStartOffset);
+ res = bp.PackBits(m_pPayload, m_ulDataSize, m_ulStartOffset);
return res;
}
Index: rfc2429hlpr.cpp
===================================================================
RCS file: /cvsroot/datatype/h263/payload/rfc2429hlpr.cpp,v
retrieving revision 1.5
diff -u -r1.5 rfc2429hlpr.cpp
--- rfc2429hlpr.cpp 6 Jul 2007 22:00:33 -0000 1.5
+++ rfc2429hlpr.cpp 6 Nov 2008 12:14:57 -0000
@@ -137,6 +137,6 @@
if (m_bP)
bp.PackBits(0,16);
- bp.PackBits(m_pPayload, m_ulPayloadSize, 0);
- return HXR_OK;
+ HX_RESULT retVal = bp.PackBits(m_pPayload, m_ulPayloadSize, 0);
+ return retVal;
}
-------------- next part --------------
Index: Umakefil
===================================================================
RCS file: /cvsroot/datatype/mp4/payload/Umakefil,v
retrieving revision 1.20
diff -u -r1.20 Umakefil
--- Umakefil 23 Sep 2008 13:23:27 -0000 1.20
+++ Umakefil 6 Nov 2008 12:12:09 -0000
@@ -54,7 +54,8 @@
"datatype/rm/common/pub",
"datatype/mp4/common/pub",
"datatype/mp4/fileformat/pub",
- "datatype/amr/common/pub")
+ "datatype/amr/common/pub",
+ "common/log/logutil/pub")
project.AddSources("amrpyld.cpp",
"amr-depack.cpp",
Index: amr-depack.cpp
===================================================================
RCS file: /cvsroot/datatype/mp4/payload/amr-depack.cpp,v
retrieving revision 1.7
diff -u -r1.7 amr-depack.cpp
--- amr-depack.cpp 14 Mar 2005 19:17:44 -0000 1.7
+++ amr-depack.cpp 6 Nov 2008 12:12:10 -0000
@@ -38,7 +38,7 @@
#include "amr_toc.h"
#include "amr_rs_itr.h"
#include "bitstream.h"
-
+#include "hxtlogutil.h"
AMRDepack::AMRDepack() :
m_flavor(NarrowBand),
@@ -164,39 +164,70 @@
Bitstream bs;
- bs.SetBuffer(pData);
+ bs.SetBuffer(pData, ulSize);
+ UINT32 ulLeft = bs.BitsLeft();
+ if(ulLeft < 4)
+ {
+ bFailed =TRUE;
+ }
// Skip the CMR since we don't care about it
- if (m_bOctetAlign)
+ if ( m_bOctetAlign )
{
+ if(ulLeft < 8)
+ {
+ bFailed =TRUE;
+ }
+
// 3GPP TS26.235 v5.0.0 Annex B Section B.4.4.1
- bs.GetBits(8);
+ bs.GetBits(8);
}
else
{
// 3GPP TS26.235 v5.0.0 Annex B Section B.4.3.1
- bs.GetBits(4);
+ bs.GetBits(4);
}
+ ulLeft = bs.BitsLeft();
+
if (m_ulMaxInterleave > 0)
{
- // 3GPP TS26.235 v5.0.0 Annex B Section B.4.4.1
- ULONG32 ulILL = bs.GetBits(4);
- ULONG32 ulILP = bs.GetBits(4);
+ if(ulLeft < 8)
+ {
+ bFailed =TRUE;
+ }
+ else
+ {
+ // 3GPP TS26.235 v5.0.0 Annex B Section B.4.4.1
+ ULONG32 ulILL = bs.GetBits(4);
+ ULONG32 ulILP = bs.GetBits(4);
- bFailed = !UpdateIleavInfo(ulILL, ulILP, ulTime);
+ bFailed = !UpdateIleavInfo(ulILL, ulILP, ulTime);
+ }
+ }
+ else
+ {
+ bFailed =TRUE;
}
if (bFailed == FALSE)
{
AMRTOCInfo tocInfo;
- GetTOCInfo(bs, tocInfo);
+ if(!GetTOCInfo(bs, tocInfo))
+ {
+ bFailed =TRUE;
+ HXLog1("Failed GetTOCInfo()");
+ }
if (m_bHasCRC)
{
// 3GPP TS26.235 v5.0.0 Annex B Section B.4.4.2.1
- SkipCRCInfo(bs, tocInfo);
+ if(!SkipCRCInfo(bs, tocInfo))
+ {
+ bFailed =TRUE;
+ HXLog1("Failed SkipCRCInfo()");
+ }
}
// Update the block count to make sure we have
@@ -218,7 +249,10 @@
if (m_bRobustSort)
{
// Copy robust sorted frame data to m_blockBuf
- SortedCopy(bs, ulStartBlock, ulBlockInc, tocInfo);
+ if(!SortedCopy(bs, ulStartBlock, ulBlockInc, tocInfo))
+ {
+ bFailed =TRUE;
+ }
}
else
{
@@ -320,13 +354,14 @@
return !bFailed;
}
-void AMRDepack::GetTOCInfo(Bitstream& bs, AMRTOCInfo& tocInfo)
+HXBOOL AMRDepack::GetTOCInfo(Bitstream& bs, AMRTOCInfo& tocInfo)
{
ULONG32 ulTocBits;
ULONG32 ulTocMask;
ULONG32 ulShift;
-
+ HXBOOL bFailed = FALSE;
+
if (m_bOctetAlign)
{
// This header is defined in
@@ -363,29 +398,47 @@
}
HXBOOL bDone = FALSE;
-
+ UINT32 ulLeft = 0;
while(!bDone)
{
- ULONG32 entry = bs.GetBits(ulTocBits);
- UINT8 type = (UINT8)(entry >> (ulShift + 1)) & 0x0f;
- UINT8 quality = (UINT8)(entry >> ulShift) & 0x01;
+ ulLeft = bs.BitsLeft();
+ if ( ulLeft < ulTocBits )
+ {
+ bFailed =TRUE;
+ break;
+ }
+ ULONG32 entry = bs.GetBits(ulTocBits);
+ UINT8 type = (UINT8)(entry >> (ulShift + 1)) & 0x0f;
+ UINT8 quality = (UINT8)(entry >> ulShift) & 0x01;
- tocInfo.AddInfo(type, quality);
+ tocInfo.AddInfo(type, quality);
- if ((entry & ulTocMask) == 0)
- bDone = TRUE;
+ if ((entry & ulTocMask) == 0)
+ bDone = TRUE;
}
+ return !bFailed;
}
-void AMRDepack::SkipCRCInfo(Bitstream& bs, const AMRTOCInfo& tocInfo)
+HXBOOL AMRDepack::SkipCRCInfo(Bitstream& bs, const AMRTOCInfo& tocInfo)
{
+ HXBOOL bFailed = FALSE;
// Skip CRCs if they are present since we don't
// care about them.
for (ULONG32 i = 0; i < tocInfo.EntryCount(); i++)
{
if (tocInfo.GetType(i) < 14)
+ {
+ UINT32 ulLeft = bs.BitsLeft();
+ if ( ulLeft < 8 )
+ {
+ bFailed =TRUE;
+ break;
+ }
bs.GetBits(8);
+ }
}
+ return !bFailed;
+
}
@@ -493,7 +546,11 @@
pCurrent[ulFrameBytes - 1] = 0;
// Copy frame bits into the buffer
- bs.GetBits(ulFrameBits, pCurrent);
+ UINT32 ulLeft = bs.BitsLeft();
+ if ( ulLeft >= ulFrameBits )
+ {
+ bs.GetBits(ulFrameBits, pCurrent);
+ }
// Move current pointer to just past this frame
pCurrent += ulFrameBytes;
@@ -513,10 +570,11 @@
return ulRet;
}
-void AMRDepack::SortedCopy(Bitstream& bs,
+HXBOOL AMRDepack::SortedCopy(Bitstream& bs,
ULONG32 ulStartBlock, ULONG32 ulBlockInc,
const AMRTOCInfo& tocInfo)
{
+ HXBOOL bFailed = FALSE;
// This function copies robust sorted data from the packet.
// Unfortunately this is not very efficient because the bytes
// of each frame are interleaved with eachother. The
@@ -532,8 +590,15 @@
UINT8* pDest = m_blockBuf.GetBlockBuf(itr.Block()) + itr.Offset();
// Copy the byte
+ UINT32 ulLeft = bs.BitsLeft();
+ if( ulLeft < 8 )
+ {
+ bFailed = TRUE;
+ break;
+ }
*pDest = (UINT8)bs.GetBits(8);
}
+ return !bFailed;
}
void AMRDepack::DispatchFrameBlock(ULONG32 ulTimestamp,
Index: mp4-latm-depack.cpp
===================================================================
RCS file: /cvsroot/datatype/mp4/payload/mp4-latm-depack.cpp,v
retrieving revision 1.11
diff -u -r1.11 mp4-latm-depack.cpp
--- mp4-latm-depack.cpp 14 Sep 2007 22:09:24 -0000 1.11
+++ mp4-latm-depack.cpp 6 Nov 2008 12:12:10 -0000
@@ -84,7 +84,7 @@
{
Bitstream bs;
- bs.SetBuffer(pStreamMuxConfig);
+ bs.SetBuffer(pStreamMuxConfig, ulMuxConfigSize);
bs.SetBufSize(ulMuxConfigSize);
// A config was specified so try to unpack it
@@ -241,17 +241,22 @@
Bitstream bs;
- bs.SetBuffer(pBuffer);
+ bs.SetBuffer(pBuffer, ulSize);
bs.SetBufSize(ulSize);
if (m_bConfigPresent)
{
- if (bs.GetBits(1) == 0)
+ UINT32 ulLeft = bs.BitsLeft();
+ if(ulLeft < 1)
{
+ failed = TRUE;
+ }
+ if (bs.GetBits(1) == 0)
+ {
// Not sure what we are supposed to do if this fails
if (!HandleMuxConfig(bs))
failed = TRUE;
- }
+ }
}
if (!failed)
@@ -267,7 +272,11 @@
failed = TRUE;
break;
}
- GetPayloads(bs, ulFrameTime);
+ if(!GetPayloads(bs, ulFrameTime))
+ {
+ failed = TRUE;
+ break;
+ }
}
m_bHadLoss = FALSE;
@@ -305,15 +314,22 @@
if (m_muxConfig.GetStream(streamID).GetLengthType() == 0)
{
ULONG32 tmp;
- UINT32 ulSizeByteCount = 0;
+ UINT32 ulSizeByteCount = 0;
m_pSlotLengths[streamID] = 0;
-
+ UINT32 ulLeft = bs.BitsLeft();
+
do
- {
- tmp = bs.GetBits(8);
- ulSizeByteCount++;
- m_pSlotLengths[streamID] += tmp;
- } while (tmp == 0xff);
+ {
+ if ( ulLeft< 8 )
+ {
+ failed = TRUE;
+ break;
+ }
+ tmp = bs.GetBits(8);
+ ulSizeByteCount++;
+ m_pSlotLengths[streamID] += tmp;
+ ulLeft = bs.BitsLeft();
+ } while (tmp == 0xff );
if (m_pSlotLengths[streamID] + ulSizeByteCount > bs.GetBufSize())
{
@@ -336,17 +352,23 @@
return !failed;
}
-void MP4LATMDepack::GetPayloads(Bitstream& bs, ULONG32 ulTime)
+HXBOOL MP4LATMDepack::GetPayloads(Bitstream& bs, ULONG32 ulTime)
{
+ HXBOOL failed = FALSE;
if (m_muxConfig.AllSameTiming())
{
for (ULONG32 prog = 0; prog < m_muxConfig.NumPrograms(); prog++)
{
for (ULONG32 layer = 0; layer < m_muxConfig.NumLayers(prog); layer++)
{
- ULONG32 streamID = m_muxConfig.GetStreamID(prog, layer);
-
- bs.GetBits(m_pSlotLengths[streamID] << 3, m_pPayloadBuf);
+ ULONG32 streamID = m_muxConfig.GetStreamID(prog, layer);
+ UINT32 ulLeft = bs.BitsLeft();
+ if ( ulLeft < (m_pSlotLengths[streamID] << 3) )
+ {
+ failed = TRUE;
+ return !failed;
+ }
+ bs.GetBits(m_pSlotLengths[streamID] << 3, m_pPayloadBuf);
// Currently we just hand out packets for stream 0
if ((streamID == 0) && m_pCallback)
@@ -359,5 +381,6 @@
}
}
}
+ return !failed;
}
Index: mp4a-mux-cfg.cpp
===================================================================
RCS file: /cvsroot/datatype/mp4/payload/mp4a-mux-cfg.cpp,v
retrieving revision 1.14
diff -u -r1.14 mp4a-mux-cfg.cpp
--- mp4a-mux-cfg.cpp 28 Aug 2007 20:29:01 -0000 1.14
+++ mp4a-mux-cfg.cpp 6 Nov 2008 12:12:11 -0000
@@ -38,6 +38,7 @@
#include "mp4a-mux-cfg.h"
#include "bitstream.h"
+#include "hxtlogutil.h"
MP4AAudioSpec::MP4AAudioSpec() :
m_pConfig(0),
@@ -89,11 +90,15 @@
{
HXBOOL ret = FALSE;
Bitstream bsTmp;
- bsTmp.SetBuffer(bs.GetBuffer());
+ bsTmp.SetBuffer(bs.GetBuffer(), bs.GetBufSize());
bsTmp.SetBufSize(bs.GetBufSize());
- bsTmp.GetBits(nBits);
- ret = AudioSpecificConfigRead(bsTmp,nBits);
+ UINT32 ulLeft = bsTmp.BitsLeft();
+ if ( ulLeft >= nBits )
+ {
+ bsTmp.GetBits(nBits);
+ ret = AudioSpecificConfigRead(bsTmp,nBits);
+ }
if(ret)
{
// Since AudioSpecificCofig size should be in
@@ -112,7 +117,8 @@
m_ulConfigSize = m_ulConfigBits/8;
delete [] m_pConfig;
m_pConfig = new UINT8 [m_ulConfigSize];
- if(m_pConfig)
+ ulLeft = bs.BitsLeft();
+ if(m_pConfig && ulLeft >= m_ulConfigBits)
{
bs.GetBits(m_ulConfigBits, m_pConfig);
}
@@ -129,17 +135,31 @@
return (m_ulBaseConfigEnd/8);
}
-ULONG32 MP4AAudioSpec::GetAudioObjectType(Bitstream& bs)
+HXBOOL MP4AAudioSpec::GetAudioObjectType(Bitstream& bs, ULONG32& AudioObjectType)
{
- ULONG32 AudioObjectType = bs.GetBits(5);
+ HXBOOL failed = FALSE;
+ UINT32 ulLeft = bs.BitsLeft();
+
+ if ( ulLeft < 5 )
+ {
+ failed = TRUE;
+ }
+ AudioObjectType = bs.GetBits(5);
m_ulConfigBits += 5;
-
+ ulLeft = bs.BitsLeft();
if(AudioObjectType == 31)
{
- AudioObjectType = 32 + bs.GetBits(6);
- m_ulConfigBits += 6;
+ if(ulLeft < 6)
+ {
+ failed = TRUE;
+ }
+ else
+ {
+ AudioObjectType = 32 + bs.GetBits(6);
+ m_ulConfigBits += 6;
+ }
}
- return AudioObjectType;
+ return !failed;
}
/* The SBR present flag is determined according to the syntax
* given in ISO/IEC 14496-3 SP-1 (MPEG-4 Audio). See section 1.6 ,
@@ -147,6 +167,7 @@
*/
HXBOOL MP4AAudioSpec::AudioSpecificConfigRead(Bitstream& bs, ULONG32 nBits)
{
+ HXBOOL failed =FALSE;
ULONG32 samplingFrequency = 0;
HXBOOL bSBR = FALSE;
HXBOOL bPS = FALSE;
@@ -154,20 +175,49 @@
ULONG32 ExtnAudioObjectType = 0;
m_ulConfigBits = 0;
- AudioObjectType = GetAudioObjectType(bs);
-
- ULONG32 samplingFrequencyIndex = bs.GetBits(4);
- m_ulConfigBits += 4;
-
- if(samplingFrequencyIndex == 0xf)
+ if(!GetAudioObjectType(bs,AudioObjectType))
{
- // ESC, read sr from bitstream
- ULONG32 samplingFrequency = bs.GetBits(24);
- m_ulConfigBits += 24;
+ HXLog1("Failed GetAudioObjectType()");
+ }
+ UINT32 ulLeft = bs.BitsLeft();
+ ULONG32 samplingFrequencyIndex = 0;
+
+ if ( ulLeft < 4 )
+ {
+ failed = TRUE;
+ }
+ else
+ {
+ samplingFrequencyIndex = bs.GetBits(4);
+ m_ulConfigBits += 4;
+ }
+
+ ulLeft = bs.BitsLeft();
+ if(samplingFrequencyIndex == 0xf && ulLeft >= 24)
+ {
+ if(ulLeft < 24)
+ {
+ failed = TRUE;
+ }
+ else
+ {
+ // ESC, read sr from bitstream
+ ULONG32 samplingFrequency = bs.GetBits(24);
+ m_ulConfigBits += 24;
+ }
+ }
+
+ ulLeft = bs.BitsLeft();
+ ULONG32 channelConfiguration = 0;
+ if ( ulLeft < 4 )
+ {
+ failed = TRUE;
+ }
+ else
+ {
+ channelConfiguration = bs.GetBits(4);
+ m_ulConfigBits += 4;
}
-
- ULONG32 channelConfiguration = bs.GetBits(4);
- m_ulConfigBits += 4;
if (AudioObjectType == 5 || AudioObjectType == 29)
{
@@ -177,23 +227,42 @@
{
bPS = TRUE;
}
- ULONG32 extensionSamplingFrequencyIndex = bs.GetBits(4);
- m_ulConfigBits += 4;
-
- if(extensionSamplingFrequencyIndex == 0xf)
+ ulLeft = bs.BitsLeft();
+ ULONG32 extensionSamplingFrequencyIndex = 0;
+ if ( ulLeft >= 4 )
+ {
+ extensionSamplingFrequencyIndex = bs.GetBits(4);
+ m_ulConfigBits += 4;
+ }
+ else
+ {
+ failed = TRUE;
+ }
+ ulLeft = bs.BitsLeft();
+ if(ulLeft < 24)
+ {
+ failed = TRUE;
+ }
+ else if(extensionSamplingFrequencyIndex == 0xf)
{
// ESC, read sr from bitstream
bs.GetBits(24);
m_ulConfigBits += 24;
}
- AudioObjectType = GetAudioObjectType(bs);
+ if(!GetAudioObjectType(bs,AudioObjectType))
+ {
+ HXLog1("Failed GetAudioObjectType()");
+ }
}
switch (AudioObjectType)
{
case 1: case 2: case 4:
- GASpecificConfigRead(bs,
- samplingFrequency,channelConfiguration,AudioObjectType) ;
+ if(!GASpecificConfigRead(bs,
+ samplingFrequency,channelConfiguration,AudioObjectType))
+ {
+ failed = TRUE;
+ }
break ;
default:
@@ -203,23 +272,50 @@
ULONG32 ulBitsLeft = bs.GetBufSize()*8 - m_ulConfigBits - nBits;
m_ulBaseConfigEnd = m_ulConfigBits;
+ ulLeft = bs.BitsLeft();
if (!bSBR && ulBitsLeft >= 16)
// if SBR info has not been read before, but there are more bytes to follow...
{
- if (bs.GetBits(11) == 0x2b7)
+ if(ulLeft < 11)
+ {
+ failed = TRUE;
+ }
+ else if (bs.GetBits(11) == 0x2b7)
{
m_ulConfigBits += 11;
- ExtnAudioObjectType = GetAudioObjectType(bs);
+ if(!GetAudioObjectType(bs,ExtnAudioObjectType))
+ {
+ HXLog1("Failed GetAudioObjectType()");
+ }
if (ExtnAudioObjectType == 5)
{
- bSBR = bs.GetBits(1);
- m_ulConfigBits += 1;
+ ulLeft = bs.BitsLeft();
+ if ( ulLeft >= 1 )
+ {
+ bSBR = bs.GetBits(1);
+ m_ulConfigBits += 1;
+ }
+ else
+ {
+ failed = TRUE;
+ }
+ ulLeft = bs.BitsLeft();
if (bSBR)
{
+ if(ulLeft < 4)
+ {
+ failed = TRUE;
+ }
+
ULONG32 extensionSamplingFrequencyIndex = bs.GetBits(4);
m_ulConfigBits += 4;
+ ulLeft = bs.BitsLeft();
if(extensionSamplingFrequencyIndex == 0xf)
{
+ if(ulLeft < 24)
+ {
+ failed = TRUE;
+ }
// ESC, read sr from bitstream
bs.GetBits(24);
m_ulConfigBits += 24;
@@ -241,20 +337,31 @@
}
}
- return TRUE ;
+ return !failed ;
}
-void MP4AAudioSpec::GASpecificConfigRead(Bitstream& bs,
+HXBOOL MP4AAudioSpec::GASpecificConfigRead(Bitstream& bs,
UINT32 samplingFrequency,
UINT32 ChannelConfiguration,
UINT32 AudioObjectType)
{
+ HXBOOL failed = FALSE;
//Read FrameLengthFlag
+ UINT32 ulLeft = bs.BitsLeft();
+ if ( ulLeft < 2 )
+ {
+ failed =TRUE;
+ }
bs.GetBits(1);
m_ulConfigBits += 1;
// Read DependsOnCoreCoder
if (bs.GetBits(1))
{
+ ulLeft = bs.BitsLeft();
+ if(ulLeft < 14)
+ {
+ failed = TRUE;
+ }
bs.GetBits(14);
m_ulConfigBits += 15;
}
@@ -262,40 +369,76 @@
m_ulConfigBits += 1;
// Read ExtensionFlag
- ULONG32 extensionFlag = bs.GetBits(1);
- m_ulConfigBits += 1;
+ ULONG32 extensionFlag = 0;
+ ulLeft = bs.BitsLeft();
+ if ( ulLeft >= 1 )
+ {
+ extensionFlag =bs.GetBits(1);
+ m_ulConfigBits += 1;
+ }
+ else
+ {
+ failed = TRUE;
+ }
if (ChannelConfiguration == 0)
{
- PCERead(bs) ;
+ if(!PCERead(bs))
+ {
+ failed = TRUE;
+ }
}
-
+ ulLeft = bs.BitsLeft();
if((AudioObjectType == 6) || (AudioObjectType == 20))
{
+ if(ulLeft < 3)
+ {
+ failed = TRUE;
+ }
// Read layerNr;
bs.GetBits(3);
m_ulConfigBits += 3;
}
if(extensionFlag)
{
+ ulLeft = bs.BitsLeft();
if (AudioObjectType == 22)
{
+ if(ulLeft < 3)
+ {
+ failed = TRUE;
+ }
// Read numOfSubFrame, layer_length
bs.GetBits(16);
m_ulConfigBits += 16;
}
+ ulLeft = bs.BitsLeft();
if (AudioObjectType == 17 || AudioObjectType == 19 ||
AudioObjectType == 20 || AudioObjectType == 23)
{
+ if(ulLeft < 3)
+ {
+ failed = TRUE;
+ }
+
// TRead aacSectionDataResilienceFlag, aacScalefactorDataResilienceFlag
// and aacSpectralDataResilienceFlag;
bs.GetBits(3);
m_ulConfigBits += 3;
}
// Read extensionFlag3
- bs.GetBits(1);
- m_ulConfigBits += 1;
+ ulLeft = bs.BitsLeft();
+ if ( ulLeft >= 1 )
+ {
+ bs.GetBits(1);
+ m_ulConfigBits += 1;
+ }
+ else
+ {
+ failed = TRUE;
+ }
}
+ return !failed;
}
HXBOOL MP4AAudioSpec::SBRPresent(UINT8* pConfig, UINT32 ulConfigSize, HXBOOL& bSBR)
@@ -305,7 +448,7 @@
ULONG32 ulExtnAudioObjectType = 0;
ULONG32 ulConfigBits = 0;
Bitstream bsAudio;
- bsAudio.SetBuffer(pConfig);
+ bsAudio.SetBuffer(pConfig, ulConfigSize);
bsAudio.SetBufSize(ulConfigSize);
bSBR = FALSE;
if(Unpack(bsAudio, 0))
@@ -319,87 +462,211 @@
return FALSE;
}
-void MP4AAudioSpec::PCERead(Bitstream& bs)
+HXBOOL MP4AAudioSpec::PCERead(Bitstream& bs)
{
+ HXBOOL failed = FALSE;
UINT32 i ;
// Read element_instance_tag, object_type, sampling_frequency_index
+ UINT32 ulLeft = bs.BitsLeft();
+ if ( ulLeft < 10 )
+ {
+ failed = TRUE;
+ }
bs.GetBits(10);
m_ulConfigBits += 10;
-
- UINT32 num_front_channel_elements = bs.GetBits(4) ;
- UINT32 num_side_channel_elements = bs.GetBits(4) ;
- UINT32 num_back_channel_elements = bs.GetBits(4) ;
- UINT32 num_lfe_channel_elements = bs.GetBits(2) ;
- UINT32 num_assoc_data_elements = bs.GetBits(3) ;
- UINT32 num_valid_cc_elements = bs.GetBits(4) ;
- m_ulConfigBits += 21;
+
+ UINT32 num_front_channel_elements = 0 ;
+ UINT32 num_side_channel_elements = 0 ;
+ UINT32 num_back_channel_elements = 0 ;
+ UINT32 num_lfe_channel_elements = 0;
+ UINT32 num_assoc_data_elements = 0 ;
+ UINT32 num_valid_cc_elements = 0 ;
+
+ ulLeft = bs.BitsLeft();
+ if ( ulLeft >= 21 )
+ {
+ num_front_channel_elements = bs.GetBits(4) ;
+ num_side_channel_elements = bs.GetBits(4) ;
+ num_back_channel_elements = bs.GetBits(4) ;
+ num_lfe_channel_elements = bs.GetBits(2) ;
+ num_assoc_data_elements = bs.GetBits(3) ;
+ num_valid_cc_elements = bs.GetBits(4) ;
+ m_ulConfigBits += 21;
+ }
+ else
+ {
+ failed = TRUE;
+ }
// Read mono_mixdown_present
- m_ulConfigBits += 1;
- if (bs.GetBits(1))
+ ulLeft = bs.BitsLeft();
+ if ( ulLeft >= 1 )
{
- // Read mono_mixdown_element_number
- bs.GetBits(4);
- m_ulConfigBits += 4;
+ m_ulConfigBits += 1;
+ if (bs.GetBits(1))
+ {
+ ulLeft = bs.BitsLeft();
+ if(ulLeft < 4)
+ {
+ failed = TRUE;
+ }
+ else
+ {
+ // Read mono_mixdown_element_number
+ bs.GetBits(4);
+ m_ulConfigBits += 4;
+ }
+ }
+ }
+ else
+ {
+ failed = TRUE;
}
// Read stereo_mixdown_present
- if (bs.GetBits(1))
+ ulLeft = bs.BitsLeft();
+ if ( ulLeft >= 1 )
{
- bs.GetBits(4);
- m_ulConfigBits += 4;
+ if (bs.GetBits(1))
+ {
+ ulLeft = bs.BitsLeft();
+ if(ulLeft < 4)
+ {
+ failed = TRUE;
+ }
+ else
+ {
+ bs.GetBits(4);
+ m_ulConfigBits += 4;
+ }
+ }
+ m_ulConfigBits += 1;
+ }
+ else
+ {
+ failed = TRUE;
}
- m_ulConfigBits += 1;
// Read matrix_mixdown_idx_present
- if (bs.GetBits(1))
+ ulLeft = bs.BitsLeft();
+ if ( ulLeft >= 1 )
{
- // Read matrix_mixdown_idx, pseudo_surround_enable
- bs.GetBits(3);
- m_ulConfigBits += 3;
+ if (bs.GetBits(1))
+ {
+ ulLeft = bs.BitsLeft();
+ if(ulLeft < 3)
+ {
+ failed = TRUE;
+ }
+ else
+ {
+ // Read matrix_mixdown_idx, pseudo_surround_enable
+ bs.GetBits(3);
+ m_ulConfigBits += 3;
+ }
+ }
+ m_ulConfigBits += 1;
+ }
+ else
+ {
+ failed = TRUE;
}
- m_ulConfigBits += 1;
- for ( i = 0; i < num_front_channel_elements; i++) {
+ for ( i = 0; i < num_front_channel_elements; i++)
+ {
+ if(bs.BitsLeft() < 5)
+ {
+ failed = TRUE;
+ break;
+ }
bs.GetBits(5);
m_ulConfigBits += 5;
}
- for ( i = 0; i < num_side_channel_elements; i++) {
+ for ( i = 0; i < num_side_channel_elements; i++)
+ {
+ if(bs.BitsLeft() < 5)
+ {
+ failed = TRUE;
+ break;
+ }
bs.GetBits(5);
m_ulConfigBits += 5;
}
- for ( i = 0; i < num_back_channel_elements; i++) {
+ for ( i = 0; i =8 )
+ {
+ comment_field_bytes = bs.GetBits(8);
+ }
+ else
+ {
+ failed = TRUE;
+ }
if (comment_field_bytes)
{
for (i = 0 ; i < comment_field_bytes ; i++)
{
- bs.GetBits(8);
- m_ulConfigBits += 8;
+ ulLeft = bs.BitsLeft();
+ if ( ulLeft >=8 )
+ {
+ bs.GetBits(8);
+ m_ulConfigBits += 8;
+ }
+ else
+ {
+ failed = TRUE;
+ break;
+ }
}
}
+ return !failed;
}
MP4AStreamInfo::MP4AStreamInfo() :
@@ -433,19 +700,36 @@
{
HXBOOL failed = FALSE;
ULONG32 nBits= 0;
-
+ UINT32 ulLeft = 0;
Reset();
#if 1
// This updates StreamMuxConfig to ISO/IEC draft 14496-3:2001
- ULONG32 ulAudioMuxVersion = bs.GetBits(1); // audioMuxVersion
- nBits++;
+ ULONG32 ulAudioMuxVersion = 0;
+ ulLeft = bs.BitsLeft();
+ if ( ulLeft < 1)
+ {
+ failed = TRUE;
+ }
+ else
+ {
+ ulAudioMuxVersion = bs.GetBits(1); // audioMuxVersion
+ nBits++;
+ }
// This updates StreamMuxConfig to ISO/IEC 14496-3:2001/Cor.2:2004(E), Table 1.21
ULONG32 ulAudioMuxVersionA = 0;
if (ulAudioMuxVersion == 1)
- {
- ulAudioMuxVersionA = bs.GetBits(1); // audioMuxVersionA
- nBits++;
+ {
+ ulLeft = bs.BitsLeft();
+ if ( ulLeft < 1)
+ {
+ failed = TRUE;
+ }
+ else
+ {
+ ulAudioMuxVersionA = bs.GetBits(1); // audioMuxVersionA
+ nBits++;
+ }
}
if (ulAudioMuxVersionA == 0)
@@ -453,13 +737,24 @@
if (ulAudioMuxVersion == 1)
{
// this increments nBits
- LatmGetValue(bs, nBits); // TaraBufferFullness
+ ULONG32 ulValue =0;
+ if(!LatmGetValue(bs, nBits, ulValue)) // TaraBufferFullness
+ {
+ failed = TRUE;
+ }
}
-
- m_bAllSameTiming = (bs.GetBits(1) ? TRUE : FALSE);
- m_ulNumSubFrames = bs.GetBits(6) + 1; // 0-based (old version was not)
- m_ulNumPrograms = bs.GetBits(4) + 1; // 0-based (old version was not)
- nBits += 11;
+ ulLeft = bs.BitsLeft();
+ if ( ulLeft < 11)
+ {
+ failed = TRUE;
+ }
+ else
+ {
+ m_bAllSameTiming = (bs.GetBits(1) ? TRUE : FALSE);
+ m_ulNumSubFrames = bs.GetBits(6) + 1; // 0-based (old version was not)
+ m_ulNumPrograms = bs.GetBits(4) + 1; // 0-based (old version was not)
+ nBits += 11;
+
// Allocate arrays
m_pLayerCounts = new ULONG32[m_ulNumPrograms];
m_ppStreamLookup = new ULONG32*[m_ulNumPrograms];
@@ -476,7 +771,14 @@
for (ulProg = 0; !failed && ulProg < m_ulNumPrograms; ulProg++)
{
// Get the number of layers
- ULONG32 ulNumLayers = bs.GetBits(3) + 1; // 0-based (old version was not)
+ ULONG32 ulNumLayers = 0 ;
+ ulLeft = bs.BitsLeft();
+ if ( ulLeft < 3 )
+ {
+ failed = TRUE;
+ break;
+ }
+ ulNumLayers = bs.GetBits(3) + 1; // 0-based (old version was not)
nBits += 3;
// Allocate stream lookup array
MP4AAudioSpec as;
@@ -493,12 +795,17 @@
streamInfo.SetProgram(ulProg);
streamInfo.SetLayer(ulLay);
-
- if ((ulProg != 0) || (ulLay != 0))
- {
+ ulLeft = bs.BitsLeft();
+ if ((ulProg != 0) || (ulLay != 0))
+ {
+ if( ulLeft < 1)
+ {
+ failed = TRUE;
+ break;
+ }
ulUseSameConfig = bs.GetBits(1);
nBits++;
- }
+ }
if (!ulUseSameConfig)
{
@@ -506,7 +813,11 @@
if (ulAudioMuxVersion == 1)
{
// this increments nBits
- ulAscLen = LatmGetValue(bs, nBits);
+ if(!LatmGetValue(bs, nBits, ulAscLen))
+ {
+ failed = TRUE;
+ break;
+ }
}
if (!as.Unpack(bs, nBits)) //nBits bytes already read
@@ -516,23 +827,46 @@
}
ULONG32 ulAscBits = as.ConfigSize() * 8;
+ ulLeft = bs.BitsLeft();
if (ulAscLen > ulAscBits)
{
- // get fill bits
- ulAscLen -= ulAscBits;
- bs.GetBits(ulAscLen);
- nBits += ulAscLen;
+ if(ulLeft < ulAscLen)
+ {
+ failed = TRUE;
+ }
+ else
+ {
+ // get fill bits
+ ulAscLen -= ulAscBits;
+ bs.GetBits(ulAscLen);
+ nBits += ulAscLen;
+ }
}
}
streamInfo.SetAudioSpec(as);
-
- streamInfo.SetLengthType(bs.GetBits(3));
+ ulLeft = bs.BitsLeft();
+ if ( ulLeft >= 3)
+ {
+ streamInfo.SetLengthType(bs.GetBits(3));
+ }
+ else
+ {
+ failed = TRUE;
+ }
switch (streamInfo.GetLengthType())
{
case 0:
- bs.GetBits(8); // Buffer fullness
+ ulLeft = bs.BitsLeft();
+ if ( ulLeft >= 8 )
+ {
+ bs.GetBits(8); // Buffer fullness
+ }
+ else
+ {
+ failed = TRUE;
+ }
if (!m_bAllSameTiming)
{
// Get Core Frame offset
@@ -541,16 +875,41 @@
}
break;
case 1:
- streamInfo.SetFrameLength(bs.GetBits(9));
+ ulLeft = bs.BitsLeft();
+ if ( ulLeft >= 9 )
+ {
+ streamInfo.SetFrameLength(bs.GetBits(9));
+ }
+ else
+ {
+ failed = TRUE;
+ }
break;
case 3:
case 4:
case 5:
- streamInfo.SetCELPIndex(bs.GetBits(6));
+ ulLeft = bs.BitsLeft();
+ if ( ulLeft >= 6 )
+ {
+ streamInfo.SetCELPIndex(bs.GetBits(6));
+ }
+ else
+ {
+ failed = TRUE;
+ }
break;
case 6 :
case 7 :
- streamInfo.SetHVXCIndex(bs.GetBits(1));
+ ulLeft = bs.BitsLeft();
+ if ( ulLeft >= 1 )
+ {
+ streamInfo.SetHVXCIndex(bs.GetBits(1));
+ }
+ else
+ {
+ failed = TRUE;
+ }
+
break;
default:
failed = TRUE;
@@ -568,7 +927,8 @@
}
}
// Other data present
- if (bs.GetBits(1))
+ ulLeft = bs.BitsLeft();
+ if ( ulLeft >= 10 && bs.GetBits(1))
{
UINT8 otherDataLenTemp = 0;
UINT32 otherDataLenBits = 0;
@@ -578,10 +938,15 @@
otherDataLenEsc = (UINT8)bs.GetBits(1);
otherDataLenTemp = (UINT8)bs.GetBits(8);
otherDataLenBits += otherDataLenTemp;
- } while (otherDataLenEsc);
+ } while (otherDataLenEsc && (bs.BitsLeft() >= 9));
}
// Crc present
- if (bs.GetBits(1))
+ ulLeft = bs.BitsLeft();
+ if(ulLeft < 9 )
+ {
+ failed = TRUE;
+ }
+ else if (bs.GetBits(1))
{
bs.GetBits(8);
}
@@ -591,15 +956,25 @@
{
failed = TRUE;
}
+ }
}
#else
- if (bs.GetBits(1))
- m_bAllSameTiming = TRUE;
-
+ ulLeft = bs.BitsLeft();
+ if(ulLeft < 1)
+ {
+ failed = TRUE;
+ }
+ else if (bs.GetBits(1))
+ {
+ m_bAllSameTiming = TRUE;
+ }
+
+ ulLeft = bs.BitsLeft();
+ if ( ulLeft >= 7 )
+ {
m_ulNumSubFrames = bs.GetBits(3);
-
m_ulNumPrograms = bs.GetBits(4);
-
+
m_pLayerCounts = new ULONG32[m_ulNumPrograms];
m_ppStreamLookup = new ULONG32*[m_ulNumPrograms];
@@ -608,10 +983,16 @@
m_pLayerCounts[i] = 0;
m_ppStreamLookup[i] = 0;
}
-
for (ULONG32 prog = 0; !failed && (prog < m_ulNumPrograms) ; prog++)
{
- ULONG32 ulNumLayers = bs.GetBits(3);
+ ULONG32 ulNumLayers =0 ;
+ ulLeft = bs.BitsLeft();
+ if ( ulLeft < 3 )
+ {
+ failed = TRUE;
+ break;
+ }
+ ulNumLayers = bs.GetBits(3);
MP4AAudioSpec as;
@@ -628,8 +1009,13 @@
streamInfo.SetProgram(prog);
streamInfo.SetLayer(lay);
-
- if (((prog != 0) || (lay != 0)) &&
+ ulLeft = bs.BitsLeft();
+ if(ulLeft < 1)
+ {
+ failed = TRUE;
+ break;
+ }
+ else if (((prog != 0) || (lay != 0)) &&
(bs.GetBits(1) != 0))
readAudioSpec = FALSE;
@@ -643,58 +1029,129 @@
}
streamInfo.SetAudioSpec(as);
-
- streamInfo.SetLengthType(bs.GetBits(3));
+ ulLeft = bs.BitsLeft();
+ if ( ulLeft >= 3 )
+ {
+ streamInfo.SetLengthType(bs.GetBits(3));
+ }
+ else
+ {
+ failed = TRUE;
+ break;
+ }
switch (streamInfo.GetLengthType()) {
case 0 :
- streamInfo.SetBlockDelay(bs.GetBits(5));
-
+ ulLeft = bs.BitsLeft();
+ if ( ulLeft >= 6 )
+ {
+ streamInfo.SetBlockDelay(bs.GetBits(5));
+ }
+ else
+ {
+ failed = TRUE;
+ break;
+ }
if (bs.GetBits(1))
{
streamInfo.SetFracDelayPresent(TRUE);
- streamInfo.SetFracDelay(bs.GetBits(8));
+ ulLeft = bs.BitsLeft();
+ if ( ulLeft >= 8 )
+ {
+ streamInfo.SetFracDelay(bs.GetBits(8));
+ }
+ else
+ {
+ failed = TRUE;
+ }
}
break;
case 1 :
- streamInfo.SetFrameLength(bs.GetBits(9));
- break;
+ ulLeft = bs.BitsLeft();
+ if ( ulLeft >= 9 )
+ {
+ streamInfo.SetFrameLength(bs.GetBits(9));
+ }
+ else
+ {
+ failed = TRUE;
+ }
+ break;
case 3 :
case 4 :
case 5 :
- streamInfo.SetCELPIndex(bs.GetBits(6));
- break;
+ ulLeft = bs.BitsLeft();
+ if ( ulLeft >= 6 )
+ {
+ streamInfo.SetCELPIndex(bs.GetBits(6));
+ }
+ else
+ {
+ failed = TRUE;
+ }
+ break;
case 6 :
case 7 :
- streamInfo.SetHVXCIndex(bs.GetBits(1));
+ ulLeft = bs.BitsLeft();
+ if ( ulLeft >= 1 )
+ {
+ streamInfo.SetHVXCIndex(bs.GetBits(1));
+ }
+ else
+ {
+ failed = TRUE;
+ }
break;
};
AddStream(streamInfo);
}
}
+ }
+ else
+ {
+ failed = TRUE;
+ }
#endif
return !failed;
}
-ULONG32 MP4AMuxConfig::LatmGetValue(Bitstream&bs, ULONG32& nBits)
+HXBOOL MP4AMuxConfig::LatmGetValue(Bitstream&bs, ULONG32& nBits, ULONG32& ulValue)
{
- ULONG32 ulValue = 0;
- ULONG32 ulBytesForValue = bs.GetBits(2);
- nBits += 2;
+ HXBOOL failed = FALSE;
+ ULONG32 ulBytesForValue = 0;
+ UINT32 ulLeft =bs.BitsLeft();
+ if( ulLeft >= 2 )
+ {
+ ulBytesForValue = bs.GetBits(2);
+ nBits += 2;
+ }
+ else
+ {
+ failed = TRUE;
+ }
for (ULONG32 i=0; i<=ulBytesForValue; i++)
{
ulValue << 8;
- ulValue += bs.GetBits(8);
- nBits += 8;
+ ulLeft =bs.BitsLeft();
+ if ( ulLeft >= 8 )
+ {
+ ulValue += bs.GetBits(8);
+ nBits += 8;
+ }
+ else
+ {
+ failed = TRUE;
+ break;
+ }
}
- return ulValue;
+ return !failed;
}
void MP4AMuxConfig::Reset()
Index: pub/amr-depack.h
===================================================================
RCS file: /cvsroot/datatype/mp4/payload/pub/amr-depack.h,v
retrieving revision 1.5
diff -u -r1.5 amr-depack.h
--- pub/amr-depack.h 14 Mar 2005 19:17:45 -0000 1.5
+++ pub/amr-depack.h 6 Nov 2008 12:12:11 -0000
@@ -83,8 +83,8 @@
protected:
HXBOOL UpdateIleavInfo(ULONG32 ulILL, ULONG32 ulILP, ULONG32 ulTime);
- void GetTOCInfo(Bitstream& bs, AMRTOCInfo& tocInfo);
- void SkipCRCInfo(Bitstream& bs, const AMRTOCInfo& tocInfo);
+ HXBOOL GetTOCInfo(Bitstream& bs, AMRTOCInfo& tocInfo);
+ HXBOOL SkipCRCInfo(Bitstream& bs, const AMRTOCInfo& tocInfo);
void UpdateBlockCount(ULONG32 ulBlockCount);
@@ -98,7 +98,7 @@
ULONG32 ulChannels);
// Copies robust sorted frame data to m_blockBuf
- void SortedCopy(Bitstream& bs, ULONG32 ulStartBlock, ULONG32 ulBlockInc,
+ HXBOOL SortedCopy(Bitstream& bs, ULONG32 ulStartBlock, ULONG32 ulBlockInc,
const AMRTOCInfo& tocInfo);
void DispatchBlocks(ULONG32 ulTimestamp);
Index: pub/mp4-latm-depack.h
===================================================================
RCS file: /cvsroot/datatype/mp4/payload/pub/mp4-latm-depack.h,v
retrieving revision 1.4
diff -u -r1.4 mp4-latm-depack.h
--- pub/mp4-latm-depack.h 27 Jun 2006 14:59:48 -0000 1.4
+++ pub/mp4-latm-depack.h 6 Nov 2008 12:12:11 -0000
@@ -78,7 +78,7 @@
HXBOOL HandleMuxConfig(Bitstream& bs);
HXBOOL GetPayloadLengths(Bitstream& bs);
- void GetPayloads(Bitstream& bs, ULONG32 ulTime);
+ HXBOOL GetPayloads(Bitstream& bs, ULONG32 ulTime);
private:
ULONG32 m_ulSampleRate;
Index: pub/mp4a-mux-cfg.h
===================================================================
RCS file: /cvsroot/datatype/mp4/payload/pub/mp4a-mux-cfg.h,v
retrieving revision 1.7
diff -u -r1.7 mp4a-mux-cfg.h
--- pub/mp4a-mux-cfg.h 14 Aug 2007 21:59:19 -0000 1.7
+++ pub/mp4a-mux-cfg.h 6 Nov 2008 12:12:11 -0000
@@ -50,13 +50,13 @@
MP4AAudioSpec& operator=(const MP4AAudioSpec& rhs);
HXBOOL Unpack(Bitstream& bs, ULONG32 nBits);
- ULONG32 GetAudioObjectType(Bitstream& bs);
+ HXBOOL GetAudioObjectType(Bitstream& bs, ULONG32& AudioObjectType);
HXBOOL AudioSpecificConfigRead(Bitstream& bs, ULONG32 nBits);
- void GASpecificConfigRead(Bitstream& bs,
+ HXBOOL GASpecificConfigRead(Bitstream& bs,
UINT32 samplingFrequency,
UINT32 ChannelConfiguration,
UINT32 AudioObjectType);
- void PCERead(Bitstream& bs);
+ HXBOOL PCERead(Bitstream& bs);
HXBOOL SBRPresent(UINT8* pConfig, UINT32 ulConfigSize, HXBOOL& bSBR);
ULONG32 GetBaseConfigSize();
const UINT8* Config() const;
@@ -139,7 +139,7 @@
protected :
void Reset();
void AddStream(const MP4AStreamInfo& info);
- ULONG32 LatmGetValue(Bitstream& bs, ULONG32& nBits);
+ HXBOOL LatmGetValue(Bitstream& bs, ULONG32& nBits, ULONG32& ulValue);
private:
HXBOOL m_bAllSameTiming;
-------------- next part --------------
Index: bitpack.cpp
===================================================================
RCS file: /cvsroot/datatype/common/util/bitpack.cpp,v
retrieving revision 1.5
diff -u -r1.5 bitpack.cpp
--- bitpack.cpp 6 Jul 2007 22:00:23 -0000 1.5
+++ bitpack.cpp 6 Nov 2008 12:13:50 -0000
@@ -96,21 +96,32 @@
}
}
-void BitPacker::PackBits(const UINT8* pBuf, ULONG32 bitCount,
+HX_RESULT BitPacker::PackBits(const UINT8* pBuf, ULONG32 bitCount,
ULONG32 ulStartOffset)
{
// Reference implementation
Bitstream bs;
- bs.SetBuffer(pBuf);
+ bs.SetBuffer(pBuf, m_ulBufSize);
+ UINT32 ulLeft = bs.BitsLeft();
+ if ( ulLeft < (ulStartOffset + bitCount) )
+ {
+ return HXR_FAIL;
+ }
bs.GetBits(ulStartOffset);
-
while(bitCount)
{
int bits = (bitCount > 8) ? 8 : bitCount;
- PackBits(bs.GetBits(bits), bits);
+
+ ulLeft = bs.BitsLeft();
+ if ( ulLeft < (UINT32) bits )
+ {
+ return HXR_FAIL;
+ }
+ PackBits(bs.GetBits(bits), bits);
bitCount -= bits;
}
+ return HXR_OK;
}
UINT32 BitPacker::ByteAlign()
Index: bitstream.cpp
===================================================================
RCS file: /cvsroot/datatype/common/util/bitstream.cpp,v
retrieving revision 1.7
diff -u -r1.7 bitstream.cpp
--- bitstream.cpp 6 Jul 2007 22:00:23 -0000 1.7
+++ bitstream.cpp 6 Nov 2008 12:13:50 -0000
@@ -74,11 +74,13 @@
m_pCur(0),
m_bitBuf(0),
m_bitCount(0),
- m_ulBufSize(0)
+ m_ulBufSize(0),
+ m_ulBufSizeBits(0)
{}
-void Bitstream::SetBuffer(const UINT8* pBuf)
+void Bitstream::SetBuffer(const UINT8* pBuf, ULONG32 ulBufSize )
{
+ SetBufSize(ulBufSize);
m_pBuf = pBuf;
m_pCur = m_pBuf;
}
@@ -91,6 +93,7 @@
void Bitstream::SetBufSize(ULONG32 ulBufSize)
{
m_ulBufSize = ulBufSize;
+ m_ulBufSizeBits = ulBufSize<<3;
}
ULONG32 Bitstream::GetBufSize(void)
@@ -113,6 +116,8 @@
m_bitCount = 8 - (bitCount - m_bitCount);
}
+ m_ulBufSizeBits -= bitCount;
+
return ret;
}
@@ -166,3 +171,9 @@
GetBits(bitCount);
}
+
+UINT32 Bitstream::BitsLeft(void)
+{
+ return m_ulBufSizeBits;
+}
+
Index: pub/bitpack.h
===================================================================
RCS file: /cvsroot/datatype/common/util/pub/bitpack.h,v
retrieving revision 1.4
diff -u -r1.4 bitpack.h
--- pub/bitpack.h 6 Jul 2007 22:00:24 -0000 1.4
+++ pub/bitpack.h 6 Nov 2008 12:13:50 -0000
@@ -51,14 +51,14 @@
#define BITPACK_H
#include "hxtypes.h"
-
+#include "hxresult.h"
class BitPacker
{
public:
BitPacker(UINT8* pBuf, ULONG32 ulBufSize);
void PackBits(UINT32 bits, ULONG32 bitCount);
- void PackBits(const UINT8* pBuf, ULONG32 bitCount,
+ HX_RESULT PackBits(const UINT8* pBuf, ULONG32 bitCount,
ULONG32 ulStartOffset);
UINT32 ByteAlign();
Index: pub/bitstream.h
===================================================================
RCS file: /cvsroot/datatype/common/util/pub/bitstream.h,v
retrieving revision 1.4
diff -u -r1.4 bitstream.h
--- pub/bitstream.h 6 Jul 2007 22:00:24 -0000 1.4
+++ pub/bitstream.h 6 Nov 2008 12:13:51 -0000
@@ -57,7 +57,7 @@
public:
Bitstream();
- void SetBuffer(const UINT8* pBuf);
+ void SetBuffer(const UINT8* pBuf, ULONG32 ulBufSize);
const UINT8* GetBuffer(void);
void SetBufSize(ULONG32 ulBufSize);
ULONG32 GetBufSize(void);
@@ -68,6 +68,7 @@
ULONG32 PeekBits(ULONG32 bitCount);
void FlushBits(ULONG32 bitCount);
+ UINT32 BitsLeft(void);
private:
const UINT8* m_pBuf;
@@ -76,6 +77,7 @@
ULONG32 m_bitBuf;
ULONG32 m_bitCount;
ULONG32 m_ulBufSize;
+ ULONG32 m_ulBufSizeBits;
};
#endif // BITSTREAM_H
Index: test/tbitpack.cpp
===================================================================
RCS file: /cvsroot/datatype/common/util/test/tbitpack.cpp,v
retrieving revision 1.3
diff -u -r1.3 tbitpack.cpp
--- test/tbitpack.cpp 6 Jul 2007 22:00:24 -0000 1.3
+++ test/tbitpack.cpp 6 Nov 2008 12:13:51 -0000
@@ -163,14 +163,23 @@
Bitstream unpack;
- unpack.SetBuffer(buf);
+ unpack.SetBuffer(buf, BUFFER_SIZE);
+ UINT32 ulLeft = 0;
for (int j = 0; !failed && (j < VALUE_CT); j++)
{
int bitCount = GetBitCount(31);
int expected = GetValue(j, bitCount);
- int peekVal = unpack.PeekBits(bitCount);
- int getVal = unpack.GetBits(bitCount);
+
+ int peekVal = 0;
+ int getVal = 0;
+ ulLeft = unpack.BitsLeft();
+
+ if ( ulLeft >= (UINT32) bitCount )
+ {
+ peekVal = unpack.PeekBits(bitCount);
+ getVal = unpack.GetBits(bitCount);
+ }
if (expected != peekVal)
{
@@ -211,8 +220,8 @@
Bitstream baseStream;
Bitstream expectStream;
- baseStream.SetBuffer(buf);
- expectStream.SetBuffer(buf);
+ baseStream.SetBuffer(buf, MaxBufferSize);
+ expectStream.SetBuffer(buf, MaxBufferSize);
int bitCount = 0;
@@ -221,14 +230,24 @@
int maxBits = (bitsLeft > MaxBitCount) ? MaxBitCount : bitsLeft;
bitCount = GetBitCount(maxBits);
-
- baseStream.GetBits(bitCount, tmpBuffer);
+ UINT32 ulLeft = baseStream.BitsLeft();
+
+ if ( ulLeft >= (UINT32) bitCount )
+ {
+ baseStream.GetBits(bitCount, tmpBuffer);
+ }
int tmpBitCount = bitCount;
for (int i = 0; !failed && tmpBitCount; i++)
{
int a = (tmpBitCount > 8) ? 8 : tmpBitCount;
- ULONG32 expect = expectStream.GetBits(a);
+ ulLeft = expectStream.BitsLeft();
+ ULONG32 expect = 0;
+ if ( ulLeft >= (UINT32) a )
+ {
+ expect = expectStream.GetBits(a);
+ }
+
ULONG32 result = tmpBuffer[i];
if (a < 8)
@@ -309,10 +328,19 @@
pack.PackBits(src, bitCount, 0);
Bitstream expectStream;
- expectStream.SetBuffer(dst);
+ expectStream.SetBuffer(dst, MaxBufSize);
- expectStream.GetBits(offset);
- expectStream.GetBits(bitCount, expectBuf);
+ UINT32 ulLeft = expectStream.BitsLeft();
+ if ( ulLeft >= offset )
+ {
+ expectStream.GetBits(offset);
+ }
+
+ ulLeft = expectStream.BitsLeft();
+ if ( ulLeft >= (UINT32) bitCount )
+ {
+ expectStream.GetBits(bitCount, expectBuf);
+ }
failed = !CompareBuffers(src, expectBuf, bitCount);
}
@@ -320,6 +348,66 @@
return !failed;
}
+bool RunTest4(int run)
+{
+ printf ("RunTest4(%d)\n", run);
+
+ bool failed = false;
+
+ // This tests the buffer BitsLeft(), PeekBits() operation
+ const int MaxBufferSize = 100;
+ const int MaxBufferBits = 8 * MaxBufferSize;
+ const int MaxByteCount = MaxBufferSize / 2;
+ const int MaxBitCount = MaxByteCount * 8;
+ UINT32 BitsLeft = MaxBufferBits;
+
+ UINT8 buf[MaxBufferSize];
+ GenBuffer(buf, MaxBufferSize);
+
+ Bitstream baseStream0;
+ Bitstream baseStream1;
+
+ baseStream0.SetBuffer(buf, MaxBufferSize);
+ baseStream1.SetBuffer(buf, MaxBufferSize);
+
+
+ int bitCount = 0;
+ for (int bitsLeft = MaxBufferBits; !failed && bitsLeft; bitsLeft -= bitCount)
+ {
+ int maxBits = (bitsLeft > MaxBitCount) ? MaxBitCount : bitsLeft;
+
+ bitCount = GetBitCount(maxBits);
+ bitCount = (bitCount > 32) ? (bitCount-8) : bitCount;
+ if (bitCount >32)
+ {
+ bitCount = 32;
+ }
+ UINT32 ulLeft = baseStream0.BitsLeft();
+
+ if ( ulLeft >= (UINT32) bitCount )
+ {
+ baseStream0.GetBits(bitCount);
+ BitsLeft -= bitCount;
+ }
+ ulLeft = baseStream1.BitsLeft();
+
+ if ( ulLeft >= (UINT32) bitCount )
+ {
+ baseStream1.PeekBits(bitCount);
+ }
+ ulLeft = baseStream0.BitsLeft();
+ UINT32 ulLeft1 = baseStream1.BitsLeft();
+ if ((BitsLeft != ulLeft) && (ulLeft1 != MaxBufferBits) )
+ {
+ printf ("bits left %d expect %02x got %02x\n",
+ run, BitsLeft, ulLeft);
+ failed = true;
+ }
+ }
+
+ return !failed;
+}
+
int main (int argc, char* argv[])
{
int ret = 0;
@@ -328,7 +416,8 @@
{
if (!RunTest(i) ||
!RunTest2(i) ||
- !RunTest3(i))
+ !RunTest3(i) ||
+ !RunTest4(i))
{
ret = -1;
break;
-------------- next part --------------
Index: ADIFfile.cpp
===================================================================
RCS file: /cvsroot/datatype/aac/fileformat/ADIFfile.cpp,v
retrieving revision 1.7
diff -u -r1.7 ADIFfile.cpp
--- ADIFfile.cpp 30 Jan 2006 21:10:58 -0000 1.7
+++ ADIFfile.cpp 6 Nov 2008 12:15:51 -0000
@@ -40,6 +40,7 @@
#include "dllpath.h"
#include "netbyte.h"
#include "aacparser.h"
+#include "hxtlogutil.h"
#if !defined(HELIX_FEATURE_DLLACCESS_CLIENT)
ENABLE_DLLACCESS_PATHS(mp4arend);
@@ -222,7 +223,12 @@
{
return HXR_FAIL;
}
- m_ulIndex += ParseADIFHeader(pAudioSpecificConfig);
+ UINT16 unADIFHeaderSize=0;
+ if(FAILED(ParseADIFHeader(pAudioSpecificConfig, unADIFHeaderSize)))
+ {
+ return HXR_FAIL;
+ }
+ m_ulIndex += unADIFHeaderSize;
m_pAACParser->SetAudioObjectType(pAudioSpecificConfig[0] >> 3);
m_pAACParser->SetSamplingFrequencyIndex(m_unSamplingFrequencyIndex);
retVal = m_pCommonClassFactory->CreateInstance(CLSID_IHXBuffer, (void**)&m_pOpaqueData);
@@ -270,7 +276,11 @@
{
// Go back and add explicit SBR signal to AudioSpecificConfig.
// Otherwise, decoder wrapper won't know about SBR at init.
- AddSBRExtension(pDestinationBuffer+1);
+ HX_RESULT resVal = AddSBRExtension(pDestinationBuffer+1, MAX_SIZE_AUDIO_SPECIFIC_CONFIG);
+ if(FAILED(resVal))
+ {
+ HXLog1("Failed to add explicit SBR signal to AudioSpecificConfig");
+ }
}
}
else
@@ -339,11 +349,10 @@
}
-UINT16 CADIFFile::ParseADIFHeader(REF(UINT8*) pAudioSpecificConfig)
+HX_RESULT CADIFFile::ParseADIFHeader(REF(UINT8*) pAudioSpecificConfig, UINT16& unADIFHeaderSize)
{
UINT16 i = 0;
UINT16 j = 0;
- UINT16 unADIFHeaderSize = 0;
UINT16 unProgConfigSize = 0;
UINT16 unBitStreamType = 0;
UINT16 unBitstreamType = 0;
@@ -363,15 +372,29 @@
Bitstream bs;
BitPacker progConfig(pAudioSpecificConfig, MAX_SIZE_AUDIO_SPECIFIC_CONFIG);
- bs.SetBuffer(pBuf);
-
+ bs.SetBuffer(pBuf, m_pBuffer->GetSize());
+ UINT32 ulLeft = bs.BitsLeft();
+ if ( ulLeft < 33 )
+ {
+ return HXR_FAIL;
+ }
bs.GetBits(32); // ADIF ID
unADIFHeaderSize += 33;
- if (bs.GetBits(1)) // copyright ID present
+ ulLeft = bs.BitsLeft();
+ if (bs.GetBits(1) ) // copyright ID present
{
+ if(ulLeft < 72)
+ {
+ return HXR_FAIL;
+ }
bs.GetBits(72); // Copyright ID
unADIFHeaderSize += 72;
}
+ ulLeft = bs.BitsLeft();
+ if ( ulLeft < 30 )
+ {
+ return HXR_FAIL;
+ }
bs.GetBits(1); // Original copy
bs.GetBits(1); // home
unBitstreamType = (UINT16)bs.GetBits(1); // Bitstream Type
@@ -381,8 +404,14 @@
HX_ASSERT(unNumProgConfigElements == 1); // AudioSpecificConfig can only have one config element!
unADIFHeaderSize += 30;
+ ulLeft = bs.BitsLeft();
+
if (unBitstreamType == 0)
{
+ if(ulLeft < 20)
+ {
+ return HXR_FAIL;
+ }
bs.GetBits(20); // adif buffer fullness
unADIFHeaderSize += 20;
}
@@ -392,7 +421,11 @@
// parsing code that handles the audio specific config data later on would surely
// get off track at the byte alignment step before the comment field data.
// So, we repack the pce after writing the first 16 bits of AudioSpecificConfig...
-
+ ulLeft = bs.BitsLeft();
+ if ( ulLeft < 32 )
+ {
+ return HXR_FAIL;
+ }
ulElementInstanceTag = bs.GetBits(4); // unpack element instance tag
m_unAudioObjectType = (UINT8)bs.GetBits(2) + 1; // unpack object type
m_unSamplingFrequencyIndex = (UINT16)bs.GetBits(4); // unpack sampling frequency index
@@ -425,61 +458,125 @@
flag = bs.GetBits(1);
progConfig.PackBits(flag, 1);
+ ulLeft = bs.BitsLeft() ;
+
if (flag == 1) // mono mixdown present
{
+ if(ulLeft < 4)
+ {
+ return HXR_FAIL;
+ }
progConfig.PackBits(bs.GetBits(4), 4); // unpack/pack mono mixdown element number
unProgConfigSize += 4;
}
+ ulLeft = bs.BitsLeft();
+ if ( ulLeft < 1 )
+ {
+ return HXR_FAIL;
+ }
flag = bs.GetBits(1);
progConfig.PackBits(flag, 1);
- if (flag == 1) // stereo mixdown present
+ ulLeft = bs.BitsLeft();
+ if (flag == 1 ) // stereo mixdown present
{
+ if(ulLeft < 4)
+ {
+ return HXR_FAIL;
+ }
progConfig.PackBits(bs.GetBits(4), 4); // unpack/pack stereo mixdown element number
unProgConfigSize += 4;
}
+ ulLeft = bs.BitsLeft();
+ if ( ulLeft < 1 )
+ {
+ return HXR_FAIL;
+ }
+
flag = bs.GetBits(1);
progConfig.PackBits(flag, 1);
+
+ ulLeft = bs.BitsLeft();
if (flag == 1) // matrix mixdown present
{
+ if(ulLeft < 3)
+ {
+ return HXR_FAIL;
+ }
progConfig.PackBits(bs.GetBits(3), 3); // unpack/pack matrix mixdown element info
unProgConfigSize += 3;
}
-
+
for (i=0; i < numFrontChannels; i++)
- {
+ {
+ ulLeft = bs.BitsLeft();
+ if(ulLeft < 5)
+ {
+ return HXR_FAIL;
+ }
+
progConfig.PackBits(bs.GetBits(5), 5); // unpack/pack front element bits
unProgConfigSize += 5;
- }
- for (i=0; i < numSideChannels; i++)
+ }
+ for (i=0; i < numSideChannels; i++ )
{
+ ulLeft = bs.BitsLeft();
+ if(ulLeft < 5)
+ {
+ return HXR_FAIL;
+ }
progConfig.PackBits(bs.GetBits(5), 5); // unpack/pack side element bits
unProgConfigSize += 5;
}
for (i=0; i < numBackChannels; i++)
- {
+ {
+ ulLeft = bs.BitsLeft();
+ if(ulLeft < 5)
+ {
+ return HXR_FAIL;
+ }
progConfig.PackBits(bs.GetBits(5), 5); // unpack/pack back element bits
unProgConfigSize += 5;
}
for (i=0; i < numLFEChannels; i++)
- {
+ {
+ ulLeft = bs.BitsLeft();
+ if(ulLeft < 4)
+ {
+ return HXR_FAIL;
+ }
progConfig.PackBits(bs.GetBits(4), 4); // unpack/pack lfe element bits
unProgConfigSize += 4;
}
for (i=0; i < numASSOCdata; i++)
- {
+ {
+ ulLeft = bs.BitsLeft();
+ if(ulLeft < 5)
+ {
+ return HXR_FAIL;
+ }
progConfig.PackBits(bs.GetBits(4), 4); // unpack/pack assoc data element bits
unProgConfigSize += 4;
}
for (i=0; i < numCCElements; i++)
- {
+ {
+ ulLeft = bs.BitsLeft();
+ if(ulLeft < 5)
+ {
+ return HXR_FAIL;
+ }
progConfig.PackBits(bs.GetBits(5), 5); // unpack/pack cc element bits
unProgConfigSize += 5;
}
// Byte alignment for ADIF header
i = 8 - ((unADIFHeaderSize + unProgConfigSize - 16) & 0x7);
+ ulLeft = bs.BitsLeft();
if (i != 8)
{
+ if(ulLeft < unADIFalign)
+ {
+ return HXR_FAIL;
+ }
unADIFalign = i;
bs.GetBits(unADIFalign);
}
@@ -493,11 +590,21 @@
}
// Exclude comment field from config data
+ ulLeft = bs.BitsLeft();
+ if ( ulLeft < 8 )
+ {
+ return HXR_FAIL;
+ }
numCommentBytes = (UINT16)bs.GetBits(8); // unpack comment field length
progConfig.PackBits(0, 8); // pack comment field length (always zero)
unProgConfigSize += 8;
for (i=0; i < numCommentBytes; i++)
- {
+ {
+ ulLeft = bs.BitsLeft();
+ if(ulLeft < 8)
+ {
+ return HXR_FAIL;
+ }
bs.GetBits(8); // unpack comment bytes
}
@@ -507,7 +614,7 @@
// Compute ADIF header size
unADIFHeaderSize = (unADIFHeaderSize + unADIFalign + unProgConfigSize - 16 + numCommentBytes*8)>>3;
- return unADIFHeaderSize;
+ return HXR_OK;
}
@@ -565,7 +672,7 @@
}
-HX_RESULT CADIFFile::AddSBRExtension(UINT8* pAudioSpecificConfig)
+HX_RESULT CADIFFile::AddSBRExtension(UINT8* pAudioSpecificConfig, UINT32 ulSize )
{
UINT32 ulAudioObjectType = 0;
UINT32 ulSampFreq = 0;
@@ -573,7 +680,7 @@
UCHAR extensionBits[6];
BitPacker exBits(extensionBits, 6);
Bitstream bs;
- bs.SetBuffer(pAudioSpecificConfig);
+ bs.SetBuffer(pAudioSpecificConfig, ulSize);
// Write extension bits to end of config data (assume byte aligned)
// syncExtensionType : 0x2b7 (11 bits)
@@ -588,8 +695,12 @@
// Pack sbrPresentFlag (1 bit)
exBits.PackBits(0x1, 1);
-
+ UINT32 ulLeft = bs.BitsLeft();
// Get sample rate config data
+ if ( ulLeft < 9 )
+ {
+ return HXR_FAIL;
+ }
ulAudioObjectType = bs.GetBits(5); // audioObjectType
ulSampFreqIndex = bs.GetBits(4); // samplingFrequencyIndex
@@ -598,8 +709,14 @@
// Pack extensionSamplingFrequencyIndex (4 bits)
exBits.PackBits(ulSampFreqIndex, 4);
// Pack extensionSamplingFrequency (24 bits)
+ ulLeft = bs.BitsLeft();
+ if ( ulLeft < 24 )
+ {
+ return HXR_FAIL;
+ }
ulSampFreqExt = bs.GetBits(24) * 2; // extended sampling frequency
exBits.PackBits(ulSampFreqExt, 24);
+
}
else if (ulSampFreqIndex < 12)
{
Index: aacff.cpp
===================================================================
RCS file: /cvsroot/datatype/aac/fileformat/aacff.cpp,v
retrieving revision 1.38
diff -u -r1.38 aacff.cpp
--- aacff.cpp 8 Sep 2008 21:41:34 -0000 1.38
+++ aacff.cpp 6 Nov 2008 12:15:53 -0000
@@ -1245,7 +1245,7 @@
unBitsForMillisecondDeviation = pData[i];
i += 1;
- bs.SetBuffer(&pData[i]);
+ bs.SetBuffer(&pData[i], ulSize-i );
ulSize -= i;
ulTableSize = (ulSize << 3) /
(unBitsForByteDeviation + unBitsForMillisecondDeviation);
@@ -1266,8 +1266,15 @@
}
for (i = 0,j = 0; j < ulTableSize && (i >> 3) < ulSize; j++)
{
+ UINT32 ulLeft = 0;
if (unBitsForByteDeviation)
{
+ ulLeft = bs.BitsLeft();
+
+ if ( ulLeft < unBitsForByteDeviation )
+ {
+ return HXR_FAIL;
+ }
ulNegative = bs.PeekBits(1);
ulTableValue = (INT32)bs.GetBits(unBitsForByteDeviation);
if (ulNegative)
@@ -1284,6 +1291,12 @@
}
if (unBitsForMillisecondDeviation)
{
+ ulLeft = bs.BitsLeft();
+
+ if ( ulLeft < unBitsForMillisecondDeviation )
+ {
+ return HXR_FAIL;
+ }
ulNegative = bs.PeekBits(1);
ulTableValue = (INT32)bs.GetBits(unBitsForMillisecondDeviation);
if (ulNegative)
Index: aacfiletypes.h
===================================================================
RCS file: /cvsroot/datatype/aac/fileformat/aacfiletypes.h,v
retrieving revision 1.7
diff -u -r1.7 aacfiletypes.h
--- aacfiletypes.h 6 Jun 2005 17:56:38 -0000 1.7
+++ aacfiletypes.h 6 Nov 2008 12:15:53 -0000
@@ -287,8 +287,8 @@
IHXCommonClassFactory* pCommonClassFactory,
IUnknown* pContext,
UINT8 uID3version);
- UINT16 ParseADIFHeader(REF(UINT8*)pAudioSpecificConfig);
- HX_RESULT AddSBRExtension(UINT8* pAudioSpecificConfig);
+ HX_RESULT ParseADIFHeader(REF(UINT8*)pAudioSpecificConfig, UINT16& unADIFHeaderSize);
+ HX_RESULT AddSBRExtension(UINT8* pAudioSpecificConfig, UINT32 ulsize);
UINT32 GetMetaDataSize(UCHAR* pFrameBuffer);
};
From ext-asheesh.srivastava at nokia.com Thu Nov 6 10:50:32 2008
From: ext-asheesh.srivastava at nokia.com (ext-asheesh.srivastava@nokia.com)
Date: Thu Nov 6 08:55:48 2008
Subject: [datatype-dev] CR: Fix for AAC and its extenssion type (eAAC+ etc)
audio clips issue with hardware accelerated codecs in HEAD branch.
Message-ID: <03528B6E301B3B42833693425F0A49F701EADE09@daebe102.NOE.Nokia.com>
> "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: ext-asheesh.srivastava@nokia.com
>
> Reviewed by:
>
> Date: 11/06/2008
>
> Project: SymbianMmf_wm
>
> ErrorId: N/A
>
> Synopsis: AAC and its extenssion type (eAAC+ etc) audio clips
> were not playing for local playback/streaming when used with DSP
> decoder in HEAD branch.
>
> Overview:
> Because of the reasons listed below, AAC and its extenssion type
> audio clips were not playing when used with DSP decoder in HEAD branch
>
> 1. CR - Enable eAAC+ error concealmeant was not propogated to
> HEAD. It activates error concealment for eAAC+ clips when used with
> hardware decoders.
>
> 2. During CHXAudioSession::Resume(CHXAudioPlayer*
> pPlayerToExclude, HXBOOL bRewindNeeded) call , bRewindNeeded gets
> enabled and that leads call to
> RewindSession, which empties the audio device's buffer list and
> that inturn adds filler (silence) frames to the audio device and audio
> play-back gets stuck.
> Resume () was calling RewindSession() even if the audio session
> has not pushed any data into the audio device.
> A check is made based on m_dNumBytesWritten to skip
> RewindSession() call if audio session has not pushed any data to it.
>
> 3. CHXMDFAudioDevice::CheckFormat(const HXAudioFormat*
> pAudioFormat) function was not implemented.
> This implementation now checks if the asked audio format is same
> as the audio device's format when the device was created by the
> decoder.
>
> 4. Target audio pushdown was calculated based on
> MINIMUM_AUDIO_PUSHDOWN in CHXAudioSession::SetAudioPushdown()
> function.
> It should be calculated based on TARGET_AUDIO_PUSHDOWN.
>
> 5. Workaround in CHXAudioPlayer::Setup( ULONG32 ulGranularity)
> for keeping min. channel at stereo is no longer required.
> RA renderer used to only call IHXAudioStream::Init() on the
> first substream when a SureStream(multi-rate) stream was played.
> Then, as it received packets for other substreams, then it
> created and Init'd those IHXAudioStreams.
> However, the current RA renderer creates and Init's an
> IHXAudioStream for each substream. So it would appear that this
> workaround is no longer needed.
>
> Files Modified:
> /cvsroot/datatype/mdf/audio/dsp/mdfauddevice.cpp
> /cvsroot/datatype/mdf/audio/dsp/mdfaudfmt.cpp
> /cvsroot/datatype/mdf/audio/dsp/mdfaudfmt.h
> /cvsroot/datatype/mdf/audio/dsp/mdfdevsound.cpp
> /cvsroot/client/audiosvc/hxaudply.cpp
> /cvsroot/client/audiosvc/hxaudses.cpp
>
> New files added:
> None.
>
> Image Size and Heap Use impact: no major impact
> Module Release testing (STIF)- After playing any clip, while
> exiting helix engine crashes. It is a known issue and is introduced by
> some recent CR submission.
> Test case(s) Added : No.
> Platforms and Profiles Build Verified:
> helix-client-s60-32-mmf-mdf-dsp
> branch: helix_restricted
> platform: symbian-91-armv5
> target(s): symbianMmf_wm
>
> Branch: HEAD
>
> DIFF:
>
> Index: hxaudply.cpp
>
> ===================================================================
> RCS file: /cvsroot/client/audiosvc/hxaudply.cpp,v
> retrieving revision 1.58
> diff -u -b -r1.58 hxaudply.cpp
> --- hxaudply.cpp 20 Sep 2008 06:02:27 -0000 1.58
> +++ hxaudply.cpp 5 Nov 2008 23:06:07 -0000
> @@ -1916,16 +1916,9 @@
>
> // Set the audio format for this Player.
> m_PlayerFmt.uMaxBlockSize = maxBlocksize;
> - // keep min. channel at stereo
> - // this is a workaround for b#205546, the root cause of
> this is that we only
> - // choose the audio format of the 1st audio stream when
> the playback is started
> - // without audio, then audio clip is started at later
> time. For sure stream audio,
> - // the first audio stream is often the lowest quality,
> thus the audio device is
> - // configured to play the lowest quality audio.
> - //
> - // proper fix requires the audio device is setup only
> after all audio streams
> - // assoicated with the same clip have been registered
> - m_PlayerFmt.uChannels = (maxChannels < 2) ? 2
> : maxChannels;
> +
> + m_PlayerFmt.uChannels = maxChannels;
> +
> m_PlayerFmt.uBitsPerSample = maxBitsPerSample;
>
> // If user wants upsampling
> Index: hxaudses.cpp
>
> ===================================================================
> RCS file: /cvsroot/client/audiosvc/hxaudses.cpp,v
> retrieving revision 1.81
> diff -u -b -r1.81 hxaudses.cpp
> --- hxaudses.cpp 18 Oct 2007 22:55:08 -0000 1.81
> +++ hxaudses.cpp 5 Nov 2008 23:06:07 -0000
> @@ -2196,7 +2196,7 @@
> if ((m_bPaused || m_bStoppedDuringPause) &&
> (!m_pLastPausedPlayer || (m_pLastPausedPlayer ==
> pPlayerToExclude)))
> {
> - if (bRewindNeeded)
> + if (bRewindNeeded && (m_dNumBytesWritten != 0))
> {
> RewindSession();
> }
> @@ -2962,8 +2962,8 @@
> STDMETHODIMP CHXAudioSession::SetAudioPushdown(UINT32
> ulMinimumPushdown)
> {
>
> - m_ulTargetPushdown =
> (ulMinimumPushdown - MINIMUM_AUDIO_PUSHDOWN : ulMinimumPushdown;
> + m_ulTargetPushdown =
> (ulMinimumPushdown + TARGET_AUDIO_PUSHDOWN : ulMinimumPushdown;
>
> UpdateMinimumPushdown();
> Index: mdfauddevice.cpp
>
> ===================================================================
> RCS file: /cvsroot/datatype/mdf/audio/dsp/mdfauddevice.cpp,v
> retrieving revision 1.15
> diff -u -b -r1.15 mdfauddevice.cpp
> --- mdfauddevice.cpp 19 Oct 2008 05:17:35 -0000 1.15
> +++ mdfauddevice.cpp 5 Nov 2008 23:06:29 -0000
> @@ -735,13 +735,21 @@
> // IHXAudioDevice::CheckFormat
> // - This method check the capability of audio device
> // for a given audio format
> -// - To be implemented
> //
> HX_RESULT CHXMDFAudioDevice::CheckFormat(const HXAudioFormat*
> pAudioFormat)
> {
> HXLOGL4(HXLOG_MDFA,"mdfdev:ChkFormat <>");
> - HX_RESULT res = HXR_OK;
> + HX_RESULT res = HXR_FAIL;
>
> + if (pAudioFormat)
> + {
> + if (m_pAudioFormat->m_uChannels ==
> pAudioFormat->uChannels &&
> + m_pAudioFormat->m_uBitsPerSample ==
> pAudioFormat->uBitsPerSample &&
> + m_pAudioFormat->m_ulSamplesPerSec ==
> pAudioFormat->ulSamplesPerSec)
> + {
> + res = HXR_OK;
> + }
> + }
> return res;
> }
>
> Index: mdfaudfmt.cpp
>
> ===================================================================
> RCS file: /cvsroot/datatype/mdf/audio/dsp/mdfaudfmt.cpp,v
> retrieving revision 1.9
> diff -u -b -r1.9 mdfaudfmt.cpp
> --- mdfaudfmt.cpp 6 Jul 2007 22:01:13 -0000 1.9
> +++ mdfaudfmt.cpp 5 Nov 2008 23:06:29 -0000
> @@ -211,8 +211,6 @@
> #define SBR_DOWNSAMPLE_CUTOFF_RATE 24000
> #define MAX_SBR_OUT_SAMPLE_RATE 48000
>
> -#define KMMFFourCCCodeEAACP 0x43414520 // ' ' 'E'
> 'A' 'C'
> -
> HXMDFAudioAac::HXMDFAudioAac():
> m_ulObjectType(0)
> ,m_ulFrameLength(0)
> Index: mdfaudfmt.h
>
> ===================================================================
> RCS file: /cvsroot/datatype/mdf/audio/dsp/mdfaudfmt.h,v
> retrieving revision 1.6
> diff -u -b -r1.6 mdfaudfmt.h
> --- mdfaudfmt.h 6 Jul 2007 22:01:13 -0000 1.6
> +++ mdfaudfmt.h 5 Nov 2008 23:06:29 -0000
> @@ -63,6 +63,8 @@
>
> #include "gaconfig.h"
>
> +#define KMMFFourCCCodeEAACP 0x43414520 // ' ' 'E'
> 'A' 'C'
> +
>
> class HXMDFAudioFormat
> {
> Index: mdfdevsound.cpp
>
> ===================================================================
> RCS file: /cvsroot/datatype/mdf/audio/dsp/mdfdevsound.cpp,v
> retrieving revision 1.19
> diff -u -b -r1.19 mdfdevsound.cpp
> --- mdfdevsound.cpp 19 Oct 2008 05:17:53 -0000 1.19
> +++ mdfdevsound.cpp 5 Nov 2008 23:06:30 -0000
> @@ -64,6 +64,7 @@
> #include "mdfdevsound.h"
> #include "mdfdebug.h"
> #include "CHXMMFDevSound.h"
> +#include "mdfaudfmt.h"
>
> inline
> TUint SamplesToMS(TUint count, TUint rate)
> @@ -681,7 +682,8 @@
> if(m_fourCC == KMMFFourCCCodeAMR ||
> m_fourCC == KMMFFourCCCodeAAC ||
> m_fourCC == KMMFFourCCCodeAWB ||
> - m_fourCC == KMMFFourCCCodeAMRW )
> + m_fourCC == KMMFFourCCCodeAMRW ||
> + m_fourCC == KMMFFourCCCodeEAACP)
> {
> CErrorConcealmentIntfc *ErrCI = 0;
> TRAPD(err, (ErrCI =
> CErrorConcealmentIntfc::NewL(*m_pDevSound)));
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.helixcommunity.org/pipermail/datatype-dev/attachments/20081106/e2967d29/attachment-0001.html
From ehyche at real.com Thu Nov 6 11:37:22 2008
From: ehyche at real.com (Eric Hyche)
Date: Thu Nov 6 09:42:24 2008
Subject: [datatype-dev] RE: [Client-dev] CR: Fix for AAC and its extenssion
type (eAAC+ etc) audio clips issue with hardware accelerated
codecs in HEAD branch.
In-Reply-To: <03528B6E301B3B42833693425F0A49F701EADE09@daebe102.NOE.Nokia.com>
References: <03528B6E301B3B42833693425F0A49F701EADE09@daebe102.NOE.Nokia.com>
Message-ID: <00b801c94047$17db6640$479232c0$@com>
Asheesh:
Here are my comments:
- The changes for #5 below (in client/audiosvc/hxaudply.cpp) are
not needed since you have made the changes in #3.
- Why is this change needed?
> - m_ulTargetPushdown = (ulMinimumPushdown - MINIMUM_AUDIO_PUSHDOWN : ulMinimumPushdown;
> + m_ulTargetPushdown = (ulMinimumPushdown + TARGET_AUDIO_PUSHDOWN : ulMinimumPushdown;
- datatype/mdf/audio/dsp/* changes look good.
Eric
=======================================
Eric Hyche (ehyche@real.com)
Principal Engineer
RealNetworks, Inc.
>-----Original Message-----
>From: client-dev-bounces@helixcommunity.org [mailto:client-dev-bounces@helixcommunity.org] On Behalf
>Of ext-asheesh.srivastava@nokia.com
>Sent: Thursday, November 06, 2008 1:51 PM
>To: client-dev@helixcommunity.org; datatype-dev@helixcommunity.org
>Subject: [Client-dev] CR: Fix for AAC and its extenssion type (eAAC+ etc) audio clips issue with
>hardware accelerated codecs in HEAD branch.
>
>
>
> "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: ext-asheesh.srivastava@nokia.com
>
> Reviewed by:
>
> Date: 11/06/2008
>
> Project: SymbianMmf_wm
>
> ErrorId: N/A
>
> Synopsis: AAC and its extenssion type (eAAC+ etc) audio clips were not playing for local
>playback/streaming when used with DSP decoder in HEAD branch.
>
> Overview:
> Because of the reasons listed below, AAC and its extenssion type audio clips were not
>playing when used with DSP decoder in HEAD branch
>
> 1. CR - Enable eAAC+ error concealmeant was not propogated to HEAD. It activates error
>concealment for eAAC+ clips when used with hardware decoders.
>
> 2. During CHXAudioSession::Resume(CHXAudioPlayer* pPlayerToExclude, HXBOOL bRewindNeeded)
>call , bRewindNeeded gets enabled and that leads call to
>
> RewindSession, which empties the audio device's buffer list and that inturn adds filler
>(silence) frames to the audio device and audio play-back gets stuck.
>
> Resume () was calling RewindSession() even if the audio session has not pushed any data
>into the audio device.
> A check is made based on m_dNumBytesWritten to skip RewindSession() call if audio session
>has not pushed any data to it.
>
> 3. CHXMDFAudioDevice::CheckFormat(const HXAudioFormat* pAudioFormat) function was not
>implemented.
> This implementation now checks if the asked audio format is same as the audio device's
>format when the device was created by the decoder.
>
> 4. Target audio pushdown was calculated based on MINIMUM_AUDIO_PUSHDOWN in
>CHXAudioSession::SetAudioPushdown() function.
>
> It should be calculated based on TARGET_AUDIO_PUSHDOWN.
>
> 5. Workaround in CHXAudioPlayer::Setup( ULONG32 ulGranularity) for keeping min. channel at
>stereo is no longer required.
>
> RA renderer used to only call IHXAudioStream::Init() on the first substream when a
>SureStream(multi-rate) stream was played.
>
> Then, as it received packets for other substreams, then it created and Init'd those
>IHXAudioStreams.
> However, the current RA renderer creates and Init's an IHXAudioStream for each substream.
>So it would appear that this workaround is no longer needed.
>
> Files Modified:
> /cvsroot/datatype/mdf/audio/dsp/mdfauddevice.cpp
> /cvsroot/datatype/mdf/audio/dsp/mdfaudfmt.cpp
> /cvsroot/datatype/mdf/audio/dsp/mdfaudfmt.h
> /cvsroot/datatype/mdf/audio/dsp/mdfdevsound.cpp
> /cvsroot/client/audiosvc/hxaudply.cpp
> /cvsroot/client/audiosvc/hxaudses.cpp
>
> New files added:
> None.
>
> Image Size and Heap Use impact: no major impact
> Module Release testing (STIF)- After playing any clip, while exiting helix engine
>crashes. It is a known issue and is introduced by some recent CR submission.
>
> Test case(s) Added : No.
> Platforms and Profiles Build Verified: helix-client-s60-32-mmf-mdf-dsp
> branch: helix_restricted
> platform: symbian-91-armv5
> target(s): symbianMmf_wm
>
> Branch: HEAD
>
> DIFF:
>
> Index: hxaudply.cpp
> ===================================================================
> RCS file: /cvsroot/client/audiosvc/hxaudply.cpp,v
> retrieving revision 1.58
> diff -u -b -r1.58 hxaudply.cpp
> --- hxaudply.cpp 20 Sep 2008 06:02:27 -0000 1.58
> +++ hxaudply.cpp 5 Nov 2008 23:06:07 -0000
> @@ -1916,16 +1916,9 @@
>
> // Set the audio format for this Player.
> m_PlayerFmt.uMaxBlockSize = maxBlocksize;
> - // keep min. channel at stereo
> - // this is a workaround for b#205546, the root cause of this is that we only
> - // choose the audio format of the 1st audio stream when the playback is started
> - // without audio, then audio clip is started at later time. For sure stream
>audio,
> - // the first audio stream is often the lowest quality, thus the audio device is
> - // configured to play the lowest quality audio.
> - //
> - // proper fix requires the audio device is setup only after all audio streams
> - // assoicated with the same clip have been registered
> - m_PlayerFmt.uChannels = (maxChannels < 2) ? 2 : maxChannels;
> +
> + m_PlayerFmt.uChannels = maxChannels;
> +
> m_PlayerFmt.uBitsPerSample = maxBitsPerSample;
>
> // If user wants upsampling
> Index: hxaudses.cpp
> ===================================================================
> RCS file: /cvsroot/client/audiosvc/hxaudses.cpp,v
> retrieving revision 1.81
> diff -u -b -r1.81 hxaudses.cpp
> --- hxaudses.cpp 18 Oct 2007 22:55:08 -0000 1.81
> +++ hxaudses.cpp 5 Nov 2008 23:06:07 -0000
> @@ -2196,7 +2196,7 @@
> if ((m_bPaused || m_bStoppedDuringPause) &&
> (!m_pLastPausedPlayer || (m_pLastPausedPlayer == pPlayerToExclude)))
> {
> - if (bRewindNeeded)
> + if (bRewindNeeded && (m_dNumBytesWritten != 0))
> {
> RewindSession();
> }
> @@ -2962,8 +2962,8 @@
> STDMETHODIMP CHXAudioSession::SetAudioPushdown(UINT32 ulMinimumPushdown)
> {
>
> - m_ulTargetPushdown = (ulMinimumPushdown - MINIMUM_AUDIO_PUSHDOWN : ulMinimumPushdown;
> + m_ulTargetPushdown = (ulMinimumPushdown + TARGET_AUDIO_PUSHDOWN : ulMinimumPushdown;
>
> UpdateMinimumPushdown();
> Index: mdfauddevice.cpp
> ===================================================================
> RCS file: /cvsroot/datatype/mdf/audio/dsp/mdfauddevice.cpp,v
> retrieving revision 1.15
> diff -u -b -r1.15 mdfauddevice.cpp
> --- mdfauddevice.cpp 19 Oct 2008 05:17:35 -0000 1.15
> +++ mdfauddevice.cpp 5 Nov 2008 23:06:29 -0000
> @@ -735,13 +735,21 @@
> // IHXAudioDevice::CheckFormat
> // - This method check the capability of audio device
> // for a given audio format
> -// - To be implemented
> //
> HX_RESULT CHXMDFAudioDevice::CheckFormat(const HXAudioFormat* pAudioFormat)
> {
> HXLOGL4(HXLOG_MDFA,"mdfdev:ChkFormat <>");
> - HX_RESULT res = HXR_OK;
> + HX_RESULT res = HXR_FAIL;
>
> + if (pAudioFormat)
> + {
> + if (m_pAudioFormat->m_uChannels == pAudioFormat->uChannels &&
> + m_pAudioFormat->m_uBitsPerSample == pAudioFormat->uBitsPerSample
>&&
> + m_pAudioFormat->m_ulSamplesPerSec == pAudioFormat-
>>ulSamplesPerSec)
> + {
> + res = HXR_OK;
> + }
> + }
> return res;
> }
>
> Index: mdfaudfmt.cpp
> ===================================================================
> RCS file: /cvsroot/datatype/mdf/audio/dsp/mdfaudfmt.cpp,v
> retrieving revision 1.9
> diff -u -b -r1.9 mdfaudfmt.cpp
> --- mdfaudfmt.cpp 6 Jul 2007 22:01:13 -0000 1.9
> +++ mdfaudfmt.cpp 5 Nov 2008 23:06:29 -0000
> @@ -211,8 +211,6 @@
> #define SBR_DOWNSAMPLE_CUTOFF_RATE 24000
> #define MAX_SBR_OUT_SAMPLE_RATE 48000
>
> -#define KMMFFourCCCodeEAACP 0x43414520 // ' ' 'E' 'A' 'C'
> -
> HXMDFAudioAac::HXMDFAudioAac():
> m_ulObjectType(0)
> ,m_ulFrameLength(0)
> Index: mdfaudfmt.h
> ===================================================================
> RCS file: /cvsroot/datatype/mdf/audio/dsp/mdfaudfmt.h,v
> retrieving revision 1.6
> diff -u -b -r1.6 mdfaudfmt.h
> --- mdfaudfmt.h 6 Jul 2007 22:01:13 -0000 1.6
> +++ mdfaudfmt.h 5 Nov 2008 23:06:29 -0000
> @@ -63,6 +63,8 @@
>
> #include "gaconfig.h"
>
> +#define KMMFFourCCCodeEAACP 0x43414520 // ' ' 'E' 'A' 'C'
> +
>
> class HXMDFAudioFormat
> {
> Index: mdfdevsound.cpp
> ===================================================================
> RCS file: /cvsroot/datatype/mdf/audio/dsp/mdfdevsound.cpp,v
> retrieving revision 1.19
> diff -u -b -r1.19 mdfdevsound.cpp
> --- mdfdevsound.cpp 19 Oct 2008 05:17:53 -0000 1.19
> +++ mdfdevsound.cpp 5 Nov 2008 23:06:30 -0000
> @@ -64,6 +64,7 @@
> #include "mdfdevsound.h"
> #include "mdfdebug.h"
> #include "CHXMMFDevSound.h"
> +#include "mdfaudfmt.h"
>
> inline
> TUint SamplesToMS(TUint count, TUint rate)
> @@ -681,7 +682,8 @@
> if(m_fourCC == KMMFFourCCCodeAMR ||
> m_fourCC == KMMFFourCCCodeAAC ||
> m_fourCC == KMMFFourCCCodeAWB ||
> - m_fourCC == KMMFFourCCCodeAMRW )
> + m_fourCC == KMMFFourCCCodeAMRW ||
> + m_fourCC == KMMFFourCCCodeEAACP)
> {
> CErrorConcealmentIntfc *ErrCI = 0;
> TRAPD(err, (ErrCI = CErrorConcealmentIntfc::NewL(*m_pDevSound)));
>
From ext-asheesh.srivastava at nokia.com Thu Nov 6 13:21:49 2008
From: ext-asheesh.srivastava at nokia.com (ext-asheesh.srivastava@nokia.com)
Date: Thu Nov 6 11:27:01 2008
Subject: [datatype-dev] RE: [Client-dev] CR: Fix for AAC and its extenssion
type (eAAC+ etc) audio clips issue with hardware accelerated
codecs in HEAD branch.
In-Reply-To: <00b801c94047$17db6640$479232c0$@com>
References: <03528B6E301B3B42833693425F0A49F701EADE09@daebe102.NOE.Nokia.com>
<00b801c94047$17db6640$479232c0$@com>
Message-ID: <03528B6E301B3B42833693425F0A49F701EADF11@daebe102.NOE.Nokia.com>
Hi Eric,
Thanks for your input. Please find my observation.
On emulator if I play any media clip which has AAC audio in it, only 1st
video frame appears and playback freezes. To fix this emulator problem I
made m_ulTargetPushdown changes.
Reason for calculating m_ulTargetPushdown based on
TARGET_AUDIO_PUSHDOWN.
1. MINIMUM_AUDIO_PUSHDOWN and TARGET_AUDIO_PUSHDOWN macros are defined
as
# define MINIMUM_AUDIO_PUSHDOWN 200
# define TARGET_AUDIO_PUSHDOWN 1000
During CHXAudioSession::SetAudioPushdown call ulMinimumPushdown has
value of 120 which is less than MINIMUM_AUDIO_PUSHDOWN, so
m_ulTargetPushdown becomes 200. Then It calls
CHXAudioSession::UpdateMinimumPushdown() where
m_ulTargetBlocksTobeQueued, m_ulMinBlocksTobeQueued etc are calculated.
Helix log has these audio pushdown values for them -
Granularity: 50
Blocks at the minimum: 4
Blocks at start: 4
Blocks to grow to: 4
MS of data at minimum: 200
MS of data at start: 200
MS of data to grow to: 200
2. In cayenne, above calculations are based on m_ulMinimumPushdown which
relies on MINIMUM_AUDIO_PUSHDOWN. Comparing above values with cayenne,
Audio pushdown values for cayenne -
Granularity: 50
Blocks at start: 4
Blocks to grow to: 20
MS of data at start: 200
MS of data to grow to: 1000
'Blocks to grow to' and 'MS of data to grow to' have different values
in cayenne and HEAD.
3. TARGET_AUDIO_PUSHDOWN and m_ulTargetPushdown are introduced recently
in HEAD branch and I think m_ulTargetPushdown needs to be calculated
based on TARGET_AUDIO_PUSHDOWN not MINIMUM_AUDIO_PUSHDOWN.
4. In HEAD, When I change MINIMUM_AUDIO_PUSHDOWN to
TARGET_AUDIO_PUSHDOWN in CHXAudioSession::SetAudioPushdown, it fixes the
emulator problem and works fine with DSP solution also. Following audio
pushdown values are found in log file -
Audio pushdown values Report:
Granularity: 50
Blocks at the minimum: 4
Blocks at start: 4
Blocks to grow to: 20
MS of data at minimum: 200
MS of data at start: 200
MS of data to grow to: 1000
Above values look similar to cayenne's value.
Thanks,
- Asheesh
>-----Original Message-----
>From: ext Eric Hyche [mailto:ehyche@real.com]
>Sent: Thursday, November 06, 2008 1:37 PM
>To: Srivastava Asheesh (EXT-Infovision-MSW/Dallas);
>client-dev@helixcommunity.org; datatype-dev@helixcommunity.org
>Subject: RE: [Client-dev] CR: Fix for AAC and its extenssion
>type (eAAC+ etc) audio clips issue with hardware accelerated
>codecs in HEAD branch.
>
>Asheesh:
>
>Here are my comments:
>
>- The changes for #5 below (in client/audiosvc/hxaudply.cpp) are
> not needed since you have made the changes in #3.
>- Why is this change needed?
>
>> - m_ulTargetPushdown =
>(ulMinimumPushdown> - MINIMUM_AUDIO_PUSHDOWN : ulMinimumPushdown;
>> + m_ulTargetPushdown =
>(ulMinimumPushdown> + TARGET_AUDIO_PUSHDOWN : ulMinimumPushdown;
>
>- datatype/mdf/audio/dsp/* changes look good.
>
>Eric
>
>
>=======================================
>Eric Hyche (ehyche@real.com)
>Principal Engineer
>RealNetworks, Inc.
>
>
>>-----Original Message-----
>>From: client-dev-bounces@helixcommunity.org
>>[mailto:client-dev-bounces@helixcommunity.org] On Behalf Of
>>ext-asheesh.srivastava@nokia.com
>>Sent: Thursday, November 06, 2008 1:51 PM
>>To: client-dev@helixcommunity.org; datatype-dev@helixcommunity.org
>>Subject: [Client-dev] CR: Fix for AAC and its extenssion type (eAAC+
>>etc) audio clips issue with hardware accelerated codecs in
>HEAD branch.
>>
>>
>>
>> "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: ext-asheesh.srivastava@nokia.com
>>
>> Reviewed by:
>>
>> Date: 11/06/2008
>>
>> Project: SymbianMmf_wm
>>
>> ErrorId: N/A
>>
>> Synopsis: AAC and its extenssion type (eAAC+
>etc) audio clips were
>>not playing for local playback/streaming when used with DSP
>decoder in HEAD branch.
>>
>> Overview:
>> Because of the reasons listed below, AAC and
>its extenssion type
>>audio clips were not playing when used with DSP decoder in HEAD branch
>>
>> 1. CR - Enable eAAC+ error concealmeant was not
>propogated to HEAD.
>>It activates error concealment for eAAC+ clips when used with
>hardware decoders.
>>
>> 2. During
>CHXAudioSession::Resume(CHXAudioPlayer* pPlayerToExclude,
>>HXBOOL bRewindNeeded) call , bRewindNeeded gets enabled and
>that leads
>>call to
>>
>> RewindSession, which empties the audio device's
>buffer list and that
>>inturn adds filler
>>(silence) frames to the audio device and audio play-back gets stuck.
>>
>> Resume () was calling RewindSession() even if
>the audio session has
>>not pushed any data into the audio device.
>> A check is made based on m_dNumBytesWritten to
>skip RewindSession()
>>call if audio session has not pushed any data to it.
>>
>> 3. CHXMDFAudioDevice::CheckFormat(const
>HXAudioFormat* pAudioFormat)
>>function was not implemented.
>> This implementation now checks if the asked
>audio format is same as
>>the audio device's format when the device was created by the decoder.
>>
>> 4. Target audio pushdown was calculated based on
>>MINIMUM_AUDIO_PUSHDOWN in
>>CHXAudioSession::SetAudioPushdown() function.
>>
>> It should be calculated based on TARGET_AUDIO_PUSHDOWN.
>>
>> 5. Workaround in CHXAudioPlayer::Setup( ULONG32
>ulGranularity) for
>>keeping min. channel at stereo is no longer required.
>>
>> RA renderer used to only call
>IHXAudioStream::Init() on the first
>>substream when a
>>SureStream(multi-rate) stream was played.
>>
>> Then, as it received packets for other
>substreams, then it created
>>and Init'd those IHXAudioStreams.
>> However, the current RA renderer creates and
>Init's an IHXAudioStream for each substream.
>>So it would appear that this workaround is no longer needed.
>>
>> Files Modified:
>> /cvsroot/datatype/mdf/audio/dsp/mdfauddevice.cpp
>> /cvsroot/datatype/mdf/audio/dsp/mdfaudfmt.cpp
>> /cvsroot/datatype/mdf/audio/dsp/mdfaudfmt.h
>> /cvsroot/datatype/mdf/audio/dsp/mdfdevsound.cpp
>> /cvsroot/client/audiosvc/hxaudply.cpp
>> /cvsroot/client/audiosvc/hxaudses.cpp
>>
>> New files added:
>> None.
>>
>> Image Size and Heap Use impact: no major impact
>> Module Release testing (STIF)- After playing
>any clip, while exiting
>>helix engine crashes. It is a known issue and is introduced
>by some recent CR submission.
>>
>> Test case(s) Added : No.
>> Platforms and Profiles Build Verified:
>helix-client-s60-32-mmf-mdf-dsp
>> branch: helix_restricted
>> platform: symbian-91-armv5
>> target(s): symbianMmf_wm
>>
>> Branch: HEAD
>>
>> DIFF:
>>
>> Index: hxaudply.cpp
>>
>===================================================================
>> RCS file: /cvsroot/client/audiosvc/hxaudply.cpp,v
>> retrieving revision 1.58
>> diff -u -b -r1.58 hxaudply.cpp
>> --- hxaudply.cpp 20 Sep 2008 06:02:27
>-0000 1.58
>> +++ hxaudply.cpp 5 Nov 2008 23:06:07 -0000
>> @@ -1916,16 +1916,9 @@
>>
>> // Set the audio format for this Player.
>> m_PlayerFmt.uMaxBlockSize = maxBlocksize;
>> - // keep min. channel at stereo
>> - // this is a workaround for b#205546,
>the root cause of this is that we only
>> - // choose the audio format of the 1st
>audio stream when the playback is started
>> - // without audio, then audio clip is
>started at later time. For sure stream
>>audio,
>> - // the first audio stream is often the
>lowest quality, thus the audio device is
>> - // configured to play the lowest quality audio.
>> - //
>> - // proper fix requires the audio
>device is setup only after all audio streams
>> - // assoicated with the same clip have
>been registered
>> - m_PlayerFmt.uChannels =
>(maxChannels < 2) ? 2 : maxChannels;
>> +
>> + m_PlayerFmt.uChannels = maxChannels;
>> +
>> m_PlayerFmt.uBitsPerSample =
>maxBitsPerSample;
>>
>> // If user wants upsampling
>> Index: hxaudses.cpp
>>
>===================================================================
>> RCS file: /cvsroot/client/audiosvc/hxaudses.cpp,v
>> retrieving revision 1.81
>> diff -u -b -r1.81 hxaudses.cpp
>> --- hxaudses.cpp 18 Oct 2007 22:55:08
>-0000 1.81
>> +++ hxaudses.cpp 5 Nov 2008 23:06:07 -0000
>> @@ -2196,7 +2196,7 @@
>> if ((m_bPaused || m_bStoppedDuringPause) &&
>> (!m_pLastPausedPlayer ||
>(m_pLastPausedPlayer == pPlayerToExclude)))
>> {
>> - if (bRewindNeeded)
>> + if (bRewindNeeded && (m_dNumBytesWritten != 0))
>> {
>> RewindSession();
>> }
>> @@ -2962,8 +2962,8 @@
>> STDMETHODIMP
>CHXAudioSession::SetAudioPushdown(UINT32 ulMinimumPushdown)
>> {
>>
>> - m_ulTargetPushdown =
>(ulMinimumPushdown> - MINIMUM_AUDIO_PUSHDOWN : ulMinimumPushdown;
>> + m_ulTargetPushdown =
>(ulMinimumPushdown> + TARGET_AUDIO_PUSHDOWN : ulMinimumPushdown;
>>
>> UpdateMinimumPushdown();
>> Index: mdfauddevice.cpp
>>
>===================================================================
>> RCS file:
>/cvsroot/datatype/mdf/audio/dsp/mdfauddevice.cpp,v
>> retrieving revision 1.15
>> diff -u -b -r1.15 mdfauddevice.cpp
>> --- mdfauddevice.cpp 19 Oct 2008 05:17:35
>-0000 1.15
>> +++ mdfauddevice.cpp 5 Nov 2008 23:06:29 -0000
>> @@ -735,13 +735,21 @@
>> // IHXAudioDevice::CheckFormat
>> // - This method check the capability
>of audio device
>> // for a given audio format
>> -// - To be implemented
>> //
>> HX_RESULT CHXMDFAudioDevice::CheckFormat(const
>HXAudioFormat* pAudioFormat)
>> {
>> HXLOGL4(HXLOG_MDFA,"mdfdev:ChkFormat <>");
>> - HX_RESULT res = HXR_OK;
>> + HX_RESULT res = HXR_FAIL;
>>
>> + if (pAudioFormat)
>> + {
>> + if (m_pAudioFormat->m_uChannels ==
>pAudioFormat->uChannels &&
>> +
>m_pAudioFormat->m_uBitsPerSample == pAudioFormat->uBitsPerSample
>>&&
>> +
>m_pAudioFormat->m_ulSamplesPerSec == pAudioFormat-
>>>ulSamplesPerSec)
>> + {
>> + res = HXR_OK;
>> + }
>> + }
>> return res;
>> }
>>
>> Index: mdfaudfmt.cpp
>>
>===================================================================
>> RCS file:
>/cvsroot/datatype/mdf/audio/dsp/mdfaudfmt.cpp,v
>> retrieving revision 1.9
>> diff -u -b -r1.9 mdfaudfmt.cpp
>> --- mdfaudfmt.cpp 6 Jul 2007 22:01:13
>-0000 1.9
>> +++ mdfaudfmt.cpp 5 Nov 2008 23:06:29 -0000
>> @@ -211,8 +211,6 @@
>> #define SBR_DOWNSAMPLE_CUTOFF_RATE 24000
>> #define MAX_SBR_OUT_SAMPLE_RATE 48000
>>
>> -#define KMMFFourCCCodeEAACP
>0x43414520 // ' ' 'E' 'A' 'C'
>> -
>> HXMDFAudioAac::HXMDFAudioAac():
>> m_ulObjectType(0)
>> ,m_ulFrameLength(0)
>> Index: mdfaudfmt.h
>>
>===================================================================
>> RCS file: /cvsroot/datatype/mdf/audio/dsp/mdfaudfmt.h,v
>> retrieving revision 1.6
>> diff -u -b -r1.6 mdfaudfmt.h
>> --- mdfaudfmt.h 6 Jul 2007 22:01:13 -0000 1.6
>> +++ mdfaudfmt.h 5 Nov 2008 23:06:29 -0000
>> @@ -63,6 +63,8 @@
>>
>> #include "gaconfig.h"
>>
>> +#define KMMFFourCCCodeEAACP
>0x43414520 // ' ' 'E' 'A' 'C'
>> +
>>
>> class HXMDFAudioFormat
>> {
>> Index: mdfdevsound.cpp
>>
>===================================================================
>> RCS file:
>/cvsroot/datatype/mdf/audio/dsp/mdfdevsound.cpp,v
>> retrieving revision 1.19
>> diff -u -b -r1.19 mdfdevsound.cpp
>> --- mdfdevsound.cpp 19 Oct 2008 05:17:53
>-0000 1.19
>> +++ mdfdevsound.cpp 5 Nov 2008 23:06:30 -0000
>> @@ -64,6 +64,7 @@
>> #include "mdfdevsound.h"
>> #include "mdfdebug.h"
>> #include "CHXMMFDevSound.h"
>> +#include "mdfaudfmt.h"
>>
>> inline
>> TUint SamplesToMS(TUint count, TUint rate)
>> @@ -681,7 +682,8 @@
>> if(m_fourCC == KMMFFourCCCodeAMR ||
>> m_fourCC == KMMFFourCCCodeAAC ||
>> m_fourCC == KMMFFourCCCodeAWB ||
>> - m_fourCC == KMMFFourCCCodeAMRW )
>> + m_fourCC == KMMFFourCCCodeAMRW ||
>> + m_fourCC == KMMFFourCCCodeEAACP)
>> {
>> CErrorConcealmentIntfc *ErrCI = 0;
>> TRAPD(err, (ErrCI =
>>CErrorConcealmentIntfc::NewL(*m_pDevSound)));
>>
>
>
>
From ext-gabriela.valverde at nokia.com Thu Nov 6 14:02:31 2008
From: ext-gabriela.valverde at nokia.com (ext-gabriela.valverde@nokia.com)
Date: Thu Nov 6 12:07:34 2008
Subject: [datatype-dev] CR: ECTN-7KVQG3 There is no video pictures displayed
when replaying same local clip and restreaming the same clip
Message-ID: <955B47D82B554643A49BD712D2EE17AD1A3BB2@esebe111.NOE.Nokia.com>
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: ext-gabriela.valverde@nokia.com
Reviewed by:
Date: 06-Nov-2008
Project: symbianMmf_rel
TSW-Id: ECTN-7KVQG3
SC Id: ou1cimx1#75606
Synopsis: No video is displayed when attempting repeat plaback of an
audio-video file (local or streaming)
Overview:
MDF video adapter and DevVideo client/server session are not being
cleaned up at the end of playback, so any repeat playback attempts
result in a -14 error (KErrInUse) when trying to obtain the posting
surface.
MDF video adapter is not destroyed at the end of playback because its
reference count is not zero; this in turn is due to the property watch
object it creates to observe the "MMF.SecureOutput" property, which has
a longer lifetime than the video adapter.
The outstanding reference to the video adapter is released in
HXMMFCtrlImpl::ReleaseResources() when the "MMF.SecureOutput" property
is deleted, but this does not happen for the repeat playback case.
Solution:
Delete the property watch object in CMdfVideoAdapter::VideoEnd(), this
way the reference to video adapter is released at the end of playback,
allowing the adapter to be destroyed.
Files Modified:
datatype/mdf/video/renderer/mdfvideoadapter.cpp
Image Size and Heap Use impact: none
Module Release testing (STIF): Yes.
Test case(s) Added: none
Memory leak check performed: Yes, no new leaks introduced.
Platforms and Profiles Build Verified:
armv5 / helix-client-s60-50-mmf-mdf-dsp
Platforms and Profiles Functionality verified:
armv5 / helix-client-s60-50-mmf-mdf-dsp
Branch:
HEAD, hxclient_2_1_0_cayennes
Index: mdfvideoadapter.cpp
===================================================================
RCS file: /cvsroot/datatype/mdf/video/renderer/mdfvideoadapter.cpp,v
retrieving revision 1.3.2.92
diff -u -w -r1.3.2.92 mdfvideoadapter.cpp
--- mdfvideoadapter.cpp 28 Oct 2008 15:16:58 -0000 1.3.2.92
+++ mdfvideoadapter.cpp 6 Nov 2008 20:48:10 -0000
@@ -647,6 +647,11 @@
m_bStreamEnd = TRUE;
+ if(m_pPropWatch)
+ {
+ m_pPropWatch->ClearWatchByName("MMF.SecureOutput");
+ HX_RELEASE(m_pPropWatch);
+ }
MDFVIDEOLOG_LEAVEFN2( "VideoEnd" );
return HXR_OK;
}
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.helixcommunity.org/pipermail/datatype-dev/attachments/20081107/d74c2a77/attachment-0001.html
From ehyche at real.com Thu Nov 6 14:28:58 2008
From: ehyche at real.com (Eric Hyche)
Date: Thu Nov 6 12:33:57 2008
Subject: [datatype-dev] CR:-To Support the Fix bounds checking in
Bitstream class
In-Reply-To: <50590.220.226.88.106.1225984966.squirrel@mailone.real.com>
References: <50590.220.226.88.106.1225984966.squirrel@mailone.real.com>
Message-ID: <00dd01c9405f$10b92650$322b72f0$@com>
Alok,
Here are my comments:
1) datatype/common/util/pub/bitstream.h - looks good
2) datatype/common/util/bitstream.cpp - looks good
3) datatype/common/util/pub/bitpack.h - looks good
4) datatype/common/util/bitpack.cpp
+ bs.SetBuffer(pBuf, m_ulBufSize);
m_ulBufSize is not the size of pBuf - it's the
size of the output buffer which has been set
into BitPacker. ulBitCount is the size of pBuf
in bits. So the buffer size passed into the Bitstream
class should be ulBitCount divided by 8. However,
if (ulBitCount % 8) != 0, then you'll need to
round up to nearest byte.
+ if ( ulLeft < (ulStartOffset + bitCount) )
Since you are about to do a bs.GetBits(ulStartOffset),
it seems like this should be:
+ if ( ulLeft < ulStartOffset)
instead.
Rest of bitpack.cpp changes look good.
5) datatype/common/util/test/tbitpack.cpp - looks good
6) datatype/h263/payload/h263pyld.cpp
+ ulLeft = bs.BitsLeft();
+ if(ulLeft < 3)
+ {
+ return res;
+ }
if (bs.GetBits(1)) // CPM
bs.GetBits(2); // PSBI
This is incorrect. We are only getting
three bits if the first bit is non-zero. So you'll
need to break this into two different BitsLeft checks here.
+ if(ulLeft < 32)
+ {
+ return res;
+ }
if (bs.GetBits(22) == 0x20) // Check PSC
{
This is incorrect. At this point you only
know you are going to get 22 bits not 32. Only
AFTER you have checked == 0x20 do you know whether
or not you are going to fetch additional bits. You'll
need to check for 22 and then inside the
" if (bs.GetBits(22) == 0x20)" check again for 10 bits.
7) datatype/h263/payload/rfc2190hlpr.cpp - looks good
8) datatype/h263/payload/rfc2429hlpr.cpp - looks good
9) datatype/mp4/payload/Umakefil - looks good
10) datatype/mp4/payload/amr-depack.cpp
+ if(ulLeft < 4)
+ {
+ bFailed =TRUE;
+ }
// Skip the CMR since we don't care about it
Seems that this should be inside the else clause
of if (m_bOctetAlign) instead of before the if (m_bOctetAlign).
Also, if you are just going to set bFailed = TRUE, then
you should add checks for !bFailed later on down in the
function so that if a BitsLeft() check fails, then no
further calls to the Bitstream class are made, and the
function drops all the way down to the "return !bFailed;".
+ if(!GetTOCInfo(bs, tocInfo))
+ {
+ bFailed =TRUE;
+ HXLog1("Failed GetTOCInfo()");
+ }
If we enter the if clause here and set bFailed to TRUE,
then we need to check right below this to make sure we don't
do anything further if bFailed = TRUE
Also, this should use the HXLOGL1() macro instead
of calling the HXLog1 function directly.
+ if(!SkipCRCInfo(bs, tocInfo))
+ {
+ bFailed =TRUE;
+ HXLog1("Failed SkipCRCInfo()");
+ }
Same two comments as immediately above.
- bs.GetBits(ulFrameBits, pCurrent);
+ UINT32 ulLeft = bs.BitsLeft();
+ if ( ulLeft >= ulFrameBits )
+ {
+ bs.GetBits(ulFrameBits, pCurrent);
+ }
I don't see anything here to force failure if ulLeft >= ulFrameBits
is not true.
Rest of amr-depack.cpp looks good.
11) datatype/mp4/payload/mp4-latm-depack.cpp
- if (bs.GetBits(1) == 0)
+ UINT32 ulLeft = bs.BitsLeft();
+ if(ulLeft < 1)
{
+ failed = TRUE;
+ }
If ulLeft < 1 is true and you have to set failed to TRUE, then
you need to add !failed checks further down so that nothing
further happens.
+ if ( ulLeft < (m_pSlotLengths[streamID] << 3) )
+ {
+ failed = TRUE;
+ return !failed;
+ }
Why not just "return FALSE" here?
12) datatype/mp4/payload/mp4a-mux-cfg.cpp
- ULONG32 AudioObjectType = bs.GetBits(5);
+ HXBOOL failed = FALSE;
+ UINT32 ulLeft = bs.BitsLeft();
+
+ if ( ulLeft < 5 )
+ {
+ failed = TRUE;
+ }
+ AudioObjectType = bs.GetBits(5);
It looks like here if the ulLeft < 5 check fails,
then we still go right ahead and fetch the bits anyway.
We need an if (!failed) check there.
+ HXLog1("Failed GetAudioObjectType()");
Use HXLOGL1 macro instead.
+ if ( ulLeft < 4 )
+ {
+ failed = TRUE;
+ }
We either need to just "return FALSE" here or
we need checks further down to make sure we don't
do anything further if failed == TRUE.
+ HXLog1("Failed GetAudioObjectType()");
Use HXLOGL1 macro.
ULONG32 ulBitsLeft = bs.GetBufSize()*8 - m_ulConfigBits - nBits;
m_ulBaseConfigEnd = m_ulConfigBits;
+ ulLeft = bs.BitsLeft();
This does not look correct. The existing code is computing
bits left based on buffer size, so we should not change that.
We should move the BitsLeft() call right before the if(ulLeft < 11).
+ HXLog1("Failed GetAudioObjectType()");
Use HXLOGL1 macro.
+ ulLeft = bs.BitsLeft();
+ if ( ulLeft >= 1 )
+ {
+ bSBR = bs.GetBits(1);
+ m_ulConfigBits += 1;
+ }
+ else
+ {
+ failed = TRUE;
+ }
+ ulLeft = bs.BitsLeft();
Again, we need to make sure we don't do anything else
if we have to set failed to TRUE.
+ if(ulLeft < 24)
+ {
+ failed = TRUE;
+ }
// ESC, read sr from bitstream
bs.GetBits(24);
We are setting failed to TRUE, but going right
ahead and fetching the bits anyway.
//Read FrameLengthFlag
+ UINT32 ulLeft = bs.BitsLeft();
+ if ( ulLeft < 2 )
+ {
+ failed =TRUE;
+ }
bs.GetBits(1);
Same thing. Why check if you are not going
to take any action based on the check?
+ ulLeft = bs.BitsLeft();
+ if(ulLeft < 14)
+ {
+ failed = TRUE;
+ }
bs.GetBits(14);
m_ulConfigBits += 15;
Same thing.
+ if(ulLeft < 3)
+ {
+ failed = TRUE;
+ }
// Read numOfSubFrame, layer_length
bs.GetBits(16);
Huh? You are checking for 3 bits and then
reading 16? Cut and paste error?
I'm going to stop reviewing this now, as there are way too
many mistakes in this CR submission to continue. I'm making
the same comments over and over.
This parsing code is VERY sensitive code, and you MUST
pay closer attention to the details of these routines. A bug
introduced by these changes would be very difficult
to find.
Please re-work these changes including all the comments
I've made so far. Also, then please go over the
remaining code I had not gotten to yet to make sure
the mistakes we encountered above (cut-n-paste errors,
not taking action based on BitsLeft() checks, etc.)
are eliminated from the rest of the CR.
Then please re-submit the CR.
Thanks,
Eric
=======================================
Eric Hyche (ehyche@real.com)
Principal Engineer
RealNetworks, Inc.
>-----Original Message-----
>From: datatype-dev-bounces@helixcommunity.org [mailto:datatype-dev-bounces@helixcommunity.org] On
>Behalf Of alokj@real.com
>Sent: Thursday, November 06, 2008 10:23 AM
>To: datatype-dev@helixcommunity.org
>Cc: alokj@real.com
>Subject: [datatype-dev] CR:-To Support the Fix bounds checking in Bitstream class
>
>Synopsis:
>To Support the Fix bounds checking in Bitstream class.
>
>Overview:
>Add the method BitsLeft() inside Bitstream class for Fix bounds checking and modified all the instance
>where GetBits() or PeekBits() is used as a method of Bitstream class.
>
>
>Files Modified:
>/datatype/common/util/bitpack.cpp
>/datatype/common/util/bitstream.cpp
>/datatype/common/util/pub/bitstream.h
>/datatype/common/util/test/tbitpack.cpp
>/datatype/aac/fileformat/ADIFfile.cpp
>/datatype/aac/fileformat/aacff.cpp
>/datatype/aac/fileformat/aacfiletypes.h
>/datatype/h263/payload/h263pyld.cpp
>/datatype/mp4/payload/amr-depack.cpp
>/datatype/mp4/payload/mp4-latm-depack.cpp
>/datatype/mp4/payload/mp4a-mux-cfg.cpp
>
>
>Files Added:
>None
>
>Image Size and Heap Use impact (Client -Only):
>None.
>
>Platforms and Profiles Affected:
>None
>
>Distribution Libraries Affected:
>None.
>
>Distribution library impact and planned action:
>None.
>
>Platforms and Profiles Build Verified:
>Profile: helix-client-all-defines
>
>BIF branch: helix.bif
>Target: splay
>
>Branch: HEAD
>
>Thanks
>Alok Jain
>
>
>
>
>
>
>
>
From ext-asheesh.srivastava at nokia.com Fri Nov 7 10:11:02 2008
From: ext-asheesh.srivastava at nokia.com (ext-asheesh.srivastava@nokia.com)
Date: Fri Nov 7 08:15:51 2008
Subject: [datatype-dev] RE: [Client-dev] CR: Fix for AAC and its extenssion
type (eAAC+etc) audio clips issue with hardware accelerated
codecs in HEADbranch.
In-Reply-To: <03528B6E301B3B42833693425F0A49F701EADF11@daebe102.NOE.Nokia.com>
References: <03528B6E301B3B42833693425F0A49F701EADE09@daebe102.NOE.Nokia.com><00b801c94047$17db6640$479232c0$@com>
<03528B6E301B3B42833693425F0A49F701EADF11@daebe102.NOE.Nokia.com>
Message-ID: <03528B6E301B3B42833693425F0A49F701EAE2D0@daebe102.NOE.Nokia.com>
Hi Eric,
After analyzing more, I noticed, HXAudioSession::SetAudioPushdown(UINT32
ulMinimumPushdown) function is to set
the minimum audio push down value, however it is modifying
m_ulTargetPushdown member, not m_ulMinimumPushdown.
I feel the correct implementation should modify m_ulMinimumPushdown.
- m_ulTargetPushdown = (ulMinimumPushdown-----Original Message-----
>From: client-dev-bounces@helixcommunity.org
>[mailto:client-dev-bounces@helixcommunity.org] On Behalf Of
>ext ext-asheesh.srivastava@nokia.com
>Sent: Thursday, November 06, 2008 3:22 PM
>To: ehyche@real.com; client-dev@helixcommunity.org;
>datatype-dev@helixcommunity.org
>Subject: RE: [Client-dev] CR: Fix for AAC and its extenssion
>type (eAAC+etc) audio clips issue with hardware accelerated
>codecs in HEADbranch.
>
>Hi Eric,
>
>Thanks for your input. Please find my observation.
>
>On emulator if I play any media clip which has AAC audio in
>it, only 1st video frame appears and playback freezes. To fix
>this emulator problem I made m_ulTargetPushdown changes.
>
>Reason for calculating m_ulTargetPushdown based on
>TARGET_AUDIO_PUSHDOWN.
>
>1. MINIMUM_AUDIO_PUSHDOWN and TARGET_AUDIO_PUSHDOWN macros are
>defined as # define MINIMUM_AUDIO_PUSHDOWN 200
># define TARGET_AUDIO_PUSHDOWN 1000
>
>During CHXAudioSession::SetAudioPushdown call
>ulMinimumPushdown has value of 120 which is less than
>MINIMUM_AUDIO_PUSHDOWN, so m_ulTargetPushdown becomes 200.
>Then It calls
>CHXAudioSession::UpdateMinimumPushdown() where
>m_ulTargetBlocksTobeQueued, m_ulMinBlocksTobeQueued etc are calculated.
>
>Helix log has these audio pushdown values for them -
>Granularity: 50
>Blocks at the minimum: 4
>Blocks at start: 4
>Blocks to grow to: 4
>MS of data at minimum: 200
>MS of data at start: 200
>MS of data to grow to: 200
>
>2. In cayenne, above calculations are based on
>m_ulMinimumPushdown which relies on MINIMUM_AUDIO_PUSHDOWN.
>Comparing above values with cayenne,
>
>Audio pushdown values for cayenne -
>Granularity: 50
>Blocks at start: 4
>Blocks to grow to: 20
>MS of data at start: 200
>MS of data to grow to: 1000
>
>'Blocks to grow to' and 'MS of data to grow to' have
>different values in cayenne and HEAD.
>
>3. TARGET_AUDIO_PUSHDOWN and m_ulTargetPushdown are introduced
>recently in HEAD branch and I think m_ulTargetPushdown needs
>to be calculated based on TARGET_AUDIO_PUSHDOWN not
>MINIMUM_AUDIO_PUSHDOWN.
>
>4. In HEAD, When I change MINIMUM_AUDIO_PUSHDOWN to
>TARGET_AUDIO_PUSHDOWN in CHXAudioSession::SetAudioPushdown, it
>fixes the emulator problem and works fine with DSP solution
>also. Following audio pushdown values are found in log file -
>
>Audio pushdown values Report:
>Granularity: 50
>Blocks at the minimum: 4
>Blocks at start: 4
>Blocks to grow to: 20
>MS of data at minimum: 200
>MS of data at start: 200
>MS of data to grow to: 1000
>
>Above values look similar to cayenne's value.
>
>Thanks,
>- Asheesh
>
>
>>-----Original Message-----
>>From: ext Eric Hyche [mailto:ehyche@real.com]
>>Sent: Thursday, November 06, 2008 1:37 PM
>>To: Srivastava Asheesh (EXT-Infovision-MSW/Dallas);
>>client-dev@helixcommunity.org; datatype-dev@helixcommunity.org
>>Subject: RE: [Client-dev] CR: Fix for AAC and its extenssion type
>>(eAAC+ etc) audio clips issue with hardware accelerated
>codecs in HEAD
>>branch.
>>
>>Asheesh:
>>
>>Here are my comments:
>>
>>- The changes for #5 below (in client/audiosvc/hxaudply.cpp) are
>> not needed since you have made the changes in #3.
>>- Why is this change needed?
>>
>>> - m_ulTargetPushdown =
>>(ulMinimumPushdown>> - MINIMUM_AUDIO_PUSHDOWN : ulMinimumPushdown;
>>> + m_ulTargetPushdown =
>>(ulMinimumPushdown>> + TARGET_AUDIO_PUSHDOWN : ulMinimumPushdown;
>>
>>- datatype/mdf/audio/dsp/* changes look good.
>>
>>Eric
>>
>>
>>=======================================
>>Eric Hyche (ehyche@real.com)
>>Principal Engineer
>>RealNetworks, Inc.
>>
>>
>>>-----Original Message-----
>>>From: client-dev-bounces@helixcommunity.org
>>>[mailto:client-dev-bounces@helixcommunity.org] On Behalf Of
>>>ext-asheesh.srivastava@nokia.com
>>>Sent: Thursday, November 06, 2008 1:51 PM
>>>To: client-dev@helixcommunity.org; datatype-dev@helixcommunity.org
>>>Subject: [Client-dev] CR: Fix for AAC and its extenssion type (eAAC+
>>>etc) audio clips issue with hardware accelerated codecs in
>>HEAD branch.
>>>
>>>
>>>
>>> "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: ext-asheesh.srivastava@nokia.com
>>>
>>> Reviewed by:
>>>
>>> Date: 11/06/2008
>>>
>>> Project: SymbianMmf_wm
>>>
>>> ErrorId: N/A
>>>
>>> Synopsis: AAC and its extenssion type (eAAC+
>>etc) audio clips were
>>>not playing for local playback/streaming when used with DSP
>>decoder in HEAD branch.
>>>
>>> Overview:
>>> Because of the reasons listed below, AAC and
>>its extenssion type
>>>audio clips were not playing when used with DSP decoder in
>HEAD branch
>>>
>>> 1. CR - Enable eAAC+ error concealmeant was not
>>propogated to HEAD.
>>>It activates error concealment for eAAC+ clips when used with
>>hardware decoders.
>>>
>>> 2. During
>>CHXAudioSession::Resume(CHXAudioPlayer* pPlayerToExclude,
>>>HXBOOL bRewindNeeded) call , bRewindNeeded gets enabled and
>>that leads
>>>call to
>>>
>>> RewindSession, which empties the audio device's
>>buffer list and that
>>>inturn adds filler
>>>(silence) frames to the audio device and audio play-back gets stuck.
>>>
>>> Resume () was calling RewindSession() even if
>>the audio session has
>>>not pushed any data into the audio device.
>>> A check is made based on m_dNumBytesWritten to
>>skip RewindSession()
>>>call if audio session has not pushed any data to it.
>>>
>>> 3. CHXMDFAudioDevice::CheckFormat(const
>>HXAudioFormat* pAudioFormat)
>>>function was not implemented.
>>> This implementation now checks if the asked
>>audio format is same as
>>>the audio device's format when the device was created by the decoder.
>>>
>>> 4. Target audio pushdown was calculated based on
>>>MINIMUM_AUDIO_PUSHDOWN in
>>>CHXAudioSession::SetAudioPushdown() function.
>>>
>>> It should be calculated based on TARGET_AUDIO_PUSHDOWN.
>>>
>>> 5. Workaround in CHXAudioPlayer::Setup( ULONG32
>>ulGranularity) for
>>>keeping min. channel at stereo is no longer required.
>>>
>>> RA renderer used to only call
>>IHXAudioStream::Init() on the first
>>>substream when a
>>>SureStream(multi-rate) stream was played.
>>>
>>> Then, as it received packets for other
>>substreams, then it created
>>>and Init'd those IHXAudioStreams.
>>> However, the current RA renderer creates and
>>Init's an IHXAudioStream for each substream.
>>>So it would appear that this workaround is no longer needed.
>>>
>>> Files Modified:
>>> /cvsroot/datatype/mdf/audio/dsp/mdfauddevice.cpp
>>> /cvsroot/datatype/mdf/audio/dsp/mdfaudfmt.cpp
>>> /cvsroot/datatype/mdf/audio/dsp/mdfaudfmt.h
>>> /cvsroot/datatype/mdf/audio/dsp/mdfdevsound.cpp
>>> /cvsroot/client/audiosvc/hxaudply.cpp
>>> /cvsroot/client/audiosvc/hxaudses.cpp
>>>
>>> New files added:
>>> None.
>>>
>>> Image Size and Heap Use impact: no major impact
>>> Module Release testing (STIF)- After playing
>>any clip, while exiting
>>>helix engine crashes. It is a known issue and is introduced
>>by some recent CR submission.
>>>
>>> Test case(s) Added : No.
>>> Platforms and Profiles Build Verified:
>>helix-client-s60-32-mmf-mdf-dsp
>>> branch: helix_restricted
>>> platform: symbian-91-armv5
>>> target(s): symbianMmf_wm
>>>
>>> Branch: HEAD
>>>
>>> DIFF:
>>>
>>> Index: hxaudply.cpp
>>>
>>===================================================================
>>> RCS file: /cvsroot/client/audiosvc/hxaudply.cpp,v
>>> retrieving revision 1.58
>>> diff -u -b -r1.58 hxaudply.cpp
>>> --- hxaudply.cpp 20 Sep 2008 06:02:27
>>-0000 1.58
>>> +++ hxaudply.cpp 5 Nov 2008 23:06:07 -0000
>>> @@ -1916,16 +1916,9 @@
>>>
>>> // Set the audio format for this Player.
>>> m_PlayerFmt.uMaxBlockSize = maxBlocksize;
>>> - // keep min. channel at stereo
>>> - // this is a workaround for b#205546,
>>the root cause of this is that we only
>>> - // choose the audio format of the 1st
>>audio stream when the playback is started
>>> - // without audio, then audio clip is
>>started at later time. For sure stream
>>>audio,
>>> - // the first audio stream is often the
>>lowest quality, thus the audio device is
>>> - // configured to play the lowest quality audio.
>>> - //
>>> - // proper fix requires the audio
>>device is setup only after all audio streams
>>> - // assoicated with the same clip have
>>been registered
>>> - m_PlayerFmt.uChannels =
>>(maxChannels < 2) ? 2 : maxChannels;
>>> +
>>> + m_PlayerFmt.uChannels = maxChannels;
>>> +
>>> m_PlayerFmt.uBitsPerSample =
>>maxBitsPerSample;
>>>
>>> // If user wants upsampling
>>> Index: hxaudses.cpp
>>>
>>===================================================================
>>> RCS file: /cvsroot/client/audiosvc/hxaudses.cpp,v
>>> retrieving revision 1.81
>>> diff -u -b -r1.81 hxaudses.cpp
>>> --- hxaudses.cpp 18 Oct 2007 22:55:08
>>-0000 1.81
>>> +++ hxaudses.cpp 5 Nov 2008 23:06:07 -0000
>>> @@ -2196,7 +2196,7 @@
>>> if ((m_bPaused || m_bStoppedDuringPause) &&
>>> (!m_pLastPausedPlayer ||
>>(m_pLastPausedPlayer == pPlayerToExclude)))
>>> {
>>> - if (bRewindNeeded)
>>> + if (bRewindNeeded && (m_dNumBytesWritten != 0))
>>> {
>>> RewindSession();
>>> }
>>> @@ -2962,8 +2962,8 @@
>>> STDMETHODIMP
>>CHXAudioSession::SetAudioPushdown(UINT32 ulMinimumPushdown)
>>> {
>>>
>>> - m_ulTargetPushdown =
>>(ulMinimumPushdown>> - MINIMUM_AUDIO_PUSHDOWN : ulMinimumPushdown;
>>> + m_ulTargetPushdown =
>>(ulMinimumPushdown>> + TARGET_AUDIO_PUSHDOWN : ulMinimumPushdown;
>>>
>>> UpdateMinimumPushdown();
>>> Index: mdfauddevice.cpp
>>>
>>===================================================================
>>> RCS file:
>>/cvsroot/datatype/mdf/audio/dsp/mdfauddevice.cpp,v
>>> retrieving revision 1.15
>>> diff -u -b -r1.15 mdfauddevice.cpp
>>> --- mdfauddevice.cpp 19 Oct 2008 05:17:35
>>-0000 1.15
>>> +++ mdfauddevice.cpp 5 Nov 2008 23:06:29 -0000
>>> @@ -735,13 +735,21 @@
>>> // IHXAudioDevice::CheckFormat
>>> // - This method check the capability
>>of audio device
>>> // for a given audio format
>>> -// - To be implemented
>>> //
>>> HX_RESULT CHXMDFAudioDevice::CheckFormat(const
>>HXAudioFormat* pAudioFormat)
>>> {
>>> HXLOGL4(HXLOG_MDFA,"mdfdev:ChkFormat <>");
>>> - HX_RESULT res = HXR_OK;
>>> + HX_RESULT res = HXR_FAIL;
>>>
>>> + if (pAudioFormat)
>>> + {
>>> + if (m_pAudioFormat->m_uChannels ==
>>pAudioFormat->uChannels &&
>>> +
>>m_pAudioFormat->m_uBitsPerSample == pAudioFormat->uBitsPerSample
>>>&&
>>> +
>>m_pAudioFormat->m_ulSamplesPerSec == pAudioFormat-
>>>>ulSamplesPerSec)
>>> + {
>>> + res = HXR_OK;
>>> + }
>>> + }
>>> return res;
>>> }
>>>
>>> Index: mdfaudfmt.cpp
>>>
>>===================================================================
>>> RCS file:
>>/cvsroot/datatype/mdf/audio/dsp/mdfaudfmt.cpp,v
>>> retrieving revision 1.9
>>> diff -u -b -r1.9 mdfaudfmt.cpp
>>> --- mdfaudfmt.cpp 6 Jul 2007 22:01:13
>>-0000 1.9
>>> +++ mdfaudfmt.cpp 5 Nov 2008 23:06:29 -0000
>>> @@ -211,8 +211,6 @@
>>> #define SBR_DOWNSAMPLE_CUTOFF_RATE 24000
>>> #define MAX_SBR_OUT_SAMPLE_RATE 48000
>>>
>>> -#define KMMFFourCCCodeEAACP
>>0x43414520 // ' ' 'E' 'A' 'C'
>>> -
>>> HXMDFAudioAac::HXMDFAudioAac():
>>> m_ulObjectType(0)
>>> ,m_ulFrameLength(0)
>>> Index: mdfaudfmt.h
>>>
>>===================================================================
>>> RCS file: /cvsroot/datatype/mdf/audio/dsp/mdfaudfmt.h,v
>>> retrieving revision 1.6
>>> diff -u -b -r1.6 mdfaudfmt.h
>>> --- mdfaudfmt.h 6 Jul 2007 22:01:13 -0000 1.6
>>> +++ mdfaudfmt.h 5 Nov 2008 23:06:29 -0000
>>> @@ -63,6 +63,8 @@
>>>
>>> #include "gaconfig.h"
>>>
>>> +#define KMMFFourCCCodeEAACP
>>0x43414520 // ' ' 'E' 'A' 'C'
>>> +
>>>
>>> class HXMDFAudioFormat
>>> {
>>> Index: mdfdevsound.cpp
>>>
>>===================================================================
>>> RCS file:
>>/cvsroot/datatype/mdf/audio/dsp/mdfdevsound.cpp,v
>>> retrieving revision 1.19
>>> diff -u -b -r1.19 mdfdevsound.cpp
>>> --- mdfdevsound.cpp 19 Oct 2008 05:17:53
>>-0000 1.19
>>> +++ mdfdevsound.cpp 5 Nov 2008 23:06:30 -0000
>>> @@ -64,6 +64,7 @@
>>> #include "mdfdevsound.h"
>>> #include "mdfdebug.h"
>>> #include "CHXMMFDevSound.h"
>>> +#include "mdfaudfmt.h"
>>>
>>> inline
>>> TUint SamplesToMS(TUint count, TUint rate)
>>> @@ -681,7 +682,8 @@
>>> if(m_fourCC == KMMFFourCCCodeAMR ||
>>> m_fourCC == KMMFFourCCCodeAAC ||
>>> m_fourCC == KMMFFourCCCodeAWB ||
>>> - m_fourCC == KMMFFourCCCodeAMRW )
>>> + m_fourCC == KMMFFourCCCodeAMRW ||
>>> + m_fourCC == KMMFFourCCCodeEAACP)
>>> {
>>> CErrorConcealmentIntfc *ErrCI = 0;
>>> TRAPD(err, (ErrCI =
>>>CErrorConcealmentIntfc::NewL(*m_pDevSound)));
>>>
>>
>>
>>
>
>_______________________________________________
>Client-dev mailing list
>Client-dev@helixcommunity.org
>http://lists.helixcommunity.org/mailman/listinfo/client-dev
>
From ehyche at real.com Fri Nov 7 12:37:53 2008
From: ehyche at real.com (Eric Hyche)
Date: Fri Nov 7 10:42:41 2008
Subject: [datatype-dev] CR: ECTN-7KVQG3 There is no video pictures
displayed when replaying same local clip and restreaming the same clip
In-Reply-To: <955B47D82B554643A49BD712D2EE17AD1A3BB2@esebe111.NOE.Nokia.com>
References: <955B47D82B554643A49BD712D2EE17AD1A3BB2@esebe111.NOE.Nokia.com>
Message-ID: <00de01c94118$b6322550$22966ff0$@com>
Looks good.
=======================================
Eric Hyche (ehyche@real.com)
Principal Engineer
RealNetworks, Inc.
>-----Original Message-----
>From: datatype-dev-bounces@helixcommunity.org [mailto:datatype-dev-bounces@helixcommunity.org] On
>Behalf Of ext-gabriela.valverde@nokia.com
>Sent: Thursday, November 06, 2008 5:03 PM
>To: datatype-dev@helixcommunity.org
>Cc: nokia-private-dev@helixcommunity.org
>Subject: [datatype-dev] CR: ECTN-7KVQG3 There is no video pictures displayed when replaying same local
>clip and restreaming the same clip
>
>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: ext-gabriela.valverde@nokia.com
>
>Reviewed by:
>
>Date: 06-Nov-2008
>
>Project: symbianMmf_rel
>
>TSW-Id: ECTN-7KVQG3
>
>SC Id: ou1cimx1#75606
>
>Synopsis: No video is displayed when attempting repeat plaback of an audio-video file (local or
>streaming)
>
>Overview:
>MDF video adapter and DevVideo client/server session are not being cleaned up at the end of playback,
>so any repeat playback attempts result in a -14 error (KErrInUse) when trying to obtain the posting
>surface.
>
>MDF video adapter is not destroyed at the end of playback because its reference count is not zero;
>this in turn is due to the property watch object it creates to observe the "MMF.SecureOutput"
>property, which has a longer lifetime than the video adapter.
>
>The outstanding reference to the video adapter is released in HXMMFCtrlImpl::ReleaseResources() when
>the "MMF.SecureOutput" property is deleted, but this does not happen for the repeat playback case.
>
>Solution:
>Delete the property watch object in CMdfVideoAdapter::VideoEnd(), this way the reference to video
>adapter is released at the end of playback, allowing the adapter to be destroyed.
>
>Files Modified:
>
>datatype/mdf/video/renderer/mdfvideoadapter.cpp
>
>Image Size and Heap Use impact: none
>
>Module Release testing (STIF): Yes.
>
>Test case(s) Added: none
>
>Memory leak check performed: Yes, no new leaks introduced.
>
>Platforms and Profiles Build Verified:
> armv5 / helix-client-s60-50-mmf-mdf-dsp
>
>Platforms and Profiles Functionality verified:
> armv5 / helix-client-s60-50-mmf-mdf-dsp
>
>Branch:
> HEAD, hxclient_2_1_0_cayennes
>
>
>Index: mdfvideoadapter.cpp
>===================================================================
>RCS file: /cvsroot/datatype/mdf/video/renderer/mdfvideoadapter.cpp,v
>retrieving revision 1.3.2.92
>diff -u -w -r1.3.2.92 mdfvideoadapter.cpp
>--- mdfvideoadapter.cpp 28 Oct 2008 15:16:58 -0000 1.3.2.92
>+++ mdfvideoadapter.cpp 6 Nov 2008 20:48:10 -0000
>@@ -647,6 +647,11 @@
>
> m_bStreamEnd = TRUE;
>
>+ if(m_pPropWatch)
>+ {
>+ m_pPropWatch->ClearWatchByName("MMF.SecureOutput");
>+ HX_RELEASE(m_pPropWatch);
>+ }
> MDFVIDEOLOG_LEAVEFN2( "VideoEnd" );
> return HXR_OK;
> }
>
>
From ext-gabriela.valverde at nokia.com Fri Nov 7 13:57:32 2008
From: ext-gabriela.valverde at nokia.com (ext-gabriela.valverde@nokia.com)
Date: Fri Nov 7 12:02:23 2008
Subject: [datatype-dev] CR: ECTN-7KVQG3 There is no video pictures
displayed when replaying same local clip and restreaming the same clip
In-Reply-To: <00de01c94118$b6322550$22966ff0$@com>
References: <955B47D82B554643A49BD712D2EE17AD1A3BB2@esebe111.NOE.Nokia.com>
<00de01c94118$b6322550$22966ff0$@com>
Message-ID: <955B47D82B554643A49BD712D2EE17AD1ECD4C@esebe111.NOE.Nokia.com>
Thank you. Changes have been commited to 210cayennes and head.
-----Original Message-----
From: ext Eric Hyche [mailto:ehyche@real.com]
Sent: Friday, November 07, 2008 2:38 PM
To: Valverde Gabriela (EXT-Infovision-MSW/Dallas);
datatype-dev@helixcommunity.org
Cc: nokia-private-dev@helixcommunity.org
Subject: RE: [datatype-dev] CR: ECTN-7KVQG3 There is no video pictures
displayed when replaying same local clip and restreaming the same clip
Looks good.
=======================================
Eric Hyche (ehyche@real.com)
Principal Engineer
RealNetworks, Inc.
>-----Original Message-----
>From: datatype-dev-bounces@helixcommunity.org
>[mailto:datatype-dev-bounces@helixcommunity.org] On Behalf Of
>ext-gabriela.valverde@nokia.com
>Sent: Thursday, November 06, 2008 5:03 PM
>To: datatype-dev@helixcommunity.org
>Cc: nokia-private-dev@helixcommunity.org
>Subject: [datatype-dev] CR: ECTN-7KVQG3 There is no video pictures
>displayed when replaying same local clip and restreaming the same clip
>
>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: ext-gabriela.valverde@nokia.com
>
>Reviewed by:
>
>Date: 06-Nov-2008
>
>Project: symbianMmf_rel
>
>TSW-Id: ECTN-7KVQG3
>
>SC Id: ou1cimx1#75606
>
>Synopsis: No video is displayed when attempting repeat plaback of an
>audio-video file (local or
>streaming)
>
>Overview:
>MDF video adapter and DevVideo client/server session are not being
>cleaned up at the end of playback, so any repeat playback attempts
>result in a -14 error (KErrInUse) when trying to obtain the posting
surface.
>
>MDF video adapter is not destroyed at the end of playback because its
>reference count is not zero; this in turn is due to the property watch
object it creates to observe the "MMF.SecureOutput"
>property, which has a longer lifetime than the video adapter.
>
>The outstanding reference to the video adapter is released in
>HXMMFCtrlImpl::ReleaseResources() when the "MMF.SecureOutput" property
is deleted, but this does not happen for the repeat playback case.
>
>Solution:
>Delete the property watch object in CMdfVideoAdapter::VideoEnd(), this
>way the reference to video adapter is released at the end of playback,
allowing the adapter to be destroyed.
>
>Files Modified:
>
>datatype/mdf/video/renderer/mdfvideoadapter.cpp
>
>Image Size and Heap Use impact: none
>
>Module Release testing (STIF): Yes.
>
>Test case(s) Added: none
>
>Memory leak check performed: Yes, no new leaks introduced.
>
>Platforms and Profiles Build Verified:
> armv5 / helix-client-s60-50-mmf-mdf-dsp
>
>Platforms and Profiles Functionality verified:
> armv5 / helix-client-s60-50-mmf-mdf-dsp
>
>Branch:
> HEAD, hxclient_2_1_0_cayennes
>
>
>Index: mdfvideoadapter.cpp
>===================================================================
>RCS file: /cvsroot/datatype/mdf/video/renderer/mdfvideoadapter.cpp,v
>retrieving revision 1.3.2.92
>diff -u -w -r1.3.2.92 mdfvideoadapter.cpp
>--- mdfvideoadapter.cpp 28 Oct 2008 15:16:58 -0000 1.3.2.92
>+++ mdfvideoadapter.cpp 6 Nov 2008 20:48:10 -0000
>@@ -647,6 +647,11 @@
>
> m_bStreamEnd = TRUE;
>
>+ if(m_pPropWatch)
>+ {
>+ m_pPropWatch->ClearWatchByName("MMF.SecureOutput");
>+ HX_RELEASE(m_pPropWatch);
>+ }
> MDFVIDEOLOG_LEAVEFN2( "VideoEnd" );
> return HXR_OK;
> }
>
>
From dyek at real.com Sat Nov 8 16:46:38 2008
From: dyek at real.com (Daniel Yek)
Date: Sat Nov 8 14:51:02 2008
Subject: [datatype-dev] CR/CN-Client: Fixed build break involving
IHXCallback in dtdriver vdecoder.h by including hxengin.h
Message-ID: <491632EE.7010205@real.com>
Modified by: dyek@real.com
Date: 11/8/2008
Project: RealPlayer for Netbook
Synopsis: Fixed build break involving IHXCallback in dtdriver vdecoder.h
by including hxengin.h
Overview:
Fixed build break where Helix scheduler's IHXCallback interface was
added to dtdriver's vdecoder.h file without adding #include "hxengin.h".
This change simply includes the above header file.
Files Modified:
datatype/tools/dtdriver/decoder/video/pub/vdecoder.h
Image Size and Heap Use impact (Client -Only):
None.
Platforms and Profiles Affected:
Linux
Distribution Libraries Affected:
None.
Distribution library impact and planned action:
None.
Platforms and Profiles Build Verified:
Profile: helix_client_all_define
Platform: Fedora
Platforms and Profiles Functionality verified:
Profile: helix_client_all_define
Platform: Fedora
Branch: 310Atlas & HEAD
Copyright assignment: I am a RealNetworks employee.
--
Daniel Yek.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: dtdr_vdecoder.h_IHXCallback[1].diff
Type: text/x-patch
Size: 652 bytes
Desc: not available
Url : http://lists.helixcommunity.org/pipermail/datatype-dev/attachments/20081108/e4d65405/dtdr_vdecoder.h_IHXCallback1.bin
From alokj at real.com Mon Nov 10 05:26:40 2008
From: alokj at real.com (Alok Jain)
Date: Mon Nov 10 03:30:52 2008
Subject: [datatype-dev] CR: To Support the Fix bounds checking in Bitstream
class
Message-ID: <002001c94337$f980cd40$7601a8c0@AlokSystem>
Skipped content of type multipart/alternative-------------- next part --------------
Index: Umakefil
===================================================================
RCS file: /cvsroot/datatype/mp4/payload/Umakefil,v
retrieving revision 1.20
diff -u -w -r1.20 Umakefil
--- Umakefil 23 Sep 2008 13:23:27 -0000 1.20
+++ Umakefil 10 Nov 2008 13:08:45 -0000
@@ -54,7 +54,8 @@
"datatype/rm/common/pub",
"datatype/mp4/common/pub",
"datatype/mp4/fileformat/pub",
- "datatype/amr/common/pub")
+ "datatype/amr/common/pub",
+ "common/log/logutil/pub")
project.AddSources("amrpyld.cpp",
"amr-depack.cpp",
Index: amr-depack.cpp
===================================================================
RCS file: /cvsroot/datatype/mp4/payload/amr-depack.cpp,v
retrieving revision 1.7
diff -u -w -r1.7 amr-depack.cpp
--- amr-depack.cpp 14 Mar 2005 19:17:44 -0000 1.7
+++ amr-depack.cpp 10 Nov 2008 13:08:46 -0000
@@ -38,7 +38,7 @@
#include "amr_toc.h"
#include "amr_rs_itr.h"
#include "bitstream.h"
-
+#include "hxtlogutil.h"
AMRDepack::AMRDepack() :
m_flavor(NarrowBand),
@@ -164,21 +164,43 @@
Bitstream bs;
- bs.SetBuffer(pData);
+ bs.SetBuffer(pData, ulSize);
+ UINT32 ulLeft = bs.BitsLeft();
// Skip the CMR since we don't care about it
if (m_bOctetAlign)
{
+ if (ulLeft < 8)
+ {
+ bFailed =TRUE;
+ }
// 3GPP TS26.235 v5.0.0 Annex B Section B.4.4.1
+ else
+ {
bs.GetBits(8);
}
+ }
else
{
+ if (ulLeft < 4)
+ {
+ bFailed =TRUE;
+ }
// 3GPP TS26.235 v5.0.0 Annex B Section B.4.3.1
+ else
+ {
bs.GetBits(4);
}
+ }
- if (m_ulMaxInterleave > 0)
+ if (m_ulMaxInterleave > 0 && !bFailed)
+ {
+ ulLeft = bs.BitsLeft();
+ if (ulLeft < 8)
+ {
+ bFailed =TRUE;
+ }
+ else
{
// 3GPP TS26.235 v5.0.0 Annex B Section B.4.4.1
ULONG32 ulILL = bs.GetBits(4);
@@ -186,17 +208,26 @@
bFailed = !UpdateIleavInfo(ulILL, ulILP, ulTime);
}
+ }
if (bFailed == FALSE)
{
AMRTOCInfo tocInfo;
- GetTOCInfo(bs, tocInfo);
+ if (!GetTOCInfo(bs, tocInfo))
+ {
+ HXLOGL1("Failed GetTOCInfo()");
+ return FALSE;
+ }
if (m_bHasCRC)
{
// 3GPP TS26.235 v5.0.0 Annex B Section B.4.4.2.1
- SkipCRCInfo(bs, tocInfo);
+ if (!SkipCRCInfo(bs, tocInfo))
+ {
+ HXLOGL1("Failed SkipCRCInfo()");
+ return FALSE;
+ }
}
// Update the block count to make sure we have
@@ -218,7 +249,10 @@
if (m_bRobustSort)
{
// Copy robust sorted frame data to m_blockBuf
- SortedCopy(bs, ulStartBlock, ulBlockInc, tocInfo);
+ if (!SortedCopy(bs, ulStartBlock, ulBlockInc, tocInfo))
+ {
+ bFailed =TRUE;
+ }
}
else
{
@@ -320,12 +354,13 @@
return !bFailed;
}
-void AMRDepack::GetTOCInfo(Bitstream& bs, AMRTOCInfo& tocInfo)
+HXBOOL AMRDepack::GetTOCInfo(Bitstream& bs, AMRTOCInfo& tocInfo)
{
ULONG32 ulTocBits;
ULONG32 ulTocMask;
ULONG32 ulShift;
+ HXBOOL bFailed = FALSE;
if (m_bOctetAlign)
{
@@ -363,9 +398,15 @@
}
HXBOOL bDone = FALSE;
-
+ UINT32 ulLeft = 0;
while(!bDone)
{
+ ulLeft = bs.BitsLeft();
+ if (ulLeft < ulTocBits)
+ {
+ bFailed =TRUE;
+ break;
+ }
ULONG32 entry = bs.GetBits(ulTocBits);
UINT8 type = (UINT8)(entry >> (ulShift + 1)) & 0x0f;
UINT8 quality = (UINT8)(entry >> ulShift) & 0x01;
@@ -375,18 +416,30 @@
if ((entry & ulTocMask) == 0)
bDone = TRUE;
}
+ return !bFailed;
}
-void AMRDepack::SkipCRCInfo(Bitstream& bs, const AMRTOCInfo& tocInfo)
+HXBOOL AMRDepack::SkipCRCInfo(Bitstream& bs, const AMRTOCInfo& tocInfo)
{
+ HXBOOL bFailed = FALSE;
// Skip CRCs if they are present since we don't
// care about them.
for (ULONG32 i = 0; i < tocInfo.EntryCount(); i++)
{
if (tocInfo.GetType(i) < 14)
+ {
+ UINT32 ulLeft = bs.BitsLeft();
+ if (ulLeft < 8)
+ {
+ bFailed =TRUE;
+ break;
+ }
bs.GetBits(8);
}
}
+ return !bFailed;
+
+}
void AMRDepack::UpdateBlockCount(ULONG32 ulBlockCount)
@@ -493,6 +546,12 @@
pCurrent[ulFrameBytes - 1] = 0;
// Copy frame bits into the buffer
+ UINT32 ulLeft = bs.BitsLeft();
+ if (ulLeft < ulFrameBits)
+ {
+ bFailed = TRUE;
+ break;
+ }
bs.GetBits(ulFrameBits, pCurrent);
// Move current pointer to just past this frame
@@ -513,10 +572,11 @@
return ulRet;
}
-void AMRDepack::SortedCopy(Bitstream& bs,
+HXBOOL AMRDepack::SortedCopy(Bitstream& bs,
ULONG32 ulStartBlock, ULONG32 ulBlockInc,
const AMRTOCInfo& tocInfo)
{
+ HXBOOL bFailed = FALSE;
// This function copies robust sorted data from the packet.
// Unfortunately this is not very efficient because the bytes
// of each frame are interleaved with eachother. The
@@ -532,8 +592,15 @@
UINT8* pDest = m_blockBuf.GetBlockBuf(itr.Block()) + itr.Offset();
// Copy the byte
+ UINT32 ulLeft = bs.BitsLeft();
+ if (ulLeft < 8)
+ {
+ bFailed = TRUE;
+ break;
+ }
*pDest = (UINT8)bs.GetBits(8);
}
+ return !bFailed;
}
void AMRDepack::DispatchFrameBlock(ULONG32 ulTimestamp,
Index: mp4-latm-depack.cpp
===================================================================
RCS file: /cvsroot/datatype/mp4/payload/mp4-latm-depack.cpp,v
retrieving revision 1.11
diff -u -w -r1.11 mp4-latm-depack.cpp
--- mp4-latm-depack.cpp 14 Sep 2007 22:09:24 -0000 1.11
+++ mp4-latm-depack.cpp 10 Nov 2008 13:08:46 -0000
@@ -84,8 +84,7 @@
{
Bitstream bs;
- bs.SetBuffer(pStreamMuxConfig);
- bs.SetBufSize(ulMuxConfigSize);
+ bs.SetBuffer(pStreamMuxConfig, ulMuxConfigSize);
// A config was specified so try to unpack it
ret = HandleMuxConfig(bs);
@@ -241,12 +240,16 @@
Bitstream bs;
- bs.SetBuffer(pBuffer);
- bs.SetBufSize(ulSize);
+ bs.SetBuffer(pBuffer, ulSize);
if (m_bConfigPresent)
{
- if (bs.GetBits(1) == 0)
+ UINT32 ulLeft = bs.BitsLeft();
+ if (ulLeft < 1)
+ {
+ failed = TRUE;
+ }
+ else if (bs.GetBits(1) == 0)
{
// Not sure what we are supposed to do if this fails
if (!HandleMuxConfig(bs))
@@ -267,7 +270,11 @@
failed = TRUE;
break;
}
- GetPayloads(bs, ulFrameTime);
+ if (!GetPayloads(bs, ulFrameTime))
+ {
+ failed = TRUE;
+ break;
+ }
}
m_bHadLoss = FALSE;
@@ -307,9 +314,15 @@
ULONG32 tmp;
UINT32 ulSizeByteCount = 0;
m_pSlotLengths[streamID] = 0;
+ UINT32 ulLeft = bs.BitsLeft();
do
{
+ ulLeft = bs.BitsLeft();
+ if (ulLeft < 8)
+ {
+ return FALSE;
+ }
tmp = bs.GetBits(8);
ulSizeByteCount++;
m_pSlotLengths[streamID] += tmp;
@@ -336,8 +349,9 @@
return !failed;
}
-void MP4LATMDepack::GetPayloads(Bitstream& bs, ULONG32 ulTime)
+HXBOOL MP4LATMDepack::GetPayloads(Bitstream& bs, ULONG32 ulTime)
{
+ HXBOOL failed = FALSE;
if (m_muxConfig.AllSameTiming())
{
for (ULONG32 prog = 0; prog < m_muxConfig.NumPrograms(); prog++)
@@ -345,7 +359,11 @@
for (ULONG32 layer = 0; layer < m_muxConfig.NumLayers(prog); layer++)
{
ULONG32 streamID = m_muxConfig.GetStreamID(prog, layer);
-
+ UINT32 ulLeft = bs.BitsLeft();
+ if (ulLeft < (m_pSlotLengths[streamID] << 3))
+ {
+ return FALSE;
+ }
bs.GetBits(m_pSlotLengths[streamID] << 3, m_pPayloadBuf);
// Currently we just hand out packets for stream 0
@@ -359,5 +377,6 @@
}
}
}
+ return !failed;
}
Index: mp4a-mux-cfg.cpp
===================================================================
RCS file: /cvsroot/datatype/mp4/payload/mp4a-mux-cfg.cpp,v
retrieving revision 1.14
diff -u -w -r1.14 mp4a-mux-cfg.cpp
--- mp4a-mux-cfg.cpp 28 Aug 2007 20:29:01 -0000 1.14
+++ mp4a-mux-cfg.cpp 10 Nov 2008 13:08:46 -0000
@@ -38,6 +38,7 @@
#include "mp4a-mux-cfg.h"
#include "bitstream.h"
+#include "hxtlogutil.h"
MP4AAudioSpec::MP4AAudioSpec() :
m_pConfig(0),
@@ -89,11 +90,14 @@
{
HXBOOL ret = FALSE;
Bitstream bsTmp;
- bsTmp.SetBuffer(bs.GetBuffer());
- bsTmp.SetBufSize(bs.GetBufSize());
+ bsTmp.SetBuffer(bs.GetBuffer(), bs.GetBufSize());
+ UINT32 ulLeft = bsTmp.BitsLeft();
+ if (ulLeft >= nBits)
+ {
bsTmp.GetBits(nBits);
ret = AudioSpecificConfigRead(bsTmp,nBits);
+ }
if(ret)
{
// Since AudioSpecificCofig size should be in
@@ -112,7 +116,8 @@
m_ulConfigSize = m_ulConfigBits/8;
delete [] m_pConfig;
m_pConfig = new UINT8 [m_ulConfigSize];
- if(m_pConfig)
+ ulLeft = bs.BitsLeft();
+ if (m_pConfig && ulLeft >= m_ulConfigBits)
{
bs.GetBits(m_ulConfigBits, m_pConfig);
}
@@ -129,17 +134,29 @@
return (m_ulBaseConfigEnd/8);
}
-ULONG32 MP4AAudioSpec::GetAudioObjectType(Bitstream& bs)
+HXBOOL MP4AAudioSpec::GetAudioObjectType(Bitstream& bs, ULONG32& AudioObjectType)
+{
+ HXBOOL failed = FALSE;
+ UINT32 ulLeft = bs.BitsLeft();
+
+ if (ulLeft < 5)
{
- ULONG32 AudioObjectType = bs.GetBits(5);
+ return FALSE;
+ }
+ AudioObjectType = bs.GetBits(5);
m_ulConfigBits += 5;
if(AudioObjectType == 31)
{
+ ulLeft = bs.BitsLeft();
+ if (ulLeft < 6)
+ {
+ return FALSE;
+ }
AudioObjectType = 32 + bs.GetBits(6);
m_ulConfigBits += 6;
}
- return AudioObjectType;
+ return !failed;
}
/* The SBR present flag is determined according to the syntax
* given in ISO/IEC 14496-3 SP-1 (MPEG-4 Audio). See section 1.6 ,
@@ -147,6 +164,7 @@
*/
HXBOOL MP4AAudioSpec::AudioSpecificConfigRead(Bitstream& bs, ULONG32 nBits)
{
+ HXBOOL failed =FALSE;
ULONG32 samplingFrequency = 0;
HXBOOL bSBR = FALSE;
HXBOOL bPS = FALSE;
@@ -154,18 +172,36 @@
ULONG32 ExtnAudioObjectType = 0;
m_ulConfigBits = 0;
- AudioObjectType = GetAudioObjectType(bs);
+ if (!GetAudioObjectType(bs,AudioObjectType))
+ {
+ HXLOGL1("Failed GetAudioObjectType()");
+ }
+ UINT32 ulLeft = bs.BitsLeft();
+ if (ulLeft < 4)
+ {
+ return FALSE;
+ }
ULONG32 samplingFrequencyIndex = bs.GetBits(4);
m_ulConfigBits += 4;
if(samplingFrequencyIndex == 0xf)
{
+ ulLeft = bs.BitsLeft();
+ if (ulLeft < 24)
+ {
+ return FALSE;
+ }
// ESC, read sr from bitstream
ULONG32 samplingFrequency = bs.GetBits(24);
m_ulConfigBits += 24;
}
+ ulLeft = bs.BitsLeft();
+ if (ulLeft < 4)
+ {
+ return FALSE;
+ }
ULONG32 channelConfiguration = bs.GetBits(4);
m_ulConfigBits += 4;
@@ -177,23 +213,41 @@
{
bPS = TRUE;
}
+ ulLeft = bs.BitsLeft();
+ if (ulLeft < 4)
+ {
+ return FALSE;
+ }
+
ULONG32 extensionSamplingFrequencyIndex = bs.GetBits(4);
m_ulConfigBits += 4;
if(extensionSamplingFrequencyIndex == 0xf)
{
// ESC, read sr from bitstream
+ ulLeft = bs.BitsLeft();
+ if (ulLeft < 24)
+ {
+ return FALSE;
+ }
+
bs.GetBits(24);
m_ulConfigBits += 24;
}
- AudioObjectType = GetAudioObjectType(bs);
+ if (!GetAudioObjectType(bs,AudioObjectType))
+ {
+ HXLOGL1("Failed GetAudioObjectType()");
+ }
}
switch (AudioObjectType)
{
case 1: case 2: case 4:
- GASpecificConfigRead(bs,
- samplingFrequency,channelConfiguration,AudioObjectType) ;
+ if (!GASpecificConfigRead(bs,
+ samplingFrequency,channelConfiguration,AudioObjectType))
+ {
+ return FALSE;
+ }
break ;
default:
@@ -206,20 +260,43 @@
if (!bSBR && ulBitsLeft >= 16)
// if SBR info has not been read before, but there are more bytes to follow...
{
+ ulLeft = bs.BitsLeft();
+ if (ulLeft < 11)
+ {
+ return FALSE;
+ }
if (bs.GetBits(11) == 0x2b7)
{
m_ulConfigBits += 11;
- ExtnAudioObjectType = GetAudioObjectType(bs);
+ if (!GetAudioObjectType(bs,ExtnAudioObjectType))
+ {
+ HXLOGL1("Failed GetAudioObjectType()");
+ }
if (ExtnAudioObjectType == 5)
{
+ ulLeft = bs.BitsLeft();
+ if (ulLeft < 1)
+ {
+ return FALSE;
+ }
bSBR = bs.GetBits(1);
m_ulConfigBits += 1;
if (bSBR)
{
+ ulLeft = bs.BitsLeft();
+ if (ulLeft < 4)
+ {
+ return FALSE;
+ }
ULONG32 extensionSamplingFrequencyIndex = bs.GetBits(4);
m_ulConfigBits += 4;
if(extensionSamplingFrequencyIndex == 0xf)
{
+ ulLeft = bs.BitsLeft();
+ if (ulLeft < 24)
+ {
+ return FALSE;
+ }
// ESC, read sr from bitstream
bs.GetBits(24);
m_ulConfigBits += 24;
@@ -228,8 +305,18 @@
ulBitsLeft = bs.GetBufSize()*8 - m_ulConfigBits - nBits;
if (ulBitsLeft >= 12)
{
+ ulLeft = bs.BitsLeft();
+ if (ulLeft < 11)
+ {
+ return FALSE;
+ }
if (bs.GetBits(11) == 0x548)
{
+ ulLeft = bs.BitsLeft();
+ if (ulLeft < 1)
+ {
+ return FALSE;
+ }
m_ulConfigBits += 11;
bPS = bs.GetBits(1);
m_ulConfigBits += 1;
@@ -241,20 +328,31 @@
}
}
- return TRUE ;
+ return !failed ;
}
-void MP4AAudioSpec::GASpecificConfigRead(Bitstream& bs,
+HXBOOL MP4AAudioSpec::GASpecificConfigRead(Bitstream& bs,
UINT32 samplingFrequency,
UINT32 ChannelConfiguration,
UINT32 AudioObjectType)
{
+ HXBOOL failed = FALSE;
//Read FrameLengthFlag
+ UINT32 ulLeft = bs.BitsLeft();
+ if (ulLeft < 2)
+ {
+ return FALSE;
+ }
bs.GetBits(1);
m_ulConfigBits += 1;
// Read DependsOnCoreCoder
if (bs.GetBits(1))
{
+ ulLeft = bs.BitsLeft();
+ if (ulLeft < 14)
+ {
+ return FALSE;
+ }
bs.GetBits(14);
m_ulConfigBits += 15;
}
@@ -262,16 +360,29 @@
m_ulConfigBits += 1;
// Read ExtensionFlag
+ ulLeft = bs.BitsLeft();
+ if (ulLeft < 1)
+ {
+ return FALSE;
+ }
ULONG32 extensionFlag = bs.GetBits(1);
m_ulConfigBits += 1;
if (ChannelConfiguration == 0)
{
- PCERead(bs) ;
+ if (!PCERead(bs))
+ {
+ return FALSE;
+ }
}
if((AudioObjectType == 6) || (AudioObjectType == 20))
{
+ ulLeft = bs.BitsLeft();
+ if (ulLeft < 3)
+ {
+ return FALSE;
+ }
// Read layerNr;
bs.GetBits(3);
m_ulConfigBits += 3;
@@ -280,6 +391,11 @@
{
if (AudioObjectType == 22)
{
+ ulLeft = bs.BitsLeft();
+ if (ulLeft < 16)
+ {
+ return FALSE;
+ }
// Read numOfSubFrame, layer_length
bs.GetBits(16);
m_ulConfigBits += 16;
@@ -287,15 +403,27 @@
if (AudioObjectType == 17 || AudioObjectType == 19 ||
AudioObjectType == 20 || AudioObjectType == 23)
{
+ ulLeft = bs.BitsLeft();
+ if (ulLeft < 3)
+ {
+ return FALSE;
+ }
+
// TRead aacSectionDataResilienceFlag, aacScalefactorDataResilienceFlag
// and aacSpectralDataResilienceFlag;
bs.GetBits(3);
m_ulConfigBits += 3;
}
// Read extensionFlag3
+ ulLeft = bs.BitsLeft();
+ if (ulLeft < 1)
+ {
+ failed = TRUE;
+ }
bs.GetBits(1);
m_ulConfigBits += 1;
}
+ return !failed;
}
HXBOOL MP4AAudioSpec::SBRPresent(UINT8* pConfig, UINT32 ulConfigSize, HXBOOL& bSBR)
@@ -305,8 +433,7 @@
ULONG32 ulExtnAudioObjectType = 0;
ULONG32 ulConfigBits = 0;
Bitstream bsAudio;
- bsAudio.SetBuffer(pConfig);
- bsAudio.SetBufSize(ulConfigSize);
+ bsAudio.SetBuffer(pConfig, ulConfigSize);
bSBR = FALSE;
if(Unpack(bsAudio, 0))
{
@@ -319,11 +446,17 @@
return FALSE;
}
-void MP4AAudioSpec::PCERead(Bitstream& bs)
+HXBOOL MP4AAudioSpec::PCERead(Bitstream& bs)
{
+ HXBOOL failed = FALSE;
UINT32 i ;
// Read element_instance_tag, object_type, sampling_frequency_index
+ UINT32 ulLeft = bs.BitsLeft();
+ if (ulLeft < 32)
+ {
+ return FALSE;
+ }
bs.GetBits(10);
m_ulConfigBits += 10;
@@ -339,67 +472,135 @@
m_ulConfigBits += 1;
if (bs.GetBits(1))
{
+ ulLeft = bs.BitsLeft();
+ if (ulLeft < 4)
+ {
+ return FALSE;
+ }
// Read mono_mixdown_element_number
bs.GetBits(4);
m_ulConfigBits += 4;
}
// Read stereo_mixdown_present
+ ulLeft = bs.BitsLeft();
+ if (ulLeft < 1)
+ {
+ return FALSE;
+ }
if (bs.GetBits(1))
{
+ ulLeft = bs.BitsLeft();
+ if (ulLeft < 4)
+ {
+ return FALSE;
+ }
bs.GetBits(4);
m_ulConfigBits += 4;
}
m_ulConfigBits += 1;
// Read matrix_mixdown_idx_present
+ ulLeft = bs.BitsLeft();
+ if (ulLeft < 1)
+ {
+ return FALSE;
+ }
if (bs.GetBits(1))
{
+ ulLeft = bs.BitsLeft();
+ if (ulLeft < 3)
+ {
+ return FALSE;
+ }
+ else
+ {
// Read matrix_mixdown_idx, pseudo_surround_enable
bs.GetBits(3);
m_ulConfigBits += 3;
}
+ }
m_ulConfigBits += 1;
-
for ( i = 0; i < num_front_channel_elements; i++) {
+ ulLeft = bs.BitsLeft();
+ if (ulLeft < 5)
+ {
+ return FALSE;
+ }
bs.GetBits(5);
m_ulConfigBits += 5;
}
for ( i = 0; i < num_side_channel_elements; i++) {
+ ulLeft = bs.BitsLeft();
+ if (ulLeft < 5)
+ {
+ return FALSE;
+ }
bs.GetBits(5);
m_ulConfigBits += 5;
}
for ( i = 0; i < num_back_channel_elements; i++) {
+ ulLeft = bs.BitsLeft();
+ if (ulLeft < 5)
+ {
+ return FALSE;
+ }
bs.GetBits(5);
m_ulConfigBits += 5;
}
for ( i = 0; i < num_lfe_channel_elements; i++) {
+ ulLeft = bs.BitsLeft();
+ if (ulLeft < 4)
+ {
+ return FALSE;
+ }
bs.GetBits(4);
m_ulConfigBits += 4;
}
for ( i = 0; i < num_assoc_data_elements; i++) {
+ ulLeft = bs.BitsLeft();
+ if (ulLeft < 4)
+ {
+ return FALSE;
+ }
bs.GetBits(4);
m_ulConfigBits += 4;
}
for ( i = 0; i < num_valid_cc_elements; i++) {
+ ulLeft = bs.BitsLeft();
+ if (ulLeft < 5)
+ {
+ return FALSE;
+ }
bs.GetBits(5);
m_ulConfigBits += 5;
}
+ ulLeft = bs.BitsLeft();
+ if (ulLeft < 8)
+ {
+ return FALSE;
+ }
UINT32 comment_field_bytes = bs.GetBits(8);
if (comment_field_bytes)
{
for (i = 0 ; i < comment_field_bytes ; i++)
{
+ ulLeft = bs.BitsLeft();
+ if (ulLeft < 8)
+ {
+ return FALSE;
+ }
bs.GetBits(8);
m_ulConfigBits += 8;
}
}
+ return !failed;
}
MP4AStreamInfo::MP4AStreamInfo() :
@@ -433,10 +634,15 @@
{
HXBOOL failed = FALSE;
ULONG32 nBits= 0;
-
+ UINT32 ulLeft = 0;
Reset();
#if 1
// This updates StreamMuxConfig to ISO/IEC draft 14496-3:2001
+ ulLeft = bs.BitsLeft();
+ if (ulLeft < 1)
+ {
+ return FALSE;
+ }
ULONG32 ulAudioMuxVersion = bs.GetBits(1); // audioMuxVersion
nBits++;
@@ -444,6 +650,11 @@
ULONG32 ulAudioMuxVersionA = 0;
if (ulAudioMuxVersion == 1)
{
+ ulLeft = bs.BitsLeft();
+ if (ulLeft < 1)
+ {
+ return FALSE;
+ }
ulAudioMuxVersionA = bs.GetBits(1); // audioMuxVersionA
nBits++;
}
@@ -453,13 +664,22 @@
if (ulAudioMuxVersion == 1)
{
// this increments nBits
- LatmGetValue(bs, nBits); // TaraBufferFullness
+ ULONG32 ulValue =0;
+ if (!LatmGetValue(bs, nBits, ulValue)) // TaraBufferFullness
+ {
+ return FALSE;
+ }
+ }
+ ulLeft = bs.BitsLeft();
+ if (ulLeft < 11)
+ {
+ return FALSE;
}
-
m_bAllSameTiming = (bs.GetBits(1) ? TRUE : FALSE);
m_ulNumSubFrames = bs.GetBits(6) + 1; // 0-based (old version was not)
m_ulNumPrograms = bs.GetBits(4) + 1; // 0-based (old version was not)
nBits += 11;
+
// Allocate arrays
m_pLayerCounts = new ULONG32[m_ulNumPrograms];
m_ppStreamLookup = new ULONG32*[m_ulNumPrograms];
@@ -476,6 +696,11 @@
for (ulProg = 0; !failed && ulProg < m_ulNumPrograms; ulProg++)
{
// Get the number of layers
+ ulLeft = bs.BitsLeft();
+ if (ulLeft < 3)
+ {
+ return FALSE;
+ }
ULONG32 ulNumLayers = bs.GetBits(3) + 1; // 0-based (old version was not)
nBits += 3;
// Allocate stream lookup array
@@ -493,9 +718,13 @@
streamInfo.SetProgram(ulProg);
streamInfo.SetLayer(ulLay);
-
if ((ulProg != 0) || (ulLay != 0))
{
+ ulLeft = bs.BitsLeft();
+ if (ulLeft < 1)
+ {
+ return FALSE;
+ }
ulUseSameConfig = bs.GetBits(1);
nBits++;
}
@@ -506,7 +735,10 @@
if (ulAudioMuxVersion == 1)
{
// this increments nBits
- ulAscLen = LatmGetValue(bs, nBits);
+ if (!LatmGetValue(bs, nBits, ulAscLen))
+ {
+ return FALSE;
+ }
}
if (!as.Unpack(bs, nBits)) //nBits bytes already read
@@ -518,6 +750,11 @@
ULONG32 ulAscBits = as.ConfigSize() * 8;
if (ulAscLen > ulAscBits)
{
+ ulLeft = bs.BitsLeft();
+ if (ulLeft < (ulAscLen - ulAscBits))
+ {
+ return FALSE;
+ }
// get fill bits
ulAscLen -= ulAscBits;
bs.GetBits(ulAscLen);
@@ -526,12 +763,21 @@
}
streamInfo.SetAudioSpec(as);
-
+ ulLeft = bs.BitsLeft();
+ if (ulLeft < 3)
+ {
+ return FALSE;
+ }
streamInfo.SetLengthType(bs.GetBits(3));
switch (streamInfo.GetLengthType())
{
case 0:
+ ulLeft = bs.BitsLeft();
+ if (ulLeft < 8)
+ {
+ return FALSE;
+ }
bs.GetBits(8); // Buffer fullness
if (!m_bAllSameTiming)
{
@@ -541,15 +787,30 @@
}
break;
case 1:
+ ulLeft = bs.BitsLeft();
+ if (ulLeft < 9)
+ {
+ return FALSE;
+ }
streamInfo.SetFrameLength(bs.GetBits(9));
break;
case 3:
case 4:
case 5:
+ ulLeft = bs.BitsLeft();
+ if (ulLeft < 6)
+ {
+ return FALSE;
+ }
streamInfo.SetCELPIndex(bs.GetBits(6));
break;
case 6 :
case 7 :
+ ulLeft = bs.BitsLeft();
+ if (ulLeft < 1)
+ {
+ return FALSE;
+ }
streamInfo.SetHVXCIndex(bs.GetBits(1));
break;
default:
@@ -568,12 +829,22 @@
}
}
// Other data present
+ ulLeft = bs.BitsLeft();
+ if (ulLeft < 1)
+ {
+ return FALSE;
+ }
if (bs.GetBits(1))
{
UINT8 otherDataLenTemp = 0;
UINT32 otherDataLenBits = 0;
UINT8 otherDataLenEsc = 0;
do {
+ ulLeft = bs.BitsLeft();
+ if (ulLeft < 9)
+ {
+ return FALSE;
+ }
otherDataLenBits *= 256;
otherDataLenEsc = (UINT8)bs.GetBits(1);
otherDataLenTemp = (UINT8)bs.GetBits(8);
@@ -581,8 +852,18 @@
} while (otherDataLenEsc);
}
// Crc present
+ ulLeft = bs.BitsLeft();
+ if (ulLeft < 1)
+ {
+ return FALSE;
+ }
if (bs.GetBits(1))
{
+ ulLeft = bs.BitsLeft();
+ if (ulLeft < 8)
+ {
+ return FALSE;
+ }
bs.GetBits(8);
}
@@ -593,9 +874,19 @@
}
}
#else
+ ulLeft = bs.BitsLeft();
+ if (ulLeft < 1)
+ {
+ return FALSE;
+ }
if (bs.GetBits(1))
m_bAllSameTiming = TRUE;
+ ulLeft = bs.BitsLeft();
+ if (ulLeft < 7)
+ {
+ return FALSE;
+ }
m_ulNumSubFrames = bs.GetBits(3);
m_ulNumPrograms = bs.GetBits(4);
@@ -608,9 +899,13 @@
m_pLayerCounts[i] = 0;
m_ppStreamLookup[i] = 0;
}
-
for (ULONG32 prog = 0; !failed && (prog < m_ulNumPrograms) ; prog++)
{
+ ulLeft = bs.BitsLeft();
+ if (ulLeft < 3)
+ {
+ return FALSE;
+ }
ULONG32 ulNumLayers = bs.GetBits(3);
MP4AAudioSpec as;
@@ -628,8 +923,12 @@
streamInfo.SetProgram(prog);
streamInfo.SetLayer(lay);
-
- if (((prog != 0) || (lay != 0)) &&
+ ulLeft = bs.BitsLeft();
+ if (ulLeft < 1)
+ {
+ return FALSE;
+ }
+ else if (((prog != 0) || (lay != 0)) &&
(bs.GetBits(1) != 0))
readAudioSpec = FALSE;
@@ -643,32 +942,61 @@
}
streamInfo.SetAudioSpec(as);
-
+ ulLeft = bs.BitsLeft();
+ if (ulLeft < 3)
+ {
+ return FALSE;
+ }
streamInfo.SetLengthType(bs.GetBits(3));
switch (streamInfo.GetLengthType()) {
case 0 :
+ ulLeft = bs.BitsLeft();
+ if (ulLeft < 6)
+ {
+ return FALSE;
+ }
streamInfo.SetBlockDelay(bs.GetBits(5));
if (bs.GetBits(1))
{
+ ulLeft = bs.BitsLeft();
+ if (ulLeft < 8)
+ {
+ return FALSE;
+ }
streamInfo.SetFracDelayPresent(TRUE);
streamInfo.SetFracDelay(bs.GetBits(8));
}
break;
case 1 :
+ ulLeft = bs.BitsLeft();
+ if (ulLeft < 9)
+ {
+ return FALSE;
+ }
streamInfo.SetFrameLength(bs.GetBits(9));
break;
case 3 :
case 4 :
case 5 :
+ ulLeft = bs.BitsLeft();
+ if (ulLeft < 6)
+ {
+ return FALSE;
+ }
streamInfo.SetCELPIndex(bs.GetBits(6));
break;
case 6 :
case 7 :
+ ulLeft = bs.BitsLeft();
+ if (ulLeft < 1)
+ {
+ return FALSE;
+ }
streamInfo.SetHVXCIndex(bs.GetBits(1));
break;
};
@@ -681,20 +1009,30 @@
return !failed;
}
-ULONG32 MP4AMuxConfig::LatmGetValue(Bitstream&bs, ULONG32& nBits)
+HXBOOL MP4AMuxConfig::LatmGetValue(Bitstream&bs, ULONG32& nBits, ULONG32& ulValue)
{
- ULONG32 ulValue = 0;
+ HXBOOL failed = FALSE;
+ UINT32 ulLeft =bs.BitsLeft();
+ if (ulLeft < 2)
+ {
+ return FALSE;
+ }
ULONG32 ulBytesForValue = bs.GetBits(2);
nBits += 2;
for (ULONG32 i=0; i<=ulBytesForValue; i++)
{
ulValue << 8;
+ ulLeft =bs.BitsLeft();
+ if (ulLeft < 8)
+ {
+ return FALSE;
+ }
ulValue += bs.GetBits(8);
nBits += 8;
}
- return ulValue;
+ return !failed;
}
void MP4AMuxConfig::Reset()
Index: pub/amr-depack.h
===================================================================
RCS file: /cvsroot/datatype/mp4/payload/pub/amr-depack.h,v
retrieving revision 1.5
diff -u -w -r1.5 amr-depack.h
--- pub/amr-depack.h 14 Mar 2005 19:17:45 -0000 1.5
+++ pub/amr-depack.h 10 Nov 2008 13:08:46 -0000
@@ -83,8 +83,8 @@
protected:
HXBOOL UpdateIleavInfo(ULONG32 ulILL, ULONG32 ulILP, ULONG32 ulTime);
- void GetTOCInfo(Bitstream& bs, AMRTOCInfo& tocInfo);
- void SkipCRCInfo(Bitstream& bs, const AMRTOCInfo& tocInfo);
+ HXBOOL GetTOCInfo(Bitstream& bs, AMRTOCInfo& tocInfo);
+ HXBOOL SkipCRCInfo(Bitstream& bs, const AMRTOCInfo& tocInfo);
void UpdateBlockCount(ULONG32 ulBlockCount);
@@ -98,7 +98,7 @@
ULONG32 ulChannels);
// Copies robust sorted frame data to m_blockBuf
- void SortedCopy(Bitstream& bs, ULONG32 ulStartBlock, ULONG32 ulBlockInc,
+ HXBOOL SortedCopy(Bitstream& bs, ULONG32 ulStartBlock, ULONG32 ulBlockInc,
const AMRTOCInfo& tocInfo);
void DispatchBlocks(ULONG32 ulTimestamp);
Index: pub/mp4-latm-depack.h
===================================================================
RCS file: /cvsroot/datatype/mp4/payload/pub/mp4-latm-depack.h,v
retrieving revision 1.4
diff -u -w -r1.4 mp4-latm-depack.h
--- pub/mp4-latm-depack.h 27 Jun 2006 14:59:48 -0000 1.4
+++ pub/mp4-latm-depack.h 10 Nov 2008 13:08:47 -0000
@@ -78,7 +78,7 @@
HXBOOL HandleMuxConfig(Bitstream& bs);
HXBOOL GetPayloadLengths(Bitstream& bs);
- void GetPayloads(Bitstream& bs, ULONG32 ulTime);
+ HXBOOL GetPayloads(Bitstream& bs, ULONG32 ulTime);
private:
ULONG32 m_ulSampleRate;
Index: pub/mp4a-mux-cfg.h
===================================================================
RCS file: /cvsroot/datatype/mp4/payload/pub/mp4a-mux-cfg.h,v
retrieving revision 1.7
diff -u -w -r1.7 mp4a-mux-cfg.h
--- pub/mp4a-mux-cfg.h 14 Aug 2007 21:59:19 -0000 1.7
+++ pub/mp4a-mux-cfg.h 10 Nov 2008 13:08:47 -0000
@@ -50,13 +50,13 @@
MP4AAudioSpec& operator=(const MP4AAudioSpec& rhs);
HXBOOL Unpack(Bitstream& bs, ULONG32 nBits);
- ULONG32 GetAudioObjectType(Bitstream& bs);
+ HXBOOL GetAudioObjectType(Bitstream& bs, ULONG32& AudioObjectType);
HXBOOL AudioSpecificConfigRead(Bitstream& bs, ULONG32 nBits);
- void GASpecificConfigRead(Bitstream& bs,
+ HXBOOL GASpecificConfigRead(Bitstream& bs,
UINT32 samplingFrequency,
UINT32 ChannelConfiguration,
UINT32 AudioObjectType);
- void PCERead(Bitstream& bs);
+ HXBOOL PCERead(Bitstream& bs);
HXBOOL SBRPresent(UINT8* pConfig, UINT32 ulConfigSize, HXBOOL& bSBR);
ULONG32 GetBaseConfigSize();
const UINT8* Config() const;
@@ -139,7 +139,7 @@
protected :
void Reset();
void AddStream(const MP4AStreamInfo& info);
- ULONG32 LatmGetValue(Bitstream& bs, ULONG32& nBits);
+ HXBOOL LatmGetValue(Bitstream& bs, ULONG32& nBits, ULONG32& ulValue);
private:
HXBOOL m_bAllSameTiming;
-------------- next part --------------
Index: bitpack.cpp
===================================================================
RCS file: /cvsroot/datatype/common/util/bitpack.cpp,v
retrieving revision 1.5
diff -u -w -r1.5 bitpack.cpp
--- bitpack.cpp 6 Jul 2007 22:00:23 -0000 1.5
+++ bitpack.cpp 10 Nov 2008 13:06:01 -0000
@@ -96,21 +96,33 @@
}
}
-void BitPacker::PackBits(const UINT8* pBuf, ULONG32 bitCount,
+HX_RESULT BitPacker::PackBits(const UINT8* pBuf, ULONG32 bitCount,
ULONG32 ulStartOffset)
{
// Reference implementation
Bitstream bs;
- bs.SetBuffer(pBuf);
+ ULONG32 ulSize = ( bitCount % 8 ) != 0 ? ( bitCount /8 ) + 1 : ( bitCount /8);
+ bs.SetBuffer(pBuf, ulSize);
+ UINT32 ulLeft = bs.BitsLeft();
+ if (ulLeft < ulStartOffset)
+ {
+ return HXR_FAIL;
+ }
bs.GetBits(ulStartOffset);
+ ulLeft = bs.BitsLeft();
+ if (ulLeft < (UINT32) bitCount)
+ {
+ return HXR_FAIL;
+ }
while(bitCount)
{
int bits = (bitCount > 8) ? 8 : bitCount;
PackBits(bs.GetBits(bits), bits);
bitCount -= bits;
}
+ return HXR_OK;
}
UINT32 BitPacker::ByteAlign()
Index: bitstream.cpp
===================================================================
RCS file: /cvsroot/datatype/common/util/bitstream.cpp,v
retrieving revision 1.7
diff -u -w -r1.7 bitstream.cpp
--- bitstream.cpp 6 Jul 2007 22:00:23 -0000 1.7
+++ bitstream.cpp 10 Nov 2008 13:06:01 -0000
@@ -74,11 +74,13 @@
m_pCur(0),
m_bitBuf(0),
m_bitCount(0),
- m_ulBufSize(0)
+ m_ulBufSize(0),
+ m_ulBufSizeBits(0)
{}
-void Bitstream::SetBuffer(const UINT8* pBuf)
+void Bitstream::SetBuffer(const UINT8* pBuf, ULONG32 ulBufSize )
{
+ SetBufSize(ulBufSize);
m_pBuf = pBuf;
m_pCur = m_pBuf;
}
@@ -91,6 +93,7 @@
void Bitstream::SetBufSize(ULONG32 ulBufSize)
{
m_ulBufSize = ulBufSize;
+ m_ulBufSizeBits = ulBufSize<<3;
}
ULONG32 Bitstream::GetBufSize(void)
@@ -113,6 +116,7 @@
m_bitCount = 8 - (bitCount - m_bitCount);
}
+ m_ulBufSizeBits -= bitCount;
return ret;
}
@@ -166,3 +170,9 @@
GetBits(bitCount);
}
+
+UINT32 Bitstream::BitsLeft(void)
+{
+ return m_ulBufSizeBits;
+}
+
Index: pub/bitpack.h
===================================================================
RCS file: /cvsroot/datatype/common/util/pub/bitpack.h,v
retrieving revision 1.4
diff -u -w -r1.4 bitpack.h
--- pub/bitpack.h 6 Jul 2007 22:00:24 -0000 1.4
+++ pub/bitpack.h 10 Nov 2008 13:06:01 -0000
@@ -51,14 +51,14 @@
#define BITPACK_H
#include "hxtypes.h"
-
+#include "hxresult.h"
class BitPacker
{
public:
BitPacker(UINT8* pBuf, ULONG32 ulBufSize);
void PackBits(UINT32 bits, ULONG32 bitCount);
- void PackBits(const UINT8* pBuf, ULONG32 bitCount,
+ HX_RESULT PackBits(const UINT8* pBuf, ULONG32 bitCount,
ULONG32 ulStartOffset);
UINT32 ByteAlign();
Index: pub/bitstream.h
===================================================================
RCS file: /cvsroot/datatype/common/util/pub/bitstream.h,v
retrieving revision 1.4
diff -u -w -r1.4 bitstream.h
--- pub/bitstream.h 6 Jul 2007 22:00:24 -0000 1.4
+++ pub/bitstream.h 10 Nov 2008 13:06:02 -0000
@@ -57,7 +57,7 @@
public:
Bitstream();
- void SetBuffer(const UINT8* pBuf);
+ void SetBuffer(const UINT8* pBuf, ULONG32 ulBufSize);
const UINT8* GetBuffer(void);
void SetBufSize(ULONG32 ulBufSize);
ULONG32 GetBufSize(void);
@@ -68,6 +68,7 @@
ULONG32 PeekBits(ULONG32 bitCount);
void FlushBits(ULONG32 bitCount);
+ UINT32 BitsLeft(void);
private:
const UINT8* m_pBuf;
@@ -76,6 +77,7 @@
ULONG32 m_bitBuf;
ULONG32 m_bitCount;
ULONG32 m_ulBufSize;
+ ULONG32 m_ulBufSizeBits;
};
#endif // BITSTREAM_H
Index: test/tbitpack.cpp
===================================================================
RCS file: /cvsroot/datatype/common/util/test/tbitpack.cpp,v
retrieving revision 1.3
diff -u -w -r1.3 tbitpack.cpp
--- test/tbitpack.cpp 6 Jul 2007 22:00:24 -0000 1.3
+++ test/tbitpack.cpp 10 Nov 2008 13:06:02 -0000
@@ -163,14 +163,23 @@
Bitstream unpack;
- unpack.SetBuffer(buf);
+ unpack.SetBuffer(buf, BUFFER_SIZE);
+ UINT32 ulLeft = 0;
for (int j = 0; !failed && (j < VALUE_CT); j++)
{
int bitCount = GetBitCount(31);
int expected = GetValue(j, bitCount);
- int peekVal = unpack.PeekBits(bitCount);
- int getVal = unpack.GetBits(bitCount);
+
+ int peekVal = 0;
+ int getVal = 0;
+ ulLeft = unpack.BitsLeft();
+
+ if ( ulLeft >= (UINT32) bitCount )
+ {
+ peekVal = unpack.PeekBits(bitCount);
+ getVal = unpack.GetBits(bitCount);
+ }
if (expected != peekVal)
{
@@ -211,8 +220,8 @@
Bitstream baseStream;
Bitstream expectStream;
- baseStream.SetBuffer(buf);
- expectStream.SetBuffer(buf);
+ baseStream.SetBuffer(buf, MaxBufferSize);
+ expectStream.SetBuffer(buf, MaxBufferSize);
int bitCount = 0;
@@ -221,14 +230,27 @@
int maxBits = (bitsLeft > MaxBitCount) ? MaxBitCount : bitsLeft;
bitCount = GetBitCount(maxBits);
-
+ UINT32 ulLeft = baseStream.BitsLeft();
+ if ( ulLeft >= (UINT32) bitCount )
+ {
baseStream.GetBits(bitCount, tmpBuffer);
+ }
+ else
+ {
+ failed = TRUE;
+ }
int tmpBitCount = bitCount;
for (int i = 0; !failed && tmpBitCount; i++)
{
int a = (tmpBitCount > 8) ? 8 : tmpBitCount;
- ULONG32 expect = expectStream.GetBits(a);
+ ulLeft = expectStream.BitsLeft();
+ ULONG32 expect = 0;
+ if ( ulLeft >= (UINT32) a )
+ {
+ expect = expectStream.GetBits(a);
+ }
+
ULONG32 result = tmpBuffer[i];
if (a < 8)
@@ -309,10 +331,19 @@
pack.PackBits(src, bitCount, 0);
Bitstream expectStream;
- expectStream.SetBuffer(dst);
+ expectStream.SetBuffer(dst, MaxBufSize);
+ UINT32 ulLeft = expectStream.BitsLeft();
+ if ( ulLeft >= offset )
+ {
expectStream.GetBits(offset);
+ }
+
+ ulLeft = expectStream.BitsLeft();
+ if ( ulLeft >= (UINT32) bitCount )
+ {
expectStream.GetBits(bitCount, expectBuf);
+ }
failed = !CompareBuffers(src, expectBuf, bitCount);
}
@@ -320,6 +351,66 @@
return !failed;
}
+bool RunTest4(int run)
+{
+ printf ("RunTest4(%d)\n", run);
+
+ bool failed = false;
+
+ // This tests the buffer BitsLeft(), PeekBits() operation
+ const int MaxBufferSize = 100;
+ const int MaxBufferBits = 8 * MaxBufferSize;
+ const int MaxByteCount = MaxBufferSize / 2;
+ const int MaxBitCount = MaxByteCount * 8;
+ UINT32 BitsLeft = MaxBufferBits;
+
+ UINT8 buf[MaxBufferSize];
+ GenBuffer(buf, MaxBufferSize);
+
+ Bitstream baseStream0;
+ Bitstream baseStream1;
+
+ baseStream0.SetBuffer(buf, MaxBufferSize);
+ baseStream1.SetBuffer(buf, MaxBufferSize);
+
+
+ int bitCount = 0;
+ for (int bitsLeft = MaxBufferBits; !failed && bitsLeft; bitsLeft -= bitCount)
+ {
+ int maxBits = (bitsLeft > MaxBitCount) ? MaxBitCount : bitsLeft;
+
+ bitCount = GetBitCount(maxBits);
+ bitCount = (bitCount > 32) ? (bitCount-8) : bitCount;
+ if (bitCount >32)
+ {
+ bitCount = 32;
+ }
+ UINT32 ulLeft = baseStream0.BitsLeft();
+
+ if ( ulLeft >= (UINT32) bitCount )
+ {
+ baseStream0.GetBits(bitCount);
+ BitsLeft -= bitCount;
+ }
+ ulLeft = baseStream1.BitsLeft();
+
+ if ( ulLeft >= (UINT32) bitCount )
+ {
+ baseStream1.PeekBits(bitCount);
+ }
+ ulLeft = baseStream0.BitsLeft();
+ UINT32 ulLeft1 = baseStream1.BitsLeft();
+ if ((BitsLeft != ulLeft) && (ulLeft1 != MaxBufferBits) )
+ {
+ printf ("bits left %d expect %02x got %02x\n",
+ run, BitsLeft, ulLeft);
+ failed = true;
+ }
+ }
+
+ return !failed;
+}
+
int main (int argc, char* argv[])
{
int ret = 0;
@@ -328,7 +419,8 @@
{
if (!RunTest(i) ||
!RunTest2(i) ||
- !RunTest3(i))
+ !RunTest3(i) ||
+ !RunTest4(i))
{
ret = -1;
break;
-------------- next part --------------
Index: ADIFfile.cpp
===================================================================
RCS file: /cvsroot/datatype/aac/fileformat/ADIFfile.cpp,v
retrieving revision 1.7
diff -u -w -r1.7 ADIFfile.cpp
--- ADIFfile.cpp 30 Jan 2006 21:10:58 -0000 1.7
+++ ADIFfile.cpp 10 Nov 2008 13:06:41 -0000
@@ -40,6 +40,7 @@
#include "dllpath.h"
#include "netbyte.h"
#include "aacparser.h"
+#include "hxtlogutil.h"
#if !defined(HELIX_FEATURE_DLLACCESS_CLIENT)
ENABLE_DLLACCESS_PATHS(mp4arend);
@@ -222,7 +223,12 @@
{
return HXR_FAIL;
}
- m_ulIndex += ParseADIFHeader(pAudioSpecificConfig);
+ UINT16 unADIFHeaderSize=0;
+ if (FAILED(ParseADIFHeader(pAudioSpecificConfig, unADIFHeaderSize)))
+ {
+ return HXR_FAIL;
+ }
+ m_ulIndex += unADIFHeaderSize;
m_pAACParser->SetAudioObjectType(pAudioSpecificConfig[0] >> 3);
m_pAACParser->SetSamplingFrequencyIndex(m_unSamplingFrequencyIndex);
retVal = m_pCommonClassFactory->CreateInstance(CLSID_IHXBuffer, (void**)&m_pOpaqueData);
@@ -270,7 +276,11 @@
{
// Go back and add explicit SBR signal to AudioSpecificConfig.
// Otherwise, decoder wrapper won't know about SBR at init.
- AddSBRExtension(pDestinationBuffer+1);
+ HX_RESULT resVal = AddSBRExtension(pDestinationBuffer+1, MAX_SIZE_AUDIO_SPECIFIC_CONFIG);
+ if (FAILED(resVal))
+ {
+ HXLOGL1("Failed to add explicit SBR signal to AudioSpecificConfig");
+ }
}
}
else
@@ -339,11 +349,10 @@
}
-UINT16 CADIFFile::ParseADIFHeader(REF(UINT8*) pAudioSpecificConfig)
+HX_RESULT CADIFFile::ParseADIFHeader(REF(UINT8*) pAudioSpecificConfig, UINT16& unADIFHeaderSize)
{
UINT16 i = 0;
UINT16 j = 0;
- UINT16 unADIFHeaderSize = 0;
UINT16 unProgConfigSize = 0;
UINT16 unBitStreamType = 0;
UINT16 unBitstreamType = 0;
@@ -363,15 +372,29 @@
Bitstream bs;
BitPacker progConfig(pAudioSpecificConfig, MAX_SIZE_AUDIO_SPECIFIC_CONFIG);
- bs.SetBuffer(pBuf);
-
+ bs.SetBuffer(pBuf, m_pBuffer->GetSize());
+ UINT32 ulLeft = bs.BitsLeft();
+ if (ulLeft < 33)
+ {
+ return HXR_FAIL;
+ }
bs.GetBits(32); // ADIF ID
unADIFHeaderSize += 33;
if (bs.GetBits(1)) // copyright ID present
{
+ ulLeft = bs.BitsLeft();
+ if (ulLeft < 72)
+ {
+ return HXR_FAIL;
+ }
bs.GetBits(72); // Copyright ID
unADIFHeaderSize += 72;
}
+ ulLeft = bs.BitsLeft();
+ if (ulLeft < 30)
+ {
+ return HXR_FAIL;
+ }
bs.GetBits(1); // Original copy
bs.GetBits(1); // home
unBitstreamType = (UINT16)bs.GetBits(1); // Bitstream Type
@@ -383,6 +406,11 @@
unADIFHeaderSize += 30;
if (unBitstreamType == 0)
{
+ ulLeft = bs.BitsLeft();
+ if (ulLeft < 20)
+ {
+ return HXR_FAIL;
+ }
bs.GetBits(20); // adif buffer fullness
unADIFHeaderSize += 20;
}
@@ -392,7 +420,11 @@
// parsing code that handles the audio specific config data later on would surely
// get off track at the byte alignment step before the comment field data.
// So, we repack the pce after writing the first 16 bits of AudioSpecificConfig...
-
+ ulLeft = bs.BitsLeft();
+ if (ulLeft < 32)
+ {
+ return HXR_FAIL;
+ }
ulElementInstanceTag = bs.GetBits(4); // unpack element instance tag
m_unAudioObjectType = (UINT8)bs.GetBits(2) + 1; // unpack object type
m_unSamplingFrequencyIndex = (UINT16)bs.GetBits(4); // unpack sampling frequency index
@@ -427,51 +459,108 @@
progConfig.PackBits(flag, 1);
if (flag == 1) // mono mixdown present
{
+ ulLeft = bs.BitsLeft();
+ if (ulLeft < 4)
+ {
+ return HXR_FAIL;
+ }
progConfig.PackBits(bs.GetBits(4), 4); // unpack/pack mono mixdown element number
unProgConfigSize += 4;
}
+ ulLeft = bs.BitsLeft();
+ if (ulLeft < 1)
+ {
+ return HXR_FAIL;
+ }
flag = bs.GetBits(1);
progConfig.PackBits(flag, 1);
if (flag == 1) // stereo mixdown present
{
+ ulLeft = bs.BitsLeft();
+ if (ulLeft < 4)
+ {
+ return HXR_FAIL;
+ }
progConfig.PackBits(bs.GetBits(4), 4); // unpack/pack stereo mixdown element number
unProgConfigSize += 4;
}
+ ulLeft = bs.BitsLeft();
+ if (ulLeft < 1)
+ {
+ return HXR_FAIL;
+ }
+
flag = bs.GetBits(1);
progConfig.PackBits(flag, 1);
if (flag == 1) // matrix mixdown present
{
+ ulLeft = bs.BitsLeft();
+ if (ulLeft < 3)
+ {
+ return HXR_FAIL;
+ }
progConfig.PackBits(bs.GetBits(3), 3); // unpack/pack matrix mixdown element info
unProgConfigSize += 3;
}
for (i=0; i < numFrontChannels; i++)
{
+ ulLeft = bs.BitsLeft();
+ if (ulLeft < 5)
+ {
+ return HXR_FAIL;
+ }
+
progConfig.PackBits(bs.GetBits(5), 5); // unpack/pack front element bits
unProgConfigSize += 5;
}
for (i=0; i < numSideChannels; i++)
{
+ ulLeft = bs.BitsLeft();
+ if (ulLeft < 5)
+ {
+ return HXR_FAIL;
+ }
progConfig.PackBits(bs.GetBits(5), 5); // unpack/pack side element bits
unProgConfigSize += 5;
}
for (i=0; i < numBackChannels; i++)
{
+ ulLeft = bs.BitsLeft();
+ if (ulLeft < 5)
+ {
+ return HXR_FAIL;
+ }
progConfig.PackBits(bs.GetBits(5), 5); // unpack/pack back element bits
unProgConfigSize += 5;
}
for (i=0; i < numLFEChannels; i++)
{
+ ulLeft = bs.BitsLeft();
+ if (ulLeft < 4)
+ {
+ return HXR_FAIL;
+ }
progConfig.PackBits(bs.GetBits(4), 4); // unpack/pack lfe element bits
unProgConfigSize += 4;
}
for (i=0; i < numASSOCdata; i++)
{
+ ulLeft = bs.BitsLeft();
+ if (ulLeft < 4)
+ {
+ return HXR_FAIL;
+ }
progConfig.PackBits(bs.GetBits(4), 4); // unpack/pack assoc data element bits
unProgConfigSize += 4;
}
for (i=0; i < numCCElements; i++)
{
+ ulLeft = bs.BitsLeft();
+ if (ulLeft < 5)
+ {
+ return HXR_FAIL;
+ }
progConfig.PackBits(bs.GetBits(5), 5); // unpack/pack cc element bits
unProgConfigSize += 5;
}
@@ -480,6 +569,11 @@
i = 8 - ((unADIFHeaderSize + unProgConfigSize - 16) & 0x7);
if (i != 8)
{
+ ulLeft = bs.BitsLeft();
+ if (ulLeft < unADIFalign)
+ {
+ return HXR_FAIL;
+ }
unADIFalign = i;
bs.GetBits(unADIFalign);
}
@@ -493,11 +587,21 @@
}
// Exclude comment field from config data
+ ulLeft = bs.BitsLeft();
+ if (ulLeft < 8)
+ {
+ return HXR_FAIL;
+ }
numCommentBytes = (UINT16)bs.GetBits(8); // unpack comment field length
progConfig.PackBits(0, 8); // pack comment field length (always zero)
unProgConfigSize += 8;
for (i=0; i < numCommentBytes; i++)
{
+ ulLeft = bs.BitsLeft();
+ if (ulLeft < 8)
+ {
+ return HXR_FAIL;
+ }
bs.GetBits(8); // unpack comment bytes
}
@@ -507,7 +611,7 @@
// Compute ADIF header size
unADIFHeaderSize = (unADIFHeaderSize + unADIFalign + unProgConfigSize - 16 + numCommentBytes*8)>>3;
- return unADIFHeaderSize;
+ return HXR_OK;
}
@@ -565,7 +669,7 @@
}
-HX_RESULT CADIFFile::AddSBRExtension(UINT8* pAudioSpecificConfig)
+HX_RESULT CADIFFile::AddSBRExtension(UINT8* pAudioSpecificConfig, UINT32 ulSize)
{
UINT32 ulAudioObjectType = 0;
UINT32 ulSampFreq = 0;
@@ -573,7 +677,7 @@
UCHAR extensionBits[6];
BitPacker exBits(extensionBits, 6);
Bitstream bs;
- bs.SetBuffer(pAudioSpecificConfig);
+ bs.SetBuffer(pAudioSpecificConfig, ulSize);
// Write extension bits to end of config data (assume byte aligned)
// syncExtensionType : 0x2b7 (11 bits)
@@ -588,8 +692,12 @@
// Pack sbrPresentFlag (1 bit)
exBits.PackBits(0x1, 1);
-
+ UINT32 ulLeft = bs.BitsLeft();
// Get sample rate config data
+ if (ulLeft < 9)
+ {
+ return HXR_FAIL;
+ }
ulAudioObjectType = bs.GetBits(5); // audioObjectType
ulSampFreqIndex = bs.GetBits(4); // samplingFrequencyIndex
@@ -598,6 +706,11 @@
// Pack extensionSamplingFrequencyIndex (4 bits)
exBits.PackBits(ulSampFreqIndex, 4);
// Pack extensionSamplingFrequency (24 bits)
+ ulLeft = bs.BitsLeft();
+ if (ulLeft < 24)
+ {
+ return HXR_FAIL;
+ }
ulSampFreqExt = bs.GetBits(24) * 2; // extended sampling frequency
exBits.PackBits(ulSampFreqExt, 24);
}
Index: aacff.cpp
===================================================================
RCS file: /cvsroot/datatype/aac/fileformat/aacff.cpp,v
retrieving revision 1.38
diff -u -w -r1.38 aacff.cpp
--- aacff.cpp 8 Sep 2008 21:41:34 -0000 1.38
+++ aacff.cpp 10 Nov 2008 13:06:42 -0000
@@ -1245,7 +1245,7 @@
unBitsForMillisecondDeviation = pData[i];
i += 1;
- bs.SetBuffer(&pData[i]);
+ bs.SetBuffer(&pData[i], ulSize-i );
ulSize -= i;
ulTableSize = (ulSize << 3) /
(unBitsForByteDeviation + unBitsForMillisecondDeviation);
@@ -1266,8 +1266,14 @@
}
for (i = 0,j = 0; j < ulTableSize && (i >> 3) < ulSize; j++)
{
+ UINT32 ulLeft = 0;
if (unBitsForByteDeviation)
{
+ ulLeft = bs.BitsLeft();
+ if (ulLeft < unBitsForByteDeviation)
+ {
+ return HXR_FAIL;
+ }
ulNegative = bs.PeekBits(1);
ulTableValue = (INT32)bs.GetBits(unBitsForByteDeviation);
if (ulNegative)
@@ -1284,6 +1290,11 @@
}
if (unBitsForMillisecondDeviation)
{
+ ulLeft = bs.BitsLeft();
+ if (ulLeft < unBitsForMillisecondDeviation)
+ {
+ return HXR_FAIL;
+ }
ulNegative = bs.PeekBits(1);
ulTableValue = (INT32)bs.GetBits(unBitsForMillisecondDeviation);
if (ulNegative)
Index: aacfiletypes.h
===================================================================
RCS file: /cvsroot/datatype/aac/fileformat/aacfiletypes.h,v
retrieving revision 1.7
diff -u -w -r1.7 aacfiletypes.h
--- aacfiletypes.h 6 Jun 2005 17:56:38 -0000 1.7
+++ aacfiletypes.h 10 Nov 2008 13:06:42 -0000
@@ -287,8 +287,8 @@
IHXCommonClassFactory* pCommonClassFactory,
IUnknown* pContext,
UINT8 uID3version);
- UINT16 ParseADIFHeader(REF(UINT8*)pAudioSpecificConfig);
- HX_RESULT AddSBRExtension(UINT8* pAudioSpecificConfig);
+ HX_RESULT ParseADIFHeader(REF(UINT8*)pAudioSpecificConfig, UINT16& unADIFHeaderSize);
+ HX_RESULT AddSBRExtension(UINT8* pAudioSpecificConfig, UINT32 ulsize);
UINT32 GetMetaDataSize(UCHAR* pFrameBuffer);
};
-------------- next part --------------
Index: h263pyld.cpp
===================================================================
RCS file: /cvsroot/datatype/h263/payload/h263pyld.cpp,v
retrieving revision 1.9
diff -u -w -r1.9 h263pyld.cpp
--- h263pyld.cpp 6 Jul 2007 22:00:33 -0000 1.9
+++ h263pyld.cpp 10 Nov 2008 13:07:27 -0000
@@ -360,9 +360,18 @@
static HX_RESULT HandleH263Plus(Bitstream& bs, HXxSize &FrameDim)
{
HX_RESULT res = HXR_UNEXPECTED;
-
+ UINT32 ulLeft = bs.BitsLeft();
+ if (ulLeft < 3)
+ {
+ return res;
+ }
if (bs.GetBits(3) == 1) // UFEP
{
+ ulLeft = bs.BitsLeft();
+ if (ulLeft < 3)
+ {
+ return res;
+ }
int fmt = bs.GetBits(3); // OPPTYPE (bits 1-3)
if (fmt != 0x6)
@@ -370,16 +379,42 @@
else
{
// This frame has custom dimensions
-
+ ulLeft = bs.BitsLeft();
+ if (ulLeft < 15)
+ {
+ return res;
+ }
bs.GetBits(11) ; // OPPTYPE (bits 4-14)
if (bs.GetBits(4) == 0x8) // OPPTYPE (bits 15-18)
{
+ ulLeft = bs.BitsLeft();
+ if (ulLeft < 9)
+ {
+ return res;
+ }
bs.GetBits(6); // MPPTYPE (bits 1-6)
if (bs.GetBits(3) == 0x1) // MPPTYPE (bits 7-9)
{
+ ulLeft = bs.BitsLeft();
+ if (ulLeft < 1)
+ {
+ return res;
+ }
if (bs.GetBits(1)) // CPM
+ {
+ ulLeft = bs.BitsLeft();
+ if (ulLeft < 2)
+ {
+ return res;
+ }
bs.GetBits(2); // PSBI
+ }
+ ulLeft = bs.BitsLeft();
+ if (ulLeft < 14)
+ {
+ return res;
+ }
bs.GetBits(4); // CPFMT (bits 1-4)
@@ -387,6 +422,12 @@
if (bs.GetBits(1)) // CPFMT (bit 14)
{
+ ulLeft = bs.BitsLeft();
+ if (ulLeft < 9)
+ {
+ return res;
+ }
+
int phi = (bs.GetBits(9)) * 4;
if ((phi >= 1) && (phi <= 288))
@@ -411,17 +452,30 @@
HX_RESULT res = HXR_UNEXPECTED;
Bitstream bs;
-
+ UINT32 ulLeft = 0;
if (pBuffer->GetSize() >= 5)
{
- bs.SetBuffer(pBuffer->GetBuffer());
-
+ bs.SetBuffer(pBuffer->GetBuffer(), pBuffer->GetSize());
+ ulLeft = bs.BitsLeft();
+ if (ulLeft < 22)
+ {
+ return res;
+ }
if (bs.GetBits(22) == 0x20) // Check PSC
{
+ ulLeft = bs.BitsLeft();
+ if (ulLeft < 10)
+ {
+ return res;
+ }
bs.GetBits(8); // Skip TR
-
if (bs.GetBits(2) == 0x02) // PTYPE(bits 1 & 2)
{
+ ulLeft =bs.BitsLeft();
+ if (ulLeft < 6)
+ {
+ return res;
+ }
bs.GetBits(3); // PTYPE(bits 3-5)
int fmt = bs.GetBits(3); // Get Format
Index: rfc2190hlpr.cpp
===================================================================
RCS file: /cvsroot/datatype/h263/payload/rfc2190hlpr.cpp,v
retrieving revision 1.4
diff -u -w -r1.4 rfc2190hlpr.cpp
--- rfc2190hlpr.cpp 6 Jul 2007 22:00:33 -0000 1.4
+++ rfc2190hlpr.cpp 10 Nov 2008 13:07:27 -0000
@@ -130,7 +130,7 @@
{
HX_RESULT res = HXR_FAILED;
- bp.PackBits(m_pPayload, m_ulDataSize, m_ulStartOffset);
+ res = bp.PackBits(m_pPayload, m_ulDataSize, m_ulStartOffset);
return res;
}
Index: rfc2429hlpr.cpp
===================================================================
RCS file: /cvsroot/datatype/h263/payload/rfc2429hlpr.cpp,v
retrieving revision 1.5
diff -u -w -r1.5 rfc2429hlpr.cpp
--- rfc2429hlpr.cpp 6 Jul 2007 22:00:33 -0000 1.5
+++ rfc2429hlpr.cpp 10 Nov 2008 13:07:27 -0000
@@ -137,6 +137,6 @@
if (m_bP)
bp.PackBits(0,16);
- bp.PackBits(m_pPayload, m_ulPayloadSize, 0);
- return HXR_OK;
+ HX_RESULT retVal = bp.PackBits(m_pPayload, m_ulPayloadSize, 0);
+ return retVal;
}
From ehyche at real.com Mon Nov 10 07:18:37 2008
From: ehyche at real.com (Eric Hyche)
Date: Mon Nov 10 05:22:41 2008
Subject: [datatype-dev] RE: [Client-dev] CR: Fix for AAC and its extenssion
type (eAAC+etc) audio clips issue with hardware accelerated
codecs in HEADbranch.
In-Reply-To: <03528B6E301B3B42833693425F0A49F701EAE2D0@daebe102.NOE.Nokia.com>
References: <03528B6E301B3B42833693425F0A49F701EADE09@daebe102.NOE.Nokia.com><00b801c94047$17db6640$479232c0$@com>
<03528B6E301B3B42833693425F0A49F701EADF11@daebe102.NOE.Nokia.com>
<03528B6E301B3B42833693425F0A49F701EAE2D0@daebe102.NOE.Nokia.com>
Message-ID: <007201c94347$9c157240$d44056c0$@com>
HXAudioSession::SetAudioPushdown() is correctly setting
m_ulTargetPushdown. m_ulTargetPushdown is the "desired" or
nominal pushdown value, while m_ulMinimumPushdown is the
absolute minimum pushdown we want to allow. So when calling
HXAudioSession::SetAudioPushdown(), the user of the audio session
is supposed to be setting the nominal value, not the minimum.
Eric
=======================================
Eric Hyche (ehyche@real.com)
Principal Engineer
RealNetworks, Inc.
>-----Original Message-----
>From: ext-asheesh.srivastava@nokia.com [mailto:ext-asheesh.srivastava@nokia.com]
>Sent: Friday, November 07, 2008 1:11 PM
>To: ext-asheesh.srivastava@nokia.com; ehyche@real.com; client-dev@helixcommunity.org; datatype-
>dev@helixcommunity.org
>Subject: RE: [Client-dev] CR: Fix for AAC and its extenssion type (eAAC+etc) audio clips issue with
>hardware accelerated codecs in HEADbranch.
>
>Hi Eric,
>
>After analyzing more, I noticed, HXAudioSession::SetAudioPushdown(UINT32
>ulMinimumPushdown) function is to set
>the minimum audio push down value, however it is modifying
>m_ulTargetPushdown member, not m_ulMinimumPushdown.
>I feel the correct implementation should modify m_ulMinimumPushdown.
>
>- m_ulTargetPushdown = (ulMinimumPushdown- MINIMUM_AUDIO_PUSHDOWN: ulMinimumPushdown;
>+ m_ulMinimumPushdown = (ulMinimumPushdown+ MINIMUM_AUDIO_PUSHDOWN : ulMinimumPushdown;
>
>Regards,
>- Asheesh
>
>
>>-----Original Message-----
>>From: client-dev-bounces@helixcommunity.org
>>[mailto:client-dev-bounces@helixcommunity.org] On Behalf Of
>>ext ext-asheesh.srivastava@nokia.com
>>Sent: Thursday, November 06, 2008 3:22 PM
>>To: ehyche@real.com; client-dev@helixcommunity.org;
>>datatype-dev@helixcommunity.org
>>Subject: RE: [Client-dev] CR: Fix for AAC and its extenssion
>>type (eAAC+etc) audio clips issue with hardware accelerated
>>codecs in HEADbranch.
>>
>>Hi Eric,
>>
>>Thanks for your input. Please find my observation.
>>
>>On emulator if I play any media clip which has AAC audio in
>>it, only 1st video frame appears and playback freezes. To fix
>>this emulator problem I made m_ulTargetPushdown changes.
>>
>>Reason for calculating m_ulTargetPushdown based on
>>TARGET_AUDIO_PUSHDOWN.
>>
>>1. MINIMUM_AUDIO_PUSHDOWN and TARGET_AUDIO_PUSHDOWN macros are
>>defined as # define MINIMUM_AUDIO_PUSHDOWN 200
>># define TARGET_AUDIO_PUSHDOWN 1000
>>
>>During CHXAudioSession::SetAudioPushdown call
>>ulMinimumPushdown has value of 120 which is less than
>>MINIMUM_AUDIO_PUSHDOWN, so m_ulTargetPushdown becomes 200.
>>Then It calls
>>CHXAudioSession::UpdateMinimumPushdown() where
>>m_ulTargetBlocksTobeQueued, m_ulMinBlocksTobeQueued etc are calculated.
>>
>>Helix log has these audio pushdown values for them -
>>Granularity: 50
>>Blocks at the minimum: 4
>>Blocks at start: 4
>>Blocks to grow to: 4
>>MS of data at minimum: 200
>>MS of data at start: 200
>>MS of data to grow to: 200
>>
>>2. In cayenne, above calculations are based on
>>m_ulMinimumPushdown which relies on MINIMUM_AUDIO_PUSHDOWN.
>>Comparing above values with cayenne,
>>
>>Audio pushdown values for cayenne -
>>Granularity: 50
>>Blocks at start: 4
>>Blocks to grow to: 20
>>MS of data at start: 200
>>MS of data to grow to: 1000
>>
>>'Blocks to grow to' and 'MS of data to grow to' have
>>different values in cayenne and HEAD.
>>
>>3. TARGET_AUDIO_PUSHDOWN and m_ulTargetPushdown are introduced
>>recently in HEAD branch and I think m_ulTargetPushdown needs
>>to be calculated based on TARGET_AUDIO_PUSHDOWN not
>>MINIMUM_AUDIO_PUSHDOWN.
>>
>>4. In HEAD, When I change MINIMUM_AUDIO_PUSHDOWN to
>>TARGET_AUDIO_PUSHDOWN in CHXAudioSession::SetAudioPushdown, it
>>fixes the emulator problem and works fine with DSP solution
>>also. Following audio pushdown values are found in log file -
>>
>>Audio pushdown values Report:
>>Granularity: 50
>>Blocks at the minimum: 4
>>Blocks at start: 4
>>Blocks to grow to: 20
>>MS of data at minimum: 200
>>MS of data at start: 200
>>MS of data to grow to: 1000
>>
>>Above values look similar to cayenne's value.
>>
>>Thanks,
>>- Asheesh
>>
>>
>>>-----Original Message-----
>>>From: ext Eric Hyche [mailto:ehyche@real.com]
>>>Sent: Thursday, November 06, 2008 1:37 PM
>>>To: Srivastava Asheesh (EXT-Infovision-MSW/Dallas);
>>>client-dev@helixcommunity.org; datatype-dev@helixcommunity.org
>>>Subject: RE: [Client-dev] CR: Fix for AAC and its extenssion type
>>>(eAAC+ etc) audio clips issue with hardware accelerated
>>codecs in HEAD
>>>branch.
>>>
>>>Asheesh:
>>>
>>>Here are my comments:
>>>
>>>- The changes for #5 below (in client/audiosvc/hxaudply.cpp) are
>>> not needed since you have made the changes in #3.
>>>- Why is this change needed?
>>>
>>>> - m_ulTargetPushdown =
>>>(ulMinimumPushdown>>> - MINIMUM_AUDIO_PUSHDOWN : ulMinimumPushdown;
>>>> + m_ulTargetPushdown =
>>>(ulMinimumPushdown>>> + TARGET_AUDIO_PUSHDOWN : ulMinimumPushdown;
>>>
>>>- datatype/mdf/audio/dsp/* changes look good.
>>>
>>>Eric
>>>
>>>
>>>=======================================
>>>Eric Hyche (ehyche@real.com)
>>>Principal Engineer
>>>RealNetworks, Inc.
>>>
>>>
>>>>-----Original Message-----
>>>>From: client-dev-bounces@helixcommunity.org
>>>>[mailto:client-dev-bounces@helixcommunity.org] On Behalf Of
>>>>ext-asheesh.srivastava@nokia.com
>>>>Sent: Thursday, November 06, 2008 1:51 PM
>>>>To: client-dev@helixcommunity.org; datatype-dev@helixcommunity.org
>>>>Subject: [Client-dev] CR: Fix for AAC and its extenssion type (eAAC+
>>>>etc) audio clips issue with hardware accelerated codecs in
>>>HEAD branch.
>>>>
>>>>
>>>>
>>>> "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: ext-asheesh.srivastava@nokia.com
>>>>
>>>> Reviewed by:
>>>>
>>>> Date: 11/06/2008
>>>>
>>>> Project: SymbianMmf_wm
>>>>
>>>> ErrorId: N/A
>>>>
>>>> Synopsis: AAC and its extenssion type (eAAC+
>>>etc) audio clips were
>>>>not playing for local playback/streaming when used with DSP
>>>decoder in HEAD branch.
>>>>
>>>> Overview:
>>>> Because of the reasons listed below, AAC and
>>>its extenssion type
>>>>audio clips were not playing when used with DSP decoder in
>>HEAD branch
>>>>
>>>> 1. CR - Enable eAAC+ error concealmeant was not
>>>propogated to HEAD.
>>>>It activates error concealment for eAAC+ clips when used with
>>>hardware decoders.
>>>>
>>>> 2. During
>>>CHXAudioSession::Resume(CHXAudioPlayer* pPlayerToExclude,
>>>>HXBOOL bRewindNeeded) call , bRewindNeeded gets enabled and
>>>that leads
>>>>call to
>>>>
>>>> RewindSession, which empties the audio device's
>>>buffer list and that
>>>>inturn adds filler
>>>>(silence) frames to the audio device and audio play-back gets stuck.
>>>>
>>>> Resume () was calling RewindSession() even if
>>>the audio session has
>>>>not pushed any data into the audio device.
>>>> A check is made based on m_dNumBytesWritten to
>>>skip RewindSession()
>>>>call if audio session has not pushed any data to it.
>>>>
>>>> 3. CHXMDFAudioDevice::CheckFormat(const
>>>HXAudioFormat* pAudioFormat)
>>>>function was not implemented.
>>>> This implementation now checks if the asked
>>>audio format is same as
>>>>the audio device's format when the device was created by the decoder.
>>>>
>>>> 4. Target audio pushdown was calculated based on
>>>>MINIMUM_AUDIO_PUSHDOWN in
>>>>CHXAudioSession::SetAudioPushdown() function.
>>>>
>>>> It should be calculated based on TARGET_AUDIO_PUSHDOWN.
>>>>
>>>> 5. Workaround in CHXAudioPlayer::Setup( ULONG32
>>>ulGranularity) for
>>>>keeping min. channel at stereo is no longer required.
>>>>
>>>> RA renderer used to only call
>>>IHXAudioStream::Init() on the first
>>>>substream when a
>>>>SureStream(multi-rate) stream was played.
>>>>
>>>> Then, as it received packets for other
>>>substreams, then it created
>>>>and Init'd those IHXAudioStreams.
>>>> However, the current RA renderer creates and
>>>Init's an IHXAudioStream for each substream.
>>>>So it would appear that this workaround is no longer needed.
>>>>
>>>> Files Modified:
>>>> /cvsroot/datatype/mdf/audio/dsp/mdfauddevice.cpp
>>>> /cvsroot/datatype/mdf/audio/dsp/mdfaudfmt.cpp
>>>> /cvsroot/datatype/mdf/audio/dsp/mdfaudfmt.h
>>>> /cvsroot/datatype/mdf/audio/dsp/mdfdevsound.cpp
>>>> /cvsroot/client/audiosvc/hxaudply.cpp
>>>> /cvsroot/client/audiosvc/hxaudses.cpp
>>>>
>>>> New files added:
>>>> None.
>>>>
>>>> Image Size and Heap Use impact: no major impact
>>>> Module Release testing (STIF)- After playing
>>>any clip, while exiting
>>>>helix engine crashes. It is a known issue and is introduced
>>>by some recent CR submission.
>>>>
>>>> Test case(s) Added : No.
>>>> Platforms and Profiles Build Verified:
>>>helix-client-s60-32-mmf-mdf-dsp
>>>> branch: helix_restricted
>>>> platform: symbian-91-armv5
>>>> target(s): symbianMmf_wm
>>>>
>>>> Branch: HEAD
>>>>
>>>> DIFF:
>>>>
>>>> Index: hxaudply.cpp
>>>>
>>>===================================================================
>>>> RCS file: /cvsroot/client/audiosvc/hxaudply.cpp,v
>>>> retrieving revision 1.58
>>>> diff -u -b -r1.58 hxaudply.cpp
>>>> --- hxaudply.cpp 20 Sep 2008 06:02:27
>>>-0000 1.58
>>>> +++ hxaudply.cpp 5 Nov 2008 23:06:07 -0000
>>>> @@ -1916,16 +1916,9 @@
>>>>
>>>> // Set the audio format for this Player.
>>>> m_PlayerFmt.uMaxBlockSize = maxBlocksize;
>>>> - // keep min. channel at stereo
>>>> - // this is a workaround for b#205546,
>>>the root cause of this is that we only
>>>> - // choose the audio format of the 1st
>>>audio stream when the playback is started
>>>> - // without audio, then audio clip is
>>>started at later time. For sure stream
>>>>audio,
>>>> - // the first audio stream is often the
>>>lowest quality, thus the audio device is
>>>> - // configured to play the lowest quality audio.
>>>> - //
>>>> - // proper fix requires the audio
>>>device is setup only after all audio streams
>>>> - // assoicated with the same clip have
>>>been registered
>>>> - m_PlayerFmt.uChannels =
>>>(maxChannels < 2) ? 2 : maxChannels;
>>>> +
>>>> + m_PlayerFmt.uChannels = maxChannels;
>>>> +
>>>> m_PlayerFmt.uBitsPerSample =
>>>maxBitsPerSample;
>>>>
>>>> // If user wants upsampling
>>>> Index: hxaudses.cpp
>>>>
>>>===================================================================
>>>> RCS file: /cvsroot/client/audiosvc/hxaudses.cpp,v
>>>> retrieving revision 1.81
>>>> diff -u -b -r1.81 hxaudses.cpp
>>>> --- hxaudses.cpp 18 Oct 2007 22:55:08
>>>-0000 1.81
>>>> +++ hxaudses.cpp 5 Nov 2008 23:06:07 -0000
>>>> @@ -2196,7 +2196,7 @@
>>>> if ((m_bPaused || m_bStoppedDuringPause) &&
>>>> (!m_pLastPausedPlayer ||
>>>(m_pLastPausedPlayer == pPlayerToExclude)))
>>>> {
>>>> - if (bRewindNeeded)
>>>> + if (bRewindNeeded && (m_dNumBytesWritten != 0))
>>>> {
>>>> RewindSession();
>>>> }
>>>> @@ -2962,8 +2962,8 @@
>>>> STDMETHODIMP
>>>CHXAudioSession::SetAudioPushdown(UINT32 ulMinimumPushdown)
>>>> {
>>>>
>>>> - m_ulTargetPushdown =
>>>(ulMinimumPushdown>>> - MINIMUM_AUDIO_PUSHDOWN : ulMinimumPushdown;
>>>> + m_ulTargetPushdown =
>>>(ulMinimumPushdown>>> + TARGET_AUDIO_PUSHDOWN : ulMinimumPushdown;
>>>>
>>>> UpdateMinimumPushdown();
>>>> Index: mdfauddevice.cpp
>>>>
>>>===================================================================
>>>> RCS file:
>>>/cvsroot/datatype/mdf/audio/dsp/mdfauddevice.cpp,v
>>>> retrieving revision 1.15
>>>> diff -u -b -r1.15 mdfauddevice.cpp
>>>> --- mdfauddevice.cpp 19 Oct 2008 05:17:35
>>>-0000 1.15
>>>> +++ mdfauddevice.cpp 5 Nov 2008 23:06:29 -0000
>>>> @@ -735,13 +735,21 @@
>>>> // IHXAudioDevice::CheckFormat
>>>> // - This method check the capability
>>>of audio device
>>>> // for a given audio format
>>>> -// - To be implemented
>>>> //
>>>> HX_RESULT CHXMDFAudioDevice::CheckFormat(const
>>>HXAudioFormat* pAudioFormat)
>>>> {
>>>> HXLOGL4(HXLOG_MDFA,"mdfdev:ChkFormat <>");
>>>> - HX_RESULT res = HXR_OK;
>>>> + HX_RESULT res = HXR_FAIL;
>>>>
>>>> + if (pAudioFormat)
>>>> + {
>>>> + if (m_pAudioFormat->m_uChannels ==
>>>pAudioFormat->uChannels &&
>>>> +
>>>m_pAudioFormat->m_uBitsPerSample == pAudioFormat->uBitsPerSample
>>>>&&
>>>> +
>>>m_pAudioFormat->m_ulSamplesPerSec == pAudioFormat-
>>>>>ulSamplesPerSec)
>>>> + {
>>>> + res = HXR_OK;
>>>> + }
>>>> + }
>>>> return res;
>>>> }
>>>>
>>>> Index: mdfaudfmt.cpp
>>>>
>>>===================================================================
>>>> RCS file:
>>>/cvsroot/datatype/mdf/audio/dsp/mdfaudfmt.cpp,v
>>>> retrieving revision 1.9
>>>> diff -u -b -r1.9 mdfaudfmt.cpp
>>>> --- mdfaudfmt.cpp 6 Jul 2007 22:01:13
>>>-0000 1.9
>>>> +++ mdfaudfmt.cpp 5 Nov 2008 23:06:29 -0000
>>>> @@ -211,8 +211,6 @@
>>>> #define SBR_DOWNSAMPLE_CUTOFF_RATE 24000
>>>> #define MAX_SBR_OUT_SAMPLE_RATE 48000
>>>>
>>>> -#define KMMFFourCCCodeEAACP
>>>0x43414520 // ' ' 'E' 'A' 'C'
>>>> -
>>>> HXMDFAudioAac::HXMDFAudioAac():
>>>> m_ulObjectType(0)
>>>> ,m_ulFrameLength(0)
>>>> Index: mdfaudfmt.h
>>>>
>>>===================================================================
>>>> RCS file: /cvsroot/datatype/mdf/audio/dsp/mdfaudfmt.h,v
>>>> retrieving revision 1.6
>>>> diff -u -b -r1.6 mdfaudfmt.h
>>>> --- mdfaudfmt.h 6 Jul 2007 22:01:13 -0000 1.6
>>>> +++ mdfaudfmt.h 5 Nov 2008 23:06:29 -0000
>>>> @@ -63,6 +63,8 @@
>>>>
>>>> #include "gaconfig.h"
>>>>
>>>> +#define KMMFFourCCCodeEAACP
>>>0x43414520 // ' ' 'E' 'A' 'C'
>>>> +
>>>>
>>>> class HXMDFAudioFormat
>>>> {
>>>> Index: mdfdevsound.cpp
>>>>
>>>===================================================================
>>>> RCS file:
>>>/cvsroot/datatype/mdf/audio/dsp/mdfdevsound.cpp,v
>>>> retrieving revision 1.19
>>>> diff -u -b -r1.19 mdfdevsound.cpp
>>>> --- mdfdevsound.cpp 19 Oct 2008 05:17:53
>>>-0000 1.19
>>>> +++ mdfdevsound.cpp 5 Nov 2008 23:06:30 -0000
>>>> @@ -64,6 +64,7 @@
>>>> #include "mdfdevsound.h"
>>>> #include "mdfdebug.h"
>>>> #include "CHXMMFDevSound.h"
>>>> +#include "mdfaudfmt.h"
>>>>
>>>> inline
>>>> TUint SamplesToMS(TUint count, TUint rate)
>>>> @@ -681,7 +682,8 @@
>>>> if(m_fourCC == KMMFFourCCCodeAMR ||
>>>> m_fourCC == KMMFFourCCCodeAAC ||
>>>> m_fourCC == KMMFFourCCCodeAWB ||
>>>> - m_fourCC == KMMFFourCCCodeAMRW )
>>>> + m_fourCC == KMMFFourCCCodeAMRW ||
>>>> + m_fourCC == KMMFFourCCCodeEAACP)
>>>> {
>>>> CErrorConcealmentIntfc *ErrCI = 0;
>>>> TRAPD(err, (ErrCI =
>>>>CErrorConcealmentIntfc::NewL(*m_pDevSound)));
>>>>
>>>
>>>
>>>
>>
>>_______________________________________________
>>Client-dev mailing list
>>Client-dev@helixcommunity.org
>>http://lists.helixcommunity.org/mailman/listinfo/client-dev
>>
From ehyche at real.com Mon Nov 10 08:56:12 2008
From: ehyche at real.com (Eric Hyche)
Date: Mon Nov 10 07:00:15 2008
Subject: [datatype-dev] CR: To Support the Fix bounds checking in
Bitstream class
In-Reply-To: <002001c94337$f980cd40$7601a8c0@AlokSystem>
References: <002001c94337$f980cd40$7601a8c0@AlokSystem>
Message-ID: <008b01c94355$3d746850$b85d38f0$@com>
Alok,
Here are my comments:
1) datatype/common/util/pub/bitstream.h changes look good.
2) datatype/common/util/test/tbitpack.cpp changes look good.
3) datatype/common/util/pub/bitpack.h changes look good.
4) In datatype/common/util/bitstream.cpp, here:
@@ -113,6 +116,7 @@
m_bitCount = 8 - (bitCount - m_bitCount);
}
+ m_ulBufSizeBits -= bitCount;
return ret;
}
If someone does ignore the BitsLeft() and goes ahead
and calls GetBits(), then m_ulBufSizeBits could wrap around
32-bits and become huge. So we should add a check here
to make sure that m_ulBufSizeBits only goes down to zero
and does not wrap around:
+ m_ulBufSizeBits -= (bitCount <= m_ulBufSizeBits ? bitCount : m_ulBufSizeBits);
5) In datatype/common/util/bitpack.cpp,
+ ulLeft = bs.BitsLeft();
+ if (ulLeft < (UINT32) bitCount)
+ {
+ return HXR_FAIL;
+ }
while(bitCount)
{
int bits = (bitCount > 8) ? 8 : bitCount;
PackBits(bs.GetBits(bits), bits);
bitCount -= bits;
}
+ return HXR_OK;
Here you are only checking once outside the while() loop.
If we ran out of bits *inside* the while() loop, then
we would crash. We need to add a check inside of the
while loop prior to the bs.GetBits() call.
6) datatype/aac/fileformat/ADIFfile.cpp
+ HXLOGL1("Failed to add explicit SBR signal to AudioSpecificConfig");
Please use a fourcc in your log statements. In this case, since
this code is in the AAC file format, then you would use HXLOG_AACF. So
it would look like:
+ HXLOGL1(HXLOG_AACF, "Failed to add explicit SBR signal to AudioSpecificConfig");
- UINT16 unADIFHeaderSize = 0;
Since we are converting unADIFHeaderSize from a local variable
to an out parameter, we should still set it to 0 here. Otherwise,
if someone didn't initialize it to 0 before passing it into
ParseADIFHeader(), then we would get an incorrect value.
7) datatype/aac/fileformat/aacff.cpp - changes looks good
8) datatype/aac/fileformat/aacfiletypes.h - changes look good
9) datatype/h263/payload/h263pyld.cpp - changes look good
10) datatype/h263/payload/rfc2190hlpr.cpp - changes look good
11) datatype/h263/payload/rfc2429hlpr.cpp - changes look good
12) datatype/mp4/payload/Umakefil - changes look good
13) datatype/mp4/payload/amr-depack.cpp
+ HXLOGL1("Failed GetTOCInfo()");
For all of the log messages in amr-depack.cpp, use the
HXLOG_GENE fourcc.
- SortedCopy(bs, ulStartBlock, ulBlockInc, tocInfo);
+ if (!SortedCopy(bs, ulStartBlock, ulBlockInc, tocInfo))
+ {
+ bFailed =TRUE;
+ }
This change looks fine, but it looks like you need a
similar check for LinearCopy() as well.
Also, if either SortedCopy() or LinearCopy() fail
and you don't return immediately after the failure,
then you'll need a !bFailed check here:
if (m_ulMaxInterleave > 0)
@@ -493,6 +546,12 @@
pCurrent[ulFrameBytes - 1] = 0;
// Copy frame bits into the buffer
+ UINT32 ulLeft = bs.BitsLeft();
+ if (ulLeft < ulFrameBits)
+ {
+ bFailed = TRUE;
+ break;
+ }
bs.GetBits(ulFrameBits, pCurrent);
These changes are in GetFrameBlock(), which currently has
no way of returning failure. You'll need to modify GetFrameBlock()
to be able to communicate failure and return ulRet as
an out parameter.
14) datatype/mp4/payload/mp4-latm-depack.cpp - changes look good
15) datatype/mp4/payload/mp4a-mux-cfg.cpp
- AudioObjectType = GetAudioObjectType(bs);
+ if (!GetAudioObjectType(bs,AudioObjectType))
+ {
+ HXLOGL1("Failed GetAudioObjectType()");
+ }
Seems like you should go ahead and return FALSE here, or
include !failed checks for the rest of the function.
Use HXLOG_GENE fourcc throughout.
- ExtnAudioObjectType = GetAudioObjectType(bs);
+ if (!GetAudioObjectType(bs,ExtnAudioObjectType))
+ {
+ HXLOGL1("Failed GetAudioObjectType()");
+ }
Probably need to return FALSE here.
+ ulLeft = bs.BitsLeft();
+ if (ulLeft < (ulAscLen - ulAscBits))
+ {
+ return FALSE;
+ }
// get fill bits
ulAscLen -= ulAscBits;
bs.GetBits(ulAscLen);
Why not just move the BitsLeft() check to right before
the GetBits() call and just make it "if (ulLeft < ulAscLen)"?
-ULONG32 MP4AMuxConfig::LatmGetValue(Bitstream&bs, ULONG32& nBits)
+HXBOOL MP4AMuxConfig::LatmGetValue(Bitstream&bs, ULONG32& nBits, ULONG32& ulValue)
{
- ULONG32 ulValue = 0;
We should still initialize ulValue to 0 at the top of LatmGetValue() just
in case the caller forgets to initialize it.
16) datatype/mp4/payload/pub/amr-depack.h - changes look good
17) datatype/mp4/payload/pub/mp4-latm-depack.h - changes look good
18) datatype/mp4/payload/pub/mp4a-mux-cfg.h - changes look good
Please make the additional changes to LinearCopy() in amr-depack.cpp
and amr-depack.h and re-submit just diffs of those two files for additional
review (no need to submit all the other diffs again).
Eric
=======================================
Eric Hyche (ehyche@real.com)
Principal Engineer
RealNetworks, Inc.
>-----Original Message-----
>From: datatype-dev-bounces@helixcommunity.org [mailto:datatype-dev-bounces@helixcommunity.org] On
>Behalf Of Alok Jain
>Sent: Monday, November 10, 2008 8:27 AM
>To: datatype-dev@helixcommunity.org
>Cc: Alok Jain
>Subject: [datatype-dev] CR: To Support the Fix bounds checking in Bitstream class
>
>
>
>Synopsis:
> To Support the Fix bounds checking in Bitstream class.
>
>Overview:
>Add the method BitsLeft() inside Bitstream class for Fix bounds checking and
>
>modified all the instance where GetBits() or PeekBits() is used as a method of
>
>Bitstream class.
>
>
>Files Modified:
>/datatype/common/util/bitpack.cpp
>
>/datatype/common/util/bitstream.cpp
>
>/datatype/common/util/pub/bitstream.h
>
>/datatype/common/util/test/tbitpack.cpp
>
>/datatype/common/util/pub/bitpack.h
>
>/datatype/aac/fileformat/ADIFfile.cpp
>
>/datatype/aac/fileformat/aacff.cpp
>
>/datatype/aac/fileformat/aacfiletypes.h
>
>/datatype/h263/payload/h263pyld.cpp
>
>/datatype/h263/payload/rfc2190hlpr.cpp
>
>/datatype/h263/payload/rfc2429hlpr.cpp
>
>/datatype/mp4/payload/Umakefil
>
>/datatype/mp4/payload/amr-depack.cpp
>
>/datatype/mp4/payload/mp4-latm-depack.cpp
>
>/datatype/mp4/payload/mp4a-mux-cfg.cpp
>
>/ datatype/mp4/payload/pub/amr-depack.h
>
>/datatype/mp4/payload/pub/mp4-latm-depack.h
>
>/datatype/mp4/payload/pub/mp4a-mux-cfg.h
>
>
>Files Added:
>None
>
>Image Size and Heap Use impact (Client -Only):
> None.
>
> Platforms and Profiles Affected:
> None
>
> Distribution Libraries Affected:
> None.
>
> Distribution library impact and planned action:
> None.
>
> Platforms and Profiles Build Verified:
> Profile: helix-client-all-defines
>
>BIF branch: helix.bif
>Target: splay
>Branch: HEAD
>
>Thanks
>Alok Jain
>
>
From ext-asheesh.srivastava at nokia.com Mon Nov 10 09:30:59 2008
From: ext-asheesh.srivastava at nokia.com (ext-asheesh.srivastava@nokia.com)
Date: Mon Nov 10 07:35:11 2008
Subject: [datatype-dev] RE: [Client-dev] CR: Fix for AAC and its extenssion
type (eAAC+etc) audio clips issue with hardware accelerated
codecs in HEADbranch.
In-Reply-To: <007201c94347$9c157240$d44056c0$@com>
References: <03528B6E301B3B42833693425F0A49F701EADE09@daebe102.NOE.Nokia.com><00b801c94047$17db6640$479232c0$@com>
<03528B6E301B3B42833693425F0A49F701EADF11@daebe102.NOE.Nokia.com>
<03528B6E301B3B42833693425F0A49F701EAE2D0@daebe102.NOE.Nokia.com>
<007201c94347$9c157240$d44056c0$@com>
Message-ID: <03528B6E301B3B42833693425F0A49F701ED8777@daebe102.NOE.Nokia.com>
Thanks for your comments Eric.
As SetAudioPushdown is related to emulator playback only, I will create
a new CR for it meanwhile I will submit rest of the changes.
Thanks,
- Asheesh
>-----Original Message-----
>From: ext Eric Hyche [mailto:ehyche@real.com]
>Sent: Monday, November 10, 2008 9:19 AM
>To: Srivastava Asheesh (EXT-Infovision-MSW/Dallas);
>client-dev@helixcommunity.org; datatype-dev@helixcommunity.org
>Subject: RE: [Client-dev] CR: Fix for AAC and its extenssion
>type (eAAC+etc) audio clips issue with hardware accelerated
>codecs in HEADbranch.
>
>HXAudioSession::SetAudioPushdown() is correctly setting
>m_ulTargetPushdown. m_ulTargetPushdown is the "desired" or
>nominal pushdown value, while m_ulMinimumPushdown is the
>absolute minimum pushdown we want to allow. So when calling
>HXAudioSession::SetAudioPushdown(), the user of the audio
>session is supposed to be setting the nominal value, not the minimum.
>
>Eric
>
>=======================================
>Eric Hyche (ehyche@real.com)
>Principal Engineer
>RealNetworks, Inc.
>
>
>>-----Original Message-----
>>From: ext-asheesh.srivastava@nokia.com
>>[mailto:ext-asheesh.srivastava@nokia.com]
>>Sent: Friday, November 07, 2008 1:11 PM
>>To: ext-asheesh.srivastava@nokia.com; ehyche@real.com;
>>client-dev@helixcommunity.org; datatype- dev@helixcommunity.org
>>Subject: RE: [Client-dev] CR: Fix for AAC and its extenssion type
>>(eAAC+etc) audio clips issue with hardware accelerated codecs
>in HEADbranch.
>>
>>Hi Eric,
>>
>>After analyzing more, I noticed,
>>HXAudioSession::SetAudioPushdown(UINT32
>>ulMinimumPushdown) function is to set
>>the minimum audio push down value, however it is modifying
>>m_ulTargetPushdown member, not m_ulMinimumPushdown.
>>I feel the correct implementation should modify m_ulMinimumPushdown.
>>
>>- m_ulTargetPushdown = (ulMinimumPushdown>- MINIMUM_AUDIO_PUSHDOWN: ulMinimumPushdown;
>>+ m_ulMinimumPushdown =
>(ulMinimumPushdown>+ MINIMUM_AUDIO_PUSHDOWN : ulMinimumPushdown;
>>
>>Regards,
>>- Asheesh
>>
>>
>>>-----Original Message-----
>>>From: client-dev-bounces@helixcommunity.org
>>>[mailto:client-dev-bounces@helixcommunity.org] On Behalf Of ext
>>>ext-asheesh.srivastava@nokia.com
>>>Sent: Thursday, November 06, 2008 3:22 PM
>>>To: ehyche@real.com; client-dev@helixcommunity.org;
>>>datatype-dev@helixcommunity.org
>>>Subject: RE: [Client-dev] CR: Fix for AAC and its extenssion type
>>>(eAAC+etc) audio clips issue with hardware accelerated codecs in
>>>HEADbranch.
>>>
>>>Hi Eric,
>>>
>>>Thanks for your input. Please find my observation.
>>>
>>>On emulator if I play any media clip which has AAC audio in it, only
>>>1st video frame appears and playback freezes. To fix this emulator
>>>problem I made m_ulTargetPushdown changes.
>>>
>>>Reason for calculating m_ulTargetPushdown based on
>>>TARGET_AUDIO_PUSHDOWN.
>>>
>>>1. MINIMUM_AUDIO_PUSHDOWN and TARGET_AUDIO_PUSHDOWN macros
>are defined
>>>as # define MINIMUM_AUDIO_PUSHDOWN 200
>>># define TARGET_AUDIO_PUSHDOWN 1000
>>>
>>>During CHXAudioSession::SetAudioPushdown call ulMinimumPushdown has
>>>value of 120 which is less than MINIMUM_AUDIO_PUSHDOWN, so
>>>m_ulTargetPushdown becomes 200.
>>>Then It calls
>>>CHXAudioSession::UpdateMinimumPushdown() where
>>>m_ulTargetBlocksTobeQueued, m_ulMinBlocksTobeQueued etc are
>calculated.
>>>
>>>Helix log has these audio pushdown values for them -
>>>Granularity: 50
>>>Blocks at the minimum: 4
>>>Blocks at start: 4
>>>Blocks to grow to: 4
>>>MS of data at minimum: 200
>>>MS of data at start: 200
>>>MS of data to grow to: 200
>>>
>>>2. In cayenne, above calculations are based on m_ulMinimumPushdown
>>>which relies on MINIMUM_AUDIO_PUSHDOWN.
>>>Comparing above values with cayenne,
>>>
>>>Audio pushdown values for cayenne -
>>>Granularity: 50
>>>Blocks at start: 4
>>>Blocks to grow to: 20
>>>MS of data at start: 200
>>>MS of data to grow to: 1000
>>>
>>>'Blocks to grow to' and 'MS of data to grow to' have
>different values
>>>in cayenne and HEAD.
>>>
>>>3. TARGET_AUDIO_PUSHDOWN and m_ulTargetPushdown are introduced
>>>recently in HEAD branch and I think m_ulTargetPushdown needs to be
>>>calculated based on TARGET_AUDIO_PUSHDOWN not MINIMUM_AUDIO_PUSHDOWN.
>>>
>>>4. In HEAD, When I change MINIMUM_AUDIO_PUSHDOWN to
>>>TARGET_AUDIO_PUSHDOWN in CHXAudioSession::SetAudioPushdown, it fixes
>>>the emulator problem and works fine with DSP solution also.
>Following
>>>audio pushdown values are found in log file -
>>>
>>>Audio pushdown values Report:
>>>Granularity: 50
>>>Blocks at the minimum: 4
>>>Blocks at start: 4
>>>Blocks to grow to: 20
>>>MS of data at minimum: 200
>>>MS of data at start: 200
>>>MS of data to grow to: 1000
>>>
>>>Above values look similar to cayenne's value.
>>>
>>>Thanks,
>>>- Asheesh
>>>
>>>
>>>>-----Original Message-----
>>>>From: ext Eric Hyche [mailto:ehyche@real.com]
>>>>Sent: Thursday, November 06, 2008 1:37 PM
>>>>To: Srivastava Asheesh (EXT-Infovision-MSW/Dallas);
>>>>client-dev@helixcommunity.org; datatype-dev@helixcommunity.org
>>>>Subject: RE: [Client-dev] CR: Fix for AAC and its extenssion type
>>>>(eAAC+ etc) audio clips issue with hardware accelerated
>>>codecs in HEAD
>>>>branch.
>>>>
>>>>Asheesh:
>>>>
>>>>Here are my comments:
>>>>
>>>>- The changes for #5 below (in client/audiosvc/hxaudply.cpp) are
>>>> not needed since you have made the changes in #3.
>>>>- Why is this change needed?
>>>>
>>>>> - m_ulTargetPushdown =
>>>>(ulMinimumPushdown>>>> - MINIMUM_AUDIO_PUSHDOWN : ulMinimumPushdown;
>>>>> + m_ulTargetPushdown =
>>>>(ulMinimumPushdown>>>> + TARGET_AUDIO_PUSHDOWN : ulMinimumPushdown;
>>>>
>>>>- datatype/mdf/audio/dsp/* changes look good.
>>>>
>>>>Eric
>>>>
>>>>
>>>>=======================================
>>>>Eric Hyche (ehyche@real.com)
>>>>Principal Engineer
>>>>RealNetworks, Inc.
>>>>
>>>>
>>>>>-----Original Message-----
>>>>>From: client-dev-bounces@helixcommunity.org
>>>>>[mailto:client-dev-bounces@helixcommunity.org] On Behalf Of
>>>>>ext-asheesh.srivastava@nokia.com
>>>>>Sent: Thursday, November 06, 2008 1:51 PM
>>>>>To: client-dev@helixcommunity.org; datatype-dev@helixcommunity.org
>>>>>Subject: [Client-dev] CR: Fix for AAC and its extenssion
>type (eAAC+
>>>>>etc) audio clips issue with hardware accelerated codecs in
>>>>HEAD branch.
>>>>>
>>>>>
>>>>>
>>>>> "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: ext-asheesh.srivastava@nokia.com
>>>>>
>>>>> Reviewed by:
>>>>>
>>>>> Date: 11/06/2008
>>>>>
>>>>> Project: SymbianMmf_wm
>>>>>
>>>>> ErrorId: N/A
>>>>>
>>>>> Synopsis: AAC and its extenssion type (eAAC+
>>>>etc) audio clips were
>>>>>not playing for local playback/streaming when used with DSP
>>>>decoder in HEAD branch.
>>>>>
>>>>> Overview:
>>>>> Because of the reasons listed below, AAC and
>>>>its extenssion type
>>>>>audio clips were not playing when used with DSP decoder in
>>>HEAD branch
>>>>>
>>>>> 1. CR - Enable eAAC+ error concealmeant was not
>>>>propogated to HEAD.
>>>>>It activates error concealment for eAAC+ clips when used with
>>>>hardware decoders.
>>>>>
>>>>> 2. During
>>>>CHXAudioSession::Resume(CHXAudioPlayer* pPlayerToExclude,
>>>>>HXBOOL bRewindNeeded) call , bRewindNeeded gets enabled and
>>>>that leads
>>>>>call to
>>>>>
>>>>> RewindSession, which empties the audio device's
>>>>buffer list and that
>>>>>inturn adds filler
>>>>>(silence) frames to the audio device and audio play-back
>gets stuck.
>>>>>
>>>>> Resume () was calling RewindSession() even if
>>>>the audio session has
>>>>>not pushed any data into the audio device.
>>>>> A check is made based on m_dNumBytesWritten to
>>>>skip RewindSession()
>>>>>call if audio session has not pushed any data to it.
>>>>>
>>>>> 3. CHXMDFAudioDevice::CheckFormat(const
>>>>HXAudioFormat* pAudioFormat)
>>>>>function was not implemented.
>>>>> This implementation now checks if the asked
>>>>audio format is same as
>>>>>the audio device's format when the device was created by
>the decoder.
>>>>>
>>>>> 4. Target audio pushdown was calculated based on
>>>>>MINIMUM_AUDIO_PUSHDOWN in
>>>>>CHXAudioSession::SetAudioPushdown() function.
>>>>>
>>>>> It should be calculated based on TARGET_AUDIO_PUSHDOWN.
>>>>>
>>>>> 5. Workaround in CHXAudioPlayer::Setup( ULONG32
>>>>ulGranularity) for
>>>>>keeping min. channel at stereo is no longer required.
>>>>>
>>>>> RA renderer used to only call
>>>>IHXAudioStream::Init() on the first
>>>>>substream when a
>>>>>SureStream(multi-rate) stream was played.
>>>>>
>>>>> Then, as it received packets for other
>>>>substreams, then it created
>>>>>and Init'd those IHXAudioStreams.
>>>>> However, the current RA renderer creates and
>>>>Init's an IHXAudioStream for each substream.
>>>>>So it would appear that this workaround is no longer needed.
>>>>>
>>>>> Files Modified:
>>>>> /cvsroot/datatype/mdf/audio/dsp/mdfauddevice.cpp
>>>>> /cvsroot/datatype/mdf/audio/dsp/mdfaudfmt.cpp
>>>>> /cvsroot/datatype/mdf/audio/dsp/mdfaudfmt.h
>>>>> /cvsroot/datatype/mdf/audio/dsp/mdfdevsound.cpp
>>>>> /cvsroot/client/audiosvc/hxaudply.cpp
>>>>> /cvsroot/client/audiosvc/hxaudses.cpp
>>>>>
>>>>> New files added:
>>>>> None.
>>>>>
>>>>> Image Size and Heap Use impact: no major impact
>>>>> Module Release testing (STIF)- After playing
>>>>any clip, while exiting
>>>>>helix engine crashes. It is a known issue and is introduced
>>>>by some recent CR submission.
>>>>>
>>>>> Test case(s) Added : No.
>>>>> Platforms and Profiles Build Verified:
>>>>helix-client-s60-32-mmf-mdf-dsp
>>>>> branch: helix_restricted
>>>>> platform: symbian-91-armv5
>>>>> target(s): symbianMmf_wm
>>>>>
>>>>> Branch: HEAD
>>>>>
>>>>> DIFF:
>>>>>
>>>>> Index: hxaudply.cpp
>>>>>
>>>>===================================================================
>>>>> RCS file: /cvsroot/client/audiosvc/hxaudply.cpp,v
>>>>> retrieving revision 1.58
>>>>> diff -u -b -r1.58 hxaudply.cpp
>>>>> --- hxaudply.cpp 20 Sep 2008 06:02:27
>>>>-0000 1.58
>>>>> +++ hxaudply.cpp 5 Nov 2008 23:06:07 -0000
>>>>> @@ -1916,16 +1916,9 @@
>>>>>
>>>>> // Set the audio format for this Player.
>>>>> m_PlayerFmt.uMaxBlockSize = maxBlocksize;
>>>>> - // keep min. channel at stereo
>>>>> - // this is a workaround for b#205546,
>>>>the root cause of this is that we only
>>>>> - // choose the audio format of the 1st
>>>>audio stream when the playback is started
>>>>> - // without audio, then audio clip is
>>>>started at later time. For sure stream
>>>>>audio,
>>>>> - // the first audio stream is often the
>>>>lowest quality, thus the audio device is
>>>>> - // configured to play the lowest quality audio.
>>>>> - //
>>>>> - // proper fix requires the audio
>>>>device is setup only after all audio streams
>>>>> - // assoicated with the same clip have
>>>>been registered
>>>>> - m_PlayerFmt.uChannels =
>>>>(maxChannels < 2) ? 2 : maxChannels;
>>>>> +
>>>>> + m_PlayerFmt.uChannels = maxChannels;
>>>>> +
>>>>> m_PlayerFmt.uBitsPerSample =
>>>>maxBitsPerSample;
>>>>>
>>>>> // If user wants upsampling
>>>>> Index: hxaudses.cpp
>>>>>
>>>>===================================================================
>>>>> RCS file: /cvsroot/client/audiosvc/hxaudses.cpp,v
>>>>> retrieving revision 1.81
>>>>> diff -u -b -r1.81 hxaudses.cpp
>>>>> --- hxaudses.cpp 18 Oct 2007 22:55:08
>>>>-0000 1.81
>>>>> +++ hxaudses.cpp 5 Nov 2008 23:06:07 -0000
>>>>> @@ -2196,7 +2196,7 @@
>>>>> if ((m_bPaused || m_bStoppedDuringPause) &&
>>>>> (!m_pLastPausedPlayer ||
>>>>(m_pLastPausedPlayer == pPlayerToExclude)))
>>>>> {
>>>>> - if (bRewindNeeded)
>>>>> + if (bRewindNeeded && (m_dNumBytesWritten != 0))
>>>>> {
>>>>> RewindSession();
>>>>> }
>>>>> @@ -2962,8 +2962,8 @@
>>>>> STDMETHODIMP
>>>>CHXAudioSession::SetAudioPushdown(UINT32 ulMinimumPushdown)
>>>>> {
>>>>>
>>>>> - m_ulTargetPushdown =
>>>>(ulMinimumPushdown>>>> - MINIMUM_AUDIO_PUSHDOWN : ulMinimumPushdown;
>>>>> + m_ulTargetPushdown =
>>>>(ulMinimumPushdown>>>> + TARGET_AUDIO_PUSHDOWN : ulMinimumPushdown;
>>>>>
>>>>> UpdateMinimumPushdown();
>>>>> Index: mdfauddevice.cpp
>>>>>
>>>>===================================================================
>>>>> RCS file:
>>>>/cvsroot/datatype/mdf/audio/dsp/mdfauddevice.cpp,v
>>>>> retrieving revision 1.15
>>>>> diff -u -b -r1.15 mdfauddevice.cpp
>>>>> --- mdfauddevice.cpp 19 Oct 2008 05:17:35
>>>>-0000 1.15
>>>>> +++ mdfauddevice.cpp 5 Nov 2008 23:06:29 -0000
>>>>> @@ -735,13 +735,21 @@
>>>>> // IHXAudioDevice::CheckFormat
>>>>> // - This method check the capability
>>>>of audio device
>>>>> // for a given audio format
>>>>> -// - To be implemented
>>>>> //
>>>>> HX_RESULT CHXMDFAudioDevice::CheckFormat(const
>>>>HXAudioFormat* pAudioFormat)
>>>>> {
>>>>> HXLOGL4(HXLOG_MDFA,"mdfdev:ChkFormat <>");
>>>>> - HX_RESULT res = HXR_OK;
>>>>> + HX_RESULT res = HXR_FAIL;
>>>>>
>>>>> + if (pAudioFormat)
>>>>> + {
>>>>> + if (m_pAudioFormat->m_uChannels ==
>>>>pAudioFormat->uChannels &&
>>>>> +
>>>>m_pAudioFormat->m_uBitsPerSample == pAudioFormat->uBitsPerSample
>>>>>&&
>>>>> +
>>>>m_pAudioFormat->m_ulSamplesPerSec == pAudioFormat-
>>>>>>ulSamplesPerSec)
>>>>> + {
>>>>> + res = HXR_OK;
>>>>> + }
>>>>> + }
>>>>> return res;
>>>>> }
>>>>>
>>>>> Index: mdfaudfmt.cpp
>>>>>
>>>>===================================================================
>>>>> RCS file:
>>>>/cvsroot/datatype/mdf/audio/dsp/mdfaudfmt.cpp,v
>>>>> retrieving revision 1.9
>>>>> diff -u -b -r1.9 mdfaudfmt.cpp
>>>>> --- mdfaudfmt.cpp 6 Jul 2007 22:01:13
>>>>-0000 1.9
>>>>> +++ mdfaudfmt.cpp 5 Nov 2008 23:06:29 -0000
>>>>> @@ -211,8 +211,6 @@
>>>>> #define SBR_DOWNSAMPLE_CUTOFF_RATE 24000
>>>>> #define MAX_SBR_OUT_SAMPLE_RATE 48000
>>>>>
>>>>> -#define KMMFFourCCCodeEAACP
>>>>0x43414520 // ' ' 'E' 'A' 'C'
>>>>> -
>>>>> HXMDFAudioAac::HXMDFAudioAac():
>>>>> m_ulObjectType(0)
>>>>> ,m_ulFrameLength(0)
>>>>> Index: mdfaudfmt.h
>>>>>
>>>>===================================================================
>>>>> RCS file: /cvsroot/datatype/mdf/audio/dsp/mdfaudfmt.h,v
>>>>> retrieving revision 1.6
>>>>> diff -u -b -r1.6 mdfaudfmt.h
>>>>> --- mdfaudfmt.h 6 Jul 2007 22:01:13 -0000 1.6
>>>>> +++ mdfaudfmt.h 5 Nov 2008 23:06:29 -0000
>>>>> @@ -63,6 +63,8 @@
>>>>>
>>>>> #include "gaconfig.h"
>>>>>
>>>>> +#define KMMFFourCCCodeEAACP
>>>>0x43414520 // ' ' 'E' 'A' 'C'
>>>>> +
>>>>>
>>>>> class HXMDFAudioFormat
>>>>> {
>>>>> Index: mdfdevsound.cpp
>>>>>
>>>>===================================================================
>>>>> RCS file:
>>>>/cvsroot/datatype/mdf/audio/dsp/mdfdevsound.cpp,v
>>>>> retrieving revision 1.19
>>>>> diff -u -b -r1.19 mdfdevsound.cpp
>>>>> --- mdfdevsound.cpp 19 Oct 2008 05:17:53
>>>>-0000 1.19
>>>>> +++ mdfdevsound.cpp 5 Nov 2008 23:06:30 -0000
>>>>> @@ -64,6 +64,7 @@
>>>>> #include "mdfdevsound.h"
>>>>> #include "mdfdebug.h"
>>>>> #include "CHXMMFDevSound.h"
>>>>> +#include "mdfaudfmt.h"
>>>>>
>>>>> inline
>>>>> TUint SamplesToMS(TUint count, TUint rate)
>>>>> @@ -681,7 +682,8 @@
>>>>> if(m_fourCC == KMMFFourCCCodeAMR ||
>>>>> m_fourCC == KMMFFourCCCodeAAC ||
>>>>> m_fourCC == KMMFFourCCCodeAWB ||
>>>>> - m_fourCC == KMMFFourCCCodeAMRW )
>>>>> + m_fourCC == KMMFFourCCCodeAMRW ||
>>>>> + m_fourCC == KMMFFourCCCodeEAACP)
>>>>> {
>>>>> CErrorConcealmentIntfc *ErrCI = 0;
>>>>> TRAPD(err, (ErrCI =
>>>>>CErrorConcealmentIntfc::NewL(*m_pDevSound)));
>>>>>
>>>>
>>>>
>>>>
>>>
>>>_______________________________________________
>>>Client-dev mailing list
>>>Client-dev@helixcommunity.org
>>>http://lists.helixcommunity.org/mailman/listinfo/client-dev
>>>
>
>
From ext-asheesh.srivastava at nokia.com Mon Nov 10 10:29:33 2008
From: ext-asheesh.srivastava at nokia.com (ext-asheesh.srivastava@nokia.com)
Date: Mon Nov 10 08:33:42 2008
Subject: [datatype-dev] RE: [Client-dev] CR: Fix for AAC and its extenssion
type(eAAC+etc) audio clips issue with hardware accelerated
codecsin HEADbranch.
In-Reply-To: <03528B6E301B3B42833693425F0A49F701ED8777@daebe102.NOE.Nokia.com>
References: <03528B6E301B3B42833693425F0A49F701EADE09@daebe102.NOE.Nokia.com><00b801c94047$17db6640$479232c0$@com><03528B6E301B3B42833693425F0A49F701EADF11@daebe102.NOE.Nokia.com><03528B6E301B3B42833693425F0A49F701EAE2D0@daebe102.NOE.Nokia.com><007201c94347$9c157240$d44056c0$@com>
<03528B6E301B3B42833693425F0A49F701ED8777@daebe102.NOE.Nokia.com>
Message-ID: <03528B6E301B3B42833693425F0A49F701ED87F4@daebe102.NOE.Nokia.com>
Changes (without 4 & 5 as mentioned in the CR) have been committed to
HEAD.
Thanks,
- Asheesh
>-----Original Message-----
>From: client-dev-bounces@helixcommunity.org
>[mailto:client-dev-bounces@helixcommunity.org] On Behalf Of
>ext ext-asheesh.srivastava@nokia.com
>Sent: Monday, November 10, 2008 11:31 AM
>To: ehyche@real.com; client-dev@helixcommunity.org;
>datatype-dev@helixcommunity.org
>Subject: RE: [Client-dev] CR: Fix for AAC and its extenssion
>type(eAAC+etc) audio clips issue with hardware accelerated
>codecsin HEADbranch.
>
>Thanks for your comments Eric.
>As SetAudioPushdown is related to emulator playback only, I
>will create a new CR for it meanwhile I will submit rest of
>the changes.
>
>Thanks,
>- Asheesh
>
>>-----Original Message-----
>>From: ext Eric Hyche [mailto:ehyche@real.com]
>>Sent: Monday, November 10, 2008 9:19 AM
>>To: Srivastava Asheesh (EXT-Infovision-MSW/Dallas);
>>client-dev@helixcommunity.org; datatype-dev@helixcommunity.org
>>Subject: RE: [Client-dev] CR: Fix for AAC and its extenssion type
>>(eAAC+etc) audio clips issue with hardware accelerated codecs in
>>HEADbranch.
>>
>>HXAudioSession::SetAudioPushdown() is correctly setting
>>m_ulTargetPushdown. m_ulTargetPushdown is the "desired" or nominal
>>pushdown value, while m_ulMinimumPushdown is the absolute minimum
>>pushdown we want to allow. So when calling
>>HXAudioSession::SetAudioPushdown(), the user of the audio session is
>>supposed to be setting the nominal value, not the minimum.
>>
>>Eric
>>
>>=======================================
>>Eric Hyche (ehyche@real.com)
>>Principal Engineer
>>RealNetworks, Inc.
>>
>>
>>>-----Original Message-----
>>>From: ext-asheesh.srivastava@nokia.com
>>>[mailto:ext-asheesh.srivastava@nokia.com]
>>>Sent: Friday, November 07, 2008 1:11 PM
>>>To: ext-asheesh.srivastava@nokia.com; ehyche@real.com;
>>>client-dev@helixcommunity.org; datatype- dev@helixcommunity.org
>>>Subject: RE: [Client-dev] CR: Fix for AAC and its extenssion type
>>>(eAAC+etc) audio clips issue with hardware accelerated codecs
>>in HEADbranch.
>>>
>>>Hi Eric,
>>>
>>>After analyzing more, I noticed,
>>>HXAudioSession::SetAudioPushdown(UINT32
>>>ulMinimumPushdown) function is to set
>>>the minimum audio push down value, however it is modifying
>>>m_ulTargetPushdown member, not m_ulMinimumPushdown.
>>>I feel the correct implementation should modify m_ulMinimumPushdown.
>>>
>>>- m_ulTargetPushdown = (ulMinimumPushdown>>- MINIMUM_AUDIO_PUSHDOWN: ulMinimumPushdown;
>>>+ m_ulMinimumPushdown =
>>(ulMinimumPushdown>>+ MINIMUM_AUDIO_PUSHDOWN : ulMinimumPushdown;
>>>
>>>Regards,
>>>- Asheesh
>>>
>>>
>>>>-----Original Message-----
>>>>From: client-dev-bounces@helixcommunity.org
>>>>[mailto:client-dev-bounces@helixcommunity.org] On Behalf Of ext
>>>>ext-asheesh.srivastava@nokia.com
>>>>Sent: Thursday, November 06, 2008 3:22 PM
>>>>To: ehyche@real.com; client-dev@helixcommunity.org;
>>>>datatype-dev@helixcommunity.org
>>>>Subject: RE: [Client-dev] CR: Fix for AAC and its extenssion type
>>>>(eAAC+etc) audio clips issue with hardware accelerated codecs in
>>>>HEADbranch.
>>>>
>>>>Hi Eric,
>>>>
>>>>Thanks for your input. Please find my observation.
>>>>
>>>>On emulator if I play any media clip which has AAC audio in
>it, only
>>>>1st video frame appears and playback freezes. To fix this emulator
>>>>problem I made m_ulTargetPushdown changes.
>>>>
>>>>Reason for calculating m_ulTargetPushdown based on
>>>>TARGET_AUDIO_PUSHDOWN.
>>>>
>>>>1. MINIMUM_AUDIO_PUSHDOWN and TARGET_AUDIO_PUSHDOWN macros
>>are defined
>>>>as # define MINIMUM_AUDIO_PUSHDOWN 200
>>>># define TARGET_AUDIO_PUSHDOWN 1000
>>>>
>>>>During CHXAudioSession::SetAudioPushdown call ulMinimumPushdown has
>>>>value of 120 which is less than MINIMUM_AUDIO_PUSHDOWN, so
>>>>m_ulTargetPushdown becomes 200.
>>>>Then It calls
>>>>CHXAudioSession::UpdateMinimumPushdown() where
>>>>m_ulTargetBlocksTobeQueued, m_ulMinBlocksTobeQueued etc are
>>calculated.
>>>>
>>>>Helix log has these audio pushdown values for them -
>>>>Granularity: 50
>>>>Blocks at the minimum: 4
>>>>Blocks at start: 4
>>>>Blocks to grow to: 4
>>>>MS of data at minimum: 200
>>>>MS of data at start: 200
>>>>MS of data to grow to: 200
>>>>
>>>>2. In cayenne, above calculations are based on m_ulMinimumPushdown
>>>>which relies on MINIMUM_AUDIO_PUSHDOWN.
>>>>Comparing above values with cayenne,
>>>>
>>>>Audio pushdown values for cayenne -
>>>>Granularity: 50
>>>>Blocks at start: 4
>>>>Blocks to grow to: 20
>>>>MS of data at start: 200
>>>>MS of data to grow to: 1000
>>>>
>>>>'Blocks to grow to' and 'MS of data to grow to' have
>>different values
>>>>in cayenne and HEAD.
>>>>
>>>>3. TARGET_AUDIO_PUSHDOWN and m_ulTargetPushdown are introduced
>>>>recently in HEAD branch and I think m_ulTargetPushdown needs to be
>>>>calculated based on TARGET_AUDIO_PUSHDOWN not
>MINIMUM_AUDIO_PUSHDOWN.
>>>>
>>>>4. In HEAD, When I change MINIMUM_AUDIO_PUSHDOWN to
>>>>TARGET_AUDIO_PUSHDOWN in CHXAudioSession::SetAudioPushdown,
>it fixes
>>>>the emulator problem and works fine with DSP solution also.
>>Following
>>>>audio pushdown values are found in log file -
>>>>
>>>>Audio pushdown values Report:
>>>>Granularity: 50
>>>>Blocks at the minimum: 4
>>>>Blocks at start: 4
>>>>Blocks to grow to: 20
>>>>MS of data at minimum: 200
>>>>MS of data at start: 200
>>>>MS of data to grow to: 1000
>>>>
>>>>Above values look similar to cayenne's value.
>>>>
>>>>Thanks,
>>>>- Asheesh
>>>>
>>>>
>>>>>-----Original Message-----
>>>>>From: ext Eric Hyche [mailto:ehyche@real.com]
>>>>>Sent: Thursday, November 06, 2008 1:37 PM
>>>>>To: Srivastava Asheesh (EXT-Infovision-MSW/Dallas);
>>>>>client-dev@helixcommunity.org; datatype-dev@helixcommunity.org
>>>>>Subject: RE: [Client-dev] CR: Fix for AAC and its extenssion type
>>>>>(eAAC+ etc) audio clips issue with hardware accelerated
>>>>codecs in HEAD
>>>>>branch.
>>>>>
>>>>>Asheesh:
>>>>>
>>>>>Here are my comments:
>>>>>
>>>>>- The changes for #5 below (in client/audiosvc/hxaudply.cpp) are
>>>>> not needed since you have made the changes in #3.
>>>>>- Why is this change needed?
>>>>>
>>>>>> - m_ulTargetPushdown =
>>>>>(ulMinimumPushdown>>>>> - MINIMUM_AUDIO_PUSHDOWN : ulMinimumPushdown;
>>>>>> + m_ulTargetPushdown =
>>>>>(ulMinimumPushdown>>>>> + TARGET_AUDIO_PUSHDOWN : ulMinimumPushdown;
>>>>>
>>>>>- datatype/mdf/audio/dsp/* changes look good.
>>>>>
>>>>>Eric
>>>>>
>>>>>
>>>>>=======================================
>>>>>Eric Hyche (ehyche@real.com)
>>>>>Principal Engineer
>>>>>RealNetworks, Inc.
>>>>>
>>>>>
>>>>>>-----Original Message-----
>>>>>>From: client-dev-bounces@helixcommunity.org
>>>>>>[mailto:client-dev-bounces@helixcommunity.org] On Behalf Of
>>>>>>ext-asheesh.srivastava@nokia.com
>>>>>>Sent: Thursday, November 06, 2008 1:51 PM
>>>>>>To: client-dev@helixcommunity.org; datatype-dev@helixcommunity.org
>>>>>>Subject: [Client-dev] CR: Fix for AAC and its extenssion
>>type (eAAC+
>>>>>>etc) audio clips issue with hardware accelerated codecs in
>>>>>HEAD branch.
>>>>>>
>>>>>>
>>>>>>
>>>>>> "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: ext-asheesh.srivastava@nokia.com
>>>>>>
>>>>>> Reviewed by:
>>>>>>
>>>>>> Date: 11/06/2008
>>>>>>
>>>>>> Project: SymbianMmf_wm
>>>>>>
>>>>>> ErrorId: N/A
>>>>>>
>>>>>> Synopsis: AAC and its extenssion type (eAAC+
>>>>>etc) audio clips were
>>>>>>not playing for local playback/streaming when used with DSP
>>>>>decoder in HEAD branch.
>>>>>>
>>>>>> Overview:
>>>>>> Because of the reasons listed below, AAC and
>>>>>its extenssion type
>>>>>>audio clips were not playing when used with DSP decoder in
>>>>HEAD branch
>>>>>>
>>>>>> 1. CR - Enable eAAC+ error concealmeant was not
>>>>>propogated to HEAD.
>>>>>>It activates error concealment for eAAC+ clips when used with
>>>>>hardware decoders.
>>>>>>
>>>>>> 2. During
>>>>>CHXAudioSession::Resume(CHXAudioPlayer* pPlayerToExclude,
>>>>>>HXBOOL bRewindNeeded) call , bRewindNeeded gets enabled and
>>>>>that leads
>>>>>>call to
>>>>>>
>>>>>> RewindSession, which empties the audio device's
>>>>>buffer list and that
>>>>>>inturn adds filler
>>>>>>(silence) frames to the audio device and audio play-back
>>gets stuck.
>>>>>>
>>>>>> Resume () was calling RewindSession() even if
>>>>>the audio session has
>>>>>>not pushed any data into the audio device.
>>>>>> A check is made based on m_dNumBytesWritten to
>>>>>skip RewindSession()
>>>>>>call if audio session has not pushed any data to it.
>>>>>>
>>>>>> 3. CHXMDFAudioDevice::CheckFormat(const
>>>>>HXAudioFormat* pAudioFormat)
>>>>>>function was not implemented.
>>>>>> This implementation now checks if the asked
>>>>>audio format is same as
>>>>>>the audio device's format when the device was created by
>>the decoder.
>>>>>>
>>>>>> 4. Target audio pushdown was calculated based on
>>>>>>MINIMUM_AUDIO_PUSHDOWN in
>>>>>>CHXAudioSession::SetAudioPushdown() function.
>>>>>>
>>>>>> It should be calculated based on TARGET_AUDIO_PUSHDOWN.
>>>>>>
>>>>>> 5. Workaround in CHXAudioPlayer::Setup( ULONG32
>>>>>ulGranularity) for
>>>>>>keeping min. channel at stereo is no longer required.
>>>>>>
>>>>>> RA renderer used to only call
>>>>>IHXAudioStream::Init() on the first
>>>>>>substream when a
>>>>>>SureStream(multi-rate) stream was played.
>>>>>>
>>>>>> Then, as it received packets for other
>>>>>substreams, then it created
>>>>>>and Init'd those IHXAudioStreams.
>>>>>> However, the current RA renderer creates and
>>>>>Init's an IHXAudioStream for each substream.
>>>>>>So it would appear that this workaround is no longer needed.
>>>>>>
>>>>>> Files Modified:
>>>>>> /cvsroot/datatype/mdf/audio/dsp/mdfauddevice.cpp
>>>>>> /cvsroot/datatype/mdf/audio/dsp/mdfaudfmt.cpp
>>>>>> /cvsroot/datatype/mdf/audio/dsp/mdfaudfmt.h
>>>>>> /cvsroot/datatype/mdf/audio/dsp/mdfdevsound.cpp
>>>>>> /cvsroot/client/audiosvc/hxaudply.cpp
>>>>>> /cvsroot/client/audiosvc/hxaudses.cpp
>>>>>>
>>>>>> New files added:
>>>>>> None.
>>>>>>
>>>>>> Image Size and Heap Use impact: no major impact
>>>>>> Module Release testing (STIF)- After playing
>>>>>any clip, while exiting
>>>>>>helix engine crashes. It is a known issue and is introduced
>>>>>by some recent CR submission.
>>>>>>
>>>>>> Test case(s) Added : No.
>>>>>> Platforms and Profiles Build Verified:
>>>>>helix-client-s60-32-mmf-mdf-dsp
>>>>>> branch: helix_restricted
>>>>>> platform: symbian-91-armv5
>>>>>> target(s): symbianMmf_wm
>>>>>>
>>>>>> Branch: HEAD
>>>>>>
>>>>>> DIFF:
>>>>>>
>>>>>> Index: hxaudply.cpp
>>>>>>
>>>>>===================================================================
>>>>>> RCS file: /cvsroot/client/audiosvc/hxaudply.cpp,v
>>>>>> retrieving revision 1.58
>>>>>> diff -u -b -r1.58 hxaudply.cpp
>>>>>> --- hxaudply.cpp 20 Sep 2008 06:02:27
>>>>>-0000 1.58
>>>>>> +++ hxaudply.cpp 5 Nov 2008 23:06:07 -0000
>>>>>> @@ -1916,16 +1916,9 @@
>>>>>>
>>>>>> // Set the audio format for this Player.
>>>>>> m_PlayerFmt.uMaxBlockSize = maxBlocksize;
>>>>>> - // keep min. channel at stereo
>>>>>> - // this is a workaround for b#205546,
>>>>>the root cause of this is that we only
>>>>>> - // choose the audio format of the 1st
>>>>>audio stream when the playback is started
>>>>>> - // without audio, then audio clip is
>>>>>started at later time. For sure stream
>>>>>>audio,
>>>>>> - // the first audio stream is often the
>>>>>lowest quality, thus the audio device is
>>>>>> - // configured to play the lowest quality audio.
>>>>>> - //
>>>>>> - // proper fix requires the audio
>>>>>device is setup only after all audio streams
>>>>>> - // assoicated with the same clip have
>>>>>been registered
>>>>>> - m_PlayerFmt.uChannels =
>>>>>(maxChannels < 2) ? 2 : maxChannels;
>>>>>> +
>>>>>> + m_PlayerFmt.uChannels = maxChannels;
>>>>>> +
>>>>>> m_PlayerFmt.uBitsPerSample =
>>>>>maxBitsPerSample;
>>>>>>
>>>>>> // If user wants upsampling
>>>>>> Index: hxaudses.cpp
>>>>>>
>>>>>===================================================================
>>>>>> RCS file: /cvsroot/client/audiosvc/hxaudses.cpp,v
>>>>>> retrieving revision 1.81
>>>>>> diff -u -b -r1.81 hxaudses.cpp
>>>>>> --- hxaudses.cpp 18 Oct 2007 22:55:08
>>>>>-0000 1.81
>>>>>> +++ hxaudses.cpp 5 Nov 2008 23:06:07 -0000
>>>>>> @@ -2196,7 +2196,7 @@
>>>>>> if ((m_bPaused || m_bStoppedDuringPause) &&
>>>>>> (!m_pLastPausedPlayer ||
>>>>>(m_pLastPausedPlayer == pPlayerToExclude)))
>>>>>> {
>>>>>> - if (bRewindNeeded)
>>>>>> + if (bRewindNeeded && (m_dNumBytesWritten != 0))
>>>>>> {
>>>>>> RewindSession();
>>>>>> }
>>>>>> @@ -2962,8 +2962,8 @@
>>>>>> STDMETHODIMP
>>>>>CHXAudioSession::SetAudioPushdown(UINT32 ulMinimumPushdown)
>>>>>> {
>>>>>>
>>>>>> - m_ulTargetPushdown =
>>>>>(ulMinimumPushdown>>>>> - MINIMUM_AUDIO_PUSHDOWN : ulMinimumPushdown;
>>>>>> + m_ulTargetPushdown =
>>>>>(ulMinimumPushdown>>>>> + TARGET_AUDIO_PUSHDOWN : ulMinimumPushdown;
>>>>>>
>>>>>> UpdateMinimumPushdown();
>>>>>> Index: mdfauddevice.cpp
>>>>>>
>>>>>===================================================================
>>>>>> RCS file:
>>>>>/cvsroot/datatype/mdf/audio/dsp/mdfauddevice.cpp,v
>>>>>> retrieving revision 1.15
>>>>>> diff -u -b -r1.15 mdfauddevice.cpp
>>>>>> --- mdfauddevice.cpp 19 Oct 2008 05:17:35
>>>>>-0000 1.15
>>>>>> +++ mdfauddevice.cpp 5 Nov 2008 23:06:29 -0000
>>>>>> @@ -735,13 +735,21 @@
>>>>>> // IHXAudioDevice::CheckFormat
>>>>>> // - This method check the capability
>>>>>of audio device
>>>>>> // for a given audio format
>>>>>> -// - To be implemented
>>>>>> //
>>>>>> HX_RESULT CHXMDFAudioDevice::CheckFormat(const
>>>>>HXAudioFormat* pAudioFormat)
>>>>>> {
>>>>>> HXLOGL4(HXLOG_MDFA,"mdfdev:ChkFormat <>");
>>>>>> - HX_RESULT res = HXR_OK;
>>>>>> + HX_RESULT res = HXR_FAIL;
>>>>>>
>>>>>> + if (pAudioFormat)
>>>>>> + {
>>>>>> + if (m_pAudioFormat->m_uChannels ==
>>>>>pAudioFormat->uChannels &&
>>>>>> +
>>>>>m_pAudioFormat->m_uBitsPerSample == pAudioFormat->uBitsPerSample
>>>>>>&&
>>>>>> +
>>>>>m_pAudioFormat->m_ulSamplesPerSec == pAudioFormat-
>>>>>>>ulSamplesPerSec)
>>>>>> + {
>>>>>> + res = HXR_OK;
>>>>>> + }
>>>>>> + }
>>>>>> return res;
>>>>>> }
>>>>>>
>>>>>> Index: mdfaudfmt.cpp
>>>>>>
>>>>>===================================================================
>>>>>> RCS file:
>>>>>/cvsroot/datatype/mdf/audio/dsp/mdfaudfmt.cpp,v
>>>>>> retrieving revision 1.9
>>>>>> diff -u -b -r1.9 mdfaudfmt.cpp
>>>>>> --- mdfaudfmt.cpp 6 Jul 2007 22:01:13
>>>>>-0000 1.9
>>>>>> +++ mdfaudfmt.cpp 5 Nov 2008 23:06:29 -0000
>>>>>> @@ -211,8 +211,6 @@
>>>>>> #define SBR_DOWNSAMPLE_CUTOFF_RATE 24000
>>>>>> #define MAX_SBR_OUT_SAMPLE_RATE 48000
>>>>>>
>>>>>> -#define KMMFFourCCCodeEAACP
>>>>>0x43414520 // ' ' 'E' 'A' 'C'
>>>>>> -
>>>>>> HXMDFAudioAac::HXMDFAudioAac():
>>>>>> m_ulObjectType(0)
>>>>>> ,m_ulFrameLength(0)
>>>>>> Index: mdfaudfmt.h
>>>>>>
>>>>>===================================================================
>>>>>> RCS file: /cvsroot/datatype/mdf/audio/dsp/mdfaudfmt.h,v
>>>>>> retrieving revision 1.6
>>>>>> diff -u -b -r1.6 mdfaudfmt.h
>>>>>> --- mdfaudfmt.h 6 Jul 2007 22:01:13 -0000 1.6
>>>>>> +++ mdfaudfmt.h 5 Nov 2008 23:06:29 -0000
>>>>>> @@ -63,6 +63,8 @@
>>>>>>
>>>>>> #include "gaconfig.h"
>>>>>>
>>>>>> +#define KMMFFourCCCodeEAACP
>>>>>0x43414520 // ' ' 'E' 'A' 'C'
>>>>>> +
>>>>>>
>>>>>> class HXMDFAudioFormat
>>>>>> {
>>>>>> Index: mdfdevsound.cpp
>>>>>>
>>>>>===================================================================
>>>>>> RCS file:
>>>>>/cvsroot/datatype/mdf/audio/dsp/mdfdevsound.cpp,v
>>>>>> retrieving revision 1.19
>>>>>> diff -u -b -r1.19 mdfdevsound.cpp
>>>>>> --- mdfdevsound.cpp 19 Oct 2008 05:17:53
>>>>>-0000 1.19
>>>>>> +++ mdfdevsound.cpp 5 Nov 2008 23:06:30 -0000
>>>>>> @@ -64,6 +64,7 @@
>>>>>> #include "mdfdevsound.h"
>>>>>> #include "mdfdebug.h"
>>>>>> #include "CHXMMFDevSound.h"
>>>>>> +#include "mdfaudfmt.h"
>>>>>>
>>>>>> inline
>>>>>> TUint SamplesToMS(TUint count, TUint rate)
>>>>>> @@ -681,7 +682,8 @@
>>>>>> if(m_fourCC == KMMFFourCCCodeAMR ||
>>>>>> m_fourCC == KMMFFourCCCodeAAC ||
>>>>>> m_fourCC == KMMFFourCCCodeAWB ||
>>>>>> - m_fourCC == KMMFFourCCCodeAMRW )
>>>>>> + m_fourCC == KMMFFourCCCodeAMRW ||
>>>>>> + m_fourCC == KMMFFourCCCodeEAACP)
>>>>>> {
>>>>>> CErrorConcealmentIntfc *ErrCI = 0;
>>>>>> TRAPD(err, (ErrCI =
>>>>>>CErrorConcealmentIntfc::NewL(*m_pDevSound)));
>>>>>>
>>>>>
>>>>>
>>>>>
>>>>
>>>>_______________________________________________
>>>>Client-dev mailing list
>>>>Client-dev@helixcommunity.org
>>>>http://lists.helixcommunity.org/mailman/listinfo/client-dev
>>>>
>>
>>
>
>_______________________________________________
>Client-dev mailing list
>Client-dev@helixcommunity.org
>http://lists.helixcommunity.org/mailman/listinfo/client-dev
>
From jgordon at real.com Mon Nov 10 12:09:42 2008
From: jgordon at real.com (Jamie Gordon)
Date: Mon Nov 10 10:13:46 2008
Subject: [datatype-dev] CR: To Support the Fix bounds checking in Bitstream
class
In-Reply-To: <002001c94337$f980cd40$7601a8c0@AlokSystem>
References: <002001c94337$f980cd40$7601a8c0@AlokSystem>
Message-ID: <49189506.4020907@real.com>
In datatype/common/util/bitpack.cpp:
+ ULONG32 ulSize = ( bitCount % 8 ) != 0 ? ( bitCount /8 ) + 1 : (
bitCount /8);
This should probably just be simplified for efficiency to
UINT32 ulSize = (bitCount + 7) / 8;
Thanks,
Jamie
Alok Jain wrote:
>
>
> *Synopsis:*
> To Support the Fix bounds checking in Bitstream class.
>
> *Overview:*
> Add the method BitsLeft() inside Bitstream class for Fix bounds checking
> and
>
> modified all the instance where GetBits() or PeekBits() is used as a
> method of
>
> Bitstream class.
>
>
> *Files Modified:*
> /datatype/common/util/bitpack.cpp
>
> /datatype/common/util/bitstream.cpp
>
> /datatype/common/util/pub/bitstream.h
>
> /datatype/common/util/test/tbitpack.cpp
>
> /datatype/common/util/pub/bitpack.h
>
> /datatype/aac/fileformat/ADIFfile.cpp
>
> /datatype/aac/fileformat/aacff.cpp
>
> /datatype/aac/fileformat/aacfiletypes.h
>
> /datatype/h263/payload/h263pyld.cpp
>
> /datatype/h263/payload/rfc2190hlpr.cpp
>
> /datatype/h263/payload/rfc2429hlpr.cpp
>
> /datatype/mp4/payload/Umakefil
>
> /datatype/mp4/payload/amr-depack.cpp
>
> /datatype/mp4/payload/mp4-latm-depack.cpp
>
> /datatype/mp4/payload/mp4a-mux-cfg.cpp
>
> / datatype/mp4/payload/pub/amr-depack.h
>
> /datatype/mp4/payload/pub/mp4-latm-depack.h
>
> /datatype/mp4/payload/pub/mp4a-mux-cfg.h
>
>
> *Files Added:*
> None
>
> *Image Size and Heap Use impact (Client -Only):*
> None.
>
> * Platforms and Profiles Affected:*
> None
>
> * Distribution Libraries Affected*:
> None.
>
> *Distribution library impact and planned action:*
> None.
>
> *Platforms and Profiles Build Verified:*
> Profile: helix-client-all-defines
>
> *BIF branch:* helix.bif
> *Target:* splay
> *Branch:* HEAD
>
> Thanks
> Alok Jain
>
>
>
>
> ------------------------------------------------------------------------
>
> _______________________________________________
> Datatype-dev mailing list
> Datatype-dev@helixcommunity.org
> http://lists.helixcommunity.org/mailman/listinfo/datatype-dev
From alokj at real.com Tue Nov 11 04:44:32 2008
From: alokj at real.com (Alok Jain)
Date: Tue Nov 11 02:48:24 2008
Subject: [datatype-dev] Re:CR: To Support the Fix bounds checking in
Bitstream class
References: <002001c94337$f980cd40$7601a8c0@AlokSystem>
<008b01c94355$3d746850$b85d38f0$@com>
Message-ID: <001801c943fb$41617c90$7601a8c0@AlokSystem>
Hi Eric,
Thanks for the suggestions.
Suggested changes have been incorporated.
Please find the Diff attached.
Thanks
Alok Jain
----- Original Message -----
From: "Eric Hyche"
To: "'Alok Jain'" ;
Sent: Monday, November 10, 2008 10:26 PM
Subject: RE: [datatype-dev] CR: To Support the Fix bounds checking in
Bitstream class
> Alok,
>
> Here are my comments:
>
> 1) datatype/common/util/pub/bitstream.h changes look good.
> 2) datatype/common/util/test/tbitpack.cpp changes look good.
> 3) datatype/common/util/pub/bitpack.h changes look good.
> 4) In datatype/common/util/bitstream.cpp, here:
>
> @@ -113,6 +116,7 @@
> m_bitCount = 8 - (bitCount - m_bitCount);
> }
>
> + m_ulBufSizeBits -= bitCount;
> return ret;
> }
>
> If someone does ignore the BitsLeft() and goes ahead
> and calls GetBits(), then m_ulBufSizeBits could wrap around
> 32-bits and become huge. So we should add a check here
> to make sure that m_ulBufSizeBits only goes down to zero
> and does not wrap around:
>
> + m_ulBufSizeBits -= (bitCount <= m_ulBufSizeBits ? bitCount :
> m_ulBufSizeBits);
>
> 5) In datatype/common/util/bitpack.cpp,
>
> + ulLeft = bs.BitsLeft();
> + if (ulLeft < (UINT32) bitCount)
> + {
> + return HXR_FAIL;
> + }
> while(bitCount)
> {
> int bits = (bitCount > 8) ? 8 : bitCount;
> PackBits(bs.GetBits(bits), bits);
> bitCount -= bits;
> }
> + return HXR_OK;
>
> Here you are only checking once outside the while() loop.
> If we ran out of bits *inside* the while() loop, then
> we would crash. We need to add a check inside of the
> while loop prior to the bs.GetBits() call.
>
> 6) datatype/aac/fileformat/ADIFfile.cpp
>
> + HXLOGL1("Failed to add explicit SBR signal to
> AudioSpecificConfig");
>
> Please use a fourcc in your log statements. In this case, since
> this code is in the AAC file format, then you would use HXLOG_AACF. So
> it would look like:
>
> + HXLOGL1(HXLOG_AACF, "Failed to add explicit SBR signal to
> AudioSpecificConfig");
>
>
> - UINT16 unADIFHeaderSize = 0;
>
> Since we are converting unADIFHeaderSize from a local variable
> to an out parameter, we should still set it to 0 here. Otherwise,
> if someone didn't initialize it to 0 before passing it into
> ParseADIFHeader(), then we would get an incorrect value.
>
>
> 7) datatype/aac/fileformat/aacff.cpp - changes looks good
> 8) datatype/aac/fileformat/aacfiletypes.h - changes look good
> 9) datatype/h263/payload/h263pyld.cpp - changes look good
> 10) datatype/h263/payload/rfc2190hlpr.cpp - changes look good
> 11) datatype/h263/payload/rfc2429hlpr.cpp - changes look good
> 12) datatype/mp4/payload/Umakefil - changes look good
> 13) datatype/mp4/payload/amr-depack.cpp
>
> + HXLOGL1("Failed GetTOCInfo()");
>
> For all of the log messages in amr-depack.cpp, use the
> HXLOG_GENE fourcc.
>
> - SortedCopy(bs, ulStartBlock, ulBlockInc, tocInfo);
> + if (!SortedCopy(bs, ulStartBlock, ulBlockInc, tocInfo))
> + {
> + bFailed =TRUE;
> + }
>
> This change looks fine, but it looks like you need a
> similar check for LinearCopy() as well.
>
> Also, if either SortedCopy() or LinearCopy() fail
> and you don't return immediately after the failure,
> then you'll need a !bFailed check here:
>
> if (m_ulMaxInterleave > 0)
>
> @@ -493,6 +546,12 @@
> pCurrent[ulFrameBytes - 1] = 0;
>
> // Copy frame bits into the buffer
> + UINT32 ulLeft = bs.BitsLeft();
> + if (ulLeft < ulFrameBits)
> + {
> + bFailed = TRUE;
> + break;
> + }
> bs.GetBits(ulFrameBits, pCurrent);
>
> These changes are in GetFrameBlock(), which currently has
> no way of returning failure. You'll need to modify GetFrameBlock()
> to be able to communicate failure and return ulRet as
> an out parameter.
>
> 14) datatype/mp4/payload/mp4-latm-depack.cpp - changes look good
> 15) datatype/mp4/payload/mp4a-mux-cfg.cpp
>
> - AudioObjectType = GetAudioObjectType(bs);
> + if (!GetAudioObjectType(bs,AudioObjectType))
> + {
> + HXLOGL1("Failed GetAudioObjectType()");
> + }
>
> Seems like you should go ahead and return FALSE here, or
> include !failed checks for the rest of the function.
> Use HXLOG_GENE fourcc throughout.
>
> - ExtnAudioObjectType = GetAudioObjectType(bs);
> + if (!GetAudioObjectType(bs,ExtnAudioObjectType))
> + {
> + HXLOGL1("Failed GetAudioObjectType()");
> + }
>
> Probably need to return FALSE here.
>
> + ulLeft = bs.BitsLeft();
> + if (ulLeft < (ulAscLen - ulAscBits))
> + {
> + return FALSE;
> + }
> // get fill bits
> ulAscLen -= ulAscBits;
> bs.GetBits(ulAscLen);
>
> Why not just move the BitsLeft() check to right before
> the GetBits() call and just make it "if (ulLeft < ulAscLen)"?
>
> -ULONG32 MP4AMuxConfig::LatmGetValue(Bitstream&bs, ULONG32& nBits)
> +HXBOOL MP4AMuxConfig::LatmGetValue(Bitstream&bs, ULONG32& nBits, ULONG32&
> ulValue)
> {
> - ULONG32 ulValue = 0;
>
> We should still initialize ulValue to 0 at the top of LatmGetValue() just
> in case the caller forgets to initialize it.
>
> 16) datatype/mp4/payload/pub/amr-depack.h - changes look good
> 17) datatype/mp4/payload/pub/mp4-latm-depack.h - changes look good
> 18) datatype/mp4/payload/pub/mp4a-mux-cfg.h - changes look good
>
> Please make the additional changes to LinearCopy() in amr-depack.cpp
> and amr-depack.h and re-submit just diffs of those two files for
> additional
> review (no need to submit all the other diffs again).
>
> Eric
>
> =======================================
> Eric Hyche (ehyche@real.com)
> Principal Engineer
> RealNetworks, Inc.
>
>
>>-----Original Message-----
>>From: datatype-dev-bounces@helixcommunity.org
>>[mailto:datatype-dev-bounces@helixcommunity.org] On
>>Behalf Of Alok Jain
>>Sent: Monday, November 10, 2008 8:27 AM
>>To: datatype-dev@helixcommunity.org
>>Cc: Alok Jain
>>Subject: [datatype-dev] CR: To Support the Fix bounds checking in
>>Bitstream class
>>
>>
>>
>>Synopsis:
>> To Support the Fix bounds checking in Bitstream class.
>>
>>Overview:
>>Add the method BitsLeft() inside Bitstream class for Fix bounds checking
>>and
>>
>>modified all the instance where GetBits() or PeekBits() is used as a
>>method of
>>
>>Bitstream class.
>>
>>
>>Files Modified:
>>/datatype/common/util/bitpack.cpp
>>
>>/datatype/common/util/bitstream.cpp
>>
>>/datatype/common/util/pub/bitstream.h
>>
>>/datatype/common/util/test/tbitpack.cpp
>>
>>/datatype/common/util/pub/bitpack.h
>>
>>/datatype/aac/fileformat/ADIFfile.cpp
>>
>>/datatype/aac/fileformat/aacff.cpp
>>
>>/datatype/aac/fileformat/aacfiletypes.h
>>
>>/datatype/h263/payload/h263pyld.cpp
>>
>>/datatype/h263/payload/rfc2190hlpr.cpp
>>
>>/datatype/h263/payload/rfc2429hlpr.cpp
>>
>>/datatype/mp4/payload/Umakefil
>>
>>/datatype/mp4/payload/amr-depack.cpp
>>
>>/datatype/mp4/payload/mp4-latm-depack.cpp
>>
>>/datatype/mp4/payload/mp4a-mux-cfg.cpp
>>
>>/ datatype/mp4/payload/pub/amr-depack.h
>>
>>/datatype/mp4/payload/pub/mp4-latm-depack.h
>>
>>/datatype/mp4/payload/pub/mp4a-mux-cfg.h
>>
>>
>>Files Added:
>>None
>>
>>Image Size and Heap Use impact (Client -Only):
>> None.
>>
>> Platforms and Profiles Affected:
>> None
>>
>> Distribution Libraries Affected:
>> None.
>>
>> Distribution library impact and planned action:
>> None.
>>
>> Platforms and Profiles Build Verified:
>> Profile: helix-client-all-defines
>>
>>BIF branch: helix.bif
>>Target: splay
>>Branch: HEAD
>>
>>Thanks
>>Alok Jain
>>
>>
>
>
-------------- next part --------------
Index: amr-depack.cpp
===================================================================
RCS file: /cvsroot/datatype/mp4/payload/amr-depack.cpp,v
retrieving revision 1.7
diff -u -w -r1.7 amr-depack.cpp
--- amr-depack.cpp 14 Mar 2005 19:17:44 -0000 1.7
+++ amr-depack.cpp 11 Nov 2008 12:24:25 -0000
@@ -38,7 +38,7 @@
#include "amr_toc.h"
#include "amr_rs_itr.h"
#include "bitstream.h"
-
+#include "hxtlogutil.h"
AMRDepack::AMRDepack() :
m_flavor(NarrowBand),
@@ -164,21 +164,43 @@
Bitstream bs;
- bs.SetBuffer(pData);
+ bs.SetBuffer(pData, ulSize);
+ UINT32 ulLeft = bs.BitsLeft();
// Skip the CMR since we don't care about it
if (m_bOctetAlign)
{
+ if (ulLeft < 8)
+ {
+ bFailed =TRUE;
+ }
// 3GPP TS26.235 v5.0.0 Annex B Section B.4.4.1
+ else
+ {
bs.GetBits(8);
}
+ }
else
{
+ if (ulLeft < 4)
+ {
+ bFailed =TRUE;
+ }
// 3GPP TS26.235 v5.0.0 Annex B Section B.4.3.1
+ else
+ {
bs.GetBits(4);
}
+ }
- if (m_ulMaxInterleave > 0)
+ if (m_ulMaxInterleave > 0 && !bFailed)
+ {
+ ulLeft = bs.BitsLeft();
+ if (ulLeft < 8)
+ {
+ bFailed =TRUE;
+ }
+ else
{
// 3GPP TS26.235 v5.0.0 Annex B Section B.4.4.1
ULONG32 ulILL = bs.GetBits(4);
@@ -186,17 +208,26 @@
bFailed = !UpdateIleavInfo(ulILL, ulILP, ulTime);
}
+ }
if (bFailed == FALSE)
{
AMRTOCInfo tocInfo;
- GetTOCInfo(bs, tocInfo);
+ if (!GetTOCInfo(bs, tocInfo))
+ {
+ HXLOGL1(HXLOG_GENE, "Failed GetTOCInfo()");
+ return FALSE;
+ }
if (m_bHasCRC)
{
// 3GPP TS26.235 v5.0.0 Annex B Section B.4.4.2.1
- SkipCRCInfo(bs, tocInfo);
+ if (!SkipCRCInfo(bs, tocInfo))
+ {
+ HXLOGL1(HXLOG_GENE, "Failed SkipCRCInfo()");
+ return FALSE;
+ }
}
// Update the block count to make sure we have
@@ -218,12 +249,18 @@
if (m_bRobustSort)
{
// Copy robust sorted frame data to m_blockBuf
- SortedCopy(bs, ulStartBlock, ulBlockInc, tocInfo);
+ if (!SortedCopy(bs, ulStartBlock, ulBlockInc, tocInfo))
+ {
+ return FALSE;
+ }
}
else
{
// Copy linear frame data to m_blockBuf
- LinearCopy(bs, ulStartBlock, ulBlockInc, tocInfo);
+ if (!LinearCopy(bs, ulStartBlock, ulBlockInc, tocInfo))
+ {
+ return FALSE;
+ }
}
if (m_ulMaxInterleave > 0)
@@ -320,12 +357,13 @@
return !bFailed;
}
-void AMRDepack::GetTOCInfo(Bitstream& bs, AMRTOCInfo& tocInfo)
+HXBOOL AMRDepack::GetTOCInfo(Bitstream& bs, AMRTOCInfo& tocInfo)
{
ULONG32 ulTocBits;
ULONG32 ulTocMask;
ULONG32 ulShift;
+ HXBOOL bFailed = FALSE;
if (m_bOctetAlign)
{
@@ -363,9 +401,15 @@
}
HXBOOL bDone = FALSE;
-
+ UINT32 ulLeft = 0;
while(!bDone)
{
+ ulLeft = bs.BitsLeft();
+ if (ulLeft < ulTocBits)
+ {
+ bFailed =TRUE;
+ break;
+ }
ULONG32 entry = bs.GetBits(ulTocBits);
UINT8 type = (UINT8)(entry >> (ulShift + 1)) & 0x0f;
UINT8 quality = (UINT8)(entry >> ulShift) & 0x01;
@@ -375,18 +419,30 @@
if ((entry & ulTocMask) == 0)
bDone = TRUE;
}
+ return !bFailed;
}
-void AMRDepack::SkipCRCInfo(Bitstream& bs, const AMRTOCInfo& tocInfo)
+HXBOOL AMRDepack::SkipCRCInfo(Bitstream& bs, const AMRTOCInfo& tocInfo)
{
+ HXBOOL bFailed = FALSE;
// Skip CRCs if they are present since we don't
// care about them.
for (ULONG32 i = 0; i < tocInfo.EntryCount(); i++)
{
if (tocInfo.GetType(i) < 14)
+ {
+ UINT32 ulLeft = bs.BitsLeft();
+ if (ulLeft < 8)
+ {
+ bFailed =TRUE;
+ break;
+ }
bs.GetBits(8);
}
}
+ return !bFailed;
+
+}
void AMRDepack::UpdateBlockCount(ULONG32 ulBlockCount)
@@ -410,10 +466,11 @@
}
}
-void AMRDepack::LinearCopy(Bitstream& bs,
+HXBOOL AMRDepack::LinearCopy(Bitstream& bs,
ULONG32 ulStartBlock, ULONG32 ulBlockInc,
const AMRTOCInfo& tocInfo)
{
+ HXBOOL bFailed = FALSE;
ULONG32 ulBlockIndex = ulStartBlock;
ULONG32 ulFrameIndex = 0;
@@ -421,10 +478,14 @@
{
UINT8* pStart = m_blockBuf.GetBlockBuf(ulBlockIndex);
- ULONG32 ulFrameSize = GetFrameBlock(bs,
+ ULONG32 ulFrameSize = 0;
+ if (!GetFrameBlock(bs,
pStart,
tocInfo, ulFrameIndex,
- m_ulChannels);
+ m_ulChannels, ulFrameSize))
+ {
+ return FALSE;
+ }
if (ulFrameSize)
{
@@ -439,23 +500,28 @@
ulFrameIndex += m_ulChannels;
}
else
+ {
+ bFailed = TRUE;
break;
}
}
+ return !bFailed;
+}
-ULONG32 AMRDepack::GetFrameBlock(Bitstream& bs,
+HXBOOL AMRDepack::GetFrameBlock(Bitstream& bs,
UINT8* pStart,
const AMRTOCInfo& tocInfo,
ULONG32 ulStartEntry,
- ULONG32 ulChannels)
+ ULONG32 ulChannels,
+ ULONG32& ulRet)
{
- ULONG32 ulRet = 0;
+ ulRet = 0;
+ HXBOOL bFailed = FALSE;
ULONG32 ulEnd = ulChannels + ulStartEntry;
if (ulEnd <= tocInfo.EntryCount())
{
- HXBOOL bFailed = FALSE;
UINT8* pCurrent = pStart;
for (ULONG32 i = ulStartEntry; i < ulEnd; i++)
@@ -493,6 +559,12 @@
pCurrent[ulFrameBytes - 1] = 0;
// Copy frame bits into the buffer
+ UINT32 ulLeft = bs.BitsLeft();
+ if (ulLeft < ulFrameBits)
+ {
+ bFailed = TRUE;
+ break;
+ }
bs.GetBits(ulFrameBits, pCurrent);
// Move current pointer to just past this frame
@@ -510,13 +582,14 @@
ulRet = pCurrent - pStart;
}
- return ulRet;
+ return !bFailed;
}
-void AMRDepack::SortedCopy(Bitstream& bs,
+HXBOOL AMRDepack::SortedCopy(Bitstream& bs,
ULONG32 ulStartBlock, ULONG32 ulBlockInc,
const AMRTOCInfo& tocInfo)
{
+ HXBOOL bFailed = FALSE;
// This function copies robust sorted data from the packet.
// Unfortunately this is not very efficient because the bytes
// of each frame are interleaved with eachother. The
@@ -532,8 +605,15 @@
UINT8* pDest = m_blockBuf.GetBlockBuf(itr.Block()) + itr.Offset();
// Copy the byte
+ UINT32 ulLeft = bs.BitsLeft();
+ if (ulLeft < 8)
+ {
+ bFailed = TRUE;
+ break;
+ }
*pDest = (UINT8)bs.GetBits(8);
}
+ return !bFailed;
}
void AMRDepack::DispatchFrameBlock(ULONG32 ulTimestamp,
Index: pub/amr-depack.h
===================================================================
RCS file: /cvsroot/datatype/mp4/payload/pub/amr-depack.h,v
retrieving revision 1.5
diff -u -w -r1.5 amr-depack.h
--- pub/amr-depack.h 14 Mar 2005 19:17:45 -0000 1.5
+++ pub/amr-depack.h 11 Nov 2008 12:24:25 -0000
@@ -83,22 +83,23 @@
protected:
HXBOOL UpdateIleavInfo(ULONG32 ulILL, ULONG32 ulILP, ULONG32 ulTime);
- void GetTOCInfo(Bitstream& bs, AMRTOCInfo& tocInfo);
- void SkipCRCInfo(Bitstream& bs, const AMRTOCInfo& tocInfo);
+ HXBOOL GetTOCInfo(Bitstream& bs, AMRTOCInfo& tocInfo);
+ HXBOOL SkipCRCInfo(Bitstream& bs, const AMRTOCInfo& tocInfo);
void UpdateBlockCount(ULONG32 ulBlockCount);
// Copies linear frame data to m_blockBuf
- void LinearCopy(Bitstream& bs, ULONG32 ulStartBlock, ULONG32 ulBlockInc,
+ HXBOOL LinearCopy(Bitstream& bs, ULONG32 ulStartBlock, ULONG32 ulBlockInc,
const AMRTOCInfo& tocInfo);
- ULONG32 GetFrameBlock(Bitstream& bs,
+ HXBOOL GetFrameBlock(Bitstream& bs,
UINT8* pStart,
const AMRTOCInfo& tocInfo,
ULONG32 ulStartEntry,
- ULONG32 ulChannels);
+ ULONG32 ulChannels,
+ ULONG32& ulRet);
// Copies robust sorted frame data to m_blockBuf
- void SortedCopy(Bitstream& bs, ULONG32 ulStartBlock, ULONG32 ulBlockInc,
+ HXBOOL SortedCopy(Bitstream& bs, ULONG32 ulStartBlock, ULONG32 ulBlockInc,
const AMRTOCInfo& tocInfo);
void DispatchBlocks(ULONG32 ulTimestamp);
From ehyche at real.com Tue Nov 11 06:38:09 2008
From: ehyche at real.com (Eric Hyche)
Date: Tue Nov 11 04:42:00 2008
Subject: [datatype-dev] RE: CR: To Support the Fix bounds checking in
Bitstream class
In-Reply-To: <001801c943fb$41617c90$7601a8c0@AlokSystem>
References: <002001c94337$f980cd40$7601a8c0@AlokSystem>
<008b01c94355$3d746850$b85d38f0$@com>
<001801c943fb$41617c90$7601a8c0@AlokSystem>
Message-ID: <004d01c9440b$1edf27c0$5c9d7740$@com>
These additional changes look good. Please check
all of the changes into HEAD only for now.
However, please save your diff files. We may be asked to
merge these to 310Atlas or other branches, so keeping
the diff files around will make that merge easily should
we be asked to do that.
Eric
=======================================
Eric Hyche (ehyche@real.com)
Principal Engineer
RealNetworks, Inc.
>-----Original Message-----
>From: Alok Jain [mailto:alokj@real.com]
>Sent: Tuesday, November 11, 2008 7:45 AM
>To: ehyche@real.com; datatype-dev@helixcommunity.org
>Cc: Alok Jain
>Subject: Re:CR: To Support the Fix bounds checking in Bitstream class
>
>Hi Eric,
>Thanks for the suggestions.
>
>Suggested changes have been incorporated.
>
>Please find the Diff attached.
>
>
>
>Thanks
>
>Alok Jain
>
>----- Original Message -----
>From: "Eric Hyche"
>To: "'Alok Jain'" ;
>Sent: Monday, November 10, 2008 10:26 PM
>Subject: RE: [datatype-dev] CR: To Support the Fix bounds checking in Bitstream class
>
>
>> Alok,
>>
>> Here are my comments:
>>
>> 1) datatype/common/util/pub/bitstream.h changes look good.
>> 2) datatype/common/util/test/tbitpack.cpp changes look good.
>> 3) datatype/common/util/pub/bitpack.h changes look good.
>> 4) In datatype/common/util/bitstream.cpp, here:
>>
>> @@ -113,6 +116,7 @@
>> m_bitCount = 8 - (bitCount - m_bitCount);
>> }
>>
>> + m_ulBufSizeBits -= bitCount;
>> return ret;
>> }
>>
>> If someone does ignore the BitsLeft() and goes ahead
>> and calls GetBits(), then m_ulBufSizeBits could wrap around
>> 32-bits and become huge. So we should add a check here
>> to make sure that m_ulBufSizeBits only goes down to zero
>> and does not wrap around:
>>
>> + m_ulBufSizeBits -= (bitCount <= m_ulBufSizeBits ? bitCount :
>> m_ulBufSizeBits);
>>
>> 5) In datatype/common/util/bitpack.cpp,
>>
>> + ulLeft = bs.BitsLeft();
>> + if (ulLeft < (UINT32) bitCount)
>> + {
>> + return HXR_FAIL;
>> + }
>> while(bitCount)
>> {
>> int bits = (bitCount > 8) ? 8 : bitCount; PackBits(bs.GetBits(bits),
>> bits); bitCount -= bits;
>> }
>> + return HXR_OK;
>>
>> Here you are only checking once outside the while() loop.
>> If we ran out of bits *inside* the while() loop, then
>> we would crash. We need to add a check inside of the
>> while loop prior to the bs.GetBits() call.
>>
>> 6) datatype/aac/fileformat/ADIFfile.cpp
>>
>> + HXLOGL1("Failed to add explicit SBR signal to
>> AudioSpecificConfig");
>>
>> Please use a fourcc in your log statements. In this case, since
>> this code is in the AAC file format, then you would use HXLOG_AACF. So
>> it would look like:
>>
>> + HXLOGL1(HXLOG_AACF, "Failed to add explicit SBR
>> + signal to
>> AudioSpecificConfig");
>>
>>
>> - UINT16 unADIFHeaderSize = 0;
>>
>> Since we are converting unADIFHeaderSize from a local variable
>> to an out parameter, we should still set it to 0 here. Otherwise,
>> if someone didn't initialize it to 0 before passing it into
>> ParseADIFHeader(), then we would get an incorrect value.
>>
>>
>> 7) datatype/aac/fileformat/aacff.cpp - changes looks good
>> 8) datatype/aac/fileformat/aacfiletypes.h - changes look good
>> 9) datatype/h263/payload/h263pyld.cpp - changes look good
>> 10) datatype/h263/payload/rfc2190hlpr.cpp - changes look good
>> 11) datatype/h263/payload/rfc2429hlpr.cpp - changes look good
>> 12) datatype/mp4/payload/Umakefil - changes look good
>> 13) datatype/mp4/payload/amr-depack.cpp
>>
>> + HXLOGL1("Failed GetTOCInfo()");
>>
>> For all of the log messages in amr-depack.cpp, use the
>> HXLOG_GENE fourcc.
>>
>> - SortedCopy(bs, ulStartBlock, ulBlockInc, tocInfo);
>> + if (!SortedCopy(bs, ulStartBlock, ulBlockInc, tocInfo))
>> + {
>> + bFailed =TRUE;
>> + }
>>
>> This change looks fine, but it looks like you need a
>> similar check for LinearCopy() as well.
>>
>> Also, if either SortedCopy() or LinearCopy() fail
>> and you don't return immediately after the failure,
>> then you'll need a !bFailed check here:
>>
>> if (m_ulMaxInterleave > 0)
>>
>> @@ -493,6 +546,12 @@
>> pCurrent[ulFrameBytes - 1] = 0;
>>
>> // Copy frame bits into the buffer
>> + UINT32 ulLeft = bs.BitsLeft();
>> + if (ulLeft < ulFrameBits)
>> + {
>> + bFailed = TRUE;
>> + break;
>> + }
>> bs.GetBits(ulFrameBits, pCurrent);
>>
>> These changes are in GetFrameBlock(), which currently has no way of
>> returning failure. You'll need to modify GetFrameBlock() to be able
>> to communicate failure and return ulRet as an out parameter.
>>
>> 14) datatype/mp4/payload/mp4-latm-depack.cpp - changes look good
>> 15) datatype/mp4/payload/mp4a-mux-cfg.cpp
>>
>> - AudioObjectType = GetAudioObjectType(bs);
>> + if (!GetAudioObjectType(bs,AudioObjectType))
>> + {
>> + HXLOGL1("Failed GetAudioObjectType()");
>> + }
>>
>> Seems like you should go ahead and return FALSE here, or
>> include !failed checks for the rest of the function.
>> Use HXLOG_GENE fourcc throughout.
>>
>> - ExtnAudioObjectType = GetAudioObjectType(bs);
>> + if (!GetAudioObjectType(bs,ExtnAudioObjectType))
>> + {
>> + HXLOGL1("Failed GetAudioObjectType()");
>> + }
>>
>> Probably need to return FALSE here.
>>
>> + ulLeft = bs.BitsLeft();
>> + if (ulLeft < (ulAscLen - ulAscBits))
>> + {
>> + return FALSE;
>> + }
>> // get fill bits
>> ulAscLen -= ulAscBits;
>> bs.GetBits(ulAscLen);
>>
>> Why not just move the BitsLeft() check to right before the GetBits()
>> call and just make it "if (ulLeft < ulAscLen)"?
>>
>> -ULONG32 MP4AMuxConfig::LatmGetValue(Bitstream&bs, ULONG32& nBits)
>> +HXBOOL MP4AMuxConfig::LatmGetValue(Bitstream&bs, ULONG32& nBits,
>> +ULONG32&
>> ulValue)
>> {
>> - ULONG32 ulValue = 0;
>>
>> We should still initialize ulValue to 0 at the top of LatmGetValue()
>> just in case the caller forgets to initialize it.
>>
>> 16) datatype/mp4/payload/pub/amr-depack.h - changes look good
>> 17) datatype/mp4/payload/pub/mp4-latm-depack.h - changes look good
>> 18) datatype/mp4/payload/pub/mp4a-mux-cfg.h - changes look good
>>
>> Please make the additional changes to LinearCopy() in amr-depack.cpp
>> and amr-depack.h and re-submit just diffs of those two files for
>> additional review (no need to submit all the other diffs again).
>>
>> Eric
>>
>> =======================================
>> Eric Hyche (ehyche@real.com)
>> Principal Engineer
>> RealNetworks, Inc.
>>
>>
>>>-----Original Message-----
>>>From: datatype-dev-bounces@helixcommunity.org
>>>[mailto:datatype-dev-bounces@helixcommunity.org] On Behalf Of Alok
>>>Jain
>>>Sent: Monday, November 10, 2008 8:27 AM
>>>To: datatype-dev@helixcommunity.org
>>>Cc: Alok Jain
>>>Subject: [datatype-dev] CR: To Support the Fix bounds checking in
>>>Bitstream class
>>>
>>>
>>>
>>>Synopsis:
>>> To Support the Fix bounds checking in Bitstream class.
>>>
>>>Overview:
>>>Add the method BitsLeft() inside Bitstream class for Fix bounds
>>>checking and
>>>
>>>modified all the instance where GetBits() or PeekBits() is used as a
>>>method of
>>>
>>>Bitstream class.
>>>
>>>
>>>Files Modified:
>>>/datatype/common/util/bitpack.cpp
>>>
>>>/datatype/common/util/bitstream.cpp
>>>
>>>/datatype/common/util/pub/bitstream.h
>>>
>>>/datatype/common/util/test/tbitpack.cpp
>>>
>>>/datatype/common/util/pub/bitpack.h
>>>
>>>/datatype/aac/fileformat/ADIFfile.cpp
>>>
>>>/datatype/aac/fileformat/aacff.cpp
>>>
>>>/datatype/aac/fileformat/aacfiletypes.h
>>>
>>>/datatype/h263/payload/h263pyld.cpp
>>>
>>>/datatype/h263/payload/rfc2190hlpr.cpp
>>>
>>>/datatype/h263/payload/rfc2429hlpr.cpp
>>>
>>>/datatype/mp4/payload/Umakefil
>>>
>>>/datatype/mp4/payload/amr-depack.cpp
>>>
>>>/datatype/mp4/payload/mp4-latm-depack.cpp
>>>
>>>/datatype/mp4/payload/mp4a-mux-cfg.cpp
>>>
>>>/ datatype/mp4/payload/pub/amr-depack.h
>>>
>>>/datatype/mp4/payload/pub/mp4-latm-depack.h
>>>
>>>/datatype/mp4/payload/pub/mp4a-mux-cfg.h
>>>
>>>
>>>Files Added:
>>>None
>>>
>>>Image Size and Heap Use impact (Client -Only):
>>> None.
>>>
>>> Platforms and Profiles Affected:
>>> None
>>>
>>> Distribution Libraries Affected:
>>> None.
>>>
>>> Distribution library impact and planned action:
>>> None.
>>>
>>> Platforms and Profiles Build Verified:
>>> Profile: helix-client-all-defines
>>>
>>>BIF branch: helix.bif
>>>Target: splay
>>>Branch: HEAD
>>>
>>>Thanks
>>>Alok Jain
>>>
>>>
>>
>>
From alokj at real.com Tue Nov 11 07:45:19 2008
From: alokj at real.com (Alok Jain)
Date: Tue Nov 11 05:49:09 2008
Subject: [datatype-dev] CN: To Support the Fix bounds checking in Bitstream
class
References: <002001c94337$f980cd40$7601a8c0@AlokSystem>
<008b01c94355$3d746850$b85d38f0$@com>
<001801c943fb$41617c90$7601a8c0@AlokSystem>
<004d01c9440b$1edf27c0$5c9d7740$@com>
Message-ID: <009801c94414$826854c0$7601a8c0@AlokSystem>
Thanks Eric,
This is now checked into HEAD.
Thanks
Alok
----- Original Message -----
From: "Eric Hyche"
To: "'Alok Jain'" ;
Sent: Tuesday, November 11, 2008 8:08 PM
Subject: RE: CR: To Support the Fix bounds checking in Bitstream class
> These additional changes look good. Please check
> all of the changes into HEAD only for now.
>
> However, please save your diff files. We may be asked to
> merge these to 310Atlas or other branches, so keeping
> the diff files around will make that merge easily should
> we be asked to do that.
>
> Eric
>
> =======================================
> Eric Hyche (ehyche@real.com)
> Principal Engineer
> RealNetworks, Inc.
>
>
>>-----Original Message-----
>>From: Alok Jain [mailto:alokj@real.com]
>>Sent: Tuesday, November 11, 2008 7:45 AM
>>To: ehyche@real.com; datatype-dev@helixcommunity.org
>>Cc: Alok Jain
>>Subject: Re:CR: To Support the Fix bounds checking in Bitstream class
>>
>>Hi Eric,
>>Thanks for the suggestions.
>>
>>Suggested changes have been incorporated.
>>
>>Please find the Diff attached.
>>
>>
>>
>>Thanks
>>
>>Alok Jain
>>
>>----- Original Message -----
>>From: "Eric Hyche"
>>To: "'Alok Jain'" ;
>>Sent: Monday, November 10, 2008 10:26 PM
>>Subject: RE: [datatype-dev] CR: To Support the Fix bounds checking in
>>Bitstream class
>>
>>
>>> Alok,
>>>
>>> Here are my comments:
>>>
>>> 1) datatype/common/util/pub/bitstream.h changes look good.
>>> 2) datatype/common/util/test/tbitpack.cpp changes look good.
>>> 3) datatype/common/util/pub/bitpack.h changes look good.
>>> 4) In datatype/common/util/bitstream.cpp, here:
>>>
>>> @@ -113,6 +116,7 @@
>>> m_bitCount = 8 - (bitCount - m_bitCount);
>>> }
>>>
>>> + m_ulBufSizeBits -= bitCount;
>>> return ret;
>>> }
>>>
>>> If someone does ignore the BitsLeft() and goes ahead
>>> and calls GetBits(), then m_ulBufSizeBits could wrap around
>>> 32-bits and become huge. So we should add a check here
>>> to make sure that m_ulBufSizeBits only goes down to zero
>>> and does not wrap around:
>>>
>>> + m_ulBufSizeBits -= (bitCount <= m_ulBufSizeBits ? bitCount :
>>> m_ulBufSizeBits);
>>>
>>> 5) In datatype/common/util/bitpack.cpp,
>>>
>>> + ulLeft = bs.BitsLeft();
>>> + if (ulLeft < (UINT32) bitCount)
>>> + {
>>> + return HXR_FAIL;
>>> + }
>>> while(bitCount)
>>> {
>>> int bits = (bitCount > 8) ? 8 : bitCount; PackBits(bs.GetBits(bits),
>>> bits); bitCount -= bits;
>>> }
>>> + return HXR_OK;
>>>
>>> Here you are only checking once outside the while() loop.
>>> If we ran out of bits *inside* the while() loop, then
>>> we would crash. We need to add a check inside of the
>>> while loop prior to the bs.GetBits() call.
>>>
>>> 6) datatype/aac/fileformat/ADIFfile.cpp
>>>
>>> + HXLOGL1("Failed to add explicit SBR signal to
>>> AudioSpecificConfig");
>>>
>>> Please use a fourcc in your log statements. In this case, since
>>> this code is in the AAC file format, then you would use HXLOG_AACF. So
>>> it would look like:
>>>
>>> + HXLOGL1(HXLOG_AACF, "Failed to add explicit SBR
>>> + signal to
>>> AudioSpecificConfig");
>>>
>>>
>>> - UINT16 unADIFHeaderSize = 0;
>>>
>>> Since we are converting unADIFHeaderSize from a local variable
>>> to an out parameter, we should still set it to 0 here. Otherwise,
>>> if someone didn't initialize it to 0 before passing it into
>>> ParseADIFHeader(), then we would get an incorrect value.
>>>
>>>
>>> 7) datatype/aac/fileformat/aacff.cpp - changes looks good
>>> 8) datatype/aac/fileformat/aacfiletypes.h - changes look good
>>> 9) datatype/h263/payload/h263pyld.cpp - changes look good
>>> 10) datatype/h263/payload/rfc2190hlpr.cpp - changes look good
>>> 11) datatype/h263/payload/rfc2429hlpr.cpp - changes look good
>>> 12) datatype/mp4/payload/Umakefil - changes look good
>>> 13) datatype/mp4/payload/amr-depack.cpp
>>>
>>> + HXLOGL1("Failed GetTOCInfo()");
>>>
>>> For all of the log messages in amr-depack.cpp, use the
>>> HXLOG_GENE fourcc.
>>>
>>> - SortedCopy(bs, ulStartBlock, ulBlockInc, tocInfo);
>>> + if (!SortedCopy(bs, ulStartBlock, ulBlockInc, tocInfo))
>>> + {
>>> + bFailed =TRUE;
>>> + }
>>>
>>> This change looks fine, but it looks like you need a
>>> similar check for LinearCopy() as well.
>>>
>>> Also, if either SortedCopy() or LinearCopy() fail
>>> and you don't return immediately after the failure,
>>> then you'll need a !bFailed check here:
>>>
>>> if (m_ulMaxInterleave > 0)
>>>
>>> @@ -493,6 +546,12 @@
>>> pCurrent[ulFrameBytes - 1] = 0;
>>>
>>> // Copy frame bits into the buffer
>>> + UINT32 ulLeft = bs.BitsLeft();
>>> + if (ulLeft < ulFrameBits)
>>> + {
>>> + bFailed = TRUE;
>>> + break;
>>> + }
>>> bs.GetBits(ulFrameBits, pCurrent);
>>>
>>> These changes are in GetFrameBlock(), which currently has no way of
>>> returning failure. You'll need to modify GetFrameBlock() to be able
>>> to communicate failure and return ulRet as an out parameter.
>>>
>>> 14) datatype/mp4/payload/mp4-latm-depack.cpp - changes look good
>>> 15) datatype/mp4/payload/mp4a-mux-cfg.cpp
>>>
>>> - AudioObjectType = GetAudioObjectType(bs);
>>> + if (!GetAudioObjectType(bs,AudioObjectType))
>>> + {
>>> + HXLOGL1("Failed GetAudioObjectType()");
>>> + }
>>>
>>> Seems like you should go ahead and return FALSE here, or
>>> include !failed checks for the rest of the function.
>>> Use HXLOG_GENE fourcc throughout.
>>>
>>> - ExtnAudioObjectType = GetAudioObjectType(bs);
>>> + if (!GetAudioObjectType(bs,ExtnAudioObjectType))
>>> + {
>>> + HXLOGL1("Failed GetAudioObjectType()");
>>> + }
>>>
>>> Probably need to return FALSE here.
>>>
>>> + ulLeft = bs.BitsLeft();
>>> + if (ulLeft < (ulAscLen - ulAscBits))
>>> + {
>>> + return FALSE;
>>> + }
>>> // get fill bits
>>> ulAscLen -= ulAscBits;
>>> bs.GetBits(ulAscLen);
>>>
>>> Why not just move the BitsLeft() check to right before the GetBits()
>>> call and just make it "if (ulLeft < ulAscLen)"?
>>>
>>> -ULONG32 MP4AMuxConfig::LatmGetValue(Bitstream&bs, ULONG32& nBits)
>>> +HXBOOL MP4AMuxConfig::LatmGetValue(Bitstream&bs, ULONG32& nBits,
>>> +ULONG32&
>>> ulValue)
>>> {
>>> - ULONG32 ulValue = 0;
>>>
>>> We should still initialize ulValue to 0 at the top of LatmGetValue()
>>> just in case the caller forgets to initialize it.
>>>
>>> 16) datatype/mp4/payload/pub/amr-depack.h - changes look good
>>> 17) datatype/mp4/payload/pub/mp4-latm-depack.h - changes look good
>>> 18) datatype/mp4/payload/pub/mp4a-mux-cfg.h - changes look good
>>>
>>> Please make the additional changes to LinearCopy() in amr-depack.cpp
>>> and amr-depack.h and re-submit just diffs of those two files for
>>> additional review (no need to submit all the other diffs again).
>>>
>>> Eric
>>>
>>> =======================================
>>> Eric Hyche (ehyche@real.com)
>>> Principal Engineer
>>> RealNetworks, Inc.
>>>
>>>
>>>>-----Original Message-----
>>>>From: datatype-dev-bounces@helixcommunity.org
>>>>[mailto:datatype-dev-bounces@helixcommunity.org] On Behalf Of Alok
>>>>Jain
>>>>Sent: Monday, November 10, 2008 8:27 AM
>>>>To: datatype-dev@helixcommunity.org
>>>>Cc: Alok Jain
>>>>Subject: [datatype-dev] CR: To Support the Fix bounds checking in
>>>>Bitstream class
>>>>
>>>>
>>>>
>>>>Synopsis:
>>>> To Support the Fix bounds checking in Bitstream class.
>>>>
>>>>Overview:
>>>>Add the method BitsLeft() inside Bitstream class for Fix bounds
>>>>checking and
>>>>
>>>>modified all the instance where GetBits() or PeekBits() is used as a
>>>>method of
>>>>
>>>>Bitstream class.
>>>>
>>>>
>>>>Files Modified:
>>>>/datatype/common/util/bitpack.cpp
>>>>
>>>>/datatype/common/util/bitstream.cpp
>>>>
>>>>/datatype/common/util/pub/bitstream.h
>>>>
>>>>/datatype/common/util/test/tbitpack.cpp
>>>>
>>>>/datatype/common/util/pub/bitpack.h
>>>>
>>>>/datatype/aac/fileformat/ADIFfile.cpp
>>>>
>>>>/datatype/aac/fileformat/aacff.cpp
>>>>
>>>>/datatype/aac/fileformat/aacfiletypes.h
>>>>
>>>>/datatype/h263/payload/h263pyld.cpp
>>>>
>>>>/datatype/h263/payload/rfc2190hlpr.cpp
>>>>
>>>>/datatype/h263/payload/rfc2429hlpr.cpp
>>>>
>>>>/datatype/mp4/payload/Umakefil
>>>>
>>>>/datatype/mp4/payload/amr-depack.cpp
>>>>
>>>>/datatype/mp4/payload/mp4-latm-depack.cpp
>>>>
>>>>/datatype/mp4/payload/mp4a-mux-cfg.cpp
>>>>
>>>>/ datatype/mp4/payload/pub/amr-depack.h
>>>>
>>>>/datatype/mp4/payload/pub/mp4-latm-depack.h
>>>>
>>>>/datatype/mp4/payload/pub/mp4a-mux-cfg.h
>>>>
>>>>
>>>>Files Added:
>>>>None
>>>>
>>>>Image Size and Heap Use impact (Client -Only):
>>>> None.
>>>>
>>>> Platforms and Profiles Affected:
>>>> None
>>>>
>>>> Distribution Libraries Affected:
>>>> None.
>>>>
>>>> Distribution library impact and planned action:
>>>> None.
>>>>
>>>> Platforms and Profiles Build Verified:
>>>> Profile: helix-client-all-defines
>>>>
>>>>BIF branch: helix.bif
>>>>Target: splay
>>>>Branch: HEAD
>>>>
>>>>Thanks
>>>>Alok Jain
>>>>
>>>>
>>>
>>>
>
From ehyche at real.com Tue Nov 11 08:58:02 2008
From: ehyche at real.com (Eric Hyche)
Date: Tue Nov 11 07:01:52 2008
Subject: [datatype-dev] RE: To Support the Fix bounds checking in Bitstream
class
In-Reply-To: <009801c94414$826854c0$7601a8c0@AlokSystem>
References: <002001c94337$f980cd40$7601a8c0@AlokSystem>
<008b01c94355$3d746850$b85d38f0$@com>
<001801c943fb$41617c90$7601a8c0@AlokSystem>
<004d01c9440b$1edf27c0$5c9d7740$@com>
<009801c94414$826854c0$7601a8c0@AlokSystem>
Message-ID: <009201c9441e$a9ca12b0$fd5e3810$@com>
Greg,
Do we want to check these into 310Atlas? My guess is
that we *would* want them in 310Atlas, since they
eliminate some potential crashes if we encountered
malicious bitstreams.
Eric
=======================================
Eric Hyche (ehyche@real.com)
Principal Engineer
RealNetworks, Inc.
>-----Original Message-----
>From: Alok Jain [mailto:alokj@real.com]
>Sent: Tuesday, November 11, 2008 10:45 AM
>To: ehyche@real.com; datatype-dev@helixcommunity.org
>Subject: CN: To Support the Fix bounds checking in Bitstream class
>
>Thanks Eric,
>
>This is now checked into HEAD.
>
>
>
>Thanks
>
>Alok
>
>
>
>----- Original Message -----
>From: "Eric Hyche"
>To: "'Alok Jain'" ;
>Sent: Tuesday, November 11, 2008 8:08 PM
>Subject: RE: CR: To Support the Fix bounds checking in Bitstream class
>
>
>> These additional changes look good. Please check
>> all of the changes into HEAD only for now.
>>
>> However, please save your diff files. We may be asked to
>> merge these to 310Atlas or other branches, so keeping
>> the diff files around will make that merge easily should
>> we be asked to do that.
>>
>> Eric
>>
>> =======================================
>> Eric Hyche (ehyche@real.com)
>> Principal Engineer
>> RealNetworks, Inc.
>>
>>
>>>-----Original Message-----
>>>From: Alok Jain [mailto:alokj@real.com]
>>>Sent: Tuesday, November 11, 2008 7:45 AM
>>>To: ehyche@real.com; datatype-dev@helixcommunity.org
>>>Cc: Alok Jain
>>>Subject: Re:CR: To Support the Fix bounds checking in Bitstream class
>>>
>>>Hi Eric,
>>>Thanks for the suggestions.
>>>
>>>Suggested changes have been incorporated.
>>>
>>>Please find the Diff attached.
>>>
>>>
>>>
>>>Thanks
>>>
>>>Alok Jain
>>>
>>>----- Original Message -----
>>>From: "Eric Hyche"
>>>To: "'Alok Jain'" ;
>>>Sent: Monday, November 10, 2008 10:26 PM
>>>Subject: RE: [datatype-dev] CR: To Support the Fix bounds checking in
>>>Bitstream class
>>>
>>>
>>>> Alok,
>>>>
>>>> Here are my comments:
>>>>
>>>> 1) datatype/common/util/pub/bitstream.h changes look good.
>>>> 2) datatype/common/util/test/tbitpack.cpp changes look good.
>>>> 3) datatype/common/util/pub/bitpack.h changes look good.
>>>> 4) In datatype/common/util/bitstream.cpp, here:
>>>>
>>>> @@ -113,6 +116,7 @@
>>>> m_bitCount = 8 - (bitCount - m_bitCount);
>>>> }
>>>>
>>>> + m_ulBufSizeBits -= bitCount;
>>>> return ret;
>>>> }
>>>>
>>>> If someone does ignore the BitsLeft() and goes ahead
>>>> and calls GetBits(), then m_ulBufSizeBits could wrap around
>>>> 32-bits and become huge. So we should add a check here
>>>> to make sure that m_ulBufSizeBits only goes down to zero
>>>> and does not wrap around:
>>>>
>>>> + m_ulBufSizeBits -= (bitCount <= m_ulBufSizeBits ? bitCount :
>>>> m_ulBufSizeBits);
>>>>
>>>> 5) In datatype/common/util/bitpack.cpp,
>>>>
>>>> + ulLeft = bs.BitsLeft();
>>>> + if (ulLeft < (UINT32) bitCount)
>>>> + {
>>>> + return HXR_FAIL;
>>>> + }
>>>> while(bitCount)
>>>> {
>>>> int bits = (bitCount > 8) ? 8 : bitCount; PackBits(bs.GetBits(bits),
>>>> bits); bitCount -= bits;
>>>> }
>>>> + return HXR_OK;
>>>>
>>>> Here you are only checking once outside the while() loop.
>>>> If we ran out of bits *inside* the while() loop, then
>>>> we would crash. We need to add a check inside of the
>>>> while loop prior to the bs.GetBits() call.
>>>>
>>>> 6) datatype/aac/fileformat/ADIFfile.cpp
>>>>
>>>> + HXLOGL1("Failed to add explicit SBR signal to
>>>> AudioSpecificConfig");
>>>>
>>>> Please use a fourcc in your log statements. In this case, since
>>>> this code is in the AAC file format, then you would use HXLOG_AACF. So
>>>> it would look like:
>>>>
>>>> + HXLOGL1(HXLOG_AACF, "Failed to add explicit SBR
>>>> + signal to
>>>> AudioSpecificConfig");
>>>>
>>>>
>>>> - UINT16 unADIFHeaderSize = 0;
>>>>
>>>> Since we are converting unADIFHeaderSize from a local variable
>>>> to an out parameter, we should still set it to 0 here. Otherwise,
>>>> if someone didn't initialize it to 0 before passing it into
>>>> ParseADIFHeader(), then we would get an incorrect value.
>>>>
>>>>
>>>> 7) datatype/aac/fileformat/aacff.cpp - changes looks good
>>>> 8) datatype/aac/fileformat/aacfiletypes.h - changes look good
>>>> 9) datatype/h263/payload/h263pyld.cpp - changes look good
>>>> 10) datatype/h263/payload/rfc2190hlpr.cpp - changes look good
>>>> 11) datatype/h263/payload/rfc2429hlpr.cpp - changes look good
>>>> 12) datatype/mp4/payload/Umakefil - changes look good
>>>> 13) datatype/mp4/payload/amr-depack.cpp
>>>>
>>>> + HXLOGL1("Failed GetTOCInfo()");
>>>>
>>>> For all of the log messages in amr-depack.cpp, use the
>>>> HXLOG_GENE fourcc.
>>>>
>>>> - SortedCopy(bs, ulStartBlock, ulBlockInc, tocInfo);
>>>> + if (!SortedCopy(bs, ulStartBlock, ulBlockInc, tocInfo))
>>>> + {
>>>> + bFailed =TRUE;
>>>> + }
>>>>
>>>> This change looks fine, but it looks like you need a
>>>> similar check for LinearCopy() as well.
>>>>
>>>> Also, if either SortedCopy() or LinearCopy() fail
>>>> and you don't return immediately after the failure,
>>>> then you'll need a !bFailed check here:
>>>>
>>>> if (m_ulMaxInterleave > 0)
>>>>
>>>> @@ -493,6 +546,12 @@
>>>> pCurrent[ulFrameBytes - 1] = 0;
>>>>
>>>> // Copy frame bits into the buffer
>>>> + UINT32 ulLeft = bs.BitsLeft();
>>>> + if (ulLeft < ulFrameBits)
>>>> + {
>>>> + bFailed = TRUE;
>>>> + break;
>>>> + }
>>>> bs.GetBits(ulFrameBits, pCurrent);
>>>>
>>>> These changes are in GetFrameBlock(), which currently has no way of
>>>> returning failure. You'll need to modify GetFrameBlock() to be able
>>>> to communicate failure and return ulRet as an out parameter.
>>>>
>>>> 14) datatype/mp4/payload/mp4-latm-depack.cpp - changes look good
>>>> 15) datatype/mp4/payload/mp4a-mux-cfg.cpp
>>>>
>>>> - AudioObjectType = GetAudioObjectType(bs);
>>>> + if (!GetAudioObjectType(bs,AudioObjectType))
>>>> + {
>>>> + HXLOGL1("Failed GetAudioObjectType()");
>>>> + }
>>>>
>>>> Seems like you should go ahead and return FALSE here, or
>>>> include !failed checks for the rest of the function.
>>>> Use HXLOG_GENE fourcc throughout.
>>>>
>>>> - ExtnAudioObjectType = GetAudioObjectType(bs);
>>>> + if (!GetAudioObjectType(bs,ExtnAudioObjectType))
>>>> + {
>>>> + HXLOGL1("Failed GetAudioObjectType()");
>>>> + }
>>>>
>>>> Probably need to return FALSE here.
>>>>
>>>> + ulLeft = bs.BitsLeft();
>>>> + if (ulLeft < (ulAscLen - ulAscBits))
>>>> + {
>>>> + return FALSE;
>>>> + }
>>>> // get fill bits
>>>> ulAscLen -= ulAscBits;
>>>> bs.GetBits(ulAscLen);
>>>>
>>>> Why not just move the BitsLeft() check to right before the GetBits()
>>>> call and just make it "if (ulLeft < ulAscLen)"?
>>>>
>>>> -ULONG32 MP4AMuxConfig::LatmGetValue(Bitstream&bs, ULONG32& nBits)
>>>> +HXBOOL MP4AMuxConfig::LatmGetValue(Bitstream&bs, ULONG32& nBits,
>>>> +ULONG32&
>>>> ulValue)
>>>> {
>>>> - ULONG32 ulValue = 0;
>>>>
>>>> We should still initialize ulValue to 0 at the top of LatmGetValue()
>>>> just in case the caller forgets to initialize it.
>>>>
>>>> 16) datatype/mp4/payload/pub/amr-depack.h - changes look good
>>>> 17) datatype/mp4/payload/pub/mp4-latm-depack.h - changes look good
>>>> 18) datatype/mp4/payload/pub/mp4a-mux-cfg.h - changes look good
>>>>
>>>> Please make the additional changes to LinearCopy() in amr-depack.cpp
>>>> and amr-depack.h and re-submit just diffs of those two files for
>>>> additional review (no need to submit all the other diffs again).
>>>>
>>>> Eric
>>>>
>>>> =======================================
>>>> Eric Hyche (ehyche@real.com)
>>>> Principal Engineer
>>>> RealNetworks, Inc.
>>>>
>>>>
>>>>>-----Original Message-----
>>>>>From: datatype-dev-bounces@helixcommunity.org
>>>>>[mailto:datatype-dev-bounces@helixcommunity.org] On Behalf Of Alok
>>>>>Jain
>>>>>Sent: Monday, November 10, 2008 8:27 AM
>>>>>To: datatype-dev@helixcommunity.org
>>>>>Cc: Alok Jain
>>>>>Subject: [datatype-dev] CR: To Support the Fix bounds checking in
>>>>>Bitstream class
>>>>>
>>>>>
>>>>>
>>>>>Synopsis:
>>>>> To Support the Fix bounds checking in Bitstream class.
>>>>>
>>>>>Overview:
>>>>>Add the method BitsLeft() inside Bitstream class for Fix bounds
>>>>>checking and
>>>>>
>>>>>modified all the instance where GetBits() or PeekBits() is used as a
>>>>>method of
>>>>>
>>>>>Bitstream class.
>>>>>
>>>>>
>>>>>Files Modified:
>>>>>/datatype/common/util/bitpack.cpp
>>>>>
>>>>>/datatype/common/util/bitstream.cpp
>>>>>
>>>>>/datatype/common/util/pub/bitstream.h
>>>>>
>>>>>/datatype/common/util/test/tbitpack.cpp
>>>>>
>>>>>/datatype/common/util/pub/bitpack.h
>>>>>
>>>>>/datatype/aac/fileformat/ADIFfile.cpp
>>>>>
>>>>>/datatype/aac/fileformat/aacff.cpp
>>>>>
>>>>>/datatype/aac/fileformat/aacfiletypes.h
>>>>>
>>>>>/datatype/h263/payload/h263pyld.cpp
>>>>>
>>>>>/datatype/h263/payload/rfc2190hlpr.cpp
>>>>>
>>>>>/datatype/h263/payload/rfc2429hlpr.cpp
>>>>>
>>>>>/datatype/mp4/payload/Umakefil
>>>>>
>>>>>/datatype/mp4/payload/amr-depack.cpp
>>>>>
>>>>>/datatype/mp4/payload/mp4-latm-depack.cpp
>>>>>
>>>>>/datatype/mp4/payload/mp4a-mux-cfg.cpp
>>>>>
>>>>>/ datatype/mp4/payload/pub/amr-depack.h
>>>>>
>>>>>/datatype/mp4/payload/pub/mp4-latm-depack.h
>>>>>
>>>>>/datatype/mp4/payload/pub/mp4a-mux-cfg.h
>>>>>
>>>>>
>>>>>Files Added:
>>>>>None
>>>>>
>>>>>Image Size and Heap Use impact (Client -Only):
>>>>> None.
>>>>>
>>>>> Platforms and Profiles Affected:
>>>>> None
>>>>>
>>>>> Distribution Libraries Affected:
>>>>> None.
>>>>>
>>>>> Distribution library impact and planned action:
>>>>> None.
>>>>>
>>>>> Platforms and Profiles Build Verified:
>>>>> Profile: helix-client-all-defines
>>>>>
>>>>>BIF branch: helix.bif
>>>>>Target: splay
>>>>>Branch: HEAD
>>>>>
>>>>>Thanks
>>>>>Alok Jain
>>>>>
>>>>>
>>>>
>>>>
>>
From gwright at real.com Tue Nov 11 10:14:20 2008
From: gwright at real.com (Greg Wright)
Date: Tue Nov 11 08:18:28 2008
Subject: [datatype-dev] Re: To Support the Fix bounds checking in Bitstream
class
In-Reply-To: <009201c9441e$a9ca12b0$fd5e3810$@com>
References: <002001c94337$f980cd40$7601a8c0@AlokSystem>
<008b01c94355$3d746850$b85d38f0$@com>
<001801c943fb$41617c90$7601a8c0@AlokSystem>
<004d01c9440b$1edf27c0$5c9d7740$@com>
<009801c94414$826854c0$7601a8c0@AlokSystem>
<009201c9441e$a9ca12b0$fd5e3810$@com>
Message-ID: <4919CB7C.6000309@real.com>
Eric Hyche wrote:
> Greg,
>
> Do we want to check these into 310Atlas? My guess is
> that we *would* want them in 310Atlas, since they
> eliminate some potential crashes if we encountered
> malicious bitstreams.
Yes, I think they are a good addition.
--greg.
>
> Eric
>
> =======================================
> Eric Hyche (ehyche@real.com)
> Principal Engineer
> RealNetworks, Inc.
>
>
>> -----Original Message-----
>> From: Alok Jain [mailto:alokj@real.com]
>> Sent: Tuesday, November 11, 2008 10:45 AM
>> To: ehyche@real.com; datatype-dev@helixcommunity.org
>> Subject: CN: To Support the Fix bounds checking in Bitstream class
>>
>> Thanks Eric,
>>
>> This is now checked into HEAD.
>>
>>
>>
>> Thanks
>>
>> Alok
>>
>>
>>
>> ----- Original Message -----
>> From: "Eric Hyche"
>> To: "'Alok Jain'" ;
>> Sent: Tuesday, November 11, 2008 8:08 PM
>> Subject: RE: CR: To Support the Fix bounds checking in Bitstream class
>>
>>
>>> These additional changes look good. Please check
>>> all of the changes into HEAD only for now.
>>>
>>> However, please save your diff files. We may be asked to
>>> merge these to 310Atlas or other branches, so keeping
>>> the diff files around will make that merge easily should
>>> we be asked to do that.
>>>
>>> Eric
>>>
>>> =======================================
>>> Eric Hyche (ehyche@real.com)
>>> Principal Engineer
>>> RealNetworks, Inc.
>>>
>>>
>>>> -----Original Message-----
>>>> From: Alok Jain [mailto:alokj@real.com]
>>>> Sent: Tuesday, November 11, 2008 7:45 AM
>>>> To: ehyche@real.com; datatype-dev@helixcommunity.org
>>>> Cc: Alok Jain
>>>> Subject: Re:CR: To Support the Fix bounds checking in Bitstream class
>>>>
>>>> Hi Eric,
>>>> Thanks for the suggestions.
>>>>
>>>> Suggested changes have been incorporated.
>>>>
>>>> Please find the Diff attached.
>>>>
>>>>
>>>>
>>>> Thanks
>>>>
>>>> Alok Jain
>>>>
>>>> ----- Original Message -----
>>>> From: "Eric Hyche"
>>>> To: "'Alok Jain'" ;
>>>> Sent: Monday, November 10, 2008 10:26 PM
>>>> Subject: RE: [datatype-dev] CR: To Support the Fix bounds checking in
>>>> Bitstream class
>>>>
>>>>
>>>>> Alok,
>>>>>
>>>>> Here are my comments:
>>>>>
>>>>> 1) datatype/common/util/pub/bitstream.h changes look good.
>>>>> 2) datatype/common/util/test/tbitpack.cpp changes look good.
>>>>> 3) datatype/common/util/pub/bitpack.h changes look good.
>>>>> 4) In datatype/common/util/bitstream.cpp, here:
>>>>>
>>>>> @@ -113,6 +116,7 @@
>>>>> m_bitCount = 8 - (bitCount - m_bitCount);
>>>>> }
>>>>>
>>>>> + m_ulBufSizeBits -= bitCount;
>>>>> return ret;
>>>>> }
>>>>>
>>>>> If someone does ignore the BitsLeft() and goes ahead
>>>>> and calls GetBits(), then m_ulBufSizeBits could wrap around
>>>>> 32-bits and become huge. So we should add a check here
>>>>> to make sure that m_ulBufSizeBits only goes down to zero
>>>>> and does not wrap around:
>>>>>
>>>>> + m_ulBufSizeBits -= (bitCount <= m_ulBufSizeBits ? bitCount :
>>>>> m_ulBufSizeBits);
>>>>>
>>>>> 5) In datatype/common/util/bitpack.cpp,
>>>>>
>>>>> + ulLeft = bs.BitsLeft();
>>>>> + if (ulLeft < (UINT32) bitCount)
>>>>> + {
>>>>> + return HXR_FAIL;
>>>>> + }
>>>>> while(bitCount)
>>>>> {
>>>>> int bits = (bitCount > 8) ? 8 : bitCount; PackBits(bs.GetBits(bits),
>>>>> bits); bitCount -= bits;
>>>>> }
>>>>> + return HXR_OK;
>>>>>
>>>>> Here you are only checking once outside the while() loop.
>>>>> If we ran out of bits *inside* the while() loop, then
>>>>> we would crash. We need to add a check inside of the
>>>>> while loop prior to the bs.GetBits() call.
>>>>>
>>>>> 6) datatype/aac/fileformat/ADIFfile.cpp
>>>>>
>>>>> + HXLOGL1("Failed to add explicit SBR signal to
>>>>> AudioSpecificConfig");
>>>>>
>>>>> Please use a fourcc in your log statements. In this case, since
>>>>> this code is in the AAC file format, then you would use HXLOG_AACF. So
>>>>> it would look like:
>>>>>
>>>>> + HXLOGL1(HXLOG_AACF, "Failed to add explicit SBR
>>>>> + signal to
>>>>> AudioSpecificConfig");
>>>>>
>>>>>
>>>>> - UINT16 unADIFHeaderSize = 0;
>>>>>
>>>>> Since we are converting unADIFHeaderSize from a local variable
>>>>> to an out parameter, we should still set it to 0 here. Otherwise,
>>>>> if someone didn't initialize it to 0 before passing it into
>>>>> ParseADIFHeader(), then we would get an incorrect value.
>>>>>
>>>>>
>>>>> 7) datatype/aac/fileformat/aacff.cpp - changes looks good
>>>>> 8) datatype/aac/fileformat/aacfiletypes.h - changes look good
>>>>> 9) datatype/h263/payload/h263pyld.cpp - changes look good
>>>>> 10) datatype/h263/payload/rfc2190hlpr.cpp - changes look good
>>>>> 11) datatype/h263/payload/rfc2429hlpr.cpp - changes look good
>>>>> 12) datatype/mp4/payload/Umakefil - changes look good
>>>>> 13) datatype/mp4/payload/amr-depack.cpp
>>>>>
>>>>> + HXLOGL1("Failed GetTOCInfo()");
>>>>>
>>>>> For all of the log messages in amr-depack.cpp, use the
>>>>> HXLOG_GENE fourcc.
>>>>>
>>>>> - SortedCopy(bs, ulStartBlock, ulBlockInc, tocInfo);
>>>>> + if (!SortedCopy(bs, ulStartBlock, ulBlockInc, tocInfo))
>>>>> + {
>>>>> + bFailed =TRUE;
>>>>> + }
>>>>>
>>>>> This change looks fine, but it looks like you need a
>>>>> similar check for LinearCopy() as well.
>>>>>
>>>>> Also, if either SortedCopy() or LinearCopy() fail
>>>>> and you don't return immediately after the failure,
>>>>> then you'll need a !bFailed check here:
>>>>>
>>>>> if (m_ulMaxInterleave > 0)
>>>>>
>>>>> @@ -493,6 +546,12 @@
>>>>> pCurrent[ulFrameBytes - 1] = 0;
>>>>>
>>>>> // Copy frame bits into the buffer
>>>>> + UINT32 ulLeft = bs.BitsLeft();
>>>>> + if (ulLeft < ulFrameBits)
>>>>> + {
>>>>> + bFailed = TRUE;
>>>>> + break;
>>>>> + }
>>>>> bs.GetBits(ulFrameBits, pCurrent);
>>>>>
>>>>> These changes are in GetFrameBlock(), which currently has no way of
>>>>> returning failure. You'll need to modify GetFrameBlock() to be able
>>>>> to communicate failure and return ulRet as an out parameter.
>>>>>
>>>>> 14) datatype/mp4/payload/mp4-latm-depack.cpp - changes look good
>>>>> 15) datatype/mp4/payload/mp4a-mux-cfg.cpp
>>>>>
>>>>> - AudioObjectType = GetAudioObjectType(bs);
>>>>> + if (!GetAudioObjectType(bs,AudioObjectType))
>>>>> + {
>>>>> + HXLOGL1("Failed GetAudioObjectType()");
>>>>> + }
>>>>>
>>>>> Seems like you should go ahead and return FALSE here, or
>>>>> include !failed checks for the rest of the function.
>>>>> Use HXLOG_GENE fourcc throughout.
>>>>>
>>>>> - ExtnAudioObjectType = GetAudioObjectType(bs);
>>>>> + if (!GetAudioObjectType(bs,ExtnAudioObjectType))
>>>>> + {
>>>>> + HXLOGL1("Failed GetAudioObjectType()");
>>>>> + }
>>>>>
>>>>> Probably need to return FALSE here.
>>>>>
>>>>> + ulLeft = bs.BitsLeft();
>>>>> + if (ulLeft < (ulAscLen - ulAscBits))
>>>>> + {
>>>>> + return FALSE;
>>>>> + }
>>>>> // get fill bits
>>>>> ulAscLen -= ulAscBits;
>>>>> bs.GetBits(ulAscLen);
>>>>>
>>>>> Why not just move the BitsLeft() check to right before the GetBits()
>>>>> call and just make it "if (ulLeft < ulAscLen)"?
>>>>>
>>>>> -ULONG32 MP4AMuxConfig::LatmGetValue(Bitstream&bs, ULONG32& nBits)
>>>>> +HXBOOL MP4AMuxConfig::LatmGetValue(Bitstream&bs, ULONG32& nBits,
>>>>> +ULONG32&
>>>>> ulValue)
>>>>> {
>>>>> - ULONG32 ulValue = 0;
>>>>>
>>>>> We should still initialize ulValue to 0 at the top of LatmGetValue()
>>>>> just in case the caller forgets to initialize it.
>>>>>
>>>>> 16) datatype/mp4/payload/pub/amr-depack.h - changes look good
>>>>> 17) datatype/mp4/payload/pub/mp4-latm-depack.h - changes look good
>>>>> 18) datatype/mp4/payload/pub/mp4a-mux-cfg.h - changes look good
>>>>>
>>>>> Please make the additional changes to LinearCopy() in amr-depack.cpp
>>>>> and amr-depack.h and re-submit just diffs of those two files for
>>>>> additional review (no need to submit all the other diffs again).
>>>>>
>>>>> Eric
>>>>>
>>>>> =======================================
>>>>> Eric Hyche (ehyche@real.com)
>>>>> Principal Engineer
>>>>> RealNetworks, Inc.
>>>>>
>>>>>
>>>>>> -----Original Message-----
>>>>>> From: datatype-dev-bounces@helixcommunity.org
>>>>>> [mailto:datatype-dev-bounces@helixcommunity.org] On Behalf Of Alok
>>>>>> Jain
>>>>>> Sent: Monday, November 10, 2008 8:27 AM
>>>>>> To: datatype-dev@helixcommunity.org
>>>>>> Cc: Alok Jain
>>>>>> Subject: [datatype-dev] CR: To Support the Fix bounds checking in
>>>>>> Bitstream class
>>>>>>
>>>>>>
>>>>>>
>>>>>> Synopsis:
>>>>>> To Support the Fix bounds checking in Bitstream class.
>>>>>>
>>>>>> Overview:
>>>>>> Add the method BitsLeft() inside Bitstream class for Fix bounds
>>>>>> checking and
>>>>>>
>>>>>> modified all the instance where GetBits() or PeekBits() is used as a
>>>>>> method of
>>>>>>
>>>>>> Bitstream class.
>>>>>>
>>>>>>
>>>>>> Files Modified:
>>>>>> /datatype/common/util/bitpack.cpp
>>>>>>
>>>>>> /datatype/common/util/bitstream.cpp
>>>>>>
>>>>>> /datatype/common/util/pub/bitstream.h
>>>>>>
>>>>>> /datatype/common/util/test/tbitpack.cpp
>>>>>>
>>>>>> /datatype/common/util/pub/bitpack.h
>>>>>>
>>>>>> /datatype/aac/fileformat/ADIFfile.cpp
>>>>>>
>>>>>> /datatype/aac/fileformat/aacff.cpp
>>>>>>
>>>>>> /datatype/aac/fileformat/aacfiletypes.h
>>>>>>
>>>>>> /datatype/h263/payload/h263pyld.cpp
>>>>>>
>>>>>> /datatype/h263/payload/rfc2190hlpr.cpp
>>>>>>
>>>>>> /datatype/h263/payload/rfc2429hlpr.cpp
>>>>>>
>>>>>> /datatype/mp4/payload/Umakefil
>>>>>>
>>>>>> /datatype/mp4/payload/amr-depack.cpp
>>>>>>
>>>>>> /datatype/mp4/payload/mp4-latm-depack.cpp
>>>>>>
>>>>>> /datatype/mp4/payload/mp4a-mux-cfg.cpp
>>>>>>
>>>>>> / datatype/mp4/payload/pub/amr-depack.h
>>>>>>
>>>>>> /datatype/mp4/payload/pub/mp4-latm-depack.h
>>>>>>
>>>>>> /datatype/mp4/payload/pub/mp4a-mux-cfg.h
>>>>>>
>>>>>>
>>>>>> Files Added:
>>>>>> None
>>>>>>
>>>>>> Image Size and Heap Use impact (Client -Only):
>>>>>> None.
>>>>>>
>>>>>> Platforms and Profiles Affected:
>>>>>> None
>>>>>>
>>>>>> Distribution Libraries Affected:
>>>>>> None.
>>>>>>
>>>>>> Distribution library impact and planned action:
>>>>>> None.
>>>>>>
>>>>>> Platforms and Profiles Build Verified:
>>>>>> Profile: helix-client-all-defines
>>>>>>
>>>>>> BIF branch: helix.bif
>>>>>> Target: splay
>>>>>> Branch: HEAD
>>>>>>
>>>>>> Thanks
>>>>>> Alok Jain
>>>>>>
>>>>>>
>>>>>
>
>
From ehyche at real.com Tue Nov 11 10:43:20 2008
From: ehyche at real.com (Eric Hyche)
Date: Tue Nov 11 08:47:05 2008
Subject: [datatype-dev] RE: To Support the Fix bounds checking in Bitstream
class
In-Reply-To: <4919CB7C.6000309@real.com>
References: <002001c94337$f980cd40$7601a8c0@AlokSystem>
<008b01c94355$3d746850$b85d38f0$@com>
<001801c943fb$41617c90$7601a8c0@AlokSystem>
<004d01c9440b$1edf27c0$5c9d7740$@com>
<009801c94414$826854c0$7601a8c0@AlokSystem>
<009201c9441e$a9ca12b0$fd5e3810$@com> <4919CB7C.6000309@real.com>
Message-ID: <00b101c9442d$5f603f10$1e20bd30$@com>
Alok,
Please check the Bitstream class changes into 310Atlas as well.
Eric
=======================================
Eric Hyche (ehyche@real.com)
Principal Engineer
RealNetworks, Inc.
>-----Original Message-----
>From: Greg Wright [mailto:gwright@real.com]
>Sent: Tuesday, November 11, 2008 1:14 PM
>To: ehyche@real.com
>Cc: datatype-dev@helixcommunity.org
>Subject: Re: To Support the Fix bounds checking in Bitstream class
>
>Eric Hyche wrote:
>> Greg,
>>
>> Do we want to check these into 310Atlas? My guess is
>> that we *would* want them in 310Atlas, since they
>> eliminate some potential crashes if we encountered
>> malicious bitstreams.
>
>Yes, I think they are a good addition.
>--greg.
>
>
>>
>> Eric
>>
>> =======================================
>> Eric Hyche (ehyche@real.com)
>> Principal Engineer
>> RealNetworks, Inc.
>>
>>
>>> -----Original Message-----
>>> From: Alok Jain [mailto:alokj@real.com]
>>> Sent: Tuesday, November 11, 2008 10:45 AM
>>> To: ehyche@real.com; datatype-dev@helixcommunity.org
>>> Subject: CN: To Support the Fix bounds checking in Bitstream class
>>>
>>> Thanks Eric,
>>>
>>> This is now checked into HEAD.
>>>
>>>
>>>
>>> Thanks
>>>
>>> Alok
>>>
>>>
>>>
>>> ----- Original Message -----
>>> From: "Eric Hyche"
>>> To: "'Alok Jain'" ;
>>> Sent: Tuesday, November 11, 2008 8:08 PM
>>> Subject: RE: CR: To Support the Fix bounds checking in Bitstream class
>>>
>>>
>>>> These additional changes look good. Please check
>>>> all of the changes into HEAD only for now.
>>>>
>>>> However, please save your diff files. We may be asked to
>>>> merge these to 310Atlas or other branches, so keeping
>>>> the diff files around will make that merge easily should
>>>> we be asked to do that.
>>>>
>>>> Eric
>>>>
>>>> =======================================
>>>> Eric Hyche (ehyche@real.com)
>>>> Principal Engineer
>>>> RealNetworks, Inc.
>>>>
>>>>
>>>>> -----Original Message-----
>>>>> From: Alok Jain [mailto:alokj@real.com]
>>>>> Sent: Tuesday, November 11, 2008 7:45 AM
>>>>> To: ehyche@real.com; datatype-dev@helixcommunity.org
>>>>> Cc: Alok Jain
>>>>> Subject: Re:CR: To Support the Fix bounds checking in Bitstream class
>>>>>
>>>>> Hi Eric,
>>>>> Thanks for the suggestions.
>>>>>
>>>>> Suggested changes have been incorporated.
>>>>>
>>>>> Please find the Diff attached.
>>>>>
>>>>>
>>>>>
>>>>> Thanks
>>>>>
>>>>> Alok Jain
>>>>>
>>>>> ----- Original Message -----
>>>>> From: "Eric Hyche"
>>>>> To: "'Alok Jain'" ;
>>>>> Sent: Monday, November 10, 2008 10:26 PM
>>>>> Subject: RE: [datatype-dev] CR: To Support the Fix bounds checking in
>>>>> Bitstream class
>>>>>
>>>>>
>>>>>> Alok,
>>>>>>
>>>>>> Here are my comments:
>>>>>>
>>>>>> 1) datatype/common/util/pub/bitstream.h changes look good.
>>>>>> 2) datatype/common/util/test/tbitpack.cpp changes look good.
>>>>>> 3) datatype/common/util/pub/bitpack.h changes look good.
>>>>>> 4) In datatype/common/util/bitstream.cpp, here:
>>>>>>
>>>>>> @@ -113,6 +116,7 @@
>>>>>> m_bitCount = 8 - (bitCount - m_bitCount);
>>>>>> }
>>>>>>
>>>>>> + m_ulBufSizeBits -= bitCount;
>>>>>> return ret;
>>>>>> }
>>>>>>
>>>>>> If someone does ignore the BitsLeft() and goes ahead
>>>>>> and calls GetBits(), then m_ulBufSizeBits could wrap around
>>>>>> 32-bits and become huge. So we should add a check here
>>>>>> to make sure that m_ulBufSizeBits only goes down to zero
>>>>>> and does not wrap around:
>>>>>>
>>>>>> + m_ulBufSizeBits -= (bitCount <= m_ulBufSizeBits ? bitCount :
>>>>>> m_ulBufSizeBits);
>>>>>>
>>>>>> 5) In datatype/common/util/bitpack.cpp,
>>>>>>
>>>>>> + ulLeft = bs.BitsLeft();
>>>>>> + if (ulLeft < (UINT32) bitCount)
>>>>>> + {
>>>>>> + return HXR_FAIL;
>>>>>> + }
>>>>>> while(bitCount)
>>>>>> {
>>>>>> int bits = (bitCount > 8) ? 8 : bitCount; PackBits(bs.GetBits(bits),
>>>>>> bits); bitCount -= bits;
>>>>>> }
>>>>>> + return HXR_OK;
>>>>>>
>>>>>> Here you are only checking once outside the while() loop.
>>>>>> If we ran out of bits *inside* the while() loop, then
>>>>>> we would crash. We need to add a check inside of the
>>>>>> while loop prior to the bs.GetBits() call.
>>>>>>
>>>>>> 6) datatype/aac/fileformat/ADIFfile.cpp
>>>>>>
>>>>>> + HXLOGL1("Failed to add explicit SBR signal to
>>>>>> AudioSpecificConfig");
>>>>>>
>>>>>> Please use a fourcc in your log statements. In this case, since
>>>>>> this code is in the AAC file format, then you would use HXLOG_AACF. So
>>>>>> it would look like:
>>>>>>
>>>>>> + HXLOGL1(HXLOG_AACF, "Failed to add explicit SBR
>>>>>> + signal to
>>>>>> AudioSpecificConfig");
>>>>>>
>>>>>>
>>>>>> - UINT16 unADIFHeaderSize = 0;
>>>>>>
>>>>>> Since we are converting unADIFHeaderSize from a local variable
>>>>>> to an out parameter, we should still set it to 0 here. Otherwise,
>>>>>> if someone didn't initialize it to 0 before passing it into
>>>>>> ParseADIFHeader(), then we would get an incorrect value.
>>>>>>
>>>>>>
>>>>>> 7) datatype/aac/fileformat/aacff.cpp - changes looks good
>>>>>> 8) datatype/aac/fileformat/aacfiletypes.h - changes look good
>>>>>> 9) datatype/h263/payload/h263pyld.cpp - changes look good
>>>>>> 10) datatype/h263/payload/rfc2190hlpr.cpp - changes look good
>>>>>> 11) datatype/h263/payload/rfc2429hlpr.cpp - changes look good
>>>>>> 12) datatype/mp4/payload/Umakefil - changes look good
>>>>>> 13) datatype/mp4/payload/amr-depack.cpp
>>>>>>
>>>>>> + HXLOGL1("Failed GetTOCInfo()");
>>>>>>
>>>>>> For all of the log messages in amr-depack.cpp, use the
>>>>>> HXLOG_GENE fourcc.
>>>>>>
>>>>>> - SortedCopy(bs, ulStartBlock, ulBlockInc, tocInfo);
>>>>>> + if (!SortedCopy(bs, ulStartBlock, ulBlockInc, tocInfo))
>>>>>> + {
>>>>>> + bFailed =TRUE;
>>>>>> + }
>>>>>>
>>>>>> This change looks fine, but it looks like you need a
>>>>>> similar check for LinearCopy() as well.
>>>>>>
>>>>>> Also, if either SortedCopy() or LinearCopy() fail
>>>>>> and you don't return immediately after the failure,
>>>>>> then you'll need a !bFailed check here:
>>>>>>
>>>>>> if (m_ulMaxInterleave > 0)
>>>>>>
>>>>>> @@ -493,6 +546,12 @@
>>>>>> pCurrent[ulFrameBytes - 1] = 0;
>>>>>>
>>>>>> // Copy frame bits into the buffer
>>>>>> + UINT32 ulLeft = bs.BitsLeft();
>>>>>> + if (ulLeft < ulFrameBits)
>>>>>> + {
>>>>>> + bFailed = TRUE;
>>>>>> + break;
>>>>>> + }
>>>>>> bs.GetBits(ulFrameBits, pCurrent);
>>>>>>
>>>>>> These changes are in GetFrameBlock(), which currently has no way of
>>>>>> returning failure. You'll need to modify GetFrameBlock() to be able
>>>>>> to communicate failure and return ulRet as an out parameter.
>>>>>>
>>>>>> 14) datatype/mp4/payload/mp4-latm-depack.cpp - changes look good
>>>>>> 15) datatype/mp4/payload/mp4a-mux-cfg.cpp
>>>>>>
>>>>>> - AudioObjectType = GetAudioObjectType(bs);
>>>>>> + if (!GetAudioObjectType(bs,AudioObjectType))
>>>>>> + {
>>>>>> + HXLOGL1("Failed GetAudioObjectType()");
>>>>>> + }
>>>>>>
>>>>>> Seems like you should go ahead and return FALSE here, or
>>>>>> include !failed checks for the rest of the function.
>>>>>> Use HXLOG_GENE fourcc throughout.
>>>>>>
>>>>>> - ExtnAudioObjectType = GetAudioObjectType(bs);
>>>>>> + if (!GetAudioObjectType(bs,ExtnAudioObjectType))
>>>>>> + {
>>>>>> + HXLOGL1("Failed GetAudioObjectType()");
>>>>>> + }
>>>>>>
>>>>>> Probably need to return FALSE here.
>>>>>>
>>>>>> + ulLeft = bs.BitsLeft();
>>>>>> + if (ulLeft < (ulAscLen - ulAscBits))
>>>>>> + {
>>>>>> + return FALSE;
>>>>>> + }
>>>>>> // get fill bits
>>>>>> ulAscLen -= ulAscBits;
>>>>>> bs.GetBits(ulAscLen);
>>>>>>
>>>>>> Why not just move the BitsLeft() check to right before the GetBits()
>>>>>> call and just make it "if (ulLeft < ulAscLen)"?
>>>>>>
>>>>>> -ULONG32 MP4AMuxConfig::LatmGetValue(Bitstream&bs, ULONG32& nBits)
>>>>>> +HXBOOL MP4AMuxConfig::LatmGetValue(Bitstream&bs, ULONG32& nBits,
>>>>>> +ULONG32&
>>>>>> ulValue)
>>>>>> {
>>>>>> - ULONG32 ulValue = 0;
>>>>>>
>>>>>> We should still initialize ulValue to 0 at the top of LatmGetValue()
>>>>>> just in case the caller forgets to initialize it.
>>>>>>
>>>>>> 16) datatype/mp4/payload/pub/amr-depack.h - changes look good
>>>>>> 17) datatype/mp4/payload/pub/mp4-latm-depack.h - changes look good
>>>>>> 18) datatype/mp4/payload/pub/mp4a-mux-cfg.h - changes look good
>>>>>>
>>>>>> Please make the additional changes to LinearCopy() in amr-depack.cpp
>>>>>> and amr-depack.h and re-submit just diffs of those two files for
>>>>>> additional review (no need to submit all the other diffs again).
>>>>>>
>>>>>> Eric
>>>>>>
>>>>>> =======================================
>>>>>> Eric Hyche (ehyche@real.com)
>>>>>> Principal Engineer
>>>>>> RealNetworks, Inc.
>>>>>>
>>>>>>
>>>>>>> -----Original Message-----
>>>>>>> From: datatype-dev-bounces@helixcommunity.org
>>>>>>> [mailto:datatype-dev-bounces@helixcommunity.org] On Behalf Of Alok
>>>>>>> Jain
>>>>>>> Sent: Monday, November 10, 2008 8:27 AM
>>>>>>> To: datatype-dev@helixcommunity.org
>>>>>>> Cc: Alok Jain
>>>>>>> Subject: [datatype-dev] CR: To Support the Fix bounds checking in
>>>>>>> Bitstream class
>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>> Synopsis:
>>>>>>> To Support the Fix bounds checking in Bitstream class.
>>>>>>>
>>>>>>> Overview:
>>>>>>> Add the method BitsLeft() inside Bitstream class for Fix bounds
>>>>>>> checking and
>>>>>>>
>>>>>>> modified all the instance where GetBits() or PeekBits() is used as a
>>>>>>> method of
>>>>>>>
>>>>>>> Bitstream class.
>>>>>>>
>>>>>>>
>>>>>>> Files Modified:
>>>>>>> /datatype/common/util/bitpack.cpp
>>>>>>>
>>>>>>> /datatype/common/util/bitstream.cpp
>>>>>>>
>>>>>>> /datatype/common/util/pub/bitstream.h
>>>>>>>
>>>>>>> /datatype/common/util/test/tbitpack.cpp
>>>>>>>
>>>>>>> /datatype/common/util/pub/bitpack.h
>>>>>>>
>>>>>>> /datatype/aac/fileformat/ADIFfile.cpp
>>>>>>>
>>>>>>> /datatype/aac/fileformat/aacff.cpp
>>>>>>>
>>>>>>> /datatype/aac/fileformat/aacfiletypes.h
>>>>>>>
>>>>>>> /datatype/h263/payload/h263pyld.cpp
>>>>>>>
>>>>>>> /datatype/h263/payload/rfc2190hlpr.cpp
>>>>>>>
>>>>>>> /datatype/h263/payload/rfc2429hlpr.cpp
>>>>>>>
>>>>>>> /datatype/mp4/payload/Umakefil
>>>>>>>
>>>>>>> /datatype/mp4/payload/amr-depack.cpp
>>>>>>>
>>>>>>> /datatype/mp4/payload/mp4-latm-depack.cpp
>>>>>>>
>>>>>>> /datatype/mp4/payload/mp4a-mux-cfg.cpp
>>>>>>>
>>>>>>> / datatype/mp4/payload/pub/amr-depack.h
>>>>>>>
>>>>>>> /datatype/mp4/payload/pub/mp4-latm-depack.h
>>>>>>>
>>>>>>> /datatype/mp4/payload/pub/mp4a-mux-cfg.h
>>>>>>>
>>>>>>>
>>>>>>> Files Added:
>>>>>>> None
>>>>>>>
>>>>>>> Image Size and Heap Use impact (Client -Only):
>>>>>>> None.
>>>>>>>
>>>>>>> Platforms and Profiles Affected:
>>>>>>> None
>>>>>>>
>>>>>>> Distribution Libraries Affected:
>>>>>>> None.
>>>>>>>
>>>>>>> Distribution library impact and planned action:
>>>>>>> None.
>>>>>>>
>>>>>>> Platforms and Profiles Build Verified:
>>>>>>> Profile: helix-client-all-defines
>>>>>>>
>>>>>>> BIF branch: helix.bif
>>>>>>> Target: splay
>>>>>>> Branch: HEAD
>>>>>>>
>>>>>>> Thanks
>>>>>>> Alok Jain
>>>>>>>
>>>>>>>
>>>>>>
>>
>>
From sharon_wang at sonix.com.tw Mon Nov 10 18:30:33 2008
From: sharon_wang at sonix.com.tw (sharon_wang)
Date: Tue Nov 11 08:58:51 2008
Subject: [datatype-dev] Compile MP3 Decoder
Message-ID: <1EBF0D9632F64282BC4685C010D6F520@sonix.group>
Skipped content of type multipart/alternative-------------- next part --------------
A non-text attachment was scrubbed...
Name: err.bmp
Type: image/bmp
Size: 2359350 bytes
Desc: not available
Url : http://lists.helixcommunity.org/pipermail/datatype-dev/attachments/20081111/b9b0b044/err-0001.bmp
From ehyche at real.com Tue Nov 11 11:25:02 2008
From: ehyche at real.com (Eric Hyche)
Date: Tue Nov 11 09:28:56 2008
Subject: [datatype-dev] Compile MP3 Decoder
In-Reply-To: <1EBF0D9632F64282BC4685C010D6F520@sonix.group>
References: <1EBF0D9632F64282BC4685C010D6F520@sonix.group>
Message-ID: <00da01c94433$32997b30$97cc7190$@com>
I'm not familiar with the Metrowerks compiler. Did
you try building with the ribosome build system?
If so, can you supply a zipped version of your build.out file?
Eric
=======================================
Eric Hyche (ehyche@real.com)
Principal Engineer
RealNetworks, Inc.
>-----Original Message-----
>From: datatype-dev-bounces@helixcommunity.org [mailto:datatype-dev-bounces@helixcommunity.org] On
>Behalf Of sharon_wang
>Sent: Monday, November 10, 2008 9:31 PM
>To: datatype-dev@helixcommunity.org
>Subject: [datatype-dev] Compile MP3 Decoder
>
>Dear HelixCommunity,
>
>We have succefully downloaded MP3 Decoder from folder path "[Helix Community]\datatype\mp3"; however,
>when I compile "mp3\codec\fixpt\real\projects\armads\mp3dec.mcp" by ADS, it has an error message as
>the attached file. Could you please kindly help us!
>Thank you so much!
>
>Sincerely,
>
>Sharon Wang
>Sonix Technology Co., LTD.
>http://www.sonix.com.tw
From stanb at real.com Tue Nov 11 17:29:40 2008
From: stanb at real.com (Stanislav Bobrovskiy)
Date: Tue Nov 11 15:33:19 2008
Subject: [datatype-dev] CR: fix of a crash in flvrenderer
Message-ID: <6.2.1.2.2.20081111171840.03a0b358@mailone.real.com>
Synopsis:
This crash was reproduced when processing a specific FLV input file by
DTDriver.
Overview:
This simply adds a NULL pointer check which prevents a crash in
flvrenderer.dll.
Files Added
None
Files Modified:
/cvsroot/datatype/flash/flashhost/platform/win32/flash_guest_player_ax.cpp
Branch:
atlas310, HEAD
Files Attached:
datatype_flash_flashhost.diff
-------------- next part --------------
Index: datatype/flash/flashhost/platform/win32/flash_guest_player_ax.cpp
===================================================================
RCS file: /cvsroot/datatype/flash/flashhost/platform/win32/flash_guest_player_ax.cpp,v
retrieving revision 1.21.2.66
diff -u -1 -0 -r1.21.2.66 flash_guest_player_ax.cpp
--- datatype/flash/flashhost/platform/win32/flash_guest_player_ax.cpp 7 Nov 2008 06:25:41 -0000 1.21.2.66
+++ datatype/flash/flashhost/platform/win32/flash_guest_player_ax.cpp 12 Nov 2008 01:10:09 -0000
@@ -4214,21 +4214,24 @@
// reset redraw data
m_redrawData.bNeedRedraw = FALSE;
m_redrawData.bErase = FALSE;
while (m_redrawData.rectList.GetCount() > 0)
{
RECT* pRect = (RECT*)m_redrawData.rectList.RemoveHead();
HX_DELETE(pRect);
}
// tell host thread that we are ready for command
- m_pFlashFinishEvent->SignalEvent();
+ if(m_pFlashFinishEvent)
+ {
+ m_pFlashFinishEvent->SignalEvent();
+ }
// use native msg handling
MSG msg;
while (::GetMessage(&msg, NULL, 0, 0))
{
switch (msg.message)
{
case PROXYMSG_CREATE:
// create the flash control
{
From gwright at real.com Tue Nov 11 17:39:43 2008
From: gwright at real.com (Greg Wright)
Date: Tue Nov 11 15:43:36 2008
Subject: [datatype-dev] CR: fix of a crash in flvrenderer
In-Reply-To: <6.2.1.2.2.20081111171840.03a0b358@mailone.real.com>
References: <6.2.1.2.2.20081111171840.03a0b358@mailone.real.com>
Message-ID: <491A33DF.5000502@real.com>
Looks good.
--greg.
Stanislav Bobrovskiy wrote:
> Synopsis:
> This crash was reproduced when processing a specific FLV input file by
> DTDriver.
>
> Overview:
> This simply adds a NULL pointer check which prevents a crash in
> flvrenderer.dll.
>
> Files Added
> None
>
> Files Modified:
> /cvsroot/datatype/flash/flashhost/platform/win32/flash_guest_player_ax.cpp
>
> Branch:
> atlas310, HEAD
>
> Files Attached:
> datatype_flash_flashhost.diff
>
>
> ------------------------------------------------------------------------
>
> _______________________________________________
> Datatype-dev mailing list
> Datatype-dev@helixcommunity.org
> http://lists.helixcommunity.org/mailman/listinfo/datatype-dev
From ping at real.com Tue Nov 11 18:06:18 2008
From: ping at real.com (ping@real.com)
Date: Tue Nov 11 16:10:06 2008
Subject: [datatype-dev] CR: fix of a crash in flvrenderer
In-Reply-To: <6.2.1.2.2.20081111171840.03a0b358@mailone.real.com>
References: <6.2.1.2.2.20081111171840.03a0b358@mailone.real.com>
Message-ID: <50104.98.203.244.37.1226455578.squirrel@mailone.real.com>
Stan,
Sheldon just checked in the fix for the same issue. The event is expected
to be created by the time the thread proc is running.
The fix is to create the event prior to the creation of the thread instead
of afterwards.
Please sync-up the code in flashhost and see if that fixes yours.
Thanks
Henry
> Synopsis:
> This crash was reproduced when processing a specific FLV input file by
> DTDriver.
>
> Overview:
> This simply adds a NULL pointer check which prevents a crash in
> flvrenderer.dll.
>
> Files Added
> None
>
> Files Modified:
> /cvsroot/datatype/flash/flashhost/platform/win32/flash_guest_player_ax.cpp
>
> Branch:
> atlas310, HEAD
>
> Files Attached:
> datatype_flash_flashhost.diff_______________________________________________
> Datatype-dev mailing list
> Datatype-dev@helixcommunity.org
> http://lists.helixcommunity.org/mailman/listinfo/datatype-dev
>
From alokj at real.com Wed Nov 12 04:36:08 2008
From: alokj at real.com (Alok Jain)
Date: Wed Nov 12 02:39:47 2008
Subject: [datatype-dev] CN: To Support the Fix bounds checking in Bitstream
class
References: <002001c94337$f980cd40$7601a8c0@AlokSystem>
<008b01c94355$3d746850$b85d38f0$@com>
<001801c943fb$41617c90$7601a8c0@AlokSystem>
<004d01c9440b$1edf27c0$5c9d7740$@com>
<009801c94414$826854c0$7601a8c0@AlokSystem>
<009201c9441e$a9ca12b0$fd5e3810$@com> <4919CB7C.6000309@real.com>
<00b101c9442d$5f603f10$1e20bd30$@com>
Message-ID: <004801c944c3$3f0abe70$7601a8c0@AlokSystem>
I checked in "Fixes in BitStream class" changes into Atlas 310.
Thanks
Alok
----- Original Message -----
From: "Eric Hyche"
To: "'Greg Wright'" ; "Alok Jain"
Cc:
Sent: Wednesday, November 12, 2008 12:13 AM
Subject: RE: To Support the Fix bounds checking in Bitstream class
> Alok,
>
> Please check the Bitstream class changes into 310Atlas as well.
>
> Eric
>
> =======================================
> Eric Hyche (ehyche@real.com)
> Principal Engineer
> RealNetworks, Inc.
>
>
>>-----Original Message-----
>>From: Greg Wright [mailto:gwright@real.com]
>>Sent: Tuesday, November 11, 2008 1:14 PM
>>To: ehyche@real.com
>>Cc: datatype-dev@helixcommunity.org
>>Subject: Re: To Support the Fix bounds checking in Bitstream class
>>
>>Eric Hyche wrote:
>>> Greg,
>>>
>>> Do we want to check these into 310Atlas? My guess is
>>> that we *would* want them in 310Atlas, since they
>>> eliminate some potential crashes if we encountered
>>> malicious bitstreams.
>>
>>Yes, I think they are a good addition.
>>--greg.
>>
>>
>>>
>>> Eric
>>>
>>> =======================================
>>> Eric Hyche (ehyche@real.com)
>>> Principal Engineer
>>> RealNetworks, Inc.
>>>
>>>
>>>> -----Original Message-----
>>>> From: Alok Jain [mailto:alokj@real.com]
>>>> Sent: Tuesday, November 11, 2008 10:45 AM
>>>> To: ehyche@real.com; datatype-dev@helixcommunity.org
>>>> Subject: CN: To Support the Fix bounds checking in Bitstream class
>>>>
>>>> Thanks Eric,
>>>>
>>>> This is now checked into HEAD.
>>>>
>>>>
>>>>
>>>> Thanks
>>>>
>>>> Alok
>>>>
>>>>
>>>>
>>>> ----- Original Message -----
>>>> From: "Eric Hyche"
>>>> To: "'Alok Jain'" ;
>>>> Sent: Tuesday, November 11, 2008 8:08 PM
>>>> Subject: RE: CR: To Support the Fix bounds checking in Bitstream class
>>>>
>>>>
>>>>> These additional changes look good. Please check
>>>>> all of the changes into HEAD only for now.
>>>>>
>>>>> However, please save your diff files. We may be asked to
>>>>> merge these to 310Atlas or other branches, so keeping
>>>>> the diff files around will make that merge easily should
>>>>> we be asked to do that.
>>>>>
>>>>> Eric
>>>>>
>>>>> =======================================
>>>>> Eric Hyche (ehyche@real.com)
>>>>> Principal Engineer
>>>>> RealNetworks, Inc.
>>>>>
>>>>>
>>>>>> -----Original Message-----
>>>>>> From: Alok Jain [mailto:alokj@real.com]
>>>>>> Sent: Tuesday, November 11, 2008 7:45 AM
>>>>>> To: ehyche@real.com; datatype-dev@helixcommunity.org
>>>>>> Cc: Alok Jain
>>>>>> Subject: Re:CR: To Support the Fix bounds checking in Bitstream class
>>>>>>
>>>>>> Hi Eric,
>>>>>> Thanks for the suggestions.
>>>>>>
>>>>>> Suggested changes have been incorporated.
>>>>>>
>>>>>> Please find the Diff attached.
>>>>>>
>>>>>>
>>>>>>
>>>>>> Thanks
>>>>>>
>>>>>> Alok Jain
>>>>>>
>>>>>> ----- Original Message -----
>>>>>> From: "Eric Hyche"
>>>>>> To: "'Alok Jain'" ;
>>>>>> Sent: Monday, November 10, 2008 10:26 PM
>>>>>> Subject: RE: [datatype-dev] CR: To Support the Fix bounds checking in
>>>>>> Bitstream class
>>>>>>
>>>>>>
>>>>>>> Alok,
>>>>>>>
>>>>>>> Here are my comments:
>>>>>>>
>>>>>>> 1) datatype/common/util/pub/bitstream.h changes look good.
>>>>>>> 2) datatype/common/util/test/tbitpack.cpp changes look good.
>>>>>>> 3) datatype/common/util/pub/bitpack.h changes look good.
>>>>>>> 4) In datatype/common/util/bitstream.cpp, here:
>>>>>>>
>>>>>>> @@ -113,6 +116,7 @@
>>>>>>> m_bitCount = 8 - (bitCount - m_bitCount);
>>>>>>> }
>>>>>>>
>>>>>>> + m_ulBufSizeBits -= bitCount;
>>>>>>> return ret;
>>>>>>> }
>>>>>>>
>>>>>>> If someone does ignore the BitsLeft() and goes ahead
>>>>>>> and calls GetBits(), then m_ulBufSizeBits could wrap around
>>>>>>> 32-bits and become huge. So we should add a check here
>>>>>>> to make sure that m_ulBufSizeBits only goes down to zero
>>>>>>> and does not wrap around:
>>>>>>>
>>>>>>> + m_ulBufSizeBits -= (bitCount <= m_ulBufSizeBits ? bitCount :
>>>>>>> m_ulBufSizeBits);
>>>>>>>
>>>>>>> 5) In datatype/common/util/bitpack.cpp,
>>>>>>>
>>>>>>> + ulLeft = bs.BitsLeft();
>>>>>>> + if (ulLeft < (UINT32) bitCount)
>>>>>>> + {
>>>>>>> + return HXR_FAIL;
>>>>>>> + }
>>>>>>> while(bitCount)
>>>>>>> {
>>>>>>> int bits = (bitCount > 8) ? 8 : bitCount;
>>>>>>> PackBits(bs.GetBits(bits),
>>>>>>> bits); bitCount -= bits;
>>>>>>> }
>>>>>>> + return HXR_OK;
>>>>>>>
>>>>>>> Here you are only checking once outside the while() loop.
>>>>>>> If we ran out of bits *inside* the while() loop, then
>>>>>>> we would crash. We need to add a check inside of the
>>>>>>> while loop prior to the bs.GetBits() call.
>>>>>>>
>>>>>>> 6) datatype/aac/fileformat/ADIFfile.cpp
>>>>>>>
>>>>>>> + HXLOGL1("Failed to add explicit SBR signal to
>>>>>>> AudioSpecificConfig");
>>>>>>>
>>>>>>> Please use a fourcc in your log statements. In this case, since
>>>>>>> this code is in the AAC file format, then you would use
>>>>>>> HXLOG_AACF. So
>>>>>>> it would look like:
>>>>>>>
>>>>>>> + HXLOGL1(HXLOG_AACF, "Failed to add explicit SBR
>>>>>>> + signal to
>>>>>>> AudioSpecificConfig");
>>>>>>>
>>>>>>>
>>>>>>> - UINT16 unADIFHeaderSize = 0;
>>>>>>>
>>>>>>> Since we are converting unADIFHeaderSize from a local variable
>>>>>>> to an out parameter, we should still set it to 0 here. Otherwise,
>>>>>>> if someone didn't initialize it to 0 before passing it into
>>>>>>> ParseADIFHeader(), then we would get an incorrect value.
>>>>>>>
>>>>>>>
>>>>>>> 7) datatype/aac/fileformat/aacff.cpp - changes looks good
>>>>>>> 8) datatype/aac/fileformat/aacfiletypes.h - changes look good
>>>>>>> 9) datatype/h263/payload/h263pyld.cpp - changes look good
>>>>>>> 10) datatype/h263/payload/rfc2190hlpr.cpp - changes look good
>>>>>>> 11) datatype/h263/payload/rfc2429hlpr.cpp - changes look good
>>>>>>> 12) datatype/mp4/payload/Umakefil - changes look good
>>>>>>> 13) datatype/mp4/payload/amr-depack.cpp
>>>>>>>
>>>>>>> + HXLOGL1("Failed GetTOCInfo()");
>>>>>>>
>>>>>>> For all of the log messages in amr-depack.cpp, use the
>>>>>>> HXLOG_GENE fourcc.
>>>>>>>
>>>>>>> - SortedCopy(bs, ulStartBlock, ulBlockInc, tocInfo);
>>>>>>> + if (!SortedCopy(bs, ulStartBlock, ulBlockInc, tocInfo))
>>>>>>> + {
>>>>>>> + bFailed =TRUE;
>>>>>>> + }
>>>>>>>
>>>>>>> This change looks fine, but it looks like you need a
>>>>>>> similar check for LinearCopy() as well.
>>>>>>>
>>>>>>> Also, if either SortedCopy() or LinearCopy() fail
>>>>>>> and you don't return immediately after the failure,
>>>>>>> then you'll need a !bFailed check here:
>>>>>>>
>>>>>>> if (m_ulMaxInterleave > 0)
>>>>>>>
>>>>>>> @@ -493,6 +546,12 @@
>>>>>>> pCurrent[ulFrameBytes - 1] = 0;
>>>>>>>
>>>>>>> // Copy frame bits into the buffer
>>>>>>> + UINT32 ulLeft = bs.BitsLeft();
>>>>>>> + if (ulLeft < ulFrameBits)
>>>>>>> + {
>>>>>>> + bFailed = TRUE;
>>>>>>> + break;
>>>>>>> + }
>>>>>>> bs.GetBits(ulFrameBits, pCurrent);
>>>>>>>
>>>>>>> These changes are in GetFrameBlock(), which currently has no way
>>>>>>> of
>>>>>>> returning failure. You'll need to modify GetFrameBlock() to be able
>>>>>>> to communicate failure and return ulRet as an out parameter.
>>>>>>>
>>>>>>> 14) datatype/mp4/payload/mp4-latm-depack.cpp - changes look good
>>>>>>> 15) datatype/mp4/payload/mp4a-mux-cfg.cpp
>>>>>>>
>>>>>>> - AudioObjectType = GetAudioObjectType(bs);
>>>>>>> + if (!GetAudioObjectType(bs,AudioObjectType))
>>>>>>> + {
>>>>>>> + HXLOGL1("Failed GetAudioObjectType()");
>>>>>>> + }
>>>>>>>
>>>>>>> Seems like you should go ahead and return FALSE here, or
>>>>>>> include !failed checks for the rest of the function.
>>>>>>> Use HXLOG_GENE fourcc throughout.
>>>>>>>
>>>>>>> - ExtnAudioObjectType = GetAudioObjectType(bs);
>>>>>>> + if (!GetAudioObjectType(bs,ExtnAudioObjectType))
>>>>>>> + {
>>>>>>> + HXLOGL1("Failed GetAudioObjectType()");
>>>>>>> + }
>>>>>>>
>>>>>>> Probably need to return FALSE here.
>>>>>>>
>>>>>>> + ulLeft = bs.BitsLeft();
>>>>>>> + if (ulLeft < (ulAscLen -
>>>>>>> ulAscBits))
>>>>>>> + {
>>>>>>> + return FALSE;
>>>>>>> + }
>>>>>>> // get fill bits
>>>>>>> ulAscLen -= ulAscBits;
>>>>>>> bs.GetBits(ulAscLen);
>>>>>>>
>>>>>>> Why not just move the BitsLeft() check to right before the
>>>>>>> GetBits()
>>>>>>> call and just make it "if (ulLeft < ulAscLen)"?
>>>>>>>
>>>>>>> -ULONG32 MP4AMuxConfig::LatmGetValue(Bitstream&bs, ULONG32& nBits)
>>>>>>> +HXBOOL MP4AMuxConfig::LatmGetValue(Bitstream&bs, ULONG32& nBits,
>>>>>>> +ULONG32&
>>>>>>> ulValue)
>>>>>>> {
>>>>>>> - ULONG32 ulValue = 0;
>>>>>>>
>>>>>>> We should still initialize ulValue to 0 at the top of
>>>>>>> LatmGetValue()
>>>>>>> just in case the caller forgets to initialize it.
>>>>>>>
>>>>>>> 16) datatype/mp4/payload/pub/amr-depack.h - changes look good
>>>>>>> 17) datatype/mp4/payload/pub/mp4-latm-depack.h - changes look good
>>>>>>> 18) datatype/mp4/payload/pub/mp4a-mux-cfg.h - changes look good
>>>>>>>
>>>>>>> Please make the additional changes to LinearCopy() in amr-depack.cpp
>>>>>>> and amr-depack.h and re-submit just diffs of those two files for
>>>>>>> additional review (no need to submit all the other diffs again).
>>>>>>>
>>>>>>> Eric
>>>>>>>
>>>>>>> =======================================
>>>>>>> Eric Hyche (ehyche@real.com)
>>>>>>> Principal Engineer
>>>>>>> RealNetworks, Inc.
>>>>>>>
>>>>>>>
>>>>>>>> -----Original Message-----
>>>>>>>> From: datatype-dev-bounces@helixcommunity.org
>>>>>>>> [mailto:datatype-dev-bounces@helixcommunity.org] On Behalf Of Alok
>>>>>>>> Jain
>>>>>>>> Sent: Monday, November 10, 2008 8:27 AM
>>>>>>>> To: datatype-dev@helixcommunity.org
>>>>>>>> Cc: Alok Jain
>>>>>>>> Subject: [datatype-dev] CR: To Support the Fix bounds checking in
>>>>>>>> Bitstream class
>>>>>>>>
>>>>>>>>
>>>>>>>>
>>>>>>>> Synopsis:
>>>>>>>> To Support the Fix bounds checking in Bitstream class.
>>>>>>>>
>>>>>>>> Overview:
>>>>>>>> Add the method BitsLeft() inside Bitstream class for Fix bounds
>>>>>>>> checking and
>>>>>>>>
>>>>>>>> modified all the instance where GetBits() or PeekBits() is used as
>>>>>>>> a
>>>>>>>> method of
>>>>>>>>
>>>>>>>> Bitstream class.
>>>>>>>>
>>>>>>>>
>>>>>>>> Files Modified:
>>>>>>>> /datatype/common/util/bitpack.cpp
>>>>>>>>
>>>>>>>> /datatype/common/util/bitstream.cpp
>>>>>>>>
>>>>>>>> /datatype/common/util/pub/bitstream.h
>>>>>>>>
>>>>>>>> /datatype/common/util/test/tbitpack.cpp
>>>>>>>>
>>>>>>>> /datatype/common/util/pub/bitpack.h
>>>>>>>>
>>>>>>>> /datatype/aac/fileformat/ADIFfile.cpp
>>>>>>>>
>>>>>>>> /datatype/aac/fileformat/aacff.cpp
>>>>>>>>
>>>>>>>> /datatype/aac/fileformat/aacfiletypes.h
>>>>>>>>
>>>>>>>> /datatype/h263/payload/h263pyld.cpp
>>>>>>>>
>>>>>>>> /datatype/h263/payload/rfc2190hlpr.cpp
>>>>>>>>
>>>>>>>> /datatype/h263/payload/rfc2429hlpr.cpp
>>>>>>>>
>>>>>>>> /datatype/mp4/payload/Umakefil
>>>>>>>>
>>>>>>>> /datatype/mp4/payload/amr-depack.cpp
>>>>>>>>
>>>>>>>> /datatype/mp4/payload/mp4-latm-depack.cpp
>>>>>>>>
>>>>>>>> /datatype/mp4/payload/mp4a-mux-cfg.cpp
>>>>>>>>
>>>>>>>> / datatype/mp4/payload/pub/amr-depack.h
>>>>>>>>
>>>>>>>> /datatype/mp4/payload/pub/mp4-latm-depack.h
>>>>>>>>
>>>>>>>> /datatype/mp4/payload/pub/mp4a-mux-cfg.h
>>>>>>>>
>>>>>>>>
>>>>>>>> Files Added:
>>>>>>>> None
>>>>>>>>
>>>>>>>> Image Size and Heap Use impact (Client -Only):
>>>>>>>> None.
>>>>>>>>
>>>>>>>> Platforms and Profiles Affected:
>>>>>>>> None
>>>>>>>>
>>>>>>>> Distribution Libraries Affected:
>>>>>>>> None.
>>>>>>>>
>>>>>>>> Distribution library impact and planned action:
>>>>>>>> None.
>>>>>>>>
>>>>>>>> Platforms and Profiles Build Verified:
>>>>>>>> Profile: helix-client-all-defines
>>>>>>>>
>>>>>>>> BIF branch: helix.bif
>>>>>>>> Target: splay
>>>>>>>> Branch: HEAD
>>>>>>>>
>>>>>>>> Thanks
>>>>>>>> Alok Jain
>>>>>>>>
>>>>>>>>
>>>>>>>
>>>
>>>
>
From ext-asheesh.srivastava at nokia.com Wed Nov 12 08:02:24 2008
From: ext-asheesh.srivastava at nokia.com (ext-asheesh.srivastava@nokia.com)
Date: Wed Nov 12 06:06:47 2008
Subject: [datatype-dev] CR: Crash in HXMMFCtrlImpl::ReleaseResources() when
used with hardware accelerated codecs.
Message-ID: <03528B6E301B3B42833693425F0A49F701ED9136@daebe102.NOE.Nokia.com>
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: ext-asheesh.srivastava@nokia.com
Reviewed by:
Date: 11-Nov-2008
Project: symbianMmf_wm
Error-Id: N/A
Synopsis: Crash in HXMMFCtrlImpl::ReleaseResources() when used with
hardware accelerated codecs.
Overview: There is a crash in HXMMFCtrlImpl::ReleaseResources() when
the "MMF.SecureOutput" property is deleted i.e.
m_pRegistry->DeleteByName("MMF.SecureOutput");
Crash is due to the fact that MDF audio device is not being destroyed at
the end of playback because its reference count is not zero; this is due
to the property watch object, it creates to observe the
"MMF.SecureOutput" property in CHXMDFAudioDevice::Open(), is not
releasing the reference to the mdf audio device. Reference to audio
device is not being released because property watch object is not being
destroyed.
Solution: Delete the property watch object in
CHXMDFAudioDevice::Close(), this way the reference to MDF audio device
as a property observer is released, allowing the audio device to be
destroyed.
Files Modified:
/cvsroot/datatype/mdf/audio/dsp/mdfauddevice.cpp
New files added:
None.
Image Size and Heap Use impact: no major impact
Module Release testing (STIF)- Passed
Test case(s) Added : No.
Platforms and Profiles Build Verified: helix-client-s60-32-mmf-mdf-dsp
branch: helix_restricted
platform: symbian-91-armv5
target(s): symbianMmf_wm
Branch: HEAD
DIFF:
===================================================================
RCS file: /cvsroot/datatype/mdf/audio/dsp/mdfauddevice.cpp,v
retrieving revision 1.16
diff -u -b -r1.16 mdfauddevice.cpp
--- mdfauddevice.cpp 10 Nov 2008 18:12:43 -0000 1.16
+++ mdfauddevice.cpp 11 Nov 2008 22:14:37 -0000
@@ -495,6 +495,12 @@
HX_RELEASE(m_pContext);
+ if(m_pPropWatch)
+ {
+
m_pPropWatch->ClearWatchByName("MMF.SecureOutput");
+ HX_RELEASE(m_pPropWatch);
+ }
+
HXLOGL4(HXLOG_MDFA,"mdfdev:close > flush=%d", bFlush);
return HXR_OK;
}
Regards,
Asheesh Srivastava
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.helixcommunity.org/pipermail/datatype-dev/attachments/20081112/5d7f4b9b/attachment-0001.html
From ext-asheesh.srivastava at nokia.com Wed Nov 12 08:09:34 2008
From: ext-asheesh.srivastava at nokia.com (ext-asheesh.srivastava@nokia.com)
Date: Wed Nov 12 06:14:32 2008
Subject: [datatype-dev] CR: Crash in HXMMFCtrlImpl::ReleaseResources() when
used with hardware accelerated codecs.
Message-ID: <03528B6E301B3B42833693425F0A49F701ED9140@daebe102.NOE.Nokia.com>
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: ext-asheesh.srivastava@nokia.com
Reviewed by:
Date: 11-Nov-2008
Project: symbianMmf_wm
Error-Id: N/A
Synopsis: Crash in HXMMFCtrlImpl::ReleaseResources() when used with
hardware accelerated codecs.
Overview: There is a crash in HXMMFCtrlImpl::ReleaseResources() when the
"MMF.SecureOutput" property is deleted i.e.
m_pRegistry->DeleteByName("MMF.SecureOutput");
Crash is due to the fact that MDF audio device is not being destroyed at
the end of playback because its reference count is not zero; this is due
to the property watch object, it creates to observe the
"MMF.SecureOutput" property in CHXMDFAudioDevice::Open(), is not
releasing the reference to the mdf audio device. Reference to audio
device is not being released because property watch object is not being
destroyed.
Solution: Delete the property watch object in
CHXMDFAudioDevice::Close(), this way the reference to MDF audio device
as a property observer is released, allowing the audio device to be
destroyed.
Files Modified:
/cvsroot/datatype/mdf/audio/dsp/mdfauddevice.cpp
New files added:
None.
Image Size and Heap Use impact: no major impact
Module Release testing (STIF)- Passed
Test case(s) Added : No.
Platforms and Profiles Build Verified: helix-client-s60-32-mmf-mdf-dsp
branch: helix_restricted
platform: symbian-91-armv5
target(s): symbianMmf_wm
Branch: HEAD, hxclient_2_1_0_cayennes
DIFF:
===================================================================
RCS file: /cvsroot/datatype/mdf/audio/dsp/mdfauddevice.cpp,v
retrieving revision 1.16
diff -u -b -r1.16 mdfauddevice.cpp
--- mdfauddevice.cpp 10 Nov 2008 18:12:43 -0000 1.16
+++ mdfauddevice.cpp 11 Nov 2008 22:14:37 -0000
@@ -495,6 +495,12 @@
HX_RELEASE(m_pContext);
+ if(m_pPropWatch)
+ {
+ m_pPropWatch->ClearWatchByName("MMF.SecureOutput");
+ HX_RELEASE(m_pPropWatch);
+ }
+
HXLOGL4(HXLOG_MDFA,"mdfdev:close > flush=%d", bFlush);
return HXR_OK;
}
Regards,
Asheesh Srivastava
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.helixcommunity.org/pipermail/datatype-dev/attachments/20081112/6cc72efb/attachment.html
From ehyche at real.com Wed Nov 12 12:20:07 2008
From: ehyche at real.com (Eric Hyche)
Date: Wed Nov 12 10:23:42 2008
Subject: [datatype-dev] CR: Crash in HXMMFCtrlImpl::ReleaseResources()
when used with hardware accelerated codecs.
In-Reply-To: <03528B6E301B3B42833693425F0A49F701ED9140@daebe102.NOE.Nokia.com>
References: <03528B6E301B3B42833693425F0A49F701ED9140@daebe102.NOE.Nokia.com>
Message-ID: <00c801c94504$0ee7fc80$2cb7f580$@com>
Looks good.
=======================================
Eric Hyche (ehyche@real.com)
Principal Engineer
RealNetworks, Inc.
>-----Original Message-----
>From: datatype-dev-bounces@helixcommunity.org [mailto:datatype-dev-bounces@helixcommunity.org] On
>Behalf Of ext-asheesh.srivastava@nokia.com
>Sent: Wednesday, November 12, 2008 11:10 AM
>To: datatype-dev@helixcommunity.org
>Subject: [datatype-dev] CR: Crash in HXMMFCtrlImpl::ReleaseResources() when used with hardware
>accelerated codecs.
>
>
>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: ext-asheesh.srivastava@nokia.com Reviewed by:
>Date: 11-Nov-2008
>Project: symbianMmf_wm
>Error-Id: N/A
>Synopsis: Crash in HXMMFCtrlImpl::ReleaseResources() when used with hardware accelerated codecs.
>Overview: There is a crash in HXMMFCtrlImpl::ReleaseResources() when the "MMF.SecureOutput" property
>is deleted i.e.
>m_pRegistry->DeleteByName("MMF.SecureOutput");
>Crash is due to the fact that MDF audio device is not being destroyed at the end of playback because
>its reference count is not zero; this is due to the property watch object, it creates to observe the
>"MMF.SecureOutput" property in CHXMDFAudioDevice::Open(), is not releasing the reference to the mdf
>audio device. Reference to audio device is not being released because property watch object is not
>being destroyed.
>
>Solution: Delete the property watch object in CHXMDFAudioDevice::Close(), this way the reference to
>MDF audio device as a property observer is released, allowing the audio device to be destroyed.
>
>Files Modified:
>/cvsroot/datatype/mdf/audio/dsp/mdfauddevice.cpp
>New files added:
>None.
>Image Size and Heap Use impact: no major impact Module Release testing (STIF)- Passed Test case(s)
>Added : No.
>Platforms and Profiles Build Verified: helix-client-s60-32-mmf-mdf-dsp
>branch: helix_restricted
>platform: symbian-91-armv5
>target(s): symbianMmf_wm
>Branch: HEAD, hxclient_2_1_0_cayennes
>DIFF:
>===================================================================
>RCS file: /cvsroot/datatype/mdf/audio/dsp/mdfauddevice.cpp,v
>retrieving revision 1.16
>diff -u -b -r1.16 mdfauddevice.cpp
>--- mdfauddevice.cpp 10 Nov 2008 18:12:43 -0000 1.16
>+++ mdfauddevice.cpp 11 Nov 2008 22:14:37 -0000
>@@ -495,6 +495,12 @@
>
>HX_RELEASE(m_pContext);
>
>+ if(m_pPropWatch)
>+ {
>+ m_pPropWatch->ClearWatchByName("MMF.SecureOutput");
>+ HX_RELEASE(m_pPropWatch);
>+ }
>+
>HXLOGL4(HXLOG_MDFA,"mdfdev:close > flush=%d", bFlush); return HXR_OK; } Regards, Asheesh Srivastava
>
>
>
>
>
From ext-asheesh.srivastava at nokia.com Wed Nov 12 15:41:31 2008
From: ext-asheesh.srivastava at nokia.com (ext-asheesh.srivastava@nokia.com)
Date: Wed Nov 12 13:45:08 2008
Subject: [datatype-dev] CR: Crash in HXMMFCtrlImpl::ReleaseResources()
when used with hardware accelerated codecs.
In-Reply-To: <00c801c94504$0ee7fc80$2cb7f580$@com>
References: <03528B6E301B3B42833693425F0A49F701ED9140@daebe102.NOE.Nokia.com>
<00c801c94504$0ee7fc80$2cb7f580$@com>
Message-ID: <03528B6E301B3B42833693425F0A49F701F0828F@daebe102.NOE.Nokia.com>
Thanks Eric.
Changes have been committed to Head and hxclient_2_1_0_cayennes.
Regards,
- Asheesh
>-----Original Message-----
>From: ext Eric Hyche [mailto:ehyche@real.com]
>Sent: Wednesday, November 12, 2008 2:20 PM
>To: Srivastava Asheesh (EXT-Infovision-MSW/Dallas);
>datatype-dev@helixcommunity.org
>Subject: RE: [datatype-dev] CR: Crash in
>HXMMFCtrlImpl::ReleaseResources() when used with hardware
>accelerated codecs.
>
>Looks good.
>
>=======================================
>Eric Hyche (ehyche@real.com)
>Principal Engineer
>RealNetworks, Inc.
>
>
>>-----Original Message-----
>>From: datatype-dev-bounces@helixcommunity.org
>>[mailto:datatype-dev-bounces@helixcommunity.org] On Behalf Of
>>ext-asheesh.srivastava@nokia.com
>>Sent: Wednesday, November 12, 2008 11:10 AM
>>To: datatype-dev@helixcommunity.org
>>Subject: [datatype-dev] CR: Crash in
>HXMMFCtrlImpl::ReleaseResources()
>>when used with hardware accelerated codecs.
>>
>>
>>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: ext-asheesh.srivastava@nokia.com Reviewed by:
>>Date: 11-Nov-2008
>>Project: symbianMmf_wm
>>Error-Id: N/A
>>Synopsis: Crash in HXMMFCtrlImpl::ReleaseResources() when
>used with hardware accelerated codecs.
>>Overview: There is a crash in HXMMFCtrlImpl::ReleaseResources() when
>>the "MMF.SecureOutput" property is deleted i.e.
>>m_pRegistry->DeleteByName("MMF.SecureOutput");
>>Crash is due to the fact that MDF audio device is not being destroyed
>>at the end of playback because its reference count is not
>zero; this is
>>due to the property watch object, it creates to observe the
>>"MMF.SecureOutput" property in CHXMDFAudioDevice::Open(), is not
>>releasing the reference to the mdf audio device. Reference to
>audio device is not being released because property watch
>object is not being destroyed.
>>
>>Solution: Delete the property watch object in
>>CHXMDFAudioDevice::Close(), this way the reference to MDF
>audio device as a property observer is released, allowing the
>audio device to be destroyed.
>>
>>Files Modified:
>>/cvsroot/datatype/mdf/audio/dsp/mdfauddevice.cpp
>>New files added:
>>None.
>>Image Size and Heap Use impact: no major impact Module
>Release testing
>>(STIF)- Passed Test case(s) Added : No.
>>Platforms and Profiles Build Verified: helix-client-s60-32-mmf-mdf-dsp
>>branch: helix_restricted
>>platform: symbian-91-armv5
>>target(s): symbianMmf_wm
>>Branch: HEAD, hxclient_2_1_0_cayennes
>>DIFF:
>>===================================================================
>>RCS file: /cvsroot/datatype/mdf/audio/dsp/mdfauddevice.cpp,v
>>retrieving revision 1.16
>>diff -u -b -r1.16 mdfauddevice.cpp
>>--- mdfauddevice.cpp 10 Nov 2008 18:12:43 -0000 1.16
>>+++ mdfauddevice.cpp 11 Nov 2008 22:14:37 -0000
>>@@ -495,6 +495,12 @@
>>
>>HX_RELEASE(m_pContext);
>>
>>+ if(m_pPropWatch)
>>+ {
>>+ m_pPropWatch->ClearWatchByName("MMF.SecureOutput");
>>+ HX_RELEASE(m_pPropWatch);
>>+ }
>>+
>>HXLOGL4(HXLOG_MDFA,"mdfdev:close > flush=%d", bFlush); return
>HXR_OK; }
>>Regards, Asheesh Srivastava
>>
>>
>>
>>
>>
>
>
>
From stanb at real.com Thu Nov 13 12:19:08 2008
From: stanb at real.com (Stanislav Bobrovskiy)
Date: Thu Nov 13 10:22:22 2008
Subject: [datatype-dev] CR: build break fix
Message-ID: <6.2.1.2.2.20081113121602.041def58@mailone.real.com>
Synopsis:
Yesterday's changes in datatype/mp4/payload broke the build on atlas310 branch.
Overview:
Adding missing library and undefined IIDs.
Files Added
None
Files Modified:
datatype/mp4/fileformat/dllumakefil
datatype/mp4/fileformat/plugin.cpp
Branch:
atlas310
Files Attached:
datatype_mp4.diff
-------------- next part --------------
Index: datatype/mp4/fileformat/dllumakefil
===================================================================
RCS file: /cvsroot/datatype/mp4/fileformat/dllumakefil,v
retrieving revision 1.8
diff -u -1 -0 -r1.8 dllumakefil
--- datatype/mp4/fileformat/dllumakefil 2 Jun 2006 00:06:15 -0000 1.8
+++ datatype/mp4/fileformat/dllumakefil 13 Nov 2008 20:07:06 -0000
@@ -92,21 +92,22 @@
"datatype/mp4/payload[mp4pyldlib]",
"datatype/rm/common[rmcommonlib]",
"datatype/common/util[dtutillib]",
"protocol/common/util[protutillib]",
"protocol/sdp[sdplib]",
"protocol/rtsp[rtsplib]",
"common/system[syslib]",
"common/container[contlib]",
"common/util[utillib]",
"common/dbgtool[debuglib]",
- "common/runtime[runtlib]")
+ "common/runtime[runtlib]",
+ "common/log/logutil[logutillib]")
if project.IsDefined("HELIX_FEATURE_QUICKTIME") or \
project.IsDefined("HELIX_FEATURE_MP4_FILEFORMAT_ALTERNATES"):
project.AddDefines("QTCONFIG_ALTERNATE_STREAMS")
if project.IsDefined("HELIX_FEATURE_QUICKTIME"):
project.AddDefines("QTCONFIG_LEGACY_ALTERNATE_STREAMS")
if project.IsDefined("QTCONFIG_GET_BITRATE_FROM_SDP_PAYLOAD") or \
project.IsDefined("QTCONFIG_ALTERNATE_STREAMS") or \
Index: datatype/mp4/fileformat/plugin.cpp
===================================================================
RCS file: /cvsroot/datatype/mp4/fileformat/plugin.cpp,v
retrieving revision 1.8
diff -u -1 -0 -r1.8 plugin.cpp
--- datatype/mp4/fileformat/plugin.cpp 5 Dec 2006 03:36:54 -0000 1.8
+++ datatype/mp4/fileformat/plugin.cpp 13 Nov 2008 20:07:06 -0000
@@ -61,20 +61,23 @@
#include "defslice.h"
#include "qtres.h"
#include "hxsdesc.h"
#include "hxstring.h"
#include "qtffplin.h"
#include "netbyte.h"
#include "hxver.h"
#include "hxxres.h"
#include "hxxrsmg.h"
#include "ihxlist.h"
+#include "ihxtlogsystem.h"
+#include "ihxtlogsystemcontext.h"
+#include "hxdllaccess.h"
#include "qtffplin.h"
#include "qtffrefcounter.h"
#ifdef _AIX
#include "hxtbuf.h"
#include "dllpath.h"
ENABLE_MULTILOAD_DLLACCESS_PATHS(Qtffplin)
#endif
From Yury.Ramanovich at nokia.com Thu Nov 13 12:42:27 2008
From: Yury.Ramanovich at nokia.com (Yury.Ramanovich@nokia.com)
Date: Thu Nov 13 10:46:32 2008
Subject: [datatype-dev] CR needed: REQ 403-11594,
SUB 417-12093: Helix engine support for the AVI file
format (210Cays)
Message-ID:
Skipped content of type multipart/alternative-------------- next part --------------
Index: helix.bif
===================================================================
RCS file: /cvsroot/common/build/BIF/helix.bif,v
retrieving revision 1.710
diff -u -w -r1.710 helix.bif
--- helix.bif 11 Nov 2008 22:10:32 -0000 1.710
+++ helix.bif 13 Nov 2008 20:16:09 -0000
@@ -3111,7 +3111,7 @@
- unix mac win32
+ unix mac win32 symbian
@@ -8664,6 +8664,8 @@
filesystem_http
datatype_aac_fileformat
+
+ datatype_avi_fileformat
Index: hxclient_2_1_0_cayennes.bif
===================================================================
RCS file: /cvsroot/client/build/BIF/hxclient_2_1_0_cayennes.bif,v
retrieving revision 1.27
diff -u -w -r1.27 hxclient_2_1_0_cayennes.bif
--- hxclient_2_1_0_cayennes.bif 9 Apr 2008 15:45:34 -0000 1.27
+++ hxclient_2_1_0_cayennes.bif 7 Nov 2008 20:20:12 -0000
@@ -2667,7 +2667,7 @@
- unix mac win32
+ unix mac win32 symbian
@@ -7607,6 +7607,8 @@
filesystem_http
datatype_aac_fileformat
+
+ datatype_avi_fileformat
Index: client/common/system/hxfsmgr.cpp
===================================================================
RCS file: /cvsroot/client/common/system/hxfsmgr.cpp,v
retrieving revision 1.13
diff -u -w -r1.13 hxfsmgr.cpp
--- client/common/system/hxfsmgr.cpp 3 May 2005 18:23:27 -0000 1.13
+++ client/common/system/hxfsmgr.cpp 13 Nov 2008 20:07:41 -0000
@@ -772,6 +772,8 @@
if (!m_pOriginalObject)
goto exit;
+ HX_RELEASE(m_pSamePool);
+
if(HXR_OK != m_pOriginalObject->QueryInterface(IID_IHXGetFileFromSamePool,
(void**)&m_pSamePool))
{
Index: clientapps/symbianMmf/videocontroller/101F8513.rss
===================================================================
RCS file: /cvsroot/clientapps/symbianMmf/videocontroller/101F8513.rss,v
retrieving revision 1.3.2.8
diff -u -w -r1.3.2.8 101F8513.rss
--- clientapps/symbianMmf/videocontroller/101F8513.rss 25 Jul 2007 22:48:09 -0000 1.3.2.8
+++ clientapps/symbianMmf/videocontroller/101F8513.rss 13 Nov 2008 20:08:02 -0000
@@ -137,6 +137,16 @@
default_data = "?";
opaque_data = "Real0x101f5d07.xpsv=?\nv=?\r\napplication/x-ext-packetsrc";
rom_only = ROM_ONLY_FLAG;
+ },
+ IMPLEMENTATION_INFO
+ {
+ // AVI
+ implementation_uid = 0x2001E2E8;
+ version_no = 1;
+ display_name = "Helix AVI File Format";
+ default_data = "?";
+ opaque_data = "Real0x101f5d07.aviRIFF????AVIapplication/x-pn-avi-pluginvideo/avivideo/x-msvideovideo/msvideo";
+ rom_only = ROM_ONLY_FLAG;
}
};
}
Index: clientapps/symbianMmf/videocontroller/installMMF.pcf
===================================================================
RCS file: /cvsroot/clientapps/symbianMmf/videocontroller/installMMF.pcf,v
retrieving revision 1.5.2.19
diff -u -w -r1.5.2.19 installMMF.pcf
--- clientapps/symbianMmf/videocontroller/installMMF.pcf 25 Mar 2008 18:21:47 -0000 1.5.2.19
+++ clientapps/symbianMmf/videocontroller/installMMF.pcf 13 Nov 2008 20:08:02 -0000
@@ -178,7 +178,8 @@
'arma' : 'datatype/mp4/audio/mdf/[target]/arma.dll',
'progdownfs' : 'filesystem/progdown/[target]/progdownfs.dll',
'XPSFileFormat' : 'datatype/xps/fileformat/[target]/XPSFileFormat.dll',
- 'hxmetadataeng' : 'datatype/xps/fileformat/[target]/hxmetadataeng.dll'
+ 'hxmetadataeng' : 'datatype/xps/fileformat/[target]/hxmetadataeng.dll',
+ 'avifformat' : 'datatype/avi/fileformat/[target]/avifformat.dll'
}
@@ -219,6 +220,7 @@
Add('httpfsys')
Add('aacff')
Add('XPSFileFormat')
+Add('avifformat')
if project.IsDefined("HELIX_FEATURE_METADATAENG"):
Add('hxmetadataeng')
Index: datatype/avi/fileformat/Umakefil
===================================================================
RCS file: /cvsroot/datatype/avi/fileformat/Umakefil,v
retrieving revision 1.1
diff -u -w -r1.1 Umakefil
--- datatype/avi/fileformat/Umakefil 6 Oct 2004 16:15:02 -0000 1.1
+++ datatype/avi/fileformat/Umakefil 13 Nov 2008 20:08:22 -0000
@@ -42,4 +42,4 @@
if project.IsDefined("HELIX_FEATURE_SERVER"):
MultiTargetMake("aviffdll")
else:
- MultiTargetMake("avifflib")
+ MultiTargetMake("avifflib","aviffdll")
Index: datatype/avi/fileformat/aviffdll
===================================================================
RCS file: /cvsroot/datatype/avi/fileformat/aviffdll,v
retrieving revision 1.2
diff -u -w -r1.2 aviffdll
--- datatype/avi/fileformat/aviffdll 9 Aug 2005 20:01:08 -0000 1.2
+++ datatype/avi/fileformat/aviffdll 13 Nov 2008 20:08:22 -0000
@@ -63,5 +63,6 @@
"common/include",
"hxcom.h")
project.ExportFunction("CanUnload", "void")
+project.ExportFunction("CanUnload2", "void")
DLLTarget("avifformat")
Index: datatype/avi/fileformat/avifflib
===================================================================
RCS file: /cvsroot/datatype/avi/fileformat/avifflib,v
retrieving revision 1.2
diff -u -w -r1.2 avifflib
--- datatype/avi/fileformat/avifflib 9 Aug 2005 20:01:08 -0000 1.2
+++ datatype/avi/fileformat/avifflib 13 Nov 2008 20:08:22 -0000
@@ -41,7 +41,7 @@
"common/container/pub",
"common/dbgtool/pub",
"common/system/pub",
- "common/util/pub/",
+ "common/util/pub",
"common/runtime/pub",
"datatype/common/util/pub",
"datatype/rm/include",
Index: datatype/avi/fileformat/aviffpln.cpp
===================================================================
RCS file: /cvsroot/datatype/avi/fileformat/aviffpln.cpp,v
retrieving revision 1.5
diff -u -w -r1.5 aviffpln.cpp
--- datatype/avi/fileformat/aviffpln.cpp 9 Aug 2005 20:01:08 -0000 1.5
+++ datatype/avi/fileformat/aviffpln.cpp 13 Nov 2008 20:08:23 -0000
@@ -125,7 +125,6 @@
#define LE16_TO_HOST(x) (x)
#endif // NET_ENDIAN
-INT32 g_nRefCount_avif;
/****************************************************************************
*
@@ -172,21 +171,16 @@
* then the pluginhandler can unload the DLL
*
*/
-HX_RESULT CAVIFileFormat::CanUnload(void)
-{
- HX_ASSERT(g_nRefCount_avif >= 0);
- return(g_nRefCount_avif > 0 ? HXR_FAIL : HXR_OK);
-}
-
-const char* CAVIFileFormat::zm_pDescription = "RealNetworks AVI File Format Plugin";
-const char* CAVIFileFormat::zm_pCopyright = HXVER_COPYRIGHT;
-const char* CAVIFileFormat::zm_pMoreInfoURL = "http://www.real.com";
-const char* CAVIFileFormat::zm_pFileMimeTypes[] = {"application/x-pn-avi-plugin", NULL};
-const char* CAVIFileFormat::zm_pFileExtensions[] = {"avi", NULL};
-const char* CAVIFileFormat::zm_pFileOpenNames[] = {"AVI Files (*.avi)",
+const char* const CAVIFileFormat::zm_pDescription = "RealNetworks AVI File Format Plugin";
+const char* const CAVIFileFormat::zm_pCopyright = HXVER_COPYRIGHT;
+const char* const CAVIFileFormat::zm_pMoreInfoURL = "http://www.real.com";
+
+const char* const CAVIFileFormat::zm_pFileMimeTypes[] = {"application/x-pn-avi-plugin", "video/x-msvideo", "video/avi", "video/msvideo", NULL};
+const char* const CAVIFileFormat::zm_pFileExtensions[] = {"avi", "divx", NULL};
+const char* const CAVIFileFormat::zm_pFileOpenNames[] = {"AVI Files (*.avi)",
"DivX Files (*.divx)", NULL};
-const char* CAVIFileFormat::zm_pPacketFormats[] = {"rdt", "rtp", NULL};
+const char* const CAVIFileFormat::zm_pPacketFormats[] = {"rdt", "rtp", NULL};
CAVIFileFormat::CAVIFileFormat()
: m_bSeekPriming(FALSE)
@@ -208,7 +202,6 @@
, m_pszCopyright(NULL)
, m_state(AS_InitPending)
{
- g_nRefCount_avif++; // DLL Ref Counting
// Header fields set to 0
@@ -302,9 +295,9 @@
{
bLoadMultiple = TRUE; // Must be true for file formats.
- pDescription = zm_pDescription;
- pCopyright = zm_pCopyright;
- pMoreInfoURL = zm_pMoreInfoURL;
+ pDescription = (const char*) zm_pDescription;
+ pCopyright = (const char*) zm_pCopyright;
+ pMoreInfoURL = (const char*) zm_pMoreInfoURL;
ulVersionNumber = TARVER_ULONG32_VERSION;
return HXR_OK;
@@ -314,7 +307,6 @@
CAVIFileFormat::~CAVIFileFormat()
{
Close();
- g_nRefCount_avif--; // DLL Ref Counting
return;
}
@@ -334,9 +326,9 @@
REF(const char**) /*OUT*/ pFileOpenNames
)
{
- pFileMimeTypes = zm_pFileMimeTypes;
- pFileExtensions = zm_pFileExtensions;
- pFileOpenNames = zm_pFileOpenNames;
+ pFileMimeTypes = (const char**) zm_pFileMimeTypes;
+ pFileExtensions = (const char**) zm_pFileExtensions;
+ pFileOpenNames = (const char**) zm_pFileOpenNames;
return HXR_OK;
}
@@ -446,6 +438,8 @@
IHXFileObject* /*IN*/ pFile
)
{
+ HXLOGL2(HXLOG_AVIX,"CAVIFileFormat[%p]::InitFileFormat() pRequest=%p pFormatResponse=%p pFile=%p", this, pRequest, pFormatResponse, pFile);
+
m_pRequest = pRequest;
m_pFFResponse = pFormatResponse;
m_pFile = pFile;
@@ -485,6 +479,7 @@
STDMETHODIMP CAVIFileFormat::Close()
{
+ HXLOGL2(HXLOG_AVIX,"CAVIFileFormat[%p]::Close()",this);
m_state = AS_Closed;
HX_VECTOR_DELETE(m_pszTitle);
@@ -565,6 +560,8 @@
STDMETHODIMP CAVIFileFormat::GetStreamHeader(UINT16 usStream)
{
+ HXLOGL3(HXLOG_AVIX,"CAVIFileFormat[%p]::GetStreamHeader() on stream %i", this, usStream);
+
HX_ASSERT(usStream <= m_header.ulStreams);
// Note request:
@@ -638,7 +635,8 @@
STDMETHODIMP CAVIFileFormat::GetPacket(UINT16 unStreamNumber)
{
- HX_TRACE("CAVIFileFormat::GetPacket() on stream %i\n", unStreamNumber);
+ HXLOGL4(HXLOG_AVIX,"CAVIFileFormat[%p]::GetPacket() on stream %i", this, unStreamNumber);
+
HX_ASSERT(m_state >= AS_GetIndexFilePending);
//HX_ASSERT(!m_bSeekPriming);
if (m_state <= AS_IndexFileInit)
@@ -692,7 +690,7 @@
*/
STDMETHODIMP CAVIFileFormat::Seek(ULONG32 ulOffset)
{
- HX_TRACE("CAVIFileFormat::Seek()\t%lu\n", ulOffset);
+ HXLOGL2(HXLOG_AVIX,"CAVIFileFormat[%p]::Seek()\t%lu", this, ulOffset);
// We should handle seeks past end of stream by streaming all data
// past and including the last keyframe
@@ -730,7 +728,7 @@
REF(UINT16) ulPercentDone
)
{
- //HX_TRACE("CAVIFileFormat::GetStatus()\n");
+ HXLOGL4(HXLOG_AVIX,"CAVIFileFormat[%p]::GetStatus() m_state=%d", this, m_state);
HX_RESULT hResult = HXR_OK;
#if 0
@@ -781,8 +779,8 @@
REF(const char**) /*OUT*/ pPacketFormats
)
{
- //HX_TRACE("CAVIFileFormat::GetSupportedPacketFormats()\n");
- pPacketFormats = zm_pPacketFormats;
+ HXLOGL2(HXLOG_AVIX,"CAVIFileFormat[%p]::GetSupportedPacketFormats()", this);
+ pPacketFormats = (const char**) zm_pPacketFormats;
return HXR_OK;
}
@@ -799,7 +797,7 @@
)
{
#if 0
- //HX_TRACE("CAVIFileFormat::SetPacketFormat()\n");
+ HXLOGL2(HXLOG_AVIX,"CAVIFileFormatp[%p]::SetPacketFormat()", this);
if ( strcasecmp(pPacketFormat, "rtp") == 0 )
{
m_packetFormat = PFMT_RTP;
@@ -816,7 +814,7 @@
STDMETHODIMP
CAVIFileFormat::RIFFOpenDone(HX_RESULT status)
{
- //PN_TRACE("CAVIFileFormat::RIFFOpenDone(%lx)\n", status);
+ HXLOGL4(HXLOG_AVIX,"CAVIFileFormat[%p]::RIFFOpenDone(%lx)",this,status);
HX_ASSERT(SUCCEEDED(status));
if ( m_state != AS_OpenPending )
@@ -833,7 +831,7 @@
}
// Verify this is indeed an AVI file:
- if (m_pGeneralReader->FileSubtype() != HX_MAKE4CC('A', 'V', 'I', ' '))
+ if (m_pGeneralReader->FileSubtype() != m_pGeneralReader->GetLong((UCHAR *)"AVI "))
{
m_pErrorMessages->Report(HXLOG_ERR, HXR_INVALID_FILE,
0, (const char*) "The stream URL is not a valid AVI",
@@ -849,7 +847,7 @@
STDMETHODIMP
CAVIFileFormat::RIFFCloseDone(HX_RESULT status)
{
- //HX_TRACE("CAVIFileFormat::RIFFCloseDone(%lx)\n", status);
+ HXLOGL4(HXLOG_AVIX,"CAVIFileFormat[%p]::RIFFCloseDone(%lx)",this, status);
HX_ASSERT(SUCCEEDED(status));
HX_ASSERT(m_state >= AS_GetIndexFilePending);
@@ -859,8 +857,8 @@
STDMETHODIMP
CAVIFileFormat::RIFFFindChunkDone(HX_RESULT status, UINT32 len)
{
- //HX_TRACE("CAVIFileFormat::RIFFFindChunkDone(""%lx, %lu)\n\tstate=%lu\n",
- // status, len, m_state);
+ HXLOGL4(HXLOG_AVIX,"CAVIFileFormat[%p]::RIFFFindChunkDone(%lx, %lu)\tstate=%lu",
+ this, status, len, m_state);
switch (m_state)
{
@@ -974,7 +972,7 @@
// We note the MOVI offset:
m_state = AS_INFOAscend;
m_ulMOVIOffset = m_pGeneralReader->GetOffset() - 4;
- //HX_TRACE("movi offset:%lx\n", m_ulMOVIOffset);
+ HXLOGL4(HXLOG_AVIX,"movi offset:%lx", m_ulMOVIOffset);
m_pGeneralReader->Ascend();
break;
case AVI_INFO_CHUNK:
@@ -1024,7 +1022,7 @@
STDMETHODIMP
CAVIFileFormat::RIFFDescendDone(HX_RESULT status)
{
- //HX_TRACE("CAVIFileFormat::RIFFDescendDone(%lx)\n\tstate=%lu\n", status, m_state);
+ HXLOGL4(HXLOG_AVIX,"CAVIFileFormat[%p]::RIFFDescendDone(%lx)\tstate=%lu", this, status, m_state);
HX_ASSERT(SUCCEEDED(status));
switch ( m_state )
@@ -1089,7 +1087,7 @@
STDMETHODIMP
CAVIFileFormat::RIFFAscendDone(HX_RESULT status)
{
- //HX_TRACE("CAVIFileFormat::RIFFAscendDone(%lx)\n\tstate=%lu\n", status, m_state);
+ HXLOGL4(HXLOG_AVIX,"CAVIFileFormat[%p]::RIFFAscendDone(%lx)\tstate=%lu", this, status, m_state);
HX_ASSERT(SUCCEEDED(status));
switch ( m_state )
@@ -1142,7 +1140,7 @@
STDMETHODIMP
CAVIFileFormat::RIFFReadDone(HX_RESULT status, IHXBuffer* pBuffer)
{
- //HX_TRACE("CAVIFileFormat::RIFFReadDone(%lx)\n\tstate=%lu\n", status, m_state);
+ HXLOGL4(HXLOG_AVIX,"CAVIFileFormat[%p]::RIFFReadDone(%lx)\tstate=%lu", this, status, m_state);
HX_ASSERT(SUCCEEDED(status));
if (m_state < AS_AVIHRead ||
@@ -1237,7 +1235,7 @@
void CAVIFileFormat::SetInfo(IHXBuffer* pBuffer, UINT32 ulChunkType)
{
- //HX_TRACE("CAVIFileFormat::SetInfo()\n", m_state);
+ HXLOGL3(HXLOG_AVIX,"CAVIFileFormat[%p]::SetInfo()", this, m_state);
if (!pBuffer)
{
HX_ASSERT(FALSE);
@@ -1252,19 +1250,19 @@
switch (ulChunkType)
{
case AVI_TITLE_CHUNK:
- m_pszTitle = new CHAR[len+1];
+ m_pszTitle = new char[len+1];
memset(m_pszTitle, len+1, 0);
strcpy(m_pszTitle, (const char*)buf);
break;
case AVI_AUTHOR_CHUNK:
- m_pszAuthor = new CHAR[len+1];
+ m_pszAuthor = new char[len+1];
memset(m_pszAuthor, len+1, 0);
strcpy(m_pszAuthor, (const char*)buf);
break;
case AVI_COPYRIGHT_CHUNK:
- m_pszCopyright = new CHAR[len+1];
+ m_pszCopyright = new char[len+1];
memset(m_pszCopyright, len+1, 0);
strcpy(m_pszCopyright, (const char*)buf);
break;
@@ -1275,7 +1273,7 @@
HX_RESULT CAVIFileFormat::SetHeader(IHXBuffer* pBuffer)
{
- //HX_TRACE("CAVIFileFormat::SetHeader\n\tstate=%lu\n", m_state);
+ HXLOGL3(HXLOG_AVIX,"CAVIFileFormat[%p]::SetHeader\tstate=%lu", this, m_state);
HX_ASSERT_VALID_PTR(pBuffer);
UINT32 len = pBuffer->GetSize();
@@ -1310,7 +1308,7 @@
STDMETHODIMP
CAVIFileFormat::RIFFSeekDone(HX_RESULT status)
{
- //HX_TRACE("CAVIFileFormat::RIFFSeekDone(%lx)\n\tstate=%lu\n", status, m_state);
+ HXLOGL4(HXLOG_AVIX,"CAVIFileFormat[%p]::RIFFSeekDone(%lx)\tstate=%lu", this,status, m_state);
HX_ASSERT(FALSE);
return HXR_UNEXPECTED;
@@ -1321,8 +1319,8 @@
UINT32 ulChunkType,
IHXBuffer* pBuffer)
{
-// HX_TRACE("CAVIFileFormat::RIFFGetChunkDone(%lx, %lx)\n\tstate=%lu\n",
-// status, ulChunkType, m_state);
+ HXLOGL4(HXLOG_AVIX,"CAVIFileFormat[%p]::RIFFGetChunkDone(%lx, %lx)\tstate=%lu",
+ this, status, ulChunkType, m_state);
// HX_ASSERT(FALSE);
// return HXR_OK;
@@ -1353,7 +1351,7 @@
CAVIFileFormat::FileObjectReady(HX_RESULT status,
IUnknown* pObject)
{
- //HX_TRACE("CAVIFileFormat::FileObjectReady\n\tstate=%lu\n", m_state);
+ HXLOGL4(HXLOG_AVIX,"CAVIFileFormat[%p]::FileObjectReady\tstate=%lu", this, m_state);
HX_ASSERT(SUCCEEDED(status));
HX_ASSERT_VALID_PTR(pObject);
HX_ASSERT(m_state == AS_GetIndexFilePending || m_state == AS_GetStreamFilePending);
@@ -1498,7 +1496,7 @@
void CAVIFileFormat::ScanState()
{
- //HX_TRACE("CAVIFileFormat::ScanState\n\tstate=%lu\n", m_state);
+ HXLOGL4(HXLOG_AVIX,"CAVIFileFormat[%p]::ScanState\tstate=%lu", this, m_state);
if (m_state != AS_Ready)
{
@@ -1561,13 +1559,7 @@
IHXPacket* pPendingPacket = ((CAVIStream*) m_streamArray[lEarliestStream])->GetNextPacket();
HX_ASSERT(pPendingPacket);
- if (m_bSeekPriming)
- {
- m_bSeekPriming = FALSE;
- HX_ASSERT(!pPendingPacket->GetASMRuleNumber());
- }
-
- HX_TRACE("CAVIFileFormat::ScanState\tPacketReady, stream: %lu\ttimestamp: %lu\n", pPendingPacket->GetStreamNumber(), pPendingPacket->GetTime());
+ HXLOGL4(HXLOG_AVIX,"CAVIFileFormat[%p]::ScanState\tPacketReady, stream: %lu\ttimestamp: %lu", this, pPendingPacket->GetStreamNumber(), pPendingPacket->GetTime());
// Warning: core call
m_pFFResponse->PacketReady(HXR_OK, pPendingPacket);
HX_RELEASE(pPendingPacket);
@@ -1692,6 +1684,7 @@
if (m_bSeekPriming)
{
m_pFFResponse->SeekDone(HXR_OK);
+ m_bSeekPriming = FALSE;
return;
}
@@ -1705,7 +1698,7 @@
IHXValues* CAVIFileFormat::GetHeader()
{
- //HX_TRACE("CAVIFileFormat::GetHeader()\n", m_state);
+ HXLOGL3(HXLOG_AVIX,"CAVIFileFormat[%p]::GetHeader()", this,m_state);
HX_ASSERT(m_streamArray.GetSize() > 0);
HX_ASSERT(m_header.ulStreams == m_streamArray.GetSize());
@@ -1734,27 +1727,27 @@
{
pTitle->Set((const UCHAR*)m_pszTitle, strlen(m_pszTitle)+1);
pHeader->SetPropertyBuffer("Title", pTitle);
- //HX_TRACE("\tTitle:\t%s\n", m_pszTitle);
+ HXLOGL3(HXLOG_AVIX,"\tTitle:\t%s", m_pszTitle);
}
if ( m_pszAuthor )
{
pAuthor->Set((const UCHAR*)m_pszAuthor, strlen(m_pszAuthor)+1);
pHeader->SetPropertyBuffer("Author", pAuthor);
- //HX_TRACE("\tAuthor:\t%s\n", m_pszAuthor);
+ HXLOGL3(HXLOG_AVIX,"\tAuthor:\t%s", m_pszAuthor);
}
if ( m_pszCopyright )
{
pCopyright->Set((const UCHAR*)m_pszCopyright, strlen(m_pszCopyright)+1);
pHeader->SetPropertyBuffer("Copyright", pCopyright);
- //HX_TRACE("\tCopyright:\t%s\n", m_pszCopyright);
+ HXLOGL3(HXLOG_AVIX,"\tCopyright:\t%s", m_pszCopyright);
}
}
// XXXKB Unconditionally enable recording? Can this be improved??
pHeader->SetPropertyULONG32("Flags", HX_SAVE_ENABLED);
- //HX_TRACE("\tFlags:\t%lu\n", HX_SAVE_ENABLED);
+ HXLOGL3(HXLOG_AVIX,"\tFlags:\t%lu", HX_SAVE_ENABLED);
// XXXKB Disable seeking if we have no index?
@@ -1768,7 +1761,7 @@
void CAVIFileFormat::IOEvent()
{
- //HX_TRACE("CAVIFileFormat::IOEvent\n\tstate=%lu\n", m_state);
+ HXLOGL4(HXLOG_AVIX,"CAVIFileFormat[%p]::IOEvent\tstate=%lu", this, m_state);
HX_ASSERT(m_state == AS_IndexFileInit || m_state == AS_IOEvent ||
m_state == AS_Closed);
Index: datatype/avi/fileformat/aviindx.cpp
===================================================================
RCS file: /cvsroot/datatype/avi/fileformat/aviindx.cpp,v
retrieving revision 1.6
diff -u -w -r1.6 aviindx.cpp
--- datatype/avi/fileformat/aviindx.cpp 9 Aug 2005 20:01:08 -0000 1.6
+++ datatype/avi/fileformat/aviindx.cpp 13 Nov 2008 20:08:23 -0000
@@ -53,6 +53,7 @@
#include "ihxpckts.h"
#include "hxheap.h"
+#include "hxtlogutil.h"
#ifdef _DEBUG
#undef HX_THIS_FILE
@@ -98,12 +99,12 @@
, m_scanState(eInitial)
, m_lRefCount(0)
{
- //HX_TRACE("CAVIFileFormat::CAVIIndex::CAVIIndex()\n");
+ HXLOGL2(HXLOG_AVIX,"CAVIIndex[%p]::CAVIIndex() CTOR", this);
}
CAVIIndex::~CAVIIndex()
{
- //HX_TRACE("CAVIFileFormat::CAVIIndex::~CAVIIndex()\n");
+ HXLOGL2(HXLOG_AVIX,"CAVIIndex[%p]::~CAVIIndex() DES", this);
/* HX_RELEASE(m_pReader);
HX_RELEASE(m_pOuter);
@@ -119,7 +120,7 @@
IUnknown* pContext, UINT32 ulFirstMOVIOffset,
UINT16 usStreamCount)
{
- //HX_TRACE("CAVIFileFormat::CAVIIndex::Init()\n");
+ HXLOGL2(HXLOG_AVIX,"CAVIIndex[%p]::Init()", this);
HX_ASSERT_VALID_PTR(pOuter);
m_pOuter = pOuter;
@@ -181,12 +182,11 @@
void CAVIIndex::AddToIndex(UINT16 usStream, UINT32 ulChunk, UINT32 ulOffset,
UINT32 ulSize, BOOL bKeyChunk) // offset includes header
{
- //HX_TRACE("CAVIFileFormat::CAVIIndex::AddToIndex()\n");
+ HXLOGL4(HXLOG_AVIX,"CAVIIndex[%p]::AddToIndex()", this);
StreamSlice* pStream = (StreamSlice*) m_sliceArray[usStream];
// Do we have an index, or is this chunk already indexed?
- if (m_pReader || ulChunk < pStream->ulNextChunkRequired
- || ulChunk < pStream->ulSliceEndChunk)
+ if (m_pReader || ulChunk < pStream->ulSliceEndChunk)
{
return;
}
@@ -210,13 +210,13 @@
void CAVIIndex::FileRead(BOOL bRead) // All chunks have been indexed; reset on seek
{
- //HX_TRACE("CAVIFileFormat::CAVIIndex::FileRead()\n");
+ HXLOGL4(HXLOG_AVIX,"CAVIIndex[%p]::FileRead()", this);
m_bRead = bRead;
}
void CAVIIndex::SetMinimumChunkInterest(UINT16 usStream, UINT32 ulChunk)
{
- //HX_TRACE("CAVIFileFormat::CAVIIndex::SetMinimumChunkInterest()\n");
+ HXLOGL4(HXLOG_AVIX,"CAVIIndex[%p]::SetMinimumChunkInterest()", this);
HX_ASSERT(usStream < m_usStreamCount);
StreamSlice* pStream = (StreamSlice*) m_sliceArray[usStream];
@@ -235,7 +235,7 @@
BOOL CAVIIndex::IsKeyChunk(UINT16 usStream, UINT32 ulChunk)
{
- //HX_TRACE("CAVIFileFormat::CAVIIndex::IsKeyChunk()\n");
+ HXLOGL4(HXLOG_AVIX,"CAVIIndex[%p]::IsKeyChunk()", this);
StreamSlice* pStream = (StreamSlice*) m_sliceArray[usStream];
// in bounds?
@@ -255,7 +255,7 @@
/* out */ UINT32& ulClosestOffset,
/* out */ UINT32& ulClosestStreamChunk)
{
- //HX_TRACE("CAVIFileFormat::CAVIIndex::FindClosestChunk()\n");
+ HXLOGL4(HXLOG_AVIX,"CAVIIndex[%p]::FindClosestChunk()", this);
if (ulChunk == 0)
{
@@ -306,7 +306,7 @@
/* out */ UINT32& ulClosestOffset,
/* out */ UINT32& ulClosestStreamChunk)
{
- //HX_TRACE("CAVIFileFormat::CAVIIndex::FindClosestKeyChunk()\n");
+ HXLOGL4(HXLOG_AVIX,"CAVIIndex[%p]::FindClosestKeyChunk()", this);
if (ulChunk == 0)
{
@@ -355,7 +355,7 @@
// in bytes, not including header:
UINT32 CAVIIndex::GetMaxChunkSize(UINT16 usStream)
{
- //HX_TRACE("CAVIFileFormat::CAVIIndex::GetMaxChunkSize()\n");
+ HXLOGL4(HXLOG_AVIX,"CAVIIndex[%p]::GetMaxChunkSize()", this);
StreamSlice* pStream = (StreamSlice*) m_sliceArray[usStream];
return pStream->ulMaxChunkSize;
}
@@ -363,7 +363,7 @@
// in bytes, not including header:
double CAVIIndex::GetAverageChunkSize(UINT16 usStream)
{
- //HX_TRACE("CAVIFileFormat::CAVIIndex::GetAverageChunkSize()\n");
+ HXLOGL4(HXLOG_AVIX,"CAVIIndex[%p]::GetAverageChunkSize()", this);
StreamSlice* pStream = (StreamSlice*) m_sliceArray[usStream];
return pStream->ulTotalBytes / (double) pStream->ulTotalChunks;
@@ -372,7 +372,7 @@
// Returns zero if we have no index; assumes transmission at average rate
UINT32 CAVIIndex::GetMaxByteDeflict(UINT16 usStream)
{
- //HX_TRACE("CAVIFileFormat::CAVIIndex::GetMaxByteDeflict()\n");
+ HXLOGL4(HXLOG_AVIX,"CAVIIndex[%p]::GetMaxByteDeflict()", this);
StreamSlice* pStream = (StreamSlice*) m_sliceArray[usStream];
return pStream->ulPrerollBytes;
@@ -380,7 +380,7 @@
UINT32 CAVIIndex::GetByteTotal(UINT16 usStream)
{
- //HX_TRACE("CAVIFileFormat::CAVIIndex::GetByteTotal()\n");
+ HXLOGL4(HXLOG_AVIX,"CAVIIndex[%p]::GetByteTotal()", this);
StreamSlice* pStream = (StreamSlice*) m_sliceArray[usStream];
return pStream->ulTotalBytes;
@@ -388,7 +388,7 @@
UINT32 CAVIIndex::GetChunkTotal(UINT16 usStream)
{
- //HX_TRACE("CAVIFileFormat::CAVIIndex::GetChunkTotal()\n");
+ HXLOGL4(HXLOG_AVIX,"CAVIIndex[%p]::GetChunkTotal()", this);
StreamSlice* pStream = (StreamSlice*) m_sliceArray[usStream];
return pStream->ulTotalChunks;
@@ -396,7 +396,7 @@
BOOL CAVIIndex::CanLoadSlice()
{
- //HX_TRACE("CAVIFileFormat::CAVIIndex::CanLoadSlice()\n");
+ HXLOGL4(HXLOG_AVIX,"CAVIIndex[%p]::CanLoadSlice()", this);
// We want serialized access:
HX_ASSERT(m_state == eReady);
@@ -418,7 +418,7 @@
BOOL CAVIIndex::CanPreloadSlice()
{
- //HX_TRACE("CAVIFileFormat::CAVIIndex::CanPreloadSlice()\n");
+ HXLOGL4(HXLOG_AVIX,"CAVIIndex[%p]::CanPreloadSlice()", this);
// We want serialized access:
HX_ASSERT(m_state == eReady);
@@ -441,7 +441,7 @@
void CAVIIndex::GetNextSlice()
{
- //HX_TRACE("CAVIFileFormat::CAVIIndex::GetNextSlice()\n");
+ HXLOGL4(HXLOG_AVIX,"CAVIIndex[%p]::GetNextSlice()", this);
HX_ASSERT(CanLoadSlice() || CanPreloadSlice());
// We want serialized access:
@@ -597,7 +597,7 @@
STDMETHODIMP CAVIIndex::RIFFOpenDone(HX_RESULT status)
{
- //HX_TRACE("CAVIFileFormat::CAVIIndex::RIFFOpenDone()\n");
+ HXLOGL4(HXLOG_AVIX,"CAVIIndex[%p]::RIFFOpenDone()", this);
HX_ASSERT(m_state == eReaderOpen);
m_state = eInitialDescend;
@@ -607,7 +607,7 @@
STDMETHODIMP CAVIIndex::RIFFCloseDone(HX_RESULT status)
{
- //HX_TRACE("CAVIFileFormat::CAVIIndex::RIFFCloseDone()\n");
+ HXLOGL4(HXLOG_AVIX,"CAVIIndex[%p]::RIFFCloseDone()", this);
return HXR_NOTIMPL;
}
@@ -617,7 +617,7 @@
*/
STDMETHODIMP CAVIIndex::RIFFFindChunkDone(HX_RESULT status, UINT32 len)
{
- //HX_TRACE("CAVIFileFormat::CAVIIndex::RIFFFindChunkDone()\n");
+ HXLOGL4(HXLOG_AVIX,"CAVIIndex[%p]::RIFFFindChunkDone() status=%x", this, status);
HX_ASSERT(m_state == eIdx1Find);
if (FAILED(status) || len == 0)
@@ -652,7 +652,7 @@
/* Called after a Descend completes */
STDMETHODIMP CAVIIndex::RIFFDescendDone(HX_RESULT status)
{
- //HX_TRACE("CAVIFileFormat::CAVIIndex::RIFFDescendDone()\n");
+ HXLOGL4(HXLOG_AVIX,"CAVIIndex[%p]::RIFFDescendDone()", this);
HX_ASSERT(m_state == eInitialDescend || m_state == eIdx1Descend);
switch (m_state)
@@ -698,7 +698,7 @@
/* Called after an Ascend completes */
STDMETHODIMP CAVIIndex::RIFFAscendDone(HX_RESULT status)
{
- //HX_TRACE("CAVIFileFormat::CAVIIndex::RIFFAscendDone()\n");
+ HXLOGL4(HXLOG_AVIX,"CAVIIndex[%p]::RIFFAscendDone()", this);
return HXR_NOTIMPL;
}
@@ -706,7 +706,7 @@
*/
STDMETHODIMP CAVIIndex::RIFFReadDone(HX_RESULT status, IHXBuffer *pBuffer)
{
- //HX_TRACE("CAVIFileFormat::CAVIIndex::RIFFReadDone()\n");
+ HXLOGL4(HXLOG_AVIX,"CAVIIndex[%p]::RIFFReadDone()", this);
HX_ASSERT(m_state == eReadSlice);
if (m_bDiscardPendingIO)
@@ -881,13 +881,13 @@
LE32_TO_HOST(pEntry->ulChunkOffset) + m_ulFirstRelativeMOVIOffset;
pStream->entryArray[pStream->ulSliceEndChunk % MAX_SLICE_SIZE].ulLength =
LE32_TO_HOST(pEntry->ulChunkLength);
- //HX_TRACE("CAVIIndex::RIFFReadDone stream: %d\toffset: %lu\n", CAVIFileFormat::GetStream(pEntry->ulChunkId),
+ // HXLOGL4(HXLOG_AVIX,"CAVIIndex[%p]::RIFFReadDone stream: %d\toffset: %lu", this,CAVIFileFormat::GetStream(pEntry->ulChunkId),
// pStream->entryArray[pStream->ulSliceEndChunk % MAX_SLICE_SIZE].ulOffset);
#ifdef _DEBUG_KEYCHUNKS
if (pStream->entryArray[pStream->ulSliceEndChunk % MAX_SLICE_SIZE].bKeyChunk)
{
- //HX_TRACE("CAVIIndex::RIFFReadDone keytype: %c%c%c%c\n",
+ HXLOGL4(HXLOG_AVIX,"CAVIIndex[%p]::RIFFReadDone keytype: %c%c%c%c",this,
pEntry->ulChunkId, pEntry->ulChunkId >> 8,
pEntry->ulChunkId >> 16, pEntry->ulChunkId >> 24);
}
@@ -931,7 +931,7 @@
/* Called when a seek completes */
STDMETHODIMP CAVIIndex::RIFFSeekDone(HX_RESULT status)
{
- //HX_TRACE("CAVIFileFormat::CAVIIndex::RIFFSeekDone()\n");
+ HXLOGL4(HXLOG_AVIX,"CAVIIndex[%p]::RIFFSeekDone()", this);
if (m_bDiscardPendingIO)
{
@@ -977,12 +977,13 @@
STDMETHODIMP CAVIIndex::RIFFGetChunkDone(HX_RESULT status, UINT32 chunkType,
IHXBuffer* pBuffer)
{
- //HX_TRACE("CAVIFileFormat::CAVIIndex::RIFFGetChunkDone()\n");
+ HXLOGL4(HXLOG_AVIX,"CAVIIndex[%p]::RIFFGetChunkDone()", this);
return HXR_NOTIMPL;
}
void CAVIIndex::Close()
{
+ HXLOGL2(HXLOG_AVIX,"CAVIIndex[%p]::Close()", this);
if(m_pFile)
{
m_pFile->Close();
Index: datatype/avi/fileformat/avistrm.cpp
===================================================================
RCS file: /cvsroot/datatype/avi/fileformat/avistrm.cpp,v
retrieving revision 1.9
diff -u -w -r1.9 avistrm.cpp
--- datatype/avi/fileformat/avistrm.cpp 9 Aug 2005 20:01:08 -0000 1.9
+++ datatype/avi/fileformat/avistrm.cpp 13 Nov 2008 20:08:23 -0000
@@ -107,6 +107,7 @@
#define AVI_VIDS_TYPE HX_MAKE4CC('v', 'i', 'd', 's') /* 'vids' */
#define AVI_AUDS_TYPE HX_MAKE4CC('a', 'u', 'd', 's') /* 'auds' */
+#define AVI_H261_VIDEO HX_MAKE4CC('1', '6', '2', 'H') /* 'H261' */
// FourCCs - TODO: make macros?
#define AVI_MJPG_VIDEO HX_MAKE4CC('G', 'P', 'J', 'M') /* 'GPJM' */
@@ -247,8 +248,12 @@
#define WAVE_FORMAT_EXTENSIBLE 0xFFFE /* Microsoft */
#define WAVE_FORMAT_DEVELOPMENT 0xFFFF /* new wave formats in development */
-#define VIDEO_FORMAT_H263 HX_MAKE4CC('H', '2', '6', '3')
-#define VIDEO_FORMAT_DIVX HX_MAKE4CC('d', 'i', 'v', 'x')
+#define VIDEO_FORMAT_H263 HX_MAKE4CC('3', '6', '2', 'H')
+#define VIDEO_FORMAT_divx HX_MAKE4CC('x', 'v', 'i', 'd')
+#define VIDEO_FORMAT_DIVX HX_MAKE4CC('X', 'V', 'I', 'D')
+#define VIDEO_FORMAT_DV50 HX_MAKE4CC('0', '5', 'V', 'D')
+#define VIDEO_FORMAT_XVID HX_MAKE4CC('D', 'I', 'V', 'X')
+#define VIDEO_FORMAT_xvid HX_MAKE4CC('d', 'i', 'v', 'x')
#define AVI_LIST_OBJECT 0x4c495354 /* 'LIST' */
#define AVI_RECORD_TYPE 0x72656320 /* 'rec ' */
@@ -303,6 +308,7 @@
, m_ulSeekTime (0)
, m_pFile (NULL)
{
+ HXLOGL2(HXLOG_AVIX, "CAVIStream[%p]::CAVIStream() CTOR", this);
HX_ASSERT_VALID_PTR(m_pOuter);
HX_ASSERT_VALID_PTR(m_pContext);
HX_ADDREF(m_pContext);
@@ -326,7 +332,7 @@
//
CAVIStream::~CAVIStream()
{
- //HX_TRACE("CAVIFileFormat::CAVIStream::~CAVIStream()\n");
+ HXLOGL2(HXLOG_AVIX, "CAVIStream[%p]::~CAVIStream()", this);
/* HX_RELEASE(m_pReader);
HX_DELETE(m_pFormat);
HX_RELEASE(m_pPayloadFormatter);
@@ -344,7 +350,7 @@
//
HX_RESULT CAVIStream::SetHeader(UINT16 usStream, IHXBuffer* pHeader)
{
- //HX_TRACE("CAVIFileFormat::CAVIStream::SetHeader()\n");
+ HXLOGL2(HXLOG_AVIX,"CAVIStream[%p]::SetHeader() usStream=%d", this, usStream);
HX_RESULT result = HXR_FAIL;
UCHAR* buf;
@@ -352,13 +358,15 @@
if (pHeader && SUCCEEDED(result = pHeader->Get(buf, len)))
{
- HX_ASSERT(len >= sizeof(m_header));
- if (len < sizeof(m_header))
+ HX_ASSERT(len >= SIZE_OF_AVI_VIDEO_HEADER);
+ if (len < SIZE_OF_AVI_VIDEO_HEADER)
{
return HXR_FAIL;
}
- m_header.ulType = LE32_TO_HOST(*(UINT32*) &buf[0]);
+ // use integer to respresent stream type, the absolute value is not important.
+ // it should be consistent with AVI_VIDS_TYPE AVI_AUDS_TYPE AVI_MJPG_VIDEO defined above
+ m_header.ulType = HX_MAKE4CC( buf[0] , buf[1] , buf[2] , buf[3] );
m_header.ulHandler = LE32_TO_HOST(*(UINT32*) &buf[4]);
m_header.ulFlags = LE32_TO_HOST(*(UINT32*) &buf[8]);
m_header.sPriority = (INT16) LE16_TO_HOST(*(UINT32*) &buf[12]);
@@ -371,11 +379,22 @@
m_header.ulSuggestedBufferSize = LE32_TO_HOST(*(UINT32*) &buf[36]);
m_header.ulQuality = LE32_TO_HOST(*(UINT32*) &buf[40]);
m_header.ulSampleSize = LE32_TO_HOST(*(UINT32*) &buf[44]);
+
+ if(len >= sizeof(m_header))
+ {
m_header.sTop = (INT16) LE16_TO_HOST(*(UINT32*) &buf[48]);
m_header.sLeft = (INT16) LE16_TO_HOST(*(UINT32*) &buf[50]);
m_header.sBottom = (INT16) LE16_TO_HOST(*(UINT32*) &buf[52]);
m_header.sRight = (INT16) LE16_TO_HOST(*(UINT32*) &buf[54]);
}
+ else
+ {
+ m_header.sTop = 0;
+ m_header.sLeft = 0;
+ m_header.sBottom = 0;
+ m_header.sRight = 0;
+ }
+ }
return result;
}
@@ -386,7 +405,7 @@
//
HX_RESULT CAVIStream::SetFormat(IHXBuffer* pFormat)
{
- //HX_TRACE("CAVIFileFormat::CAVIStream::SetFormat()\n");
+ HXLOGL2(HXLOG_AVIX,"CAVIStream[%p]::SetFormat()", this);
HX_ASSERT(pFormat);
HX_RESULT result = HXR_FAIL;
@@ -463,7 +482,7 @@
m_pFormat = new UCHAR[len + nPadding];
memcpy(m_pFormat, buf, len);
- HXLOGL3(HXLOG_AVIX, "CAVIStream::SetFormat with wave m_pFormat=%p\n", m_pFormat);
+ HXLOGL3(HXLOG_AVIX, "CAVIStream[%p]::SetFormat with wave m_pFormat=%p", this,m_pFormat);
if(nPadding > 0)
{
@@ -498,7 +517,7 @@
//
HX_RESULT CAVIStream::SetPacketFormat(UINT32 ePacketFormat)
{
- //HX_TRACE("CAVIFileFormat::CAVIStream::SetPacketFormat()\n");
+ HXLOGL4(HXLOG_AVIX,"CAVIStream[%p]::SetPacketFormat()", this);
HX_ASSERT(m_state <= ePreHeader);
m_ePacketFormat = (PacketFormat) ePacketFormat;
@@ -510,7 +529,7 @@
//
HX_RESULT CAVIStream::SetOpaque(IHXBuffer* pOpaque)
{
- //HX_TRACE("CAVIFileFormat::CAVIStream::SetOpaque()\n");
+ HXLOGL4(HXLOG_AVIX,"CAVIStream[%p]::SetOpaque()", this);
return HXR_NOTIMPL;
}
@@ -519,7 +538,7 @@
//
HX_RESULT CAVIStream::SetIndex(CAVIIndex* pIndex)
{
- //HX_TRACE("CAVIFileFormat::CAVIStream::SetIndex()\n");
+ HXLOGL4(HXLOG_AVIX,"CAVIStream[%p]::SetIndex()", this);
HX_ASSERT(!m_pIndex);
HX_ASSERT_VALID_PTR(pIndex);
m_pIndex = pIndex;
@@ -532,7 +551,7 @@
//
void CAVIStream::SetPendingHeaderRequest()
{
- //HX_TRACE("CAVIFileFormat::CAVIStream::SetPendingHeaderRequest()\n");
+ HXLOGL4(HXLOG_AVIX,"CAVIStream[%p]::SetPendingHeaderRequest()", this);
m_bPendingHeaderRequest = TRUE;
}
@@ -541,7 +560,7 @@
//
BOOL CAVIStream::PendingHeaderRequest()
{
- //HX_TRACE("CAVIFileFormat::CAVIStream::PendingHeaderRequest()\n");
+ HXLOGL4(HXLOG_AVIX,"CAVIStream[%p]::PendingHeaderRequest()", this);
return m_bPendingHeaderRequest;
}
@@ -550,7 +569,7 @@
//
HX_RESULT CAVIStream::GetHeader(IHXValues* pHeader)
{
- //HX_TRACE("CAVIFileFormat::CAVIStream::GetHeader()\n");
+ HXLOGL3(HXLOG_AVIX,"CAVIStream[%p]::GetHeader()", this);
HX_ASSERT(pHeader);
HX_ASSERT(m_bPendingHeaderRequest);
@@ -621,13 +640,13 @@
pHeader->SetPropertyULONG32("MicrosecondsPerFrame",
(ULONG32) (1e6 * ((double) m_header.ulScale / m_header.ulRate)));
- //HX_TRACE("\t\tMicrosecondsPerFrame:\t%lu\n", (ULONG32) 1e6 * ((double) m_header.ulScale / m_header.ulRate));
+ HXLOGL4(HXLOG_AVIX,"\t\tMicrosecondsPerFrame:\t%lu", (ULONG32) 1e6 * ((double) m_header.ulScale / m_header.ulRate));
}
else
{
-#if 0 // JPEGPayloadFormat not supported (yet)
if ( bi->ulCompression == AVI_MJPG_VIDEO )
{
+ #if defined(HELIX_FEATURE_SERVER)
if (!m_bLocalPlayback)
{
m_pPayloadFormatter = new JPEGPayloadFormat();
@@ -642,11 +661,11 @@
m_pPayloadFormatter->Init(m_pContext, TRUE);
// We'll set the headers below.
}
+ #endif
strcpy(szMimeType, "video/x-pn-jpeg-plugin");
nRTPPayloadType = RTP_PAYLOAD_JPEG;
}
else
-#endif // 0
{
if (m_header.ulHandler == VIDEO_FORMAT_H263)
{
@@ -656,11 +675,20 @@
strcpy(szStreamName, "Video Track");
strcpy (szMimeType, "video/X-RN-3GPP-H263");
}
- else if (m_header.ulHandler == VIDEO_FORMAT_DIVX)
+ else if ((m_header.ulHandler == VIDEO_FORMAT_DIVX) ||
+ (m_header.ulHandler == VIDEO_FORMAT_divx) ||
+ (m_header.ulHandler == VIDEO_FORMAT_DV50) ||
+ (m_header.ulHandler == VIDEO_FORMAT_XVID)||
+ (m_header.ulHandler == VIDEO_FORMAT_xvid))
{
strcpy(szStreamName, "Video Track");
strcpy (szMimeType, "video/X-HX-DIVX");
}
+ else if (m_header.ulHandler == AVI_H261_VIDEO)
+ {
+ strcpy(szStreamName, "Video Track");
+ strcpy(szMimeType, "video/H261");
+ }
else
{
strcpy(szStreamName, "An AVI stream");
@@ -811,6 +839,15 @@
}
}
break;
+ case WAVE_FORMAT_MPEG:
+ {
+ pMimeType = "audio/MPEG-ELEMENTARY";
+ if ( m_ePacketFormat == PFMT_RTP )
+ {
+ nRTPPayloadType = RTP_PAYLOAD_MPA;
+ }
+ }
+ break;
default:
{
pMimeType = szMimeTypeACM;
@@ -888,13 +925,13 @@
}
pHeader->SetPropertyULONG32("BitsPerSample", pWaveInfo->usBitsPerSample);
- //HX_TRACE("\t\tBitsPerSample:\t%lu\n", pWaveInfo->usBitsPerSample);
+ HXLOGL4(HXLOG_AVIX,"\t\tBitsPerSample:\t%lu", pWaveInfo->usBitsPerSample);
pHeader->SetPropertyULONG32("SamplesPerSecond", pWaveInfo->ulSamplesPerSec);
- //HX_TRACE("\t\tSamplesPerSecond:\t%lu\n", pWaveInfo->ulSamplesPerSec);
+ HXLOGL4(HXLOG_AVIX,"\t\tSamplesPerSecond:\t%lu", pWaveInfo->ulSamplesPerSec);
pHeader->SetPropertyULONG32("Channels", pWaveInfo->usChannels);
- //HX_TRACE("\t\tChannels:\t%lu\n", pWaveInfo->usChannels);
+ HXLOGL4(HXLOG_AVIX,"\t\tChannels:\t%lu", pWaveInfo->usChannels);
m_fChunksPerSecond = m_pIndex->GetChunkTotal(m_usStream) / ((double) m_pIndex->GetByteTotal(m_usStream) / pWaveInfo->ulAvgBytesPerSec);
m_fSamplesPerSecond = (double) m_header.ulRate / m_header.ulScale;
@@ -926,16 +963,16 @@
if ( m_ePacketFormat == PFMT_RTP )
{
pHeader->SetPropertyULONG32("RTPPayloadType", nRTPPayloadType);
- //HX_TRACE("\t\tRTPPayloadType:\t%lu\n", nRTPPayloadType);
+ HXLOGL4(HXLOG_AVIX,"\t\tRTPPayloadType:\t%lu", nRTPPayloadType);
}
// Max packet size:
pHeader->SetPropertyULONG32("MaxPacketSize", ulMaxPacketSize);
- //HX_TRACE("\t\tMaxPacketSize:\t%lu\n", ulMaxPacketSize);
+ HXLOGL4(HXLOG_AVIX,"\t\tMaxPacketSize:\t%lu", ulMaxPacketSize);
// Average packet size:
pHeader->SetPropertyULONG32("AvgPacketSize", ulMaxPacketSize);
- //HX_TRACE("\t\tAvgPacketSize:\t%lu\n", ulMaxPacketSize);
+ HXLOGL4(HXLOG_AVIX,"\t\tAvgPacketSize:\t%lu", ulMaxPacketSize);
}
// Format specific data (for future use):
@@ -943,26 +980,30 @@
// Stream number:
pHeader->SetPropertyULONG32("StreamNumber", m_usStream);
- //HX_TRACE("\t\tStreamNumber:\t%lu\n", m_usStream);
+ HXLOGL4(HXLOG_AVIX,"\t\tStreamNumber:\t%lu", m_usStream);
// HX_ASSERT(m_fChunksPerSecond && m_fSamplesPerSecond);
// Start time:
pHeader->SetPropertyULONG32("StartTime", (ULONG32) (m_header.ulStart * m_fChunksPerSecond * 1000));
- //HX_TRACE("\t\tStartTime:\t%lu\n", (ULONG32) (m_header.ulStart * m_fSamplesPerSecond * 1000));
+ HXLOGL4(HXLOG_AVIX,"\t\tStartTime:\t%lu", (ULONG32) (m_header.ulStart * m_fSamplesPerSecond * 1000));
// Duration:
+ if(m_header.ulLength == 0)
+ {
+ m_header.ulLength = 0xffffffff;
+ }
pHeader->SetPropertyULONG32("Duration", (ULONG32) (((double) m_header.ulLength / m_fSamplesPerSecond) * 1000));
- //HX_TRACE("\t\tDuration:\t%lu\n", (ULONG32) (((double) m_header.ulLength / m_fSamplesPerSecond) * 1000));
+ HXLOGL4(HXLOG_AVIX,"\t\tDuration:\t%lu", (ULONG32) (((double) m_header.ulLength / m_fSamplesPerSecond) * 1000));
// Max bit rate:
pHeader->SetPropertyULONG32("MaxBitRate", (ULONG32) (8 * m_pIndex->GetMaxChunkSize(m_usStream) * m_fChunksPerSecond));
- //HX_TRACE("\t\tMaxBitRate:\t%lu\n", (ULONG32) (8 * m_pIndex->GetMaxChunkSize(m_usStream) * m_fChunksPerSecond));
+ HXLOGL4(HXLOG_AVIX,"\t\tMaxBitRate:\t%lu", (ULONG32) (8 * m_pIndex->GetMaxChunkSize(m_usStream) * m_fChunksPerSecond));
// Averate bit rate:
ULONG32 ulAverageBitrate = (ULONG32) (8 * m_pIndex->GetAverageChunkSize(m_usStream) * m_fChunksPerSecond);
pHeader->SetPropertyULONG32("AvgBitRate", ulAverageBitrate);
- //HX_TRACE("\t\tAvgBitRate:\t%lu\n", ulAverageBitrate);
+ HXLOGL4(HXLOG_AVIX,"\t\tAvgBitRate:\t%lu", ulAverageBitrate);
// Preroll:
UINT32 ulPreroll = (UINT32) (((double) m_pIndex->GetMaxByteDeflict(m_usStream) / ulAverageBitrate) * 1000);
@@ -999,7 +1040,7 @@
}
pHeader->SetPropertyULONG32("Preroll", ulPreroll);
- //HX_TRACE("\t\tPreroll:\t%lu\n", ulPreroll);
+ HXLOGL4(HXLOG_AVIX,"\t\tPreroll:\t%lu", ulPreroll);
// Set rule book:
#if 0
@@ -1050,7 +1091,7 @@
//
BOOL CAVIStream::IsAudio()
{
- //HX_TRACE("CAVIFileFormat::CAVIStream::IsAudio()\n");
+ HXLOGL4(HXLOG_AVIX,"CAVIStream[%p]::IsAudio() %d",this,(m_header.ulType == AVI_AUDS_TYPE));
return m_header.ulType == AVI_AUDS_TYPE;
}
@@ -1059,7 +1100,7 @@
//
double CAVIStream::GetDuration()
{
- //HX_TRACE("CAVIFileFormat::CAVIStream::GetDuration()\n");
+ HXLOGL4(HXLOG_AVIX,"CAVIStream[%p]::GetDuration()", this);
HX_ASSERT(m_header.ulScale);
return m_header.ulLength / (m_header.ulRate / (double) m_header.ulScale);
}
@@ -1073,7 +1114,7 @@
HX_RESULT CAVIStream::InitForReading(IUnknown* pContext, IHXFileObject* pFile)
{
- //HX_TRACE("CAVIFileFormat::CAVIStream::InitForReading()\n");
+ HXLOGL2(HXLOG_AVIX,"CAVIStream[%p]::InitForReading()", this);
HX_ASSERT(m_state == ePreReader);
@@ -1098,7 +1139,7 @@
//
BOOL CAVIStream::ReadInitialized()
{
- //HX_TRACE("CAVIFileFormat::CAVIStream::ReadInitialized()\n");
+ HXLOGL4(HXLOG_AVIX,"CAVIStream[%p]::ReadInitialized()", this);
HX_ASSERT(m_pReader ? m_state > ePreReader : TRUE);
return m_pReader != NULL;
}
@@ -1108,7 +1149,7 @@
//
BOOL CAVIStream::HasPackets()
{
- //HX_TRACE("CAVIFileFormat::CAVIStream::HasPackets()\n");
+ HXLOGL4(HXLOG_AVIX,"CAVIStream[%p]::HasPackets()", this);
return (BOOL) m_pNextPacket;
}
@@ -1117,7 +1158,7 @@
//
UINT32 CAVIStream::GetPendingPacketCount()
{
- //HX_TRACE("CAVIFileFormat::CAVIStream::GetPendingPacketCount()\n");
+ HXLOGL4(HXLOG_AVIX,"CAVIStream[%p]::GetPendingPacketCount()", this);
return m_ulPendingPacketRequests;
}
@@ -1126,7 +1167,7 @@
//
UINT32 CAVIStream::IncrementPendingPacketCount()
{
- //HX_TRACE("CAVIFileFormat::CAVIStream::IncrementPendingPacketCount()\n");
+ HXLOGL4(HXLOG_AVIX,"CAVIStream[%p]::IncrementPendingPacketCount()", this);
m_ulPendingPacketRequests++;
return m_ulPendingPacketRequests;
}
@@ -1136,7 +1177,7 @@
//
void CAVIStream::ClearPendingPacketCount()
{
- //HX_TRACE("CAVIFileFormat::CAVIStream::ClearPendingPacketCount()\n");
+ HXLOGL4(HXLOG_AVIX,"CAVIStream[%p]::ClearPendingPacketCount()", this);
m_ulPendingPacketRequests = 0;
}
@@ -1146,7 +1187,7 @@
//
void CAVIStream::Seek(UINT32 ulTime)
{
- //HX_TRACE("CAVIFileFormat::CAVIStream::Seek()\ttime: %lu\n", ulTime);
+ HXLOGL2(HXLOG_AVIX,"CAVIStream[%p]::Seek()\ttime: %lu", this,ulTime);
m_ulPendingPacketRequests = 0;
m_bRead = FALSE;
@@ -1221,7 +1262,7 @@
if (SUCCEEDED(m_pCommonClassFactory->CreateInstance(IID_IHXPacket,
(void**) &pNewPacket)))
{
- // HX_TRACE("CAVIFileFormat::CAVIStream::Seek()\tstream %d\tpacket time: %lu\t minreadchunk: %lu\n", m_usStream, ulTime, m_ulMinReadChunk);
+ HXLOGL2(HXLOG_AVIX,"CAVIStream[%p]::Seek()\tstream %d\tpacket time: %lu\t minreadchunk: %lu", this, m_usStream, ulTime, m_ulMinReadChunk);
if (IsAudio ())
{
WaveInfo* pWaveInfo = (WaveInfo*) m_pFormat;
@@ -1318,7 +1359,7 @@
// on success, returns an AddRef'd packet
IHXPacket* CAVIStream::GetNextPacket()
{
- //HX_TRACE("CAVIFileFormat::CAVIStream::GetNextPacket()\n");
+ HXLOGL4(HXLOG_AVIX,"CAVIStream[%p]::GetNextPacket()", this);
HX_ASSERT(m_state > ePreReader);
HX_ASSERT(m_ulPendingPacketRequests > 0);
HX_ASSERT(m_pNextPacket);
@@ -1350,6 +1391,8 @@
ulTime = (UINT32) ((m_ulMinReadChunk / m_fChunksPerSecond) * 1000);
}
+ HXLOGL4(HXLOG_AVIX,"CAVIStream[%p]::GetNextPacket()\tstream %d\tpacket time: %lu\t minreadchunk: %lu\n", this, m_usStream, ulTime, m_ulMinReadChunk);
+
// TODO: Set correct ASM rules
if (m_bEndianSwap16)
{
@@ -1409,7 +1452,7 @@
//
UINT32 CAVIStream::PeekPacketTime()
{
- //HX_TRACE("CAVIFileFormat::CAVIStream::GetNextPacketTime()\n");
+ HXLOGL4(HXLOG_AVIX,"CAVIStream[%p]::PeekPacketTime()", this);
if (m_pNextPacket)
{
return m_pNextPacket->GetTime();
@@ -1435,7 +1478,7 @@
//
void CAVIStream::GetNextSlice()
{
- //HX_TRACE("CAVIFileFormat::CAVIStream::GetNextSlice()\n");
+ HXLOGL4(HXLOG_AVIX,"CAVIStream[%p]::GetNextSlice()", this);
UINT32 ulNextChunkOffset;
HX_RESULT indexResult;
@@ -1475,7 +1518,7 @@
//
BOOL CAVIStream::CanPrefetchSlice()
{
- //HX_TRACE("CAVIFileFormat::CAVIStream::CanPrefetchSlice()\n");
+ HXLOGL4(HXLOG_AVIX,"CAVIStream[%p]::CanPrefetchSlice()", this);
return (m_ulMaxReadChunk - m_ulMinReadChunk < MAX_CHUNK_PREFETCH) && !m_bRead;
}
@@ -1484,7 +1527,7 @@
//
UINT32 CAVIStream::PeekPrefetchTime()
{
- //HX_TRACE("CAVIFileFormat::CAVIStream::PeekPrefetchSliceTime()\n");
+ HXLOGL4(HXLOG_AVIX,"CAVIStream[%p]::PeekPrefetchSliceTime()", this);
UINT32 ulTime;
if (IsAudio ())
@@ -1505,7 +1548,7 @@
//
BOOL CAVIStream::AtEndOfStream()
{
- //HX_TRACE("CAVIFileFormat::CAVIStream::AtEndOfStream()\n");
+ HXLOGL4(HXLOG_AVIX,"CAVIStream[%p]::AtEndOfStream()", this);
//HX_ASSERT( (m_state != eReady) || (m_pNextPacket && m_bRead)); // Currently we don't prime on init
return m_bRead;
}
@@ -1571,7 +1614,7 @@
// CRiffResponse
STDMETHODIMP CAVIStream::RIFFOpenDone(HX_RESULT status)
{
- //HX_TRACE("CAVIFileFormat::CAVIStream::RIFFOpenDone()\n");
+ HXLOGL4(HXLOG_AVIX,"CAVIStream[%p]::RIFFOpenDone()", this);
HX_ASSERT(m_state == ePreReader);
m_state = eReady;
@@ -1593,7 +1636,7 @@
STDMETHODIMP CAVIStream::RIFFFindChunkDone(HX_RESULT status, UINT32 len)
{
- //HX_TRACE("CAVIFileFormat::CAVIStream::RIFFFindChunkDone()\n");
+ HXLOGL4(HXLOG_AVIX,"CAVIStream[%p]::RIFFFindChunkDone()", this);
HX_ASSERT(m_state == eChunkFind);
HX_ASSERT(SUCCEEDED(status));
@@ -1636,7 +1679,7 @@
if (m_ulChunkReadTarget == m_ulMaxReadChunk)
{
- //HX_TRACE("\tstream: %d\toffset: %lu\n", m_usStream, m_pReader->GetOffset());
+ HXLOGL4(HXLOG_AVIX,"\tstream: %d\toffset: %lu", m_usStream, m_pReader->GetOffset());
if (m_bSeeking)
{
// Find the time of the next packet.
@@ -1653,7 +1696,7 @@
ulNextPacketTime = (UINT32) (((m_ulMaxReadChunk + 1)/ m_fChunksPerSecond) * 1000);
}
- if (ulNextPacketTime < m_ulSeekTime)
+ if (ulNextPacketTime <= m_ulSeekTime)
{
// Discard the packet.
m_ulChunkReadTarget++;
@@ -1702,7 +1745,7 @@
/* Called after a Descend completes */
STDMETHODIMP CAVIStream::RIFFDescendDone(HX_RESULT status)
{
- //HX_TRACE("CAVIFileFormat::CAVIStream::RIFFDescendDone()\n");
+ HXLOGL4(HXLOG_AVIX,"CAVIStream[%p]::RIFFDescendDone()", this);
HX_ASSERT(FALSE); // we don't support multiple MOVI chunks yet
return HXR_NOTIMPL;
}
@@ -1710,7 +1753,7 @@
/* Called after an Ascend completes */
STDMETHODIMP CAVIStream::RIFFAscendDone(HX_RESULT status)
{
- //HX_TRACE("CAVIFileFormat::CAVIStream::RIFFAscendDone()\n");
+ HXLOGL4(HXLOG_AVIX,"CAVIStream[%p]::RIFFAscendDone()", this);
HX_ASSERT(FALSE); // we don't support multiple MOVI chunks yet
return HXR_NOTIMPL;
}
@@ -1719,7 +1762,7 @@
*/
STDMETHODIMP CAVIStream::RIFFReadDone(HX_RESULT status, IHXBuffer *pBuffer)
{
- //HX_TRACE("CAVIFileFormat::CAVIStream::RIFFReadDone()\n");
+ HXLOGL4(HXLOG_AVIX,"CAVIStream[%p]::RIFFReadDone()", this);
HX_ASSERT(m_state == eChunkRead);
HX_ASSERT(CAVIFileFormat::GetStream(ENDIAN_SWAP_32(m_pReader->GetChunkType())) == m_usStream);
HX_ASSERT(m_ulChunkReadTarget == m_ulMaxReadChunk);
@@ -1817,7 +1860,7 @@
/* Called when a seek completes */
STDMETHODIMP CAVIStream::RIFFSeekDone(HX_RESULT status)
{
- //HX_TRACE("CAVIFileFormat::CAVIStream::RIFFSeekDone()\n");
+ HXLOGL4(HXLOG_AVIX,"CAVIStream[%p]::RIFFSeekDone()", this);
HX_ASSERT(m_state == eChunkSeek);
HX_ASSERT(SUCCEEDED(status));
@@ -1842,7 +1885,7 @@
STDMETHODIMP CAVIStream::RIFFGetChunkDone(HX_RESULT status, UINT32 chunkType,
IHXBuffer* pBuffer)
{
-//HX_TRACE("CAVIFileFormat::CAVIStream::RIFFGetChunkDone()\n");
+ HXLOGL4(HXLOG_AVIX,"CAVIStream[%p]::RIFFGetChunkDone()", this);
// HX_ASSERT(!"RIFFGetChunkDone is not used");
// return HXR_NOTIMPL;
@@ -1862,7 +1905,7 @@
IHXCommonClassFactory* pCommonClassFactory,
ULONG32 ulAvgBitRate, INT32 lRTPPayloadType)
{
- //HX_TRACE("CAVIFileFormat::CAVIStream::SetRuleBook()\n");
+ HXLOGL4(HXLOG_AVIX,"CAVIStream[%p]::SetRuleBook()", this);
if ( !pHeader || !pCommonClassFactory )
{
return FALSE;
@@ -1904,6 +1947,7 @@
void CAVIStream::Close()
{
+ HXLOGL2(HXLOG_AVIX,"CAVIStream[%p]::Close()", this);
if(m_pFile)
{
m_pFile->Close();
Index: datatype/avi/fileformat/plugin.cpp
===================================================================
RCS file: /cvsroot/datatype/avi/fileformat/plugin.cpp,v
retrieving revision 1.3
diff -u -w -r1.3 plugin.cpp
--- datatype/avi/fileformat/plugin.cpp 27 Sep 2005 20:08:07 -0000 1.3
+++ datatype/avi/fileformat/plugin.cpp 13 Nov 2008 20:08:23 -0000
@@ -48,6 +48,7 @@
#include "ihxtlogsystem.h"
#include "ihxtlogsystemcontext.h"
#include "hxdllaccess.h"
+#include "baseobj.h"
#include "riff.h"
#include "riffres.h"
@@ -61,12 +62,17 @@
ENABLE_MULTILOAD_DLLACCESS_PATHS(Avifformat);
#endif
-STDAPI ENTRYPOINT(HXCREATEINSTANCE)(IUnknown** ppIUnknown)
+STDAPI HXEXPORT ENTRYPOINT(HXCREATEINSTANCE)(IUnknown** ppIUnknown)
{
return CAVIFileFormat::HXCreateInstance(ppIUnknown);
}
-STDAPI ENTRYPOINT(CanUnload)(void)
+STDAPI HXEXPORT ENTRYPOINT(CanUnload2)(void)
{
- return CAVIFileFormat::CanUnload();
+ return (CHXBaseCountingObject::ObjectsActive() > 0 ? HXR_FAIL : HXR_OK);
+}
+
+STDAPI HXEXPORT ENTRYPOINT(CanUnload)(void)
+{
+ return ENTRYPOINT(CanUnload2)();
}
Index: datatype/avi/fileformat/pub/aviffpln.h
===================================================================
RCS file: /cvsroot/datatype/avi/fileformat/pub/aviffpln.h,v
retrieving revision 1.4
diff -u -w -r1.4 aviffpln.h
--- datatype/avi/fileformat/pub/aviffpln.h 14 Jun 2005 20:45:07 -0000 1.4
+++ datatype/avi/fileformat/pub/aviffpln.h 13 Nov 2008 20:08:23 -0000
@@ -124,7 +124,6 @@
public:
static HX_RESULT STDAPICALLTYPE HXCreateInstance(IUnknown** ppIUnknown);
- static HX_RESULT CanUnload();
CAVIFileFormat();
static BOOL IsAVChunk(UINT32 ulChunkId);
@@ -379,7 +378,7 @@
AVIState;
AVIState m_state;
- BOOL m_bSeekPriming;
+ HXBOOL m_bSeekPriming;
BOOL m_bLocalPlayback;
CHXPtrArray m_streamArray;
@@ -400,13 +399,13 @@
IUnknown* m_pContext;
IHXCommonClassFactory* m_pCommonClassFactory;
- static const char* zm_pDescription;
- static const char* zm_pCopyright;
- static const char* zm_pMoreInfoURL;
- static const char* zm_pFileMimeTypes[];
- static const char* zm_pFileExtensions[];
- static const char* zm_pFileOpenNames[];
- static const char* zm_pPacketFormats[];
+ static const char* const zm_pDescription;
+ static const char* const zm_pCopyright;
+ static const char* const zm_pMoreInfoURL;
+ static const char* const zm_pFileMimeTypes[];
+ static const char* const zm_pFileExtensions[];
+ static const char* const zm_pFileOpenNames[];
+ static const char* const zm_pPacketFormats[];
};
#endif // _AVIFFPLIN_H_
Index: datatype/avi/fileformat/pub/avistrm.h
===================================================================
RCS file: /cvsroot/datatype/avi/fileformat/pub/avistrm.h,v
retrieving revision 1.6
diff -u -w -r1.6 avistrm.h
--- datatype/avi/fileformat/pub/avistrm.h 9 Aug 2005 20:01:09 -0000 1.6
+++ datatype/avi/fileformat/pub/avistrm.h 13 Nov 2008 20:08:23 -0000
@@ -58,7 +58,8 @@
#define MAX_COLOR_TABLE_SIZE 256
#define MAX_CHUNK_PREFETCH 2
-#define PRIOR_SEEK_TIME 1500
+#define PRIOR_SEEK_TIME 0
+#define SIZE_OF_AVI_VIDEO_HEADER 48
class CAVIFileFormat;
class CAVIIndex;
Index: datatype/common/util/Umakefil
===================================================================
RCS file: /cvsroot/datatype/common/util/Umakefil,v
retrieving revision 1.12
diff -u -w -r1.12 Umakefil
--- datatype/common/util/Umakefil 29 Apr 2005 20:05:34 -0000 1.12
+++ datatype/common/util/Umakefil 13 Nov 2008 20:08:23 -0000
@@ -56,7 +56,8 @@
"common/dbgtool/pub",
"common/util/pub",
"common/container/pub",
- "common/runtime/pub")
+ "common/runtime/pub",
+ "common/log/logutil/pub")
project.AddSources("bitstream.cpp",
"bitpack.cpp",
Index: datatype/common/util/riff.cpp
===================================================================
RCS file: /cvsroot/datatype/common/util/riff.cpp,v
retrieving revision 1.12
diff -u -w -r1.12 riff.cpp
--- datatype/common/util/riff.cpp 14 Mar 2005 19:24:45 -0000 1.12
+++ datatype/common/util/riff.cpp 13 Nov 2008 20:08:23 -0000
@@ -45,6 +45,7 @@
#include "hxcomm.h"
#include "hxheap.h"
+#include "hxtlogutil.h"
#ifdef _DEBUG
#undef HX_THIS_FILE
static const char HX_THIS_FILE[] = __FILE__;
@@ -109,11 +110,14 @@
: m_pReassemblyBuffer(NULL)
, m_ulChunkBytesRead(0)
, m_ulChunkSize(0)
+ , m_ulChunkType(0)
{
m_pContext = pContext;
m_pResponse = pResponse;
m_pFileObject = pFileObject;
+ HXLOGL2(HXLOG_AVIX,"CRIFFReader[%p]::CRIFFReader CTOR ctx=%p resp=%p fob=%p", this,m_pContext,m_pResponse,m_pFileObject);
+
if ( m_pFileObject )
{
m_pFileObject->AddRef();
@@ -142,6 +146,7 @@
CRIFFReader::~CRIFFReader()
{
+ HXLOGL2(HXLOG_AVIX,"CRIFFReader[%p]::~CRIFFReader() DES ctx=%p resp=%p fob=%p", this,m_pContext,m_pResponse,m_pFileObject);
if ( m_bFileIsOpen )
Close();
@@ -211,6 +216,7 @@
HX_RESULT
CRIFFReader::Close()
{
+ HXLOGL2(HXLOG_AVIX,"CRIFFReader[%p]::Close() ctx=%p resp=%p fob=%p", this,m_pContext,m_pResponse,m_pFileObject);
if ( m_pFileObject )
{
m_pFileObject->Close();
@@ -565,10 +571,10 @@
}
if ( (m_ulFileType == RIFF_FILE_MAGIC_NUMBER) &&
- (m_ulGetChunkType == (UINT32)0) )
+ (m_ulChunkType == (UINT32)0) )
{
m_state = RS_Ready;
- m_pResponse->RIFFGetChunkDone(HXR_FAILED, 0, NULL);
+ m_pResponse->RIFFFindChunkDone(HXR_FAILED, 0);
return HXR_OK;
}
Index: datatype/common/util/pub/riffres.h
===================================================================
RCS file: /cvsroot/datatype/common/util/pub/riffres.h,v
retrieving revision 1.3
diff -u -w -r1.3 riffres.h
--- datatype/common/util/pub/riffres.h 9 Jul 2004 18:30:56 -0000 1.3
+++ datatype/common/util/pub/riffres.h 13 Nov 2008 20:08:23 -0000
@@ -50,7 +50,7 @@
#ifndef __RIFFRES_H__
#define __RIFFRES_H__
-class CRIFFResponse
+class CRIFFResponse : public IUnknown
{
public:
STDMETHOD(RIFFOpenDone)(HX_RESULT) PURE;
@@ -79,9 +79,6 @@
/* Called with the data from a GetChunk request */
STDMETHOD(RIFFGetChunkDone)(HX_RESULT, UINT32, IHXBuffer*) PURE;
- STDMETHOD(QueryInterface) (THIS_ REFIID riid, void** ppvObj) PURE;
- STDMETHOD_(ULONG32,AddRef) (THIS) PURE;
- STDMETHOD_(ULONG32,Release) (THIS) PURE;
};
#endif /* __RIFFRES_H_ */
Index: datatype/mdf/video/format/mp4/mdfmp4payloadformat.cpp
===================================================================
RCS file: /cvsroot/datatype/mdf/video/format/mp4/mdfmp4payloadformat.cpp,v
retrieving revision 1.2.2.17
diff -u -w -r1.2.2.17 mdfmp4payloadformat.cpp
--- datatype/mdf/video/format/mp4/mdfmp4payloadformat.cpp 6 Aug 2008 21:14:27 -0000 1.2.2.17
+++ datatype/mdf/video/format/mp4/mdfmp4payloadformat.cpp 13 Nov 2008 20:08:23 -0000
@@ -260,7 +260,7 @@
const TDesC8& CMP4PayloadFormatPluginDevice::GetVideoProfile() const
{
MDFVIDEOLOG_ENTERFN( "GetVideoProfile" );
- MDFVIDEOLOG_WRITE_FORMAT( " Profile for mp4 payload is %d", m_lProfile );
+ MDFVIDEOLOG_WRITE_FORMAT2( " Profile for mp4 payload is %d", m_lProfile );
MDFVIDEOLOG_LEAVEFN( "GetVideoProfile" );
// From ISO/IEC 14496-2 Annex G Table G-1
@@ -310,6 +310,7 @@
aPayloadFormatInfo.AppendMimeType( KVideoMimeTypeMP4ES, KVideoMimeTypeKeywordMP4 );
aPayloadFormatInfo.AppendMimeType( KVideoMimeTypeMP4RN, KVideoMimeTypeKeywordMP4 );
+ aPayloadFormatInfo.AppendMimeType( KVideoMimeTypeMP4DIVX, KVideoMimeTypeKeywordMP4 );
aPayloadFormatInfo.SetPayloadFormatId( KUidMP4PayloadFormatPluginDevice );
MDFVIDEOLOG_LEAVEFN( "SetVideoMimetypes" );
@@ -334,6 +335,14 @@
if( m_pMP4Depacketizer )
{
const TUint8* bitstreamheader = (const TUint8*) m_pMP4Depacketizer->GetBitstreamHeader();
+ MDFVIDEOLOG_WRITE_FORMAT( " bitstreamheader %x", bitstreamheader );
+ if(bitstreamheader == NULL)
+ {
+ pPictureHeader.iOptional = NULL;
+ retVal = TRUE;
+ }
+ else
+ {
TInt length = (TInt) m_pMP4Depacketizer->GetBitstreamHeaderSize();
TPtrC8* pStreamHeader = new TPtrC8( bitstreamheader, length );
@@ -341,6 +350,7 @@
pPictureHeader.iOptional = (TDesC8*) pStreamHeader;
retVal = TRUE;
}
+ }
//fill iSizeInMemory and iDisplayedRect fields of pPictureHeader
//must be placed here since width and height are found in
Index: datatype/mp3/renderer/mp3rend.cpp
===================================================================
RCS file: /cvsroot/datatype/mp3/renderer/mp3rend.cpp,v
retrieving revision 1.32
diff -u -w -r1.32 mp3rend.cpp
--- datatype/mp3/renderer/mp3rend.cpp 27 Sep 2005 16:10:23 -0000 1.32
+++ datatype/mp3/renderer/mp3rend.cpp 13 Nov 2008 20:08:24 -0000
@@ -347,11 +347,10 @@
// Check MIME type
IHXBuffer* pStringObj = NULL;
- m_pClassFactory->CreateInstance(CLSID_IHXBuffer,
- (void**)&pStringObj);
+ pStreamHeaderObj->GetPropertyCString("MimeType", pStringObj);
+
if (pStringObj)
{
- pStreamHeaderObj->GetPropertyCString("MimeType", pStringObj);
SetPacketFormat((const char*)(pStringObj->GetBuffer()));
// Check if we know these packets can be trusted. These
Index: datatype/mp4/audio/renderer/mp3decinfo.cpp
===================================================================
RCS file: /cvsroot/datatype/mp4/audio/renderer/mp3decinfo.cpp,v
retrieving revision 1.5
diff -u -w -r1.5 mp3decinfo.cpp
--- datatype/mp4/audio/renderer/mp3decinfo.cpp 14 Mar 2005 19:17:42 -0000 1.5
+++ datatype/mp4/audio/renderer/mp3decinfo.cpp 13 Nov 2008 20:08:24 -0000
@@ -42,7 +42,8 @@
if (pMimeType &&
(!strcmp(pMimeType, "audio/X-MP3-draft-00") ||
!strcmp(pMimeType, "audio/X-MP3-draft-00-RN") ||
- !strcmp(pMimeType, "audio/MPEG-ELEMENTARY")))
+ !strcmp(pMimeType, "audio/MPEG-ELEMENTARY") ||
+ !strcmp(pMimeType, "audio/rn-mpeg")))
{
bRet = TRUE;
}
Index: datatype/mp4/audio/renderer/mp4audio.cpp
===================================================================
RCS file: /cvsroot/datatype/mp4/audio/renderer/mp4audio.cpp,v
retrieving revision 1.23
diff -u -w -r1.23 mp4audio.cpp
--- datatype/mp4/audio/renderer/mp4audio.cpp 14 Mar 2005 19:17:42 -0000 1.23
+++ datatype/mp4/audio/renderer/mp4audio.cpp 13 Nov 2008 20:08:24 -0000
@@ -109,6 +109,7 @@
"audio/X-MP3-draft-00",
"audio/X-MP3-draft-00-RN",
"audio/MPEG-ELEMENTARY",
+ "audio/rn-mpeg",
#endif /* #if defined(HELIX_FEATURE_AUDIO_CODEC_MP3) */
NULL
};
Index: datatype/mp4/payload/mp4vpyld.cpp
===================================================================
RCS file: /cvsroot/datatype/mp4/payload/mp4vpyld.cpp,v
retrieving revision 1.18.2.1
diff -u -w -r1.18.2.1 mp4vpyld.cpp
--- datatype/mp4/payload/mp4vpyld.cpp 20 Dec 2006 10:41:48 -0000 1.18.2.1
+++ datatype/mp4/payload/mp4vpyld.cpp 13 Nov 2008 20:08:24 -0000
@@ -556,9 +556,15 @@
return retVal;
}
-HX_RESULT MP4VPayloadFormat::SetAssemblerHXAVIHeader(IHXValues* /* pHeader */)
+HX_RESULT MP4VPayloadFormat::SetAssemblerHXAVIHeader(IHXValues* pHeader)
{
- return HXR_OK;
+ HX_RESULT retVal = HXR_OK;
+
+ // We'll let decoder initialize with in-band bitstream
+ HX_VECTOR_DELETE(m_pBitstreamHeader);
+ m_ulBitstreamHeaderSize = 0;
+
+ return retVal;
}
STDMETHODIMP
From Yury.Ramanovich at nokia.com Fri Nov 14 07:19:27 2008
From: Yury.Ramanovich at nokia.com (Yury.Ramanovich@nokia.com)
Date: Fri Nov 14 05:22:42 2008
Subject: [datatype-dev] CR needed: REQ 403-11594,
SUB 417-12093: Helix engine support for the AVI file
format (210Cays)
Message-ID:
Skipped content of type multipart/alternative-------------- next part --------------
Index: helix.bif
===================================================================
RCS file: /cvsroot/common/build/BIF/helix.bif,v
retrieving revision 1.710
diff -u -w -r1.710 helix.bif
--- helix.bif 11 Nov 2008 22:10:32 -0000 1.710
+++ helix.bif 13 Nov 2008 20:16:09 -0000
@@ -3111,7 +3111,7 @@
- unix mac win32
+ unix mac win32 symbian
@@ -8664,6 +8664,8 @@
filesystem_http
datatype_aac_fileformat
+
+ datatype_avi_fileformat
Index: hxclient_2_1_0_cayennes.bif
===================================================================
RCS file: /cvsroot/client/build/BIF/hxclient_2_1_0_cayennes.bif,v
retrieving revision 1.27
diff -u -w -r1.27 hxclient_2_1_0_cayennes.bif
--- hxclient_2_1_0_cayennes.bif 9 Apr 2008 15:45:34 -0000 1.27
+++ hxclient_2_1_0_cayennes.bif 7 Nov 2008 20:20:12 -0000
@@ -2667,7 +2667,7 @@
- unix mac win32
+ unix mac win32 symbian
@@ -7607,6 +7607,8 @@
filesystem_http
datatype_aac_fileformat
+
+ datatype_avi_fileformat
Index: client/common/system/hxfsmgr.cpp
===================================================================
RCS file: /cvsroot/client/common/system/hxfsmgr.cpp,v
retrieving revision 1.13
diff -u -w -r1.13 hxfsmgr.cpp
--- client/common/system/hxfsmgr.cpp 3 May 2005 18:23:27 -0000 1.13
+++ client/common/system/hxfsmgr.cpp 13 Nov 2008 20:07:41 -0000
@@ -772,6 +772,8 @@
if (!m_pOriginalObject)
goto exit;
+ HX_RELEASE(m_pSamePool);
+
if(HXR_OK != m_pOriginalObject->QueryInterface(IID_IHXGetFileFromSamePool,
(void**)&m_pSamePool))
{
Index: clientapps/symbianMmf/videocontroller/101F8513.rss
===================================================================
RCS file: /cvsroot/clientapps/symbianMmf/videocontroller/101F8513.rss,v
retrieving revision 1.3.2.8
diff -u -w -r1.3.2.8 101F8513.rss
--- clientapps/symbianMmf/videocontroller/101F8513.rss 25 Jul 2007 22:48:09 -0000 1.3.2.8
+++ clientapps/symbianMmf/videocontroller/101F8513.rss 13 Nov 2008 20:08:02 -0000
@@ -137,6 +137,16 @@
default_data = "?";
opaque_data = "Real0x101f5d07.xpsv=?\nv=?\r\napplication/x-ext-packetsrc";
rom_only = ROM_ONLY_FLAG;
+ },
+ IMPLEMENTATION_INFO
+ {
+ // AVI
+ implementation_uid = 0x2001E2E8;
+ version_no = 1;
+ display_name = "Helix AVI File Format";
+ default_data = "?";
+ opaque_data = "Real0x101f5d07.aviRIFF????AVIapplication/x-pn-avi-pluginvideo/avivideo/x-msvideovideo/msvideo";
+ rom_only = ROM_ONLY_FLAG;
}
};
}
Index: clientapps/symbianMmf/videocontroller/installMMF.pcf
===================================================================
RCS file: /cvsroot/clientapps/symbianMmf/videocontroller/installMMF.pcf,v
retrieving revision 1.5.2.19
diff -u -w -r1.5.2.19 installMMF.pcf
--- clientapps/symbianMmf/videocontroller/installMMF.pcf 25 Mar 2008 18:21:47 -0000 1.5.2.19
+++ clientapps/symbianMmf/videocontroller/installMMF.pcf 13 Nov 2008 20:08:02 -0000
@@ -178,7 +178,8 @@
'arma' : 'datatype/mp4/audio/mdf/[target]/arma.dll',
'progdownfs' : 'filesystem/progdown/[target]/progdownfs.dll',
'XPSFileFormat' : 'datatype/xps/fileformat/[target]/XPSFileFormat.dll',
- 'hxmetadataeng' : 'datatype/xps/fileformat/[target]/hxmetadataeng.dll'
+ 'hxmetadataeng' : 'datatype/xps/fileformat/[target]/hxmetadataeng.dll',
+ 'avifformat' : 'datatype/avi/fileformat/[target]/avifformat.dll'
}
@@ -219,6 +220,7 @@
Add('httpfsys')
Add('aacff')
Add('XPSFileFormat')
+Add('avifformat')
if project.IsDefined("HELIX_FEATURE_METADATAENG"):
Add('hxmetadataeng')
Index: datatype/avi/fileformat/Umakefil
===================================================================
RCS file: /cvsroot/datatype/avi/fileformat/Umakefil,v
retrieving revision 1.1
diff -u -w -r1.1 Umakefil
--- datatype/avi/fileformat/Umakefil 6 Oct 2004 16:15:02 -0000 1.1
+++ datatype/avi/fileformat/Umakefil 13 Nov 2008 20:08:22 -0000
@@ -42,4 +42,4 @@
if project.IsDefined("HELIX_FEATURE_SERVER"):
MultiTargetMake("aviffdll")
else:
- MultiTargetMake("avifflib")
+ MultiTargetMake("avifflib","aviffdll")
Index: datatype/avi/fileformat/aviffdll
===================================================================
RCS file: /cvsroot/datatype/avi/fileformat/aviffdll,v
retrieving revision 1.2
diff -u -w -r1.2 aviffdll
--- datatype/avi/fileformat/aviffdll 9 Aug 2005 20:01:08 -0000 1.2
+++ datatype/avi/fileformat/aviffdll 13 Nov 2008 20:08:22 -0000
@@ -63,5 +63,6 @@
"common/include",
"hxcom.h")
project.ExportFunction("CanUnload", "void")
+project.ExportFunction("CanUnload2", "void")
DLLTarget("avifformat")
Index: datatype/avi/fileformat/avifflib
===================================================================
RCS file: /cvsroot/datatype/avi/fileformat/avifflib,v
retrieving revision 1.2
diff -u -w -r1.2 avifflib
--- datatype/avi/fileformat/avifflib 9 Aug 2005 20:01:08 -0000 1.2
+++ datatype/avi/fileformat/avifflib 13 Nov 2008 20:08:22 -0000
@@ -41,7 +41,7 @@
"common/container/pub",
"common/dbgtool/pub",
"common/system/pub",
- "common/util/pub/",
+ "common/util/pub",
"common/runtime/pub",
"datatype/common/util/pub",
"datatype/rm/include",
Index: datatype/avi/fileformat/aviffpln.cpp
===================================================================
RCS file: /cvsroot/datatype/avi/fileformat/aviffpln.cpp,v
retrieving revision 1.5
diff -u -w -r1.5 aviffpln.cpp
--- datatype/avi/fileformat/aviffpln.cpp 9 Aug 2005 20:01:08 -0000 1.5
+++ datatype/avi/fileformat/aviffpln.cpp 13 Nov 2008 20:08:23 -0000
@@ -125,7 +125,6 @@
#define LE16_TO_HOST(x) (x)
#endif // NET_ENDIAN
-INT32 g_nRefCount_avif;
/****************************************************************************
*
@@ -172,21 +171,16 @@
* then the pluginhandler can unload the DLL
*
*/
-HX_RESULT CAVIFileFormat::CanUnload(void)
-{
- HX_ASSERT(g_nRefCount_avif >= 0);
- return(g_nRefCount_avif > 0 ? HXR_FAIL : HXR_OK);
-}
-
-const char* CAVIFileFormat::zm_pDescription = "RealNetworks AVI File Format Plugin";
-const char* CAVIFileFormat::zm_pCopyright = HXVER_COPYRIGHT;
-const char* CAVIFileFormat::zm_pMoreInfoURL = "http://www.real.com";
-const char* CAVIFileFormat::zm_pFileMimeTypes[] = {"application/x-pn-avi-plugin", NULL};
-const char* CAVIFileFormat::zm_pFileExtensions[] = {"avi", NULL};
-const char* CAVIFileFormat::zm_pFileOpenNames[] = {"AVI Files (*.avi)",
+const char* const CAVIFileFormat::zm_pDescription = "RealNetworks AVI File Format Plugin";
+const char* const CAVIFileFormat::zm_pCopyright = HXVER_COPYRIGHT;
+const char* const CAVIFileFormat::zm_pMoreInfoURL = "http://www.real.com";
+
+const char* const CAVIFileFormat::zm_pFileMimeTypes[] = {"application/x-pn-avi-plugin", "video/x-msvideo", "video/avi", "video/msvideo", NULL};
+const char* const CAVIFileFormat::zm_pFileExtensions[] = {"avi", "divx", NULL};
+const char* const CAVIFileFormat::zm_pFileOpenNames[] = {"AVI Files (*.avi)",
"DivX Files (*.divx)", NULL};
-const char* CAVIFileFormat::zm_pPacketFormats[] = {"rdt", "rtp", NULL};
+const char* const CAVIFileFormat::zm_pPacketFormats[] = {"rdt", "rtp", NULL};
CAVIFileFormat::CAVIFileFormat()
: m_bSeekPriming(FALSE)
@@ -208,7 +202,6 @@
, m_pszCopyright(NULL)
, m_state(AS_InitPending)
{
- g_nRefCount_avif++; // DLL Ref Counting
// Header fields set to 0
@@ -302,9 +295,9 @@
{
bLoadMultiple = TRUE; // Must be true for file formats.
- pDescription = zm_pDescription;
- pCopyright = zm_pCopyright;
- pMoreInfoURL = zm_pMoreInfoURL;
+ pDescription = (const char*) zm_pDescription;
+ pCopyright = (const char*) zm_pCopyright;
+ pMoreInfoURL = (const char*) zm_pMoreInfoURL;
ulVersionNumber = TARVER_ULONG32_VERSION;
return HXR_OK;
@@ -314,7 +307,6 @@
CAVIFileFormat::~CAVIFileFormat()
{
Close();
- g_nRefCount_avif--; // DLL Ref Counting
return;
}
@@ -334,9 +326,9 @@
REF(const char**) /*OUT*/ pFileOpenNames
)
{
- pFileMimeTypes = zm_pFileMimeTypes;
- pFileExtensions = zm_pFileExtensions;
- pFileOpenNames = zm_pFileOpenNames;
+ pFileMimeTypes = (const char**) zm_pFileMimeTypes;
+ pFileExtensions = (const char**) zm_pFileExtensions;
+ pFileOpenNames = (const char**) zm_pFileOpenNames;
return HXR_OK;
}
@@ -446,6 +438,8 @@
IHXFileObject* /*IN*/ pFile
)
{
+ HXLOGL2(HXLOG_AVIX,"CAVIFileFormat[%p]::InitFileFormat() pRequest=%p pFormatResponse=%p pFile=%p", this, pRequest, pFormatResponse, pFile);
+
m_pRequest = pRequest;
m_pFFResponse = pFormatResponse;
m_pFile = pFile;
@@ -485,6 +479,7 @@
STDMETHODIMP CAVIFileFormat::Close()
{
+ HXLOGL2(HXLOG_AVIX,"CAVIFileFormat[%p]::Close()",this);
m_state = AS_Closed;
HX_VECTOR_DELETE(m_pszTitle);
@@ -565,6 +560,8 @@
STDMETHODIMP CAVIFileFormat::GetStreamHeader(UINT16 usStream)
{
+ HXLOGL3(HXLOG_AVIX,"CAVIFileFormat[%p]::GetStreamHeader() on stream %i", this, usStream);
+
HX_ASSERT(usStream <= m_header.ulStreams);
// Note request:
@@ -638,7 +635,8 @@
STDMETHODIMP CAVIFileFormat::GetPacket(UINT16 unStreamNumber)
{
- HX_TRACE("CAVIFileFormat::GetPacket() on stream %i\n", unStreamNumber);
+ HXLOGL4(HXLOG_AVIX,"CAVIFileFormat[%p]::GetPacket() on stream %i", this, unStreamNumber);
+
HX_ASSERT(m_state >= AS_GetIndexFilePending);
//HX_ASSERT(!m_bSeekPriming);
if (m_state <= AS_IndexFileInit)
@@ -692,7 +690,7 @@
*/
STDMETHODIMP CAVIFileFormat::Seek(ULONG32 ulOffset)
{
- HX_TRACE("CAVIFileFormat::Seek()\t%lu\n", ulOffset);
+ HXLOGL2(HXLOG_AVIX,"CAVIFileFormat[%p]::Seek()\t%lu", this, ulOffset);
// We should handle seeks past end of stream by streaming all data
// past and including the last keyframe
@@ -730,7 +728,7 @@
REF(UINT16) ulPercentDone
)
{
- //HX_TRACE("CAVIFileFormat::GetStatus()\n");
+ HXLOGL4(HXLOG_AVIX,"CAVIFileFormat[%p]::GetStatus() m_state=%d", this, m_state);
HX_RESULT hResult = HXR_OK;
#if 0
@@ -781,8 +779,8 @@
REF(const char**) /*OUT*/ pPacketFormats
)
{
- //HX_TRACE("CAVIFileFormat::GetSupportedPacketFormats()\n");
- pPacketFormats = zm_pPacketFormats;
+ HXLOGL2(HXLOG_AVIX,"CAVIFileFormat[%p]::GetSupportedPacketFormats()", this);
+ pPacketFormats = (const char**) zm_pPacketFormats;
return HXR_OK;
}
@@ -799,7 +797,7 @@
)
{
#if 0
- //HX_TRACE("CAVIFileFormat::SetPacketFormat()\n");
+ HXLOGL2(HXLOG_AVIX,"CAVIFileFormatp[%p]::SetPacketFormat()", this);
if ( strcasecmp(pPacketFormat, "rtp") == 0 )
{
m_packetFormat = PFMT_RTP;
@@ -816,7 +814,7 @@
STDMETHODIMP
CAVIFileFormat::RIFFOpenDone(HX_RESULT status)
{
- //PN_TRACE("CAVIFileFormat::RIFFOpenDone(%lx)\n", status);
+ HXLOGL4(HXLOG_AVIX,"CAVIFileFormat[%p]::RIFFOpenDone(%lx)",this,status);
HX_ASSERT(SUCCEEDED(status));
if ( m_state != AS_OpenPending )
@@ -833,7 +831,7 @@
}
// Verify this is indeed an AVI file:
- if (m_pGeneralReader->FileSubtype() != HX_MAKE4CC('A', 'V', 'I', ' '))
+ if (m_pGeneralReader->FileSubtype() != m_pGeneralReader->GetLong((UCHAR *)"AVI "))
{
m_pErrorMessages->Report(HXLOG_ERR, HXR_INVALID_FILE,
0, (const char*) "The stream URL is not a valid AVI",
@@ -849,7 +847,7 @@
STDMETHODIMP
CAVIFileFormat::RIFFCloseDone(HX_RESULT status)
{
- //HX_TRACE("CAVIFileFormat::RIFFCloseDone(%lx)\n", status);
+ HXLOGL4(HXLOG_AVIX,"CAVIFileFormat[%p]::RIFFCloseDone(%lx)",this, status);
HX_ASSERT(SUCCEEDED(status));
HX_ASSERT(m_state >= AS_GetIndexFilePending);
@@ -859,8 +857,8 @@
STDMETHODIMP
CAVIFileFormat::RIFFFindChunkDone(HX_RESULT status, UINT32 len)
{
- //HX_TRACE("CAVIFileFormat::RIFFFindChunkDone(""%lx, %lu)\n\tstate=%lu\n",
- // status, len, m_state);
+ HXLOGL4(HXLOG_AVIX,"CAVIFileFormat[%p]::RIFFFindChunkDone(%lx, %lu)\tstate=%lu",
+ this, status, len, m_state);
switch (m_state)
{
@@ -974,7 +972,7 @@
// We note the MOVI offset:
m_state = AS_INFOAscend;
m_ulMOVIOffset = m_pGeneralReader->GetOffset() - 4;
- //HX_TRACE("movi offset:%lx\n", m_ulMOVIOffset);
+ HXLOGL4(HXLOG_AVIX,"movi offset:%lx", m_ulMOVIOffset);
m_pGeneralReader->Ascend();
break;
case AVI_INFO_CHUNK:
@@ -1024,7 +1022,7 @@
STDMETHODIMP
CAVIFileFormat::RIFFDescendDone(HX_RESULT status)
{
- //HX_TRACE("CAVIFileFormat::RIFFDescendDone(%lx)\n\tstate=%lu\n", status, m_state);
+ HXLOGL4(HXLOG_AVIX,"CAVIFileFormat[%p]::RIFFDescendDone(%lx)\tstate=%lu", this, status, m_state);
HX_ASSERT(SUCCEEDED(status));
switch ( m_state )
@@ -1089,7 +1087,7 @@
STDMETHODIMP
CAVIFileFormat::RIFFAscendDone(HX_RESULT status)
{
- //HX_TRACE("CAVIFileFormat::RIFFAscendDone(%lx)\n\tstate=%lu\n", status, m_state);
+ HXLOGL4(HXLOG_AVIX,"CAVIFileFormat[%p]::RIFFAscendDone(%lx)\tstate=%lu", this, status, m_state);
HX_ASSERT(SUCCEEDED(status));
switch ( m_state )
@@ -1142,7 +1140,7 @@
STDMETHODIMP
CAVIFileFormat::RIFFReadDone(HX_RESULT status, IHXBuffer* pBuffer)
{
- //HX_TRACE("CAVIFileFormat::RIFFReadDone(%lx)\n\tstate=%lu\n", status, m_state);
+ HXLOGL4(HXLOG_AVIX,"CAVIFileFormat[%p]::RIFFReadDone(%lx)\tstate=%lu", this, status, m_state);
HX_ASSERT(SUCCEEDED(status));
if (m_state < AS_AVIHRead ||
@@ -1237,7 +1235,7 @@
void CAVIFileFormat::SetInfo(IHXBuffer* pBuffer, UINT32 ulChunkType)
{
- //HX_TRACE("CAVIFileFormat::SetInfo()\n", m_state);
+ HXLOGL3(HXLOG_AVIX,"CAVIFileFormat[%p]::SetInfo()", this, m_state);
if (!pBuffer)
{
HX_ASSERT(FALSE);
@@ -1252,19 +1250,19 @@
switch (ulChunkType)
{
case AVI_TITLE_CHUNK:
- m_pszTitle = new CHAR[len+1];
+ m_pszTitle = new char[len+1];
memset(m_pszTitle, len+1, 0);
strcpy(m_pszTitle, (const char*)buf);
break;
case AVI_AUTHOR_CHUNK:
- m_pszAuthor = new CHAR[len+1];
+ m_pszAuthor = new char[len+1];
memset(m_pszAuthor, len+1, 0);
strcpy(m_pszAuthor, (const char*)buf);
break;
case AVI_COPYRIGHT_CHUNK:
- m_pszCopyright = new CHAR[len+1];
+ m_pszCopyright = new char[len+1];
memset(m_pszCopyright, len+1, 0);
strcpy(m_pszCopyright, (const char*)buf);
break;
@@ -1275,7 +1273,7 @@
HX_RESULT CAVIFileFormat::SetHeader(IHXBuffer* pBuffer)
{
- //HX_TRACE("CAVIFileFormat::SetHeader\n\tstate=%lu\n", m_state);
+ HXLOGL3(HXLOG_AVIX,"CAVIFileFormat[%p]::SetHeader\tstate=%lu", this, m_state);
HX_ASSERT_VALID_PTR(pBuffer);
UINT32 len = pBuffer->GetSize();
@@ -1310,7 +1308,7 @@
STDMETHODIMP
CAVIFileFormat::RIFFSeekDone(HX_RESULT status)
{
- //HX_TRACE("CAVIFileFormat::RIFFSeekDone(%lx)\n\tstate=%lu\n", status, m_state);
+ HXLOGL4(HXLOG_AVIX,"CAVIFileFormat[%p]::RIFFSeekDone(%lx)\tstate=%lu", this,status, m_state);
HX_ASSERT(FALSE);
return HXR_UNEXPECTED;
@@ -1321,8 +1319,8 @@
UINT32 ulChunkType,
IHXBuffer* pBuffer)
{
-// HX_TRACE("CAVIFileFormat::RIFFGetChunkDone(%lx, %lx)\n\tstate=%lu\n",
-// status, ulChunkType, m_state);
+ HXLOGL4(HXLOG_AVIX,"CAVIFileFormat[%p]::RIFFGetChunkDone(%lx, %lx)\tstate=%lu",
+ this, status, ulChunkType, m_state);
// HX_ASSERT(FALSE);
// return HXR_OK;
@@ -1353,7 +1351,7 @@
CAVIFileFormat::FileObjectReady(HX_RESULT status,
IUnknown* pObject)
{
- //HX_TRACE("CAVIFileFormat::FileObjectReady\n\tstate=%lu\n", m_state);
+ HXLOGL4(HXLOG_AVIX,"CAVIFileFormat[%p]::FileObjectReady\tstate=%lu", this, m_state);
HX_ASSERT(SUCCEEDED(status));
HX_ASSERT_VALID_PTR(pObject);
HX_ASSERT(m_state == AS_GetIndexFilePending || m_state == AS_GetStreamFilePending);
@@ -1498,7 +1496,7 @@
void CAVIFileFormat::ScanState()
{
- //HX_TRACE("CAVIFileFormat::ScanState\n\tstate=%lu\n", m_state);
+ HXLOGL4(HXLOG_AVIX,"CAVIFileFormat[%p]::ScanState\tstate=%lu", this, m_state);
if (m_state != AS_Ready)
{
@@ -1561,13 +1559,7 @@
IHXPacket* pPendingPacket = ((CAVIStream*) m_streamArray[lEarliestStream])->GetNextPacket();
HX_ASSERT(pPendingPacket);
- if (m_bSeekPriming)
- {
- m_bSeekPriming = FALSE;
- HX_ASSERT(!pPendingPacket->GetASMRuleNumber());
- }
-
- HX_TRACE("CAVIFileFormat::ScanState\tPacketReady, stream: %lu\ttimestamp: %lu\n", pPendingPacket->GetStreamNumber(), pPendingPacket->GetTime());
+ HXLOGL4(HXLOG_AVIX,"CAVIFileFormat[%p]::ScanState\tPacketReady, stream: %lu\ttimestamp: %lu", this, pPendingPacket->GetStreamNumber(), pPendingPacket->GetTime());
// Warning: core call
m_pFFResponse->PacketReady(HXR_OK, pPendingPacket);
HX_RELEASE(pPendingPacket);
@@ -1692,6 +1684,7 @@
if (m_bSeekPriming)
{
m_pFFResponse->SeekDone(HXR_OK);
+ m_bSeekPriming = FALSE;
return;
}
@@ -1705,7 +1698,7 @@
IHXValues* CAVIFileFormat::GetHeader()
{
- //HX_TRACE("CAVIFileFormat::GetHeader()\n", m_state);
+ HXLOGL3(HXLOG_AVIX,"CAVIFileFormat[%p]::GetHeader()", this,m_state);
HX_ASSERT(m_streamArray.GetSize() > 0);
HX_ASSERT(m_header.ulStreams == m_streamArray.GetSize());
@@ -1734,27 +1727,27 @@
{
pTitle->Set((const UCHAR*)m_pszTitle, strlen(m_pszTitle)+1);
pHeader->SetPropertyBuffer("Title", pTitle);
- //HX_TRACE("\tTitle:\t%s\n", m_pszTitle);
+ HXLOGL3(HXLOG_AVIX,"\tTitle:\t%s", m_pszTitle);
}
if ( m_pszAuthor )
{
pAuthor->Set((const UCHAR*)m_pszAuthor, strlen(m_pszAuthor)+1);
pHeader->SetPropertyBuffer("Author", pAuthor);
- //HX_TRACE("\tAuthor:\t%s\n", m_pszAuthor);
+ HXLOGL3(HXLOG_AVIX,"\tAuthor:\t%s", m_pszAuthor);
}
if ( m_pszCopyright )
{
pCopyright->Set((const UCHAR*)m_pszCopyright, strlen(m_pszCopyright)+1);
pHeader->SetPropertyBuffer("Copyright", pCopyright);
- //HX_TRACE("\tCopyright:\t%s\n", m_pszCopyright);
+ HXLOGL3(HXLOG_AVIX,"\tCopyright:\t%s", m_pszCopyright);
}
}
// XXXKB Unconditionally enable recording? Can this be improved??
pHeader->SetPropertyULONG32("Flags", HX_SAVE_ENABLED);
- //HX_TRACE("\tFlags:\t%lu\n", HX_SAVE_ENABLED);
+ HXLOGL3(HXLOG_AVIX,"\tFlags:\t%lu", HX_SAVE_ENABLED);
// XXXKB Disable seeking if we have no index?
@@ -1768,7 +1761,7 @@
void CAVIFileFormat::IOEvent()
{
- //HX_TRACE("CAVIFileFormat::IOEvent\n\tstate=%lu\n", m_state);
+ HXLOGL4(HXLOG_AVIX,"CAVIFileFormat[%p]::IOEvent\tstate=%lu", this, m_state);
HX_ASSERT(m_state == AS_IndexFileInit || m_state == AS_IOEvent ||
m_state == AS_Closed);
Index: datatype/avi/fileformat/aviindx.cpp
===================================================================
RCS file: /cvsroot/datatype/avi/fileformat/aviindx.cpp,v
retrieving revision 1.6
diff -u -w -r1.6 aviindx.cpp
--- datatype/avi/fileformat/aviindx.cpp 9 Aug 2005 20:01:08 -0000 1.6
+++ datatype/avi/fileformat/aviindx.cpp 13 Nov 2008 20:08:23 -0000
@@ -53,6 +53,7 @@
#include "ihxpckts.h"
#include "hxheap.h"
+#include "hxtlogutil.h"
#ifdef _DEBUG
#undef HX_THIS_FILE
@@ -98,12 +99,12 @@
, m_scanState(eInitial)
, m_lRefCount(0)
{
- //HX_TRACE("CAVIFileFormat::CAVIIndex::CAVIIndex()\n");
+ HXLOGL2(HXLOG_AVIX,"CAVIIndex[%p]::CAVIIndex() CTOR", this);
}
CAVIIndex::~CAVIIndex()
{
- //HX_TRACE("CAVIFileFormat::CAVIIndex::~CAVIIndex()\n");
+ HXLOGL2(HXLOG_AVIX,"CAVIIndex[%p]::~CAVIIndex() DES", this);
/* HX_RELEASE(m_pReader);
HX_RELEASE(m_pOuter);
@@ -119,7 +120,7 @@
IUnknown* pContext, UINT32 ulFirstMOVIOffset,
UINT16 usStreamCount)
{
- //HX_TRACE("CAVIFileFormat::CAVIIndex::Init()\n");
+ HXLOGL2(HXLOG_AVIX,"CAVIIndex[%p]::Init()", this);
HX_ASSERT_VALID_PTR(pOuter);
m_pOuter = pOuter;
@@ -181,12 +182,11 @@
void CAVIIndex::AddToIndex(UINT16 usStream, UINT32 ulChunk, UINT32 ulOffset,
UINT32 ulSize, BOOL bKeyChunk) // offset includes header
{
- //HX_TRACE("CAVIFileFormat::CAVIIndex::AddToIndex()\n");
+ HXLOGL4(HXLOG_AVIX,"CAVIIndex[%p]::AddToIndex()", this);
StreamSlice* pStream = (StreamSlice*) m_sliceArray[usStream];
// Do we have an index, or is this chunk already indexed?
- if (m_pReader || ulChunk < pStream->ulNextChunkRequired
- || ulChunk < pStream->ulSliceEndChunk)
+ if (m_pReader || ulChunk < pStream->ulSliceEndChunk)
{
return;
}
@@ -210,13 +210,13 @@
void CAVIIndex::FileRead(BOOL bRead) // All chunks have been indexed; reset on seek
{
- //HX_TRACE("CAVIFileFormat::CAVIIndex::FileRead()\n");
+ HXLOGL4(HXLOG_AVIX,"CAVIIndex[%p]::FileRead()", this);
m_bRead = bRead;
}
void CAVIIndex::SetMinimumChunkInterest(UINT16 usStream, UINT32 ulChunk)
{
- //HX_TRACE("CAVIFileFormat::CAVIIndex::SetMinimumChunkInterest()\n");
+ HXLOGL4(HXLOG_AVIX,"CAVIIndex[%p]::SetMinimumChunkInterest()", this);
HX_ASSERT(usStream < m_usStreamCount);
StreamSlice* pStream = (StreamSlice*) m_sliceArray[usStream];
@@ -235,7 +235,7 @@
BOOL CAVIIndex::IsKeyChunk(UINT16 usStream, UINT32 ulChunk)
{
- //HX_TRACE("CAVIFileFormat::CAVIIndex::IsKeyChunk()\n");
+ HXLOGL4(HXLOG_AVIX,"CAVIIndex[%p]::IsKeyChunk()", this);
StreamSlice* pStream = (StreamSlice*) m_sliceArray[usStream];
// in bounds?
@@ -255,7 +255,7 @@
/* out */ UINT32& ulClosestOffset,
/* out */ UINT32& ulClosestStreamChunk)
{
- //HX_TRACE("CAVIFileFormat::CAVIIndex::FindClosestChunk()\n");
+ HXLOGL4(HXLOG_AVIX,"CAVIIndex[%p]::FindClosestChunk()", this);
if (ulChunk == 0)
{
@@ -306,7 +306,7 @@
/* out */ UINT32& ulClosestOffset,
/* out */ UINT32& ulClosestStreamChunk)
{
- //HX_TRACE("CAVIFileFormat::CAVIIndex::FindClosestKeyChunk()\n");
+ HXLOGL4(HXLOG_AVIX,"CAVIIndex[%p]::FindClosestKeyChunk()", this);
if (ulChunk == 0)
{
@@ -355,7 +355,7 @@
// in bytes, not including header:
UINT32 CAVIIndex::GetMaxChunkSize(UINT16 usStream)
{
- //HX_TRACE("CAVIFileFormat::CAVIIndex::GetMaxChunkSize()\n");
+ HXLOGL4(HXLOG_AVIX,"CAVIIndex[%p]::GetMaxChunkSize()", this);
StreamSlice* pStream = (StreamSlice*) m_sliceArray[usStream];
return pStream->ulMaxChunkSize;
}
@@ -363,7 +363,7 @@
// in bytes, not including header:
double CAVIIndex::GetAverageChunkSize(UINT16 usStream)
{
- //HX_TRACE("CAVIFileFormat::CAVIIndex::GetAverageChunkSize()\n");
+ HXLOGL4(HXLOG_AVIX,"CAVIIndex[%p]::GetAverageChunkSize()", this);
StreamSlice* pStream = (StreamSlice*) m_sliceArray[usStream];
return pStream->ulTotalBytes / (double) pStream->ulTotalChunks;
@@ -372,7 +372,7 @@
// Returns zero if we have no index; assumes transmission at average rate
UINT32 CAVIIndex::GetMaxByteDeflict(UINT16 usStream)
{
- //HX_TRACE("CAVIFileFormat::CAVIIndex::GetMaxByteDeflict()\n");
+ HXLOGL4(HXLOG_AVIX,"CAVIIndex[%p]::GetMaxByteDeflict()", this);
StreamSlice* pStream = (StreamSlice*) m_sliceArray[usStream];
return pStream->ulPrerollBytes;
@@ -380,7 +380,7 @@
UINT32 CAVIIndex::GetByteTotal(UINT16 usStream)
{
- //HX_TRACE("CAVIFileFormat::CAVIIndex::GetByteTotal()\n");
+ HXLOGL4(HXLOG_AVIX,"CAVIIndex[%p]::GetByteTotal()", this);
StreamSlice* pStream = (StreamSlice*) m_sliceArray[usStream];
return pStream->ulTotalBytes;
@@ -388,7 +388,7 @@
UINT32 CAVIIndex::GetChunkTotal(UINT16 usStream)
{
- //HX_TRACE("CAVIFileFormat::CAVIIndex::GetChunkTotal()\n");
+ HXLOGL4(HXLOG_AVIX,"CAVIIndex[%p]::GetChunkTotal()", this);
StreamSlice* pStream = (StreamSlice*) m_sliceArray[usStream];
return pStream->ulTotalChunks;
@@ -396,7 +396,7 @@
BOOL CAVIIndex::CanLoadSlice()
{
- //HX_TRACE("CAVIFileFormat::CAVIIndex::CanLoadSlice()\n");
+ HXLOGL4(HXLOG_AVIX,"CAVIIndex[%p]::CanLoadSlice()", this);
// We want serialized access:
HX_ASSERT(m_state == eReady);
@@ -418,7 +418,7 @@
BOOL CAVIIndex::CanPreloadSlice()
{
- //HX_TRACE("CAVIFileFormat::CAVIIndex::CanPreloadSlice()\n");
+ HXLOGL4(HXLOG_AVIX,"CAVIIndex[%p]::CanPreloadSlice()", this);
// We want serialized access:
HX_ASSERT(m_state == eReady);
@@ -441,7 +441,7 @@
void CAVIIndex::GetNextSlice()
{
- //HX_TRACE("CAVIFileFormat::CAVIIndex::GetNextSlice()\n");
+ HXLOGL4(HXLOG_AVIX,"CAVIIndex[%p]::GetNextSlice()", this);
HX_ASSERT(CanLoadSlice() || CanPreloadSlice());
// We want serialized access:
@@ -597,7 +597,7 @@
STDMETHODIMP CAVIIndex::RIFFOpenDone(HX_RESULT status)
{
- //HX_TRACE("CAVIFileFormat::CAVIIndex::RIFFOpenDone()\n");
+ HXLOGL4(HXLOG_AVIX,"CAVIIndex[%p]::RIFFOpenDone()", this);
HX_ASSERT(m_state == eReaderOpen);
m_state = eInitialDescend;
@@ -607,7 +607,7 @@
STDMETHODIMP CAVIIndex::RIFFCloseDone(HX_RESULT status)
{
- //HX_TRACE("CAVIFileFormat::CAVIIndex::RIFFCloseDone()\n");
+ HXLOGL4(HXLOG_AVIX,"CAVIIndex[%p]::RIFFCloseDone()", this);
return HXR_NOTIMPL;
}
@@ -617,7 +617,7 @@
*/
STDMETHODIMP CAVIIndex::RIFFFindChunkDone(HX_RESULT status, UINT32 len)
{
- //HX_TRACE("CAVIFileFormat::CAVIIndex::RIFFFindChunkDone()\n");
+ HXLOGL4(HXLOG_AVIX,"CAVIIndex[%p]::RIFFFindChunkDone() status=%x", this, status);
HX_ASSERT(m_state == eIdx1Find);
if (FAILED(status) || len == 0)
@@ -652,7 +652,7 @@
/* Called after a Descend completes */
STDMETHODIMP CAVIIndex::RIFFDescendDone(HX_RESULT status)
{
- //HX_TRACE("CAVIFileFormat::CAVIIndex::RIFFDescendDone()\n");
+ HXLOGL4(HXLOG_AVIX,"CAVIIndex[%p]::RIFFDescendDone()", this);
HX_ASSERT(m_state == eInitialDescend || m_state == eIdx1Descend);
switch (m_state)
@@ -698,7 +698,7 @@
/* Called after an Ascend completes */
STDMETHODIMP CAVIIndex::RIFFAscendDone(HX_RESULT status)
{
- //HX_TRACE("CAVIFileFormat::CAVIIndex::RIFFAscendDone()\n");
+ HXLOGL4(HXLOG_AVIX,"CAVIIndex[%p]::RIFFAscendDone()", this);
return HXR_NOTIMPL;
}
@@ -706,7 +706,7 @@
*/
STDMETHODIMP CAVIIndex::RIFFReadDone(HX_RESULT status, IHXBuffer *pBuffer)
{
- //HX_TRACE("CAVIFileFormat::CAVIIndex::RIFFReadDone()\n");
+ HXLOGL4(HXLOG_AVIX,"CAVIIndex[%p]::RIFFReadDone()", this);
HX_ASSERT(m_state == eReadSlice);
if (m_bDiscardPendingIO)
@@ -881,13 +881,13 @@
LE32_TO_HOST(pEntry->ulChunkOffset) + m_ulFirstRelativeMOVIOffset;
pStream->entryArray[pStream->ulSliceEndChunk % MAX_SLICE_SIZE].ulLength =
LE32_TO_HOST(pEntry->ulChunkLength);
- //HX_TRACE("CAVIIndex::RIFFReadDone stream: %d\toffset: %lu\n", CAVIFileFormat::GetStream(pEntry->ulChunkId),
+ // HXLOGL4(HXLOG_AVIX,"CAVIIndex[%p]::RIFFReadDone stream: %d\toffset: %lu", this,CAVIFileFormat::GetStream(pEntry->ulChunkId),
// pStream->entryArray[pStream->ulSliceEndChunk % MAX_SLICE_SIZE].ulOffset);
#ifdef _DEBUG_KEYCHUNKS
if (pStream->entryArray[pStream->ulSliceEndChunk % MAX_SLICE_SIZE].bKeyChunk)
{
- //HX_TRACE("CAVIIndex::RIFFReadDone keytype: %c%c%c%c\n",
+ HXLOGL4(HXLOG_AVIX,"CAVIIndex[%p]::RIFFReadDone keytype: %c%c%c%c",this,
pEntry->ulChunkId, pEntry->ulChunkId >> 8,
pEntry->ulChunkId >> 16, pEntry->ulChunkId >> 24);
}
@@ -931,7 +931,7 @@
/* Called when a seek completes */
STDMETHODIMP CAVIIndex::RIFFSeekDone(HX_RESULT status)
{
- //HX_TRACE("CAVIFileFormat::CAVIIndex::RIFFSeekDone()\n");
+ HXLOGL4(HXLOG_AVIX,"CAVIIndex[%p]::RIFFSeekDone()", this);
if (m_bDiscardPendingIO)
{
@@ -977,12 +977,13 @@
STDMETHODIMP CAVIIndex::RIFFGetChunkDone(HX_RESULT status, UINT32 chunkType,
IHXBuffer* pBuffer)
{
- //HX_TRACE("CAVIFileFormat::CAVIIndex::RIFFGetChunkDone()\n");
+ HXLOGL4(HXLOG_AVIX,"CAVIIndex[%p]::RIFFGetChunkDone()", this);
return HXR_NOTIMPL;
}
void CAVIIndex::Close()
{
+ HXLOGL2(HXLOG_AVIX,"CAVIIndex[%p]::Close()", this);
if(m_pFile)
{
m_pFile->Close();
Index: datatype/avi/fileformat/avistrm.cpp
===================================================================
RCS file: /cvsroot/datatype/avi/fileformat/avistrm.cpp,v
retrieving revision 1.9
diff -u -w -r1.9 avistrm.cpp
--- datatype/avi/fileformat/avistrm.cpp 9 Aug 2005 20:01:08 -0000 1.9
+++ datatype/avi/fileformat/avistrm.cpp 13 Nov 2008 20:08:23 -0000
@@ -107,6 +107,7 @@
#define AVI_VIDS_TYPE HX_MAKE4CC('v', 'i', 'd', 's') /* 'vids' */
#define AVI_AUDS_TYPE HX_MAKE4CC('a', 'u', 'd', 's') /* 'auds' */
+#define AVI_H261_VIDEO HX_MAKE4CC('1', '6', '2', 'H') /* 'H261' */
// FourCCs - TODO: make macros?
#define AVI_MJPG_VIDEO HX_MAKE4CC('G', 'P', 'J', 'M') /* 'GPJM' */
@@ -247,8 +248,12 @@
#define WAVE_FORMAT_EXTENSIBLE 0xFFFE /* Microsoft */
#define WAVE_FORMAT_DEVELOPMENT 0xFFFF /* new wave formats in development */
-#define VIDEO_FORMAT_H263 HX_MAKE4CC('H', '2', '6', '3')
-#define VIDEO_FORMAT_DIVX HX_MAKE4CC('d', 'i', 'v', 'x')
+#define VIDEO_FORMAT_H263 HX_MAKE4CC('3', '6', '2', 'H')
+#define VIDEO_FORMAT_divx HX_MAKE4CC('x', 'v', 'i', 'd')
+#define VIDEO_FORMAT_DIVX HX_MAKE4CC('X', 'V', 'I', 'D')
+#define VIDEO_FORMAT_DV50 HX_MAKE4CC('0', '5', 'V', 'D')
+#define VIDEO_FORMAT_XVID HX_MAKE4CC('D', 'I', 'V', 'X')
+#define VIDEO_FORMAT_xvid HX_MAKE4CC('d', 'i', 'v', 'x')
#define AVI_LIST_OBJECT 0x4c495354 /* 'LIST' */
#define AVI_RECORD_TYPE 0x72656320 /* 'rec ' */
@@ -303,6 +308,7 @@
, m_ulSeekTime (0)
, m_pFile (NULL)
{
+ HXLOGL2(HXLOG_AVIX, "CAVIStream[%p]::CAVIStream() CTOR", this);
HX_ASSERT_VALID_PTR(m_pOuter);
HX_ASSERT_VALID_PTR(m_pContext);
HX_ADDREF(m_pContext);
@@ -326,7 +332,7 @@
//
CAVIStream::~CAVIStream()
{
- //HX_TRACE("CAVIFileFormat::CAVIStream::~CAVIStream()\n");
+ HXLOGL2(HXLOG_AVIX, "CAVIStream[%p]::~CAVIStream()", this);
/* HX_RELEASE(m_pReader);
HX_DELETE(m_pFormat);
HX_RELEASE(m_pPayloadFormatter);
@@ -344,7 +350,7 @@
//
HX_RESULT CAVIStream::SetHeader(UINT16 usStream, IHXBuffer* pHeader)
{
- //HX_TRACE("CAVIFileFormat::CAVIStream::SetHeader()\n");
+ HXLOGL2(HXLOG_AVIX,"CAVIStream[%p]::SetHeader() usStream=%d", this, usStream);
HX_RESULT result = HXR_FAIL;
UCHAR* buf;
@@ -352,13 +358,15 @@
if (pHeader && SUCCEEDED(result = pHeader->Get(buf, len)))
{
- HX_ASSERT(len >= sizeof(m_header));
- if (len < sizeof(m_header))
+ HX_ASSERT(len >= SIZE_OF_AVI_VIDEO_HEADER);
+ if (len < SIZE_OF_AVI_VIDEO_HEADER)
{
return HXR_FAIL;
}
- m_header.ulType = LE32_TO_HOST(*(UINT32*) &buf[0]);
+ // use integer to respresent stream type, the absolute value is not important.
+ // it should be consistent with AVI_VIDS_TYPE AVI_AUDS_TYPE AVI_MJPG_VIDEO defined above
+ m_header.ulType = HX_MAKE4CC( buf[0] , buf[1] , buf[2] , buf[3] );
m_header.ulHandler = LE32_TO_HOST(*(UINT32*) &buf[4]);
m_header.ulFlags = LE32_TO_HOST(*(UINT32*) &buf[8]);
m_header.sPriority = (INT16) LE16_TO_HOST(*(UINT32*) &buf[12]);
@@ -371,11 +379,22 @@
m_header.ulSuggestedBufferSize = LE32_TO_HOST(*(UINT32*) &buf[36]);
m_header.ulQuality = LE32_TO_HOST(*(UINT32*) &buf[40]);
m_header.ulSampleSize = LE32_TO_HOST(*(UINT32*) &buf[44]);
+
+ if(len >= sizeof(m_header))
+ {
m_header.sTop = (INT16) LE16_TO_HOST(*(UINT32*) &buf[48]);
m_header.sLeft = (INT16) LE16_TO_HOST(*(UINT32*) &buf[50]);
m_header.sBottom = (INT16) LE16_TO_HOST(*(UINT32*) &buf[52]);
m_header.sRight = (INT16) LE16_TO_HOST(*(UINT32*) &buf[54]);
}
+ else
+ {
+ m_header.sTop = 0;
+ m_header.sLeft = 0;
+ m_header.sBottom = 0;
+ m_header.sRight = 0;
+ }
+ }
return result;
}
@@ -386,7 +405,7 @@
//
HX_RESULT CAVIStream::SetFormat(IHXBuffer* pFormat)
{
- //HX_TRACE("CAVIFileFormat::CAVIStream::SetFormat()\n");
+ HXLOGL2(HXLOG_AVIX,"CAVIStream[%p]::SetFormat()", this);
HX_ASSERT(pFormat);
HX_RESULT result = HXR_FAIL;
@@ -463,7 +482,7 @@
m_pFormat = new UCHAR[len + nPadding];
memcpy(m_pFormat, buf, len);
- HXLOGL3(HXLOG_AVIX, "CAVIStream::SetFormat with wave m_pFormat=%p\n", m_pFormat);
+ HXLOGL3(HXLOG_AVIX, "CAVIStream[%p]::SetFormat with wave m_pFormat=%p", this,m_pFormat);
if(nPadding > 0)
{
@@ -498,7 +517,7 @@
//
HX_RESULT CAVIStream::SetPacketFormat(UINT32 ePacketFormat)
{
- //HX_TRACE("CAVIFileFormat::CAVIStream::SetPacketFormat()\n");
+ HXLOGL4(HXLOG_AVIX,"CAVIStream[%p]::SetPacketFormat()", this);
HX_ASSERT(m_state <= ePreHeader);
m_ePacketFormat = (PacketFormat) ePacketFormat;
@@ -510,7 +529,7 @@
//
HX_RESULT CAVIStream::SetOpaque(IHXBuffer* pOpaque)
{
- //HX_TRACE("CAVIFileFormat::CAVIStream::SetOpaque()\n");
+ HXLOGL4(HXLOG_AVIX,"CAVIStream[%p]::SetOpaque()", this);
return HXR_NOTIMPL;
}
@@ -519,7 +538,7 @@
//
HX_RESULT CAVIStream::SetIndex(CAVIIndex* pIndex)
{
- //HX_TRACE("CAVIFileFormat::CAVIStream::SetIndex()\n");
+ HXLOGL4(HXLOG_AVIX,"CAVIStream[%p]::SetIndex()", this);
HX_ASSERT(!m_pIndex);
HX_ASSERT_VALID_PTR(pIndex);
m_pIndex = pIndex;
@@ -532,7 +551,7 @@
//
void CAVIStream::SetPendingHeaderRequest()
{
- //HX_TRACE("CAVIFileFormat::CAVIStream::SetPendingHeaderRequest()\n");
+ HXLOGL4(HXLOG_AVIX,"CAVIStream[%p]::SetPendingHeaderRequest()", this);
m_bPendingHeaderRequest = TRUE;
}
@@ -541,7 +560,7 @@
//
BOOL CAVIStream::PendingHeaderRequest()
{
- //HX_TRACE("CAVIFileFormat::CAVIStream::PendingHeaderRequest()\n");
+ HXLOGL4(HXLOG_AVIX,"CAVIStream[%p]::PendingHeaderRequest()", this);
return m_bPendingHeaderRequest;
}
@@ -550,7 +569,7 @@
//
HX_RESULT CAVIStream::GetHeader(IHXValues* pHeader)
{
- //HX_TRACE("CAVIFileFormat::CAVIStream::GetHeader()\n");
+ HXLOGL3(HXLOG_AVIX,"CAVIStream[%p]::GetHeader()", this);
HX_ASSERT(pHeader);
HX_ASSERT(m_bPendingHeaderRequest);
@@ -621,13 +640,13 @@
pHeader->SetPropertyULONG32("MicrosecondsPerFrame",
(ULONG32) (1e6 * ((double) m_header.ulScale / m_header.ulRate)));
- //HX_TRACE("\t\tMicrosecondsPerFrame:\t%lu\n", (ULONG32) 1e6 * ((double) m_header.ulScale / m_header.ulRate));
+ HXLOGL4(HXLOG_AVIX,"\t\tMicrosecondsPerFrame:\t%lu", (ULONG32) 1e6 * ((double) m_header.ulScale / m_header.ulRate));
}
else
{
-#if 0 // JPEGPayloadFormat not supported (yet)
if ( bi->ulCompression == AVI_MJPG_VIDEO )
{
+ #if defined(HELIX_FEATURE_SERVER)
if (!m_bLocalPlayback)
{
m_pPayloadFormatter = new JPEGPayloadFormat();
@@ -642,11 +661,11 @@
m_pPayloadFormatter->Init(m_pContext, TRUE);
// We'll set the headers below.
}
+ #endif
strcpy(szMimeType, "video/x-pn-jpeg-plugin");
nRTPPayloadType = RTP_PAYLOAD_JPEG;
}
else
-#endif // 0
{
if (m_header.ulHandler == VIDEO_FORMAT_H263)
{
@@ -656,11 +675,20 @@
strcpy(szStreamName, "Video Track");
strcpy (szMimeType, "video/X-RN-3GPP-H263");
}
- else if (m_header.ulHandler == VIDEO_FORMAT_DIVX)
+ else if ((m_header.ulHandler == VIDEO_FORMAT_DIVX) ||
+ (m_header.ulHandler == VIDEO_FORMAT_divx) ||
+ (m_header.ulHandler == VIDEO_FORMAT_DV50) ||
+ (m_header.ulHandler == VIDEO_FORMAT_XVID)||
+ (m_header.ulHandler == VIDEO_FORMAT_xvid))
{
strcpy(szStreamName, "Video Track");
strcpy (szMimeType, "video/X-HX-DIVX");
}
+ else if (m_header.ulHandler == AVI_H261_VIDEO)
+ {
+ strcpy(szStreamName, "Video Track");
+ strcpy(szMimeType, "video/H261");
+ }
else
{
strcpy(szStreamName, "An AVI stream");
@@ -811,6 +839,15 @@
}
}
break;
+ case WAVE_FORMAT_MPEG:
+ {
+ pMimeType = "audio/MPEG-ELEMENTARY";
+ if ( m_ePacketFormat == PFMT_RTP )
+ {
+ nRTPPayloadType = RTP_PAYLOAD_MPA;
+ }
+ }
+ break;
default:
{
pMimeType = szMimeTypeACM;
@@ -888,13 +925,13 @@
}
pHeader->SetPropertyULONG32("BitsPerSample", pWaveInfo->usBitsPerSample);
- //HX_TRACE("\t\tBitsPerSample:\t%lu\n", pWaveInfo->usBitsPerSample);
+ HXLOGL4(HXLOG_AVIX,"\t\tBitsPerSample:\t%lu", pWaveInfo->usBitsPerSample);
pHeader->SetPropertyULONG32("SamplesPerSecond", pWaveInfo->ulSamplesPerSec);
- //HX_TRACE("\t\tSamplesPerSecond:\t%lu\n", pWaveInfo->ulSamplesPerSec);
+ HXLOGL4(HXLOG_AVIX,"\t\tSamplesPerSecond:\t%lu", pWaveInfo->ulSamplesPerSec);
pHeader->SetPropertyULONG32("Channels", pWaveInfo->usChannels);
- //HX_TRACE("\t\tChannels:\t%lu\n", pWaveInfo->usChannels);
+ HXLOGL4(HXLOG_AVIX,"\t\tChannels:\t%lu", pWaveInfo->usChannels);
m_fChunksPerSecond = m_pIndex->GetChunkTotal(m_usStream) / ((double) m_pIndex->GetByteTotal(m_usStream) / pWaveInfo->ulAvgBytesPerSec);
m_fSamplesPerSecond = (double) m_header.ulRate / m_header.ulScale;
@@ -926,16 +963,16 @@
if ( m_ePacketFormat == PFMT_RTP )
{
pHeader->SetPropertyULONG32("RTPPayloadType", nRTPPayloadType);
- //HX_TRACE("\t\tRTPPayloadType:\t%lu\n", nRTPPayloadType);
+ HXLOGL4(HXLOG_AVIX,"\t\tRTPPayloadType:\t%lu", nRTPPayloadType);
}
// Max packet size:
pHeader->SetPropertyULONG32("MaxPacketSize", ulMaxPacketSize);
- //HX_TRACE("\t\tMaxPacketSize:\t%lu\n", ulMaxPacketSize);
+ HXLOGL4(HXLOG_AVIX,"\t\tMaxPacketSize:\t%lu", ulMaxPacketSize);
// Average packet size:
pHeader->SetPropertyULONG32("AvgPacketSize", ulMaxPacketSize);
- //HX_TRACE("\t\tAvgPacketSize:\t%lu\n", ulMaxPacketSize);
+ HXLOGL4(HXLOG_AVIX,"\t\tAvgPacketSize:\t%lu", ulMaxPacketSize);
}
// Format specific data (for future use):
@@ -943,26 +980,30 @@
// Stream number:
pHeader->SetPropertyULONG32("StreamNumber", m_usStream);
- //HX_TRACE("\t\tStreamNumber:\t%lu\n", m_usStream);
+ HXLOGL4(HXLOG_AVIX,"\t\tStreamNumber:\t%lu", m_usStream);
// HX_ASSERT(m_fChunksPerSecond && m_fSamplesPerSecond);
// Start time:
pHeader->SetPropertyULONG32("StartTime", (ULONG32) (m_header.ulStart * m_fChunksPerSecond * 1000));
- //HX_TRACE("\t\tStartTime:\t%lu\n", (ULONG32) (m_header.ulStart * m_fSamplesPerSecond * 1000));
+ HXLOGL4(HXLOG_AVIX,"\t\tStartTime:\t%lu", (ULONG32) (m_header.ulStart * m_fSamplesPerSecond * 1000));
// Duration:
+ if(m_header.ulLength == 0)
+ {
+ m_header.ulLength = 0xffffffff;
+ }
pHeader->SetPropertyULONG32("Duration", (ULONG32) (((double) m_header.ulLength / m_fSamplesPerSecond) * 1000));
- //HX_TRACE("\t\tDuration:\t%lu\n", (ULONG32) (((double) m_header.ulLength / m_fSamplesPerSecond) * 1000));
+ HXLOGL4(HXLOG_AVIX,"\t\tDuration:\t%lu", (ULONG32) (((double) m_header.ulLength / m_fSamplesPerSecond) * 1000));
// Max bit rate:
pHeader->SetPropertyULONG32("MaxBitRate", (ULONG32) (8 * m_pIndex->GetMaxChunkSize(m_usStream) * m_fChunksPerSecond));
- //HX_TRACE("\t\tMaxBitRate:\t%lu\n", (ULONG32) (8 * m_pIndex->GetMaxChunkSize(m_usStream) * m_fChunksPerSecond));
+ HXLOGL4(HXLOG_AVIX,"\t\tMaxBitRate:\t%lu", (ULONG32) (8 * m_pIndex->GetMaxChunkSize(m_usStream) * m_fChunksPerSecond));
// Averate bit rate:
ULONG32 ulAverageBitrate = (ULONG32) (8 * m_pIndex->GetAverageChunkSize(m_usStream) * m_fChunksPerSecond);
pHeader->SetPropertyULONG32("AvgBitRate", ulAverageBitrate);
- //HX_TRACE("\t\tAvgBitRate:\t%lu\n", ulAverageBitrate);
+ HXLOGL4(HXLOG_AVIX,"\t\tAvgBitRate:\t%lu", ulAverageBitrate);
// Preroll:
UINT32 ulPreroll = (UINT32) (((double) m_pIndex->GetMaxByteDeflict(m_usStream) / ulAverageBitrate) * 1000);
@@ -999,7 +1040,7 @@
}
pHeader->SetPropertyULONG32("Preroll", ulPreroll);
- //HX_TRACE("\t\tPreroll:\t%lu\n", ulPreroll);
+ HXLOGL4(HXLOG_AVIX,"\t\tPreroll:\t%lu", ulPreroll);
// Set rule book:
#if 0
@@ -1050,7 +1091,7 @@
//
BOOL CAVIStream::IsAudio()
{
- //HX_TRACE("CAVIFileFormat::CAVIStream::IsAudio()\n");
+ HXLOGL4(HXLOG_AVIX,"CAVIStream[%p]::IsAudio() %d",this,(m_header.ulType == AVI_AUDS_TYPE));
return m_header.ulType == AVI_AUDS_TYPE;
}
@@ -1059,7 +1100,7 @@
//
double CAVIStream::GetDuration()
{
- //HX_TRACE("CAVIFileFormat::CAVIStream::GetDuration()\n");
+ HXLOGL4(HXLOG_AVIX,"CAVIStream[%p]::GetDuration()", this);
HX_ASSERT(m_header.ulScale);
return m_header.ulLength / (m_header.ulRate / (double) m_header.ulScale);
}
@@ -1073,7 +1114,7 @@
HX_RESULT CAVIStream::InitForReading(IUnknown* pContext, IHXFileObject* pFile)
{
- //HX_TRACE("CAVIFileFormat::CAVIStream::InitForReading()\n");
+ HXLOGL2(HXLOG_AVIX,"CAVIStream[%p]::InitForReading()", this);
HX_ASSERT(m_state == ePreReader);
@@ -1098,7 +1139,7 @@
//
BOOL CAVIStream::ReadInitialized()
{
- //HX_TRACE("CAVIFileFormat::CAVIStream::ReadInitialized()\n");
+ HXLOGL4(HXLOG_AVIX,"CAVIStream[%p]::ReadInitialized()", this);
HX_ASSERT(m_pReader ? m_state > ePreReader : TRUE);
return m_pReader != NULL;
}
@@ -1108,7 +1149,7 @@
//
BOOL CAVIStream::HasPackets()
{
- //HX_TRACE("CAVIFileFormat::CAVIStream::HasPackets()\n");
+ HXLOGL4(HXLOG_AVIX,"CAVIStream[%p]::HasPackets()", this);
return (BOOL) m_pNextPacket;
}
@@ -1117,7 +1158,7 @@
//
UINT32 CAVIStream::GetPendingPacketCount()
{
- //HX_TRACE("CAVIFileFormat::CAVIStream::GetPendingPacketCount()\n");
+ HXLOGL4(HXLOG_AVIX,"CAVIStream[%p]::GetPendingPacketCount()", this);
return m_ulPendingPacketRequests;
}
@@ -1126,7 +1167,7 @@
//
UINT32 CAVIStream::IncrementPendingPacketCount()
{
- //HX_TRACE("CAVIFileFormat::CAVIStream::IncrementPendingPacketCount()\n");
+ HXLOGL4(HXLOG_AVIX,"CAVIStream[%p]::IncrementPendingPacketCount()", this);
m_ulPendingPacketRequests++;
return m_ulPendingPacketRequests;
}
@@ -1136,7 +1177,7 @@
//
void CAVIStream::ClearPendingPacketCount()
{
- //HX_TRACE("CAVIFileFormat::CAVIStream::ClearPendingPacketCount()\n");
+ HXLOGL4(HXLOG_AVIX,"CAVIStream[%p]::ClearPendingPacketCount()", this);
m_ulPendingPacketRequests = 0;
}
@@ -1146,7 +1187,7 @@
//
void CAVIStream::Seek(UINT32 ulTime)
{
- //HX_TRACE("CAVIFileFormat::CAVIStream::Seek()\ttime: %lu\n", ulTime);
+ HXLOGL2(HXLOG_AVIX,"CAVIStream[%p]::Seek()\ttime: %lu", this,ulTime);
m_ulPendingPacketRequests = 0;
m_bRead = FALSE;
@@ -1221,7 +1262,7 @@
if (SUCCEEDED(m_pCommonClassFactory->CreateInstance(IID_IHXPacket,
(void**) &pNewPacket)))
{
- // HX_TRACE("CAVIFileFormat::CAVIStream::Seek()\tstream %d\tpacket time: %lu\t minreadchunk: %lu\n", m_usStream, ulTime, m_ulMinReadChunk);
+ HXLOGL2(HXLOG_AVIX,"CAVIStream[%p]::Seek()\tstream %d\tpacket time: %lu\t minreadchunk: %lu", this, m_usStream, ulTime, m_ulMinReadChunk);
if (IsAudio ())
{
WaveInfo* pWaveInfo = (WaveInfo*) m_pFormat;
@@ -1318,7 +1359,7 @@
// on success, returns an AddRef'd packet
IHXPacket* CAVIStream::GetNextPacket()
{
- //HX_TRACE("CAVIFileFormat::CAVIStream::GetNextPacket()\n");
+ HXLOGL4(HXLOG_AVIX,"CAVIStream[%p]::GetNextPacket()", this);
HX_ASSERT(m_state > ePreReader);
HX_ASSERT(m_ulPendingPacketRequests > 0);
HX_ASSERT(m_pNextPacket);
@@ -1350,6 +1391,8 @@
ulTime = (UINT32) ((m_ulMinReadChunk / m_fChunksPerSecond) * 1000);
}
+ HXLOGL4(HXLOG_AVIX,"CAVIStream[%p]::GetNextPacket()\tstream %d\tpacket time: %lu\t minreadchunk: %lu\n", this, m_usStream, ulTime, m_ulMinReadChunk);
+
// TODO: Set correct ASM rules
if (m_bEndianSwap16)
{
@@ -1409,7 +1452,7 @@
//
UINT32 CAVIStream::PeekPacketTime()
{
- //HX_TRACE("CAVIFileFormat::CAVIStream::GetNextPacketTime()\n");
+ HXLOGL4(HXLOG_AVIX,"CAVIStream[%p]::PeekPacketTime()", this);
if (m_pNextPacket)
{
return m_pNextPacket->GetTime();
@@ -1435,7 +1478,7 @@
//
void CAVIStream::GetNextSlice()
{
- //HX_TRACE("CAVIFileFormat::CAVIStream::GetNextSlice()\n");
+ HXLOGL4(HXLOG_AVIX,"CAVIStream[%p]::GetNextSlice()", this);
UINT32 ulNextChunkOffset;
HX_RESULT indexResult;
@@ -1475,7 +1518,7 @@
//
BOOL CAVIStream::CanPrefetchSlice()
{
- //HX_TRACE("CAVIFileFormat::CAVIStream::CanPrefetchSlice()\n");
+ HXLOGL4(HXLOG_AVIX,"CAVIStream[%p]::CanPrefetchSlice()", this);
return (m_ulMaxReadChunk - m_ulMinReadChunk < MAX_CHUNK_PREFETCH) && !m_bRead;
}
@@ -1484,7 +1527,7 @@
//
UINT32 CAVIStream::PeekPrefetchTime()
{
- //HX_TRACE("CAVIFileFormat::CAVIStream::PeekPrefetchSliceTime()\n");
+ HXLOGL4(HXLOG_AVIX,"CAVIStream[%p]::PeekPrefetchSliceTime()", this);
UINT32 ulTime;
if (IsAudio ())
@@ -1505,7 +1548,7 @@
//
BOOL CAVIStream::AtEndOfStream()
{
- //HX_TRACE("CAVIFileFormat::CAVIStream::AtEndOfStream()\n");
+ HXLOGL4(HXLOG_AVIX,"CAVIStream[%p]::AtEndOfStream()", this);
//HX_ASSERT( (m_state != eReady) || (m_pNextPacket && m_bRead)); // Currently we don't prime on init
return m_bRead;
}
@@ -1571,7 +1614,7 @@
// CRiffResponse
STDMETHODIMP CAVIStream::RIFFOpenDone(HX_RESULT status)
{
- //HX_TRACE("CAVIFileFormat::CAVIStream::RIFFOpenDone()\n");
+ HXLOGL4(HXLOG_AVIX,"CAVIStream[%p]::RIFFOpenDone()", this);
HX_ASSERT(m_state == ePreReader);
m_state = eReady;
@@ -1593,7 +1636,7 @@
STDMETHODIMP CAVIStream::RIFFFindChunkDone(HX_RESULT status, UINT32 len)
{
- //HX_TRACE("CAVIFileFormat::CAVIStream::RIFFFindChunkDone()\n");
+ HXLOGL4(HXLOG_AVIX,"CAVIStream[%p]::RIFFFindChunkDone()", this);
HX_ASSERT(m_state == eChunkFind);
HX_ASSERT(SUCCEEDED(status));
@@ -1636,7 +1679,7 @@
if (m_ulChunkReadTarget == m_ulMaxReadChunk)
{
- //HX_TRACE("\tstream: %d\toffset: %lu\n", m_usStream, m_pReader->GetOffset());
+ HXLOGL4(HXLOG_AVIX,"\tstream: %d\toffset: %lu", m_usStream, m_pReader->GetOffset());
if (m_bSeeking)
{
// Find the time of the next packet.
@@ -1653,7 +1696,7 @@
ulNextPacketTime = (UINT32) (((m_ulMaxReadChunk + 1)/ m_fChunksPerSecond) * 1000);
}
- if (ulNextPacketTime < m_ulSeekTime)
+ if (ulNextPacketTime <= m_ulSeekTime)
{
// Discard the packet.
m_ulChunkReadTarget++;
@@ -1702,7 +1745,7 @@
/* Called after a Descend completes */
STDMETHODIMP CAVIStream::RIFFDescendDone(HX_RESULT status)
{
- //HX_TRACE("CAVIFileFormat::CAVIStream::RIFFDescendDone()\n");
+ HXLOGL4(HXLOG_AVIX,"CAVIStream[%p]::RIFFDescendDone()", this);
HX_ASSERT(FALSE); // we don't support multiple MOVI chunks yet
return HXR_NOTIMPL;
}
@@ -1710,7 +1753,7 @@
/* Called after an Ascend completes */
STDMETHODIMP CAVIStream::RIFFAscendDone(HX_RESULT status)
{
- //HX_TRACE("CAVIFileFormat::CAVIStream::RIFFAscendDone()\n");
+ HXLOGL4(HXLOG_AVIX,"CAVIStream[%p]::RIFFAscendDone()", this);
HX_ASSERT(FALSE); // we don't support multiple MOVI chunks yet
return HXR_NOTIMPL;
}
@@ -1719,7 +1762,7 @@
*/
STDMETHODIMP CAVIStream::RIFFReadDone(HX_RESULT status, IHXBuffer *pBuffer)
{
- //HX_TRACE("CAVIFileFormat::CAVIStream::RIFFReadDone()\n");
+ HXLOGL4(HXLOG_AVIX,"CAVIStream[%p]::RIFFReadDone()", this);
HX_ASSERT(m_state == eChunkRead);
HX_ASSERT(CAVIFileFormat::GetStream(ENDIAN_SWAP_32(m_pReader->GetChunkType())) == m_usStream);
HX_ASSERT(m_ulChunkReadTarget == m_ulMaxReadChunk);
@@ -1817,7 +1860,7 @@
/* Called when a seek completes */
STDMETHODIMP CAVIStream::RIFFSeekDone(HX_RESULT status)
{
- //HX_TRACE("CAVIFileFormat::CAVIStream::RIFFSeekDone()\n");
+ HXLOGL4(HXLOG_AVIX,"CAVIStream[%p]::RIFFSeekDone()", this);
HX_ASSERT(m_state == eChunkSeek);
HX_ASSERT(SUCCEEDED(status));
@@ -1842,7 +1885,7 @@
STDMETHODIMP CAVIStream::RIFFGetChunkDone(HX_RESULT status, UINT32 chunkType,
IHXBuffer* pBuffer)
{
-//HX_TRACE("CAVIFileFormat::CAVIStream::RIFFGetChunkDone()\n");
+ HXLOGL4(HXLOG_AVIX,"CAVIStream[%p]::RIFFGetChunkDone()", this);
// HX_ASSERT(!"RIFFGetChunkDone is not used");
// return HXR_NOTIMPL;
@@ -1862,7 +1905,7 @@
IHXCommonClassFactory* pCommonClassFactory,
ULONG32 ulAvgBitRate, INT32 lRTPPayloadType)
{
- //HX_TRACE("CAVIFileFormat::CAVIStream::SetRuleBook()\n");
+ HXLOGL4(HXLOG_AVIX,"CAVIStream[%p]::SetRuleBook()", this);
if ( !pHeader || !pCommonClassFactory )
{
return FALSE;
@@ -1904,6 +1947,7 @@
void CAVIStream::Close()
{
+ HXLOGL2(HXLOG_AVIX,"CAVIStream[%p]::Close()", this);
if(m_pFile)
{
m_pFile->Close();
Index: datatype/avi/fileformat/plugin.cpp
===================================================================
RCS file: /cvsroot/datatype/avi/fileformat/plugin.cpp,v
retrieving revision 1.3
diff -u -w -r1.3 plugin.cpp
--- datatype/avi/fileformat/plugin.cpp 27 Sep 2005 20:08:07 -0000 1.3
+++ datatype/avi/fileformat/plugin.cpp 13 Nov 2008 20:08:23 -0000
@@ -48,6 +48,7 @@
#include "ihxtlogsystem.h"
#include "ihxtlogsystemcontext.h"
#include "hxdllaccess.h"
+#include "baseobj.h"
#include "riff.h"
#include "riffres.h"
@@ -61,12 +62,17 @@
ENABLE_MULTILOAD_DLLACCESS_PATHS(Avifformat);
#endif
-STDAPI ENTRYPOINT(HXCREATEINSTANCE)(IUnknown** ppIUnknown)
+STDAPI HXEXPORT ENTRYPOINT(HXCREATEINSTANCE)(IUnknown** ppIUnknown)
{
return CAVIFileFormat::HXCreateInstance(ppIUnknown);
}
-STDAPI ENTRYPOINT(CanUnload)(void)
+STDAPI HXEXPORT ENTRYPOINT(CanUnload2)(void)
{
- return CAVIFileFormat::CanUnload();
+ return (CHXBaseCountingObject::ObjectsActive() > 0 ? HXR_FAIL : HXR_OK);
+}
+
+STDAPI HXEXPORT ENTRYPOINT(CanUnload)(void)
+{
+ return ENTRYPOINT(CanUnload2)();
}
Index: datatype/avi/fileformat/pub/aviffpln.h
===================================================================
RCS file: /cvsroot/datatype/avi/fileformat/pub/aviffpln.h,v
retrieving revision 1.4
diff -u -w -r1.4 aviffpln.h
--- datatype/avi/fileformat/pub/aviffpln.h 14 Jun 2005 20:45:07 -0000 1.4
+++ datatype/avi/fileformat/pub/aviffpln.h 13 Nov 2008 20:08:23 -0000
@@ -124,7 +124,6 @@
public:
static HX_RESULT STDAPICALLTYPE HXCreateInstance(IUnknown** ppIUnknown);
- static HX_RESULT CanUnload();
CAVIFileFormat();
static BOOL IsAVChunk(UINT32 ulChunkId);
@@ -379,7 +378,7 @@
AVIState;
AVIState m_state;
- BOOL m_bSeekPriming;
+ HXBOOL m_bSeekPriming;
BOOL m_bLocalPlayback;
CHXPtrArray m_streamArray;
@@ -400,13 +399,13 @@
IUnknown* m_pContext;
IHXCommonClassFactory* m_pCommonClassFactory;
- static const char* zm_pDescription;
- static const char* zm_pCopyright;
- static const char* zm_pMoreInfoURL;
- static const char* zm_pFileMimeTypes[];
- static const char* zm_pFileExtensions[];
- static const char* zm_pFileOpenNames[];
- static const char* zm_pPacketFormats[];
+ static const char* const zm_pDescription;
+ static const char* const zm_pCopyright;
+ static const char* const zm_pMoreInfoURL;
+ static const char* const zm_pFileMimeTypes[];
+ static const char* const zm_pFileExtensions[];
+ static const char* const zm_pFileOpenNames[];
+ static const char* const zm_pPacketFormats[];
};
#endif // _AVIFFPLIN_H_
Index: datatype/avi/fileformat/pub/avistrm.h
===================================================================
RCS file: /cvsroot/datatype/avi/fileformat/pub/avistrm.h,v
retrieving revision 1.6
diff -u -w -r1.6 avistrm.h
--- datatype/avi/fileformat/pub/avistrm.h 9 Aug 2005 20:01:09 -0000 1.6
+++ datatype/avi/fileformat/pub/avistrm.h 13 Nov 2008 20:08:23 -0000
@@ -58,7 +58,8 @@
#define MAX_COLOR_TABLE_SIZE 256
#define MAX_CHUNK_PREFETCH 2
-#define PRIOR_SEEK_TIME 1500
+#define PRIOR_SEEK_TIME 0
+#define SIZE_OF_AVI_VIDEO_HEADER 48
class CAVIFileFormat;
class CAVIIndex;
Index: datatype/common/util/Umakefil
===================================================================
RCS file: /cvsroot/datatype/common/util/Umakefil,v
retrieving revision 1.12
diff -u -w -r1.12 Umakefil
--- datatype/common/util/Umakefil 29 Apr 2005 20:05:34 -0000 1.12
+++ datatype/common/util/Umakefil 13 Nov 2008 20:08:23 -0000
@@ -56,7 +56,8 @@
"common/dbgtool/pub",
"common/util/pub",
"common/container/pub",
- "common/runtime/pub")
+ "common/runtime/pub",
+ "common/log/logutil/pub")
project.AddSources("bitstream.cpp",
"bitpack.cpp",
Index: datatype/common/util/riff.cpp
===================================================================
RCS file: /cvsroot/datatype/common/util/riff.cpp,v
retrieving revision 1.12
diff -u -w -r1.12 riff.cpp
--- datatype/common/util/riff.cpp 14 Mar 2005 19:24:45 -0000 1.12
+++ datatype/common/util/riff.cpp 13 Nov 2008 20:08:23 -0000
@@ -45,6 +45,7 @@
#include "hxcomm.h"
#include "hxheap.h"
+#include "hxtlogutil.h"
#ifdef _DEBUG
#undef HX_THIS_FILE
static const char HX_THIS_FILE[] = __FILE__;
@@ -109,11 +110,14 @@
: m_pReassemblyBuffer(NULL)
, m_ulChunkBytesRead(0)
, m_ulChunkSize(0)
+ , m_ulChunkType(0)
{
m_pContext = pContext;
m_pResponse = pResponse;
m_pFileObject = pFileObject;
+ HXLOGL2(HXLOG_AVIX,"CRIFFReader[%p]::CRIFFReader CTOR ctx=%p resp=%p fob=%p", this,m_pContext,m_pResponse,m_pFileObject);
+
if ( m_pFileObject )
{
m_pFileObject->AddRef();
@@ -142,6 +146,7 @@
CRIFFReader::~CRIFFReader()
{
+ HXLOGL2(HXLOG_AVIX,"CRIFFReader[%p]::~CRIFFReader() DES ctx=%p resp=%p fob=%p", this,m_pContext,m_pResponse,m_pFileObject);
if ( m_bFileIsOpen )
Close();
@@ -211,6 +216,7 @@
HX_RESULT
CRIFFReader::Close()
{
+ HXLOGL2(HXLOG_AVIX,"CRIFFReader[%p]::Close() ctx=%p resp=%p fob=%p", this,m_pContext,m_pResponse,m_pFileObject);
if ( m_pFileObject )
{
m_pFileObject->Close();
@@ -565,10 +571,10 @@
}
if ( (m_ulFileType == RIFF_FILE_MAGIC_NUMBER) &&
- (m_ulGetChunkType == (UINT32)0) )
+ (m_ulChunkType == (UINT32)0) )
{
m_state = RS_Ready;
- m_pResponse->RIFFGetChunkDone(HXR_FAILED, 0, NULL);
+ m_pResponse->RIFFFindChunkDone(HXR_FAILED, 0);
return HXR_OK;
}
Index: datatype/common/util/pub/riffres.h
===================================================================
RCS file: /cvsroot/datatype/common/util/pub/riffres.h,v
retrieving revision 1.3
diff -u -w -r1.3 riffres.h
--- datatype/common/util/pub/riffres.h 9 Jul 2004 18:30:56 -0000 1.3
+++ datatype/common/util/pub/riffres.h 13 Nov 2008 20:08:23 -0000
@@ -50,7 +50,7 @@
#ifndef __RIFFRES_H__
#define __RIFFRES_H__
-class CRIFFResponse
+class CRIFFResponse : public IUnknown
{
public:
STDMETHOD(RIFFOpenDone)(HX_RESULT) PURE;
@@ -79,9 +79,6 @@
/* Called with the data from a GetChunk request */
STDMETHOD(RIFFGetChunkDone)(HX_RESULT, UINT32, IHXBuffer*) PURE;
- STDMETHOD(QueryInterface) (THIS_ REFIID riid, void** ppvObj) PURE;
- STDMETHOD_(ULONG32,AddRef) (THIS) PURE;
- STDMETHOD_(ULONG32,Release) (THIS) PURE;
};
#endif /* __RIFFRES_H_ */
Index: datatype/mdf/video/format/mp4/mdfmp4payloadformat.cpp
===================================================================
RCS file: /cvsroot/datatype/mdf/video/format/mp4/mdfmp4payloadformat.cpp,v
retrieving revision 1.2.2.17
diff -u -w -r1.2.2.17 mdfmp4payloadformat.cpp
--- datatype/mdf/video/format/mp4/mdfmp4payloadformat.cpp 6 Aug 2008 21:14:27 -0000 1.2.2.17
+++ datatype/mdf/video/format/mp4/mdfmp4payloadformat.cpp 13 Nov 2008 20:08:23 -0000
@@ -260,7 +260,7 @@
const TDesC8& CMP4PayloadFormatPluginDevice::GetVideoProfile() const
{
MDFVIDEOLOG_ENTERFN( "GetVideoProfile" );
- MDFVIDEOLOG_WRITE_FORMAT( " Profile for mp4 payload is %d", m_lProfile );
+ MDFVIDEOLOG_WRITE_FORMAT2( " Profile for mp4 payload is %d", m_lProfile );
MDFVIDEOLOG_LEAVEFN( "GetVideoProfile" );
// From ISO/IEC 14496-2 Annex G Table G-1
@@ -310,6 +310,7 @@
aPayloadFormatInfo.AppendMimeType( KVideoMimeTypeMP4ES, KVideoMimeTypeKeywordMP4 );
aPayloadFormatInfo.AppendMimeType( KVideoMimeTypeMP4RN, KVideoMimeTypeKeywordMP4 );
+ aPayloadFormatInfo.AppendMimeType( KVideoMimeTypeMP4DIVX, KVideoMimeTypeKeywordMP4 );
aPayloadFormatInfo.SetPayloadFormatId( KUidMP4PayloadFormatPluginDevice );
MDFVIDEOLOG_LEAVEFN( "SetVideoMimetypes" );
@@ -334,6 +335,14 @@
if( m_pMP4Depacketizer )
{
const TUint8* bitstreamheader = (const TUint8*) m_pMP4Depacketizer->GetBitstreamHeader();
+ MDFVIDEOLOG_WRITE_FORMAT( " bitstreamheader %x", bitstreamheader );
+ if(bitstreamheader == NULL)
+ {
+ pPictureHeader.iOptional = NULL;
+ retVal = TRUE;
+ }
+ else
+ {
TInt length = (TInt) m_pMP4Depacketizer->GetBitstreamHeaderSize();
TPtrC8* pStreamHeader = new TPtrC8( bitstreamheader, length );
@@ -341,6 +350,7 @@
pPictureHeader.iOptional = (TDesC8*) pStreamHeader;
retVal = TRUE;
}
+ }
//fill iSizeInMemory and iDisplayedRect fields of pPictureHeader
//must be placed here since width and height are found in
Index: datatype/mp3/renderer/mp3rend.cpp
===================================================================
RCS file: /cvsroot/datatype/mp3/renderer/mp3rend.cpp,v
retrieving revision 1.32
diff -u -w -r1.32 mp3rend.cpp
--- datatype/mp3/renderer/mp3rend.cpp 27 Sep 2005 16:10:23 -0000 1.32
+++ datatype/mp3/renderer/mp3rend.cpp 13 Nov 2008 20:08:24 -0000
@@ -347,11 +347,10 @@
// Check MIME type
IHXBuffer* pStringObj = NULL;
- m_pClassFactory->CreateInstance(CLSID_IHXBuffer,
- (void**)&pStringObj);
+ pStreamHeaderObj->GetPropertyCString("MimeType", pStringObj);
+
if (pStringObj)
{
- pStreamHeaderObj->GetPropertyCString("MimeType", pStringObj);
SetPacketFormat((const char*)(pStringObj->GetBuffer()));
// Check if we know these packets can be trusted. These
Index: datatype/mp4/audio/renderer/mp3decinfo.cpp
===================================================================
RCS file: /cvsroot/datatype/mp4/audio/renderer/mp3decinfo.cpp,v
retrieving revision 1.5
diff -u -w -r1.5 mp3decinfo.cpp
--- datatype/mp4/audio/renderer/mp3decinfo.cpp 14 Mar 2005 19:17:42 -0000 1.5
+++ datatype/mp4/audio/renderer/mp3decinfo.cpp 13 Nov 2008 20:08:24 -0000
@@ -42,7 +42,8 @@
if (pMimeType &&
(!strcmp(pMimeType, "audio/X-MP3-draft-00") ||
!strcmp(pMimeType, "audio/X-MP3-draft-00-RN") ||
- !strcmp(pMimeType, "audio/MPEG-ELEMENTARY")))
+ !strcmp(pMimeType, "audio/MPEG-ELEMENTARY") ||
+ !strcmp(pMimeType, "audio/rn-mpeg")))
{
bRet = TRUE;
}
Index: datatype/mp4/audio/renderer/mp4audio.cpp
===================================================================
RCS file: /cvsroot/datatype/mp4/audio/renderer/mp4audio.cpp,v
retrieving revision 1.23
diff -u -w -r1.23 mp4audio.cpp
--- datatype/mp4/audio/renderer/mp4audio.cpp 14 Mar 2005 19:17:42 -0000 1.23
+++ datatype/mp4/audio/renderer/mp4audio.cpp 13 Nov 2008 20:08:24 -0000
@@ -109,6 +109,7 @@
"audio/X-MP3-draft-00",
"audio/X-MP3-draft-00-RN",
"audio/MPEG-ELEMENTARY",
+ "audio/rn-mpeg",
#endif /* #if defined(HELIX_FEATURE_AUDIO_CODEC_MP3) */
NULL
};
Index: datatype/mp4/payload/mp4vpyld.cpp
===================================================================
RCS file: /cvsroot/datatype/mp4/payload/mp4vpyld.cpp,v
retrieving revision 1.18.2.1
diff -u -w -r1.18.2.1 mp4vpyld.cpp
--- datatype/mp4/payload/mp4vpyld.cpp 20 Dec 2006 10:41:48 -0000 1.18.2.1
+++ datatype/mp4/payload/mp4vpyld.cpp 13 Nov 2008 20:08:24 -0000
@@ -556,9 +556,15 @@
return retVal;
}
-HX_RESULT MP4VPayloadFormat::SetAssemblerHXAVIHeader(IHXValues* /* pHeader */)
+HX_RESULT MP4VPayloadFormat::SetAssemblerHXAVIHeader(IHXValues* pHeader)
{
- return HXR_OK;
+ HX_RESULT retVal = HXR_OK;
+
+ // We'll let decoder initialize with in-band bitstream
+ HX_VECTOR_DELETE(m_pBitstreamHeader);
+ m_ulBitstreamHeaderSize = 0;
+
+ return retVal;
}
STDMETHODIMP
-------------- next part --------------
Index: platform/symbian/symbianrecognizer.cpp
===================================================================
RCS file: /cvsroot/common/system/platform/symbian/symbianrecognizer.cpp,v
retrieving revision 1.2.156.5
diff -u -w -r1.2.156.5 symbianrecognizer.cpp
--- platform/symbian/symbianrecognizer.cpp 3 Jun 2008 17:15:29 -0000 1.2.156.5
+++ platform/symbian/symbianrecognizer.cpp 14 Nov 2008 15:02:40 -0000
@@ -155,6 +155,40 @@
return bRet;
}
+static HXBOOL IsAVIHeader(const TDesC& fileName,
+ const TDesC8& fileBuf,
+ TDataType &type)
+{
+ // known header for AVI file.
+ // we are looking for "RIFF????AVI" pattern
+ _LIT8(KRIFFType , "RIFF" );
+ _LIT8(KAVIType , "AVI" );
+
+ // mime types can be returned.
+ _LIT8(KAVIFile , "application/x-pn-avi-plugin" );
+
+ if (fileBuf.Length() < 11)
+ {
+ return FALSE;
+ }
+
+ HXBOOL bRet = TRUE;
+
+ TPtrC8 riffBuffer = fileBuf.Mid(0, 4);
+ TPtrC8 aviBuffer = fileBuf.Mid(8, 3);
+
+ if ((riffBuffer.FindF(KRIFFType) != KErrNotFound) &&
+ (aviBuffer.FindF(KAVIType) != KErrNotFound))
+ {
+ type = TDataType(KAVIFile);
+ }
+ else
+ {
+ bRet = FALSE;
+ }
+ return bRet;
+}
+
static TInt DoGetMimeType(const TDesC& fileName,
const TDesC8& fileBuf,
@@ -175,6 +209,10 @@
{
return ret;
}
+ else if (IsAVIHeader(fileName, fileBuf, type))
+ {
+ return ret;
+ }
else
{
// check if system recognizer has been disabled.
Index: metadataeng/engine/platform/symbian/hxthumbnail_dlls.txt
===================================================================
RCS file: /cvsroot/datatype/tools/metadataeng/engine/platform/symbian/hxthumbnail_dlls.txt,v
retrieving revision 1.1
diff -u -w -r1.1 hxthumbnail_dlls.txt
--- metadataeng/engine/platform/symbian/hxthumbnail_dlls.txt 24 Jan 2008 17:22:57 -0000 1.1
+++ metadataeng/engine/platform/symbian/hxthumbnail_dlls.txt 14 Nov 2008 15:04:04 -0000
@@ -3,3 +3,4 @@
smplfsys.dll
asfff.dll
mdfvidrender.dll
+avifformat.dll
From ehyche at real.com Fri Nov 14 08:10:09 2008
From: ehyche at real.com (Eric Hyche)
Date: Fri Nov 14 06:13:13 2008
Subject: [datatype-dev] RE: [Nokia-private-dev] CR needed: REQ 403-11594,
SUB 417-12093: Helix engine support for the AVI file
format (210Cays)
In-Reply-To:
References:
Message-ID: <009d01c94673$78c43e00$6a4cba00$@com>
Yury,
I noticed you build avifformat.dll. Do you guys include
datatype/group/video (vidplin.dll) in your installer?
We generally include the AVI fileformat in the datatype/group/video
instead of building a separate .dll for it. However, whichever
way you guys want to do it is fine. Just FYI.
Can you tell me specifically what files are being changed on HEAD?
+STDAPI HXEXPORT ENTRYPOINT(HXCREATEINSTANCE)(IUnknown** ppIUnknown)
On HEAD and 310Atlas, entrypoints should be defined like this:
+STDAPI ENTRYPOINTCALLTYPE ENTRYPOINT(HXCREATEINSTANCE)(IUnknown** ppIUnknown)
Changes in general look good, but I'd like to take
a closer look at the files which are changing on HEAD.
Eric
=======================================
Eric Hyche (ehyche@real.com)
Principal Engineer
RealNetworks, Inc.
>-----Original Message-----
>From: nokia-private-dev-bounces@helixcommunity.org [mailto:nokia-private-dev-
>bounces@helixcommunity.org] On Behalf Of Yury.Ramanovich@nokia.com
>Sent: Friday, November 14, 2008 10:19 AM
>To: datatype-dev@helixcommunity.org; client-dev@helixcommunity.org; nokia-private-
>dev@helixcommunity.org
>Subject: [Nokia-private-dev] CR needed: REQ 403-11594, SUB 417-12093: Helix engine support for the AVI
>file format (210Cays)
>
>Modified by: yury.ramanovich@nokia.com
>
>Reviewed by:
>
>Date: 11/14/2008
>
>Project: SymbianMmf_rel
>
>ErrorId: REQ 403-11594 Helix support for AVI file parsing;
> SUB 417-12093: Helix engine support for the AVI file format
>
>Synopsis: this is port of helix AVI fileformat support from atlas310 branch to Cays210
>
>Overview: 1) added datatype_avi_fileformat to dependlist for symbian_mmf_client module; added symbian
>platform to includeplatforms for datatype_avi_fileformat module in hxclient_2_1_0_cayennes.bif and
>helix.bif;
>
>2) merged datatype/avi/fileformat and datatype\common\util\riff.cpp changes/fixes from from atlas310.
>3) add helix logging in aviffpln.cpp, aviindx.cpp, avistrm.cpp and datatype\common\util\riff.cpp; to
>see AVI logs, AVIX filter needs to be added to
>clientapps\symbiancommon\config\R1_Mobile_4_0_Factory.cfg
>
>4) to fix global data problem -> removed usage of global variable g_nRefCount_avif in aviffpln.cpp,
>used CHXBaseCountingObject instead; also replaced CAVIFileFormat::CanUnload() with CanUnload()
>function in plugin.cpp; Also CanUnload() function now calls CanUnload2()
>
>5) added const to CAVIFileFormat::zm_pDescription and similar variables to fix static uninitialized
>data problems
>6) fixed winscw build buster while building aviffpln.lib caused by extra forward slash in a module
>include path in datatype\avi\fileformat\avifflib
>
>7) added several avi file mimetypes to CAVIFileFormat::zm_pFileMimeTypes
>
>8) added IMPLEMENTATION_INFO structure for Helix AVI Fileformat to
>clientapps\symbianMmf\videocontroller\101F8513.rss to enable avi support on Symbian
>
>9) added avifformat to clientapps\symbianMmf\videocontroller\installMMF.pcf
>
>10) changed CRIFFResponse class to inherit from Iunknown. Consequently, removed QueryInterface(),
>AddRef() and Release() methods from CRIFFResponse class since they are already declared in Iunknown.
>This fixes HX_ASSERT failure during seek or end of playback. Where CAVIIndex::RIFFFindChunkDone()
>method was called in wrong state. The reason for ASSERT is that when Release() is called on CAVIIndex
>it caused CAVIIndex::RIFFFindChunkDone to be called instead; CAVIIndex inherits from CRIFFResponse and
>implements Release() method, but on Symbian HX_ReleaseFunc casts all objects to Iunknown, so to find
>implementation of Release() the 3rd method in virtual table for CRIFFResponse was picked, which
>happened to be RIFFFindChunkDone() instead of Release().
>
>11) fixed a few memory leaks: in CRnMp3Ren::OnHeader() merged the memory leak fix from Atlas310
>branch; in HXFileSystemManager::ProcessGetRelativeFileObjectPending() release m_pSamePool before QI-
>ing it.
>
>12) in CMP4PayloadFormatPluginDevice::SetVideoMimetypes, append "video/X-HX-DIVX" mimetype to
>payloadinfo list of mimetypes to enable matching the MPEG4 video decoder to this mimetype.
>
>in MP4VPayloadFormat::SetAssemblerHXAVIHeader() delete and set m_pBitstreamHeader to NULL; so that
>CMP4PayloadFormatPluginDevice::FormPictureHeader() will set pPictureHeader.iOptional to NULL to let
>the decoder initialize itself with first frame.
>
>13) add "audio/rn-mpeg" mimetype to CMP4AudioRenderer::zm_pStreamMimeTypes[] and to
>CMP3DecInfo::IsMatch() to enable mp3 audio playback in .avi files via CMP4AudioRenderer
>
>14) added AVI file recognition in symbianrecognizer.cpp and avifformat.dll to hxthumbnail_dlls.txt to
>enable .AVI thumbnails displayed.
>
>
>Files modified:
>/common/build/BIF/helix.bif
>/client/build/BIF/hxclient_2_1_0_cayennes.bif
>/client/common/system/hxfsmgr.cpp
>/clientapps/symbianMmf/videocontroller/101F8513.rss
>/clientapps/symbianMmf/videocontroller/installMMF.pcf
>/datatype/avi/fileformat/Umakefil
>/datatype/avi/fileformat/aviffdll
>/datatype/avi/fileformat/avifflib
>/datatype/avi/fileformat/aviffpln.cpp
>/datatype/avi/fileformat/aviindx.cpp
>/datatype/avi/fileformat/avistrm.cpp
>/datatype/avi/fileformat/plugin.cpp
>/datatype/avi/fileformat/pub/aviffpln.h
>/datatype/avi/fileformat/pub/avistrm.h
>/datatype/common/util/Umakefil
>/datatype/common/util/riff.cpp
>/datatype/common/util/pub/riffres.h
>/datatype/mdf/video/format/mp4/mdfmp4payloadformat.cpp
>/datatype/mp3/renderer/mp3rend.cpp
>/datatype/mp4/audio/renderer/mp3decinfo.cpp
>/datatype/mp4/audio/renderer/mp4audio.cpp
>/datatype/mp4/payload/mp4vpyld.cpp
>/common/system/platform/symbian/symbianrecognizer.cpp
>/datatype/tools/metadataeng/engine/platform/symbian/hxthumbnail_dlls.txt
>
>Files added:
>None.
>
>CVS diff
><>
><>
>
>Image Size and Heap Use impact: +47KB
>
>Module Release testing (STIF) : yes
>
>Test case(s) Added : No
>
>Memory leak check performed : Yes. No new memory leaks introduced.
>
>Platforms and Profiles Build Verified: helix-client-s60-50-mmf-mdf-arm
>
>Platforms and Profiles Functionality verified: armv5, winscw
>
>Branch: 210Cays, HEAD
From Yury.Ramanovich at nokia.com Fri Nov 14 08:40:20 2008
From: Yury.Ramanovich at nokia.com (Yury.Ramanovich@nokia.com)
Date: Fri Nov 14 06:43:31 2008
Subject: [datatype-dev] RE: [Nokia-private-dev] CR needed: REQ 403-11594,
SUB 417-12093: Helix engine support for the AVI file
format (210Cays)
In-Reply-To: <009d01c94673$78c43e00$6a4cba00$@com>
References:
<009d01c94673$78c43e00$6a4cba00$@com>
Message-ID:
HI Eric
We do build both avifformat.dll and aviffpln.lib but currently we use
avifformat.dll. We don't build vidplin.dll for our installation.
I'll send you HEAD changes shortly
Yury
>-----Original Message-----
>From: ext Eric Hyche [mailto:ehyche@real.com]
>Sent: Friday, November 14, 2008 10:10 AM
>To: Ramanovich Yury (Nokia-D-MSW/Dallas);
>datatype-dev@helixcommunity.org;
>client-dev@helixcommunity.org; nokia-private-dev@helixcommunity.org
>Subject: RE: [Nokia-private-dev] CR needed: REQ 403-11594, SUB
>417-12093: Helix engine support for the AVI file format (210Cays)
>
>Yury,
>
>I noticed you build avifformat.dll. Do you guys include
>datatype/group/video (vidplin.dll) in your installer?
>We generally include the AVI fileformat in the
>datatype/group/video instead of building a separate .dll for
>it. However, whichever way you guys want to do it is fine. Just FYI.
>
>Can you tell me specifically what files are being changed on HEAD?
>
>+STDAPI HXEXPORT ENTRYPOINT(HXCREATEINSTANCE)(IUnknown** ppIUnknown)
>
>On HEAD and 310Atlas, entrypoints should be defined like this:
>
>+STDAPI ENTRYPOINTCALLTYPE ENTRYPOINT(HXCREATEINSTANCE)(IUnknown**
>+ppIUnknown)
>
>Changes in general look good, but I'd like to take a closer
>look at the files which are changing on HEAD.
>
>Eric
>
>=======================================
>Eric Hyche (ehyche@real.com)
>Principal Engineer
>RealNetworks, Inc.
>
>
>>-----Original Message-----
>>From: nokia-private-dev-bounces@helixcommunity.org
>>[mailto:nokia-private-dev- bounces@helixcommunity.org] On Behalf Of
>>Yury.Ramanovich@nokia.com
>>Sent: Friday, November 14, 2008 10:19 AM
>>To: datatype-dev@helixcommunity.org; client-dev@helixcommunity.org;
>>nokia-private- dev@helixcommunity.org
>>Subject: [Nokia-private-dev] CR needed: REQ 403-11594, SUB 417-12093:
>>Helix engine support for the AVI file format (210Cays)
>>
>>Modified by: yury.ramanovich@nokia.com
>>
>>Reviewed by:
>>
>>Date: 11/14/2008
>>
>>Project: SymbianMmf_rel
>>
>>ErrorId: REQ 403-11594 Helix support for AVI file parsing;
>> SUB 417-12093: Helix engine support for the AVI file format
>>
>>Synopsis: this is port of helix AVI fileformat support from atlas310
>>branch to Cays210
>>
>>Overview: 1) added datatype_avi_fileformat to dependlist for
>>symbian_mmf_client module; added symbian platform to includeplatforms
>>for datatype_avi_fileformat module in
>hxclient_2_1_0_cayennes.bif and
>>helix.bif;
>>
>>2) merged datatype/avi/fileformat and
>datatype\common\util\riff.cpp changes/fixes from from atlas310.
>>3) add helix logging in aviffpln.cpp, aviindx.cpp, avistrm.cpp and
>>datatype\common\util\riff.cpp; to see AVI logs, AVIX filter
>needs to be
>>added to clientapps\symbiancommon\config\R1_Mobile_4_0_Factory.cfg
>>
>>4) to fix global data problem -> removed usage of global variable
>>g_nRefCount_avif in aviffpln.cpp, used CHXBaseCountingObject instead;
>>also replaced CAVIFileFormat::CanUnload() with CanUnload()
>function in
>>plugin.cpp; Also CanUnload() function now calls CanUnload2()
>>
>>5) added const to CAVIFileFormat::zm_pDescription and similar
>variables
>>to fix static uninitialized data problems
>>6) fixed winscw build buster while building aviffpln.lib caused by
>>extra forward slash in a module include path in
>>datatype\avi\fileformat\avifflib
>>
>>7) added several avi file mimetypes to
>>CAVIFileFormat::zm_pFileMimeTypes
>>
>>8) added IMPLEMENTATION_INFO structure for Helix AVI Fileformat to
>>clientapps\symbianMmf\videocontroller\101F8513.rss to enable avi
>>support on Symbian
>>
>>9) added avifformat to
>>clientapps\symbianMmf\videocontroller\installMMF.pcf
>>
>>10) changed CRIFFResponse class to inherit from Iunknown.
>Consequently,
>>removed QueryInterface(),
>>AddRef() and Release() methods from CRIFFResponse class since
>they are already declared in Iunknown.
>>This fixes HX_ASSERT failure during seek or end of playback. Where
>>CAVIIndex::RIFFFindChunkDone() method was called in wrong state. The
>>reason for ASSERT is that when Release() is called on CAVIIndex it
>>caused CAVIIndex::RIFFFindChunkDone to be called instead; CAVIIndex
>>inherits from CRIFFResponse and implements Release() method, but on
>>Symbian HX_ReleaseFunc casts all objects to Iunknown, so to
>find implementation of Release() the 3rd method in virtual
>table for CRIFFResponse was picked, which happened to be
>RIFFFindChunkDone() instead of Release().
>>
>>11) fixed a few memory leaks: in CRnMp3Ren::OnHeader() merged the
>>memory leak fix from Atlas310 branch; in
>>HXFileSystemManager::ProcessGetRelativeFileObjectPending()
>release m_pSamePool before QI- ing it.
>>
>>12) in CMP4PayloadFormatPluginDevice::SetVideoMimetypes, append
>>"video/X-HX-DIVX" mimetype to payloadinfo list of mimetypes
>to enable matching the MPEG4 video decoder to this mimetype.
>>
>>in MP4VPayloadFormat::SetAssemblerHXAVIHeader() delete and set
>>m_pBitstreamHeader to NULL; so that
>>CMP4PayloadFormatPluginDevice::FormPictureHeader() will set
>>pPictureHeader.iOptional to NULL to let the decoder
>initialize itself with first frame.
>>
>>13) add "audio/rn-mpeg" mimetype to
>>CMP4AudioRenderer::zm_pStreamMimeTypes[] and to
>>CMP3DecInfo::IsMatch() to enable mp3 audio playback in .avi files via
>>CMP4AudioRenderer
>>
>>14) added AVI file recognition in symbianrecognizer.cpp and
>>avifformat.dll to hxthumbnail_dlls.txt to enable .AVI
>thumbnails displayed.
>>
>>
>>Files modified:
>>/common/build/BIF/helix.bif
>>/client/build/BIF/hxclient_2_1_0_cayennes.bif
>>/client/common/system/hxfsmgr.cpp
>>/clientapps/symbianMmf/videocontroller/101F8513.rss
>>/clientapps/symbianMmf/videocontroller/installMMF.pcf
>>/datatype/avi/fileformat/Umakefil
>>/datatype/avi/fileformat/aviffdll
>>/datatype/avi/fileformat/avifflib
>>/datatype/avi/fileformat/aviffpln.cpp
>>/datatype/avi/fileformat/aviindx.cpp
>>/datatype/avi/fileformat/avistrm.cpp
>>/datatype/avi/fileformat/plugin.cpp
>>/datatype/avi/fileformat/pub/aviffpln.h
>>/datatype/avi/fileformat/pub/avistrm.h
>>/datatype/common/util/Umakefil
>>/datatype/common/util/riff.cpp
>>/datatype/common/util/pub/riffres.h
>>/datatype/mdf/video/format/mp4/mdfmp4payloadformat.cpp
>>/datatype/mp3/renderer/mp3rend.cpp
>>/datatype/mp4/audio/renderer/mp3decinfo.cpp
>>/datatype/mp4/audio/renderer/mp4audio.cpp
>>/datatype/mp4/payload/mp4vpyld.cpp
>>/common/system/platform/symbian/symbianrecognizer.cpp
>>/datatype/tools/metadataeng/engine/platform/symbian/hxthumbnai
>l_dlls.tx
>>t
>>
>>Files added:
>>None.
>>
>>CVS diff
>><>
>><>
>>
>>Image Size and Heap Use impact: +47KB
>>
>>Module Release testing (STIF) : yes
>>
>>Test case(s) Added : No
>>
>>Memory leak check performed : Yes. No new memory leaks introduced.
>>
>>Platforms and Profiles Build Verified: helix-client-s60-50-mmf-mdf-arm
>>
>>Platforms and Profiles Functionality verified: armv5, winscw
>>
>>Branch: 210Cays, HEAD
>
>
>
From gwright at real.com Fri Nov 14 09:32:02 2008
From: gwright at real.com (Greg Wright)
Date: Fri Nov 14 07:35:02 2008
Subject: [datatype-dev] CR: build break fix
In-Reply-To: <6.2.1.2.2.20081113121602.041def58@mailone.real.com>
References: <6.2.1.2.2.20081113121602.041def58@mailone.real.com>
Message-ID: <491DB612.4080206@real.com>
Looks fine.
--greg.
Stanislav Bobrovskiy wrote:
> Synopsis:
> Yesterday's changes in datatype/mp4/payload broke the build on atlas310
> branch.
>
> Overview:
> Adding missing library and undefined IIDs.
>
> Files Added
> None
>
> Files Modified:
> datatype/mp4/fileformat/dllumakefil
> datatype/mp4/fileformat/plugin.cpp
>
> Branch:
> atlas310
>
> Files Attached:
> datatype_mp4.diff
>
>
> ------------------------------------------------------------------------
>
> _______________________________________________
> Datatype-dev mailing list
> Datatype-dev@helixcommunity.org
> http://lists.helixcommunity.org/mailman/listinfo/datatype-dev
From Yury.Ramanovich at nokia.com Fri Nov 14 10:29:28 2008
From: Yury.Ramanovich at nokia.com (Yury.Ramanovich@nokia.com)
Date: Fri Nov 14 08:33:18 2008
Subject: [datatype-dev] RE: [Nokia-private-dev] CR needed: REQ 403-11594,
SUB 417-12093: Helix engine support for the AVI file
format (210Cays)
In-Reply-To:
References: <009d01c94673$78c43e00$6a4cba00$@com>
Message-ID:
HI Eric
Heres the HEAD diff
And the list of files changed on HEAD
/client/common/system/hxfsmgr.cpp,v
/clientapps/symbianMmf/videocontroller/101F8513.rss,v
/clientapps/symbianMmf/videocontroller/installMMF.pcf,v
/common/include/platform.h,v
/common/system/platform/symbian/symbianrecognizer.cpp,v
/datatype/avi/fileformat/aviffdll,v
/datatype/avi/fileformat/avifflib,v
/datatype/avi/fileformat/aviffpln.cpp,v
/datatype/avi/fileformat/aviindx.cpp,v
/datatype/avi/fileformat/avistrm.cpp,v
/datatype/avi/fileformat/plugin.cpp,v
/datatype/avi/fileformat/pub/aviffpln.h,v
/datatype/common/util/Umakefil,v
/datatype/common/util/riff.cpp,v
/datatype/common/util/pub/riffres.h,v
/datatype/mdf/video/format/mp4/mdfmp4payloadformat.cpp,v
/datatype/mp4/audio/renderer/mp3decinfo.cpp,v
/datatype/mp4/audio/renderer/mp4audio.cpp,v
/datatype/mp4/payload/mp4vpyld.cpp,v
/datatype/tools/metadataeng/engine/platform/symbian/hxthumbnail_dlls.txt
,v
Thanks
Yury
>-----Original Message-----
>From: nokia-private-dev-bounces@helixcommunity.org
>[mailto:nokia-private-dev-bounces@helixcommunity.org] On
>Behalf Of ext Yury.Ramanovich@nokia.com
>Sent: Friday, November 14, 2008 10:40 AM
>To: ehyche@real.com; datatype-dev@helixcommunity.org;
>client-dev@helixcommunity.org; nokia-private-dev@helixcommunity.org
>Subject: RE: [Nokia-private-dev] CR needed: REQ 403-11594,SUB
>417-12093: Helix engine support for the AVI file format (210Cays)
>
>HI Eric
>
>We do build both avifformat.dll and aviffpln.lib but currently we use
>avifformat.dll. We don't build vidplin.dll for our installation.
>
>
> I'll send you HEAD changes shortly
>
>Yury
>
>>-----Original Message-----
>>From: ext Eric Hyche [mailto:ehyche@real.com]
>>Sent: Friday, November 14, 2008 10:10 AM
>>To: Ramanovich Yury (Nokia-D-MSW/Dallas);
>>datatype-dev@helixcommunity.org; client-dev@helixcommunity.org;
>>nokia-private-dev@helixcommunity.org
>>Subject: RE: [Nokia-private-dev] CR needed: REQ 403-11594, SUB
>>417-12093: Helix engine support for the AVI file format (210Cays)
>>
>>Yury,
>>
>>I noticed you build avifformat.dll. Do you guys include
>>datatype/group/video (vidplin.dll) in your installer?
>>We generally include the AVI fileformat in the datatype/group/video
>>instead of building a separate .dll for it. However,
>whichever way you
>>guys want to do it is fine. Just FYI.
>>
>>Can you tell me specifically what files are being changed on HEAD?
>>
>>+STDAPI HXEXPORT ENTRYPOINT(HXCREATEINSTANCE)(IUnknown** ppIUnknown)
>>
>>On HEAD and 310Atlas, entrypoints should be defined like this:
>>
>>+STDAPI ENTRYPOINTCALLTYPE ENTRYPOINT(HXCREATEINSTANCE)(IUnknown**
>>+ppIUnknown)
>>
>>Changes in general look good, but I'd like to take a closer
>look at the
>>files which are changing on HEAD.
>>
>>Eric
>>
>>=======================================
>>Eric Hyche (ehyche@real.com)
>>Principal Engineer
>>RealNetworks, Inc.
>>
>>
>>>-----Original Message-----
>>>From: nokia-private-dev-bounces@helixcommunity.org
>>>[mailto:nokia-private-dev- bounces@helixcommunity.org] On Behalf Of
>>>Yury.Ramanovich@nokia.com
>>>Sent: Friday, November 14, 2008 10:19 AM
>>>To: datatype-dev@helixcommunity.org; client-dev@helixcommunity.org;
>>>nokia-private- dev@helixcommunity.org
>>>Subject: [Nokia-private-dev] CR needed: REQ 403-11594, SUB
>417-12093:
>>>Helix engine support for the AVI file format (210Cays)
>>>
>>>Modified by: yury.ramanovich@nokia.com
>>>
>>>Reviewed by:
>>>
>>>Date: 11/14/2008
>>>
>>>Project: SymbianMmf_rel
>>>
>>>ErrorId: REQ 403-11594 Helix support for AVI file parsing;
>>> SUB 417-12093: Helix engine support for the AVI file format
>>>
>>>Synopsis: this is port of helix AVI fileformat support from atlas310
>>>branch to Cays210
>>>
>>>Overview: 1) added datatype_avi_fileformat to dependlist for
>>>symbian_mmf_client module; added symbian platform to
>includeplatforms
>>>for datatype_avi_fileformat module in
>>hxclient_2_1_0_cayennes.bif and
>>>helix.bif;
>>>
>>>2) merged datatype/avi/fileformat and
>>datatype\common\util\riff.cpp changes/fixes from from atlas310.
>>>3) add helix logging in aviffpln.cpp, aviindx.cpp, avistrm.cpp and
>>>datatype\common\util\riff.cpp; to see AVI logs, AVIX filter
>>needs to be
>>>added to clientapps\symbiancommon\config\R1_Mobile_4_0_Factory.cfg
>>>
>>>4) to fix global data problem -> removed usage of global variable
>>>g_nRefCount_avif in aviffpln.cpp, used CHXBaseCountingObject
>instead;
>>>also replaced CAVIFileFormat::CanUnload() with CanUnload()
>>function in
>>>plugin.cpp; Also CanUnload() function now calls CanUnload2()
>>>
>>>5) added const to CAVIFileFormat::zm_pDescription and similar
>>variables
>>>to fix static uninitialized data problems
>>>6) fixed winscw build buster while building aviffpln.lib caused by
>>>extra forward slash in a module include path in
>>>datatype\avi\fileformat\avifflib
>>>
>>>7) added several avi file mimetypes to
>>>CAVIFileFormat::zm_pFileMimeTypes
>>>
>>>8) added IMPLEMENTATION_INFO structure for Helix AVI Fileformat to
>>>clientapps\symbianMmf\videocontroller\101F8513.rss to enable avi
>>>support on Symbian
>>>
>>>9) added avifformat to
>>>clientapps\symbianMmf\videocontroller\installMMF.pcf
>>>
>>>10) changed CRIFFResponse class to inherit from Iunknown.
>>Consequently,
>>>removed QueryInterface(),
>>>AddRef() and Release() methods from CRIFFResponse class since
>>they are already declared in Iunknown.
>>>This fixes HX_ASSERT failure during seek or end of playback. Where
>>>CAVIIndex::RIFFFindChunkDone() method was called in wrong state. The
>>>reason for ASSERT is that when Release() is called on CAVIIndex it
>>>caused CAVIIndex::RIFFFindChunkDone to be called instead; CAVIIndex
>>>inherits from CRIFFResponse and implements Release() method, but on
>>>Symbian HX_ReleaseFunc casts all objects to Iunknown, so to
>>find implementation of Release() the 3rd method in virtual table for
>>CRIFFResponse was picked, which happened to be
>>RIFFFindChunkDone() instead of Release().
>>>
>>>11) fixed a few memory leaks: in CRnMp3Ren::OnHeader() merged the
>>>memory leak fix from Atlas310 branch; in
>>>HXFileSystemManager::ProcessGetRelativeFileObjectPending()
>>release m_pSamePool before QI- ing it.
>>>
>>>12) in CMP4PayloadFormatPluginDevice::SetVideoMimetypes, append
>>>"video/X-HX-DIVX" mimetype to payloadinfo list of mimetypes
>>to enable matching the MPEG4 video decoder to this mimetype.
>>>
>>>in MP4VPayloadFormat::SetAssemblerHXAVIHeader() delete and set
>>>m_pBitstreamHeader to NULL; so that
>>>CMP4PayloadFormatPluginDevice::FormPictureHeader() will set
>>>pPictureHeader.iOptional to NULL to let the decoder
>>initialize itself with first frame.
>>>
>>>13) add "audio/rn-mpeg" mimetype to
>>>CMP4AudioRenderer::zm_pStreamMimeTypes[] and to
>>>CMP3DecInfo::IsMatch() to enable mp3 audio playback in .avi
>files via
>>>CMP4AudioRenderer
>>>
>>>14) added AVI file recognition in symbianrecognizer.cpp and
>>>avifformat.dll to hxthumbnail_dlls.txt to enable .AVI
>>thumbnails displayed.
>>>
>>>
>>>Files modified:
>>>/common/build/BIF/helix.bif
>>>/client/build/BIF/hxclient_2_1_0_cayennes.bif
>>>/client/common/system/hxfsmgr.cpp
>>>/clientapps/symbianMmf/videocontroller/101F8513.rss
>>>/clientapps/symbianMmf/videocontroller/installMMF.pcf
>>>/datatype/avi/fileformat/Umakefil
>>>/datatype/avi/fileformat/aviffdll
>>>/datatype/avi/fileformat/avifflib
>>>/datatype/avi/fileformat/aviffpln.cpp
>>>/datatype/avi/fileformat/aviindx.cpp
>>>/datatype/avi/fileformat/avistrm.cpp
>>>/datatype/avi/fileformat/plugin.cpp
>>>/datatype/avi/fileformat/pub/aviffpln.h
>>>/datatype/avi/fileformat/pub/avistrm.h
>>>/datatype/common/util/Umakefil
>>>/datatype/common/util/riff.cpp
>>>/datatype/common/util/pub/riffres.h
>>>/datatype/mdf/video/format/mp4/mdfmp4payloadformat.cpp
>>>/datatype/mp3/renderer/mp3rend.cpp
>>>/datatype/mp4/audio/renderer/mp3decinfo.cpp
>>>/datatype/mp4/audio/renderer/mp4audio.cpp
>>>/datatype/mp4/payload/mp4vpyld.cpp
>>>/common/system/platform/symbian/symbianrecognizer.cpp
>>>/datatype/tools/metadataeng/engine/platform/symbian/hxthumbnai
>>l_dlls.tx
>>>t
>>>
>>>Files added:
>>>None.
>>>
>>>CVS diff
>>><>
>>><>
>>>
>>>Image Size and Heap Use impact: +47KB
>>>
>>>Module Release testing (STIF) : yes
>>>
>>>Test case(s) Added : No
>>>
>>>Memory leak check performed : Yes. No new memory leaks introduced.
>>>
>>>Platforms and Profiles Build Verified:
>helix-client-s60-50-mmf-mdf-arm
>>>
>>>Platforms and Profiles Functionality verified: armv5, winscw
>>>
>>>Branch: 210Cays, HEAD
>>
>>
>>
>
>_______________________________________________
>Nokia-private-dev mailing list
>Nokia-private-dev@helixcommunity.org
>http://lists.helixcommunity.org/mailman/listinfo/nokia-private-dev
>
-------------- next part --------------
? Umakefil.upp
? avi_HEAD_diff.txt
? build.out
? build.reg
? hxcleanup.bat
? ribosome_logs
Index: client/common/system/hxfsmgr.cpp
===================================================================
RCS file: /cvsroot/client/common/system/hxfsmgr.cpp,v
retrieving revision 1.17
diff -u -w -r1.17 hxfsmgr.cpp
--- client/common/system/hxfsmgr.cpp 6 Jul 2007 21:58:03 -0000 1.17
+++ client/common/system/hxfsmgr.cpp 14 Nov 2008 18:16:08 -0000
@@ -779,6 +779,8 @@
if (!m_pOriginalObject)
goto exit;
+ HX_RELEASE(m_pSamePool);
+
if(HXR_OK != m_pOriginalObject->QueryInterface(IID_IHXGetFileFromSamePool,
(void**)&m_pSamePool))
{
Index: clientapps/symbianMmf/videocontroller/101F8513.rss
===================================================================
RCS file: /cvsroot/clientapps/symbianMmf/videocontroller/101F8513.rss,v
retrieving revision 1.11
diff -u -w -r1.11 101F8513.rss
--- clientapps/symbianMmf/videocontroller/101F8513.rss 26 Jul 2007 00:14:51 -0000 1.11
+++ clientapps/symbianMmf/videocontroller/101F8513.rss 14 Nov 2008 18:16:16 -0000
@@ -137,6 +137,16 @@
default_data = "?";
opaque_data = "Real0x101f5d07.xpsv=?\nv=?\r\napplication/x-ext-packetsrc";
rom_only = ROM_ONLY_FLAG;
+ },
+ IMPLEMENTATION_INFO
+ {
+ // AVI
+ implementation_uid = 0x2001E2E8;
+ version_no = 1;
+ display_name = "Helix AVI File Format";
+ default_data = "?";
+ opaque_data = "Real0x101f5d07.aviRIFF????AVIapplication/x-pn-avi-pluginvideo/avivideo/x-msvideovideo/msvideo";
+ rom_only = ROM_ONLY_FLAG;
}
};
}
Index: clientapps/symbianMmf/videocontroller/installMMF.pcf
===================================================================
RCS file: /cvsroot/clientapps/symbianMmf/videocontroller/installMMF.pcf,v
retrieving revision 1.26
diff -u -w -r1.26 installMMF.pcf
--- clientapps/symbianMmf/videocontroller/installMMF.pcf 25 Mar 2008 20:03:34 -0000 1.26
+++ clientapps/symbianMmf/videocontroller/installMMF.pcf 14 Nov 2008 18:16:16 -0000
@@ -181,7 +181,8 @@
'hxmedpltfm' : 'client/medpltfm/[target]/hxmedpltfm.dll',
'hxmedplyeng' : 'client/core/[target]/hxmedplyeng.dll',
'hxnetwksvc' : 'client/netwksvc/[target]/hxnetwksvc.dll',
- 'rtspclnt' : 'protocol/rtsp/[target]/rtspclnt.dll'
+ 'rtspclnt' : 'protocol/rtsp/[target]/rtspclnt.dll',
+ 'avifformat' : 'datatype/avi/fileformat/[target]/avifformat.dll'
}
@@ -224,6 +225,7 @@
Add('httpfsys')
Add('aacff')
Add('XPSFileFormat')
+Add('avifformat')
if project.IsDefined("HELIX_FEATURE_METADATAENG"):
Add('hxmetadataeng')
Index: common/include/platform.h
===================================================================
RCS file: /cvsroot/common/include/platform.h,v
retrieving revision 1.55
diff -u -w -r1.55 platform.h
--- common/include/platform.h 6 Jun 2008 05:45:15 -0000 1.55
+++ common/include/platform.h 14 Nov 2008 18:16:25 -0000
@@ -1,5 +1,5 @@
#ifndef _PLATFORM_H_
#define _PLATFORM_H_
-#define TARVER_STR_PLATFORM "win32"
-#define TARVER_STR_BUILD_BRANCH "playerx"
+#define TARVER_STR_PLATFORM "symbian"
+#define TARVER_STR_BUILD_BRANCH "helix_restricted"
#endif
Index: common/system/platform/symbian/symbianrecognizer.cpp
===================================================================
RCS file: /cvsroot/common/system/platform/symbian/symbianrecognizer.cpp,v
retrieving revision 1.10
diff -u -w -r1.10 symbianrecognizer.cpp
--- common/system/platform/symbian/symbianrecognizer.cpp 3 Jun 2008 17:10:46 -0000 1.10
+++ common/system/platform/symbian/symbianrecognizer.cpp 14 Nov 2008 18:16:26 -0000
@@ -186,6 +186,40 @@
}
#endif
+static HXBOOL IsAVIHeader(const TDesC& fileName,
+ const TDesC8& fileBuf,
+ TDataType &type)
+{
+ // known header for AVI file.
+ // we are looking for "RIFF????AVI" pattern
+ _LIT8(KRIFFType , "RIFF" );
+ _LIT8(KAVIType , "AVI" );
+
+ // mime types can be returned.
+ _LIT8(KAVIFile , "application/x-pn-avi-plugin" );
+
+ if (fileBuf.Length() < 11)
+ {
+ return FALSE;
+ }
+
+ HXBOOL bRet = TRUE;
+
+ TPtrC8 riffBuffer = fileBuf.Mid(0, 4);
+ TPtrC8 aviBuffer = fileBuf.Mid(8, 3);
+
+ if ((riffBuffer.FindF(KRIFFType) != KErrNotFound) &&
+ (aviBuffer.FindF(KAVIType) != KErrNotFound))
+ {
+ type = TDataType(KAVIFile);
+ }
+ else
+ {
+ bRet = FALSE;
+ }
+ return bRet;
+}
+
static TInt DoGetMimeType(const TDesC& fileName,
const TDesC8& fileBuf,
TDataType &type,
@@ -211,6 +245,10 @@
{
return ret;
}
+ else if (IsAVIHeader(fileName, fileBuf, type))
+ {
+ return ret;
+ }
else
{
// check if system recognizer has been disabled.
Index: datatype/avi/fileformat/aviffdll
===================================================================
RCS file: /cvsroot/datatype/avi/fileformat/aviffdll,v
retrieving revision 1.2
diff -u -w -r1.2 aviffdll
--- datatype/avi/fileformat/aviffdll 9 Aug 2005 20:01:08 -0000 1.2
+++ datatype/avi/fileformat/aviffdll 14 Nov 2008 18:16:37 -0000
@@ -63,5 +63,6 @@
"common/include",
"hxcom.h")
project.ExportFunction("CanUnload", "void")
+project.ExportFunction("CanUnload2", "void")
DLLTarget("avifformat")
Index: datatype/avi/fileformat/avifflib
===================================================================
RCS file: /cvsroot/datatype/avi/fileformat/avifflib,v
retrieving revision 1.2
diff -u -w -r1.2 avifflib
--- datatype/avi/fileformat/avifflib 9 Aug 2005 20:01:08 -0000 1.2
+++ datatype/avi/fileformat/avifflib 14 Nov 2008 18:16:37 -0000
@@ -41,7 +41,7 @@
"common/container/pub",
"common/dbgtool/pub",
"common/system/pub",
- "common/util/pub/",
+ "common/util/pub",
"common/runtime/pub",
"datatype/common/util/pub",
"datatype/rm/include",
Index: datatype/avi/fileformat/aviffpln.cpp
===================================================================
RCS file: /cvsroot/datatype/avi/fileformat/aviffpln.cpp,v
retrieving revision 1.10
diff -u -w -r1.10 aviffpln.cpp
--- datatype/avi/fileformat/aviffpln.cpp 3 Oct 2008 02:04:46 -0000 1.10
+++ datatype/avi/fileformat/aviffpln.cpp 14 Nov 2008 18:16:38 -0000
@@ -125,7 +125,6 @@
#define LE16_TO_HOST(x) (x)
#endif // NET_ENDIAN
-INT32 g_nRefCount_avif;
/****************************************************************************
*
@@ -172,21 +171,16 @@
* then the pluginhandler can unload the DLL
*
*/
-HX_RESULT CAVIFileFormat::CanUnload(void)
-{
- HX_ASSERT(g_nRefCount_avif >= 0);
- return(g_nRefCount_avif > 0 ? HXR_FAIL : HXR_OK);
-}
-
-const char* CAVIFileFormat::zm_pDescription = "RealNetworks AVI File Format Plugin";
-const char* CAVIFileFormat::zm_pCopyright = HXVER_COPYRIGHT;
-const char* CAVIFileFormat::zm_pMoreInfoURL = "http://www.real.com";
-const char* CAVIFileFormat::zm_pFileMimeTypes[] = {"application/x-pn-avi-plugin", NULL};
-const char* CAVIFileFormat::zm_pFileExtensions[] = {"avi", "divx", NULL};
-const char* CAVIFileFormat::zm_pFileOpenNames[] = {"AVI Files (*.avi)",
+const char* const CAVIFileFormat::zm_pDescription = "RealNetworks AVI File Format Plugin";
+const char* const CAVIFileFormat::zm_pCopyright = HXVER_COPYRIGHT;
+const char* const CAVIFileFormat::zm_pMoreInfoURL = "http://www.real.com";
+
+const char* const CAVIFileFormat::zm_pFileMimeTypes[] = {"application/x-pn-avi-plugin", "video/x-msvideo", "video/avi", "video/msvideo", NULL};
+const char* const CAVIFileFormat::zm_pFileExtensions[] = {"avi", "divx", NULL};
+const char* const CAVIFileFormat::zm_pFileOpenNames[] = {"AVI Files (*.avi)",
"DivX Files (*.divx)", NULL};
-const char* CAVIFileFormat::zm_pPacketFormats[] = {"rdt", "rtp", NULL};
+const char* const CAVIFileFormat::zm_pPacketFormats[] = {"rdt", "rtp", NULL};
CAVIFileFormat::CAVIFileFormat()
: m_bSeekPriming(FALSE)
@@ -208,7 +202,6 @@
, m_pszCopyright(NULL)
, m_state(AS_InitPending)
{
- g_nRefCount_avif++; // DLL Ref Counting
// Header fields set to 0
@@ -302,9 +295,9 @@
{
bLoadMultiple = TRUE; // Must be true for file formats.
- pDescription = zm_pDescription;
- pCopyright = zm_pCopyright;
- pMoreInfoURL = zm_pMoreInfoURL;
+ pDescription = (const char*) zm_pDescription;
+ pCopyright = (const char*) zm_pCopyright;
+ pMoreInfoURL = (const char*) zm_pMoreInfoURL;
ulVersionNumber = TARVER_ULONG32_VERSION;
return HXR_OK;
@@ -314,7 +307,6 @@
CAVIFileFormat::~CAVIFileFormat()
{
Close();
- g_nRefCount_avif--; // DLL Ref Counting
return;
}
@@ -334,9 +326,9 @@
REF(const char**) /*OUT*/ pFileOpenNames
)
{
- pFileMimeTypes = zm_pFileMimeTypes;
- pFileExtensions = zm_pFileExtensions;
- pFileOpenNames = zm_pFileOpenNames;
+ pFileMimeTypes = (const char**) zm_pFileMimeTypes;
+ pFileExtensions = (const char**) zm_pFileExtensions;
+ pFileOpenNames = (const char**) zm_pFileOpenNames;
return HXR_OK;
}
@@ -446,6 +438,8 @@
IHXFileObject* /*IN*/ pFile
)
{
+ HXLOGL2(HXLOG_AVIX,"CAVIFileFormat[%p]::InitFileFormat() pRequest=%p pFormatResponse=%p pFile=%p", this, pRequest, pFormatResponse, pFile);
+
m_pRequest = pRequest;
m_pFFResponse = pFormatResponse;
m_pFile = pFile;
@@ -485,6 +479,7 @@
STDMETHODIMP CAVIFileFormat::Close()
{
+ HXLOGL2(HXLOG_AVIX,"CAVIFileFormat[%p]::Close()",this);
m_state = AS_Closed;
HX_VECTOR_DELETE(m_pszTitle);
@@ -565,6 +560,8 @@
STDMETHODIMP CAVIFileFormat::GetStreamHeader(UINT16 usStream)
{
+ HXLOGL3(HXLOG_AVIX,"CAVIFileFormat[%p]::GetStreamHeader() on stream %i", this, usStream);
+
HX_ASSERT(usStream <= m_header.ulStreams);
// Note request:
@@ -638,7 +635,8 @@
STDMETHODIMP CAVIFileFormat::GetPacket(UINT16 unStreamNumber)
{
- HX_TRACE("CAVIFileFormat::GetPacket() on stream %i\n", unStreamNumber);
+ HXLOGL4(HXLOG_AVIX,"CAVIFileFormat[%p]::GetPacket() on stream %i", this, unStreamNumber);
+
HX_ASSERT(m_state >= AS_GetIndexFilePending);
//HX_ASSERT(!m_bSeekPriming);
if (m_state <= AS_IndexFileInit)
@@ -692,7 +690,7 @@
*/
STDMETHODIMP CAVIFileFormat::Seek(ULONG32 ulOffset)
{
- HX_TRACE("CAVIFileFormat::Seek()\t%lu\n", ulOffset);
+ HXLOGL2(HXLOG_AVIX,"CAVIFileFormat[%p]::Seek()\t%lu", this, ulOffset);
// We should handle seeks past end of stream by streaming all data
// past and including the last keyframe
@@ -730,7 +728,7 @@
REF(UINT16) ulPercentDone
)
{
- //HX_TRACE("CAVIFileFormat::GetStatus()\n");
+ HXLOGL4(HXLOG_AVIX,"CAVIFileFormat[%p]::GetStatus() m_state=%d", this, m_state);
HX_RESULT hResult = HXR_OK;
#if 0
@@ -781,8 +779,8 @@
REF(const char**) /*OUT*/ pPacketFormats
)
{
- //HX_TRACE("CAVIFileFormat::GetSupportedPacketFormats()\n");
- pPacketFormats = zm_pPacketFormats;
+ HXLOGL2(HXLOG_AVIX,"CAVIFileFormat[%p]::GetSupportedPacketFormats()", this);
+ pPacketFormats = (const char**) zm_pPacketFormats;
return HXR_OK;
}
@@ -799,7 +797,7 @@
)
{
#if 0
- //HX_TRACE("CAVIFileFormat::SetPacketFormat()\n");
+ HXLOGL2(HXLOG_AVIX,"CAVIFileFormatp[%p]::SetPacketFormat()", this);
if ( strcasecmp(pPacketFormat, "rtp") == 0 )
{
m_packetFormat = PFMT_RTP;
@@ -816,7 +814,7 @@
STDMETHODIMP
CAVIFileFormat::RIFFOpenDone(HX_RESULT status)
{
- //PN_TRACE("CAVIFileFormat::RIFFOpenDone(%lx)\n", status);
+ HXLOGL4(HXLOG_AVIX,"CAVIFileFormat[%p]::RIFFOpenDone(%lx)",this,status);
HX_ASSERT(SUCCEEDED(status));
if ( m_state != AS_OpenPending )
@@ -849,7 +847,7 @@
STDMETHODIMP
CAVIFileFormat::RIFFCloseDone(HX_RESULT status)
{
- //HX_TRACE("CAVIFileFormat::RIFFCloseDone(%lx)\n", status);
+ HXLOGL4(HXLOG_AVIX,"CAVIFileFormat[%p]::RIFFCloseDone(%lx)",this, status);
HX_ASSERT(SUCCEEDED(status));
HX_ASSERT(m_state >= AS_GetIndexFilePending);
@@ -859,8 +857,8 @@
STDMETHODIMP
CAVIFileFormat::RIFFFindChunkDone(HX_RESULT status, UINT32 len)
{
- //HX_TRACE("CAVIFileFormat::RIFFFindChunkDone(""%lx, %lu)\n\tstate=%lu\n",
- // status, len, m_state);
+ HXLOGL4(HXLOG_AVIX,"CAVIFileFormat[%p]::RIFFFindChunkDone(%lx, %lu)\tstate=%lu",
+ this, status, len, m_state);
switch (m_state)
{
@@ -974,7 +972,7 @@
// We note the MOVI offset:
m_state = AS_INFOAscend;
m_ulMOVIOffset = m_pGeneralReader->GetOffset() - 4;
- //HX_TRACE("movi offset:%lx\n", m_ulMOVIOffset);
+ HXLOGL4(HXLOG_AVIX,"movi offset:%lx", m_ulMOVIOffset);
m_pGeneralReader->Ascend();
break;
case AVI_INFO_CHUNK:
@@ -1024,7 +1022,7 @@
STDMETHODIMP
CAVIFileFormat::RIFFDescendDone(HX_RESULT status)
{
- //HX_TRACE("CAVIFileFormat::RIFFDescendDone(%lx)\n\tstate=%lu\n", status, m_state);
+ HXLOGL4(HXLOG_AVIX,"CAVIFileFormat[%p]::RIFFDescendDone(%lx)\tstate=%lu", this, status, m_state);
HX_ASSERT(SUCCEEDED(status));
switch ( m_state )
@@ -1089,7 +1087,7 @@
STDMETHODIMP
CAVIFileFormat::RIFFAscendDone(HX_RESULT status)
{
- //HX_TRACE("CAVIFileFormat::RIFFAscendDone(%lx)\n\tstate=%lu\n", status, m_state);
+ HXLOGL4(HXLOG_AVIX,"CAVIFileFormat[%p]::RIFFAscendDone(%lx)\tstate=%lu", this, status, m_state);
HX_ASSERT(SUCCEEDED(status));
switch ( m_state )
@@ -1142,7 +1140,7 @@
STDMETHODIMP
CAVIFileFormat::RIFFReadDone(HX_RESULT status, IHXBuffer* pBuffer)
{
- //HX_TRACE("CAVIFileFormat::RIFFReadDone(%lx)\n\tstate=%lu\n", status, m_state);
+ HXLOGL4(HXLOG_AVIX,"CAVIFileFormat[%p]::RIFFReadDone(%lx)\tstate=%lu", this, status, m_state);
HX_ASSERT(SUCCEEDED(status));
if (m_state < AS_AVIHRead ||
@@ -1237,7 +1235,7 @@
void CAVIFileFormat::SetInfo(IHXBuffer* pBuffer, UINT32 ulChunkType)
{
- //HX_TRACE("CAVIFileFormat::SetInfo()\n", m_state);
+ HXLOGL3(HXLOG_AVIX,"CAVIFileFormat[%p]::SetInfo()", this, m_state);
if (!pBuffer)
{
HX_ASSERT(FALSE);
@@ -1252,19 +1250,19 @@
switch (ulChunkType)
{
case AVI_TITLE_CHUNK:
- m_pszTitle = new CHAR[len+1];
+ m_pszTitle = new char[len+1];
memset(m_pszTitle, len+1, 0);
strcpy(m_pszTitle, (const char*)buf);
break;
case AVI_AUTHOR_CHUNK:
- m_pszAuthor = new CHAR[len+1];
+ m_pszAuthor = new char[len+1];
memset(m_pszAuthor, len+1, 0);
strcpy(m_pszAuthor, (const char*)buf);
break;
case AVI_COPYRIGHT_CHUNK:
- m_pszCopyright = new CHAR[len+1];
+ m_pszCopyright = new char[len+1];
memset(m_pszCopyright, len+1, 0);
strcpy(m_pszCopyright, (const char*)buf);
break;
@@ -1275,7 +1273,7 @@
HX_RESULT CAVIFileFormat::SetHeader(IHXBuffer* pBuffer)
{
- //HX_TRACE("CAVIFileFormat::SetHeader\n\tstate=%lu\n", m_state);
+ HXLOGL3(HXLOG_AVIX,"CAVIFileFormat[%p]::SetHeader\tstate=%lu", this, m_state);
HX_ASSERT_VALID_PTR(pBuffer);
UINT32 len = pBuffer->GetSize();
@@ -1310,7 +1308,7 @@
STDMETHODIMP
CAVIFileFormat::RIFFSeekDone(HX_RESULT status)
{
- //HX_TRACE("CAVIFileFormat::RIFFSeekDone(%lx)\n\tstate=%lu\n", status, m_state);
+ HXLOGL4(HXLOG_AVIX,"CAVIFileFormat[%p]::RIFFSeekDone(%lx)\tstate=%lu", this,status, m_state);
HX_ASSERT(FALSE);
return HXR_UNEXPECTED;
@@ -1321,8 +1319,8 @@
UINT32 ulChunkType,
IHXBuffer* pBuffer)
{
-// HX_TRACE("CAVIFileFormat::RIFFGetChunkDone(%lx, %lx)\n\tstate=%lu\n",
-// status, ulChunkType, m_state);
+ HXLOGL4(HXLOG_AVIX,"CAVIFileFormat[%p]::RIFFGetChunkDone(%lx, %lx)\tstate=%lu",
+ this, status, ulChunkType, m_state);
// HX_ASSERT(FALSE);
// return HXR_OK;
@@ -1353,7 +1351,7 @@
CAVIFileFormat::FileObjectReady(HX_RESULT status,
IUnknown* pObject)
{
- //HX_TRACE("CAVIFileFormat::FileObjectReady\n\tstate=%lu\n", m_state);
+ HXLOGL4(HXLOG_AVIX,"CAVIFileFormat[%p]::FileObjectReady\tstate=%lu", this, m_state);
HX_ASSERT(SUCCEEDED(status));
HX_ASSERT_VALID_PTR(pObject);
HX_ASSERT(m_state == AS_GetIndexFilePending || m_state == AS_GetStreamFilePending);
@@ -1498,7 +1496,7 @@
void CAVIFileFormat::ScanState()
{
- //HX_TRACE("CAVIFileFormat::ScanState\n\tstate=%lu\n", m_state);
+ HXLOGL4(HXLOG_AVIX,"CAVIFileFormat[%p]::ScanState\tstate=%lu", this, m_state);
if (m_state != AS_Ready)
{
@@ -1561,7 +1559,7 @@
IHXPacket* pPendingPacket = ((CAVIStream*) m_streamArray[lEarliestStream])->GetNextPacket();
HX_ASSERT(pPendingPacket);
- HX_TRACE("CAVIFileFormat::ScanState\tPacketReady, stream: %lu\ttimestamp: %lu\n", pPendingPacket->GetStreamNumber(), pPendingPacket->GetTime());
+ HXLOGL4(HXLOG_AVIX,"CAVIFileFormat[%p]::ScanState\tPacketReady, stream: %lu\ttimestamp: %lu", this, pPendingPacket->GetStreamNumber(), pPendingPacket->GetTime());
// Warning: core call
m_pFFResponse->PacketReady(HXR_OK, pPendingPacket);
HX_RELEASE(pPendingPacket);
@@ -1700,7 +1698,7 @@
IHXValues* CAVIFileFormat::GetHeader()
{
- //HX_TRACE("CAVIFileFormat::GetHeader()\n", m_state);
+ HXLOGL3(HXLOG_AVIX,"CAVIFileFormat[%p]::GetHeader()", this,m_state);
HX_ASSERT(m_streamArray.GetSize() > 0);
HX_ASSERT(m_header.ulStreams == m_streamArray.GetSize());
@@ -1729,27 +1727,27 @@
{
pTitle->Set((const UCHAR*)m_pszTitle, strlen(m_pszTitle)+1);
pHeader->SetPropertyBuffer("Title", pTitle);
- //HX_TRACE("\tTitle:\t%s\n", m_pszTitle);
+ HXLOGL3(HXLOG_AVIX,"\tTitle:\t%s", m_pszTitle);
}
if ( m_pszAuthor )
{
pAuthor->Set((const UCHAR*)m_pszAuthor, strlen(m_pszAuthor)+1);
pHeader->SetPropertyBuffer("Author", pAuthor);
- //HX_TRACE("\tAuthor:\t%s\n", m_pszAuthor);
+ HXLOGL3(HXLOG_AVIX,"\tAuthor:\t%s", m_pszAuthor);
}
if ( m_pszCopyright )
{
pCopyright->Set((const UCHAR*)m_pszCopyright, strlen(m_pszCopyright)+1);
pHeader->SetPropertyBuffer("Copyright", pCopyright);
- //HX_TRACE("\tCopyright:\t%s\n", m_pszCopyright);
+ HXLOGL3(HXLOG_AVIX,"\tCopyright:\t%s", m_pszCopyright);
}
}
// XXXKB Unconditionally enable recording? Can this be improved??
pHeader->SetPropertyULONG32("Flags", HX_SAVE_ENABLED);
- //HX_TRACE("\tFlags:\t%lu\n", HX_SAVE_ENABLED);
+ HXLOGL3(HXLOG_AVIX,"\tFlags:\t%lu", HX_SAVE_ENABLED);
// XXXKB Disable seeking if we have no index?
@@ -1763,7 +1761,7 @@
void CAVIFileFormat::IOEvent()
{
- //HX_TRACE("CAVIFileFormat::IOEvent\n\tstate=%lu\n", m_state);
+ HXLOGL4(HXLOG_AVIX,"CAVIFileFormat[%p]::IOEvent\tstate=%lu", this, m_state);
HX_ASSERT(m_state == AS_IndexFileInit || m_state == AS_IOEvent ||
m_state == AS_Closed);
Index: datatype/avi/fileformat/aviindx.cpp
===================================================================
RCS file: /cvsroot/datatype/avi/fileformat/aviindx.cpp,v
retrieving revision 1.8
diff -u -w -r1.8 aviindx.cpp
--- datatype/avi/fileformat/aviindx.cpp 19 Jun 2008 05:02:45 -0000 1.8
+++ datatype/avi/fileformat/aviindx.cpp 14 Nov 2008 18:16:38 -0000
@@ -53,6 +53,7 @@
#include "ihxpckts.h"
#include "hxheap.h"
+#include "hxtlogutil.h"
#ifdef _DEBUG
#undef HX_THIS_FILE
@@ -98,12 +99,12 @@
, m_scanState(eInitial)
, m_lRefCount(0)
{
- //HX_TRACE("CAVIFileFormat::CAVIIndex::CAVIIndex()\n");
+ HXLOGL2(HXLOG_AVIX,"CAVIIndex[%p]::CAVIIndex() CTOR", this);
}
CAVIIndex::~CAVIIndex()
{
- //HX_TRACE("CAVIFileFormat::CAVIIndex::~CAVIIndex()\n");
+ HXLOGL2(HXLOG_AVIX,"CAVIIndex[%p]::~CAVIIndex() DES", this);
/* HX_RELEASE(m_pReader);
HX_RELEASE(m_pOuter);
@@ -119,7 +120,7 @@
IUnknown* pContext, UINT32 ulFirstMOVIOffset,
UINT16 usStreamCount)
{
- //HX_TRACE("CAVIFileFormat::CAVIIndex::Init()\n");
+ HXLOGL2(HXLOG_AVIX,"CAVIIndex[%p]::Init()", this);
HX_ASSERT_VALID_PTR(pOuter);
m_pOuter = pOuter;
@@ -181,7 +182,7 @@
void CAVIIndex::AddToIndex(UINT16 usStream, UINT32 ulChunk, UINT32 ulOffset,
UINT32 ulSize, BOOL bKeyChunk) // offset includes header
{
- //HX_TRACE("CAVIFileFormat::CAVIIndex::AddToIndex()\n");
+ HXLOGL4(HXLOG_AVIX,"CAVIIndex[%p]::AddToIndex()", this);
StreamSlice* pStream = (StreamSlice*) m_sliceArray[usStream];
// Do we have an index, or is this chunk already indexed?
@@ -209,13 +210,13 @@
void CAVIIndex::FileRead(BOOL bRead) // All chunks have been indexed; reset on seek
{
- //HX_TRACE("CAVIFileFormat::CAVIIndex::FileRead()\n");
+ HXLOGL4(HXLOG_AVIX,"CAVIIndex[%p]::FileRead()", this);
m_bRead = bRead;
}
void CAVIIndex::SetMinimumChunkInterest(UINT16 usStream, UINT32 ulChunk)
{
- //HX_TRACE("CAVIFileFormat::CAVIIndex::SetMinimumChunkInterest()\n");
+ HXLOGL4(HXLOG_AVIX,"CAVIIndex[%p]::SetMinimumChunkInterest()", this);
HX_ASSERT(usStream < m_usStreamCount);
StreamSlice* pStream = (StreamSlice*) m_sliceArray[usStream];
@@ -234,7 +235,7 @@
BOOL CAVIIndex::IsKeyChunk(UINT16 usStream, UINT32 ulChunk)
{
- //HX_TRACE("CAVIFileFormat::CAVIIndex::IsKeyChunk()\n");
+ HXLOGL4(HXLOG_AVIX,"CAVIIndex[%p]::IsKeyChunk()", this);
StreamSlice* pStream = (StreamSlice*) m_sliceArray[usStream];
// in bounds?
@@ -254,7 +255,7 @@
/* out */ UINT32& ulClosestOffset,
/* out */ UINT32& ulClosestStreamChunk)
{
- //HX_TRACE("CAVIFileFormat::CAVIIndex::FindClosestChunk()\n");
+ HXLOGL4(HXLOG_AVIX,"CAVIIndex[%p]::FindClosestChunk()", this);
if (ulChunk == 0)
{
@@ -305,7 +306,7 @@
/* out */ UINT32& ulClosestOffset,
/* out */ UINT32& ulClosestStreamChunk)
{
- //HX_TRACE("CAVIFileFormat::CAVIIndex::FindClosestKeyChunk()\n");
+ HXLOGL4(HXLOG_AVIX,"CAVIIndex[%p]::FindClosestKeyChunk()", this);
if (ulChunk == 0)
{
@@ -354,7 +355,7 @@
// in bytes, not including header:
UINT32 CAVIIndex::GetMaxChunkSize(UINT16 usStream)
{
- //HX_TRACE("CAVIFileFormat::CAVIIndex::GetMaxChunkSize()\n");
+ HXLOGL4(HXLOG_AVIX,"CAVIIndex[%p]::GetMaxChunkSize()", this);
StreamSlice* pStream = (StreamSlice*) m_sliceArray[usStream];
return pStream->ulMaxChunkSize;
}
@@ -362,7 +363,7 @@
// in bytes, not including header:
double CAVIIndex::GetAverageChunkSize(UINT16 usStream)
{
- //HX_TRACE("CAVIFileFormat::CAVIIndex::GetAverageChunkSize()\n");
+ HXLOGL4(HXLOG_AVIX,"CAVIIndex[%p]::GetAverageChunkSize()", this);
StreamSlice* pStream = (StreamSlice*) m_sliceArray[usStream];
return pStream->ulTotalBytes / (double) pStream->ulTotalChunks;
@@ -371,7 +372,7 @@
// Returns zero if we have no index; assumes transmission at average rate
UINT32 CAVIIndex::GetMaxByteDeflict(UINT16 usStream)
{
- //HX_TRACE("CAVIFileFormat::CAVIIndex::GetMaxByteDeflict()\n");
+ HXLOGL4(HXLOG_AVIX,"CAVIIndex[%p]::GetMaxByteDeflict()", this);
StreamSlice* pStream = (StreamSlice*) m_sliceArray[usStream];
return pStream->ulPrerollBytes;
@@ -379,7 +380,7 @@
UINT32 CAVIIndex::GetByteTotal(UINT16 usStream)
{
- //HX_TRACE("CAVIFileFormat::CAVIIndex::GetByteTotal()\n");
+ HXLOGL4(HXLOG_AVIX,"CAVIIndex[%p]::GetByteTotal()", this);
StreamSlice* pStream = (StreamSlice*) m_sliceArray[usStream];
return pStream->ulTotalBytes;
@@ -387,7 +388,7 @@
UINT32 CAVIIndex::GetChunkTotal(UINT16 usStream)
{
- //HX_TRACE("CAVIFileFormat::CAVIIndex::GetChunkTotal()\n");
+ HXLOGL4(HXLOG_AVIX,"CAVIIndex[%p]::GetChunkTotal()", this);
StreamSlice* pStream = (StreamSlice*) m_sliceArray[usStream];
return pStream->ulTotalChunks;
@@ -395,7 +396,7 @@
BOOL CAVIIndex::CanLoadSlice()
{
- //HX_TRACE("CAVIFileFormat::CAVIIndex::CanLoadSlice()\n");
+ HXLOGL4(HXLOG_AVIX,"CAVIIndex[%p]::CanLoadSlice()", this);
// We want serialized access:
HX_ASSERT(m_state == eReady);
@@ -417,7 +418,7 @@
BOOL CAVIIndex::CanPreloadSlice()
{
- //HX_TRACE("CAVIFileFormat::CAVIIndex::CanPreloadSlice()\n");
+ HXLOGL4(HXLOG_AVIX,"CAVIIndex[%p]::CanPreloadSlice()", this);
// We want serialized access:
HX_ASSERT(m_state == eReady);
@@ -440,7 +441,7 @@
void CAVIIndex::GetNextSlice()
{
- //HX_TRACE("CAVIFileFormat::CAVIIndex::GetNextSlice()\n");
+ HXLOGL4(HXLOG_AVIX,"CAVIIndex[%p]::GetNextSlice()", this);
HX_ASSERT(CanLoadSlice() || CanPreloadSlice());
// We want serialized access:
@@ -596,7 +597,7 @@
STDMETHODIMP CAVIIndex::RIFFOpenDone(HX_RESULT status)
{
- //HX_TRACE("CAVIFileFormat::CAVIIndex::RIFFOpenDone()\n");
+ HXLOGL4(HXLOG_AVIX,"CAVIIndex[%p]::RIFFOpenDone()", this);
HX_ASSERT(m_state == eReaderOpen);
m_state = eInitialDescend;
@@ -606,7 +607,7 @@
STDMETHODIMP CAVIIndex::RIFFCloseDone(HX_RESULT status)
{
- //HX_TRACE("CAVIFileFormat::CAVIIndex::RIFFCloseDone()\n");
+ HXLOGL4(HXLOG_AVIX,"CAVIIndex[%p]::RIFFCloseDone()", this);
return HXR_NOTIMPL;
}
@@ -616,7 +617,7 @@
*/
STDMETHODIMP CAVIIndex::RIFFFindChunkDone(HX_RESULT status, UINT32 len)
{
- //HX_TRACE("CAVIFileFormat::CAVIIndex::RIFFFindChunkDone()\n");
+ HXLOGL4(HXLOG_AVIX,"CAVIIndex[%p]::RIFFFindChunkDone() status=%x", this, status);
HX_ASSERT(m_state == eIdx1Find);
if (FAILED(status) || len == 0)
@@ -651,7 +652,7 @@
/* Called after a Descend completes */
STDMETHODIMP CAVIIndex::RIFFDescendDone(HX_RESULT status)
{
- //HX_TRACE("CAVIFileFormat::CAVIIndex::RIFFDescendDone()\n");
+ HXLOGL4(HXLOG_AVIX,"CAVIIndex[%p]::RIFFDescendDone()", this);
HX_ASSERT(m_state == eInitialDescend || m_state == eIdx1Descend);
switch (m_state)
@@ -697,7 +698,7 @@
/* Called after an Ascend completes */
STDMETHODIMP CAVIIndex::RIFFAscendDone(HX_RESULT status)
{
- //HX_TRACE("CAVIFileFormat::CAVIIndex::RIFFAscendDone()\n");
+ HXLOGL4(HXLOG_AVIX,"CAVIIndex[%p]::RIFFAscendDone()", this);
return HXR_NOTIMPL;
}
@@ -705,7 +706,7 @@
*/
STDMETHODIMP CAVIIndex::RIFFReadDone(HX_RESULT status, IHXBuffer *pBuffer)
{
- //HX_TRACE("CAVIFileFormat::CAVIIndex::RIFFReadDone()\n");
+ HXLOGL4(HXLOG_AVIX,"CAVIIndex[%p]::RIFFReadDone()", this);
HX_ASSERT(m_state == eReadSlice);
if (m_bDiscardPendingIO)
@@ -880,13 +881,13 @@
LE32_TO_HOST(pEntry->ulChunkOffset) + m_ulFirstRelativeMOVIOffset;
pStream->entryArray[pStream->ulSliceEndChunk % MAX_SLICE_SIZE].ulLength =
LE32_TO_HOST(pEntry->ulChunkLength);
- //HX_TRACE("CAVIIndex::RIFFReadDone stream: %d\toffset: %lu\n", CAVIFileFormat::GetStream(pEntry->ulChunkId),
+ // HXLOGL4(HXLOG_AVIX,"CAVIIndex[%p]::RIFFReadDone stream: %d\toffset: %lu", this,CAVIFileFormat::GetStream(pEntry->ulChunkId),
// pStream->entryArray[pStream->ulSliceEndChunk % MAX_SLICE_SIZE].ulOffset);
#ifdef _DEBUG_KEYCHUNKS
if (pStream->entryArray[pStream->ulSliceEndChunk % MAX_SLICE_SIZE].bKeyChunk)
{
- //HX_TRACE("CAVIIndex::RIFFReadDone keytype: %c%c%c%c\n",
+ HXLOGL4(HXLOG_AVIX,"CAVIIndex[%p]::RIFFReadDone keytype: %c%c%c%c",this,
pEntry->ulChunkId, pEntry->ulChunkId >> 8,
pEntry->ulChunkId >> 16, pEntry->ulChunkId >> 24);
}
@@ -930,7 +931,7 @@
/* Called when a seek completes */
STDMETHODIMP CAVIIndex::RIFFSeekDone(HX_RESULT status)
{
- //HX_TRACE("CAVIFileFormat::CAVIIndex::RIFFSeekDone()\n");
+ HXLOGL4(HXLOG_AVIX,"CAVIIndex[%p]::RIFFSeekDone()", this);
if (m_bDiscardPendingIO)
{
@@ -976,12 +977,13 @@
STDMETHODIMP CAVIIndex::RIFFGetChunkDone(HX_RESULT status, UINT32 chunkType,
IHXBuffer* pBuffer)
{
- //HX_TRACE("CAVIFileFormat::CAVIIndex::RIFFGetChunkDone()\n");
+ HXLOGL4(HXLOG_AVIX,"CAVIIndex[%p]::RIFFGetChunkDone()", this);
return HXR_NOTIMPL;
}
void CAVIIndex::Close()
{
+ HXLOGL2(HXLOG_AVIX,"CAVIIndex[%p]::Close()", this);
if(m_pFile)
{
m_pFile->Close();
Index: datatype/avi/fileformat/avistrm.cpp
===================================================================
RCS file: /cvsroot/datatype/avi/fileformat/avistrm.cpp,v
retrieving revision 1.16
diff -u -w -r1.16 avistrm.cpp
--- datatype/avi/fileformat/avistrm.cpp 3 Oct 2008 02:12:25 -0000 1.16
+++ datatype/avi/fileformat/avistrm.cpp 14 Nov 2008 18:16:38 -0000
@@ -308,6 +308,7 @@
, m_ulSeekTime (0)
, m_pFile (NULL)
{
+ HXLOGL2(HXLOG_AVIX, "CAVIStream[%p]::CAVIStream() CTOR", this);
HX_ASSERT_VALID_PTR(m_pOuter);
HX_ASSERT_VALID_PTR(m_pContext);
HX_ADDREF(m_pContext);
@@ -331,7 +332,7 @@
//
CAVIStream::~CAVIStream()
{
- //HX_TRACE("CAVIFileFormat::CAVIStream::~CAVIStream()\n");
+ HXLOGL2(HXLOG_AVIX, "CAVIStream[%p]::~CAVIStream()", this);
/* HX_RELEASE(m_pReader);
HX_DELETE(m_pFormat);
HX_RELEASE(m_pPayloadFormatter);
@@ -349,7 +350,7 @@
//
HX_RESULT CAVIStream::SetHeader(UINT16 usStream, IHXBuffer* pHeader)
{
- //HX_TRACE("CAVIFileFormat::CAVIStream::SetHeader()\n");
+ HXLOGL2(HXLOG_AVIX,"CAVIStream[%p]::SetHeader() usStream=%d", this, usStream);
HX_RESULT result = HXR_FAIL;
UCHAR* buf;
@@ -404,7 +405,7 @@
//
HX_RESULT CAVIStream::SetFormat(IHXBuffer* pFormat)
{
- //HX_TRACE("CAVIFileFormat::CAVIStream::SetFormat()\n");
+ HXLOGL2(HXLOG_AVIX,"CAVIStream[%p]::SetFormat()", this);
HX_ASSERT(pFormat);
HX_RESULT result = HXR_FAIL;
@@ -481,7 +482,7 @@
m_pFormat = new UCHAR[len + nPadding];
memcpy(m_pFormat, buf, len);
- HXLOGL3(HXLOG_AVIX, "CAVIStream::SetFormat with wave m_pFormat=%p\n", m_pFormat);
+ HXLOGL3(HXLOG_AVIX, "CAVIStream[%p]::SetFormat with wave m_pFormat=%p", this,m_pFormat);
if(nPadding > 0)
{
@@ -516,7 +517,7 @@
//
HX_RESULT CAVIStream::SetPacketFormat(UINT32 ePacketFormat)
{
- //HX_TRACE("CAVIFileFormat::CAVIStream::SetPacketFormat()\n");
+ HXLOGL4(HXLOG_AVIX,"CAVIStream[%p]::SetPacketFormat()", this);
HX_ASSERT(m_state <= ePreHeader);
m_ePacketFormat = (PacketFormat) ePacketFormat;
@@ -528,7 +529,7 @@
//
HX_RESULT CAVIStream::SetOpaque(IHXBuffer* pOpaque)
{
- //HX_TRACE("CAVIFileFormat::CAVIStream::SetOpaque()\n");
+ HXLOGL4(HXLOG_AVIX,"CAVIStream[%p]::SetOpaque()", this);
return HXR_NOTIMPL;
}
@@ -537,7 +538,7 @@
//
HX_RESULT CAVIStream::SetIndex(CAVIIndex* pIndex)
{
- //HX_TRACE("CAVIFileFormat::CAVIStream::SetIndex()\n");
+ HXLOGL4(HXLOG_AVIX,"CAVIStream[%p]::SetIndex()", this);
HX_ASSERT(!m_pIndex);
HX_ASSERT_VALID_PTR(pIndex);
m_pIndex = pIndex;
@@ -550,7 +551,7 @@
//
void CAVIStream::SetPendingHeaderRequest()
{
- //HX_TRACE("CAVIFileFormat::CAVIStream::SetPendingHeaderRequest()\n");
+ HXLOGL4(HXLOG_AVIX,"CAVIStream[%p]::SetPendingHeaderRequest()", this);
m_bPendingHeaderRequest = TRUE;
}
@@ -559,7 +560,7 @@
//
BOOL CAVIStream::PendingHeaderRequest()
{
- //HX_TRACE("CAVIFileFormat::CAVIStream::PendingHeaderRequest()\n");
+ HXLOGL4(HXLOG_AVIX,"CAVIStream[%p]::PendingHeaderRequest()", this);
return m_bPendingHeaderRequest;
}
@@ -568,7 +569,7 @@
//
HX_RESULT CAVIStream::GetHeader(IHXValues* pHeader)
{
- //HX_TRACE("CAVIFileFormat::CAVIStream::GetHeader()\n");
+ HXLOGL3(HXLOG_AVIX,"CAVIStream[%p]::GetHeader()", this);
HX_ASSERT(pHeader);
HX_ASSERT(m_bPendingHeaderRequest);
@@ -639,7 +640,7 @@
pHeader->SetPropertyULONG32("MicrosecondsPerFrame",
(ULONG32) (1e6 * ((double) m_header.ulScale / m_header.ulRate)));
- //HX_TRACE("\t\tMicrosecondsPerFrame:\t%lu\n", (ULONG32) 1e6 * ((double) m_header.ulScale / m_header.ulRate));
+ HXLOGL4(HXLOG_AVIX,"\t\tMicrosecondsPerFrame:\t%lu", (ULONG32) 1e6 * ((double) m_header.ulScale / m_header.ulRate));
}
else
{
@@ -924,13 +925,13 @@
}
pHeader->SetPropertyULONG32("BitsPerSample", pWaveInfo->usBitsPerSample);
- //HX_TRACE("\t\tBitsPerSample:\t%lu\n", pWaveInfo->usBitsPerSample);
+ HXLOGL4(HXLOG_AVIX,"\t\tBitsPerSample:\t%lu", pWaveInfo->usBitsPerSample);
pHeader->SetPropertyULONG32("SamplesPerSecond", pWaveInfo->ulSamplesPerSec);
- //HX_TRACE("\t\tSamplesPerSecond:\t%lu\n", pWaveInfo->ulSamplesPerSec);
+ HXLOGL4(HXLOG_AVIX,"\t\tSamplesPerSecond:\t%lu", pWaveInfo->ulSamplesPerSec);
pHeader->SetPropertyULONG32("Channels", pWaveInfo->usChannels);
- //HX_TRACE("\t\tChannels:\t%lu\n", pWaveInfo->usChannels);
+ HXLOGL4(HXLOG_AVIX,"\t\tChannels:\t%lu", pWaveInfo->usChannels);
m_fChunksPerSecond = m_pIndex->GetChunkTotal(m_usStream) / ((double) m_pIndex->GetByteTotal(m_usStream) / pWaveInfo->ulAvgBytesPerSec);
m_fSamplesPerSecond = (double) m_header.ulRate / m_header.ulScale;
@@ -962,16 +963,16 @@
if ( m_ePacketFormat == PFMT_RTP )
{
pHeader->SetPropertyULONG32("RTPPayloadType", nRTPPayloadType);
- //HX_TRACE("\t\tRTPPayloadType:\t%lu\n", nRTPPayloadType);
+ HXLOGL4(HXLOG_AVIX,"\t\tRTPPayloadType:\t%lu", nRTPPayloadType);
}
// Max packet size:
pHeader->SetPropertyULONG32("MaxPacketSize", ulMaxPacketSize);
- //HX_TRACE("\t\tMaxPacketSize:\t%lu\n", ulMaxPacketSize);
+ HXLOGL4(HXLOG_AVIX,"\t\tMaxPacketSize:\t%lu", ulMaxPacketSize);
// Average packet size:
pHeader->SetPropertyULONG32("AvgPacketSize", ulMaxPacketSize);
- //HX_TRACE("\t\tAvgPacketSize:\t%lu\n", ulMaxPacketSize);
+ HXLOGL4(HXLOG_AVIX,"\t\tAvgPacketSize:\t%lu", ulMaxPacketSize);
}
// Format specific data (for future use):
@@ -979,13 +980,13 @@
// Stream number:
pHeader->SetPropertyULONG32("StreamNumber", m_usStream);
- //HX_TRACE("\t\tStreamNumber:\t%lu\n", m_usStream);
+ HXLOGL4(HXLOG_AVIX,"\t\tStreamNumber:\t%lu", m_usStream);
// HX_ASSERT(m_fChunksPerSecond && m_fSamplesPerSecond);
// Start time:
pHeader->SetPropertyULONG32("StartTime", (ULONG32) (m_header.ulStart * m_fChunksPerSecond * 1000));
- //HX_TRACE("\t\tStartTime:\t%lu\n", (ULONG32) (m_header.ulStart * m_fSamplesPerSecond * 1000));
+ HXLOGL4(HXLOG_AVIX,"\t\tStartTime:\t%lu", (ULONG32) (m_header.ulStart * m_fSamplesPerSecond * 1000));
// Duration:
if(m_header.ulLength == 0)
@@ -993,16 +994,16 @@
m_header.ulLength = 0xffffffff;
}
pHeader->SetPropertyULONG32("Duration", (ULONG32) (((double) m_header.ulLength / m_fSamplesPerSecond) * 1000));
- //HX_TRACE("\t\tDuration:\t%lu\n", (ULONG32) (((double) m_header.ulLength / m_fSamplesPerSecond) * 1000));
+ HXLOGL4(HXLOG_AVIX,"\t\tDuration:\t%lu", (ULONG32) (((double) m_header.ulLength / m_fSamplesPerSecond) * 1000));
// Max bit rate:
pHeader->SetPropertyULONG32("MaxBitRate", (ULONG32) (8 * m_pIndex->GetMaxChunkSize(m_usStream) * m_fChunksPerSecond));
- //HX_TRACE("\t\tMaxBitRate:\t%lu\n", (ULONG32) (8 * m_pIndex->GetMaxChunkSize(m_usStream) * m_fChunksPerSecond));
+ HXLOGL4(HXLOG_AVIX,"\t\tMaxBitRate:\t%lu", (ULONG32) (8 * m_pIndex->GetMaxChunkSize(m_usStream) * m_fChunksPerSecond));
// Averate bit rate:
ULONG32 ulAverageBitrate = (ULONG32) (8 * m_pIndex->GetAverageChunkSize(m_usStream) * m_fChunksPerSecond);
pHeader->SetPropertyULONG32("AvgBitRate", ulAverageBitrate);
- //HX_TRACE("\t\tAvgBitRate:\t%lu\n", ulAverageBitrate);
+ HXLOGL4(HXLOG_AVIX,"\t\tAvgBitRate:\t%lu", ulAverageBitrate);
// Preroll:
UINT32 ulPreroll = (UINT32) (((double) m_pIndex->GetMaxByteDeflict(m_usStream) / ulAverageBitrate) * 1000);
@@ -1039,7 +1040,7 @@
}
pHeader->SetPropertyULONG32("Preroll", ulPreroll);
- //HX_TRACE("\t\tPreroll:\t%lu\n", ulPreroll);
+ HXLOGL4(HXLOG_AVIX,"\t\tPreroll:\t%lu", ulPreroll);
// Set rule book:
#if 0
@@ -1090,7 +1091,7 @@
//
BOOL CAVIStream::IsAudio()
{
- //HX_TRACE("CAVIFileFormat::CAVIStream::IsAudio()\n");
+ HXLOGL4(HXLOG_AVIX,"CAVIStream[%p]::IsAudio() %d",this,(m_header.ulType == AVI_AUDS_TYPE));
return m_header.ulType == AVI_AUDS_TYPE;
}
@@ -1099,7 +1100,7 @@
//
double CAVIStream::GetDuration()
{
- //HX_TRACE("CAVIFileFormat::CAVIStream::GetDuration()\n");
+ HXLOGL4(HXLOG_AVIX,"CAVIStream[%p]::GetDuration()", this);
HX_ASSERT(m_header.ulScale);
return m_header.ulLength / (m_header.ulRate / (double) m_header.ulScale);
}
@@ -1113,7 +1114,7 @@
HX_RESULT CAVIStream::InitForReading(IUnknown* pContext, IHXFileObject* pFile)
{
- //HX_TRACE("CAVIFileFormat::CAVIStream::InitForReading()\n");
+ HXLOGL2(HXLOG_AVIX,"CAVIStream[%p]::InitForReading()", this);
HX_ASSERT(m_state == ePreReader);
@@ -1138,7 +1139,7 @@
//
BOOL CAVIStream::ReadInitialized()
{
- //HX_TRACE("CAVIFileFormat::CAVIStream::ReadInitialized()\n");
+ HXLOGL4(HXLOG_AVIX,"CAVIStream[%p]::ReadInitialized()", this);
HX_ASSERT(m_pReader ? m_state > ePreReader : TRUE);
return m_pReader != NULL;
}
@@ -1148,7 +1149,7 @@
//
BOOL CAVIStream::HasPackets()
{
- //HX_TRACE("CAVIFileFormat::CAVIStream::HasPackets()\n");
+ HXLOGL4(HXLOG_AVIX,"CAVIStream[%p]::HasPackets()", this);
return (BOOL) m_pNextPacket;
}
@@ -1157,7 +1158,7 @@
//
UINT32 CAVIStream::GetPendingPacketCount()
{
- //HX_TRACE("CAVIFileFormat::CAVIStream::GetPendingPacketCount()\n");
+ HXLOGL4(HXLOG_AVIX,"CAVIStream[%p]::GetPendingPacketCount()", this);
return m_ulPendingPacketRequests;
}
@@ -1166,7 +1167,7 @@
//
UINT32 CAVIStream::IncrementPendingPacketCount()
{
- //HX_TRACE("CAVIFileFormat::CAVIStream::IncrementPendingPacketCount()\n");
+ HXLOGL4(HXLOG_AVIX,"CAVIStream[%p]::IncrementPendingPacketCount()", this);
m_ulPendingPacketRequests++;
return m_ulPendingPacketRequests;
}
@@ -1176,7 +1177,7 @@
//
void CAVIStream::ClearPendingPacketCount()
{
- //HX_TRACE("CAVIFileFormat::CAVIStream::ClearPendingPacketCount()\n");
+ HXLOGL4(HXLOG_AVIX,"CAVIStream[%p]::ClearPendingPacketCount()", this);
m_ulPendingPacketRequests = 0;
}
@@ -1186,7 +1187,7 @@
//
void CAVIStream::Seek(UINT32 ulTime)
{
- //HX_TRACE("CAVIFileFormat::CAVIStream::Seek()\ttime: %lu\n", ulTime);
+ HXLOGL2(HXLOG_AVIX,"CAVIStream[%p]::Seek()\ttime: %lu", this,ulTime);
m_ulPendingPacketRequests = 0;
m_bRead = FALSE;
@@ -1261,7 +1262,7 @@
if (SUCCEEDED(m_pCommonClassFactory->CreateInstance(IID_IHXPacket,
(void**) &pNewPacket)))
{
- // HX_TRACE("CAVIFileFormat::CAVIStream::Seek()\tstream %d\tpacket time: %lu\t minreadchunk: %lu\n", m_usStream, ulTime, m_ulMinReadChunk);
+ HXLOGL2(HXLOG_AVIX,"CAVIStream[%p]::Seek()\tstream %d\tpacket time: %lu\t minreadchunk: %lu", this, m_usStream, ulTime, m_ulMinReadChunk);
if (IsAudio ())
{
WaveInfo* pWaveInfo = (WaveInfo*) m_pFormat;
@@ -1358,7 +1359,7 @@
// on success, returns an AddRef'd packet
IHXPacket* CAVIStream::GetNextPacket()
{
- //HX_TRACE("CAVIFileFormat::CAVIStream::GetNextPacket()\n");
+ HXLOGL4(HXLOG_AVIX,"CAVIStream[%p]::GetNextPacket()", this);
HX_ASSERT(m_state > ePreReader);
HX_ASSERT(m_ulPendingPacketRequests > 0);
HX_ASSERT(m_pNextPacket);
@@ -1389,6 +1390,7 @@
{
ulTime = (UINT32) ((m_ulMinReadChunk / m_fChunksPerSecond) * 1000);
}
+ HXLOGL4(HXLOG_AVIX,"CAVIStream[%p]::GetNextPacket()\tstream %d\tpacket time: %lu\t minreadchunk: %lu\n", this, m_usStream, ulTime, m_ulMinReadChunk);
// TODO: Set correct ASM rules
if (m_bEndianSwap16)
@@ -1449,7 +1451,7 @@
//
UINT32 CAVIStream::PeekPacketTime()
{
- //HX_TRACE("CAVIFileFormat::CAVIStream::GetNextPacketTime()\n");
+ HXLOGL4(HXLOG_AVIX,"CAVIStream[%p]::PeekPacketTime()", this);
if (m_pNextPacket)
{
return m_pNextPacket->GetTime();
@@ -1475,7 +1477,7 @@
//
void CAVIStream::GetNextSlice()
{
- //HX_TRACE("CAVIFileFormat::CAVIStream::GetNextSlice()\n");
+ HXLOGL4(HXLOG_AVIX,"CAVIStream[%p]::GetNextSlice()", this);
UINT32 ulNextChunkOffset;
HX_RESULT indexResult;
@@ -1515,7 +1517,7 @@
//
BOOL CAVIStream::CanPrefetchSlice()
{
- //HX_TRACE("CAVIFileFormat::CAVIStream::CanPrefetchSlice()\n");
+ HXLOGL4(HXLOG_AVIX,"CAVIStream[%p]::CanPrefetchSlice()", this);
return (m_ulMaxReadChunk - m_ulMinReadChunk < MAX_CHUNK_PREFETCH) && !m_bRead;
}
@@ -1524,7 +1526,7 @@
//
UINT32 CAVIStream::PeekPrefetchTime()
{
- //HX_TRACE("CAVIFileFormat::CAVIStream::PeekPrefetchSliceTime()\n");
+ HXLOGL4(HXLOG_AVIX,"CAVIStream[%p]::PeekPrefetchSliceTime()", this);
UINT32 ulTime;
if (IsAudio ())
@@ -1545,7 +1547,7 @@
//
BOOL CAVIStream::AtEndOfStream()
{
- //HX_TRACE("CAVIFileFormat::CAVIStream::AtEndOfStream()\n");
+ HXLOGL4(HXLOG_AVIX,"CAVIStream[%p]::AtEndOfStream()", this);
//HX_ASSERT( (m_state != eReady) || (m_pNextPacket && m_bRead)); // Currently we don't prime on init
return m_bRead;
}
@@ -1611,7 +1613,7 @@
// CRiffResponse
STDMETHODIMP CAVIStream::RIFFOpenDone(HX_RESULT status)
{
- //HX_TRACE("CAVIFileFormat::CAVIStream::RIFFOpenDone()\n");
+ HXLOGL4(HXLOG_AVIX,"CAVIStream[%p]::RIFFOpenDone()", this);
HX_ASSERT(m_state == ePreReader);
m_state = eReady;
@@ -1633,7 +1635,7 @@
STDMETHODIMP CAVIStream::RIFFFindChunkDone(HX_RESULT status, UINT32 len)
{
- //HX_TRACE("CAVIFileFormat::CAVIStream::RIFFFindChunkDone()\n");
+ HXLOGL4(HXLOG_AVIX,"CAVIStream[%p]::RIFFFindChunkDone()", this);
HX_ASSERT(m_state == eChunkFind);
HX_ASSERT(SUCCEEDED(status));
@@ -1676,7 +1678,7 @@
if (m_ulChunkReadTarget == m_ulMaxReadChunk)
{
- //HX_TRACE("\tstream: %d\toffset: %lu\n", m_usStream, m_pReader->GetOffset());
+ HXLOGL4(HXLOG_AVIX,"\tstream: %d\toffset: %lu", m_usStream, m_pReader->GetOffset());
if (m_bSeeking)
{
// Find the time of the next packet.
@@ -1742,7 +1744,7 @@
/* Called after a Descend completes */
STDMETHODIMP CAVIStream::RIFFDescendDone(HX_RESULT status)
{
- //HX_TRACE("CAVIFileFormat::CAVIStream::RIFFDescendDone()\n");
+ HXLOGL4(HXLOG_AVIX,"CAVIStream[%p]::RIFFDescendDone()", this);
HX_ASSERT(FALSE); // we don't support multiple MOVI chunks yet
return HXR_NOTIMPL;
}
@@ -1750,7 +1752,7 @@
/* Called after an Ascend completes */
STDMETHODIMP CAVIStream::RIFFAscendDone(HX_RESULT status)
{
- //HX_TRACE("CAVIFileFormat::CAVIStream::RIFFAscendDone()\n");
+ HXLOGL4(HXLOG_AVIX,"CAVIStream[%p]::RIFFAscendDone()", this);
HX_ASSERT(FALSE); // we don't support multiple MOVI chunks yet
return HXR_NOTIMPL;
}
@@ -1759,7 +1761,7 @@
*/
STDMETHODIMP CAVIStream::RIFFReadDone(HX_RESULT status, IHXBuffer *pBuffer)
{
- //HX_TRACE("CAVIFileFormat::CAVIStream::RIFFReadDone()\n");
+ HXLOGL4(HXLOG_AVIX,"CAVIStream[%p]::RIFFReadDone()", this);
HX_ASSERT(m_state == eChunkRead);
HX_ASSERT(CAVIFileFormat::GetStream(ENDIAN_SWAP_32(m_pReader->GetChunkType())) == m_usStream);
HX_ASSERT(m_ulChunkReadTarget == m_ulMaxReadChunk);
@@ -1857,7 +1859,7 @@
/* Called when a seek completes */
STDMETHODIMP CAVIStream::RIFFSeekDone(HX_RESULT status)
{
- //HX_TRACE("CAVIFileFormat::CAVIStream::RIFFSeekDone()\n");
+ HXLOGL4(HXLOG_AVIX,"CAVIStream[%p]::RIFFSeekDone()", this);
HX_ASSERT(m_state == eChunkSeek);
HX_ASSERT(SUCCEEDED(status));
@@ -1882,7 +1884,7 @@
STDMETHODIMP CAVIStream::RIFFGetChunkDone(HX_RESULT status, UINT32 chunkType,
IHXBuffer* pBuffer)
{
-//HX_TRACE("CAVIFileFormat::CAVIStream::RIFFGetChunkDone()\n");
+ HXLOGL4(HXLOG_AVIX,"CAVIStream[%p]::RIFFGetChunkDone()", this);
// HX_ASSERT(!"RIFFGetChunkDone is not used");
// return HXR_NOTIMPL;
@@ -1902,7 +1904,7 @@
IHXCommonClassFactory* pCommonClassFactory,
ULONG32 ulAvgBitRate, INT32 lRTPPayloadType)
{
- //HX_TRACE("CAVIFileFormat::CAVIStream::SetRuleBook()\n");
+ HXLOGL4(HXLOG_AVIX,"CAVIStream[%p]::SetRuleBook()", this);
if ( !pHeader || !pCommonClassFactory )
{
return FALSE;
@@ -1944,6 +1946,7 @@
void CAVIStream::Close()
{
+ HXLOGL2(HXLOG_AVIX,"CAVIStream[%p]::Close()", this);
if(m_pFile)
{
m_pFile->Close();
Index: datatype/avi/fileformat/plugin.cpp
===================================================================
RCS file: /cvsroot/datatype/avi/fileformat/plugin.cpp,v
retrieving revision 1.4
diff -u -w -r1.4 plugin.cpp
--- datatype/avi/fileformat/plugin.cpp 13 Apr 2007 13:06:28 -0000 1.4
+++ datatype/avi/fileformat/plugin.cpp 14 Nov 2008 18:16:38 -0000
@@ -48,7 +48,7 @@
#include "ihxtlogsystem.h"
#include "ihxtlogsystemcontext.h"
#include "hxdllaccess.h"
-#include "ihxfgbuf.h"
+#include "baseobj.h"
#include "riff.h"
#include "riffres.h"
@@ -62,12 +62,17 @@
ENABLE_MULTILOAD_DLLACCESS_PATHS(Avifformat);
#endif
-STDAPI ENTRYPOINT(HXCREATEINSTANCE)(IUnknown** ppIUnknown)
+STDAPI ENTRYPOINTCALLTYPE ENTRYPOINT(HXCREATEINSTANCE)(IUnknown** ppIUnknown)
{
return CAVIFileFormat::HXCreateInstance(ppIUnknown);
}
-STDAPI ENTRYPOINT(CanUnload)(void)
+STDAPI ENTRYPOINTCALLTYPE ENTRYPOINT(CanUnload2)(void)
{
- return CAVIFileFormat::CanUnload();
+ return (CHXBaseCountingObject::ObjectsActive() > 0 ? HXR_FAIL : HXR_OK);
+}
+
+STDAPI ENTRYPOINTCALLTYPE ENTRYPOINT(CanUnload)(void)
+{
+ return ENTRYPOINT(CanUnload2)();
}
Index: datatype/avi/fileformat/pub/aviffpln.h
===================================================================
RCS file: /cvsroot/datatype/avi/fileformat/pub/aviffpln.h,v
retrieving revision 1.6
diff -u -w -r1.6 aviffpln.h
--- datatype/avi/fileformat/pub/aviffpln.h 5 Jun 2008 14:40:38 -0000 1.6
+++ datatype/avi/fileformat/pub/aviffpln.h 14 Nov 2008 18:16:38 -0000
@@ -124,7 +124,6 @@
public:
static HX_RESULT STDAPICALLTYPE HXCreateInstance(IUnknown** ppIUnknown);
- static HX_RESULT CanUnload();
CAVIFileFormat();
static BOOL IsAVChunk(UINT32 ulChunkId);
@@ -400,13 +399,13 @@
IUnknown* m_pContext;
IHXCommonClassFactory* m_pCommonClassFactory;
- static const char* zm_pDescription;
- static const char* zm_pCopyright;
- static const char* zm_pMoreInfoURL;
- static const char* zm_pFileMimeTypes[];
- static const char* zm_pFileExtensions[];
- static const char* zm_pFileOpenNames[];
- static const char* zm_pPacketFormats[];
+ static const char* const zm_pDescription;
+ static const char* const zm_pCopyright;
+ static const char* const zm_pMoreInfoURL;
+ static const char* const zm_pFileMimeTypes[];
+ static const char* const zm_pFileExtensions[];
+ static const char* const zm_pFileOpenNames[];
+ static const char* const zm_pPacketFormats[];
};
#endif // _AVIFFPLIN_H_
Index: datatype/common/util/Umakefil
===================================================================
RCS file: /cvsroot/datatype/common/util/Umakefil,v
retrieving revision 1.13
diff -u -w -r1.13 Umakefil
--- datatype/common/util/Umakefil 6 Jul 2007 22:00:23 -0000 1.13
+++ datatype/common/util/Umakefil 14 Nov 2008 18:16:38 -0000
@@ -56,7 +56,8 @@
"common/dbgtool/pub",
"common/util/pub",
"common/container/pub",
- "common/runtime/pub")
+ "common/runtime/pub",
+ "common/log/logutil/pub")
project.AddSources("bitstream.cpp",
"bitpack.cpp",
Index: datatype/common/util/riff.cpp
===================================================================
RCS file: /cvsroot/datatype/common/util/riff.cpp,v
retrieving revision 1.15
diff -u -w -r1.15 riff.cpp
--- datatype/common/util/riff.cpp 5 Jun 2008 08:33:00 -0000 1.15
+++ datatype/common/util/riff.cpp 14 Nov 2008 18:16:38 -0000
@@ -45,6 +45,7 @@
#include "hxcomm.h"
#include "hxheap.h"
+#include "hxtlogutil.h"
#ifdef _DEBUG
#undef HX_THIS_FILE
static const char HX_THIS_FILE[] = __FILE__;
@@ -114,6 +115,8 @@
m_pResponse = pResponse;
m_pFileObject = pFileObject;
+ HXLOGL2(HXLOG_AVIX,"CRIFFReader[%p]::CRIFFReader CTOR ctx=%p resp=%p fob=%p", this,m_pContext,m_pResponse,m_pFileObject);
+
if ( m_pFileObject )
{
m_pFileObject->AddRef();
@@ -142,6 +145,7 @@
CRIFFReader::~CRIFFReader()
{
+ HXLOGL2(HXLOG_AVIX,"CRIFFReader[%p]::~CRIFFReader() DES ctx=%p resp=%p fob=%p", this,m_pContext,m_pResponse,m_pFileObject);
if ( m_bFileIsOpen )
Close();
@@ -211,6 +215,7 @@
HX_RESULT
CRIFFReader::Close()
{
+ HXLOGL2(HXLOG_AVIX,"CRIFFReader[%p]::Close() ctx=%p resp=%p fob=%p", this,m_pContext,m_pResponse,m_pFileObject);
if ( m_pFileObject )
{
m_pFileObject->Close();
Index: datatype/common/util/pub/riffres.h
===================================================================
RCS file: /cvsroot/datatype/common/util/pub/riffres.h,v
retrieving revision 1.4
diff -u -w -r1.4 riffres.h
--- datatype/common/util/pub/riffres.h 6 Jul 2007 22:00:24 -0000 1.4
+++ datatype/common/util/pub/riffres.h 14 Nov 2008 18:16:41 -0000
@@ -50,7 +50,7 @@
#ifndef __RIFFRES_H__
#define __RIFFRES_H__
-class CRIFFResponse
+class CRIFFResponse : public IUnknown
{
public:
STDMETHOD(RIFFOpenDone)(HX_RESULT) PURE;
@@ -79,9 +79,6 @@
/* Called with the data from a GetChunk request */
STDMETHOD(RIFFGetChunkDone)(HX_RESULT, UINT32, IHXBuffer*) PURE;
- STDMETHOD(QueryInterface) (THIS_ REFIID riid, void** ppvObj) PURE;
- STDMETHOD_(ULONG32,AddRef) (THIS) PURE;
- STDMETHOD_(ULONG32,Release) (THIS) PURE;
};
#endif /* __RIFFRES_H_ */
Index: datatype/mdf/video/format/mp4/mdfmp4payloadformat.cpp
===================================================================
RCS file: /cvsroot/datatype/mdf/video/format/mp4/mdfmp4payloadformat.cpp,v
retrieving revision 1.19
diff -u -w -r1.19 mdfmp4payloadformat.cpp
--- datatype/mdf/video/format/mp4/mdfmp4payloadformat.cpp 24 Jan 2008 00:19:18 -0000 1.19
+++ datatype/mdf/video/format/mp4/mdfmp4payloadformat.cpp 14 Nov 2008 18:16:41 -0000
@@ -260,7 +260,7 @@
const TDesC8& CMP4PayloadFormatPluginDevice::GetVideoProfile() const
{
MDFVIDEOLOG_ENTERFN( "GetVideoProfile" );
- MDFVIDEOLOG_WRITE_FORMAT( " Profile for mp4 payload is %d", m_lProfile );
+ MDFVIDEOLOG_WRITE_FORMAT2( " Profile for mp4 payload is %d", m_lProfile );
MDFVIDEOLOG_LEAVEFN( "GetVideoProfile" );
// From ISO/IEC 14496-2 Annex G Table G-1
@@ -310,6 +310,7 @@
aPayloadFormatInfo.AppendMimeType( KVideoMimeTypeMP4ES, KVideoMimeTypeKeywordMP4 );
aPayloadFormatInfo.AppendMimeType( KVideoMimeTypeMP4RN, KVideoMimeTypeKeywordMP4 );
+ aPayloadFormatInfo.AppendMimeType( KVideoMimeTypeMP4DIVX, KVideoMimeTypeKeywordMP4 );
aPayloadFormatInfo.SetPayloadFormatId( KUidMP4PayloadFormatPluginDevice );
MDFVIDEOLOG_LEAVEFN( "SetVideoMimetypes" );
@@ -334,6 +335,14 @@
if( m_pMP4Depacketizer )
{
const TUint8* bitstreamheader = (const TUint8*) m_pMP4Depacketizer->GetBitstreamHeader();
+ MDFVIDEOLOG_WRITE_FORMAT( " bitstreamheader %x", bitstreamheader );
+ if(bitstreamheader == NULL)
+ {
+ pPictureHeader.iOptional = NULL;
+ retVal = TRUE;
+ }
+ else
+ {
TInt length = (TInt) m_pMP4Depacketizer->GetBitstreamHeaderSize();
TPtrC8* pStreamHeader = new TPtrC8( bitstreamheader, length );
@@ -341,6 +350,7 @@
pPictureHeader.iOptional = (TDesC8*) pStreamHeader;
retVal = TRUE;
}
+ }
//fill iSizeInMemory and iDisplayedRect fields of pPictureHeader
//must be placed here since width and height are found in
Index: datatype/mp4/audio/renderer/mp3decinfo.cpp
===================================================================
RCS file: /cvsroot/datatype/mp4/audio/renderer/mp3decinfo.cpp,v
retrieving revision 1.5
diff -u -w -r1.5 mp3decinfo.cpp
--- datatype/mp4/audio/renderer/mp3decinfo.cpp 14 Mar 2005 19:17:42 -0000 1.5
+++ datatype/mp4/audio/renderer/mp3decinfo.cpp 14 Nov 2008 18:16:41 -0000
@@ -42,7 +42,8 @@
if (pMimeType &&
(!strcmp(pMimeType, "audio/X-MP3-draft-00") ||
!strcmp(pMimeType, "audio/X-MP3-draft-00-RN") ||
- !strcmp(pMimeType, "audio/MPEG-ELEMENTARY")))
+ !strcmp(pMimeType, "audio/MPEG-ELEMENTARY") ||
+ !strcmp(pMimeType, "audio/rn-mpeg")))
{
bRet = TRUE;
}
Index: datatype/mp4/audio/renderer/mp4audio.cpp
===================================================================
RCS file: /cvsroot/datatype/mp4/audio/renderer/mp4audio.cpp,v
retrieving revision 1.24
diff -u -w -r1.24 mp4audio.cpp
--- datatype/mp4/audio/renderer/mp4audio.cpp 4 Jul 2008 07:21:39 -0000 1.24
+++ datatype/mp4/audio/renderer/mp4audio.cpp 14 Nov 2008 18:16:41 -0000
@@ -110,6 +110,7 @@
"audio/X-MP3-draft-00",
"audio/X-MP3-draft-00-RN",
"audio/MPEG-ELEMENTARY",
+ "audio/rn-mpeg",
#endif /* #if defined(HELIX_FEATURE_AUDIO_CODEC_MP3) */
NULL
};
Index: datatype/mp4/payload/mp4vpyld.cpp
===================================================================
RCS file: /cvsroot/datatype/mp4/payload/mp4vpyld.cpp,v
retrieving revision 1.20
diff -u -w -r1.20 mp4vpyld.cpp
--- datatype/mp4/payload/mp4vpyld.cpp 19 Dec 2006 17:20:29 -0000 1.20
+++ datatype/mp4/payload/mp4vpyld.cpp 14 Nov 2008 18:16:41 -0000
@@ -556,9 +556,15 @@
return retVal;
}
-HX_RESULT MP4VPayloadFormat::SetAssemblerHXAVIHeader(IHXValues* /* pHeader */)
+HX_RESULT MP4VPayloadFormat::SetAssemblerHXAVIHeader(IHXValues* pHeader)
{
- return HXR_OK;
+ HX_RESULT retVal = HXR_OK;
+
+ // We'll let decoder initialize with in-band bitstream
+ HX_VECTOR_DELETE(m_pBitstreamHeader);
+ m_ulBitstreamHeaderSize = 0;
+
+ return retVal;
}
STDMETHODIMP
Index: datatype/tools/metadataeng/engine/platform/symbian/hxthumbnail_dlls.txt
===================================================================
RCS file: /cvsroot/datatype/tools/metadataeng/engine/platform/symbian/hxthumbnail_dlls.txt,v
retrieving revision 1.1
diff -u -w -r1.1 hxthumbnail_dlls.txt
--- datatype/tools/metadataeng/engine/platform/symbian/hxthumbnail_dlls.txt 24 Jan 2008 17:22:57 -0000 1.1
+++ datatype/tools/metadataeng/engine/platform/symbian/hxthumbnail_dlls.txt 14 Nov 2008 18:16:42 -0000
@@ -3,3 +3,4 @@
smplfsys.dll
asfff.dll
mdfvidrender.dll
+avifformat.dll
From ehyche at real.com Fri Nov 14 12:59:31 2008
From: ehyche at real.com (Eric Hyche)
Date: Fri Nov 14 11:02:31 2008
Subject: [datatype-dev] RE: [Nokia-private-dev] CR needed: REQ 403-11594,
SUB 417-12093: Helix engine support for the AVI file
format (210Cays)
In-Reply-To:
References: <009d01c94673$78c43e00$6a4cba00$@com>
Message-ID: <00be01c9469b$e4d46610$ae7d3230$@com>
Yury,
HEAD changes look good as well.
Eric
=======================================
Eric Hyche (ehyche@real.com)
Principal Engineer
RealNetworks, Inc.
>-----Original Message-----
>From: Yury.Ramanovich@nokia.com [mailto:Yury.Ramanovich@nokia.com]
>Sent: Friday, November 14, 2008 1:29 PM
>To: Yury.Ramanovich@nokia.com; ehyche@real.com; datatype-dev@helixcommunity.org; client-
>dev@helixcommunity.org; nokia-private-dev@helixcommunity.org
>Subject: RE: [Nokia-private-dev] CR needed: REQ 403-11594,SUB 417-12093: Helix engine support for the
>AVI file format (210Cays)
>
>HI Eric
>
>Heres the HEAD diff
>
>And the list of files changed on HEAD
>
>/client/common/system/hxfsmgr.cpp,v
>
>/clientapps/symbianMmf/videocontroller/101F8513.rss,v
>
>/clientapps/symbianMmf/videocontroller/installMMF.pcf,v
>
>/common/include/platform.h,v
>
>/common/system/platform/symbian/symbianrecognizer.cpp,v
>
>/datatype/avi/fileformat/aviffdll,v
>
>/datatype/avi/fileformat/avifflib,v
>
>/datatype/avi/fileformat/aviffpln.cpp,v
>
>/datatype/avi/fileformat/aviindx.cpp,v
>
>/datatype/avi/fileformat/avistrm.cpp,v
>
>/datatype/avi/fileformat/plugin.cpp,v
>
>/datatype/avi/fileformat/pub/aviffpln.h,v
>
>/datatype/common/util/Umakefil,v
>
>/datatype/common/util/riff.cpp,v
>
>/datatype/common/util/pub/riffres.h,v
>
>/datatype/mdf/video/format/mp4/mdfmp4payloadformat.cpp,v
>
>/datatype/mp4/audio/renderer/mp3decinfo.cpp,v
>
>/datatype/mp4/audio/renderer/mp4audio.cpp,v
>
>/datatype/mp4/payload/mp4vpyld.cpp,v
>
>/datatype/tools/metadataeng/engine/platform/symbian/hxthumbnail_dlls.txt
>,v
>
>Thanks
>Yury
>>-----Original Message-----
>>From: nokia-private-dev-bounces@helixcommunity.org
>>[mailto:nokia-private-dev-bounces@helixcommunity.org] On Behalf Of ext
>>Yury.Ramanovich@nokia.com
>>Sent: Friday, November 14, 2008 10:40 AM
>>To: ehyche@real.com; datatype-dev@helixcommunity.org;
>>client-dev@helixcommunity.org; nokia-private-dev@helixcommunity.org
>>Subject: RE: [Nokia-private-dev] CR needed: REQ 403-11594,SUB
>>417-12093: Helix engine support for the AVI file format (210Cays)
>>
>>HI Eric
>>
>>We do build both avifformat.dll and aviffpln.lib but currently we use
>>avifformat.dll. We don't build vidplin.dll for our installation.
>>
>>
>> I'll send you HEAD changes shortly
>>
>>Yury
>>
>>>-----Original Message-----
>>>From: ext Eric Hyche [mailto:ehyche@real.com]
>>>Sent: Friday, November 14, 2008 10:10 AM
>>>To: Ramanovich Yury (Nokia-D-MSW/Dallas);
>>>datatype-dev@helixcommunity.org; client-dev@helixcommunity.org;
>>>nokia-private-dev@helixcommunity.org
>>>Subject: RE: [Nokia-private-dev] CR needed: REQ 403-11594, SUB
>>>417-12093: Helix engine support for the AVI file format (210Cays)
>>>
>>>Yury,
>>>
>>>I noticed you build avifformat.dll. Do you guys include
>>>datatype/group/video (vidplin.dll) in your installer?
>>>We generally include the AVI fileformat in the datatype/group/video
>>>instead of building a separate .dll for it. However,
>>whichever way you
>>>guys want to do it is fine. Just FYI.
>>>
>>>Can you tell me specifically what files are being changed on HEAD?
>>>
>>>+STDAPI HXEXPORT ENTRYPOINT(HXCREATEINSTANCE)(IUnknown** ppIUnknown)
>>>
>>>On HEAD and 310Atlas, entrypoints should be defined like this:
>>>
>>>+STDAPI ENTRYPOINTCALLTYPE ENTRYPOINT(HXCREATEINSTANCE)(IUnknown**
>>>+ppIUnknown)
>>>
>>>Changes in general look good, but I'd like to take a closer
>>look at the
>>>files which are changing on HEAD.
>>>
>>>Eric
>>>
>>>=======================================
>>>Eric Hyche (ehyche@real.com)
>>>Principal Engineer
>>>RealNetworks, Inc.
>>>
>>>
>>>>-----Original Message-----
>>>>From: nokia-private-dev-bounces@helixcommunity.org
>>>>[mailto:nokia-private-dev- bounces@helixcommunity.org] On Behalf Of
>>>>Yury.Ramanovich@nokia.com
>>>>Sent: Friday, November 14, 2008 10:19 AM
>>>>To: datatype-dev@helixcommunity.org; client-dev@helixcommunity.org;
>>>>nokia-private- dev@helixcommunity.org
>>>>Subject: [Nokia-private-dev] CR needed: REQ 403-11594, SUB
>>417-12093:
>>>>Helix engine support for the AVI file format (210Cays)
>>>>
>>>>Modified by: yury.ramanovich@nokia.com
>>>>
>>>>Reviewed by:
>>>>
>>>>Date: 11/14/2008
>>>>
>>>>Project: SymbianMmf_rel
>>>>
>>>>ErrorId: REQ 403-11594 Helix support for AVI file parsing;
>>>> SUB 417-12093: Helix engine support for the AVI file format
>>>>
>>>>Synopsis: this is port of helix AVI fileformat support from atlas310
>>>>branch to Cays210
>>>>
>>>>Overview: 1) added datatype_avi_fileformat to dependlist for
>>>>symbian_mmf_client module; added symbian platform to
>>includeplatforms
>>>>for datatype_avi_fileformat module in
>>>hxclient_2_1_0_cayennes.bif and
>>>>helix.bif;
>>>>
>>>>2) merged datatype/avi/fileformat and
>>>datatype\common\util\riff.cpp changes/fixes from from atlas310.
>>>>3) add helix logging in aviffpln.cpp, aviindx.cpp, avistrm.cpp and
>>>>datatype\common\util\riff.cpp; to see AVI logs, AVIX filter
>>>needs to be
>>>>added to clientapps\symbiancommon\config\R1_Mobile_4_0_Factory.cfg
>>>>
>>>>4) to fix global data problem -> removed usage of global variable
>>>>g_nRefCount_avif in aviffpln.cpp, used CHXBaseCountingObject
>>instead;
>>>>also replaced CAVIFileFormat::CanUnload() with CanUnload()
>>>function in
>>>>plugin.cpp; Also CanUnload() function now calls CanUnload2()
>>>>
>>>>5) added const to CAVIFileFormat::zm_pDescription and similar
>>>variables
>>>>to fix static uninitialized data problems
>>>>6) fixed winscw build buster while building aviffpln.lib caused by
>>>>extra forward slash in a module include path in
>>>>datatype\avi\fileformat\avifflib
>>>>
>>>>7) added several avi file mimetypes to
>>>>CAVIFileFormat::zm_pFileMimeTypes
>>>>
>>>>8) added IMPLEMENTATION_INFO structure for Helix AVI Fileformat to
>>>>clientapps\symbianMmf\videocontroller\101F8513.rss to enable avi
>>>>support on Symbian
>>>>
>>>>9) added avifformat to
>>>>clientapps\symbianMmf\videocontroller\installMMF.pcf
>>>>
>>>>10) changed CRIFFResponse class to inherit from Iunknown.
>>>Consequently,
>>>>removed QueryInterface(),
>>>>AddRef() and Release() methods from CRIFFResponse class since
>>>they are already declared in Iunknown.
>>>>This fixes HX_ASSERT failure during seek or end of playback. Where
>>>>CAVIIndex::RIFFFindChunkDone() method was called in wrong state. The
>>>>reason for ASSERT is that when Release() is called on CAVIIndex it
>>>>caused CAVIIndex::RIFFFindChunkDone to be called instead; CAVIIndex
>>>>inherits from CRIFFResponse and implements Release() method, but on
>>>>Symbian HX_ReleaseFunc casts all objects to Iunknown, so to
>>>find implementation of Release() the 3rd method in virtual table for
>>>CRIFFResponse was picked, which happened to be
>>>RIFFFindChunkDone() instead of Release().
>>>>
>>>>11) fixed a few memory leaks: in CRnMp3Ren::OnHeader() merged the
>>>>memory leak fix from Atlas310 branch; in
>>>>HXFileSystemManager::ProcessGetRelativeFileObjectPending()
>>>release m_pSamePool before QI- ing it.
>>>>
>>>>12) in CMP4PayloadFormatPluginDevice::SetVideoMimetypes, append
>>>>"video/X-HX-DIVX" mimetype to payloadinfo list of mimetypes
>>>to enable matching the MPEG4 video decoder to this mimetype.
>>>>
>>>>in MP4VPayloadFormat::SetAssemblerHXAVIHeader() delete and set
>>>>m_pBitstreamHeader to NULL; so that
>>>>CMP4PayloadFormatPluginDevice::FormPictureHeader() will set
>>>>pPictureHeader.iOptional to NULL to let the decoder
>>>initialize itself with first frame.
>>>>
>>>>13) add "audio/rn-mpeg" mimetype to
>>>>CMP4AudioRenderer::zm_pStreamMimeTypes[] and to
>>>>CMP3DecInfo::IsMatch() to enable mp3 audio playback in .avi
>>files via
>>>>CMP4AudioRenderer
>>>>
>>>>14) added AVI file recognition in symbianrecognizer.cpp and
>>>>avifformat.dll to hxthumbnail_dlls.txt to enable .AVI
>>>thumbnails displayed.
>>>>
>>>>
>>>>Files modified:
>>>>/common/build/BIF/helix.bif
>>>>/client/build/BIF/hxclient_2_1_0_cayennes.bif
>>>>/client/common/system/hxfsmgr.cpp
>>>>/clientapps/symbianMmf/videocontroller/101F8513.rss
>>>>/clientapps/symbianMmf/videocontroller/installMMF.pcf
>>>>/datatype/avi/fileformat/Umakefil
>>>>/datatype/avi/fileformat/aviffdll
>>>>/datatype/avi/fileformat/avifflib
>>>>/datatype/avi/fileformat/aviffpln.cpp
>>>>/datatype/avi/fileformat/aviindx.cpp
>>>>/datatype/avi/fileformat/avistrm.cpp
>>>>/datatype/avi/fileformat/plugin.cpp
>>>>/datatype/avi/fileformat/pub/aviffpln.h
>>>>/datatype/avi/fileformat/pub/avistrm.h
>>>>/datatype/common/util/Umakefil
>>>>/datatype/common/util/riff.cpp
>>>>/datatype/common/util/pub/riffres.h
>>>>/datatype/mdf/video/format/mp4/mdfmp4payloadformat.cpp
>>>>/datatype/mp3/renderer/mp3rend.cpp
>>>>/datatype/mp4/audio/renderer/mp3decinfo.cpp
>>>>/datatype/mp4/audio/renderer/mp4audio.cpp
>>>>/datatype/mp4/payload/mp4vpyld.cpp
>>>>/common/system/platform/symbian/symbianrecognizer.cpp
>>>>/datatype/tools/metadataeng/engine/platform/symbian/hxthumbnai
>>>l_dlls.tx
>>>>t
>>>>
>>>>Files added:
>>>>None.
>>>>
>>>>CVS diff
>>>><>
>>>><>
>>>>
>>>>Image Size and Heap Use impact: +47KB
>>>>
>>>>Module Release testing (STIF) : yes
>>>>
>>>>Test case(s) Added : No
>>>>
>>>>Memory leak check performed : Yes. No new memory leaks introduced.
>>>>
>>>>Platforms and Profiles Build Verified:
>>helix-client-s60-50-mmf-mdf-arm
>>>>
>>>>Platforms and Profiles Functionality verified: armv5, winscw
>>>>
>>>>Branch: 210Cays, HEAD
>>>
>>>
>>>
>>
>>_______________________________________________
>>Nokia-private-dev mailing list
>>Nokia-private-dev@helixcommunity.org
>>http://lists.helixcommunity.org/mailman/listinfo/nokia-private-dev
>>
From Yury.Ramanovich at nokia.com Fri Nov 14 14:07:25 2008
From: Yury.Ramanovich at nokia.com (Yury.Ramanovich@nokia.com)
Date: Fri Nov 14 12:10:27 2008
Subject: [datatype-dev] RE: [Nokia-private-dev] CR needed: REQ 403-11594,
SUB 417-12093: Helix engine support for the AVI file
format (210Cays)
In-Reply-To: <00be01c9469b$e4d46610$ae7d3230$@com>
References: <009d01c94673$78c43e00$6a4cba00$@com>
<00be01c9469b$e4d46610$ae7d3230$@com>
Message-ID:
Thanks Eric, checked in to 210Cays and HEAD
Yury
>-----Original Message-----
>From: ext Eric Hyche [mailto:ehyche@real.com]
>Sent: Friday, November 14, 2008 3:00 PM
>To: Ramanovich Yury (Nokia-D-MSW/Dallas);
>datatype-dev@helixcommunity.org;
>client-dev@helixcommunity.org; nokia-private-dev@helixcommunity.org
>Subject: RE: [Nokia-private-dev] CR needed: REQ 403-11594,SUB
>417-12093: Helix engine support for the AVI file format (210Cays)
>
>Yury,
>
>HEAD changes look good as well.
>
>Eric
>
>=======================================
>Eric Hyche (ehyche@real.com)
>Principal Engineer
>RealNetworks, Inc.
>
>
>>-----Original Message-----
>>From: Yury.Ramanovich@nokia.com [mailto:Yury.Ramanovich@nokia.com]
>>Sent: Friday, November 14, 2008 1:29 PM
>>To: Yury.Ramanovich@nokia.com; ehyche@real.com;
>>datatype-dev@helixcommunity.org; client- dev@helixcommunity.org;
>>nokia-private-dev@helixcommunity.org
>>Subject: RE: [Nokia-private-dev] CR needed: REQ 403-11594,SUB
>>417-12093: Helix engine support for the AVI file format (210Cays)
>>
>>HI Eric
>>
>>Heres the HEAD diff
>>
>>And the list of files changed on HEAD
>>
>>/client/common/system/hxfsmgr.cpp,v
>>
>>/clientapps/symbianMmf/videocontroller/101F8513.rss,v
>>
>>/clientapps/symbianMmf/videocontroller/installMMF.pcf,v
>>
>>/common/include/platform.h,v
>>
>>/common/system/platform/symbian/symbianrecognizer.cpp,v
>>
>>/datatype/avi/fileformat/aviffdll,v
>>
>>/datatype/avi/fileformat/avifflib,v
>>
>>/datatype/avi/fileformat/aviffpln.cpp,v
>>
>>/datatype/avi/fileformat/aviindx.cpp,v
>>
>>/datatype/avi/fileformat/avistrm.cpp,v
>>
>>/datatype/avi/fileformat/plugin.cpp,v
>>
>>/datatype/avi/fileformat/pub/aviffpln.h,v
>>
>>/datatype/common/util/Umakefil,v
>>
>>/datatype/common/util/riff.cpp,v
>>
>>/datatype/common/util/pub/riffres.h,v
>>
>>/datatype/mdf/video/format/mp4/mdfmp4payloadformat.cpp,v
>>
>>/datatype/mp4/audio/renderer/mp3decinfo.cpp,v
>>
>>/datatype/mp4/audio/renderer/mp4audio.cpp,v
>>
>>/datatype/mp4/payload/mp4vpyld.cpp,v
>>
>>/datatype/tools/metadataeng/engine/platform/symbian/hxthumbnai
>l_dlls.tx
>>t
>>,v
>>
>>Thanks
>>Yury
>>>-----Original Message-----
>>>From: nokia-private-dev-bounces@helixcommunity.org
>>>[mailto:nokia-private-dev-bounces@helixcommunity.org] On
>Behalf Of ext
>>>Yury.Ramanovich@nokia.com
>>>Sent: Friday, November 14, 2008 10:40 AM
>>>To: ehyche@real.com; datatype-dev@helixcommunity.org;
>>>client-dev@helixcommunity.org; nokia-private-dev@helixcommunity.org
>>>Subject: RE: [Nokia-private-dev] CR needed: REQ 403-11594,SUB
>>>417-12093: Helix engine support for the AVI file format (210Cays)
>>>
>>>HI Eric
>>>
>>>We do build both avifformat.dll and aviffpln.lib but
>currently we use
>>>avifformat.dll. We don't build vidplin.dll for our installation.
>>>
>>>
>>> I'll send you HEAD changes shortly
>>>
>>>Yury
>>>
>>>>-----Original Message-----
>>>>From: ext Eric Hyche [mailto:ehyche@real.com]
>>>>Sent: Friday, November 14, 2008 10:10 AM
>>>>To: Ramanovich Yury (Nokia-D-MSW/Dallas);
>>>>datatype-dev@helixcommunity.org; client-dev@helixcommunity.org;
>>>>nokia-private-dev@helixcommunity.org
>>>>Subject: RE: [Nokia-private-dev] CR needed: REQ 403-11594, SUB
>>>>417-12093: Helix engine support for the AVI file format (210Cays)
>>>>
>>>>Yury,
>>>>
>>>>I noticed you build avifformat.dll. Do you guys include
>>>>datatype/group/video (vidplin.dll) in your installer?
>>>>We generally include the AVI fileformat in the datatype/group/video
>>>>instead of building a separate .dll for it. However,
>>>whichever way you
>>>>guys want to do it is fine. Just FYI.
>>>>
>>>>Can you tell me specifically what files are being changed on HEAD?
>>>>
>>>>+STDAPI HXEXPORT ENTRYPOINT(HXCREATEINSTANCE)(IUnknown** ppIUnknown)
>>>>
>>>>On HEAD and 310Atlas, entrypoints should be defined like this:
>>>>
>>>>+STDAPI ENTRYPOINTCALLTYPE ENTRYPOINT(HXCREATEINSTANCE)(IUnknown**
>>>>+ppIUnknown)
>>>>
>>>>Changes in general look good, but I'd like to take a closer
>>>look at the
>>>>files which are changing on HEAD.
>>>>
>>>>Eric
>>>>
>>>>=======================================
>>>>Eric Hyche (ehyche@real.com)
>>>>Principal Engineer
>>>>RealNetworks, Inc.
>>>>
>>>>
>>>>>-----Original Message-----
>>>>>From: nokia-private-dev-bounces@helixcommunity.org
>>>>>[mailto:nokia-private-dev- bounces@helixcommunity.org] On
>Behalf Of
>>>>>Yury.Ramanovich@nokia.com
>>>>>Sent: Friday, November 14, 2008 10:19 AM
>>>>>To: datatype-dev@helixcommunity.org; client-dev@helixcommunity.org;
>>>>>nokia-private- dev@helixcommunity.org
>>>>>Subject: [Nokia-private-dev] CR needed: REQ 403-11594, SUB
>>>417-12093:
>>>>>Helix engine support for the AVI file format (210Cays)
>>>>>
>>>>>Modified by: yury.ramanovich@nokia.com
>>>>>
>>>>>Reviewed by:
>>>>>
>>>>>Date: 11/14/2008
>>>>>
>>>>>Project: SymbianMmf_rel
>>>>>
>>>>>ErrorId: REQ 403-11594 Helix support for AVI file parsing;
>>>>> SUB 417-12093: Helix engine support for the AVI
>file format
>>>>>
>>>>>Synopsis: this is port of helix AVI fileformat support
>from atlas310
>>>>>branch to Cays210
>>>>>
>>>>>Overview: 1) added datatype_avi_fileformat to dependlist for
>>>>>symbian_mmf_client module; added symbian platform to
>>>includeplatforms
>>>>>for datatype_avi_fileformat module in
>>>>hxclient_2_1_0_cayennes.bif and
>>>>>helix.bif;
>>>>>
>>>>>2) merged datatype/avi/fileformat and
>>>>datatype\common\util\riff.cpp changes/fixes from from atlas310.
>>>>>3) add helix logging in aviffpln.cpp, aviindx.cpp, avistrm.cpp and
>>>>>datatype\common\util\riff.cpp; to see AVI logs, AVIX filter
>>>>needs to be
>>>>>added to clientapps\symbiancommon\config\R1_Mobile_4_0_Factory.cfg
>>>>>
>>>>>4) to fix global data problem -> removed usage of global variable
>>>>>g_nRefCount_avif in aviffpln.cpp, used CHXBaseCountingObject
>>>instead;
>>>>>also replaced CAVIFileFormat::CanUnload() with CanUnload()
>>>>function in
>>>>>plugin.cpp; Also CanUnload() function now calls CanUnload2()
>>>>>
>>>>>5) added const to CAVIFileFormat::zm_pDescription and similar
>>>>variables
>>>>>to fix static uninitialized data problems
>>>>>6) fixed winscw build buster while building aviffpln.lib caused by
>>>>>extra forward slash in a module include path in
>>>>>datatype\avi\fileformat\avifflib
>>>>>
>>>>>7) added several avi file mimetypes to
>>>>>CAVIFileFormat::zm_pFileMimeTypes
>>>>>
>>>>>8) added IMPLEMENTATION_INFO structure for Helix AVI Fileformat to
>>>>>clientapps\symbianMmf\videocontroller\101F8513.rss to enable avi
>>>>>support on Symbian
>>>>>
>>>>>9) added avifformat to
>>>>>clientapps\symbianMmf\videocontroller\installMMF.pcf
>>>>>
>>>>>10) changed CRIFFResponse class to inherit from Iunknown.
>>>>Consequently,
>>>>>removed QueryInterface(),
>>>>>AddRef() and Release() methods from CRIFFResponse class since
>>>>they are already declared in Iunknown.
>>>>>This fixes HX_ASSERT failure during seek or end of playback. Where
>>>>>CAVIIndex::RIFFFindChunkDone() method was called in wrong
>state. The
>>>>>reason for ASSERT is that when Release() is called on CAVIIndex it
>>>>>caused CAVIIndex::RIFFFindChunkDone to be called instead;
>CAVIIndex
>>>>>inherits from CRIFFResponse and implements Release()
>method, but on
>>>>>Symbian HX_ReleaseFunc casts all objects to Iunknown, so to
>>>>find implementation of Release() the 3rd method in virtual
>table for
>>>>CRIFFResponse was picked, which happened to be
>>>>RIFFFindChunkDone() instead of Release().
>>>>>
>>>>>11) fixed a few memory leaks: in CRnMp3Ren::OnHeader() merged the
>>>>>memory leak fix from Atlas310 branch; in
>>>>>HXFileSystemManager::ProcessGetRelativeFileObjectPending()
>>>>release m_pSamePool before QI- ing it.
>>>>>
>>>>>12) in CMP4PayloadFormatPluginDevice::SetVideoMimetypes, append
>>>>>"video/X-HX-DIVX" mimetype to payloadinfo list of mimetypes
>>>>to enable matching the MPEG4 video decoder to this mimetype.
>>>>>
>>>>>in MP4VPayloadFormat::SetAssemblerHXAVIHeader() delete and set
>>>>>m_pBitstreamHeader to NULL; so that
>>>>>CMP4PayloadFormatPluginDevice::FormPictureHeader() will set
>>>>>pPictureHeader.iOptional to NULL to let the decoder
>>>>initialize itself with first frame.
>>>>>
>>>>>13) add "audio/rn-mpeg" mimetype to
>>>>>CMP4AudioRenderer::zm_pStreamMimeTypes[] and to
>>>>>CMP3DecInfo::IsMatch() to enable mp3 audio playback in .avi
>>>files via
>>>>>CMP4AudioRenderer
>>>>>
>>>>>14) added AVI file recognition in symbianrecognizer.cpp and
>>>>>avifformat.dll to hxthumbnail_dlls.txt to enable .AVI
>>>>thumbnails displayed.
>>>>>
>>>>>
>>>>>Files modified:
>>>>>/common/build/BIF/helix.bif
>>>>>/client/build/BIF/hxclient_2_1_0_cayennes.bif
>>>>>/client/common/system/hxfsmgr.cpp
>>>>>/clientapps/symbianMmf/videocontroller/101F8513.rss
>>>>>/clientapps/symbianMmf/videocontroller/installMMF.pcf
>>>>>/datatype/avi/fileformat/Umakefil
>>>>>/datatype/avi/fileformat/aviffdll
>>>>>/datatype/avi/fileformat/avifflib
>>>>>/datatype/avi/fileformat/aviffpln.cpp
>>>>>/datatype/avi/fileformat/aviindx.cpp
>>>>>/datatype/avi/fileformat/avistrm.cpp
>>>>>/datatype/avi/fileformat/plugin.cpp
>>>>>/datatype/avi/fileformat/pub/aviffpln.h
>>>>>/datatype/avi/fileformat/pub/avistrm.h
>>>>>/datatype/common/util/Umakefil
>>>>>/datatype/common/util/riff.cpp
>>>>>/datatype/common/util/pub/riffres.h
>>>>>/datatype/mdf/video/format/mp4/mdfmp4payloadformat.cpp
>>>>>/datatype/mp3/renderer/mp3rend.cpp
>>>>>/datatype/mp4/audio/renderer/mp3decinfo.cpp
>>>>>/datatype/mp4/audio/renderer/mp4audio.cpp
>>>>>/datatype/mp4/payload/mp4vpyld.cpp
>>>>>/common/system/platform/symbian/symbianrecognizer.cpp
>>>>>/datatype/tools/metadataeng/engine/platform/symbian/hxthumbnai
>>>>l_dlls.tx
>>>>>t
>>>>>
>>>>>Files added:
>>>>>None.
>>>>>
>>>>>CVS diff
>>>>><>
>>>>><>
>>>>>
>>>>>Image Size and Heap Use impact: +47KB
>>>>>
>>>>>Module Release testing (STIF) : yes
>>>>>
>>>>>Test case(s) Added : No
>>>>>
>>>>>Memory leak check performed : Yes. No new memory leaks introduced.
>>>>>
>>>>>Platforms and Profiles Build Verified:
>>>helix-client-s60-50-mmf-mdf-arm
>>>>>
>>>>>Platforms and Profiles Functionality verified: armv5, winscw
>>>>>
>>>>>Branch: 210Cays, HEAD
>>>>
>>>>
>>>>
>>>
>>>_______________________________________________
>>>Nokia-private-dev mailing list
>>>Nokia-private-dev@helixcommunity.org
>>>http://lists.helixcommunity.org/mailman/listinfo/nokia-private-dev
>>>
>
>
From Alvaro.Vaquero at nokia.com Mon Nov 17 09:06:19 2008
From: Alvaro.Vaquero at nokia.com (Alvaro.Vaquero@nokia.com)
Date: Mon Nov 17 07:08:53 2008
Subject: [datatype-dev] CR: SHEE-7KLP76 - Partial FLV playback on gadget.
Message-ID: <2334E6CC5C1FD34F90C1167EA4EBFE5B07191A73@daebe102.NOE.Nokia.com>
Skipped content of type multipart/alternative-------------- next part --------------
Index: audioconfigs.cpp
===================================================================
RCS file: /cvsroot/datatype/mp4/audio/mdf/platform/symbian/audioconfigs.cpp,v
retrieving revision 1.2.2.5
diff -w -u -b -r1.2.2.5 audioconfigs.cpp
--- audioconfigs.cpp 28 Aug 2007 19:28:33 -0000 1.2.2.5
+++ audioconfigs.cpp 13 Nov 2008 23:52:55 -0000
@@ -72,6 +72,10 @@
{
pAudConfig = new HXAudioConfiguratorAMRWB;
}
+ else if(!strcmp(pFourCC, "mp3d"))
+ {
+ pAudConfig = new HXAudioConfiguratorMP3;
+ }
else
{
HXLOGL2(HXLOG_MDFA,
@@ -566,3 +570,123 @@
return result;
}
+//--- MP3 -------------------------------------------------------------------
+
+// local constants
+// Defines
+#define DEFAULT_MP3_MAXSAMPLESOUT 2304
+#define DEFAULT_MP3_NUMCHANNELS 2
+#define DEFAULT_MP3_SAMPLERATE 44100
+#define DEFAULT_MP3_DELAY 0
+#define DEFAULT_MP3_STEREO_TO_MONO 1
+#define DEFAULT_MP3_CONCEALMENT 1
+#define DEFAULT_MP3_DECIM_FACTOR 1
+#define DEFAULT_MP3_LEFT_RIGHT 0
+#define DEFAULT_MP3_BITS_PER_SAMPLE 16
+#define MAX_BITSTREAM_VERSION 0
+
+HXAudioConfiguratorMP3::HXAudioConfiguratorMP3():
+ HXAudioConfigurator(KMMFFourCCCodeMP3, // fourCC
+ 0, // InputFrameLength
+ DEFAULT_MP3_MAXSAMPLESOUT, // SamplesPerFrame
+ DEFAULT_MP3_NUMCHANNELS, // NumChannels
+ DEFAULT_MP3_BITS_PER_SAMPLE, // BitsPerSample
+ DEFAULT_MP3_SAMPLERATE, // SamplesPerSecond
+ DEFAULT_MP3_DELAY) // DelayInSamples
+ , m_bStereoToMono(DEFAULT_MP3_STEREO_TO_MONO)
+ , m_uLeftRight(DEFAULT_MP3_LEFT_RIGHT)
+ , m_uDecimFactor(DEFAULT_MP3_DECIM_FACTOR)
+ , m_bConcealment(DEFAULT_MP3_CONCEALMENT)
+{
+}
+
+HX_RESULT HXAudioConfiguratorMP3::ValidateDecoderConfig(UINT32 cfgType,
+ const void* config,
+ UINT32 nBytes)
+{
+ HX_RESULT result = HXR_OK;
+
+ // See if we have config data
+ if (config && nBytes)
+ {
+ if (nBytes >= 4)
+ {
+ // Get the version
+ BYTE* pBuf = (BYTE*) config;
+ UINT32 ulVersion = (pBuf[0] << 24) | (pBuf[1] << 16) | (pBuf[2] << 8) | pBuf[3];
+ // Can we support this version?
+ if (ulVersion <= MAX_BITSTREAM_VERSION)
+ {
+ // Parse version 0
+ if (ulVersion == 0 && nBytes >= 16)
+ {
+ // Parse the values
+ UINT32 ulNumChannels = (pBuf[4] << 24) | (pBuf[5] << 16) | (pBuf[6] << 8) | pBuf[7];
+ UINT32 ulSampleRate = (pBuf[8] << 24) | (pBuf[9] << 16) | (pBuf[10] << 8) | pBuf[11];
+ UINT32 ulDelay = (pBuf[12] << 24) | (pBuf[13] << 16) | (pBuf[14] << 8) | pBuf[15];
+
+ // Assign the number of channels if non-NULL
+ if (ulNumChannels) m_uNumChannels = ulNumChannels;
+ // Assign the sample rate if non-NULL
+ if (ulSampleRate) m_ulSamplesPerSecond = ulSampleRate;
+ // Assign the delay
+ m_ulCodecDelayInSamples = ulDelay;
+ }
+ }
+ }
+ }
+
+ result = ValidateDecoderInfo();
+
+ return result;
+}
+
+HX_RESULT HXAudioConfiguratorMP3::ValidateDecoderInfo()
+{
+ HX_RESULT result = HXR_OK;
+
+ // we only support up to 2 channels
+ if(m_uNumChannels != 1 && m_uNumChannels != 2)
+ {
+ HXLOGL2(HXLOG_MDFA,
+ "HXAudioConfiguratorMP3::ValidateDecoderInfo() HXR_NOT_SUPPORTED: number of channels=%d",
+ m_uNumChannels);
+
+ result = HXR_NOT_SUPPORTED;
+ }
+ return result;
+}
+
+HX_RESULT HXAudioConfiguratorMP3::ConfigureDecoder(CMMFCodec* pDecoder)
+{
+ HX_RESULT result = HXR_OK;
+
+ if (m_uNumChannels == 1)
+ {
+ m_bStereoToMono = true;
+ }
+ else
+ {
+ m_bStereoToMono = false;
+ }
+
+ RArray configParams;
+ configParams.Append(m_bStereoToMono);
+ configParams.Append(m_uLeftRight);
+ configParams.Append(m_uDecimFactor);
+ configParams.Append(m_bConcealment);
+ configParams.Append(m_uBitsPerSample);
+ configParams.Append(m_ulSamplesPerSecond);
+
+ TUid codecId = TUid::Uid(KUidMmfCodecAudioSettings);
+
+ TRAPD(err, pDecoder->ConfigureL(codecId, (TDesC8&) configParams));
+ if(KErrNone != err)
+ {
+ result = HXR_FAIL;
+ }
+
+ configParams.Close();
+
+ return result;
+}
-------------- next part --------------
Index: audioconfigs.h
===================================================================
RCS file: /cvsroot/datatype/mp4/audio/mdf/pub/platform/symbian/audioconfigs.h,v
retrieving revision 1.2.2.1
diff -w -u -b -r1.2.2.1 audioconfigs.h
--- audioconfigs.h 22 Mar 2006 21:24:20 -0000 1.2.2.1
+++ audioconfigs.h 13 Nov 2008 23:53:26 -0000
@@ -97,4 +97,27 @@
UINT16 m_uExtObjectType;
};
+//*** MP3 ********************************************************************
+
+class HXAudioConfiguratorMP3: public HXAudioConfigurator
+{
+public:
+
+ HXAudioConfiguratorMP3();
+
+ virtual HX_RESULT ValidateDecoderConfig(UINT32 cfgType,
+ const void* config,
+ UINT32 nBytes);
+
+ virtual HX_RESULT ConfigureDecoder(CMMFCodec* pDecoder);
+
+private:
+
+ HX_RESULT ValidateDecoderInfo();
+
+ HXBOOL m_bStereoToMono; // stereo to mono switch (TRUE or default FALSE)
+ UINT16 m_uLeftRight; // decode left or right channel (1 left, 2 right, 0 default all)
+ UINT16 m_uDecimFactor; // decimation factor (2, 4 or default 1)
+ HXBOOL m_bConcealment; // error concealment level (0 none, default 1)
+};
#endif // __AUDIO_CONFIGS_H__
-------------- next part --------------
Index: hxclient_2_2_1_cayennes.bif
===================================================================
RCS file: /cvsroot/client/build/BIF/hxclient_2_2_1_cayennes.bif,v
retrieving revision 1.2
diff -w -u -b -r1.2 hxclient_2_2_1_cayennes.bif
--- hxclient_2_2_1_cayennes.bif 18 Sep 2008 22:52:49 -0000 1.2
+++ hxclient_2_2_1_cayennes.bif 13 Nov 2008 23:45:26 -0000
@@ -256,7 +256,10 @@
unix mac win32 openwave tm1 wince
-
+
+ helix-client-s60-32-mmf-mdf-dsp
+ helix-client-s60-32-mmf-mdf-arm
+
@@ -4074,10 +4077,12 @@
helix-client-s60-mmf-basic
helix-client-s60-mmf-mdf-dsp
helix-client-s60-mmf-mdf-arm
- helix-client-s60-32-mmf-mdf-dsp
- helix-client-s60-32-mmf-mdf-arm
helix-client-s60-advanced
+
+ helix-client-s60-32-mmf-mdf-dsp
+ helix-client-s60-32-mmf-mdf-arm
+
common_include
@@ -4097,6 +4102,10 @@
common_include
common_import_zlib
+
+ helix-client-s60-32-mmf-mdf-dsp
+ helix-client-s60-32-mmf-mdf-arm
+
@@ -7536,6 +7545,8 @@
datatype_xps
+
+ datatype_mp3
-------------- next part --------------
Index: installMMF.pcf
===================================================================
RCS file: /cvsroot/clientapps/symbianMmf/videocontroller/installMMF.pcf,v
retrieving revision 1.5.2.16.2.1
diff -w -u -b -r1.5.2.16.2.1 installMMF.pcf
--- installMMF.pcf 18 Sep 2008 22:43:38 -0000 1.5.2.16.2.1
+++ installMMF.pcf 13 Nov 2008 23:54:47 -0000
@@ -263,7 +263,6 @@
Add('arma')
Remove('amrn', 'amrw')
Remove('raac')
- Remove('mp3fformat')
Remove('mp3d')
Remove('mp3render')
@@ -271,7 +270,6 @@
Add('dspmdfaud')
Remove('amrn', 'amrw')
Remove('raac')
- Remove('mp3fformat')
Remove('mp3d')
Remove('mp3render')
-------------- next part --------------
Index: mdfswdecinfo.cpp
===================================================================
RCS file: /cvsroot/datatype/mp4/audio/renderer/mdfswdecinfo.cpp,v
retrieving revision 1.1.2.2
diff -w -u -b -r1.1.2.2 mdfswdecinfo.cpp
--- mdfswdecinfo.cpp 9 Mar 2007 23:43:18 -0000 1.1.2.2
+++ mdfswdecinfo.cpp 13 Nov 2008 23:53:59 -0000
@@ -39,6 +39,7 @@
#include "aacdecinfo.h"
#include "amrdecinfo.h"
#include "amrwbdecinfo.h"
+#include "mp3decinfo.h"
#include "mdfswdecinfo.h"
CMDFSWDecInfo::CMDFSWDecInfo(CMP4ADecoder* decoder)
@@ -79,6 +80,11 @@
m_pDecInfo = &m_AMRWBDecInfo;
return TRUE;
}
+ if(m_MP3DecInfo.IsMatch(pMimeType, pRssm))
+ {
+ m_pDecInfo = &m_MP3DecInfo;
+ return TRUE;
+ }
return FALSE;
}
Index: mdfswdecinfo.h
===================================================================
RCS file: /cvsroot/datatype/mp4/audio/renderer/mdfswdecinfo.h,v
retrieving revision 1.2.2.1
diff -w -u -b -r1.2.2.1 mdfswdecinfo.h
--- mdfswdecinfo.h 9 Mar 2007 23:43:09 -0000 1.2.2.1
+++ mdfswdecinfo.h 13 Nov 2008 23:53:59 -0000
@@ -42,6 +42,7 @@
class CAACDecInfo;
class CAMRNBDecInfo;
class CAMRWBDecInfo;
+class CMP3DecInfo;
class CMP4ADecoder;
class CMDFSWDecInfo : public CDecoderInfo
@@ -61,6 +62,7 @@
CAACDecInfo m_AACDecInfo;
CAMRNBDecInfo m_AMRNBDecInfo;
CAMRWBDecInfo m_AMRWBDecInfo;
+ CMP3DecInfo m_MP3DecInfo;
CMP4ADecoder* m_pDecoder;
};
Index: mp3decinfo.h
===================================================================
RCS file: /cvsroot/datatype/mp4/audio/renderer/mp3decinfo.h,v
retrieving revision 1.4
diff -w -u -b -r1.4 mp3decinfo.h
--- mp3decinfo.h 14 Mar 2005 19:17:42 -0000 1.4
+++ mp3decinfo.h 13 Nov 2008 23:53:59 -0000
@@ -41,6 +41,7 @@
class CMP3DecInfo : public CDecoderInfo
{
+public:
virtual HXBOOL IsMatch(const char* pMimeType, IMP4APayloadFormat* pRssm);
virtual const char* GetLibName(void);
virtual const char* GetCodecFourCC(void);
From stanb at real.com Mon Nov 17 17:20:03 2008
From: stanb at real.com (Stanislav Bobrovskiy)
Date: Mon Nov 17 15:22:20 2008
Subject: [datatype-dev] CR: PR#229755 Video stops early when Flash10 is
installed
Message-ID: <6.2.1.2.2.20081117171057.044e28b8@mailone.real.com>
Synopsis:
Flash renderer stops sending video at some point when used from DTDR. It
only happens when Flash 10 is cleanly installed on a machine.
Overview:
I found what change in datatype/flash/flashhost caused the problem to occur
and it happens to be setting m_bEnableThreading to TRUE in
datatype/flash/flashhost/flash_guest_player.cpp. I suggest resetting this
flag back to FALSE until someone can find out what exactly is broken when
we try to enable it.
Files Added
None
Files Modified:
datatype/flash/flashhost/flash_guest_player.cpp
Branch:
atlas310, HEAD
Files Attached:
datatype_flash_flashhost.diff
-------------- next part --------------
? datatype/flash/flashhost/Makefile
? datatype/flash/flashhost/Umakefil.upp
? datatype/flash/flashhost/datatype_flash_flashhost.sln
? datatype/flash/flashhost/datatype_flash_flashhost.vcproj
? datatype/flash/flashhost/datatype_flash_flashhost_flashhostdll.sln
? datatype/flash/flashhost/datatype_flash_flashhost_flashhostdll.vcproj
? datatype/flash/flashhost/datatype_flash_flashhost_flashhostlib.sln
? datatype/flash/flashhost/datatype_flash_flashhost_flashhostlib.vcproj
? datatype/flash/flashhost/dbg32
? datatype/flash/flashhost/flashhost.def
? datatype/flash/flashhost/flashhost.idb
? datatype/flash/flashhost/flashhost.pdb
? datatype/flash/flashhost/flashhostdll.mak
? datatype/flash/flashhost/flashhostdll.upp
? datatype/flash/flashhost/flashhostlib.idb
? datatype/flash/flashhost/flashhostlib.mak
? datatype/flash/flashhost/flashhostlib.pdb
? datatype/flash/flashhost/flashhostlib.upp
? datatype/flash/flashhost/pylinktmp-flashhost
? datatype/flash/flashhost/ribosome_logs
? datatype/flash/flashhost/vc70.idb
Index: datatype/flash/flashhost/flash_guest_player.cpp
===================================================================
RCS file: /cvsroot/datatype/flash/flashhost/flash_guest_player.cpp,v
retrieving revision 1.33.2.36
diff -u -1 -0 -r1.33.2.36 flash_guest_player.cpp
--- datatype/flash/flashhost/flash_guest_player.cpp 7 Nov 2008 03:18:25 -0000 1.33.2.36
+++ datatype/flash/flashhost/flash_guest_player.cpp 18 Nov 2008 01:02:24 -0000
@@ -114,21 +114,21 @@
, m_pNetworkConfig(NULL)
, m_ulDuration(dDefaultDuration)
, m_ulCustomDuration(0)
, m_ulLastUpdatedPlayTime(0)
, m_ulLastReportedPlayTime(0)
, m_ulLastPlayTimeUpdateTick(0)
, m_bTransparent(FALSE)
, m_bLoop(TRUE)
, m_bDisableAlphaBlending(FALSE)
, m_bDisableDefaultSize(FALSE)
- , m_bEnableThreading(TRUE)
+ , m_bEnableThreading(FALSE)
, m_bLowerThreadPriority(FALSE)
, m_pExternalInterfaceResponse(NULL)
, m_pRepresentingSite(NULL)
#if defined(MAC_OSX)
, m_bWindowlessPref(TRUE)
, m_bWindowless(TRUE)
#elif defined(_WINDOWS)
, m_hwndParent(NULL)
, m_bWindowlessPref(TRUE)
, m_bWindowless(TRUE)
From sfu at real.com Tue Nov 18 06:02:19 2008
From: sfu at real.com (Sheldon Fu)
Date: Tue Nov 18 04:04:27 2008
Subject: [datatype-dev] CR: PR#229755 Video stops early when Flash10 is
installed
In-Reply-To: <6.2.1.2.2.20081117171057.044e28b8@mailone.real.com>
References: <6.2.1.2.2.20081117171057.044e28b8@mailone.real.com>
Message-ID: <4922CAEB.80001@real.com>
ra/ve need this to be enabled for automatic FLV frame skipping
(alpha-blending enabled rendering in flashhost is very heavy, especially
in fullscreen).
Since DTDR is for transcoding, skipping frame is not right and DTDR
doesn't need real-time performance so it is quite ok or even preferred
to run flashhost in non-threading mode for DTDR.
Is there a way for flashhost to detect that it is running within the
context of DTDR and disable threading selectively?
fxd
Stanislav Bobrovskiy wrote:
> Synopsis:
> Flash renderer stops sending video at some point when used from DTDR.
> It only happens when Flash 10 is cleanly installed on a machine.
>
> Overview:
> I found what change in datatype/flash/flashhost caused the problem to
> occur and it happens to be setting m_bEnableThreading to TRUE in
> datatype/flash/flashhost/flash_guest_player.cpp. I suggest resetting
> this flag back to FALSE until someone can find out what exactly is
> broken when we try to enable it.
>
> Files Added
> None
>
> Files Modified:
> datatype/flash/flashhost/flash_guest_player.cpp
>
> Branch:
> atlas310, HEAD
>
> Files Attached:
> datatype_flash_flashhost.diff
From ping at real.com Tue Nov 18 09:34:14 2008
From: ping at real.com (Henry Ping)
Date: Tue Nov 18 07:36:12 2008
Subject: [datatype-dev] CR: PR#229755 Video stops early when Flash10 is
installed
In-Reply-To: <4922CAEB.80001@real.com>
References: <6.2.1.2.2.20081117171057.044e28b8@mailone.real.com>
<4922CAEB.80001@real.com>
Message-ID: <2CFD9E78645D4F3BB4A9795CB9AC2648@corp.real.com>
Don't we have a preference to enable/disable the threading inside flashhost?
Then, It'll be up to the application to decide by setting the preference.
Since the threading logic is newly added for ra/ve and only tested in the
context of ra/ve, Stan's change to turn it off by default is reasonable.
Henry
> -----Original Message-----
> From: Sheldon Fu [mailto:sfu@real.com]
> Sent: Tuesday, November 18, 2008 6:02 AM
> To: Stanislav Bobrovskiy
> Cc: datatype-dev@helixcommunity.org; Henry Ping
> Subject: Re: [datatype-dev] CR: PR#229755 Video stops early
> when Flash10 is installed
>
> ra/ve need this to be enabled for automatic FLV frame
> skipping (alpha-blending enabled rendering in flashhost is
> very heavy, especially in fullscreen).
>
> Since DTDR is for transcoding, skipping frame is not right
> and DTDR doesn't need real-time performance so it is quite ok
> or even preferred to run flashhost in non-threading mode for DTDR.
>
> Is there a way for flashhost to detect that it is running
> within the context of DTDR and disable threading selectively?
>
> fxd
>
> Stanislav Bobrovskiy wrote:
> > Synopsis:
> > Flash renderer stops sending video at some point when used
> from DTDR.
> > It only happens when Flash 10 is cleanly installed on a machine.
> >
> > Overview:
> > I found what change in datatype/flash/flashhost caused the
> problem to
> > occur and it happens to be setting m_bEnableThreading to TRUE in
> > datatype/flash/flashhost/flash_guest_player.cpp. I suggest
> resetting
> > this flag back to FALSE until someone can find out what exactly is
> > broken when we try to enable it.
> >
> > Files Added
> > None
> >
> > Files Modified:
> > datatype/flash/flashhost/flash_guest_player.cpp
> >
> > Branch:
> > atlas310, HEAD
> >
> > Files Attached:
> > datatype_flash_flashhost.diff
>
From sfu at real.com Tue Nov 18 09:45:10 2008
From: sfu at real.com (Sheldon Fu)
Date: Tue Nov 18 07:47:13 2008
Subject: [datatype-dev] CR: PR#229755 Video stops early when Flash10 is
installed
In-Reply-To: <2CFD9E78645D4F3BB4A9795CB9AC2648@corp.real.com>
References: <6.2.1.2.2.20081117171057.044e28b8@mailone.real.com>
<4922CAEB.80001@real.com>
<2CFD9E78645D4F3BB4A9795CB9AC2648@corp.real.com>
Message-ID: <4922FF26.50703@real.com>
This is flashhost used for FLV playback as main video. There is no
direct application to load flashhost and call SetPreference (unlike
ra/ve ui's use of flashhost).
There is a registry setting to control threading though, so if we want
to turn the threading off by default and use that setting (in xml file)
to turn it on for ra/ve, then it's fine.
fxd
Henry Ping wrote:
> Don't we have a preference to enable/disable the threading inside flashhost?
> Then, It'll be up to the application to decide by setting the preference.
>
> Since the threading logic is newly added for ra/ve and only tested in the
> context of ra/ve, Stan's change to turn it off by default is reasonable.
>
> Henry
>
>
>> -----Original Message-----
>> From: Sheldon Fu [mailto:sfu@real.com]
>> Sent: Tuesday, November 18, 2008 6:02 AM
>> To: Stanislav Bobrovskiy
>> Cc: datatype-dev@helixcommunity.org; Henry Ping
>> Subject: Re: [datatype-dev] CR: PR#229755 Video stops early
>> when Flash10 is installed
>>
>> ra/ve need this to be enabled for automatic FLV frame
>> skipping (alpha-blending enabled rendering in flashhost is
>> very heavy, especially in fullscreen).
>>
>> Since DTDR is for transcoding, skipping frame is not right
>> and DTDR doesn't need real-time performance so it is quite ok
>> or even preferred to run flashhost in non-threading mode for DTDR.
>>
>> Is there a way for flashhost to detect that it is running
>> within the context of DTDR and disable threading selectively?
>>
>> fxd
>>
>> Stanislav Bobrovskiy wrote:
>>
>>> Synopsis:
>>> Flash renderer stops sending video at some point when used
>>>
>> from DTDR.
>>
>>> It only happens when Flash 10 is cleanly installed on a machine.
>>>
>>> Overview:
>>> I found what change in datatype/flash/flashhost caused the
>>>
>> problem to
>>
>>> occur and it happens to be setting m_bEnableThreading to TRUE in
>>> datatype/flash/flashhost/flash_guest_player.cpp. I suggest
>>>
>> resetting
>>
>>> this flag back to FALSE until someone can find out what exactly is
>>> broken when we try to enable it.
>>>
>>> Files Added
>>> None
>>>
>>> Files Modified:
>>> datatype/flash/flashhost/flash_guest_player.cpp
>>>
>>> Branch:
>>> atlas310, HEAD
>>>
>>> Files Attached:
>>> datatype_flash_flashhost.diff
>>>
>
>
>
From ping at real.com Tue Nov 18 09:54:18 2008
From: ping at real.com (Henry Ping)
Date: Tue Nov 18 07:56:15 2008
Subject: [datatype-dev] CR: PR#229755 Video stops early when Flash10 is
installed
In-Reply-To: <4922FF26.50703@real.com>
References: <6.2.1.2.2.20081117171057.044e28b8@mailone.real.com>
<4922CAEB.80001@real.com>
<2CFD9E78645D4F3BB4A9795CB9AC2648@corp.real.com>
<4922FF26.50703@real.com>
Message-ID:
I refer to preference as IHXPreferences.
Stan, you change looks good.
Henry
> -----Original Message-----
> From: Sheldon Fu [mailto:sfu@real.com]
> Sent: Tuesday, November 18, 2008 9:45 AM
> To: ping@real.com
> Cc: 'Stanislav Bobrovskiy'; datatype-dev@helixcommunity.org
> Subject: Re: [datatype-dev] CR: PR#229755 Video stops early
> when Flash10 is installed
>
> This is flashhost used for FLV playback as main video. There
> is no direct application to load flashhost and call
> SetPreference (unlike ra/ve ui's use of flashhost).
>
> There is a registry setting to control threading though, so
> if we want to turn the threading off by default and use that
> setting (in xml file) to turn it on for ra/ve, then it's fine.
>
> fxd
>
> Henry Ping wrote:
> > Don't we have a preference to enable/disable the threading
> inside flashhost?
> > Then, It'll be up to the application to decide by setting
> the preference.
> >
> > Since the threading logic is newly added for ra/ve and only
> tested in
> > the context of ra/ve, Stan's change to turn it off by
> default is reasonable.
> >
> > Henry
> >
> >
> >> -----Original Message-----
> >> From: Sheldon Fu [mailto:sfu@real.com]
> >> Sent: Tuesday, November 18, 2008 6:02 AM
> >> To: Stanislav Bobrovskiy
> >> Cc: datatype-dev@helixcommunity.org; Henry Ping
> >> Subject: Re: [datatype-dev] CR: PR#229755 Video stops early when
> >> Flash10 is installed
> >>
> >> ra/ve need this to be enabled for automatic FLV frame skipping
> >> (alpha-blending enabled rendering in flashhost is very heavy,
> >> especially in fullscreen).
> >>
> >> Since DTDR is for transcoding, skipping frame is not right
> and DTDR
> >> doesn't need real-time performance so it is quite ok or even
> >> preferred to run flashhost in non-threading mode for DTDR.
> >>
> >> Is there a way for flashhost to detect that it is running
> within the
> >> context of DTDR and disable threading selectively?
> >>
> >> fxd
> >>
> >> Stanislav Bobrovskiy wrote:
> >>
> >>> Synopsis:
> >>> Flash renderer stops sending video at some point when used
> >>>
> >> from DTDR.
> >>
> >>> It only happens when Flash 10 is cleanly installed on a machine.
> >>>
> >>> Overview:
> >>> I found what change in datatype/flash/flashhost caused the
> >>>
> >> problem to
> >>
> >>> occur and it happens to be setting m_bEnableThreading to TRUE in
> >>> datatype/flash/flashhost/flash_guest_player.cpp. I suggest
> >>>
> >> resetting
> >>
> >>> this flag back to FALSE until someone can find out what
> exactly is
> >>> broken when we try to enable it.
> >>>
> >>> Files Added
> >>> None
> >>>
> >>> Files Modified:
> >>> datatype/flash/flashhost/flash_guest_player.cpp
> >>>
> >>> Branch:
> >>> atlas310, HEAD
> >>>
> >>> Files Attached:
> >>> datatype_flash_flashhost.diff
> >>>
> >
> >
> >
>
From Alvaro.Vaquero at nokia.com Tue Nov 18 14:10:34 2008
From: Alvaro.Vaquero at nokia.com (Alvaro.Vaquero@nokia.com)
Date: Tue Nov 18 12:12:38 2008
Subject: [datatype-dev] RESEND: SHEE-7KLP76 - Partial FLV playback on
Cayennes 221.
Message-ID: <2334E6CC5C1FD34F90C1167EA4EBFE5B071C9C4A@daebe102.NOE.Nokia.com>
Skipped content of type multipart/alternative-------------- next part --------------
Index: audioconfigs.cpp
===================================================================
RCS file: /cvsroot/datatype/mp4/audio/mdf/platform/symbian/audioconfigs.cpp,v
retrieving revision 1.2.2.5
diff -w -u -b -r1.2.2.5 audioconfigs.cpp
--- audioconfigs.cpp 28 Aug 2007 19:28:33 -0000 1.2.2.5
+++ audioconfigs.cpp 13 Nov 2008 23:52:55 -0000
@@ -72,6 +72,10 @@
{
pAudConfig = new HXAudioConfiguratorAMRWB;
}
+ else if(!strcmp(pFourCC, "mp3d"))
+ {
+ pAudConfig = new HXAudioConfiguratorMP3;
+ }
else
{
HXLOGL2(HXLOG_MDFA,
@@ -566,3 +570,123 @@
return result;
}
+//--- MP3 -------------------------------------------------------------------
+
+// local constants
+// Defines
+#define DEFAULT_MP3_MAXSAMPLESOUT 2304
+#define DEFAULT_MP3_NUMCHANNELS 2
+#define DEFAULT_MP3_SAMPLERATE 44100
+#define DEFAULT_MP3_DELAY 0
+#define DEFAULT_MP3_STEREO_TO_MONO 1
+#define DEFAULT_MP3_CONCEALMENT 1
+#define DEFAULT_MP3_DECIM_FACTOR 1
+#define DEFAULT_MP3_LEFT_RIGHT 0
+#define DEFAULT_MP3_BITS_PER_SAMPLE 16
+#define MAX_BITSTREAM_VERSION 0
+
+HXAudioConfiguratorMP3::HXAudioConfiguratorMP3():
+ HXAudioConfigurator(KMMFFourCCCodeMP3, // fourCC
+ 0, // InputFrameLength
+ DEFAULT_MP3_MAXSAMPLESOUT, // SamplesPerFrame
+ DEFAULT_MP3_NUMCHANNELS, // NumChannels
+ DEFAULT_MP3_BITS_PER_SAMPLE, // BitsPerSample
+ DEFAULT_MP3_SAMPLERATE, // SamplesPerSecond
+ DEFAULT_MP3_DELAY) // DelayInSamples
+ , m_bStereoToMono(DEFAULT_MP3_STEREO_TO_MONO)
+ , m_uLeftRight(DEFAULT_MP3_LEFT_RIGHT)
+ , m_uDecimFactor(DEFAULT_MP3_DECIM_FACTOR)
+ , m_bConcealment(DEFAULT_MP3_CONCEALMENT)
+{
+}
+
+HX_RESULT HXAudioConfiguratorMP3::ValidateDecoderConfig(UINT32 cfgType,
+ const void* config,
+ UINT32 nBytes)
+{
+ HX_RESULT result = HXR_OK;
+
+ // See if we have config data
+ if (config && nBytes)
+ {
+ if (nBytes >= 4)
+ {
+ // Get the version
+ BYTE* pBuf = (BYTE*) config;
+ UINT32 ulVersion = (pBuf[0] << 24) | (pBuf[1] << 16) | (pBuf[2] << 8) | pBuf[3];
+ // Can we support this version?
+ if (ulVersion <= MAX_BITSTREAM_VERSION)
+ {
+ // Parse version 0
+ if (ulVersion == 0 && nBytes >= 16)
+ {
+ // Parse the values
+ UINT32 ulNumChannels = (pBuf[4] << 24) | (pBuf[5] << 16) | (pBuf[6] << 8) | pBuf[7];
+ UINT32 ulSampleRate = (pBuf[8] << 24) | (pBuf[9] << 16) | (pBuf[10] << 8) | pBuf[11];
+ UINT32 ulDelay = (pBuf[12] << 24) | (pBuf[13] << 16) | (pBuf[14] << 8) | pBuf[15];
+
+ // Assign the number of channels if non-NULL
+ if (ulNumChannels) m_uNumChannels = ulNumChannels;
+ // Assign the sample rate if non-NULL
+ if (ulSampleRate) m_ulSamplesPerSecond = ulSampleRate;
+ // Assign the delay
+ m_ulCodecDelayInSamples = ulDelay;
+ }
+ }
+ }
+ }
+
+ result = ValidateDecoderInfo();
+
+ return result;
+}
+
+HX_RESULT HXAudioConfiguratorMP3::ValidateDecoderInfo()
+{
+ HX_RESULT result = HXR_OK;
+
+ // we only support up to 2 channels
+ if(m_uNumChannels != 1 && m_uNumChannels != 2)
+ {
+ HXLOGL2(HXLOG_MDFA,
+ "HXAudioConfiguratorMP3::ValidateDecoderInfo() HXR_NOT_SUPPORTED: number of channels=%d",
+ m_uNumChannels);
+
+ result = HXR_NOT_SUPPORTED;
+ }
+ return result;
+}
+
+HX_RESULT HXAudioConfiguratorMP3::ConfigureDecoder(CMMFCodec* pDecoder)
+{
+ HX_RESULT result = HXR_OK;
+
+ if (m_uNumChannels == 1)
+ {
+ m_bStereoToMono = true;
+ }
+ else
+ {
+ m_bStereoToMono = false;
+ }
+
+ RArray configParams;
+ configParams.Append(m_bStereoToMono);
+ configParams.Append(m_uLeftRight);
+ configParams.Append(m_uDecimFactor);
+ configParams.Append(m_bConcealment);
+ configParams.Append(m_uBitsPerSample);
+ configParams.Append(m_ulSamplesPerSecond);
+
+ TUid codecId = TUid::Uid(KUidMmfCodecAudioSettings);
+
+ TRAPD(err, pDecoder->ConfigureL(codecId, (TDesC8&) configParams));
+ if(KErrNone != err)
+ {
+ result = HXR_FAIL;
+ }
+
+ configParams.Close();
+
+ return result;
+}
-------------- next part --------------
Index: audioconfigs.h
===================================================================
RCS file: /cvsroot/datatype/mp4/audio/mdf/pub/platform/symbian/audioconfigs.h,v
retrieving revision 1.2.2.1
diff -w -u -b -r1.2.2.1 audioconfigs.h
--- audioconfigs.h 22 Mar 2006 21:24:20 -0000 1.2.2.1
+++ audioconfigs.h 13 Nov 2008 23:53:26 -0000
@@ -97,4 +97,27 @@
UINT16 m_uExtObjectType;
};
+//*** MP3 ********************************************************************
+
+class HXAudioConfiguratorMP3: public HXAudioConfigurator
+{
+public:
+
+ HXAudioConfiguratorMP3();
+
+ virtual HX_RESULT ValidateDecoderConfig(UINT32 cfgType,
+ const void* config,
+ UINT32 nBytes);
+
+ virtual HX_RESULT ConfigureDecoder(CMMFCodec* pDecoder);
+
+private:
+
+ HX_RESULT ValidateDecoderInfo();
+
+ HXBOOL m_bStereoToMono; // stereo to mono switch (TRUE or default FALSE)
+ UINT16 m_uLeftRight; // decode left or right channel (1 left, 2 right, 0 default all)
+ UINT16 m_uDecimFactor; // decimation factor (2, 4 or default 1)
+ HXBOOL m_bConcealment; // error concealment level (0 none, default 1)
+};
#endif // __AUDIO_CONFIGS_H__
-------------- next part --------------
Index: hxclient_2_2_1_cayennes.bif
===================================================================
RCS file: /cvsroot/client/build/BIF/hxclient_2_2_1_cayennes.bif,v
retrieving revision 1.2
diff -w -u -b -r1.2 hxclient_2_2_1_cayennes.bif
--- hxclient_2_2_1_cayennes.bif 18 Sep 2008 22:52:49 -0000 1.2
+++ hxclient_2_2_1_cayennes.bif 13 Nov 2008 23:45:26 -0000
@@ -256,7 +256,10 @@
unix mac win32 openwave tm1 wince
-
+
+ helix-client-s60-32-mmf-mdf-dsp
+ helix-client-s60-32-mmf-mdf-arm
+
@@ -4074,10 +4077,12 @@
helix-client-s60-mmf-basic
helix-client-s60-mmf-mdf-dsp
helix-client-s60-mmf-mdf-arm
- helix-client-s60-32-mmf-mdf-dsp
- helix-client-s60-32-mmf-mdf-arm
helix-client-s60-advanced
+
+ helix-client-s60-32-mmf-mdf-dsp
+ helix-client-s60-32-mmf-mdf-arm
+
common_include
@@ -4097,6 +4102,10 @@
common_include
common_import_zlib
+
+ helix-client-s60-32-mmf-mdf-dsp
+ helix-client-s60-32-mmf-mdf-arm
+
@@ -7536,6 +7545,8 @@
datatype_xps
+
+ datatype_mp3
-------------- next part --------------
Index: installMMF.pcf
===================================================================
RCS file: /cvsroot/clientapps/symbianMmf/videocontroller/installMMF.pcf,v
retrieving revision 1.5.2.16.2.1
diff -w -u -b -r1.5.2.16.2.1 installMMF.pcf
--- installMMF.pcf 18 Sep 2008 22:43:38 -0000 1.5.2.16.2.1
+++ installMMF.pcf 13 Nov 2008 23:54:47 -0000
@@ -263,7 +263,6 @@
Add('arma')
Remove('amrn', 'amrw')
Remove('raac')
- Remove('mp3fformat')
Remove('mp3d')
Remove('mp3render')
@@ -271,7 +270,6 @@
Add('dspmdfaud')
Remove('amrn', 'amrw')
Remove('raac')
- Remove('mp3fformat')
Remove('mp3d')
Remove('mp3render')
-------------- next part --------------
Index: mdfswdecinfo.cpp
===================================================================
RCS file: /cvsroot/datatype/mp4/audio/renderer/mdfswdecinfo.cpp,v
retrieving revision 1.1.2.2
diff -w -u -b -r1.1.2.2 mdfswdecinfo.cpp
--- mdfswdecinfo.cpp 9 Mar 2007 23:43:18 -0000 1.1.2.2
+++ mdfswdecinfo.cpp 13 Nov 2008 23:53:59 -0000
@@ -39,6 +39,7 @@
#include "aacdecinfo.h"
#include "amrdecinfo.h"
#include "amrwbdecinfo.h"
+#include "mp3decinfo.h"
#include "mdfswdecinfo.h"
CMDFSWDecInfo::CMDFSWDecInfo(CMP4ADecoder* decoder)
@@ -79,6 +80,11 @@
m_pDecInfo = &m_AMRWBDecInfo;
return TRUE;
}
+ if(m_MP3DecInfo.IsMatch(pMimeType, pRssm))
+ {
+ m_pDecInfo = &m_MP3DecInfo;
+ return TRUE;
+ }
return FALSE;
}
Index: mdfswdecinfo.h
===================================================================
RCS file: /cvsroot/datatype/mp4/audio/renderer/mdfswdecinfo.h,v
retrieving revision 1.2.2.1
diff -w -u -b -r1.2.2.1 mdfswdecinfo.h
--- mdfswdecinfo.h 9 Mar 2007 23:43:09 -0000 1.2.2.1
+++ mdfswdecinfo.h 13 Nov 2008 23:53:59 -0000
@@ -42,6 +42,7 @@
class CAACDecInfo;
class CAMRNBDecInfo;
class CAMRWBDecInfo;
+class CMP3DecInfo;
class CMP4ADecoder;
class CMDFSWDecInfo : public CDecoderInfo
@@ -61,6 +62,7 @@
CAACDecInfo m_AACDecInfo;
CAMRNBDecInfo m_AMRNBDecInfo;
CAMRWBDecInfo m_AMRWBDecInfo;
+ CMP3DecInfo m_MP3DecInfo;
CMP4ADecoder* m_pDecoder;
};
Index: mp3decinfo.h
===================================================================
RCS file: /cvsroot/datatype/mp4/audio/renderer/mp3decinfo.h,v
retrieving revision 1.4
diff -w -u -b -r1.4 mp3decinfo.h
--- mp3decinfo.h 14 Mar 2005 19:17:42 -0000 1.4
+++ mp3decinfo.h 13 Nov 2008 23:53:59 -0000
@@ -41,6 +41,7 @@
class CMP3DecInfo : public CDecoderInfo
{
+public:
virtual HXBOOL IsMatch(const char* pMimeType, IMP4APayloadFormat* pRssm);
virtual const char* GetLibName(void);
virtual const char* GetCodecFourCC(void);
From ehyche at real.com Wed Nov 19 06:04:24 2008
From: ehyche at real.com (Eric Hyche)
Date: Wed Nov 19 04:06:20 2008
Subject: [datatype-dev] RE: [Clientapps-dev] CR: SHEE-7KLP76 - Partial FLV
playback on gadget.
In-Reply-To: <2334E6CC5C1FD34F90C1167EA4EBFE5B07191A73@daebe102.NOE.Nokia.com>
References: <2334E6CC5C1FD34F90C1167EA4EBFE5B07191A73@daebe102.NOE.Nokia.com>
Message-ID: <005301c94a4f$bb512960$31f37c20$@com>
These changes look good to me.
=======================================
Eric Hyche (ehyche@real.com)
Principal Engineer
RealNetworks, Inc.
>-----Original Message-----
>From: clientapps-dev-bounces@helixcommunity.org [mailto:clientapps-dev-bounces@helixcommunity.org] On
>Behalf Of Alvaro.Vaquero@nokia.com
>Sent: Monday, November 17, 2008 12:06 PM
>To: datatype-dev@helixcommunity.org; clientapps-dev@helixcommunity.org
>Subject: [Clientapps-dev] CR: SHEE-7KLP76 - Partial FLV playback on gadget.
>
>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: alvaro.vaquero@nokia.com
>
>Reviewed by:
>
>Date: 17-Nov-2008
>
>Project: symbianMmf_rel
>
>Error-Id: SHEE-7KLP76
>
>Synopsis: Partial FLV playback on gadget.
>
>Overview: FLV content uses mp3 audio format, but mp3 fileformat is unavailable in Cayennes 221
>branch. This task ports mp3 support back from 210 branch.
>
>Files Modified:
>ribosome/build/bif-cvs/helix/client/build/BIF/hxclient_2_2_1_cayennes.bif
>
>cvsroot/clientapps/symbianMmf/videocontroller/installMMF.pcf
>
>cvsroot/datatype/mp4/audio/mdf/platform/symbian/audioconfigs.cpp
>cvsroot/datatype/mp4/audio/mdf/pub/platform/symbian/audioconfigs.h
>cvsroot/datatype/mp4/audio/renderer/mdfswdecinfo.cpp
>cvsroot/datatype/mp4/audio/renderer/mdfswdecinfo.h
>cvsroot/datatype/mp4/audio/renderer/mp3decinfo.h
>
>New folder added:
>cvsroot/datatype/mp3/fileformat/... (content taken from 210 branch)
>
>Image Size and Heap Use impact: no major impact
>
>Module Release testing (STIF)- Passed
>
>Test case(s) Added : No.
>
>Platforms and Profiles Build Verified: helix-client-s60-32-mmf-mdf-dsp
>
>branch: hxclient_2_2_1_cayennes
>
>platform: armv5, winscw
>
>Branch: HEAD
>
><> <> <>
><> <>
From dennis.lacroix at nokia.com Mon Nov 17 12:41:59 2008
From: dennis.lacroix at nokia.com (dennis.lacroix@nokia.com)
Date: Wed Nov 19 10:59:16 2008
Subject: [datatype-dev] CR: Eliminate unnecessary calculations,
and a few conditional compilations
Message-ID: <0CAE54807525EA45A1F206287D7F0184E21D0C@daebe100.NOE.Nokia.com>
> "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: dennis.lacroix@nokia.com
>
> Reviewed by:
>
> Date: 11/14/2008
>
> Project: SymbianMmf_wm
>
> ErrorId: N/A
>
> Synopsis: Eliminate unnecessary calculations, and a few conditional
> compilations.
>
> Overview: Added a new function to CMdfClockSource, which returns a
> TUint time in milliseconds, rather than 64-bit microseconds. This is
> now used to log the time from the video renderer. This saves two
> conversions from 32 and 64 bit integers, two conversions from 64 to
> 32, and two multiplies and two divides, and eliminates conditional
> compilation in for 64-bit integer handling
>
> Files Modified:
> /cvsroot/datatype/mdf/video/renderer/pub/mdfclocksource.h
> /cvsroot/datatype/mdf/video/renderer/mdfclocksource.cpp
> /cvsroot/datatype/mdf/video/renderer/mdfvidrend.cpp
>
> New files added:
> None.
>
> Image Size and Heap Use impact: no major impact
> Module Release testing (STIF)- Passed
> Test case(s) Added : No.
> Platforms and Profiles Build Verified: helix-client-s60-32-mmf-mdf-dsp
> branch: helix_restricted
> platform: symbian-91-armv5
> target(s): symbianMmf_wm
>
> Branch: HEAD
>
> DIFF:
> Index: pub/mdfclocksource.h
> ===================================================================
> RCS file: /cvsroot/datatype/mdf/video/renderer/pub/mdfclocksource.h,v
> retrieving revision 1.7
> diff -w -u -b -r1.7 mdfclocksource.h
> --- pub/mdfclocksource.h 24 Jan 2008 00:16:45 -0000 1.7
> +++ pub/mdfclocksource.h 14 Nov 2008 20:25:50 -0000
> @@ -88,6 +88,7 @@
> virtual TTimeIntervalMicroSeconds Time();
>
> void OnTimeSync(UINT32 ulTime);
> + TUint TimeInMs();
>
> Index: mdfclocksource.cpp
> ===================================================================
> RCS file: /cvsroot/datatype/mdf/video/renderer/mdfclocksource.cpp,v
> retrieving revision 1.10
> diff -w -u -b -r1.10 mdfclocksource.cpp
> --- mdfclocksource.cpp 24 Jan 2008 00:15:19 -0000 1.10
> +++ mdfclocksource.cpp 14 Nov 2008 20:33:25 -0000
> @@ -75,11 +75,8 @@
> return NULL;
> }
>
> -TTimeIntervalMicroSeconds CMdfClockSource::Time()
> +TUint CMdfClockSource::TimeInMs()
> {
> -
> - TTimeIntervalMicroSeconds currentTimeInMicro( 0 );
> - TInt64 currentTimeInMs64 = 0;
> TUint currentTimeInMsTUint = 0;
>
> m_TimeSyncMutex.Wait();
> @@ -95,10 +92,12 @@
>
> m_TimeSyncMutex.Signal();
>
> - currentTimeInMs64 = TInt64( currentTimeInMsTUint );
> - currentTimeInMicro = currentTimeInMs64 * TInt64( 1000 );
> + return currentTimeInMsTUint;
> +}
>
> - return currentTimeInMicro;
> +TTimeIntervalMicroSeconds CMdfClockSource::Time()
> +{
> + return TInt64( TimeInMs() ) * TInt64( 1000 );
> }
>
> Index: mdfvidrend.cpp
> ===================================================================
> RCS file: /cvsroot/datatype/mdf/video/renderer/mdfvidrend.cpp,v
> retrieving revision 1.29
> diff -w -u -b -r1.29 mdfvidrend.cpp
> --- mdfvidrend.cpp 15 Oct 2008 15:23:37 -0000 1.29
> +++ mdfvidrend.cpp 14 Nov 2008 20:35:21 -0000
> @@ -729,24 +729,14 @@
> HX_ASSERT( m_pClockSource );
> MDFVIDEOLOG_WRITE_FORMAT( " CurrentTime from OnTimeSync is
> %d", ulTime );
>
> - TInt currentTime = 0;
> -
> -#ifdef HELIX_CONFIG_SYMBIAN_PLATFORM_SECURITY
> - currentTime = (TInt) ((m_pClockSource->Time()).Int64()/1000);
> -#else
> - currentTime = ((m_pClockSource->Time()).Int64()/1000).Low();
> -#endif
> + TInt currentTime = m_pClockSource->TimeInMs();
>
> MDFVIDEOLOG_WRITE_FORMAT( " CurrentTime from ClockSource
> before updating is %d", currentTime );
>
> m_pClockSource->OnTimeSync(ulTime);
> m_pMdfVideoAdapter->OnTimeSync(ulTime);
>
> -#ifdef HELIX_CONFIG_SYMBIAN_PLATFORM_SECURITY
> - currentTime = (TInt) ((m_pClockSource->Time()).Int64()/1000);
> -#else
> - currentTime = ((m_pClockSource->Time()).Int64()/1000).Low();
> -#endif
> + currentTime = m_pClockSource->TimeInMs();
>
> MDFVIDEOLOG_WRITE_FORMAT( " CurrentTime from ClockSource
> after updating is %d", currentTime );
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.helixcommunity.org/pipermail/datatype-dev/attachments/20081117/a57a0e5c/attachment.html
From Alvaro.Vaquero at nokia.com Wed Nov 19 14:58:24 2008
From: Alvaro.Vaquero at nokia.com (Alvaro.Vaquero@nokia.com)
Date: Wed Nov 19 13:00:12 2008
Subject: [datatype-dev] RE: [Clientapps-dev] CR: SHEE-7KLP76 - Partial FLV
playback on gadget.
In-Reply-To: <005301c94a4f$bb512960$31f37c20$@com>
References: <2334E6CC5C1FD34F90C1167EA4EBFE5B07191A73@daebe102.NOE.Nokia.com>
<005301c94a4f$bb512960$31f37c20$@com>
Message-ID: <2334E6CC5C1FD34F90C1167EA4EBFE5B071F9A97@daebe102.NOE.Nokia.com>
Thanks Eric. Checked in to Cayennes 221 branch.
BR,
/Alvaro
-----Original Message-----
From: ext Eric Hyche [mailto:ehyche@real.com]
Sent: Wednesday, November 19, 2008 8:04 AM
To: Vaquero Alvaro (Nokia-D-MSW/Dallas);
datatype-dev@helixcommunity.org; clientapps-dev@helixcommunity.org
Subject: RE: [Clientapps-dev] CR: SHEE-7KLP76 - Partial FLV playback on
gadget.
These changes look good to me.
=======================================
Eric Hyche (ehyche@real.com)
Principal Engineer
RealNetworks, Inc.
>-----Original Message-----
>From: clientapps-dev-bounces@helixcommunity.org
>[mailto:clientapps-dev-bounces@helixcommunity.org] On Behalf Of
>Alvaro.Vaquero@nokia.com
>Sent: Monday, November 17, 2008 12:06 PM
>To: datatype-dev@helixcommunity.org; clientapps-dev@helixcommunity.org
>Subject: [Clientapps-dev] CR: SHEE-7KLP76 - Partial FLV playback on
gadget.
>
>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: alvaro.vaquero@nokia.com
>
>Reviewed by:
>
>Date: 17-Nov-2008
>
>Project: symbianMmf_rel
>
>Error-Id: SHEE-7KLP76
>
>Synopsis: Partial FLV playback on gadget.
>
>Overview: FLV content uses mp3 audio format, but mp3 fileformat is
>unavailable in Cayennes 221 branch. This task ports mp3 support back
from 210 branch.
>
>Files Modified:
>ribosome/build/bif-cvs/helix/client/build/BIF/hxclient_2_2_1_cayennes.b
>if
>
>cvsroot/clientapps/symbianMmf/videocontroller/installMMF.pcf
>
>cvsroot/datatype/mp4/audio/mdf/platform/symbian/audioconfigs.cpp
>cvsroot/datatype/mp4/audio/mdf/pub/platform/symbian/audioconfigs.h
>cvsroot/datatype/mp4/audio/renderer/mdfswdecinfo.cpp
>cvsroot/datatype/mp4/audio/renderer/mdfswdecinfo.h
>cvsroot/datatype/mp4/audio/renderer/mp3decinfo.h
>
>New folder added:
>cvsroot/datatype/mp3/fileformat/... (content taken from 210 branch)
>
>Image Size and Heap Use impact: no major impact
>
>Module Release testing (STIF)- Passed
>
>Test case(s) Added : No.
>
>Platforms and Profiles Build Verified: helix-client-s60-32-mmf-mdf-dsp
>
>branch: hxclient_2_2_1_cayennes
>
>platform: armv5, winscw
>
>Branch: HEAD
>
><> <>
><>
><> <>
From vtyagi at real.com Thu Nov 20 05:36:05 2008
From: vtyagi at real.com (Vipin Kumar Tyagi)
Date: Thu Nov 20 03:37:48 2008
Subject: [datatype-dev] CR: For Bug 8564 GetVideoFrame dbus method for
generating video thumbnails locks the file.
Message-ID: <492567C5.7050209@real.com>
*Synopsis:*
GetVideoFrame dbus method for generating video thumbnails should not
locks the file.
**
*Overview:*
In file ffdriver.cpp in function FFDriver::Drive under case
State_GetStreamHeaders: if it fails to find the renderer then it sets
the m_status=HXR_FAIL and quits without set case State_CleanUp.
Now if m_status is not succeeded then in else part it will call cleanup
function. which performs same thing as under the case State_CleanUp.
After these changes able to unmount the USB safely.
*Files Added:
*
None
*Files Modified:*
**
**
datatype/tools/dtdriver/engine/ffdriver.cpp
datatype/tools/dtdriver/engine/pub/ffdriver.h
*Image Size and Heap Use impact (Client -Only):
*None.
*Platforms and Profiles Affected:*
None
*Distribution Libraries Affected:
*None
*Distribution library impact and planned action:
*None
*Platforms and Profiles Build Verified:*
BIF branch ->hxclient_3_4_1_atlas_restricted
Target(s) -> player_mid_all_installers
Profile ->helix-client-moblin
SYSTEM_ID ->linux-2.2-libc6-gcc32-i586
*Branch:
* hxclient_3_1_0_atlas, hxclient_3_4_1_atlas, HEAD
**
*Files Attached:*
diff.txt
Thanks & Regards,
Vipin Kumar Tyagi
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.helixcommunity.org/pipermail/datatype-dev/attachments/20081120/47d4465d/attachment-0001.html
From vtyagi at real.com Thu Nov 20 05:46:05 2008
From: vtyagi at real.com (Vipin Kumar Tyagi)
Date: Thu Nov 20 03:47:48 2008
Subject: [datatype-dev] Re: CR: For Bug 8564 GetVideoFrame dbus method for
generating video thumbnails locks the file.
In-Reply-To: <492567C5.7050209@real.com>
References: <492567C5.7050209@real.com>
Message-ID: <49256A1D.5020000@real.com>
Hi All,
Sorry , forgot to attached the diff with CR. It is attached now.
Please find the attached diff to this mail.
Thanks & Regards,
Vipin Kumar Tyagi
Vipin Kumar Tyagi wrote:
> *Synopsis:*
> GetVideoFrame dbus method for generating video thumbnails should not
> locks the file.
> **
> *Overview:*
> In file ffdriver.cpp in function FFDriver::Drive under case
> State_GetStreamHeaders: if it fails to find the renderer then it sets
> the m_status=HXR_FAIL and quits without set case State_CleanUp.
>
> Now if m_status is not succeeded then in else part it will call
> cleanup function. which performs same thing as under the case
> State_CleanUp.
>
> After these changes able to unmount the USB safely.
>
> *Files Added:
> *
> None
>
> *Files Modified:*
> **
> **
> datatype/tools/dtdriver/engine/ffdriver.cpp
> datatype/tools/dtdriver/engine/pub/ffdriver.h
>
> *Image Size and Heap Use impact (Client -Only):
> *None.
>
> *Platforms and Profiles Affected:*
> None
>
> *Distribution Libraries Affected:
> *None
>
> *Distribution library impact and planned action:
> *None
>
> *Platforms and Profiles Build Verified:*
> BIF branch ->hxclient_3_4_1_atlas_restricted
> Target(s) -> player_mid_all_installers
> Profile ->helix-client-moblin
> SYSTEM_ID ->linux-2.2-libc6-gcc32-i586
>
> *Branch:
> * hxclient_3_1_0_atlas, hxclient_3_4_1_atlas, HEAD
> **
> *Files Attached:*
> diff.txt
>
>
> Thanks & Regards,
> Vipin Kumar Tyagi
-------------- next part --------------
Index: ffdriver.cpp
===================================================================
RCS file: /cvsroot/datatype/tools/dtdriver/engine/ffdriver.cpp,v
retrieving revision 1.39.2.13
diff -u -r1.39.2.13 ffdriver.cpp
--- ffdriver.cpp 25 Apr 2008 10:44:44 -0000 1.39.2.13
+++ ffdriver.cpp 20 Nov 2008 12:57:27 -0000
@@ -1385,7 +1385,16 @@
{
m_status = status;
}
+ else
+ {
+ HX_RESULT LastError;
+ LastError = m_status;
+ CleanUp();
+ m_status = LastError;
+ break;
+ }
}
+
break;
case State_StreamHeadersDone:
@@ -3125,6 +3134,74 @@
}
+void FFDriver::CleanUp()
+{
+ HXLOGL3(HXLOG_DTDR, "FFDriver::CleanUp()");
+
+ MEMPROBE_FREEZE(MEMPRB_FORMATDRIVE);
+
+ OnTermination(HXR_CLOSED);
+
+ HX_RELEASE(m_pFileHeader);
+
+ HX_RESULT status = HXR_OK;
+ if (m_pFileFormat)
+ {
+ status = m_pFileFormat->Close();
+ }
+ if (SUCCEEDED(m_status))
+ {
+ m_status = status;
+ }
+ HX_RELEASE(m_pFileFormat);
+
+ m_bPacketsReady = FALSE;
+
+ if (m_pFileWriter)
+ {
+ m_pFileWriter->Close();
+ m_pFileWriter->Release();
+ m_pFileWriter = NULL;
+ }
+
+ FlushWriterPacketQueue();
+
+ CloseGetPacketEngine(TRUE);
+
+ MEMPROBE_FREEZE(MEMPRB_FORMATTOTAL);
+
+ if (m_pFileObject)
+ {
+ m_pFileObject->Close();
+ HX_RELEASE(m_pFileObject);
+ }
+ MEMPROBE_FREEZE(MEMPRB_FILEOBJTOTAL);
+
+ HX_RELEASE(m_pFileSystem);
+ HX_RELEASE(m_pLastWrittenPacket);
+ HX_RELEASE(m_pLastWrittenFileHeader);
+
+ MEMPROBE_FREEZE(MEMPRB_FILESYSTOTAL);
+
+ m_ulContextEvents = m_pContext->GetProcessEventCount();
+
+ HX_RELEASE(m_pSourceHandlerStack);
+ ReleaseSourceHandlerList(m_pUtilizedSourceHandlerList);
+
+ if (MEMORY_TRACKING_NEEDED && !m_bPersistentContext)
+ {
+ HX_RELEASE(m_pScheduler);
+ HX_RELEASE(m_pErrorMessages);
+ if (m_pContext)
+ {
+ m_pContext->Destruct();
+ m_pContext = NULL;
+ }
+ }
+
+ MEMPROBE_FREEZE(MEMPRB_TOTAL);
+}
+
#ifndef HELIX_CONFIG_DTDR_DISABLE_LOGGING
void FFDriver::ReportError(HX_RESULT errVal, const char *format, ...)
{
Index: pub/ffdriver.h
===================================================================
RCS file: /cvsroot/datatype/tools/dtdriver/engine/pub/ffdriver.h,v
retrieving revision 1.31.2.8
diff -u -r1.31.2.8 ffdriver.h
--- pub/ffdriver.h 25 Apr 2008 08:25:47 -0000 1.31.2.8
+++ pub/ffdriver.h 20 Nov 2008 12:57:27 -0000
@@ -211,6 +211,7 @@
IHXFileWriterMonitor* pFileWriterMonitor = NULL);
void Close(HXBOOL bCompleteShutdown = TRUE);
void Stop(void);
+ void CleanUp();
HX_RESULT InitContext(HXBOOL bPersistentContext = FALSE,
char* pCompanyName = 0,
char* pProductName = 0,
From dennis.lacroix at nokia.com Thu Nov 20 08:32:55 2008
From: dennis.lacroix at nokia.com (dennis.lacroix@nokia.com)
Date: Thu Nov 20 06:34:31 2008
Subject: [datatype-dev] CR: Eliminate unnecessary calculations,
and a few conditional compilations
Message-ID: <0CAE54807525EA45A1F206287D7F0184EB5128@daebe100.NOE.Nokia.com>
> "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: dennis.lacroix@nokia.com
>
> Reviewed by:
>
> Date: 11/14/2008
>
> Project: SymbianMmf_wm
>
> ErrorId: N/A
>
> Synopsis: Eliminate unnecessary calculations, and a few conditional
> compilations.
>
> Overview: Added a new function to CMdfClockSource, which returns a
> TUint time in milliseconds, rather than 64-bit microseconds. This is
> now used to log the time from the video renderer. This saves two
> conversions from 32 and 64 bit integers, two conversions from 64 to
> 32, and two multiplies and two divides, and eliminates conditional
> compilation in for 64-bit integer handling
>
> Files Modified:
> /cvsroot/datatype/mdf/video/renderer/pub/mdfclocksource.h
> /cvsroot/datatype/mdf/video/renderer/mdfclocksource.cpp
> /cvsroot/datatype/mdf/video/renderer/mdfvidrend.cpp
>
> New files added:
> None.
>
> Image Size and Heap Use impact: no major impact
> Module Release testing (STIF)- Passed
> Test case(s) Added : No.
> Platforms and Profiles Build Verified: helix-client-s60-32-mmf-mdf-dsp
> branch: helix_restricted
> platform: symbian-91-armv5
> target(s): symbianMmf_wm
>
> Branch: HEAD
>
> DIFF:
> Index: pub/mdfclocksource.h
> ===================================================================
> RCS file: /cvsroot/datatype/mdf/video/renderer/pub/mdfclocksource.h,v
> retrieving revision 1.7
> diff -w -u -b -r1.7 mdfclocksource.h
> --- pub/mdfclocksource.h 24 Jan 2008 00:16:45 -0000 1.7
> +++ pub/mdfclocksource.h 14 Nov 2008 20:25:50 -0000
> @@ -88,6 +88,7 @@
> virtual TTimeIntervalMicroSeconds Time();
>
> void OnTimeSync(UINT32 ulTime);
> + TUint TimeInMs();
>
> Index: mdfclocksource.cpp
> ===================================================================
> RCS file: /cvsroot/datatype/mdf/video/renderer/mdfclocksource.cpp,v
> retrieving revision 1.10
> diff -w -u -b -r1.10 mdfclocksource.cpp
> --- mdfclocksource.cpp 24 Jan 2008 00:15:19 -0000 1.10
> +++ mdfclocksource.cpp 14 Nov 2008 20:33:25 -0000
> @@ -75,11 +75,8 @@
> return NULL;
> }
>
> -TTimeIntervalMicroSeconds CMdfClockSource::Time()
> +TUint CMdfClockSource::TimeInMs()
> {
> -
> - TTimeIntervalMicroSeconds currentTimeInMicro( 0 );
> - TInt64 currentTimeInMs64 = 0;
> TUint currentTimeInMsTUint = 0;
>
> m_TimeSyncMutex.Wait();
> @@ -95,10 +92,12 @@
>
> m_TimeSyncMutex.Signal();
>
> - currentTimeInMs64 = TInt64( currentTimeInMsTUint );
> - currentTimeInMicro = currentTimeInMs64 * TInt64( 1000 );
> + return currentTimeInMsTUint;
> +}
>
> - return currentTimeInMicro;
> +TTimeIntervalMicroSeconds CMdfClockSource::Time()
> +{
> + return TInt64( TimeInMs() ) * TInt64( 1000 );
> }
>
> Index: mdfvidrend.cpp
> ===================================================================
> RCS file: /cvsroot/datatype/mdf/video/renderer/mdfvidrend.cpp,v
> retrieving revision 1.29
> diff -w -u -b -r1.29 mdfvidrend.cpp
> --- mdfvidrend.cpp 15 Oct 2008 15:23:37 -0000 1.29
> +++ mdfvidrend.cpp 14 Nov 2008 20:35:21 -0000
> @@ -729,24 +729,14 @@
> HX_ASSERT( m_pClockSource );
> MDFVIDEOLOG_WRITE_FORMAT( " CurrentTime from OnTimeSync is
> %d", ulTime );
>
> - TInt currentTime = 0;
> -
> -#ifdef HELIX_CONFIG_SYMBIAN_PLATFORM_SECURITY
> - currentTime = (TInt) ((m_pClockSource->Time()).Int64()/1000);
> -#else
> - currentTime = ((m_pClockSource->Time()).Int64()/1000).Low();
> -#endif
> + TInt currentTime = m_pClockSource->TimeInMs();
>
> MDFVIDEOLOG_WRITE_FORMAT( " CurrentTime from ClockSource
> before updating is %d", currentTime );
>
> m_pClockSource->OnTimeSync(ulTime);
> m_pMdfVideoAdapter->OnTimeSync(ulTime);
>
> -#ifdef HELIX_CONFIG_SYMBIAN_PLATFORM_SECURITY
> - currentTime = (TInt) ((m_pClockSource->Time()).Int64()/1000);
> -#else
> - currentTime = ((m_pClockSource->Time()).Int64()/1000).Low();
> -#endif
> + currentTime = m_pClockSource->TimeInMs();
>
> MDFVIDEOLOG_WRITE_FORMAT( " CurrentTime from ClockSource
> after updating is %d", currentTime );
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.helixcommunity.org/pipermail/datatype-dev/attachments/20081120/7c183511/attachment.html
From ltani at real.com Thu Nov 20 15:46:59 2008
From: ltani at real.com (Leina Tani)
Date: Thu Nov 20 13:48:23 2008
Subject: [datatype-dev] RE: CR: For Bug 8564 GetVideoFrame dbus method for
generating video thumbnails locks the file.
In-Reply-To: <49256A1D.5020000@real.com>
References: <492567C5.7050209@real.com> <49256A1D.5020000@real.com>
Message-ID: <025801c94b6a$4780f4e0$1f40a8c0@corp.real.com>
Is anyone available to code review this before tomorrow??
-----Original Message-----
From: Vipin Kumar Tyagi [mailto:vtyagi@real.com]
Sent: Thursday, November 20, 2008 5:46 AM
To: datatype-dev@helixcommunity.org; Eric Hyche
Cc: Leina Tani; Gurpreet Ahluwalia; Rishi Mathew; Vipin Kumar Tyagi
Subject: Re: CR: For Bug 8564 GetVideoFrame dbus method for generating video
thumbnails locks the file.
Hi All,
Sorry , forgot to attached the diff with CR. It is attached now.
Please find the attached diff to this mail.
Thanks & Regards,
Vipin Kumar Tyagi
Vipin Kumar Tyagi wrote:
> *Synopsis:*
> GetVideoFrame dbus method for generating video thumbnails should not
> locks the file.
> **
> *Overview:*
> In file ffdriver.cpp in function FFDriver::Drive under case
> State_GetStreamHeaders: if it fails to find the renderer then it sets
> the m_status=HXR_FAIL and quits without set case State_CleanUp.
>
> Now if m_status is not succeeded then in else part it will call
> cleanup function. which performs same thing as under the case
> State_CleanUp.
>
> After these changes able to unmount the USB safely.
>
> *Files Added:
> *
> None
>
> *Files Modified:*
> **
> **
> datatype/tools/dtdriver/engine/ffdriver.cpp
> datatype/tools/dtdriver/engine/pub/ffdriver.h
>
> *Image Size and Heap Use impact (Client -Only):
> *None.
>
> *Platforms and Profiles Affected:*
> None
>
> *Distribution Libraries Affected:
> *None
>
> *Distribution library impact and planned action:
> *None
>
> *Platforms and Profiles Build Verified:*
> BIF branch ->hxclient_3_4_1_atlas_restricted
> Target(s) -> player_mid_all_installers
> Profile ->helix-client-moblin
> SYSTEM_ID ->linux-2.2-libc6-gcc32-i586
>
> *Branch:
> * hxclient_3_1_0_atlas, hxclient_3_4_1_atlas, HEAD
> **
> *Files Attached:*
> diff.txt
>
>
> Thanks & Regards,
> Vipin Kumar Tyagi
From ehyche at real.com Fri Nov 21 07:33:29 2008
From: ehyche at real.com (Eric Hyche)
Date: Fri Nov 21 05:34:48 2008
Subject: [datatype-dev] CR: Eliminate unnecessary calculations,
and a few conditional compilations
In-Reply-To: <0CAE54807525EA45A1F206287D7F0184EB5128@daebe100.NOE.Nokia.com>
References: <0CAE54807525EA45A1F206287D7F0184EB5128@daebe100.NOE.Nokia.com>
Message-ID: <00ad01c94bee$81c23d60$8546b820$@com>
Looks good.
=======================================
Eric Hyche (ehyche@real.com)
Principal Engineer
RealNetworks, Inc.
>-----Original Message-----
>From: datatype-dev-bounces@helixcommunity.org [mailto:datatype-dev-bounces@helixcommunity.org] On
>Behalf Of dennis.lacroix@nokia.com
>Sent: Thursday, November 20, 2008 11:33 AM
>To: datatype-dev@helixcommunity.org
>Subject: [datatype-dev] CR: Eliminate unnecessary calculations, and a few conditional compilations
>
>"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: dennis.lacroix@nokia.com
>
>Reviewed by:
>
>Date: 11/14/2008
>
>Project: SymbianMmf_wm
>
>ErrorId: N/A
>
>Synopsis: Eliminate unnecessary calculations, and a few conditional compilations.
>
>Overview: Added a new function to CMdfClockSource, which returns a TUint time in milliseconds, rather
>than 64-bit microseconds. This is now used to log the time from the video renderer. This saves two
>conversions from 32 and 64 bit integers, two conversions from 64 to 32, and two multiplies and two
>divides, and eliminates conditional compilation in for 64-bit integer handling
>
>Files Modified:
>/cvsroot/datatype/mdf/video/renderer/pub/mdfclocksource.h
>/cvsroot/datatype/mdf/video/renderer/mdfclocksource.cpp
>/cvsroot/datatype/mdf/video/renderer/mdfvidrend.cpp
>
>New files added:
>None.
>
>Image Size and Heap Use impact: no major impact Module Release testing (STIF)- Passed Test case(s)
>Added : No.
>Platforms and Profiles Build Verified: helix-client-s60-32-mmf-mdf-dsp
>branch: helix_restricted
>platform: symbian-91-armv5
>target(s): symbianMmf_wm
>
>Branch: HEAD
>
>DIFF:
>Index: pub/mdfclocksource.h
>===================================================================
>RCS file: /cvsroot/datatype/mdf/video/renderer/pub/mdfclocksource.h,v
>retrieving revision 1.7
>diff -w -u -b -r1.7 mdfclocksource.h
>--- pub/mdfclocksource.h 24 Jan 2008 00:16:45 -0000 1.7
>+++ pub/mdfclocksource.h 14 Nov 2008 20:25:50 -0000
>@@ -88,6 +88,7 @@
> virtual TTimeIntervalMicroSeconds Time();
>
> void OnTimeSync(UINT32 ulTime);
>+ TUint TimeInMs();
>
>Index: mdfclocksource.cpp
>===================================================================
>RCS file: /cvsroot/datatype/mdf/video/renderer/mdfclocksource.cpp,v
>retrieving revision 1.10
>diff -w -u -b -r1.10 mdfclocksource.cpp
>--- mdfclocksource.cpp 24 Jan 2008 00:15:19 -0000 1.10
>+++ mdfclocksource.cpp 14 Nov 2008 20:33:25 -0000
>@@ -75,11 +75,8 @@
> return NULL;
> }
>
>-TTimeIntervalMicroSeconds CMdfClockSource::Time()
>+TUint CMdfClockSource::TimeInMs()
> {
>-
>- TTimeIntervalMicroSeconds currentTimeInMicro( 0 );
>- TInt64 currentTimeInMs64 = 0;
> TUint currentTimeInMsTUint = 0;
>
> m_TimeSyncMutex.Wait();
>@@ -95,10 +92,12 @@
>
> m_TimeSyncMutex.Signal();
>
>- currentTimeInMs64 = TInt64( currentTimeInMsTUint );
>- currentTimeInMicro = currentTimeInMs64 * TInt64( 1000 );
>+ return currentTimeInMsTUint;
>+}
>
>- return currentTimeInMicro;
>+TTimeIntervalMicroSeconds CMdfClockSource::Time() {
>+ return TInt64( TimeInMs() ) * TInt64( 1000 );
> }
>
>Index: mdfvidrend.cpp
>===================================================================
>RCS file: /cvsroot/datatype/mdf/video/renderer/mdfvidrend.cpp,v
>retrieving revision 1.29
>diff -w -u -b -r1.29 mdfvidrend.cpp
>--- mdfvidrend.cpp 15 Oct 2008 15:23:37 -0000 1.29
>+++ mdfvidrend.cpp 14 Nov 2008 20:35:21 -0000
>@@ -729,24 +729,14 @@
> HX_ASSERT( m_pClockSource );
> MDFVIDEOLOG_WRITE_FORMAT( " CurrentTime from OnTimeSync is %d", ulTime );
>
>- TInt currentTime = 0;
>-
>-#ifdef HELIX_CONFIG_SYMBIAN_PLATFORM_SECURITY
>- currentTime = (TInt) ((m_pClockSource->Time()).Int64()/1000);
>-#else
>- currentTime = ((m_pClockSource->Time()).Int64()/1000).Low();
>-#endif
>+ TInt currentTime = m_pClockSource->TimeInMs();
>
> MDFVIDEOLOG_WRITE_FORMAT( " CurrentTime from ClockSource before updating is %d", currentTime
>);
>
> m_pClockSource->OnTimeSync(ulTime);
> m_pMdfVideoAdapter->OnTimeSync(ulTime);
>
>-#ifdef HELIX_CONFIG_SYMBIAN_PLATFORM_SECURITY
>- currentTime = (TInt) ((m_pClockSource->Time()).Int64()/1000);
>-#else
>- currentTime = ((m_pClockSource->Time()).Int64()/1000).Low();
>-#endif
>+ currentTime = m_pClockSource->TimeInMs();
>
> MDFVIDEOLOG_WRITE_FORMAT( " CurrentTime from ClockSource after updating is %d", currentTime
>);
From ehyche at real.com Fri Nov 21 08:15:44 2008
From: ehyche at real.com (Eric Hyche)
Date: Fri Nov 21 06:16:57 2008
Subject: [datatype-dev] RE: For Bug 8564 GetVideoFrame dbus method for
generating video thumbnails locks the file.
In-Reply-To: <492567C5.7050209@real.com>
References: <492567C5.7050209@real.com>
Message-ID: <00bd01c94bf4$6912e840$3b38b8c0$@com>
Vipin,
The code to properly cleanup from within FFDriver::Drive()
already exists. There is no need to duplicated that code.
Does the following diff fix the bug?
Index: ffdriver.cpp
===================================================================
RCS file: /cvsroot/datatype/tools/dtdriver/engine/ffdriver.cpp,v
retrieving revision 1.57
diff -u -w -u -w -r1.57 ffdriver.cpp
--- ffdriver.cpp 10 Nov 2008 23:26:01 -0000 1.57
+++ ffdriver.cpp 21 Nov 2008 16:05:01 -0000
@@ -1363,6 +1363,25 @@
m_status = status;
}
}
+ if (FAILED(m_status))
+ {
+ // For one or more of our stream headers, either the
+ // call to GetStreamHeader() returned failure or the
+ // response call StreamHeaderReady() had a failure
+ // status in it. Either way, we cannot continue.
+ //
+ // The failed call to the OnStreamHeader() may not
+ // have propagated all the way through the source
+ // handler stack, so we make sure that the sink
+ // is called back with a failed OnStreamHeader().
+ _StreamHeaderReady(m_status, NULL);
+ // Setting the state to State_PacketsDone means
+ // we go through our cleanup code.
+ m_state = State_PacketsDone;
+ // We clear the m_status error code so that the
+ // loop does not terminate immediately.
+ m_status = HXR_OK;
+ }
break;
case State_StreamHeadersDone:
What this does is cause is to loop through the State_Cleanup state
where we do all the cleanup that is in your ::Cleanup() function.
Eric
=======================================
Eric Hyche (ehyche@real.com)
Principal Engineer
RealNetworks, Inc.
>-----Original Message-----
>From: Vipin Kumar Tyagi [mailto:vtyagi@real.com]
>Sent: Thursday, November 20, 2008 8:36 AM
>To: datatype-dev@helixcommunity.org; Eric Hyche
>Cc: Leina Tani; Vipin Kumar Tyagi; Gurpreet Ahluwalia; Rishi Mathew
>Subject: CR: For Bug 8564 GetVideoFrame dbus method for generating video thumbnails locks the file.
>
>Synopsis:
>GetVideoFrame dbus method for generating video thumbnails should not locks the file.
>
>
>Overview:
>In file ffdriver.cpp in function FFDriver::Drive under case State_GetStreamHeaders: if it fails to
>find the renderer then it sets the m_status=HXR_FAIL and quits without set case State_CleanUp.
>
>Now if m_status is not succeeded then in else part it will call cleanup function. which performs same
>thing as under the case State_CleanUp.
>
>After these changes able to unmount the USB safely.
>
>Files Added:
>
>None
>
>Files Modified:
>datatype/tools/dtdriver/engine/ffdriver.cpp
>datatype/tools/dtdriver/engine/pub/ffdriver.h
>
>
>Image Size and Heap Use impact (Client -Only):
>None.
>
>Platforms and Profiles Affected:
>None
>
>Distribution Libraries Affected:
>None
>
>Distribution library impact and planned action:
>None
>
>Platforms and Profiles Build Verified:
>BIF branch ->hxclient_3_4_1_atlas_restricted
>Target(s) -> player_mid_all_installers
>Profile ->helix-client-moblin
>SYSTEM_ID ->linux-2.2-libc6-gcc32-i586
>
>Branch:
> hxclient_3_1_0_atlas, hxclient_3_4_1_atlas, HEAD
>
>Files Attached:
>diff.txt
>
>
>
>Thanks & Regards,
>Vipin Kumar Tyagi
From ehyche at real.com Fri Nov 21 08:19:46 2008
From: ehyche at real.com (Eric Hyche)
Date: Fri Nov 21 06:21:01 2008
Subject: [datatype-dev] RE: [Clientapps-dev] RESEND: SHEE-7KLP76 - Partial
FLV playback on Cayennes 221.
In-Reply-To: <2334E6CC5C1FD34F90C1167EA4EBFE5B071C9C4A@daebe102.NOE.Nokia.com>
References: <2334E6CC5C1FD34F90C1167EA4EBFE5B071C9C4A@daebe102.NOE.Nokia.com>
Message-ID: <00bf01c94bf4$f94853a0$ebd8fae0$@com>
I thought I already reviewed this. Is this a different
CR than the CR in the link below?
http://lists.helixcommunity.org/pipermail/datatype-dev/2008-November/007179.html
Eric
=======================================
Eric Hyche (ehyche@real.com)
Principal Engineer
RealNetworks, Inc.
>-----Original Message-----
>From: clientapps-dev-bounces@helixcommunity.org [mailto:clientapps-dev-bounces@helixcommunity.org] On
>Behalf Of Alvaro.Vaquero@nokia.com
>Sent: Tuesday, November 18, 2008 5:11 PM
>To: datatype-dev@helixcommunity.org; clientapps-dev@helixcommunity.org
>Subject: [Clientapps-dev] RESEND: SHEE-7KLP76 - Partial FLV playback on Cayennes 221.
>
>
>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: alvaro.vaquero@nokia.com
>
>Reviewed by:
>
>Date: 17-Nov-2008
>
>Project: symbianMmf_rel
>
>Error-Id: SHEE-7KLP76
>
>Synopsis: Partial FLV playback on Cayennes 221.
>
>Overview: FLV content uses mp3 audio format, but mp3 fileformat is unavailable in Cayennes 221
>branch. This task ports mp3 support back from 210 branch.
>
>Files Modified:
>ribosome/build/bif-cvs/helix/client/build/BIF/hxclient_2_2_1_cayennes.bif
>
>cvsroot/clientapps/symbianMmf/videocontroller/installMMF.pcf
>
>cvsroot/datatype/mp4/audio/mdf/platform/symbian/audioconfigs.cpp
>cvsroot/datatype/mp4/audio/mdf/pub/platform/symbian/audioconfigs.h
>cvsroot/datatype/mp4/audio/renderer/mdfswdecinfo.cpp
>cvsroot/datatype/mp4/audio/renderer/mdfswdecinfo.h
>cvsroot/datatype/mp4/audio/renderer/mp3decinfo.h
>
>New folder added:
>cvsroot/datatype/mp3/fileformat/... (content taken from 210 branch)
>
>Image Size and Heap Use impact: no major impact
>
>Module Release testing (STIF)- Passed
>
>Test case(s) Added : No.
>
>Platforms and Profiles Build Verified: helix-client-s60-32-mmf-mdf-dsp
>
>branch: hxclient_2_2_1_cayennes
>
>platform: armv5, winscw
>
>Branch: HEAD
>
><> <> <>
><> <>
From Alvaro.Vaquero at nokia.com Fri Nov 21 09:55:03 2008
From: Alvaro.Vaquero at nokia.com (Alvaro.Vaquero@nokia.com)
Date: Fri Nov 21 07:58:01 2008
Subject: [datatype-dev] RE: [Clientapps-dev] RESEND: SHEE-7KLP76 - Partial
FLV playback on Cayennes 221.
In-Reply-To: <00bf01c94bf4$f94853a0$ebd8fae0$@com>
References: <2334E6CC5C1FD34F90C1167EA4EBFE5B071C9C4A@daebe102.NOE.Nokia.com>
<00bf01c94bf4$f94853a0$ebd8fae0$@com>
Message-ID: <2334E6CC5C1FD34F90C1167EA4EBFE5B071FA5C4@daebe102.NOE.Nokia.com>
Hi Eric,
It's the same CR. Not sure why the two entries...
BR,
/Alvaro
-----Original Message-----
From: ext Eric Hyche [mailto:ehyche@real.com]
Sent: Friday, November 21, 2008 10:20 AM
To: Vaquero Alvaro (Nokia-D-MSW/Dallas);
datatype-dev@helixcommunity.org; clientapps-dev@helixcommunity.org
Subject: RE: [Clientapps-dev] RESEND: SHEE-7KLP76 - Partial FLV playback
on Cayennes 221.
I thought I already reviewed this. Is this a different CR than the CR in
the link below?
http://lists.helixcommunity.org/pipermail/datatype-dev/2008-November/007
179.html
Eric
=======================================
Eric Hyche (ehyche@real.com)
Principal Engineer
RealNetworks, Inc.
>-----Original Message-----
>From: clientapps-dev-bounces@helixcommunity.org
>[mailto:clientapps-dev-bounces@helixcommunity.org] On Behalf Of
>Alvaro.Vaquero@nokia.com
>Sent: Tuesday, November 18, 2008 5:11 PM
>To: datatype-dev@helixcommunity.org; clientapps-dev@helixcommunity.org
>Subject: [Clientapps-dev] RESEND: SHEE-7KLP76 - Partial FLV playback on
Cayennes 221.
>
>
>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: alvaro.vaquero@nokia.com
>
>Reviewed by:
>
>Date: 17-Nov-2008
>
>Project: symbianMmf_rel
>
>Error-Id: SHEE-7KLP76
>
>Synopsis: Partial FLV playback on Cayennes 221.
>
>Overview: FLV content uses mp3 audio format, but mp3 fileformat is
>unavailable in Cayennes 221 branch. This task ports mp3 support back
from 210 branch.
>
>Files Modified:
>ribosome/build/bif-cvs/helix/client/build/BIF/hxclient_2_2_1_cayennes.b
>if
>
>cvsroot/clientapps/symbianMmf/videocontroller/installMMF.pcf
>
>cvsroot/datatype/mp4/audio/mdf/platform/symbian/audioconfigs.cpp
>cvsroot/datatype/mp4/audio/mdf/pub/platform/symbian/audioconfigs.h
>cvsroot/datatype/mp4/audio/renderer/mdfswdecinfo.cpp
>cvsroot/datatype/mp4/audio/renderer/mdfswdecinfo.h
>cvsroot/datatype/mp4/audio/renderer/mp3decinfo.h
>
>New folder added:
>cvsroot/datatype/mp3/fileformat/... (content taken from 210 branch)
>
>Image Size and Heap Use impact: no major impact
>
>Module Release testing (STIF)- Passed
>
>Test case(s) Added : No.
>
>Platforms and Profiles Build Verified: helix-client-s60-32-mmf-mdf-dsp
>
>branch: hxclient_2_2_1_cayennes
>
>platform: armv5, winscw
>
>Branch: HEAD
>
><> <>
><>
><> <>
From ehayashi at real.com Fri Nov 21 17:38:06 2008
From: ehayashi at real.com (Enryo Hayashi)
Date: Fri Nov 21 15:39:23 2008
Subject: [datatype-dev] CR: PR#231289 Pending callback removed unexpectedly
during untimed rendering mode
Message-ID: <010001c94c42$f7e321e0$b68917ac@kinser>
Synopsis: Pending callback removed unexpectedly during untimed rendering
mode.
Overview:
During untimed rendering mode, a non existing callback handle is created in
CVideoRenderer::StartScheduler(). On DetachSite(), an actual callback with
the same handle is removed instead.
Files Modified:
datatype/common/vidrend/vidrend.cpp
Files Attached:
datatype_common_vidrend.diff
Branch: 310Atlas, HEAD
Copyright assignment: I am a RealNetworks employee.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: datatype_common_vidrend.diff
Type: application/octet-stream
Size: 1947 bytes
Desc: not available
Url : http://lists.helixcommunity.org/pipermail/datatype-dev/attachments/20081121/6ef06f5f/datatype_common_vidrend.obj
From rmathew at real.com Sun Nov 23 08:33:29 2008
From: rmathew at real.com (Rishi Mathew)
Date: Sun Nov 23 06:34:20 2008
Subject: [datatype-dev] Fwd: [hxadmin] Helix recorder?
Message-ID: <6.2.5.6.2.20081123083159.046ad200@real.com>
Hey Andy,
We do have tools in the Helix Community that can convert from one
format to another. I am forwarding to the right mailing list so that
our engineers can respond.
Regards,
Rishi.
>From: Andy Canfield
>To: admin@helixcommunity.org
>Subject: [hxadmin] Helix recorder?
>
>I bought a Nokia 6300 telephone which records video as 3gp files.
>Although there are several programs which can play 3gp files, and
>several which can convert 3gp files to other formats, none of them can
>find the audio track.
>
>Except for RealPlayer, based on the Helix player. I have installed both
>on my Ubuntu 8.04 notebook, and I thank you very much. Apparently Nokia
>has done something weird with their audio track, and only the Helix team
>has figured out where it went.
>
>I still have no way to convert a Nokia 6300 3gp file with sound to any
>other format, such as flv or mpeg4. These are videos of my toddler son.
>3gp doesn't seem like a good archive format for films to be watched
>twenty years from now.
>
>Do you know of anyone who has done a format converter based on Helix?
>
>If this is the wrong e-mail address I apologize, but it's the best I
>could figure out from the Helix Community web site. If you are not the
>right person to reply, please forward it on to someone else. If i
>receive no answer I will assume that the answer is "no".
>
>Thank you very much.
>
>Andy Canfield
>http://andycanfield.dyndns.org
>Roiet, Thailand
Rishi Mathew
Helix Community
RealNetworks, Inc.
rmathew@real.com
http://www.helixcommunity.org
http://www.realnetworks.com/products/support/devsupport.html
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.helixcommunity.org/pipermail/datatype-dev/attachments/20081123/bc89ccad/attachment-0001.html
From ehyche at real.com Mon Nov 24 07:22:58 2008
From: ehyche at real.com (Eric Hyche)
Date: Mon Nov 24 05:23:31 2008
Subject: [datatype-dev] CR: PR#231289 Pending callback removed
unexpectedly during untimed rendering mode
In-Reply-To: <010001c94c42$f7e321e0$b68917ac@kinser>
References: <010001c94c42$f7e321e0$b68917ac@kinser>
Message-ID: <00c601c94e48$8951a190$9bf4e4b0$@com>
These changes look good.
=======================================
Eric Hyche (ehyche@real.com)
Principal Engineer
RealNetworks, Inc.
>-----Original Message-----
>From: datatype-dev-bounces@helixcommunity.org [mailto:datatype-dev-bounces@helixcommunity.org] On
>Behalf Of Enryo Hayashi
>Sent: Friday, November 21, 2008 8:38 PM
>To: datatype-dev@helixcommunity.org
>Subject: [datatype-dev] CR: PR#231289 Pending callback removed unexpectedly during untimed rendering
>mode
>
>
>Synopsis: Pending callback removed unexpectedly during untimed rendering mode.
>
>Overview:
>During untimed rendering mode, a non existing callback handle is created in
>CVideoRenderer::StartScheduler(). On DetachSite(), an actual callback with the same handle is removed
>instead.
>
>
>Files Modified:
>datatype/common/vidrend/vidrend.cpp
>
>Files Attached:
>datatype_common_vidrend.diff
>
>Branch: 310Atlas, HEAD
>
>Copyright assignment: I am a RealNetworks employee.
From ext-asheesh.srivastava at nokia.com Mon Nov 24 07:37:51 2008
From: ext-asheesh.srivastava at nokia.com (ext-asheesh.srivastava@nokia.com)
Date: Mon Nov 24 05:38:38 2008
Subject: [datatype-dev] CR: Audio playback for some audio formats is not
working on Emulator with HEAD branch.
Message-ID: <03528B6E301B3B42833693425F0A49F701F6C742@daebe102.NOE.Nokia.com>
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: ext-asheesh.srivastava@nokia.com
Reviewed by:
Date: 21-Nov-2008
Project: symbianMmf_wm
Error-Id: N/A
Synopsis: Audio playback for some audio formats is not working on
Emulator with HEAD branch.
Overview: WMA and AAC audio clips is not working on Emulator with Head
branch.
If it is an A/V clip and has AAC/WMA audio, first video frame appears
and video gets frozen on emulator. Timeline also does not move.
Its happening because call to SetAudioPushdowm from
CAudioRenderer::StartStream function is setting the target pushdown
lesser than it
is required to play the audio clip on emulator.
Solution: For symbian platform, override MINIMUM_AUDIO_PUSHDOWN with
value 1000.
Files Modified:
datatype\common\audrend\audrend.cpp
New files added:
None.
Image Size and Heap Use impact: no major impact
Module Release testing (STIF)- Passed
Test case(s) Added : No.
Platforms and Profiles Build Verified: helix-client-s60-50-mmf-mdf-dsp
branch: helix_restricted
platform: symbian-91-armv5, symbian-91-winscw-emulator
target(s): symbianMmf_wm
Branch: HEAD
DIFF:
Index: audrend.cpp
===================================================================
RCS file: /cvsroot/datatype/common/audrend/audrend.cpp,v
retrieving revision 1.46
diff -u -b -r1.46 audrend.cpp
--- audrend.cpp 21 Mar 2008 05:32:39 -0000 1.46
+++ audrend.cpp 19 Nov 2008 21:46:12 -0000
@@ -49,6 +49,10 @@
#define BASE_AUDIO_RENDERER_NAME "Basic Audio"
#define MINIMAL_AUDIO_PUSHDOWN 120
+#ifdef HELIX_CONFIG_SYMBIAN_PCM_PUSHDOWN_BYTES
+#define MINIMAL_AUDIO_PUSHDOWN 1000
+#endif //HELIX_CONFIG_SYMBIAN_PCM_PUSHDOWN_BYTES
+
#ifdef _AUDREND_FLOW_LOG
#define AUDREND_FLOW_FILE "C:\\audrend.txt"
#else // _AUDREND_FLOW_LOG
Regards,
Asheesh Srivastava
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.helixcommunity.org/pipermail/datatype-dev/attachments/20081124/a0207ddc/attachment.html
From ehayashi at real.com Mon Nov 24 12:43:57 2008
From: ehayashi at real.com (Enryo Hayashi)
Date: Mon Nov 24 10:44:27 2008
Subject: [datatype-dev] CR: PR#231289 Pending callback removed
unexpectedly during untimed rendering mode
In-Reply-To: <00c601c94e48$8951a190$9bf4e4b0$@com>
References: <010001c94c42$f7e321e0$b68917ac@kinser>
<00c601c94e48$8951a190$9bf4e4b0$@com>
Message-ID: <000f01c94e75$5f5b5110$b68917ac@kinser>
Thanks. This has been checked into 310Atlas and HEAD.
-----Original Message-----
From: Eric Hyche [mailto:ehyche@real.com]
Sent: Monday, November 24, 2008 7:23 AM
To: 'Enryo Hayashi'; datatype-dev@helixcommunity.org
Subject: RE: [datatype-dev] CR: PR#231289 Pending callback removed
unexpectedly during untimed rendering mode
These changes look good.
=======================================
Eric Hyche (ehyche@real.com)
Principal Engineer
RealNetworks, Inc.
>-----Original Message-----
>From: datatype-dev-bounces@helixcommunity.org
>[mailto:datatype-dev-bounces@helixcommunity.org] On Behalf Of Enryo
>Hayashi
>Sent: Friday, November 21, 2008 8:38 PM
>To: datatype-dev@helixcommunity.org
>Subject: [datatype-dev] CR: PR#231289 Pending callback removed
>unexpectedly during untimed rendering mode
>
>
>Synopsis: Pending callback removed unexpectedly during untimed rendering
mode.
>
>Overview:
>During untimed rendering mode, a non existing callback handle is
>created in CVideoRenderer::StartScheduler(). On DetachSite(), an
>actual callback with the same handle is removed instead.
>
>
>Files Modified:
>datatype/common/vidrend/vidrend.cpp
>
>Files Attached:
>datatype_common_vidrend.diff
>
>Branch: 310Atlas, HEAD
>
>Copyright assignment: I am a RealNetworks employee.
From jrathore at real.com Mon Nov 24 13:39:36 2008
From: jrathore at real.com (Jyotsana Rathore)
Date: Mon Nov 24 11:40:09 2008
Subject: [datatype-dev] Fwd: [hxadmin] Helix recorder?
In-Reply-To: <6.2.5.6.2.20081123083159.046ad200@real.com>
References: <6.2.5.6.2.20081123083159.046ad200@real.com>
Message-ID: <006b01c94e7d$2751f190$f58016ac@corp.real.com>
Hi Andy,
Dtdrive is a helix based command line tool that can be used to convert from
one format to another:
https://datatype.helixcommunity.org/2005/dtdrive/index.html
The above link has some examples and links to download the binary as well as
the source code.
There are also GUI tools like Helix Mobile Producer and Real Producer that
you can download from https://helixcommunity.org/frs/?group_id=156
Thanks,
Jyotsana
_____
From: datatype-dev-bounces@helixcommunity.org
[mailto:datatype-dev-bounces@helixcommunity.org] On Behalf Of Rishi Mathew
Sent: Sunday, November 23, 2008 8:33 AM
To: datatype-dev@helixcommunity.org; Andy Canfield
Subject: [datatype-dev] Fwd: [hxadmin] Helix recorder?
Hey Andy,
We do have tools in the Helix Community that can convert from one format to
another. I am forwarding to the right mailing list so that our engineers can
respond.
Regards,
Rishi.
From: Andy Canfield
To: admin@helixcommunity.org
Subject: [hxadmin] Helix recorder?
I bought a Nokia 6300 telephone which records video as 3gp files.
Although there are several programs which can play 3gp files, and
several which can convert 3gp files to other formats, none of them can
find the audio track.
Except for RealPlayer, based on the Helix player. I have installed both
on my Ubuntu 8.04 notebook, and I thank you very much. Apparently Nokia
has done something weird with their audio track, and only the Helix team
has figured out where it went.
I still have no way to convert a Nokia 6300 3gp file with sound to any
other format, such as flv or mpeg4. These are videos of my toddler son.
3gp doesn't seem like a good archive format for films to be watched
twenty years from now.
Do you know of anyone who has done a format converter based on Helix?
If this is the wrong e-mail address I apologize, but it's the best I
could figure out from the Helix Community web site. If you are not the
right person to reply, please forward it on to someone else. If i
receive no answer I will assume that the answer is "no".
Thank you very much.
Andy Canfield
http://andycanfield.dyndns.org
Roiet, Thailand
Rishi Mathew
Helix Community
Real Networks, Inc.
rmathew@real.com
http://www.helixcommunity.org
http://www.realnetworks.com/products/support/devsupport.html
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.helixcommunity.org/pipermail/datatype-dev/attachments/20081124/c209279b/attachment-0001.html
From ext-asheesh.srivastava at nokia.com Tue Nov 25 08:40:47 2008
From: ext-asheesh.srivastava at nokia.com (ext-asheesh.srivastava@nokia.com)
Date: Tue Nov 25 06:41:18 2008
Subject: [datatype-dev] RESEND CR: Audio playback for some audio formats is
not working on Emulator with HEAD branch.
Message-ID: <03528B6E301B3B42833693425F0A49F701F6CF48@daebe102.NOE.Nokia.com>
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: ext-asheesh.srivastava@nokia.com
Reviewed by:
Date: 21-Nov-2008
Project: symbianMmf_wm
Error-Id: N/A
Synopsis: Audio playback for some audio formats is not working on
Emulator with HEAD branch.
Overview: WMA and AAC audio clips is not working on Emulator with Head
branch.
If it is an A/V clip and has AAC/WMA audio, first video frame appears
and video gets frozen on emulator. Timeline also does not move.
Its happening because call to SetAudioPushdowm from
CAudioRenderer::StartStream function is setting the target pushdown
lesser than it
is required to play the audio clip on emulator.
Solution: For symbian platform, override MINIMUM_AUDIO_PUSHDOWN with
value 1000.
Files Modified:
datatype\common\audrend\audrend.cpp
New files added:
None.
Image Size and Heap Use impact: no major impact
Module Release testing (STIF)- Passed
Test case(s) Added : No.
Platforms and Profiles Build Verified: helix-client-s60-50-mmf-mdf-dsp
branch: helix_restricted
platform: symbian-91-armv5, symbian-91-winscw-emulator
target(s): symbianMmf_wm
Branch: HEAD
DIFF:
Index: audrend.cpp
===================================================================
RCS file: /cvsroot/datatype/common/audrend/audrend.cpp,v
retrieving revision 1.46
diff -u -b -r1.46 audrend.cpp
--- audrend.cpp 21 Mar 2008 05:32:39 -0000 1.46
+++ audrend.cpp 19 Nov 2008 21:46:12 -0000
@@ -49,6 +49,10 @@
#define BASE_AUDIO_RENDERER_NAME "Basic Audio"
#define MINIMAL_AUDIO_PUSHDOWN 120
+#ifdef HELIX_CONFIG_SYMBIAN_PCM_PUSHDOWN_BYTES
+#define MINIMAL_AUDIO_PUSHDOWN 1000
+#endif //HELIX_CONFIG_SYMBIAN_PCM_PUSHDOWN_BYTES
+
#ifdef _AUDREND_FLOW_LOG
#define AUDREND_FLOW_FILE "C:\\audrend.txt"
#else // _AUDREND_FLOW_LOG
Regards,
Asheesh Srivastava
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.helixcommunity.org/pipermail/datatype-dev/attachments/20081125/541b47b8/attachment.html
From EXT-Sebastien.Gros2 at nokia.com Wed Nov 26 09:52:09 2008
From: EXT-Sebastien.Gros2 at nokia.com (EXT-Sebastien.Gros2@nokia.com)
Date: Wed Nov 26 07:53:10 2008
Subject: [datatype-dev] RESEND: CR-Client Needed: Helix Core - Datatype/
Error EJYG-7FWDJQ
References: <43070ABC04E3884F8874997D8B1C6A9B017D40BA@xesebe102.nee.nokia.com>
<43070ABC04E3884F8874997D8B1C6A9B017D40BE@xesebe102.nee.nokia.com>
<43070ABC04E3884F8874997D8B1C6A9B017D40BF@xesebe102.nee.nokia.com>
Message-ID: <43070ABC04E3884F8874997D8B1C6A9B017D40C5@xesebe102.nee.nokia.com>
________________________________
From: Sebastien Gros.2 (EXT-DextraTechnologies-MSW/Mexico)
Sent: Tue 25-Nov-08 13:33
To: datatype-dev@helixcommunity.org
Subject: FW: CR-Client Needed: Helix Core - Datatype/ Error EJYG-7FWDJQ
________________________________
From: Sebastien Gros.2 (EXT-DextraTechnologies-MSW/Mexico)
Sent: Tue 18-Nov-08 15:20
To: DG.TP-S60-APPS-MM-VPD-HELIX@nokia.com
Subject: CR-Client Needed: Helix Core - Datatype/ Error EJYG-7FWDJQ
Modified by:
Date: <11:18:08>
Project:
Bug Number: EJYG-7FWDJQ
Synopsis: Being able to resume a video properly when having 2 instances playing video files.
Overview:
Reproducing the following steps leads the phone not to show any pictures when changing the orientation window:
1. Play the MP4 video clip in full screen from File manager.
2. Press Menu key and launch Video Center.
3. Play a MP4 video clip in Video Center.
4. Long press Menu key and select File manager.
5. Select LSK('Options')-> Continue Play in nomal screen.
When theses steps are performed quickly, Helix is assuming that the hardware is completely available when setting the window parameters.
Unfortunately, it's not the case sometimes so SetWindowparameters steps are not completed, due to unaivailable hardware.
Solution:
When Resuming, try to set up agaiin window parameters so as to make sure they are known from the hardware.
Files Modified:
[Helix Folder]\datatype\mdf\video\renderer\mdfvideoadapter.cpp
[Helix Folder]\datatype\mdf\video\renderer\pub\mdfvideoadapter.h
Image Size and Heap Use impact (Client -Only):
No change
Platforms and Profiles Affected:
helix-client-s60-32-mmf-mdf-arm
Distribution Libraries Affected:
mdfvidrender.dll
Module Release testing (STIF) : yes
Test case(s) Added : No
Memory leak check performed : Yes. No new memory leaks introduced.
Platforms and Profiles Build Verified:
helix-client-s60-32-mmf-mdf-arm
Platforms and Profiles Functionality verified: armv5, winscw
Branch: 221Cays
-------------- next part --------------
--- mdfvideoadapter_OLD.cpp Wed Nov 12 13:49:36 2008
+++ mdfvideoadapter.cpp Tue Nov 18 14:53:02 2008
@@ -190,6 +190,7 @@
m_CropRect.right = 0;
m_CropRect.bottom = 0;
+ m_bNeedToChangeParams = false;
MDFVIDEOLOG_LEAVEFN( "CMdfVideoAdapter" );
}
@@ -583,6 +584,22 @@
m_pDevVideoClient->Resume();
m_bIsPaused = FALSE;
m_DevVidInitialized = EInitializedSuccess;
+
+ if (m_bNeedToChangeParams)
+ {
+ m_windowRect = TRect(0,0,0,0);
+ m_clipRect = TRect(0,0,0,0);
+
+ HXxRect tempWinRect;
+ HXxRect tempClipRect;
+
+ (SymbianGlobalVideoParameters::Instance())->GetWindowParameters(tempWinRect, tempClipRect);
+
+ m_bNeedToChangeParams = FALSE;
+
+ SetWindowParameters(tempWinRect, tempClipRect);
+ }
+
MDFVIDEOLOG_LEAVEFN2( "VideoResume -- Sucess" );
}
@@ -908,6 +925,7 @@
m_DevVidInitialized = EInitializedResourceLost;
// DevVideo is paused by the server session
m_bIsPaused = TRUE;
+ m_bNeedToChangeParams = TRUE; //Will update parameters in VideoResume()
ReportError(KErrMMVideoDevice, HXLOG_INFO, HXR_DEVVIDEO_RESOURCE_LOST);
MDFVIDEOLOG_LEAVEFN2( "MmvroResourcesLost" );
-------------- next part --------------
--- mdfvideoadapter_OLD.h Wed Nov 12 13:39:18 2008
+++ mdfvideoadapter.h Tue Nov 18 14:58:29 2008
@@ -252,6 +252,7 @@
HXBOOL m_bIsShutdown;
HXBOOL m_bIsPlayStartReceived;
HXBOOL m_bIsDevVideoStarted;
+ HXBOOL m_bNeedToChangeParams;
CPayloadFormatPluginDevice* m_pPayloadFormatPluginDevice;
HXBOOL m_bIsFirstFrameSent;
From EXT-Sebastien.Gros2 at nokia.com Wed Nov 26 10:42:00 2008
From: EXT-Sebastien.Gros2 at nokia.com (EXT-Sebastien.Gros2@nokia.com)
Date: Wed Nov 26 08:45:49 2008
Subject: [datatype-dev] RESEND: CR-Client Needed: Helix Core - Datatype/
Error EJYG-7FWDJQ (For 210 Cays, 221 Cays and Head)
References: <43070ABC04E3884F8874997D8B1C6A9B017D40BA@xesebe102.nee.nokia.com>
<43070ABC04E3884F8874997D8B1C6A9B017D40C1@xesebe102.nee.nokia.com>
<43070ABC04E3884F8874997D8B1C6A9B017D40C4@xesebe102.nee.nokia.com>
Message-ID: <43070ABC04E3884F8874997D8B1C6A9B017D40C7@xesebe102.nee.nokia.com>
Modified by:
Date: <11:26:08>
Project:
Bug Number: EJYG-7FWDJQ
Synopsis: Being able to resume a video properly when having 2 instances playing video files.
Overview:
Reproducing the following steps leads the phone not to show any pictures when changing the orientation window:
1. Play the MP4 video clip in full screen from File manager.
2. Press Menu key and launch Video Center.
3. Play a MP4 video clip in Video Center.
4. Long press Menu key and select File manager.
5. Select LSK('Options')-> Continue Play in nomal screen.
When theses steps are performed quickly, Helix is assuming that the hardware is completely available when setting the window parameters.
Unfortunately, it's not the case sometimes so SetWindowparameters steps are not completed, due to unaivailable hardware.
Solution:
When Resuming, try to set up agaiin window parameters so as to make sure they are known from the hardware.
Files Modified:
[Helix Folder]\datatype\mdf\video\renderer\mdfvideoadapter.cpp
[Helix Folder]\datatype\mdf\video\renderer\pub\mdfvideoadapter.h
Image Size and Heap Use impact (Client -Only):
No change
Platforms and Profiles Affected:
helix-client-s60-32-mmf-mdf-arm
helix-client-s60-50-mmf-mdf-arm
Distribution Libraries Affected:
mdfvidrender.dll
Module Release testing (STIF) : yes
Test case(s) Added : No
Memory leak check performed : Yes. No new memory leaks introduced.
Platforms and Profiles Build Verified:
helix-client-s60-32-mmf-mdf-arm
helix-client-s60-50-mmf-mdf-arm
Head
Platforms and Profiles Functionality verified: armv5, winscw
Branch: 221Cays 210Cays Head
-------------- next part --------------
--- mdfvideoadapter_OLD.h Wed Nov 12 13:39:18 2008
+++ mdfvideoadapter.h Tue Nov 18 14:58:29 2008
@@ -252,6 +252,7 @@
HXBOOL m_bIsShutdown;
HXBOOL m_bIsPlayStartReceived;
HXBOOL m_bIsDevVideoStarted;
+ HXBOOL m_bNeedToChangeParams;
CPayloadFormatPluginDevice* m_pPayloadFormatPluginDevice;
HXBOOL m_bIsFirstFrameSent;
-------------- next part --------------
--- mdfvideoadapter_OLD.cpp Wed Nov 12 13:49:36 2008
+++ mdfvideoadapter.cpp Tue Nov 18 14:53:02 2008
@@ -190,6 +190,7 @@
m_CropRect.right = 0;
m_CropRect.bottom = 0;
+ m_bNeedToChangeParams = FALSE;
MDFVIDEOLOG_LEAVEFN( "CMdfVideoAdapter" );
}
@@ -583,6 +584,22 @@
m_pDevVideoClient->Resume();
m_bIsPaused = FALSE;
m_DevVidInitialized = EInitializedSuccess;
+
+ if (m_bNeedToChangeParams)
+ {
+ m_windowRect = TRect(0,0,0,0);
+ m_clipRect = TRect(0,0,0,0);
+
+ HXxRect tempWinRect;
+ HXxRect tempClipRect;
+
+ (SymbianGlobalVideoParameters::Instance())->GetWindowParameters(tempWinRect, tempClipRect);
+
+ m_bNeedToChangeParams = FALSE;
+
+ SetWindowParameters(tempWinRect, tempClipRect);
+ }
+
MDFVIDEOLOG_LEAVEFN2( "VideoResume -- Sucess" );
}
@@ -908,6 +925,7 @@
m_DevVidInitialized = EInitializedResourceLost;
// DevVideo is paused by the server session
m_bIsPaused = TRUE;
+ m_bNeedToChangeParams = TRUE; //Will update parameters in VideoResume()
ReportError(KErrMMVideoDevice, HXLOG_INFO, HXR_DEVVIDEO_RESOURCE_LOST);
MDFVIDEOLOG_LEAVEFN2( "MmvroResourcesLost" );
From ext-asheesh.srivastava at nokia.com Wed Nov 26 11:05:56 2008
From: ext-asheesh.srivastava at nokia.com (ext-asheesh.srivastava@nokia.com)
Date: Wed Nov 26 09:06:00 2008
Subject: [datatype-dev] RESEND CR: Audio playback for some audio formats is
not working on Emulator with HEAD branch.
Message-ID: <03528B6E301B3B42833693425F0A49F701FC3055@daebe102.NOE.Nokia.com>
> ______________________________________________
> From: Srivastava Asheesh (EXT-Infovision-MSW/Dallas)
> Sent: Tuesday, November 25, 2008 10:41 AM
> To: datatype-dev@helixcommunity.org
> Subject: RESEND CR: Audio playback for some audio formats is not
> working on Emulator with HEAD branch.
>
> 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: ext-asheesh.srivastava@nokia.com
>
> Reviewed by:
>
> Date: 21-Nov-2008
>
> Project: symbianMmf_wm
>
> Error-Id: N/A
>
> Synopsis: Audio playback for some audio formats is not working on
> Emulator with HEAD branch.
>
> Overview: WMA and AAC audio clips is not working on Emulator with
> Head branch.
> If it is an A/V clip and has AAC/WMA audio, first video frame appears
> and video gets frozen on emulator. Timeline also does not move.
> Its happening because call to SetAudioPushdowm from
> CAudioRenderer::StartStream function is setting the target pushdown
> lesser than it
> is required to play the audio clip on emulator.
>
> Solution: For symbian platform, override MINIMUM_AUDIO_PUSHDOWN with
> value 1000.
>
> Files Modified:
> datatype\common\audrend\audrend.cpp
>
> New files added:
> None.
>
> Image Size and Heap Use impact: no major impact
>
> Module Release testing (STIF)- Passed
>
> Test case(s) Added : No.
>
> Platforms and Profiles Build Verified: helix-client-s60-50-mmf-mdf-dsp
>
> branch: helix_restricted
>
> platform: symbian-91-armv5, symbian-91-winscw-emulator
>
> target(s): symbianMmf_wm
>
> Branch: HEAD
>
> DIFF:
>
> Index: audrend.cpp
> ===================================================================
> RCS file: /cvsroot/datatype/common/audrend/audrend.cpp,v
> retrieving revision 1.46
> diff -u -b -r1.46 audrend.cpp
> --- audrend.cpp 21 Mar 2008 05:32:39 -0000 1.46
> +++ audrend.cpp 19 Nov 2008 21:46:12 -0000
> @@ -49,6 +49,10 @@
> #define BASE_AUDIO_RENDERER_NAME "Basic Audio"
> #define MINIMAL_AUDIO_PUSHDOWN 120
>
> +#ifdef HELIX_CONFIG_SYMBIAN_PCM_PUSHDOWN_BYTES
> +#define MINIMAL_AUDIO_PUSHDOWN 1000
> +#endif //HELIX_CONFIG_SYMBIAN_PCM_PUSHDOWN_BYTES
> +
> #ifdef _AUDREND_FLOW_LOG
> #define AUDREND_FLOW_FILE "C:\\audrend.txt"
> #else // _AUDREND_FLOW_LOG
>
> Regards,
> Asheesh Srivastava
>
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.helixcommunity.org/pipermail/datatype-dev/attachments/20081126/123ed11a/attachment-0001.html
From ehyche at real.com Wed Nov 26 11:37:33 2008
From: ehyche at real.com (Eric Hyche)
Date: Wed Nov 26 09:37:33 2008
Subject: [datatype-dev] RESEND CR: Audio playback for some audio formats
is not working on Emulator with HEAD branch.
In-Reply-To: <03528B6E301B3B42833693425F0A49F701FC3055@daebe102.NOE.Nokia.com>
References: <03528B6E301B3B42833693425F0A49F701FC3055@daebe102.NOE.Nokia.com>
Message-ID: <004c01c94ffe$6ee1a960$4ca4fc20$@com>
Asheesh,
This would probably be better to define
it once rather than define MINIMAL_AUDIO_PUSHDOWN
and then re-define it:
+#ifdef HELIX_CONFIG_SYMBIAN_PCM_PUSHDOWN_BYTES
#define MINIMAL_AUDIO_PUSHDOWN 120
+else
+#define MINIMAL_AUDIO_PUSHDOWN 1000
+#endif
=======================================
Eric Hyche (ehyche@real.com)
Principal Engineer
RealNetworks, Inc.
>-----Original Message-----
>From: datatype-dev-bounces@helixcommunity.org [mailto:datatype-dev-bounces@helixcommunity.org] On
>Behalf Of ext-asheesh.srivastava@nokia.com
>Sent: Wednesday, November 26, 2008 2:06 PM
>To: datatype-dev@helixcommunity.org
>Subject: [datatype-dev] RESEND CR: Audio playback for some audio formats is not working on Emulator
>with HEAD branch.
>
>
>
> ______________________________________________
> From: Srivastava Asheesh (EXT-Infovision-MSW/Dallas)
> Sent: Tuesday, November 25, 2008 10:41 AM
> To: datatype-dev@helixcommunity.org
> Subject: RESEND CR: Audio playback for some audio formats is not working on Emulator with
>HEAD branch.
>
> 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: ext-asheesh.srivastava@nokia.com
>
> Reviewed by:
>
> Date: 21-Nov-2008
>
> Project: symbianMmf_wm
>
> Error-Id: N/A
>
> Synopsis: Audio playback for some audio formats is not working on Emulator with HEAD branch.
>
> Overview: WMA and AAC audio clips is not working on Emulator with Head branch.
> If it is an A/V clip and has AAC/WMA audio, first video frame appears and video gets frozen on
>emulator. Timeline also does not move.
>
> Its happening because call to SetAudioPushdowm from CAudioRenderer::StartStream function is
>setting the target pushdown lesser than it
>
> is required to play the audio clip on emulator.
>
> Solution: For symbian platform, override MINIMUM_AUDIO_PUSHDOWN with value 1000.
>
> Files Modified:
> datatype\common\audrend\audrend.cpp
>
> New files added:
> None.
>
> Image Size and Heap Use impact: no major impact
>
> Module Release testing (STIF)- Passed
>
> Test case(s) Added : No.
>
> Platforms and Profiles Build Verified: helix-client-s60-50-mmf-mdf-dsp
>
> branch: helix_restricted
>
> platform: symbian-91-armv5, symbian-91-winscw-emulator
>
> target(s): symbianMmf_wm
>
> Branch: HEAD
>
> DIFF:
>
> Index: audrend.cpp
> ===================================================================
> RCS file: /cvsroot/datatype/common/audrend/audrend.cpp,v
> retrieving revision 1.46
> diff -u -b -r1.46 audrend.cpp
> --- audrend.cpp 21 Mar 2008 05:32:39 -0000 1.46
> +++ audrend.cpp 19 Nov 2008 21:46:12 -0000
> @@ -49,6 +49,10 @@
> #define BASE_AUDIO_RENDERER_NAME "Basic Audio"
> #define MINIMAL_AUDIO_PUSHDOWN 120
>
> +#ifdef HELIX_CONFIG_SYMBIAN_PCM_PUSHDOWN_BYTES
> +#define MINIMAL_AUDIO_PUSHDOWN 1000
> +#endif //HELIX_CONFIG_SYMBIAN_PCM_PUSHDOWN_BYTES
> +
> #ifdef _AUDREND_FLOW_LOG
> #define AUDREND_FLOW_FILE "C:\\audrend.txt"
> #else // _AUDREND_FLOW_LOG
>
> Regards,
> Asheesh Srivastava
>
>
From ehyche at real.com Wed Nov 26 11:39:25 2008
From: ehyche at real.com (Eric Hyche)
Date: Wed Nov 26 09:39:21 2008
Subject: [datatype-dev] RESEND: CR-Client Needed: Helix Core -
Datatype/ Error EJYG-7FWDJQ (For 210 Cays, 221 Cays and Head)
In-Reply-To: <43070ABC04E3884F8874997D8B1C6A9B017D40C7@xesebe102.nee.nokia.com>
References: <43070ABC04E3884F8874997D8B1C6A9B017D40BA@xesebe102.nee.nokia.com> <43070ABC04E3884F8874997D8B1C6A9B017D40C1@xesebe102.nee.nokia.com> <43070ABC04E3884F8874997D8B1C6A9B017D40C4@xesebe102.nee.nokia.com>
<43070ABC04E3884F8874997D8B1C6A9B017D40C7@xesebe102.nee.nokia.com>
Message-ID: <004d01c94ffe$b1665150$1432f3f0$@com>
Looks good.
=======================================
Eric Hyche (ehyche@real.com)
Principal Engineer
RealNetworks, Inc.
>-----Original Message-----
>From: datatype-dev-bounces@helixcommunity.org [mailto:datatype-dev-bounces@helixcommunity.org] On
>Behalf Of EXT-Sebastien.Gros2@nokia.com
>Sent: Wednesday, November 26, 2008 1:42 PM
>To: datatype-dev@helixcommunity.org
>Subject: [datatype-dev] RESEND: CR-Client Needed: Helix Core - Datatype/ Error EJYG-7FWDJQ (For 210
>Cays, 221 Cays and Head)
>Importance: High
>
>Modified by:
>Date: <11:26:08>
>Project:
>Bug Number: EJYG-7FWDJQ
>Synopsis: Being able to resume a video properly when having 2 instances playing video files.
>Overview:
>Reproducing the following steps leads the phone not to show any pictures when changing the orientation
>window:
>
>
>1. Play the MP4 video clip in full screen from File manager.
>
>2. Press Menu key and launch Video Center.
>
>3. Play a MP4 video clip in Video Center.
>
>4. Long press Menu key and select File manager.
>
>5. Select LSK('Options')-> Continue Play in nomal screen.
>
>
>
>When theses steps are performed quickly, Helix is assuming that the hardware is completely available
>when setting the window parameters.
>Unfortunately, it's not the case sometimes so SetWindowparameters steps are not completed, due to
>unaivailable hardware.
>
>Solution:
>
>
>
>When Resuming, try to set up agaiin window parameters so as to make sure they are known from the
>hardware.
>
>
>
>Files Modified:
>[Helix Folder]\datatype\mdf\video\renderer\mdfvideoadapter.cpp
>[Helix Folder]\datatype\mdf\video\renderer\pub\mdfvideoadapter.h
>
>Image Size and Heap Use impact (Client -Only):
>No change
>
>Platforms and Profiles Affected:
>
>helix-client-s60-32-mmf-mdf-arm
>
>helix-client-s60-50-mmf-mdf-arm
>
>
>
>Distribution Libraries Affected:
>mdfvidrender.dll
>
>
>Module Release testing (STIF) : yes
>
>Test case(s) Added : No
>
>Memory leak check performed : Yes. No new memory leaks introduced.
>
>Platforms and Profiles Build Verified:
>
>helix-client-s60-32-mmf-mdf-arm
>
>helix-client-s60-50-mmf-mdf-arm
>
>Head
>
>Platforms and Profiles Functionality verified: armv5, winscw
>
>Branch: 221Cays 210Cays Head
From gbajaj at real.com Sun Nov 30 22:45:49 2008
From: gbajaj at real.com (Gaurav Bajaj)
Date: Sun Nov 30 20:44:45 2008
Subject: [datatype-dev] CR: Consolidated CR for wma10 and wma9voice related
changes to support the same with Helix
Message-ID: <4933881D.2040003@real.com>
Skipped content of type multipart/alternative-------------- next part --------------
Index: wmadecoder.cpp
===================================================================
RCS file: /cvsroot/datatype/wm/audio/renderer/wmadecoder.cpp,v
retrieving revision 1.7.10.2
diff -u -r1.7.10.2 wmadecoder.cpp
--- wmadecoder.cpp 21 Feb 2008 04:58:54 -0000 1.7.10.2
+++ wmadecoder.cpp 28 Nov 2008 11:30:10 -0000
@@ -124,11 +124,19 @@
HX_ADDREF(m_pStreamHdr);
// Parse the init buffer
retVal = ParseInitBuffer(pInitBuf, ulInitBufLen);
- if (SUCCEEDED(retVal))
- {
- // Get the codec name, 4cc, and AU string from the format tag
- retVal = GetCodecInfo(m_AudioTSD.m_WaveFormatEx.m_usFormatTag, &m_pszCodec4cc, &m_pszCodecName, &m_pszCodec4cc);
- }
+ if(SUCCEEDED(retVal))
+ {
+ if(m_AudioTSD.m_WaveFormatEx.m_usFormatTag == 0x000a)
+ {
+ // Get the codec name, 4cc, and AU string from the format tag
+ retVal = GetWMA9VoiceCodecInfo(m_AudioTSD.m_WaveFormatEx.m_usFormatTag, &m_pszCodec4cc, &m_pszCodecName, &m_pszCodec4cc);
+ }
+ else
+ {
+ // Get the codec name, 4cc, and AU string from the format tag
+ retVal = GetCodecInfo(m_AudioTSD.m_WaveFormatEx.m_usFormatTag, &m_pszCodec4cc, &m_pszCodecName, &m_pszCodec4cc);
+ }
+ }
}
return retVal;
@@ -146,6 +154,11 @@
HX_DELETE(m_pDLLAccess);
// Load the codec DLL
retVal = LoadIHXAudioDecoderDLL(m_pContext, m_pszCodec4cc, &m_pAudioDecoder);
+ if (retVal==HXR_REQUEST_UPGRADE)
+ {
+ retVal = GetAltCodecInfo(m_AudioTSD.m_WaveFormatEx.m_usFormatTag, &m_pszCodec4cc, &m_pszCodecName, &m_pszCodec4cc);
+ retVal = LoadIHXAudioDecoderDLL(m_pContext, m_pszCodec4cc, &m_pAudioDecoder);
+ }
if (SUCCEEDED(retVal))
{
// See if it supports IHXObjectConfiguration, and if so,
@@ -391,23 +404,23 @@
{
case 0x0161:
{
- pszName = WMDECODER_CODEC_NAME_WMA9;
- pszFourCC = WMDECODER_CODEC_4CC_WMA9;
- pszAUStr = WMDECODER_CODEC_4CC_WMA9;
+ pszName = WMDECODER_CODEC_NAME_WMA10;
+ pszFourCC = WMDECODER_CODEC_4CC_WMA10;
+ pszAUStr = WMDECODER_CODEC_4CC_WMA10;
}
break;
case 0x0162:
{
- pszName = WMDECODER_CODEC_NAME_WMA9_PROFESSIONAL;
- pszFourCC = WMDECODER_CODEC_4CC_WMA9_PROFESSIONAL;
- pszAUStr = WMDECODER_CODEC_4CC_WMA9_PROFESSIONAL;
+ pszName = WMDECODER_CODEC_NAME_WMA10_PROFESSIONAL;
+ pszFourCC = WMDECODER_CODEC_4CC_WMA10_PROFESSIONAL;
+ pszAUStr = WMDECODER_CODEC_4CC_WMA10_PROFESSIONAL;
}
break;
case 0x0163:
{
- pszName = WMDECODER_CODEC_NAME_WMA9_LOSSLESS;
- pszFourCC = WMDECODER_CODEC_4CC_WMA9_LOSSLESS;
- pszAUStr = WMDECODER_CODEC_4CC_WMA9_LOSSLESS;
+ pszName = WMDECODER_CODEC_NAME_WMA10_LOSSLESS;
+ pszFourCC = WMDECODER_CODEC_4CC_WMA10_LOSSLESS;
+ pszAUStr = WMDECODER_CODEC_4CC_WMA10_LOSSLESS;
}
break;
default:
@@ -570,3 +583,79 @@
return retVal;
}
+
+HX_RESULT CWMAudioDecoder::GetAltCodecInfo(UINT16 usFormatTag, char** ppszFourCC, char** ppszName, char** ppszAUStr)
+{
+ HX_RESULT retVal = HXR_FAIL;
+
+ const char* pszName = NULL;
+ const char* pszFourCC = NULL;
+ const char* pszAUStr = NULL;
+ switch (usFormatTag)
+ {
+ case 0x0161:
+ {
+ pszName = WMDECODER_CODEC_NAME_WMA9;
+ pszFourCC = WMDECODER_CODEC_4CC_WMA9;
+ pszAUStr = WMDECODER_CODEC_4CC_WMA9;
+ }
+ break;
+ case 0x0162:
+ {
+ pszName = WMDECODER_CODEC_NAME_WMA9_PROFESSIONAL;
+ pszFourCC = WMDECODER_CODEC_4CC_WMA9_PROFESSIONAL;
+ pszAUStr = WMDECODER_CODEC_4CC_WMA9_PROFESSIONAL;
+ }
+ break;
+ case 0x0163:
+ {
+ pszName = WMDECODER_CODEC_NAME_WMA9_LOSSLESS;
+ pszFourCC = WMDECODER_CODEC_4CC_WMA9_LOSSLESS;
+ pszAUStr = WMDECODER_CODEC_4CC_WMA9_LOSSLESS;
+ }
+ break;
+ default:
+ HX_ASSERT(FALSE);
+ break;
+ }
+ if (pszName && pszFourCC && pszAUStr)
+ {
+ HX_VECTOR_DELETE(m_pszCodec4cc);
+ HX_VECTOR_DELETE(m_pszCodecName);
+ HX_VECTOR_DELETE(m_pszAutoUpgrade);
+ StrAllocCopy(m_pszCodec4cc, pszFourCC);
+ StrAllocCopy(m_pszCodecName, pszName);
+ StrAllocCopy(m_pszAutoUpgrade, pszAUStr);
+ // Clear the return value
+ retVal = HXR_OK;
+ }
+
+ return retVal;
+}
+
+HX_RESULT CWMAudioDecoder::GetWMA9VoiceCodecInfo(UINT16 usFormatTag, char** ppszFourCC, char** ppszName, char** ppszAUStr)
+{
+ HX_RESULT retVal = HXR_FAIL;
+
+ const char* pszName = NULL;
+ const char* pszFourCC = NULL;
+ const char* pszAUStr = NULL;
+
+ pszName = WMDECODER_CODEC_NAME_WMA9V;
+ pszFourCC = WMDECODER_CODEC_4CC_WMA9V;
+ pszAUStr = WMDECODER_CODEC_4CC_WMA9V;
+
+ if (pszName && pszFourCC && pszAUStr)
+ {
+ HX_VECTOR_DELETE(m_pszCodec4cc);
+ HX_VECTOR_DELETE(m_pszCodecName);
+ HX_VECTOR_DELETE(m_pszAutoUpgrade);
+ StrAllocCopy(m_pszCodec4cc, pszFourCC);
+ StrAllocCopy(m_pszCodecName, pszName);
+ StrAllocCopy(m_pszAutoUpgrade, pszAUStr);
+ // Clear the return value
+ retVal = HXR_OK;
+ }
+
+ return retVal;
+}
Index: wmadecoder.h
===================================================================
RCS file: /cvsroot/datatype/wm/audio/renderer/wmadecoder.h,v
retrieving revision 1.5
diff -u -r1.5 wmadecoder.h
--- wmadecoder.h 15 Nov 2006 15:10:33 -0000 1.5
+++ wmadecoder.h 28 Nov 2008 11:30:10 -0000
@@ -94,6 +94,8 @@
HX_RESULT ParseInitBuffer(BYTE* pBuf, UINT32 ulLen);
HX_RESULT GetCodecInfo(UINT16 usFormatTag, char** ppszFourCC, char** ppszName, char** ppszAUStr);
+ HX_RESULT GetAltCodecInfo(UINT16 usFormatTag, char** ppszFourCC, char** ppszName, char** ppszAUStr);
+ HX_RESULT GetWMA9VoiceCodecInfo(UINT16 usFormatTag, char** ppszFourCC, char** ppszName, char** ppszAUStr);
HX_RESULT LoadIHXAudioDecoderDLL(IUnknown* pContext, const char* pszCodec4cc, IHXAudioDecoder** ppIHXAudioDecoder);
HX_RESULT ConfigureAudioDecoder(IUnknown* pContext, const char* pszCodec4cc, IHXAudioDecoder* pDecoder);
HX_RESULT BuildOSSpecificDLLName(const char* psz4cc, char* pszNameBuf, UINT32 ulBufLen);
Index: wmarender.cpp
===================================================================
RCS file: /cvsroot/datatype/wm/audio/renderer/wmarender.cpp,v
retrieving revision 1.2.2.2
diff -u -r1.2.2.2 wmarender.cpp
--- wmarender.cpp 13 Sep 2007 17:52:54 -0000 1.2.2.2
+++ wmarender.cpp 28 Nov 2008 11:30:10 -0000
@@ -47,6 +47,7 @@
#include "wmaformat.h"
#include "wmarender.h"
#include "wmarender.ver"
+#include "parse_audio.h"
#include "hxheap.h"
#ifdef _DEBUG
@@ -121,12 +122,12 @@
const char* CWMAudioRenderer::GetCodecFourCC(void)
{
- return WMA_CODEC_4CC;
+ return WMDECODER_CODEC_4CC_WMA10;
}
const char* CWMAudioRenderer::GetCodecName(void)
{
- return WMA_CODEC_NAME;
+ return WMDECODER_CODEC_NAME_WMA10;
}
HX_RESULT STDAPICALLTYPE CWMAudioRenderer::HXCreateInstance(IUnknown** ppIUnknown)
-------------- next part --------------
Index: parse_asf_objects.cpp
===================================================================
RCS file: /cvsroot/datatype/wm/common/parse_asf_objects.cpp,v
retrieving revision 1.10.4.2
diff -u -r1.10.4.2 parse_asf_objects.cpp
--- parse_asf_objects.cpp 30 May 2008 15:22:04 -0000 1.10.4.2
+++ parse_asf_objects.cpp 28 Nov 2008 09:20:33 -0000
@@ -2912,7 +2912,7 @@
m_bErrorCorrectionPresent = ((ucTmp & 0x80) ? TRUE : FALSE);
// See if this packet contains opaque error correction data
m_bOpaqueDataPresent = ((ucTmp & 0x10) ? TRUE : FALSE);
- // Do we have
+ // Do we have error correction?
if (m_bErrorCorrectionPresent)
{
// If the MS bit is set (error correction is present), then
@@ -2943,6 +2943,16 @@
}
}
}
+ else
+ {
+ // No error correction was present, so the first byte of
+ // the ASF Data packet starts with payload parsing information.
+ // However, we still advanced the parsing cursor, so we need to back
+ // up one byte, so that we being parsing the payload information
+ // at the first byte of the ASF data packet.
+ *ppBuf -= 1;
+ *pulLen += 1;
+ }
if (SUCCEEDED(retVal) && !m_bOpaqueDataPresent)
{
// Parse the packet length type flags
@@ -3464,7 +3474,7 @@
// XXXMEH - in network playback, we may get packets which
// are bigger than the max packet size in the ASF header.
// So don't assert here.
-// HX_ASSERT(ulLen == m_ulExpectedPacketSize);
+ // HX_ASSERT(ulLen == m_ulExpectedPacketSize);
// Sanity check
HX_ASSERT(ulLen >= ulPayloadHdrLen);
if (pBuf && ulLen >= ulPayloadHdrLen)
Index: parse_audio.cpp
===================================================================
RCS file: /cvsroot/datatype/wm/common/parse_audio.cpp,v
retrieving revision 1.2
diff -u -r1.2 parse_audio.cpp
--- parse_audio.cpp 5 Jul 2006 14:49:56 -0000 1.2
+++ parse_audio.cpp 28 Nov 2008 09:20:34 -0000
@@ -43,7 +43,7 @@
HX_RESULT retVal = HXR_INVALID_PARAMETER;
// Sanity check the inputs
- if (usFormatTag >= 0x160 && usFormatTag <= 0x163 && ulAvgBytesPerSec && pulSamplesPerBlock)
+ if (((usFormatTag >= 0x160 && usFormatTag <= 0x163) || usFormatTag == 0x000a) && ulAvgBytesPerSec && pulSamplesPerBlock)
{
// Clear the return value
retVal = HXR_OK;
@@ -153,10 +153,10 @@
switch (pTSD->m_WaveFormatEx.m_usChannels)
{
case 1:
- pTSD->m_WaveFormatEx.m_usChannels = HXWM_SPEAKER_FRONT_CENTER;
+ pTSD->m_ulChannelMask = HXWM_SPEAKER_FRONT_CENTER;
break;
case 2:
- pTSD->m_WaveFormatEx.m_usChannels = HXWM_SPEAKER_FRONT_LEFT | HXWM_SPEAKER_FRONT_RIGHT;
+ pTSD->m_ulChannelMask = HXWM_SPEAKER_FRONT_LEFT | HXWM_SPEAKER_FRONT_RIGHT;
break;
}
// Clear the return value
@@ -188,15 +188,15 @@
switch (pTSD->m_WaveFormatEx.m_usChannels)
{
case 1:
- pTSD->m_WaveFormatEx.m_usChannels = HXWM_SPEAKER_FRONT_CENTER;
+ pTSD->m_ulChannelMask = HXWM_SPEAKER_FRONT_CENTER;
break;
case 2:
- pTSD->m_WaveFormatEx.m_usChannels = HXWM_SPEAKER_FRONT_LEFT | HXWM_SPEAKER_FRONT_RIGHT;
+ pTSD->m_ulChannelMask = HXWM_SPEAKER_FRONT_LEFT | HXWM_SPEAKER_FRONT_RIGHT;
break;
case 6:
- pTSD->m_WaveFormatEx.m_usChannels = HXWM_SPEAKER_FRONT_LEFT | HXWM_SPEAKER_FRONT_RIGHT |
- HXWM_SPEAKER_FRONT_CENTER | HXWM_SPEAKER_BACK_LEFT |
- HXWM_SPEAKER_BACK_RIGHT | HXWM_SPEAKER_LOW_FREQUENCY;
+ pTSD->m_ulChannelMask = HXWM_SPEAKER_FRONT_LEFT | HXWM_SPEAKER_FRONT_RIGHT |
+ HXWM_SPEAKER_FRONT_CENTER | HXWM_SPEAKER_BACK_LEFT |
+ HXWM_SPEAKER_BACK_RIGHT | HXWM_SPEAKER_LOW_FREQUENCY;
break;
}
// Clear the return value
@@ -207,7 +207,7 @@
else if (pTSD->m_WaveFormatEx.m_usFormatTag == 0x0162 ||
pTSD->m_WaveFormatEx.m_usFormatTag == 0x0163)
{
- // This is WMA 9 Pro or Lossless
+ // This is WMA9 Pro or WMA10 Pro
//
// Make sure we have at least 18 bytes of codec-specific data
if (pTSD->m_WaveFormatEx.m_usCodecSpecificDataSize >= 18)
@@ -218,8 +218,9 @@
UnpackUINT16LEInc(&pBuf, &ulLen, &usTmp);
UnpackUINT32LEInc(&pBuf, &ulLen, &pTSD->m_ulChannelMask);
UnpackUINT32LEInc(&pBuf, &ulLen, &ulTmp);
- UnpackUINT32LEInc(&pBuf, &ulLen, &ulTmp);
+ UnpackUINT32LEInc(&pBuf, &ulLen, &pTSD->m_ulAdvancedEncodeOpt2);
UnpackUINT16LEInc(&pBuf, &ulLen, &pTSD->m_usEncodeOptions);
+ UnpackUINT16LEInc(&pBuf, &ulLen, &pTSD->m_usAdvancedEncodeOpt);
// In the WMA 9 Pro or Lossless WAVEFORMATEX, the
// bits per sample field is actually the *valid* bits
// per sample. For example, the valid bits per sample might
@@ -245,6 +246,37 @@
}
}
}
+ else if(pTSD->m_WaveFormatEx.m_usFormatTag == 0x000a) //WMA9 Voice changes
+ {
+ // This is WMA 9 Voice
+ //
+ // Make sure we have at least 18 bytes of codec-specific data
+ if (pTSD->m_WaveFormatEx.m_usCodecSpecificDataSize >= 18)
+ {
+ // Parse the channel mask and the encode options
+ UnpackUINT16LEInc(&pBuf, &ulLen, &pTSD->m_usValidBitsPerSample);
+ UnpackUINT32LEInc(&pBuf, &ulLen, &pTSD->m_ulChannelMask);
+ UnpackUINT16LEInc(&pBuf, &ulLen, &pTSD->m_usEncodeOptions);
+
+ // Round up to the next byte
+ pTSD->m_WaveFormatEx.m_usBitsPerSample = 8 * ((pTSD->m_usValidBitsPerSample + 7) / 8);
+ pTSD->m_WaveFormatEx.m_usChannels = HXWM_SPEAKER_FRONT_CENTER;
+ // In WMA 9 Lossless and Pro, there is no specific samples per
+ // block field. We must compute it based on the sample
+ // rate and encode options.
+ UINT32 ulSamplesPerBlock = 0;
+ retVal = DetermineSamplesPerBlock(pTSD->m_WaveFormatEx.m_usFormatTag,
+ pTSD->m_WaveFormatEx.m_ulSamplesPerSec,
+ pTSD->m_WaveFormatEx.m_ulAvgBytesPerSec,
+ pTSD->m_usEncodeOptions,
+ &ulSamplesPerBlock);
+ if (SUCCEEDED(retVal))
+ {
+ // Assign the samples per block
+ pTSD->m_ulSamplesPerBlock = ulSamplesPerBlock;
+ }
+ }
+ }
}
}
Index: pub/parse_audio.h
===================================================================
RCS file: /cvsroot/datatype/wm/common/pub/parse_audio.h,v
retrieving revision 1.2
diff -u -r1.2 parse_audio.h
--- pub/parse_audio.h 5 Jul 2006 14:49:56 -0000 1.2
+++ pub/parse_audio.h 28 Nov 2008 09:20:34 -0000
@@ -57,6 +57,10 @@
UINT32 m_ulSuperBlockAlign;
UINT16 m_usValidBitsPerSample;
UINT32 m_ulChannelMask;
+
+ //Parameters for WMA10
+ UINT16 m_usAdvancedEncodeOpt;
+ UINT32 m_ulAdvancedEncodeOpt2;
}
HXWMATypeSpecificData;
@@ -81,6 +85,14 @@
#define HXWM_SPEAKER_TOP_BACK_CENTER 0x10000
#define HXWM_SPEAKER_TOP_BACK_RIGHT 0x20000
+#define WMDECODER_CODEC_NAME_WMA10 "Windows Media Audio 10"
+#define WMDECODER_CODEC_NAME_WMA10_PROFESSIONAL "Windows Media Audio 10 Professional"
+#define WMDECODER_CODEC_NAME_WMA10_LOSSLESS "Windows Media Audio 10 Lossless"
+#define WMDECODER_CODEC_4CC_WMA10 "wmaA"
+#define WMDECODER_CODEC_4CC_WMA10_PROFESSIONAL "wmaA"
+#define WMDECODER_CODEC_4CC_WMA10_LOSSLESS "wmaA"
+#define WMDECODER_CODEC_NAME_WMA9V "Windows Media Audio 9 Voice"
+#define WMDECODER_CODEC_4CC_WMA9V "wm9v"
HX_RESULT DetermineSamplesPerBlock(UINT16 usFormatTag, UINT32 ulSamplesPerSec, UINT32 ulAvgBytesPerSec,
UINT16 usEncodeOptions, UINT32* pulSamplesPerBlock);
From EXT-Sebastien.Gros2 at nokia.com Tue Nov 25 11:33:54 2008
From: EXT-Sebastien.Gros2 at nokia.com (EXT-Sebastien.Gros2@nokia.com)
Date: Tue Dec 2 08:02:12 2008
Subject: [datatype-dev] FW: CR-Client Needed: Helix Core - Datatype/ Error
EJYG-7FWDJQ
References: <43070ABC04E3884F8874997D8B1C6A9B017D40BA@xesebe102.nee.nokia.com>
<43070ABC04E3884F8874997D8B1C6A9B017D40BE@xesebe102.nee.nokia.com>
Message-ID: <43070ABC04E3884F8874997D8B1C6A9B017D40BF@xesebe102.nee.nokia.com>
________________________________
From: Sebastien Gros.2 (EXT-DextraTechnologies-MSW/Mexico)
Sent: Tue 18-Nov-08 15:20
To: DG.TP-S60-APPS-MM-VPD-HELIX@nokia.com
Subject: CR-Client Needed: Helix Core - Datatype/ Error EJYG-7FWDJQ
Modified by:
Date: <11:18:08>
Project:
Bug Number: EJYG-7FWDJQ
Synopsis: Being able to resume a video properly when having 2 instances playing video files.
Overview:
Reproducing the following steps leads the phone not to show any pictures when changing the orientation window:
1. Play the MP4 video clip in full screen from File manager.
2. Press Menu key and launch Video Center.
3. Play a MP4 video clip in Video Center.
4. Long press Menu key and select File manager.
5. Select LSK('Options')-> Continue Play in nomal screen.
When theses steps are performed quickly, Helix is assuming that the hardware is completely available when setting the window parameters.
Unfortunately, it's not the case sometimes so SetWindowparameters steps are not completed, due to unaivailable hardware.
Solution:
When Resuming, try to set up agaiin window parameters so as to make sure they are known from the hardware.
Files Modified:
[Helix Folder]\datatype\mdf\video\renderer\mdfvideoadapter.cpp
[Helix Folder]\datatype\mdf\video\renderer\pub\mdfvideoadapter.h
Image Size and Heap Use impact (Client -Only):
No change
Platforms and Profiles Affected:
helix-client-s60-32-mmf-mdf-arm
Distribution Libraries Affected:
mdfvidrender.dll
Module Release testing (STIF) : yes
Test case(s) Added : No
Memory leak check performed : Yes. No new memory leaks introduced.
Platforms and Profiles Build Verified:
helix-client-s60-32-mmf-mdf-arm
Platforms and Profiles Functionality verified: armv5, winscw
Branch: 221Cays
-------------- next part --------------
--- mdfvideoadapter_OLD.cpp Wed Nov 12 13:49:36 2008
+++ mdfvideoadapter.cpp Tue Nov 18 14:53:02 2008
@@ -190,6 +190,7 @@
m_CropRect.right = 0;
m_CropRect.bottom = 0;
+ m_bNeedToChangeParams = false;
MDFVIDEOLOG_LEAVEFN( "CMdfVideoAdapter" );
}
@@ -583,6 +584,22 @@
m_pDevVideoClient->Resume();
m_bIsPaused = FALSE;
m_DevVidInitialized = EInitializedSuccess;
+
+ if (m_bNeedToChangeParams)
+ {
+ m_windowRect = TRect(0,0,0,0);
+ m_clipRect = TRect(0,0,0,0);
+
+ HXxRect tempWinRect;
+ HXxRect tempClipRect;
+
+ (SymbianGlobalVideoParameters::Instance())->GetWindowParameters(tempWinRect, tempClipRect);
+
+ m_bNeedToChangeParams = FALSE;
+
+ SetWindowParameters(tempWinRect, tempClipRect);
+ }
+
MDFVIDEOLOG_LEAVEFN2( "VideoResume -- Sucess" );
}
@@ -908,6 +925,7 @@
m_DevVidInitialized = EInitializedResourceLost;
// DevVideo is paused by the server session
m_bIsPaused = TRUE;
+ m_bNeedToChangeParams = TRUE; //Will update parameters in VideoResume()
ReportError(KErrMMVideoDevice, HXLOG_INFO, HXR_DEVVIDEO_RESOURCE_LOST);
MDFVIDEOLOG_LEAVEFN2( "MmvroResourcesLost" );
-------------- next part --------------
--- mdfvideoadapter_OLD.h Wed Nov 12 13:39:18 2008
+++ mdfvideoadapter.h Tue Nov 18 14:58:29 2008
@@ -252,6 +252,7 @@
HXBOOL m_bIsShutdown;
HXBOOL m_bIsPlayStartReceived;
HXBOOL m_bIsDevVideoStarted;
+ HXBOOL m_bNeedToChangeParams;
CPayloadFormatPluginDevice* m_pPayloadFormatPluginDevice;
HXBOOL m_bIsFirstFrameSent;
Copyright © 1995-2007 RealNetworks, Inc. All rights reserved.
RealNetworks and Helix are trademarks of RealNetworks.
All other trademarks or registered trademarks are the property of their respective holders.