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 698054 - Port gstreamer-vaapi to GStreamer API 1.2.x
Port gstreamer-vaapi to GStreamer API 1.2.x
Status: RESOLVED FIXED
Product: gstreamer-vaapi
Classification: Other
Component: general
git master
Other Linux
: Normal enhancement
: ---
Assigned To: gstreamer-vaapi maintainer(s)
gstreamer-vaapi maintainer(s)
Depends on: 687183 700967 703235 703236 703271 709112 709200
Blocks: 719412
 
 
Reported: 2013-04-15 11:30 UTC by Víctor Manuel Jáquez Leal
Modified: 2013-12-19 12:14 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
[clutter-gst] Add HW decoder support back (3.30 KB, patch)
2013-04-15 15:37 UTC, Gwenole Beauchesne
none Details | Review
intial port to gstreamer 1.2 api (11.75 KB, patch)
2013-05-17 16:48 UTC, Víctor Manuel Jáquez Leal
none Details | Review
Initial port to GStreamer 1.2 (19.91 KB, patch)
2013-05-21 10:58 UTC, Víctor Manuel Jáquez Leal
none Details | Review
initial port to GStreamer 1.2 (10.43 KB, patch)
2013-05-23 19:25 UTC, Víctor Manuel Jáquez Leal
none Details | Review
initial port to GStreamer 1.2 (10.46 KB, patch)
2013-06-04 11:06 UTC, Víctor Manuel Jáquez Leal
none Details | Review
pluginutil: add gst_vaapi_create_display() (2.68 KB, patch)
2013-06-04 11:06 UTC, Víctor Manuel Jáquez Leal
none Details | Review
pluginutil: add locks (1.56 KB, patch)
2013-06-04 11:06 UTC, Víctor Manuel Jáquez Leal
none Details | Review
display: add gstcontext utilities (2.44 KB, patch)
2013-06-04 11:07 UTC, Víctor Manuel Jáquez Leal
none Details | Review
libs: add gstvaapivideocontext (10.37 KB, patch)
2013-06-04 11:07 UTC, Víctor Manuel Jáquez Leal
none Details | Review
postproc: set context (3.37 KB, patch)
2013-06-04 11:07 UTC, Víctor Manuel Jáquez Leal
none Details | Review
decode: set context (3.14 KB, patch)
2013-06-04 11:07 UTC, Víctor Manuel Jáquez Leal
none Details | Review
decode: query context (1.91 KB, patch)
2013-06-04 11:07 UTC, Víctor Manuel Jáquez Leal
none Details | Review
sink: set context (3.51 KB, patch)
2013-06-04 11:07 UTC, Víctor Manuel Jáquez Leal
none Details | Review
sink: handle events (2.18 KB, patch)
2013-06-04 11:07 UTC, Víctor Manuel Jáquez Leal
none Details | Review
sink: handle context query (2.11 KB, patch)
2013-06-04 11:07 UTC, Víctor Manuel Jáquez Leal
none Details | Review
pluginsutil: GLX first (1.08 KB, patch)
2013-06-06 14:33 UTC, Víctor Manuel Jáquez Leal
none Details | Review
videobuffer: add GstVideoGLTextureUploadMeta (3.25 KB, patch)
2013-06-06 14:35 UTC, Víctor Manuel Jáquez Leal
none Details | Review
initial port to GStreamer 1.2 (10.46 KB, patch)
2013-06-12 13:26 UTC, Víctor Manuel Jáquez Leal
none Details | Review
pluginutil: add gst_vaapi_create_display() (2.75 KB, patch)
2013-06-12 13:27 UTC, Víctor Manuel Jáquez Leal
none Details | Review
pluginutil: add locks (1.63 KB, patch)
2013-06-12 13:28 UTC, Víctor Manuel Jáquez Leal
none Details | Review
display: add gstcontext utilities (2.44 KB, patch)
2013-06-12 13:28 UTC, Víctor Manuel Jáquez Leal
none Details | Review
libs: add gstvaapivideocontext (10.71 KB, patch)
2013-06-12 13:28 UTC, Víctor Manuel Jáquez Leal
none Details | Review
postproc: set context (3.64 KB, patch)
2013-06-12 13:28 UTC, Víctor Manuel Jáquez Leal
none Details | Review
decode: set context (3.58 KB, patch)
2013-06-12 13:28 UTC, Víctor Manuel Jáquez Leal
none Details | Review
decode: query context (1.91 KB, patch)
2013-06-12 13:28 UTC, Víctor Manuel Jáquez Leal
none Details | Review
sink: set context (3.94 KB, patch)
2013-06-12 13:28 UTC, Víctor Manuel Jáquez Leal
none Details | Review
sink: handle events (2.18 KB, patch)
2013-06-12 13:28 UTC, Víctor Manuel Jáquez Leal
none Details | Review
sink: handle context query (2.11 KB, patch)
2013-06-12 13:28 UTC, Víctor Manuel Jáquez Leal
none Details | Review
videobuffer: add GstVideoGLTextureUploadMeta (3.25 KB, patch)
2013-06-12 13:28 UTC, Víctor Manuel Jáquez Leal
none Details | Review
Add capsfeature support (3.82 KB, patch)
2013-06-13 14:21 UTC, sreerenj
none Details | Review

