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 756686 - fix caps negotiation for meta:GstVideoGLTextureUploadMeta
fix caps negotiation for meta:GstVideoGLTextureUploadMeta
Status: RESOLVED FIXED
Product: gstreamer-vaapi
Classification: Other
Component: general
git master
Other Linux
: Normal normal
: ---
Assigned To: gstreamer-vaapi maintainer(s)
gstreamer-vaapi maintainer(s)
Depends on:
Blocks: 750547
 
 
Reported: 2015-10-16 10:29 UTC by Víctor Manuel Jáquez Leal
Modified: 2015-10-20 10:42 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
vaapidecode: set format before decide allocation (1.40 KB, patch)
2015-10-16 10:34 UTC, Víctor Manuel Jáquez Leal
none Details | Review
vaapidecode: use caps to check the features (3.82 KB, patch)
2015-10-16 10:34 UTC, Víctor Manuel Jáquez Leal
none Details | Review
vaapidecode: decide allocation doesn't update srccaps (1.70 KB, patch)
2015-10-16 10:34 UTC, Víctor Manuel Jáquez Leal
none Details | Review
vaapidecode: set format before decide allocation (1.40 KB, patch)
2015-10-16 16:24 UTC, Víctor Manuel Jáquez Leal
none Details | Review
vaapidecode: use caps to check the features (3.74 KB, patch)
2015-10-16 16:24 UTC, Víctor Manuel Jáquez Leal
none Details | Review
vaapidecode: decide allocation doesn't update srccaps (1.70 KB, patch)
2015-10-16 16:24 UTC, Víctor Manuel Jáquez Leal
none Details | Review
vaapidecode: unguard memory:VASurface capsfeature (1.29 KB, patch)
2015-10-16 16:24 UTC, Víctor Manuel Jáquez Leal
none Details | Review
vaapidecode: set format before decide allocation (1.40 KB, patch)
2015-10-16 16:29 UTC, Víctor Manuel Jáquez Leal
committed Details | Review
vaapidecode: use caps to check the features (3.75 KB, patch)
2015-10-16 16:29 UTC, Víctor Manuel Jáquez Leal
none Details | Review
vaapidecode: decide allocation doesn't update srccaps (1.70 KB, patch)
2015-10-16 16:29 UTC, Víctor Manuel Jáquez Leal
committed Details | Review
vaapidecode: unguard memory:VASurface capsfeature (1.29 KB, patch)
2015-10-16 16:30 UTC, Víctor Manuel Jáquez Leal
accepted-commit_now Details | Review
vaapidecode: use caps to check the features (5.01 KB, patch)
2015-10-19 15:51 UTC, Víctor Manuel Jáquez Leal
committed Details | Review
vaapidecode: relax guards for memory:VASurface capsfeature (1.42 KB, patch)
2015-10-20 10:21 UTC, Víctor Manuel Jáquez Leal
committed Details | Review

Description Víctor Manuel Jáquez Leal 2015-10-16 10:29:39 UTC
From bug 754680

> Jan Schmidt [developer] 2015-10-01 11:07:08 UTC
> 
> I'm not sure if GstVideoGLTextureUploadMeta is not just more generally broken.
> I can't get GstVideoGLTextureUploadMeta even with glx using git master.
>
> filesrc location=test-h264.mov ! qtdemux ! vaapidecode ! 'video/x-raw(meta:GstVideoGLTextureUploadMeta)' ! glimagesink
>
> yields not-negotiated.
>
> It seems that gst_vaapidecode_update_src_caps() relies on 
> decode->has_texture_upload_meta == TRUE, which is only set 
> gst_vaapidecode_decide_allocation. gst_vaapidecode_decide_allocation() doesn't 
> happen until after the decoder has already tried to set the wrong caps and 
> gotten not-negotiated.
>
> I am sure this worked last time I tried, so it's a regression since sometime in 
> July.
>
> Dolevo 2015-10-07 11:40:51 UTC
>
> I have also tried above pipeline that Jan provided and it doesn't work. format 
> is selected as I420 in glimagesinkbin and it goes over CPU memory. Can anybody 
> check that?
Comment 1 Víctor Manuel Jáquez Leal 2015-10-16 10:34:16 UTC
Created attachment 313449 [details] [review]
vaapidecode: set format before decide allocation

