[Bug 705129] androidmedia: add support for video encoding

GStreamer (bugzilla.gnome.org) bugzilla at gnome.org
Mon Sep 16 19:39:34 PDT 2013


https://bugzilla.gnome.org/show_bug.cgi?id=705129
  GStreamer | gst-plugins-bad | git

--- Comment #8 from cee1 <fykcee1 at gmail.com> 2013-09-17 02:39:28 UTC ---
I've tested these new patches, they work on my pad.
I notice an API change, the patch for it is here:
https://github.com/cee1/gst-plugins-bad/commit/6bcce47d6a3459e14dba3ce2a879931055ad7903

(In reply to comment #7)
> > > @@ +1246,3 @@
> > > +    gst_buffer_fill (out_buf, 0, buf->data + buffer_info->offset,
> > > +        buffer_info->size);
> > > +
> > > 
> > > You probably also have to handle (differently) codec_data or header buffers
> > > here. They might appear in the GstAmcFormat as csd-0, csd-1, etc fields. Or
> > > maybe inside the stream. Depending on codec/stream-format they need to be put
> > > in-stream or into the caps
> > I have no idea.
> > For gst-omx, it will get the codec_data from omx_buf of
> > OMX_BUFFERFLAG_CODECCONFIG type.
> > For h264, it is in stream.
> > For other format which may have codec_data in GstAmcFormat, but no 
> > INFO_OUTPUT_FORMAT_CHANGED returned for the first time... 
> 
> Is it actually returned in the output format if you get it later? If that is
> the case I think it is safe to assume that the output format is final once you
> get the first output buffer.
> 
> For in-stream codec_data you probably get a flag set on the buffer too, like in
> gst-omx.
But that flag in gst-omx is set by underling OpenMAX component, right? In
gstamcvideoenc when to set such a flag?

I tried to use gst_amc_codec_get_output_format()(and hope there is csd-0 or
csd-1)[1] but got a SEGV[2].

So, it seems I can only retrieve in-stream codec_data, and I need to parse
buffers for each codec which has in-stream codec_data -- then, why not append a
*parse(h264parse, etc) after gstamcvideoenc?

----
[1] 
diff --git a/sys/androidmedia/gstamcvideoenc.c
b/sys/androidmedia/gstamcvideoenc.c
index 79b7f32..0abef91 100644
--- a/sys/androidmedia/gstamcvideoenc.c
+++ b/sys/androidmedia/gstamcvideoenc.c
@@ -1276,18 +1276,26 @@ retry:

       GST_DEBUG_OBJECT (self, "Output format has changed");

+#if 0
       format = (idx == INFO_OUTPUT_FORMAT_CHANGED) ?
           gst_amc_codec_get_output_format (self->codec) :
           self->first_set_format;
+#else
+      format = gst_amc_codec_get_output_format (self->codec);
+#endif

[2] SIGSEGV:
I/DEBUG   ( 1708): backtrace:
I/DEBUG   ( 1708):     #00  pc 00007e90 
/system/lib/libstagefright_foundation.so
(android::AMessage::writeToParcel(android::Parcel*) const+211)
I/DEBUG   ( 1708):     #01  pc 00015793  /system/lib/libmedia_jni.so
(android::ConvertMessageToMap(_JNIEnv*, android::sp<android::AMessage> const&,
_jobject**)+886)
I/DEBUG   ( 1708):     #02  pc 0000f199  /system/lib/libmedia_jni.so
(android::JMediaCodec::getOutputFormat(_JNIEnv*, _jobject**) const+32)
I/DEBUG   ( 1708):     #03  pc 0000f637  /system/lib/libmedia_jni.so
I/DEBUG   ( 1708):     #04  pc 0001df30  /system/lib/libdvm.so
(dvmPlatformInvoke+112)
I/DEBUG   ( 1708):     #05  pc 0004d183  /system/lib/libdvm.so
(dvmCallJNIMethod(unsigned int const*, JValue*, Method const*, Thread*)+394)
I/DEBUG   ( 1708):     #06  pc 00027360  /system/lib/libdvm.so
I/DEBUG   ( 1708):     #07  pc 0002bc68  /system/lib/libdvm.so
(dvmInterpret(Thread*, Method const*, JValue*)+180)
I/DEBUG   ( 1708):     #08  pc 0005f8f5  /system/lib/libdvm.so
(dvmCallMethodV(Thread*, Method const*, Object*, bool, JValue*,
std::__va_list)+272)
I/DEBUG   ( 1708):     #09  pc 0004c983  /system/lib/libdvm.so
I/DEBUG   ( 1708):     #10  pc 001fcfeb 
/data/data/com.lemote.mcplayer/lib/libgstreamer_android.so
(gst_amc_codec_get_output_format+38)

-- 
Configure bugmail: https://bugzilla.gnome.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the QA contact for the bug.
You are the assignee for the bug.


More information about the gstreamer-bugs mailing list