GNOME Bugzilla – Bug 793624
debugutilsbad: Add fakevideosink a fakesink that can do zero-copy
Last modified: 2018-02-21 17:28:38 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.
Why not derive from BaseSink directly instead? Is there anything worthwhile in fakesink if the handoff-signals are not proxied?
num-buffers, last-sample, dump, state-error and whatever get added in the future.
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.
Created attachment 368677 [details] [review] meson: Remove unused header list
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.
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.
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.
(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.
Created attachment 368727 [details] [review] doc: Add section for fakevideosink
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