Quicktime demuxer ported to new interface

Original commit message from CVS:
Quicktime demuxer ported to new interface
This commit is contained in:
Ronald S. Bultje 2003-11-02 21:45:18 +00:00
parent 0c45af7343
commit fbdc88a45f

View file

@ -97,11 +97,8 @@ gst_qtdemux_details =
{ {
"QuickTime Demuxer", "QuickTime Demuxer",
"Codec/Demuxer", "Codec/Demuxer",
"LGPL",
"Demultiplex a QuickTime file into audio and video streams", "Demultiplex a QuickTime file into audio and video streams",
VERSION, "David Schleef <ds@schleef.org>"
"David Schleef <ds@schleef.org>",
"(C) 2003",
}; };
enum { enum {
@ -127,6 +124,7 @@ static GstPadTemplate *videosrctempl, *audiosrctempl;
static GstElementClass *parent_class = NULL; static GstElementClass *parent_class = NULL;
static void gst_qtdemux_class_init (GstQTDemuxClass *klass); static void gst_qtdemux_class_init (GstQTDemuxClass *klass);
static void gst_qtdemux_base_init (GstQTDemuxClass *klass);
static void gst_qtdemux_init (GstQTDemux *quicktime_demux); static void gst_qtdemux_init (GstQTDemux *quicktime_demux);
static GstElementStateReturn gst_qtdemux_change_state(GstElement *element); static GstElementStateReturn gst_qtdemux_change_state(GstElement *element);
static void gst_qtdemux_loop_header (GstElement *element); static void gst_qtdemux_loop_header (GstElement *element);
@ -146,7 +144,8 @@ static GType gst_qtdemux_get_type (void)
if (!qtdemux_type) { if (!qtdemux_type) {
static const GTypeInfo qtdemux_info = { static const GTypeInfo qtdemux_info = {
sizeof(GstQTDemuxClass), NULL, NULL, sizeof(GstQTDemuxClass),
(GBaseInitFunc)gst_qtdemux_base_init, NULL,
(GClassInitFunc)gst_qtdemux_class_init, (GClassInitFunc)gst_qtdemux_class_init,
NULL, NULL, sizeof(GstQTDemux), 0, NULL, NULL, sizeof(GstQTDemux), 0,
(GInstanceInitFunc)gst_qtdemux_init, (GInstanceInitFunc)gst_qtdemux_init,
@ -156,6 +155,17 @@ static GType gst_qtdemux_get_type (void)
return qtdemux_type; return qtdemux_type;
} }
static void gst_qtdemux_base_init (GstQTDemuxClass *klass)
{
GstElementClass *element_class = GST_ELEMENT_CLASS (klass);
gst_element_class_add_pad_template (element_class,
GST_PAD_TEMPLATE_GET (sink_templ));
gst_element_class_add_pad_template (element_class, videosrctempl);
gst_element_class_add_pad_template (element_class, audiosrctempl);
gst_element_class_set_details (element_class, &gst_qtdemux_details);
}
static void gst_qtdemux_class_init (GstQTDemuxClass *klass) static void gst_qtdemux_class_init (GstQTDemuxClass *klass)
{ {
GObjectClass *gobject_class; GObjectClass *gobject_class;
@ -178,9 +188,8 @@ gst_qtdemux_init (GstQTDemux *qtdemux)
} }
static gboolean static gboolean
plugin_init (GModule *module, GstPlugin *plugin) plugin_init (GstPlugin *plugin)
{ {
GstElementFactory *factory;
GstCaps *audiocaps = NULL, *videocaps = NULL, *temp; GstCaps *audiocaps = NULL, *videocaps = NULL, *temp;
const guint32 audio_fcc[] = { const guint32 audio_fcc[] = {
/* FILLME */ /* FILLME */
@ -194,11 +203,6 @@ plugin_init (GModule *module, GstPlugin *plugin)
if (!gst_library_load ("gstbytestream")) if (!gst_library_load ("gstbytestream"))
return FALSE; return FALSE;
factory = gst_element_factory_new ("qtdemux", GST_TYPE_QTDEMUX,
&gst_qtdemux_details);
g_return_val_if_fail(factory != NULL, FALSE);
gst_element_factory_set_rank (factory, GST_ELEMENT_RANK_PRIMARY);
for (i = 0; audio_fcc[i] != 0; i++) { for (i = 0; audio_fcc[i] != 0; i++) {
temp = qtdemux_audio_caps (NULL, audio_fcc[i]); temp = qtdemux_audio_caps (NULL, audio_fcc[i]);
audiocaps = gst_caps_append (audiocaps, temp); audiocaps = gst_caps_append (audiocaps, temp);
@ -217,21 +221,22 @@ plugin_init (GModule *module, GstPlugin *plugin)
GST_PAD_SOMETIMES, GST_PAD_SOMETIMES,
videocaps, NULL); videocaps, NULL);
gst_element_factory_add_pad_template (factory, GST_PAD_TEMPLATE_GET (sink_templ)); return gst_element_register (plugin, "qtdemux",
gst_element_factory_add_pad_template (factory, videosrctempl); GST_RANK_NONE, GST_TYPE_QTDEMUX);
gst_element_factory_add_pad_template (factory, audiosrctempl);
gst_plugin_add_feature (plugin, GST_PLUGIN_FEATURE (factory));
return TRUE;
} }
GstPluginDesc plugin_desc = { GST_PLUGIN_DEFINE (
GST_VERSION_MAJOR, GST_VERSION_MAJOR,
GST_VERSION_MINOR, GST_VERSION_MINOR,
"qtdemux", "qtdemux",
plugin_init "Quicktime stream demuxer",
}; plugin_init,
VERSION,
"LGPL",
GST_COPYRIGHT,
GST_PACKAGE,
GST_ORIGIN
)
static gboolean gst_qtdemux_handle_sink_event (GstQTDemux *qtdemux) static gboolean gst_qtdemux_handle_sink_event (GstQTDemux *qtdemux)
{ {