Hi Anupama,

In Mp4, A movie fragment is usually time based(15sec) and contains fixed
number of samples/frames for audio/video tracks for this interval. The
getNumFragments() returns number of fragments present in a particular track.
The Mp4 parser parses the movie fragment to extract Audio/Video frames. The
parser can send one frame or multiple frames to omx component for decoding
in one buffer( I'm not sure about how PV is doing it). Assuming PV parser
has filled/copied X number of bytes(which may contain non integer number of
frames ) to the OpenMax component InputBuffer..  As per your below mentioned
findings, it seems the DecodeFrame() is not consuming the entire buffer you
have sent for decoding. Most of the decoders operates on frame by frame
basis. For AAC, The minimum InputBuffer size required for decoding is 1536
bytes(Stereo, except EOS case). The parser keeps filling 1536 bytes to
openmax component buffer. The decoder may consume a part of this or complete
data. You have to take care of offsets calculation in the openmax component.
After returning from DecodeFrame() check whether any data left in the
InputBuffer(InputFrameSize - decConsumedBytes) and advance the InputBuffer
pointer by decConsumedBytes and push it to decoder for decoding. When
decoder returns INCOMPLETE_FRAME than You have to copy left over data
present in the current input buffer to the next Incoming buffer and call
decode frame again.
Following are my suggestions for fixing this bug,
1. Please try with a clip which has only moov atom/box. Once you succeed,
you can verify for moof box/atom.
2. Log Input and Output data in open max component and compare this with
standalone parser and decoder outputs.
3. Please send us the m4a clip with Log so that we can throw away all our
assumptions.

Thanks and regards,
-Lakshman




On Sat, Mar 20, 2010 at 12:54 PM, anupama <[email protected]> wrote:

> Hi All,
>
> I have integrated AAC codec to Android Platform and I am able to play
> a test file test_adts.aac.
>
> But I am getting some issues here when I play a m4a file.
> The issues I am facing are -
>  -1) It's getting reset automatically (coming to the beginning) after
> playing for some 30-40 seconds.
>  -2) Some data part are skipped in the input as well as in the
> decoded
> output.
>
> From the logs below is my understanding -
>
> - PV is getting 4 fragments through getNumFragments() ,filling the
> input buffer with these 4 fragments and sending the buffer to the
> component.
>
> - My doubt is -
>
>  1) Is fragment is nothing but a frame?
>  2)The no. of samples given to the decoder frame by frame OR is it
> the
> buffer containing multi frames ?
>  3) If the decoder decodes some part of the data in the input buffer
> and some bytes are left undecoded and I set the nOffset value
> accordingly,  does PV take care of this while sending the buffer next
> time to the component?
> 4)  I don't see the use of updated nOffset in the
> pvmf_omx_basedec_node.cpp file apart from FillBufferDoneProcessing()
> function. Is it required to set the nOffset value for input and
> output
> buffer before EmptyBufferDone() and FillBufferDone() calls in the
> component?
>
>
> Please help me to get this clear.
>
>
> Thanks & Regards,
> Anupama
>
>
> --
> unsubscribe: 
> [email protected]<android-porting%[email protected]>
> website: http://groups.google.com/group/android-porting
>
> To unsubscribe from this group, send email to android-porting+
> unsubscribegooglegroups.com or reply to this email with the words "REMOVE
> ME" as the subject.
>

-- 
unsubscribe: [email protected]
website: http://groups.google.com/group/android-porting

To unsubscribe from this group, send email to 
android-porting+unsubscribegooglegroups.com or reply to this email with the 
words "REMOVE ME" as the subject.

Reply via email to