Description Víctor Manuel Jáquez Leal 2013-04-15 11:30:56 UTC
* Port gstreamer-vaapi to use GstContext instead of the -already removed- GstVideoContext

* Port gstreamer-vaapi to use GstVideoGLTextureUploadMeta instead of the -already removed- GstSurfaceConverter
Comment 1 Gwenole Beauchesne 2013-04-15 12:09:57 UTC
Those APIs are removed from GStreamer git master (towards 1.2.x), not from 1.0.x where they will be deprecated instead. It would be fine to indeed port gstreamer-vaapi to GStreamer git master and use the new APIs. Then, if that works good enough, backport the necessary support to 1.0.x.

However, meanwhile, and since OSVs are already using GStreamer 1.0.x as is, I have just implemented support GstSurfaceMeta. Tested with a slightly patched clutter-gst 1.9.92 only.
Comment 2 Gwenole Beauchesne 2013-04-15 15:37:23 UTC
Created attachment 241576 [details] [review]
[clutter-gst] Add HW decoder support back

Patch against clutter-gst 1.9.92 so that to test GstSurfaceMeta API + gstreamer-vaapi.
Comment 3 Víctor Manuel Jáquez Leal 2013-05-17 16:48:18 UTC
Created attachment 244557 [details] [review]
intial port to gstreamer 1.2 api

I'm starting to work on this. The current patch only enables the compilation of gstreamer-vaapi with gstreamer HEAD. 

The next step is connect the dots for the context and the texture upload meta.

Another stage would be the use of caps features.

__gb__ what do you thing about this approach?
Comment 4 Sebastian Dröge (slomo) 2013-05-17 18:11:38 UTC
And yet another stage would be to implement a vaapi specific GstAllocator/GstMemory, and deferring the jobs of the vaapi GstMeta to those for conceptional cleanness and flexibility :)
Comment 5 sreerenj 2013-05-18 05:22:44 UTC
(In reply to comment #3)
> Created an attachment (id=244557) [details] [review]
> intial port to gstreamer 1.2 api
> 
> I'm starting to work on this. The current patch only enables the compilation of
> gstreamer-vaapi with gstreamer HEAD. 
> 
> The next step is connect the dots for the context and the texture upload meta.
> 
> Another stage would be the use of caps features.

I have implemented the capsfeature for testing this: http://cgit.freedesktop.org/gstreamer/gst-plugins-base/commit/?id=a8d1b4549184f4aec88132b3650fa2b8fe1ca970 

I will provide the proper patch once I back from vacation :)

