GNOME Bugzilla – Bug 597690
Improve caps setters API
Last modified: 2009-10-15 18:01:09 UTC
This patch adds gst_caps_set_value() and allows gst_caps_set_simple() to work on non-simple caps. See the API documentation for the functions about what they do. The intention of these changes is to ease working with caps in caps transform functions. An example for this would be ffmpegcolorspace, where the caps transform function could be changed to look roughly like this (pseudocode ahead): result = gst_caps_copy (template_caps); value = gst_structure_get_value (gst_caps_get_structure (caps, 0), "widh"); gst_caps_set_value (result, value); /* same for height, framerate and par */ return caps; which is much cleaner and easier to understand than the current code.
Created attachment 144961 [details] [review] Improve caps setters API
I should note that I kept the name gst_caps_set_simple() and didn't introduce a gst_caps_set() because I thought everybody knows that function even though the name is strictly wrong, because it does work on more than simple caps now.
Well, the _simple() suffix could also mean, that it's a function that simplifies setting things on the caps. :) The docs of _set_simple() are wrong, before 0.10.26 it failed when the caps were *not* simple. Other than that it looks good, but let's wait for a second oppinion.
pushed to master.