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 774782 - set vaapi allocators in allocation queries
set vaapi allocators in allocation queries
Status: RESOLVED FIXED
Product: GStreamer
Classification: Platform
Component: gstreamer-vaapi
unspecified
Other All
: Normal normal
: 1.11.1
Assigned To: GStreamer Maintainers
GStreamer Maintainers
Depends on:
Blocks:
 
 
Reported: 2016-11-21 12:04 UTC by Víctor Manuel Jáquez Leal
Modified: 2016-11-24 12:03 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
vaapivideobufferpool: set correct buffer size (1.96 KB, patch)
2016-11-21 12:04 UTC, Víctor Manuel Jáquez Leal
none Details | Review
plugins: add allocator to allocation query (4.85 KB, patch)
2016-11-21 12:04 UTC, Víctor Manuel Jáquez Leal
none Details | Review
plugins: use early return without goto (1.17 KB, patch)
2016-11-21 12:05 UTC, Víctor Manuel Jáquez Leal
none Details | Review
vaapivideomemory: add missing documentation (2.01 KB, patch)
2016-11-21 12:05 UTC, Víctor Manuel Jáquez Leal
none Details | Review
plugins: update the src pad allocator video info (2.02 KB, patch)
2016-11-21 12:05 UTC, Víctor Manuel Jáquez Leal
none Details | Review
vaapivideobufferpool: set correct buffer size (1.91 KB, patch)
2016-11-21 16:22 UTC, Víctor Manuel Jáquez Leal
committed Details | Review
plugins: add allocator to allocation query (4.85 KB, patch)
2016-11-21 16:22 UTC, Víctor Manuel Jáquez Leal
committed Details | Review
plugins: use early return without goto (1.17 KB, patch)
2016-11-21 16:22 UTC, Víctor Manuel Jáquez Leal
committed Details | Review
vaapivideomemory: add missing documentation (2.01 KB, patch)
2016-11-21 16:23 UTC, Víctor Manuel Jáquez Leal
committed Details | Review
plugins: update the src pad allocator video info (2.02 KB, patch)
2016-11-21 16:23 UTC, Víctor Manuel Jáquez Leal
committed Details | Review
vaapivideomemory: remove GST_VAAPI_TYPE_VIDEO_INFO (2.51 KB, patch)
2016-11-21 16:23 UTC, Víctor Manuel Jáquez Leal
committed Details | Review

Description Víctor Manuel Jáquez Leal 2016-11-21 12:04:42 UTC
Set the vaapi allocator in the allocation queries decide_allocation() and 
propose_allocation()

In this way we avoid to set the allocators computed frame size in the elements,
since the vaapivideobufferpool takes care of that.

Side commits are related with documentation and update correctly the video info
which will be used by the GstVideo meta.
Comment 1 Víctor Manuel Jáquez Leal 2016-11-21 12:04:50 UTC
Created attachment 340411 [details] [review]
vaapivideobufferpool: set correct buffer size

We should set the correct buffer size when we are configuring the pool,
otherwise the buffer will be discarded when it returns to the pool.

Indeed when the ref-count of a buffer reaches zero, its pool will queue
it back (and ref it) if, and only if, the buffer size matches the
configured buffer size on the pool.

This issue can be debugged with GST_DEBUG=*PERF*:6, see gstbufferpool.c

https://bugzilla.gnome.org/show_bug.cgi?id=755072
Comment 2 Víctor Manuel Jáquez Leal 2016-11-21 12:04:57 UTC
Created attachment 340412 [details] [review]
plugins: add allocator to allocation query

This patch adds the created allocator to the allocation query either
in decide_allocation() and propose_allocation() vmehtods.

With it, there's no need to set the modified allocator's size in the
pool configuration.
Comment 3 Víctor Manuel Jáquez Leal 2016-11-21 12:05:10 UTC
Created attachment 340413 [details] [review]
plugins: use early return without goto
Comment 4 Víctor Manuel Jáquez Leal 2016-11-21 12:05:17 UTC
Created attachment 340414 [details] [review]
vaapivideomemory: add missing documentation
Comment 5 Víctor Manuel Jáquez Leal 2016-11-21 12:05:23 UTC
Created attachment 340415 [details] [review]
plugins: update the src pad allocator video info

Update the size, stride and offset of the source pad allocator video
info, so the pool could set the correct GstVideoMeta
Comment 6 Víctor Manuel Jáquez Leal 2016-11-21 16:22:39 UTC
Created attachment 340438 [details] [review]
vaapivideobufferpool: set correct buffer size

We should set the correct buffer size when we are configuring the pool,
otherwise the buffer will be discarded when it returns to the pool.

Indeed when the ref-count of a buffer reaches zero, its pool will queue
it back (and ref it) if, and only if, the buffer size matches the
configured buffer size on the pool.

This issue can be debugged with GST_DEBUG=*PERF*:6, see gstbufferpool.c
Comment 7 Víctor Manuel Jáquez Leal 2016-11-21 16:22:46 UTC
Created attachment 340439 [details] [review]
plugins: add allocator to allocation query

This patch adds the created allocator to the allocation query either
in decide_allocation() and propose_allocation() vmehtods.

With it, there's no need to set the modified allocator's size in the
pool configuration.
Comment 8 Víctor Manuel Jáquez Leal 2016-11-21 16:22:53 UTC
Created attachment 340440 [details] [review]
plugins: use early return without goto
Comment 9 Víctor Manuel Jáquez Leal 2016-11-21 16:23:01 UTC
Created attachment 340441 [details] [review]
vaapivideomemory: add missing documentation
Comment 10 Víctor Manuel Jáquez Leal 2016-11-21 16:23:08 UTC
Created attachment 340443 [details] [review]
plugins: update the src pad allocator video info

Update the size, stride and offset of the source pad allocator video
info, so the pool could set the correct GstVideoMeta
Comment 11 Víctor Manuel Jáquez Leal 2016-11-21 16:23:19 UTC
Created attachment 340444 [details] [review]
vaapivideomemory: remove GST_VAAPI_TYPE_VIDEO_INFO

Remove redundant GST_VAAPI_TYPE_VIDEO_INFO, since it is a duplicate of
GST_TYPE_VIDEO_INFO created before gstreamer 1.6, where the boxed type
was created.
Comment 12 Hyunjun Ko 2016-11-22 01:14:39 UTC
Wow, fast!
I Tested these patches and seems everything is Okay :)
Comment 13 Víctor Manuel Jáquez Leal 2016-11-24 11:45:12 UTC
Attachment 340439 [details] pushed as acefc7e - plugins: add allocator to allocation query
Attachment 340440 [details] pushed as ac18e04 - plugins: use early return without goto
Attachment 340441 [details] pushed as 432731e - vaapivideomemory: add missing documentation
Attachment 340443 [details] pushed as d799bb3 - plugins: update the src pad allocator video info
Attachment 340444 [details] pushed as 22463b9 - vaapivideomemory: remove GST_VAAPI_TYPE_VIDEO_INFO