There is a regression from commit 3d8e5e. It was expected the buffer pool
allocation occur before the caps negotiation, but it is not.

This patch fixes this regression: the caps negotiation is done regardless the
allocation query from downstream.

Signed-off-by: Víctor Manuel Jáquez Leal <victorx.jaquez@intel.com>
Comment 2 Víctor Manuel Jáquez Leal 2015-10-16 10:34:21 UTC
Created attachment 313450 [details] [review]
vaapidecode: use caps to check the features

Instead of calling gst_vaapi_find_preferred_caps_feature(), which is
expensive, we check the caps from the allocation query, to check the
negotiated feature.

In order to do this verification a new utility function has been implemented:
gst_vaapi_caps_has_feature()

Signed-off-by: Víctor Manuel Jáquez Leal <victorx.jaquez@intel.com>
Comment 3 Víctor Manuel Jáquez Leal 2015-10-16 10:34:26 UTC
Created attachment 313451 [details] [review]
vaapidecode: decide allocation doesn't update srccaps

The received caps query will bring the already negotiated caps, so they are
not expected to change.

This patch removes this verification which is dead code path.

Signed-off-by: Víctor Manuel Jáquez Leal <victorx.jaquez@intel.com>
Comment 4 Víctor Manuel Jáquez Leal 2015-10-16 16:24:27 UTC
Created attachment 313480 [details] [review]
vaapidecode: set format before decide allocation

There is a regression from commit 3d8e5e. It was expected the buffer pool
allocation occur before the caps negotiation, but it is not.

This patch fixes this regression: the caps negotiation is done regardless the
allocation query from downstream.

Signed-off-by: Víctor Manuel Jáquez Leal <victorx.jaquez@intel.com>
Comment 5 Víctor Manuel Jáquez Leal 2015-10-16 16:24:32 UTC
Created attachment 313481 [details] [review]
vaapidecode: use caps to check the features

Instead of calling gst_vaapi_find_preferred_caps_feature(), which is
expensive, we check the caps from the allocation query, to check the
negotiated feature.

In order to do this verification a new utility function has been implemented:
gst_vaapi_caps_has_feature()

Signed-off-by: Víctor Manuel Jáquez Leal <victorx.jaquez@intel.com>
Comment 6 Víctor Manuel Jáquez Leal 2015-10-16 16:24:38 UTC
Created attachment 313482 [details] [review]
vaapidecode: decide allocation doesn't update srccaps

The received caps query will bring the already negotiated caps, so they are
not expected to change.

This patch removes this verification which is dead code path.

Signed-off-by: Víctor Manuel Jáquez Leal <victorx.jaquez@intel.com>
Comment 7 Víctor Manuel Jáquez Leal 2015-10-16 16:24:43 UTC
Created attachment 313483 [details] [review]
vaapidecode: unguard memory:VASurface capsfeature

Caps features are supported since GStreamer 1.2, and gstreamer-vaapi supports
GStreamer since that version. So, first the guards where wrong and nowadays
there is no need to guard it.

Signed-off-by: Víctor Manuel Jáquez Leal <victorx.jaquez@intel.com>
Comment 8 Víctor Manuel Jáquez Leal 2015-10-16 16:29:46 UTC
Created attachment 313484 [details] [review]
vaapidecode: set format before decide allocation

There is a regression from commit 3d8e5e. It was expected the buffer pool
allocation occur before the caps negotiation, but it is not.

This patch fixes this regression: the caps negotiation is done regardless the
allocation query from downstream.

Signed-off-by: Víctor Manuel Jáquez Leal <victorx.jaquez@intel.com>
Comment 9 Víctor Manuel Jáquez Leal 2015-10-16 16:29:51 UTC
Created attachment 313485 [details] [review]
vaapidecode: use caps to check the features

Instead of calling gst_vaapi_find_preferred_caps_feature(), which is
expensive, we check the caps from the allocation query, to check the
negotiated feature.

In order to do this verification a new utility function has been implemented:
gst_vaapi_caps_feature_contains()

Signed-off-by: Víctor Manuel Jáquez Leal <victorx.jaquez@intel.com>
Comment 10 Víctor Manuel Jáquez Leal 2015-10-16 16:29:57 UTC
Created attachment 313486 [details] [review]
vaapidecode: decide allocation doesn't update srccaps

