diff options
author | Benjamin Otte <otte@gnome.org> | 2009-10-07 15:32:18 +0200 |
---|---|---|
committer | Benjamin Otte <otte@gnome.org> | 2009-10-15 19:10:50 +0200 |
commit | 0ff4086507671e5306a772ba5255c004de63626a (patch) | |
tree | 98a48b82c588a60eeb5567384e9a1def3d963e9d /gst/gstcaps.h | |
parent | 1190018f04ced9fc21b3c0addb8a4a21a2a7f7ca (diff) | |
download | gstreamer-0ff4086507671e5306a772ba5255c004de63626a.tar.gz |
Improve caps setters API
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.
https://bugzilla.gnome.org/show_bug.cgi?id=597690
Diffstat (limited to 'gst/gstcaps.h')
-rw-r--r-- | gst/gstcaps.h | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/gst/gstcaps.h b/gst/gstcaps.h index e535881ed9..e0a2aae0f6 100644 --- a/gst/gstcaps.h +++ b/gst/gstcaps.h @@ -207,6 +207,9 @@ GstStructure * gst_caps_get_structure (const GstCaps *caps, guint index); GstCaps * gst_caps_copy_nth (const GstCaps *caps, guint nth); void gst_caps_truncate (GstCaps *caps); +void gst_caps_set_value (GstCaps *caps, + const char *field, + const GValue *value); void gst_caps_set_simple (GstCaps *caps, const char *field, ...) G_GNUC_NULL_TERMINATED; void gst_caps_set_simple_valist (GstCaps *caps, |