After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 788758 - vaapidecodebin: Register element if no VPP support is available too
vaapidecodebin: Register element if no VPP support is available too
Status: RESOLVED FIXED
Product: GStreamer
Classification: Platform
Component: gstreamer-vaapi
unspecified
Other All
: Normal normal
: 1.13.1
Assigned To: GStreamer Maintainers
GStreamer Maintainers
Depends on:
Blocks:
 
 
Reported: 2017-10-10 08:36 UTC by Sebastian Dröge (slomo)
Modified: 2017-10-20 11:00 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
vaapidecodebin: Register element if no VPP support is available too (3.08 KB, patch)
2017-10-10 08:36 UTC, Sebastian Dröge (slomo)
none Details | Review
vaapidecodebin: Register element if no VPP support is available too (4.71 KB, patch)
2017-10-19 14:58 UTC, Sebastian Dröge (slomo)
committed Details | Review

Description Sebastian Dröge (slomo) 2017-10-10 08:36:17 UTC
See commit message
Comment 1 Sebastian Dröge (slomo) 2017-10-10 08:36:23 UTC
Created attachment 361216 [details] [review]
vaapidecodebin: Register element if no VPP support is available too

VPP support is only needed for advanced deinterlacing, which is not
enabled by default either. Error out if it is selected but VPP is not
supported, and otherwise just work without VPP support.
Comment 2 Víctor Manuel Jáquez Leal 2017-10-19 12:33:07 UTC
Review of attachment 361216 [details] [review]:

::: gst/vaapi/gstvaapidecodebin.c
@@ +314,3 @@
+  } else {
+    GST_INFO_OBJECT (vaapidecbin, "Creating a dummy display to test for vpp");
+    display = gst_vaapi_create_test_display ();

I'm a bit worry of creating, again, a test display to check if vpp is supported. I foresee three options:

1\ pass has_vpp to the element at registration time
2\ query for display through the gst context mechanism
3\ ignore all that and just create a test display again 

The first option looks promising

The second would mean to get vaapidecodebin more complex than needed

The third option is simpler, cleaner in code terms, but expensive.
Comment 3 Sebastian Dröge (slomo) 2017-10-19 12:51:28 UTC
(In reply to Víctor Manuel Jáquez Leal from comment #2)
> Review of attachment 361216 [details] [review] [review]:
> 
> ::: gst/vaapi/gstvaapidecodebin.c
> @@ +314,3 @@
> +  } else {
> +    GST_INFO_OBJECT (vaapidecbin, "Creating a dummy display to test for
> vpp");
> +    display = gst_vaapi_create_test_display ();
> 
> I'm a bit worry of creating, again, a test display to check if vpp is
> supported. I foresee three options:
> 
> 1\ pass has_vpp to the element at registration time

From the code that registers vaapidecodebin you mean? There's no easy way to pass this information through to the element, other than a global variable.

We could check once in gstvaapi.c if VPP is supported with the test display, and then just remember that. Would that work for you? E.g. by allowing to pass NULL to gst_vaapi_display_has_video_processing() or adding a new function or global variable.
Comment 4 Víctor Manuel Jáquez Leal 2017-10-19 13:42:01 UTC
(In reply to Sebastian Dröge (slomo) from comment #3)
>
> We could check once in gstvaapi.c if VPP is supported with the test display,
> and then just remember that. Would that work for you? E.g. by allowing to
> pass NULL to gst_vaapi_display_has_video_processing() or adding a new
> function or global variable.

Yes, that looks promising.
Comment 5 Sebastian Dröge (slomo) 2017-10-19 13:50:22 UTC
Which option do you prefer? Personally I'd just add a global variable inside the plugin that is set in plugin_init(), it's simplest.
Comment 6 Víctor Manuel Jáquez Leal 2017-10-19 14:23:43 UTC
(In reply to Sebastian Dröge (slomo) from comment #5)
> Which option do you prefer? Personally I'd just add a global variable inside
> the plugin that is set in plugin_init(), it's simplest.

That's ok for me.
Comment 7 Sebastian Dröge (slomo) 2017-10-19 14:58:18 UTC
Created attachment 361882 [details] [review]
vaapidecodebin: Register element if no VPP support is available too

VPP support is only needed for advanced deinterlacing, which is not
enabled by default either. Error out if it is selected but VPP is not
supported, and otherwise just work without VPP support.
Comment 8 Víctor Manuel Jáquez Leal 2017-10-20 10:39:51 UTC
Review of attachment 361882 [details] [review]:

lgtm

::: gst/vaapi/gstvaapi.h
@@ +5,3 @@
+ *    Author: Gwenole Beauchesne <gwenole.beauchesne@intel.com>
+ *  Copyright (C) 2011 Collabora Ltd.
+ *    Author: Nicolas Dufresne <nicolas.dufresne@collabora.co.uk>

Is copyright ok?
Comment 9 Sebastian Dröge (slomo) 2017-10-20 10:59:41 UTC
Attachment 361882 [details] pushed as a8f2309 - vaapidecodebin: Register element if no VPP support is available too