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 597690 - Improve caps setters API
Improve caps setters API
Status: RESOLVED FIXED
Product: GStreamer
Classification: Platform
Component: gstreamer (core)
0.10.26
Other All
: Normal normal
: 0.10.26
Assigned To: GStreamer Maintainers
GStreamer Maintainers
Depends on:
Blocks:
 
 
Reported: 2009-10-07 13:39 UTC by Benjamin Otte (Company)
Modified: 2009-10-15 18:01 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
Improve caps setters API (6.58 KB, patch)
2009-10-07 13:40 UTC, Benjamin Otte (Company)
none Details | Review

Description Benjamin Otte (Company) 2009-10-07 13:39:49 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.
Comment 1 Benjamin Otte (Company) 2009-10-07 13:40:07 UTC
Created attachment 144961 [details] [review]
Improve caps setters API
Comment 2 Benjamin Otte (Company) 2009-10-07 13:41:45 UTC
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.
Comment 3 Sebastian Dröge (slomo) 2009-10-07 15:56:30 UTC
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.
Comment 4 Benjamin Otte (Company) 2009-10-15 18:01:09 UTC
pushed to master.