[prev in list] [next in list] [prev in thread] [next in thread]
List: helix-datatype-cvs
Subject: [Datatype-cvs] mdf/audio/dsp mdfaudfmt.h,1.1.2.12,1.1.2.13
From: anugrahk () helixcommunity ! org
Date: 2010-04-29 11:22:12
Message-ID: 201004291122.o3TBMnKG004471 () mailer ! progressive-comp ! com
[Download RAW message or body]
Update of /cvsroot/datatype/mdf/audio/dsp
In directory cvs01.internal.helixcommunity.org:/tmp/cvs-serv9719
Modified Files:
Tag: hxclient_2_1_0_cayennes
mdfaudfmt.h
Log Message:
Nokia submits this code under the terms of a commercial contribution agreement with \
RealNetworks, and I am authorized to contribute this code under said agreement."
Modified by: ext-anugrah.2.kashari@nokia.com
Reviewed by: Rathinasamy Rajesh
ext Sheldon Fu [sfu@real.com]
TSW Id: EZLU-83T9YY
Date: 04/28/2010
Project: SymbianMmf_wm
Synopsis: AppCert-WIN7-Device can not play WMV video with H264 conent
Overview: WMA audio stream is decoded as a block. Number of samples produced from \
each audio block need not be constant. When using SW codec, CWMAudioDecoder::Decode() \
(called in CWMAudioFormat::DecodeAudioData() ) returns exact number of samples \
produced after decoding. This value is used to keep track of decoded output time. \
This is later used to make decision on whether buffering is required or not. In \
case of DSP codec CHXMDFAudioDecoder::Decode()returns a dummy value for number of \
samples produced which is equal to HXMDFAudioFormat::m_uSamplesPerFrame. This is \
incorrect as number of samples produced per audio block is not constant. In this \
defect this value was much lower than the actual value. Therefore, helix goes into \
buffering mode and loading happens at regular intervals. Number of samples produced \
is required by CWMAudioFormat to keep track of current decode time. This value need \
not be accurate but should be close enough to actual decode time. Number of samples \
produces cannot be known without decoding. In case of DSP codec \
CHXMDFAudioDecoder::Decode() does not actually decode audio but simply stores data \
which is later sent in CMDFDevSound::BufferToBeFilled() call. CWMAudioFormat module \
is not aware of this and it updates current decode time according to the values \
retuned. Therefore, changes are needed in CHXMDFAudioDecoder::Decode() to ensure that \
total accumulated time is close to decode time.
Fix: 1. Number of samples produced can also be calculated using difference of \
presentation times of two consecutive audio blocks. For first audio block number of \
samples produce is approximated to HXMDFAudioFormat::m_uSamplesPerFrame. From next \
block onwards samples produced is equal to presentation time difference between the \
last audio block and current audio block (which is append to the buffer to be sent to \
DSP). This gives a better approximation for total output time than fixed \
m_uSamplesPerFrame. These calculations are done GetSamplesPerFrame() (a new function \
added to HXMDFAudioFormat)
2. In WMA audio format 0x161, wSamplesPerBlock (defined in union Samples (type WORD) \
of WAVEFORMATEXTENSIBLE) is present if and only if wBitsPerSample==0. If value of \
Samples is zero it means that wSamplesPerBlock is not constant. So it is safer to \
initialized m_uSamplesPerFrame with BlockAlign*channels( also done in SW codec). This \
value is used once and rest of calculation are based on the timestamp of audio \
blocks.
Files modified & changes:
/datatype/mdf/audio/dsp/mdfaudfmt.cpp
/datatype/mdf/audio/dsp/mdfaudfmt.h
/datatype/mdf/audio/dsp/mdfauddecoder.h
/datatype/mdf/audio/dsp/mdfauddecoder.cpp
Image Size and Heap Use impact: No major impact
Module Release testing (STIF) : Passed
Test case(s) Added : Yes WMV specfic
Memory leak check performed : Passed, No additional leaks introduced.
Platforms and Profiles Build Verified: helix-client-s60-52-mmf-mdf-dsp
Platforms and Profiles Functionality verified: armv5
Branch: 210CayS, 420Bizo and HEAD
Index: mdfaudfmt.h
===================================================================
RCS file: /cvsroot/datatype/mdf/audio/dsp/mdfaudfmt.h,v
retrieving revision 1.1.2.12
retrieving revision 1.1.2.13
diff -u -d -r1.1.2.12 -r1.1.2.13
--- mdfaudfmt.h 30 Mar 2010 05:44:12 -0000 1.1.2.12
+++ mdfaudfmt.h 29 Apr 2010 11:22:09 -0000 1.1.2.13
@@ -115,6 +115,8 @@
virtual HX_RESULT GetMDFAudioPacket(HXMDFAudioData *mdfAudioData, \
CMMFBuffer * dataOutBuffer, HXBOOL& bRelease);
virtual UINT32 PrepareHeader(HXMDFAudioData*,UINT32,UINT32,TPtrC8&);
virtual void SetStartTime(UINT32 ulStartTime);
+ virtual UINT16 GetSamplesPerFrame(UINT32 ulNextFrameTime,UINT32 \
ulLastFrameTime){return m_uSamplesPerFrame;}; +
protected:
HXMDFAudioFormat();
@@ -175,6 +177,7 @@
HXMDFAudioData* CreateMDFAudioData(UINT32 nBytes, UINT32 timestamp, HXBOOL& \
eof); UINT32 PrepareHeader(HXMDFAudioData*,UINT32,UINT32,TPtrC8&);
+ UINT16 GetSamplesPerFrame(UINT32 ulNextFrameTime,UINT32 ulLastFrameTime);
HXWMATypeSpecificData m_AudioTSD;
_______________________________________________
Datatype-cvs mailing list
Datatype-cvs@helixcommunity.org
http://lists.helixcommunity.org/mailman/listinfo/datatype-cvs
[prev in list] [next in list] [prev in thread] [next in thread]
Configure |
About |
News |
Add a list |
Sponsored by KoreLogic