Zero-copy "decodebin ! glimagesink" equivalent to playbin on Android
Matthew Waters
matthew at centricular.com
Tue Feb 9 07:12:02 UTC 2016
On 09/02/16 17:35, Grégoire Gentil wrote:
>
>
> On 02/08/2016 04:31 PM, Matthew Waters wrote:
>> If everything is working, then it will be picked automatically. The
>> fact that it isn't, indicates a problem with your code. Look at
>> playbin's implementation as well as the debug logs to determine what
>> exactly is happening (It's all there somewhere ;)).
>
>
> Are you absolutely sure it's only bug 742924 and there is no problem
> elsewhere?
Never. The problem you described was decodebin ! glimagesink not
negotiating zerocopy which *is* the aforementioned bug.
> I have implemented an horrible but working autoplug_query function:
>
>
>
> static gboolean autoplug_query_cb(GstElement *bin, GstPad *pad,
> GstElement *element, GstQuery *query, CustomData *data) {
>
> if (strstr(gst_element_get_name(element), "amcvideodec") == NULL)
> return FALSE;
>
> if (GST_QUERY_TYPE(query) == GST_QUERY_CONTEXT) {
> GstPad *sinkpad = gst_element_get_static_pad(data->scd[0].video_sink,
> "sink");
> if (sinkpad) {
> gboolean res = gst_pad_query(sinkpad, query);
> gst_object_unref(sinkpad);
> return res;
> }
> }
>
> if (GST_QUERY_TYPE(query) == GST_QUERY_CAPS) {
> GstCaps *filter;
> gst_query_parse_caps(query, &filter);
> char *a = gst_caps_to_string(filter);
> char *b = strstr(a, ";");//The first hunk is always the gl one
> //structure from caps is confused by memory:GLMemory
> //so we go down to string
> if (b) *b = '\0';
> if (strstr(a, "texture-target=(string)external-oes") != NULL) {
> GstCaps *cc = gst_caps_from_string(a);
> GST_DEBUG("WE FOUND IT %s\n", gst_caps_to_string(cc));
> gst_query_set_caps_result(query, cc);
> return TRUE;
> }
> }
>
> return FALSE;
> }
>
>
>
> I'm pretty sure it's working because I get the following in the log:
>
>
> aigstreamer.c:625:autoplug_query_cb WE FOUND IT
> video/x-raw(memory:GLMemory), format=(string)RGBA,
> texture-target=(string)external-oes
>
> 02-08 21:57:54.140 20973 21058 I GStreamer+GST_CONTEXT:
> 0:00:08.614410400 0x9c73fe30
> gstglutils.c:573:_gst_context_query:<amcvideodec-omxqcomvideodecoderavc0>
> found context (0x96c68120) in downstream query
>
> 02-08 21:57:54.142 20973 21058 I GStreamer+amcvideodec:
> 0:00:08.616394043 0x9c73fe30
> gstamcvideodec.c:1953:gst_amc_video_dec_set_format:<amcvideodec-omxqcomvideodecoderavc0>
> GL output: enabled
>
>
> so hardware goes directly to GL and context is properly passed.
>
>
> But decodebin ! glimagesink is still at 30fps while playbin is at
> 50fps. I *really* suspect that there is another problem somewhere else,
There may be. If you believe there is a problem, you have to find it
with your deductive skills ;)
Cheers
-Matt
> Grégoire
>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 473 bytes
Desc: OpenPGP digital signature
URL: <https://lists.freedesktop.org/archives/gstreamer-android/attachments/20160209/7cc6f85f/attachment.sig>
More information about the gstreamer-android
mailing list