mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2024-11-09 19:09:41 +00:00
MPEG system streams work too, now
Original commit message from CVS: MPEG system streams work too, now
This commit is contained in:
parent
2869025b0a
commit
d71c0d2065
7 changed files with 84 additions and 73 deletions
|
@ -30,12 +30,9 @@ GST_DEBUG_CATEGORY_EXTERN (GST_CAT_SEEK);
|
||||||
static GstElementDetails mpeg_demux_details = {
|
static GstElementDetails mpeg_demux_details = {
|
||||||
"MPEG Demuxer",
|
"MPEG Demuxer",
|
||||||
"Codec/Demuxer",
|
"Codec/Demuxer",
|
||||||
"LGPL",
|
|
||||||
"Demultiplexes MPEG1 and MPEG2 System Streams",
|
"Demultiplexes MPEG1 and MPEG2 System Streams",
|
||||||
VERSION,
|
|
||||||
"Erik Walthinsen <omega@cse.ogi.edu>\n"
|
"Erik Walthinsen <omega@cse.ogi.edu>\n"
|
||||||
"Wim Taymans <wim.taymans@chello.be>",
|
"Wim Taymans <wim.taymans@chello.be>"
|
||||||
"(C) 1999",
|
|
||||||
};
|
};
|
||||||
|
|
||||||
/* MPEG2Demux signals and args */
|
/* MPEG2Demux signals and args */
|
||||||
|
@ -154,6 +151,7 @@ GST_PAD_TEMPLATE_FACTORY (subtitle_factory,
|
||||||
);
|
);
|
||||||
|
|
||||||
static void gst_mpeg_demux_class_init (GstMPEGDemuxClass *klass);
|
static void gst_mpeg_demux_class_init (GstMPEGDemuxClass *klass);
|
||||||
|
static void gst_mpeg_demux_base_init (GstMPEGDemuxClass *klass);
|
||||||
static void gst_mpeg_demux_init (GstMPEGDemux *mpeg_demux);
|
static void gst_mpeg_demux_init (GstMPEGDemux *mpeg_demux);
|
||||||
|
|
||||||
static gboolean gst_mpeg_demux_parse_packhead (GstMPEGParse *mpeg_parse, GstBuffer *buffer);
|
static gboolean gst_mpeg_demux_parse_packhead (GstMPEGParse *mpeg_parse, GstBuffer *buffer);
|
||||||
|
@ -187,7 +185,7 @@ mpeg_demux_get_type (void)
|
||||||
if (!mpeg_demux_type) {
|
if (!mpeg_demux_type) {
|
||||||
static const GTypeInfo mpeg_demux_info = {
|
static const GTypeInfo mpeg_demux_info = {
|
||||||
sizeof(GstMPEGDemuxClass),
|
sizeof(GstMPEGDemuxClass),
|
||||||
NULL,
|
(GBaseInitFunc)gst_mpeg_demux_base_init,
|
||||||
NULL,
|
NULL,
|
||||||
(GClassInitFunc)gst_mpeg_demux_class_init,
|
(GClassInitFunc)gst_mpeg_demux_class_init,
|
||||||
NULL,
|
NULL,
|
||||||
|
@ -201,6 +199,29 @@ mpeg_demux_get_type (void)
|
||||||
return mpeg_demux_type;
|
return mpeg_demux_type;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static void
|
||||||
|
gst_mpeg_demux_base_init (GstMPEGDemuxClass *klass)
|
||||||
|
{
|
||||||
|
GstElementClass *element_class = GST_ELEMENT_CLASS (klass);
|
||||||
|
|
||||||
|
gst_element_class_add_pad_template (element_class,
|
||||||
|
GST_PAD_TEMPLATE_GET (sink_factory));
|
||||||
|
gst_element_class_add_pad_template (element_class,
|
||||||
|
GST_PAD_TEMPLATE_GET (video_src_factory));
|
||||||
|
gst_element_class_add_pad_template (element_class,
|
||||||
|
GST_PAD_TEMPLATE_GET (private1_factory));
|
||||||
|
gst_element_class_add_pad_template (element_class,
|
||||||
|
GST_PAD_TEMPLATE_GET (private2_factory));
|
||||||
|
gst_element_class_add_pad_template (element_class,
|
||||||
|
GST_PAD_TEMPLATE_GET (pcm_factory));
|
||||||
|
gst_element_class_add_pad_template (element_class,
|
||||||
|
GST_PAD_TEMPLATE_GET (subtitle_factory));
|
||||||
|
gst_element_class_add_pad_template (element_class,
|
||||||
|
GST_PAD_TEMPLATE_GET (audio_factory));
|
||||||
|
gst_element_class_set_details (element_class, &mpeg_demux_details);
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
gst_mpeg_demux_class_init (GstMPEGDemuxClass *klass)
|
gst_mpeg_demux_class_init (GstMPEGDemuxClass *klass)
|
||||||
{
|
{
|
||||||
|
@ -1231,25 +1252,8 @@ gst_mpeg_demux_get_index (GstElement *element)
|
||||||
|
|
||||||
|
|
||||||
gboolean
|
gboolean
|
||||||
gst_mpeg_demux_plugin_init (GModule *module, GstPlugin *plugin)
|
gst_mpeg_demux_plugin_init (GstPlugin *plugin)
|
||||||
{
|
{
|
||||||
GstElementFactory *factory;
|
return gst_element_register (plugin, "mpegdemux",
|
||||||
|
GST_RANK_PRIMARY, GST_TYPE_MPEG_DEMUX);
|
||||||
/* create an elementfactory for the mpeg_demux element */
|
|
||||||
factory = gst_element_factory_new ("mpegdemux", GST_TYPE_MPEG_DEMUX,
|
|
||||||
&mpeg_demux_details);
|
|
||||||
g_return_val_if_fail (factory != NULL, FALSE);
|
|
||||||
gst_element_factory_set_rank (factory, GST_ELEMENT_RANK_PRIMARY);
|
|
||||||
|
|
||||||
gst_element_factory_add_pad_template (factory, GST_PAD_TEMPLATE_GET (sink_factory));
|
|
||||||
gst_element_factory_add_pad_template (factory, GST_PAD_TEMPLATE_GET (video_src_factory));
|
|
||||||
gst_element_factory_add_pad_template (factory, GST_PAD_TEMPLATE_GET (private1_factory));
|
|
||||||
gst_element_factory_add_pad_template (factory, GST_PAD_TEMPLATE_GET (private2_factory));
|
|
||||||
gst_element_factory_add_pad_template (factory, GST_PAD_TEMPLATE_GET (pcm_factory));
|
|
||||||
gst_element_factory_add_pad_template (factory, GST_PAD_TEMPLATE_GET (subtitle_factory));
|
|
||||||
gst_element_factory_add_pad_template (factory, GST_PAD_TEMPLATE_GET (audio_factory));
|
|
||||||
|
|
||||||
gst_plugin_add_feature (plugin, GST_PLUGIN_FEATURE (factory));
|
|
||||||
|
|
||||||
return TRUE;
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -103,7 +103,7 @@ struct _GstMPEGDemuxClass {
|
||||||
|
|
||||||
GType gst_mpeg_demux_get_type(void);
|
GType gst_mpeg_demux_get_type(void);
|
||||||
|
|
||||||
gboolean gst_mpeg_demux_plugin_init (GModule *module, GstPlugin *plugin);
|
gboolean gst_mpeg_demux_plugin_init (GstPlugin *plugin);
|
||||||
|
|
||||||
#ifdef __cplusplus
|
#ifdef __cplusplus
|
||||||
}
|
}
|
||||||
|
|
|
@ -33,12 +33,9 @@ GST_DEBUG_CATEGORY_EXTERN (GST_CAT_SEEK);
|
||||||
static GstElementDetails mpeg_parse_details = {
|
static GstElementDetails mpeg_parse_details = {
|
||||||
"MPEG System Parser",
|
"MPEG System Parser",
|
||||||
"Codec/Parser",
|
"Codec/Parser",
|
||||||
"LGPL",
|
|
||||||
"Parses MPEG1 and MPEG2 System Streams",
|
"Parses MPEG1 and MPEG2 System Streams",
|
||||||
VERSION,
|
|
||||||
"Erik Walthinsen <omega@cse.ogi.edu>\n"
|
"Erik Walthinsen <omega@cse.ogi.edu>\n"
|
||||||
"Wim Taymans <wim.taymans@chello.be>",
|
"Wim Taymans <wim.taymans@chello.be>"
|
||||||
"(C) 1999",
|
|
||||||
};
|
};
|
||||||
|
|
||||||
#define CLASS(o) GST_MPEG_PARSE_CLASS (G_OBJECT_GET_CLASS (o))
|
#define CLASS(o) GST_MPEG_PARSE_CLASS (G_OBJECT_GET_CLASS (o))
|
||||||
|
@ -84,6 +81,7 @@ GST_PAD_TEMPLATE_FACTORY (src_factory,
|
||||||
);
|
);
|
||||||
|
|
||||||
static void gst_mpeg_parse_class_init (GstMPEGParseClass *klass);
|
static void gst_mpeg_parse_class_init (GstMPEGParseClass *klass);
|
||||||
|
static void gst_mpeg_parse_base_init (GstMPEGParseClass *klass);
|
||||||
static void gst_mpeg_parse_init (GstMPEGParse *mpeg_parse);
|
static void gst_mpeg_parse_init (GstMPEGParse *mpeg_parse);
|
||||||
static GstElementStateReturn
|
static GstElementStateReturn
|
||||||
gst_mpeg_parse_change_state (GstElement *element);
|
gst_mpeg_parse_change_state (GstElement *element);
|
||||||
|
@ -117,7 +115,8 @@ gst_mpeg_parse_get_type (void)
|
||||||
|
|
||||||
if (!mpeg_parse_type) {
|
if (!mpeg_parse_type) {
|
||||||
static const GTypeInfo mpeg_parse_info = {
|
static const GTypeInfo mpeg_parse_info = {
|
||||||
sizeof(GstMPEGParseClass), NULL,
|
sizeof(GstMPEGParseClass),
|
||||||
|
(GBaseInitFunc)gst_mpeg_parse_base_init,
|
||||||
NULL,
|
NULL,
|
||||||
(GClassInitFunc)gst_mpeg_parse_class_init,
|
(GClassInitFunc)gst_mpeg_parse_class_init,
|
||||||
NULL,
|
NULL,
|
||||||
|
@ -131,6 +130,18 @@ gst_mpeg_parse_get_type (void)
|
||||||
return mpeg_parse_type;
|
return mpeg_parse_type;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static void
|
||||||
|
gst_mpeg_parse_base_init (GstMPEGParseClass *klass)
|
||||||
|
{
|
||||||
|
GstElementClass *element_class = GST_ELEMENT_CLASS (klass);
|
||||||
|
|
||||||
|
gst_element_class_add_pad_template (element_class,
|
||||||
|
GST_PAD_TEMPLATE_GET (src_factory));
|
||||||
|
gst_element_class_add_pad_template (element_class,
|
||||||
|
GST_PAD_TEMPLATE_GET (sink_factory));
|
||||||
|
gst_element_class_set_details (element_class, &mpeg_parse_details);
|
||||||
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
gst_mpeg_parse_class_init (GstMPEGParseClass *klass)
|
gst_mpeg_parse_class_init (GstMPEGParseClass *klass)
|
||||||
{
|
{
|
||||||
|
@ -911,21 +922,10 @@ gst_mpeg_parse_release_locks (GstElement *element)
|
||||||
}
|
}
|
||||||
|
|
||||||
gboolean
|
gboolean
|
||||||
gst_mpeg_parse_plugin_init (GModule *module, GstPlugin *plugin)
|
gst_mpeg_parse_plugin_init (GstPlugin *plugin)
|
||||||
{
|
{
|
||||||
GstElementFactory *factory;
|
|
||||||
|
|
||||||
/* create an elementfactory for the mpeg_parse element */
|
|
||||||
factory = gst_element_factory_new ("mpegparse", GST_TYPE_MPEG_PARSE,
|
|
||||||
&mpeg_parse_details);
|
|
||||||
g_return_val_if_fail(factory != NULL, FALSE);
|
|
||||||
|
|
||||||
scr_format = gst_format_register ("scr", "The MPEG system clock reference time");
|
scr_format = gst_format_register ("scr", "The MPEG system clock reference time");
|
||||||
|
|
||||||
gst_element_factory_add_pad_template (factory, GST_PAD_TEMPLATE_GET (src_factory));
|
return gst_element_register (plugin, "mpegparse",
|
||||||
gst_element_factory_add_pad_template (factory, GST_PAD_TEMPLATE_GET (sink_factory));
|
GST_RANK_NONE, GST_TYPE_MPEG_PARSE);
|
||||||
|
|
||||||
gst_plugin_add_feature (plugin, GST_PLUGIN_FEATURE (factory));
|
|
||||||
|
|
||||||
return TRUE;
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -98,7 +98,7 @@ struct _GstMPEGParseClass {
|
||||||
|
|
||||||
GType gst_mpeg_parse_get_type(void);
|
GType gst_mpeg_parse_get_type(void);
|
||||||
|
|
||||||
gboolean gst_mpeg_parse_plugin_init (GModule *module, GstPlugin *plugin);
|
gboolean gst_mpeg_parse_plugin_init (GstPlugin *plugin);
|
||||||
|
|
||||||
const GstFormat*
|
const GstFormat*
|
||||||
gst_mpeg_parse_get_src_formats (GstPad *pad);
|
gst_mpeg_parse_get_src_formats (GstPad *pad);
|
||||||
|
|
|
@ -23,7 +23,7 @@
|
||||||
#include "gstrfc2250enc.h"
|
#include "gstrfc2250enc.h"
|
||||||
|
|
||||||
static gboolean
|
static gboolean
|
||||||
plugin_init (GModule *module, GstPlugin *plugin)
|
plugin_init (GstPlugin *plugin)
|
||||||
{
|
{
|
||||||
/* short-circuit here; this is potentially dangerous since if the second
|
/* short-circuit here; this is potentially dangerous since if the second
|
||||||
* or third init fails then the whole plug-in will be placed on the register
|
* or third init fails then the whole plug-in will be placed on the register
|
||||||
|
@ -33,16 +33,23 @@ plugin_init (GModule *module, GstPlugin *plugin)
|
||||||
if (!gst_library_load ("gstbytestream"))
|
if (!gst_library_load ("gstbytestream"))
|
||||||
return FALSE;
|
return FALSE;
|
||||||
|
|
||||||
if (!gst_mpeg_parse_plugin_init (module, plugin)) return FALSE;
|
if (!gst_mpeg_parse_plugin_init (plugin) ||
|
||||||
if (!gst_mpeg_demux_plugin_init (module, plugin)) return FALSE;
|
!gst_mpeg_demux_plugin_init (plugin) ||
|
||||||
if (!gst_rfc2250_enc_plugin_init (module, plugin)) return FALSE;
|
!gst_rfc2250_enc_plugin_init (plugin))
|
||||||
|
return FALSE;
|
||||||
|
|
||||||
return TRUE;
|
return TRUE;
|
||||||
}
|
}
|
||||||
|
|
||||||
GstPluginDesc plugin_desc = {
|
GST_PLUGIN_DEFINE (
|
||||||
GST_VERSION_MAJOR,
|
GST_VERSION_MAJOR,
|
||||||
GST_VERSION_MINOR,
|
GST_VERSION_MINOR,
|
||||||
"mpegstream",
|
"mpegstream",
|
||||||
plugin_init
|
"MPEG system stream parser",
|
||||||
};
|
plugin_init,
|
||||||
|
VERSION,
|
||||||
|
"LGPL",
|
||||||
|
GST_COPYRIGHT,
|
||||||
|
GST_PACKAGE,
|
||||||
|
GST_ORIGIN
|
||||||
|
)
|
||||||
|
|
|
@ -28,11 +28,8 @@
|
||||||
static GstElementDetails rfc2250_enc_details = {
|
static GstElementDetails rfc2250_enc_details = {
|
||||||
"RFC 2250 packet encoder",
|
"RFC 2250 packet encoder",
|
||||||
"Codec/Parser",
|
"Codec/Parser",
|
||||||
"LGPL",
|
|
||||||
"transforms MPEG1/2 video to an RFC 2250 compliant format",
|
"transforms MPEG1/2 video to an RFC 2250 compliant format",
|
||||||
VERSION,
|
"Wim Taymans <wim.taymans@chello.be>"
|
||||||
"Wim Taymans <wim.taymans@chello.be>",
|
|
||||||
"(C) 2001",
|
|
||||||
};
|
};
|
||||||
|
|
||||||
#define CLASS(o) GST_RFC2250_ENC_CLASS (G_OBJECT_GET_CLASS (o))
|
#define CLASS(o) GST_RFC2250_ENC_CLASS (G_OBJECT_GET_CLASS (o))
|
||||||
|
@ -75,6 +72,7 @@ GST_PAD_TEMPLATE_FACTORY (src_factory,
|
||||||
);
|
);
|
||||||
|
|
||||||
static void gst_rfc2250_enc_class_init (GstRFC2250EncClass *klass);
|
static void gst_rfc2250_enc_class_init (GstRFC2250EncClass *klass);
|
||||||
|
static void gst_rfc2250_enc_base_init (GstRFC2250EncClass *klass);
|
||||||
static void gst_rfc2250_enc_init (GstRFC2250Enc *rfc2250_enc);
|
static void gst_rfc2250_enc_init (GstRFC2250Enc *rfc2250_enc);
|
||||||
static GstElementStateReturn
|
static GstElementStateReturn
|
||||||
gst_rfc2250_enc_change_state (GstElement *element);
|
gst_rfc2250_enc_change_state (GstElement *element);
|
||||||
|
@ -94,7 +92,8 @@ gst_rfc2250_enc_get_type (void)
|
||||||
|
|
||||||
if (!rfc2250_enc_type) {
|
if (!rfc2250_enc_type) {
|
||||||
static const GTypeInfo rfc2250_enc_info = {
|
static const GTypeInfo rfc2250_enc_info = {
|
||||||
sizeof(GstRFC2250EncClass), NULL,
|
sizeof(GstRFC2250EncClass),
|
||||||
|
(GBaseInitFunc)gst_rfc2250_enc_base_init,
|
||||||
NULL,
|
NULL,
|
||||||
(GClassInitFunc)gst_rfc2250_enc_class_init,
|
(GClassInitFunc)gst_rfc2250_enc_class_init,
|
||||||
NULL,
|
NULL,
|
||||||
|
@ -108,6 +107,18 @@ gst_rfc2250_enc_get_type (void)
|
||||||
return rfc2250_enc_type;
|
return rfc2250_enc_type;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static void
|
||||||
|
gst_rfc2250_enc_base_init (GstRFC2250EncClass *klass)
|
||||||
|
{
|
||||||
|
GstElementClass *element_class = GST_ELEMENT_CLASS (klass);
|
||||||
|
|
||||||
|
gst_element_class_add_pad_template (element_class,
|
||||||
|
GST_PAD_TEMPLATE_GET (src_factory));
|
||||||
|
gst_element_class_add_pad_template (element_class,
|
||||||
|
GST_PAD_TEMPLATE_GET (sink_factory));
|
||||||
|
gst_element_class_set_details (element_class, &rfc2250_enc_details);
|
||||||
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
gst_rfc2250_enc_class_init (GstRFC2250EncClass *klass)
|
gst_rfc2250_enc_class_init (GstRFC2250EncClass *klass)
|
||||||
{
|
{
|
||||||
|
@ -324,19 +335,8 @@ gst_rfc2250_enc_get_property (GObject *object, guint prop_id, GValue *value, GPa
|
||||||
|
|
||||||
|
|
||||||
gboolean
|
gboolean
|
||||||
gst_rfc2250_enc_plugin_init (GModule *module, GstPlugin *plugin)
|
gst_rfc2250_enc_plugin_init (GstPlugin *plugin)
|
||||||
{
|
{
|
||||||
GstElementFactory *factory;
|
return gst_element_register (plugin, "rfc2250enc",
|
||||||
|
GST_RANK_NONE, GST_TYPE_RFC2250_ENC);
|
||||||
/* create an elementfactory for the rfc2250_enc element */
|
|
||||||
factory = gst_element_factory_new ("rfc2250enc", GST_TYPE_RFC2250_ENC,
|
|
||||||
&rfc2250_enc_details);
|
|
||||||
g_return_val_if_fail(factory != NULL, FALSE);
|
|
||||||
|
|
||||||
gst_element_factory_add_pad_template (factory, GST_PAD_TEMPLATE_GET (src_factory));
|
|
||||||
gst_element_factory_add_pad_template (factory, GST_PAD_TEMPLATE_GET (sink_factory));
|
|
||||||
|
|
||||||
gst_plugin_add_feature (plugin, GST_PLUGIN_FEATURE (factory));
|
|
||||||
|
|
||||||
return TRUE;
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -78,7 +78,7 @@ struct _GstRFC2250EncClass {
|
||||||
|
|
||||||
GType gst_rfc2250_enc_get_type(void);
|
GType gst_rfc2250_enc_get_type(void);
|
||||||
|
|
||||||
gboolean gst_rfc2250_enc_plugin_init (GModule *module, GstPlugin *plugin);
|
gboolean gst_rfc2250_enc_plugin_init (GstPlugin *plugin);
|
||||||
|
|
||||||
|
|
||||||
#ifdef __cplusplus
|
#ifdef __cplusplus
|
||||||
|
|
Loading…
Reference in a new issue