> 
> __gb__ what do you thing about this approach?
Comment 6 Víctor Manuel Jáquez Leal 2013-05-21 10:58:47 UTC
Created attachment 244905 [details] [review]
Initial port to GStreamer 1.2
Comment 7 Víctor Manuel Jáquez Leal 2013-05-21 11:00:54 UTC
This new patch is still a WIP. It makes a simple playbin, with X11 display, works.
Comment 8 Gwenole Beauchesne 2013-05-22 16:35:48 UTC
Hi Victor,

(In reply to comment #3)
> Created an attachment (id=244557) [details] [review]
> intial port to gstreamer 1.2 api
> 
> I'm starting to work on this. The current patch only enables the compilation of
> gstreamer-vaapi with gstreamer HEAD. 
> 
> The next step is connect the dots for the context and the texture upload meta.
> 
> Another stage would be the use of caps features.
> 
> __gb__ what do you thing about this approach?

That looks like a good plan.
Comment 9 Gwenole Beauchesne 2013-05-22 16:38:56 UTC
(In reply to comment #6)
> Created an attachment (id=244905) [details] [review]
> Initial port to GStreamer 1.2

Does !USE_BASEVIDEO with GStreamer 1.0.x have any meaningful use? If not, why don't we just check against Gst 1.2.x? Or do we plan to backport some of those new APIs to 1.0.x at least in non-upstream spaces?

i.e. we probably need to just check for gst >= 1.2, then >= 1.0, then the fallback is 0.10.
Comment 10 Víctor Manuel Jáquez Leal 2013-05-22 18:50:08 UTC
Hi Gwenole,

(In reply to comment #9)
> (In reply to comment #6)
> > Created an attachment (id=244905) [details] [review] [details] [review]
> > Initial port to GStreamer 1.2
> 
> Does !USE_BASEVIDEO with GStreamer 1.0.x have any meaningful use? If not, why
> don't we just check against Gst 1.2.x? Or do we plan to backport some of those
> new APIs to 1.0.x at least in non-upstream spaces?
> 
> i.e. we probably need to just check for gst >= 1.2, then >= 1.0, then the
> fallback is 0.10.

Yes! I'm working in a new patch that use GST_CHECK_VERSION(1,1,0) instead of USE_BASEVIDEO

Also I'm exploring a new approach: as gstcompat.h, I'm trying to see if is possible a gstvaapivideocontext adapting the current GstContext to the old GstVideoContext.
Comment 11 Gwenole Beauchesne 2013-05-23 09:40:36 UTC
(In reply to comment #10)
> Hi Gwenole,
> 
> (In reply to comment #9)
> > (In reply to comment #6)
> > > Created an attachment (id=244905) [details] [review] [details] [review] [details] [review]
> > > Initial port to GStreamer 1.2
> > 
> > Does !USE_BASEVIDEO with GStreamer 1.0.x have any meaningful use? If not, why
> > don't we just check against Gst 1.2.x? Or do we plan to backport some of those
> > new APIs to 1.0.x at least in non-upstream spaces?
> > 
> > i.e. we probably need to just check for gst >= 1.2, then >= 1.0, then the
> > fallback is 0.10.
> 
> Yes! I'm working in a new patch that use GST_CHECK_VERSION(1,1,0) instead of
> USE_BASEVIDEO
> 
> Also I'm exploring a new approach: as gstcompat.h, I'm trying to see if is
> possible a gstvaapivideocontext adapting the current GstContext to the old
> GstVideoContext.

Don't spend too much time on it if you can't get this to work simply. The gstcompat or glibcompat thing can only work well because the replacement functions are rather small. Though, if you can get this to work, that's fine too. :)

The idea is indeed to use as many new APIs as possible by default to ease transition and integration, with reasonable fallbacks to older APIs. e.g. no serious performance regression. That's because most of the "real" customers out there will stick to 0.10 or 1.0 for now.

They would only upgrade if there is a compelling reason for this. e.g. for 0.10 to 1.0 transition, my metrics show that overall the 1.0 based gstreamer-vaapi is ~10% faster than 0.10 based. As in, a full video playback will tend to use 10% less instructions overall to perform the same workload than before. That's an interesting gain.
Comment 12 Víctor Manuel Jáquez Leal 2013-05-23 19:25:57 UTC
Created attachment 245176 [details] [review]
initial port to GStreamer 1.2

This new patch uses GST_CHECK_VERSION macro, and depends on 
--with-gstreamer-api=1.2 configuration flag

TODO: 

+ fix the context sharing
+ support GstVideoGLTextureUploadMeta
+ add caps features
+ use a x-raw caps relying on GstMemory ???
Comment 13 Víctor Manuel Jáquez Leal 2013-06-04 11:06:43 UTC
Created attachment 245982 [details] [review]
initial port to GStreamer 1.2
Comment 14 Víctor Manuel Jáquez Leal 2013-06-04 11:06:52 UTC
Created attachment 245983 [details] [review]
pluginutil: add gst_vaapi_create_display()
Comment 15 Víctor Manuel Jáquez Leal 2013-06-04 11:06:57 UTC
Created attachment 245984 [details] [review]
pluginutil: add locks

This seems to be healthy.
Comment 16 Víctor Manuel Jáquez Leal 2013-06-04 11:07:02 UTC
Created attachment 245985 [details] [review]
display: add gstcontext utilities

declared an use a boxed type for display
Comment 17 Víctor Manuel Jáquez Leal 2013-06-04 11:07:07 UTC
Created attachment 245986 [details] [review]
libs: add gstvaapivideocontext

This is thin compat layer for the deprecated GstVideoContext.
Comment 18 Víctor Manuel Jáquez Leal 2013-06-04 11:07:13 UTC
Created attachment 245987 [details] [review]
postproc: set context
Comment 19 Víctor Manuel Jáquez Leal 2013-06-04 11:07:18 UTC
Created attachment 245988 [details] [review]
decode: set context
Comment 20 Víctor Manuel Jáquez Leal 2013-06-04 11:07:22 UTC
Created attachment 245989 [details] [review]
decode: query context
Comment 21 Víctor Manuel Jáquez Leal 2013-06-04 11:07:28 UTC
Created attachment 245990 [details] [review]
sink: set context
Comment 22 Víctor Manuel Jáquez Leal 2013-06-04 11:07:32 UTC
Created attachment 245991 [details] [review]
sink: handle events
Comment 23 Víctor Manuel Jáquez Leal 2013-06-04 11:07:40 UTC
Created attachment 245992 [details] [review]
sink: handle context query
Comment 24 Víctor Manuel Jáquez Leal 2013-06-06 14:33:46 UTC
Created attachment 246164 [details] [review]
pluginsutil: GLX first
Comment 25 Víctor Manuel Jáquez Leal 2013-06-06 14:35:17 UTC
Created attachment 246165 [details] [review]
videobuffer: add GstVideoGLTextureUploadMeta
Comment 26 sreerenj 2013-06-07 09:52:23 UTC
https://bugzilla.gnome.org/show_bug.cgi?id=687182 is also a dependency.
Comment 27 Víctor Manuel Jáquez Leal 2013-06-12 13:26:47 UTC
Created attachment 246629 [details] [review]
initial port to GStreamer 1.2
Comment 28 Víctor Manuel Jáquez Leal 2013-06-12 13:27:53 UTC
Created attachment 246630 [details] [review]
pluginutil: add gst_vaapi_create_display()
Comment 29 Víctor Manuel Jáquez Leal 2013-06-12 13:28:02 UTC
Created attachment 246631 [details] [review]
pluginutil: add locks

This seems to be healthy.
Comment 30 Víctor Manuel Jáquez Leal 2013-06-12 13:28:09 UTC
Created attachment 246632 [details] [review]
display: add gstcontext utilities

declared an use a boxed type for display
Comment 31 Víctor Manuel Jáquez Leal 2013-06-12 13:28:14 UTC
Created attachment 246633 [details] [review]
libs: add gstvaapivideocontext

This is thin compat layer for the deprecated GstVideoContext.
Comment 32 Víctor Manuel Jáquez Leal 2013-06-12 13:28:19 UTC
Created attachment 246634 [details] [review]
postproc: set context
Comment 33 Víctor Manuel Jáquez Leal 2013-06-12 13:28:24 UTC
Created attachment 246635 [details] [review]
decode: set context
Comment 34 Víctor Manuel Jáquez Leal 2013-06-12 13:28:29 UTC
Created attachment 246636 [details] [review]
decode: query context
Comment 35 Víctor Manuel Jáquez Leal 2013-06-12 13:28:36 UTC
Created attachment 246637 [details] [review]
sink: set context
Comment 36 Víctor Manuel Jáquez Leal 2013-06-12 13:28:41 UTC
Created attachment 246638 [details] [review]
sink: handle events
Comment 37 Víctor Manuel Jáquez Leal 2013-06-12 13:28:46 UTC
Created attachment 246639 [details] [review]
sink: handle context query
Comment 38 Víctor Manuel Jáquez Leal 2013-06-12 13:28:51 UTC
Created attachment 246640 [details] [review]
videobuffer: add GstVideoGLTextureUploadMeta
Comment 39 sreerenj 2013-06-13 14:21:55 UTC
Created attachment 246725 [details] [review]
Add capsfeature support

This patch is adding capsfeature support. But for now I have added  GST_VIDEO_FORMATS_ALL for the raw video format support.
Comment 40 sreerenj 2013-06-13 14:27:27 UTC
Hm, it seems that the code is already messing up with lots of VERSION_CHECK macros !!
Comment 41 sreerenj 2013-06-14 13:00:47 UTC
Hi Ceyusa,
Can you please add the similar stuffs to vaapipostproc also ??
Comment 42 sreerenj 2013-06-14 13:08:11 UTC
Aha, just noticed that you have a patch to vaapipostproc also. Is that working fine for you?
Comment 43 Víctor Manuel Jáquez Leal 2013-06-14 13:19:06 UTC
(In reply to comment #42)
> Aha, just noticed that you have a patch to vaapipostproc also. Is that working
> fine for you?

Sorry, I haven't tried postproc at all :/
Comment 44 Víctor Manuel Jáquez Leal 2013-06-14 13:20:50 UTC
Review of attachment 246725 [details] [review]:

The problem with this patch is that no format negotiation is done, NV12 is hard-coded.
Comment 45 sreerenj 2013-06-14 13:25:46 UTC
(In reply to comment #44)
> Review of attachment 246725 [details] [review]:
> 
> The problem with this patch is that no format negotiation is done, NV12 is
> hard-coded.

I didn't do anything to handle the format nego with this patch. Just kept the master branch as it is. 
Yes, we need better ways to handle negotiations.
We will get the exact format only after the decoding of first buffer.:
Reference: https://bugzilla.gnome.org/show_bug.cgi?id=687183
Comment 46 sreerenj 2013-06-14 13:27:05 UTC
(In reply to comment #43)
> (In reply to comment #42)
> > Aha, just noticed that you have a patch to vaapipostproc also. Is that working
> > fine for you?
> 
> Sorry, I haven't tried postproc at all :/

It is not working ;) Failing somewhere in context query handling. Didn't debug it but you can reproduce it with any file i guess..
Comment 47 Víctor Manuel Jáquez Leal 2013-06-25 11:18:13 UTC
This bug is big and complex, so I will split it, and handle this bug as a meta bug.
Comment 48 Gwenole Beauchesne 2013-12-19 12:14:47 UTC
Closing this bug since this concerned the initial GStreamer 1.2 support work, and all dependencies are now closed. :)