The received caps query will bring the already negotiated caps, so they are
not expected to change.

This patch removes this verification which is dead code path.

Signed-off-by: Víctor Manuel Jáquez Leal <victorx.jaquez@intel.com>
Comment 11 Víctor Manuel Jáquez Leal 2015-10-16 16:30:02 UTC
Created attachment 313487 [details] [review]
vaapidecode: unguard memory:VASurface capsfeature

Caps features are supported since GStreamer 1.2, and gstreamer-vaapi supports
GStreamer since that version. So, first the guards where wrong and nowadays
there is no need to guard it.

Signed-off-by: Víctor Manuel Jáquez Leal <victorx.jaquez@intel.com>
Comment 12 sreerenj 2015-10-18 19:56:22 UTC
Review of attachment 313484 [details] [review]:

lgtm
Comment 13 sreerenj 2015-10-18 20:06:19 UTC
Review of attachment 313485 [details] [review]:

lgtm, But honestly I am not 100% sure whether the current implementation has been done like this to fix some corner cases...
Anyway as log as you can test with glimagesink/cluttersink without any issue, I am fine with this patch :)

BTW, IMHO, We should add a comment in source file itself for each corner case that we fix (not just in commit message).Otherwise we will forget
about this later,,This reminds me to add some comment block for 1a3e884...
Comment 14 sreerenj 2015-10-18 20:12:13 UTC
Review of attachment 313486 [details] [review]:

lgtm
Comment 15 sreerenj 2015-10-18 20:14:04 UTC
Review of attachment 313487 [details] [review]:

lgtm
Comment 16 sreerenj 2015-10-18 20:16:16 UTC
(In reply to sreerenj from comment #13)
> Review of attachment 313485 [details] [review] [review]:
> 
> lgtm, But honestly I am not 100% sure whether the current implementation has
> been done like this to fix some corner cases...
> Anyway as log as you can test with glimagesink/cluttersink without any
> issue, I am fine with this patch :)
> 
> BTW, IMHO, We should add a comment in source file itself for each corner
> case that we fix (not just in commit message).

I mean, for each corner cases that fix  in future :)

>Otherwise we will forget
> about this later,,This reminds me to add some comment block for 1a3e884...
Comment 17 Víctor Manuel Jáquez Leal 2015-10-19 15:51:42 UTC
Created attachment 313670 [details] [review]
vaapidecode: use caps to check the features

Instead of calling gst_vaapi_find_preferred_caps_feature(), which is
expensive, we check the caps from the allocation query, to check the
negotiated feature.

In order to do this verification a new utility function has been implemented:
gst_vaapi_caps_feature_contains().

As this new function shared its logic with gst_caps_has_vaapi_surface(), both
have been refactorized.

Signed-off-by: Víctor Manuel Jáquez Leal <victorx.jaquez@intel.com>
Comment 18 Víctor Manuel Jáquez Leal 2015-10-20 10:21:33 UTC
Created attachment 313730 [details] [review]
vaapidecode: relax guards for memory:VASurface capsfeature

Though caps features are supported since GStreamer 1.2, there are some
issues with the features caps negotiation in that version. Nonetheless,
those issues are fixed in GStreamer 1.4. So, the memoy:VASurface caps
feature negotiation is relaxed for GStreamer 1.4.

The guard is the same as in vaapisink's caps template.

Signed-off-by: Víctor Manuel Jáquez Leal <victorx.jaquez@intel.com>
Comment 19 Víctor Manuel Jáquez Leal 2015-10-20 10:36:50 UTC
After some testing, now the patches look correct to me. I'll push them now.
Comment 20 Víctor Manuel Jáquez Leal 2015-10-20 10:40:11 UTC
Attachment 313484 [details] pushed as 45487fe - vaapidecode: set format before decide allocation
Attachment 313486 [details] pushed as 361f55b - vaapidecode: decide allocation doesn't update srccaps
Attachment 313670 [details] pushed as 6d9f31e - vaapidecode: use caps to check the features
Attachment 313730 [details] pushed as b76f482 - vaapidecode: relax guards for memory:VASurface capsfeature