[gstreamer-bugs] [Bug 491501] New: gst_element_class_set_details should be used in class_init instead of base_init
GStreamer (bugzilla.gnome.org)
bugzilla-daemon at bugzilla.gnome.org
Mon Oct 29 13:08:17 PDT 2007
If you have any questions why you received this email, please see the text at
the end of this email. Replies to this email are NOT read, please see the text
at the end of this email. You can add comments to this bug at:
http://bugzilla.gnome.org/show_bug.cgi?id=491501
GStreamer | gstreamer (core) | Ver: HEAD CVS
Summary: gst_element_class_set_details should be used in
class_init instead of base_init
Product: GStreamer
Version: HEAD CVS
Platform: Other
OS/Version: All
Status: UNCONFIRMED
Severity: normal
Priority: Normal
Component: gstreamer (core)
AssignedTo: gstreamer-bugs at lists.sourceforge.net
ReportedBy: zeng.shixin at gmail.com
QAContact: gstreamer-bugs at lists.sourceforge.net
GNOME version: Unspecified
GNOME milestone: Unspecified
Please describe the problem:
The document for gst_element_class_set_details says "This function is for use
in _base_init functions only." and it is indeed used in base_init functions.
However, because this function set a field "details" of type
"GstElementDetails" in GstElementClass which is not dynamically allocated, it
should be initialized in class_init function instead of base_init() function to
avoid redundant initialization.
At least it was spotted in following case:
GstPipeline is derived from GstBin which is derived from GstElement
In GstBin's base_init function:
static void
gst_bin_base_init (gpointer g_class)
{
GstElementClass *gstelement_class = GST_ELEMENT_CLASS (g_class);
gst_element_class_set_details (gstelement_class, &gst_bin_details);
}
in GstPipeline's base_init function:
gst_pipeline_base_init (gpointer g_class)
{
GstElementClass *gstelement_class = GST_ELEMENT_CLASS (g_class);
gst_element_class_set_details (gstelement_class, &gst_pipeline_details);
}
So, during registering the type GstPipeline,
gst_element_class_set_details will firstly be called via
gst_bin_base_init () and secondly via gst_pipeline_base_init().
Steps to reproduce:
Actual results:
Expected results:
Does this happen every time?
Other information:
--
See http://bugzilla.gnome.org/page.cgi?id=email.html for more info about why you received
this email, why you can't respond via email, how to stop receiving
emails (or reduce the number you receive), and how to contact someone
if you are having problems with the system.
You can add comments to this bug at http://bugzilla.gnome.org/show_bug.cgi?id=491501.
More information about the Gstreamer-bugs
mailing list