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 793624 - debugutilsbad: Add fakevideosink a fakesink that can do zero-copy
debugutilsbad: Add fakevideosink a fakesink that can do zero-copy
Status: RESOLVED FIXED
Product: GStreamer
Classification: Platform
Component: gst-plugins-bad
unspecified
Other Linux
: Normal enhancement
: 1.13.90
Assigned To: GStreamer Maintainers
GStreamer Maintainers
Depends on:
Blocks:
 
 
Reported: 2018-02-20 03:13 UTC by Nicolas Dufresne (ndufresne)
Modified: 2018-02-21 17:28 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
meson: Remove unused header list (836 bytes, patch)
2018-02-20 21:44 UTC, Nicolas Dufresne (ndufresne)
committed Details | Review
Add fakevideosink element (12.62 KB, patch)
2018-02-20 21:44 UTC, Nicolas Dufresne (ndufresne)
none Details | Review
Add fakevideosink element (13.34 KB, patch)
2018-02-20 21:48 UTC, Nicolas Dufresne (ndufresne)
committed Details | Review
doc: Add section for fakevideosink (2.73 KB, patch)
2018-02-21 17:27 UTC, Nicolas Dufresne (ndufresne)
committed Details | Review

Description Nicolas Dufresne (ndufresne) 2018-02-20 03:13:41 UTC
I just started working on a shim that wraps fakesink but adversize couple of meta API in the allocation query. The list of meta api can be extended as needed. As I didn't want to clone fakesink, I've added some code that replicates the child properties on the GstBin, a bit tricky, but seems to work nicely. I'll finish this work tomorrow hopefully but am sharing a link to gather comment:

https://gitlab.collabora.com/nicolas/gst-plugins-bad/commit/d2fabd6c93fea902229fc9f4161abeca043229c4

TODO:
 - Document the element, add examples
 - Make sure there is no leaks

Note, I haven't proxied the handoff signals, I'm not sure it's really worth it.
Comment 1 Tim-Philipp Müller 2018-02-20 09:06:49 UTC
Why not derive from BaseSink directly instead?

Is there anything worthwhile in fakesink if the handoff-signals are not proxied?
Comment 2 Nicolas Dufresne (ndufresne) 2018-02-20 13:38:42 UTC
num-buffers, last-sample, dump, state-error and whatever get added in the future.
Comment 3 Nicolas Dufresne (ndufresne) 2018-02-20 16:48:54 UTC
Also, the handoff could in theory be proxied if needed, I just don't think it is very important to have it in a first iteration. Though the semantic will be different, since buffers might not be mappable, and there might be a GstVideoMeta (different padding).

If this method is ok, I'd like to use the same trick to wrap filesink into videofilesink. That's for the mappable case where you want to store image with their original padding (for debugging purpose, also useful to generate tests samples to be used with rawvideoparse). Note that the property proxying trick is not applicable to the GL wrappers. You need the child soon in the process, otherwise the properties won't be visible through gst-inspect-1.0.
Comment 4 Nicolas Dufresne (ndufresne) 2018-02-20 21:44:53 UTC
Created attachment 368677 [details] [review]
meson: Remove unused header list
Comment 5 Nicolas Dufresne (ndufresne) 2018-02-20 21:44:58 UTC
Created attachment 368678 [details] [review]
Add fakevideosink element

This is a wrapper around fakesink that will advertise GstVideoMeta
and other meta API in order to achieve zero-copy whenever possible.
This new element is useful when doing performance testing with
video stream and don't want the sink capability to change the
upstream behaviour.
Comment 6 Nicolas Dufresne (ndufresne) 2018-02-20 21:48:51 UTC
Created attachment 368679 [details] [review]
Add fakevideosink element

This is a wrapper around fakesink that will advertise GstVideoMeta
and other meta API in order to achieve zero-copy whenever possible.
his new element is useful when doing performance testing with
video stream and don't want the sink capability to change the
upstream behaviour.
Comment 7 Tim-Philipp Müller 2018-02-21 11:30:37 UTC
I don't really like the bin/wrapper-around-fakesink thing, but that's details, so if you find this element useful, get it in I'd say.

Not sure I fully grok what you have in mind with the videofilesink you mentioned.
Comment 8 Nicolas Dufresne (ndufresne) 2018-02-21 16:16:10 UTC
(In reply to Tim-Philipp Müller from comment #7)
> I don't really like the bin/wrapper-around-fakesink thing, but that's
> details, so if you find this element useful, get it in I'd say.

Ok, well as part of -bad, I'm sure we can revisit this later. I wanted to keep fakesink, in fact I wanted to add this feature to fakesink but couldn't.

> 
> Not sure I fully grok what you have in mind with the videofilesink you
> mentioned.

Sorry, might have been a bit vague, there is a debugging need to record a raw image (or multiple images) with the padding chosen by the HW. Currently, decoders endup removing this padding by copying before pushing to filesink.
Comment 9 Nicolas Dufresne (ndufresne) 2018-02-21 17:27:44 UTC
Created attachment 368727 [details] [review]
doc: Add section for fakevideosink
Comment 10 Nicolas Dufresne (ndufresne) 2018-02-21 17:28:09 UTC
Attachment 368677 [details] pushed as ccb0837 - meson: Remove unused header list
Attachment 368679 [details] pushed as f0c676c - Add fakevideosink element
Attachment 368727 [details] pushed as a73e5eb - doc: Add section for fakevideosink