GNOME Bugzilla – Bug 699352
[PATCH] shm: Allow caps to change in PLAYING state
Last modified: 2018-11-03 13:15:34 UTC
I'd like to extend shmsrc/shmsink to support changing of caps while in the PLAYING state, though I'm really only interested in width and height changing. A new ShmPipe command would be needed, such as COMMAND_NEW_CAPS, which would include a string set by gst_caps_to_string in shmsink. Upon shmsrc receiving this command, in 0.10 the new caps would just be set to the subsequent buffers, and in 1.0 a CAPS event would be sent. Certainly this breaks API compatibility somewhat, but this could be mitigated by adding an allow-reconfigure property to shmsink that defaults to FALSE. Is any of this reasonable?
The current design of shmsink/shmsrc is that it doesn't do caps at all, it's like fdsink/fdsrc. You may want to use gdppay if you want the full gst handling, although I guess that means you don't get zerocopy.
Created attachment 243219 [details] [review] patch for shm 0.10 to allow caps string to be sent to clients
I've attached a patch that does this for 0.10, but will port to 1.0 if it would be accepted upstream. This is applied on top of the patch [here](https://bugzilla.gnome.org/show_bug.cgi?id=698657), but does not depend on it. I know the current design is to have ShmPipe be completely independent of any GStreamer concepts, but I'm not sure what the value is in this. This patch, while perhaps crude, does allow the caps to be changed during the PLAYING state (convenient for me where an application can toggle between views of different width/height/format), and perhaps significant to more people is that a capsfilter is no longer needed with shmsrc.
if you are to send caps, you also want to send timestamps, segments, tags, whatnot.. And then you just re-invented gdp!
I personally have no interest in any of those other features, as the ability to change caps and do zerocopy is all that matters to me. I think the gap in complexity from what I'm proposing to what gdp does is pretty huge, especially when you talk about custom implementations of a shm writer. If this is out of scope, that's fine, or if you have a suggestion as to how I can get zerocopy and caps changing, I'll try it out.
-- GitLab Migration Automatic Message -- This bug has been migrated to freedesktop.org's GitLab instance and has been closed from further activity. You can subscribe and participate further through the new bug through this link to our GitLab instance: https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/issues/94.