[gstreamer-bugs] [Bug 617314] pbutils: Add codec-specific utility functions

GStreamer (bugzilla.gnome.org) bugzilla at gnome.org
Fri May 7 04:36:26 PDT 2010


https://bugzilla.gnome.org/show_bug.cgi?id=617314
  GStreamer | gst-plugins-base | unspecified

Benjamin Otte (Company) <otte> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |otte at gnome.org

--- Comment #9 from Benjamin Otte (Company) <otte at gnome.org> 2010-05-07 11:36:25 UTC ---
I think in the long run, we want a support lib for every format that is handled
by more than one plugin, as that simplifies writing plugins a lot and helps in
getting stuff right the first time. A place where I think that's particularly
important is handling caps properly.

I don't have a lot of experience with codecs, so I have no good idea how to
handle it there, but I'll share some experience from my gst-plugins-cairo work.
(You can read the header files in
http://cgit.freedesktop.org/~company/gst-plugins-cairo/tree/gst-libs/gst/cairo
if you want to follow along)

The first thing I did is make sure the code pretty much never needs to modify
caps directly. Once you get a fixed caps that you want to handle, you run
format = gst_cairo_format_new (caps); on it. You then have a GstCairoFormat API
that provides exactly te utility functions you care about. Of course, getting
caps out of a format works with gst_cairo_format_to_caps() again.
For a codec, I'd do something like GstH264Format *gst_h264_format_new_from_data
(GstBuffer *codec_data) and GstBuffer *gst_h264_format_to_data (GstH264Format
*format) in addition to the caps functions.
Then elements can use the format struct to seamlessly transform between data
and caps and modify the format using getters and setters.

The current functions to me don't look like a very good public API. They seem
to be just a bunch of utility functions dumped into some file - I think this
can be done better with a bit of thought. You want to have caps code that's as
trivial as
http://cgit.freedesktop.org/~company/gst-plugins-cairo/tree/gst/cairo/gstcairocolorspace.c#n42
(and that code does more than ffmpegcolorspace).

-- 
Configure bugmail: https://bugzilla.gnome.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the QA contact for the bug.




More information about the Gstreamer-bugs mailing list