<div dir="ltr"><br><div class="gmail_extra"><div class="gmail_quote"><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex">
Message: 1<br>
Date: Tue, 3 Sep 2013 12:02:12 +0800<br>
From: Bruce Tsai <<a href="mailto:wagamama.tsai@gmail.com">wagamama.tsai@gmail.com</a>><br>
To: <a href="mailto:gstreamer-android@lists.freedesktop.org">gstreamer-android@lists.freedesktop.org</a><br>
Subject: Re: Failed to allocate buffer while playing mp4 file<br>
Message-ID:<br>
<CAMZeiQt7KsguDXQGd=<a href="mailto:mX5HR9Aov_ti_b5fEPU8ZvJz5hpLamnw@mail.gmail.com">mX5HR9Aov_ti_b5fEPU8ZvJz5hpLamnw@mail.gmail.com</a>><br>
Content-Type: text/plain; charset="utf-8"<br>
<br>
> Message: 2<br>
> Date: Mon, 02 Sep 2013 16:20:13 +0200<br>
> From: Sebastian Dr?ge <<a href="mailto:slomo@circular-chaos.org">slomo@circular-chaos.org</a>><br>
> To: Discussions about GStreamer on Android<br>
> <<a href="mailto:gstreamer-android@lists.freedesktop.org">gstreamer-android@lists.freedesktop.org</a>><br>
> Subject: Re: Failed to allocate buffer while playing mp4 file<br>
> Message-ID: <1378131613.4380.30.camel@thor.lan><br>
> Content-Type: text/plain; charset="utf-8"<br>
><br>
> On Mo, 2013-09-02 at 17:10 +0800, Bruce Tsai wrote:<br>
> ><br>
> > Message: 5<br>
> > Date: Mon, 02 Sep 2013 09:48:48 +0200<br>
> > From: Sebastian Dr?ge <<a href="mailto:slomo@circular-chaos.org">slomo@circular-chaos.org</a>><br>
> > To: Discussions about GStreamer on Android<br>
> > <<a href="mailto:gstreamer-android@lists.freedesktop.org">gstreamer-android@lists.freedesktop.org</a>><br>
> > Subject: Re: Failed to allocate buffer while playing mp4 file<br>
> > Message-ID: <1378108128.4380.14.camel@thor.lan><br>
> > Content-Type: text/plain; charset="UTF-8"<br>
> ><br>
> > On Mo, 2013-09-02 at 10:43 +0800, Bruce Tsai wrote:<br>
> > > If I want to print more debug info, how could I build<br>
> > gstreamer-sdk<br>
> > > with my modified code by "cerbero"?<br>
> ><br>
> > You should first of all build the SDK completely for Android<br>
> > according<br>
> > to the documentation. Then you could use the cerbero shell to<br>
> > apply your<br>
> > changes in<br>
> ><br>
> cerbero/sources/android*/gst-plugins-bad-*-static/sys/androidmedia<br>
> > run make and copy .libs/*.a to<br>
> > cerbero/dist/android*/lib/gstreamer*/static<br>
> ><br>
> ><br>
> ><br>
> > This is really really interesting!<br>
> > I rebuilt libgstandroidmedia according your instruction without<br>
> > modifying anything.<br>
> > Then every thing is fine though the error, "Failed to call Java<br>
> > method", still exists!<br>
> > The video frames are correctly presented with audio.<br>
><br>
> Not sure why or how that is possible :) Which instructions and sources<br>
> did you use to build GStreamer?<br>
><br>
<br>
I git cerbero from git://<a href="http://anongit.freedesktop.org/gstreamer-sdk/cerbero" target="_blank">anongit.freedesktop.org/gstreamer-sdk/cerbero</a><br>
The commit index is 374d5b.<br>
After setup, run "cerbero -c config/cross-andorid.cbc bootstrap"<br>
Then run "cerbero -c config/cross-android.cbc package gstreamer-sdk"<br>
The version of gst-plugins-bad-static in cerbero/sources/android_arm is<br>
0.10.23<br>
<br>
<br>
><br>
> > By outputting exception detail, I also found "Failed to call Java<br>
> > method" is due to an exception from calling "dequeueOutputBuffer".<br>
> > There is a similar question on StackOverflow, [1].<br>
><br>
> Hmm, I don't think this is related though. Might be useful to check from<br>
> where in the Android code this exception comes from, and also what<br>
> exactly the exception is first (i.e. print the stacktrace and all<br>
> that) :)<br>
><br>
><br>
I updated the log at [1] with stacktrace for the exception.<br>
<br>
<br>
java.lang.IllegalStateException<br>
android.media.MediaCodec.dequeueOutputBuffer(Native Method)<br>
dalvik.system.NativeStart.run(Native Method)<br>
<br>
<br>
[1]<br>
<a href="https://dl.dropboxusercontent.com/u/72809300/GoogleNexus7/log_no_mp4_video.txt" target="_blank">https://dl.dropboxusercontent.com/u/72809300/GoogleNexus7/log_no_mp4_video.txt</a></blockquote><div><br></div><div>
Though I could play mp4 file with gstreamer on Android, I still want to know why these errors occur.</div><div>Updated log is at [1].</div><div><br></div><div>There's an error "Downstream returned wrong-state" in function "gst_amc_video_dec_handle_frame" of gstamcvideodec.c.</div>
<div>The "downstream_flow_ret" is -2, which means GST_FLOW_FLUSHING.</div><div>But the "flushing" is 0.</div><div>Above information seems in conflict situation.</div><div><br></div><div>An error "Failed to allocate buffer" occurs in function "gst_amc_video_dec_loop" of gstamcvideodec.c.</div>
<div>This error is due to GST_FLOW_FLUSHING as well.</div><div><br></div><div>And also have "Failed to call Java method" in function "gst_amc_codec_dequeue_output_buffer" of gstamc.c.</div><div>The stacktrace is as follows:</div>
<div><div> java.lang.IllegalStateException</div><div> at android.media.MediaCodec.dequeueOutputBuffer(Native Method)</div><div> dalvik.system.NativeStart.run(Native Method)</div></div><div><br></div><div>[1] <a href="https://dl.dropboxusercontent.com/u/72809300/GoogleNexus7/log_no_mp4_video.txt" target="_blank">https://dl.dropboxusercontent.com/u/72809300/GoogleNexus7/log_no_mp4_video.txt</a></div>
</div></div></div>