Failed to allocate buffer while playing mp4 file

Bruce Tsai wagamama.tsai at gmail.com
Thu Sep 5 03:36:20 PDT 2013


> Message: 1
> Date: Tue, 3 Sep 2013 12:02:12 +0800
> From: Bruce Tsai <wagamama.tsai at gmail.com>
> To: gstreamer-android at lists.freedesktop.org
> Subject: Re: Failed to allocate buffer while playing mp4 file
> Message-ID:
>         <CAMZeiQt7KsguDXQGd=
> mX5HR9Aov_ti_b5fEPU8ZvJz5hpLamnw at mail.gmail.com>
> Content-Type: text/plain; charset="utf-8"
>
> > Message: 2
> > Date: Mon, 02 Sep 2013 16:20:13 +0200
> > From: Sebastian Dr?ge <slomo at circular-chaos.org>
> > To: Discussions about GStreamer on Android
> >         <gstreamer-android at lists.freedesktop.org>
> > Subject: Re: Failed to allocate buffer while playing mp4 file
> > Message-ID: <1378131613.4380.30.camel at thor.lan>
> > Content-Type: text/plain; charset="utf-8"
> >
> > On Mo, 2013-09-02 at 17:10 +0800, Bruce Tsai wrote:
> > >
> > >         Message: 5
> > >         Date: Mon, 02 Sep 2013 09:48:48 +0200
> > >         From: Sebastian Dr?ge <slomo at circular-chaos.org>
> > >         To: Discussions about GStreamer on Android
> > >                 <gstreamer-android at lists.freedesktop.org>
> > >         Subject: Re: Failed to allocate buffer while playing mp4 file
> > >         Message-ID: <1378108128.4380.14.camel at thor.lan>
> > >         Content-Type: text/plain; charset="UTF-8"
> > >
> > >         On Mo, 2013-09-02 at 10:43 +0800, Bruce Tsai wrote:
> > >         > If I want to print more debug info, how could I build
> > >         gstreamer-sdk
> > >         > with my modified code by "cerbero"?
> > >
> > >         You should first of all build the SDK completely for Android
> > >         according
> > >         to the documentation. Then you could use the cerbero shell to
> > >         apply your
> > >         changes in
> > >
> > cerbero/sources/android*/gst-plugins-bad-*-static/sys/androidmedia
> > >         run make and copy .libs/*.a to
> > >         cerbero/dist/android*/lib/gstreamer*/static
> > >
> > >
> > >
> > > This is really really interesting!
> > > I rebuilt libgstandroidmedia according your instruction without
> > > modifying anything.
> > > Then every thing is fine though the error, "Failed to call Java
> > > method", still exists!
> > > The video frames are correctly presented with audio.
> >
> > Not sure why or how that is possible :) Which instructions and sources
> > did you use to build GStreamer?
> >
>
> I git cerbero from git://anongit.freedesktop.org/gstreamer-sdk/cerbero
> The commit index is 374d5b.
> After setup, run "cerbero -c config/cross-andorid.cbc bootstrap"
> Then run "cerbero -c config/cross-android.cbc package gstreamer-sdk"
> The version of gst-plugins-bad-static in cerbero/sources/android_arm is
> 0.10.23
>
>
> >
> > > By outputting exception detail, I also found "Failed to call Java
> > > method" is due to an exception from calling "dequeueOutputBuffer".
> > > There is a similar question on StackOverflow, [1].
> >
> > Hmm, I don't think this is related though. Might be useful to check from
> > where in the Android code this exception comes from, and also what
> > exactly the exception is first (i.e. print the stacktrace and all
> > that) :)
> >
> >
> I updated the log at [1] with stacktrace for the exception.
>
>
> java.lang.IllegalStateException
> android.media.MediaCodec.dequeueOutputBuffer(Native Method)
> dalvik.system.NativeStart.run(Native Method)
>
>
> [1]
>
> https://dl.dropboxusercontent.com/u/72809300/GoogleNexus7/log_no_mp4_video.txt


Though I could play mp4 file with gstreamer on Android, I still want to
know why these errors occur.
Updated log is at [1].

There's an error "Downstream returned wrong-state" in function
"gst_amc_video_dec_handle_frame" of gstamcvideodec.c.
The "downstream_flow_ret" is -2, which means GST_FLOW_FLUSHING.
But the "flushing" is 0.
Above information seems in conflict situation.

An error "Failed to allocate buffer" occurs in function
"gst_amc_video_dec_loop" of gstamcvideodec.c.
This error is due to GST_FLOW_FLUSHING as well.

And also have "Failed to call Java method" in function
"gst_amc_codec_dequeue_output_buffer" of gstamc.c.
The stacktrace is as follows:
    java.lang.IllegalStateException
    at android.media.MediaCodec.dequeueOutputBuffer(Native Method)
    dalvik.system.NativeStart.run(Native Method)

[1]
https://dl.dropboxusercontent.com/u/72809300/GoogleNexus7/log_no_mp4_video.txt
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.freedesktop.org/archives/gstreamer-android/attachments/20130905/f6663d5e/attachment.html>


More information about the gstreamer-android mailing list