diff --git a/gst/mpegtsmux/atscmux.c b/gst/mpegtsmux/atscmux.c new file mode 100644 index 0000000000..c9f2777608 --- /dev/null +++ b/gst/mpegtsmux/atscmux.c @@ -0,0 +1,44 @@ +/* ATSC Transport Stream muxer + * Copyright (C) 2019 Mathieu Duponchelle + * + * atscmux.c: + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Library General Public + * License as published by the Free Software Foundation; either + * version 2 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Library General Public License for more details. + * + * You should have received a copy of the GNU Library General Public + * License along with this library; if not, write to the + * Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, + * Boston, MA 02110-1301, USA. + */ + +#include "atscmux.h" + +GST_DEBUG_CATEGORY (atscmux_debug); +#define GST_CAT_DEFAULT atscmux_debug + +G_DEFINE_TYPE (ATSCMux, atscmux, GST_TYPE_MPEG_TSMUX) + + static void atscmux_class_init (ATSCMuxClass * klass) +{ + GstElementClass *gstelement_class = GST_ELEMENT_CLASS (klass); + + GST_DEBUG_CATEGORY_INIT (atscmux_debug, "atscmux", 0, "ATSC muxer"); + + gst_element_class_set_static_metadata (gstelement_class, + "ATSC Transport Stream Muxer", "Codec/Muxer", + "Multiplexes media streams into an ATSC-compliant Transport Stream", + "Mathieu Duponchelle "); +} + +static void +atscmux_init (ATSCMux * mux) +{ +} diff --git a/gst/mpegtsmux/atscmux.h b/gst/mpegtsmux/atscmux.h new file mode 100644 index 0000000000..e79f9cd636 --- /dev/null +++ b/gst/mpegtsmux/atscmux.h @@ -0,0 +1,46 @@ +/* ATSC Transport Stream muxer + * Copyright (C) 2019 Mathieu Duponchelle + * + * atscmux.h: + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Library General Public + * License as published by the Free Software Foundation; either + * version 2 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Library General Public License for more details. + * + * You should have received a copy of the GNU Library General Public + * License along with this library; if not, write to the + * Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, + * Boston, MA 02110-1301, USA. + */ + +#ifndef __ATSCMUX_H__ +#define __ATSCMUX_H__ + +#include "mpegtsmux.h" + +G_BEGIN_DECLS + +#define GST_TYPE_ATSCMUX (atscmux_get_type()) + +typedef struct ATSCMux ATSCMux; +typedef struct ATSCMuxClass ATSCMuxClass; + +struct ATSCMux { + MpegTsMux parent; +}; + +struct ATSCMuxClass { + MpegTsMuxClass parent_class; +}; + +GType atscmux_get_type (void); + +G_END_DECLS + +#endif /* __ATSCMUX_H__ */ diff --git a/gst/mpegtsmux/meson.build b/gst/mpegtsmux/meson.build index 8f9111720a..ff5f5490f0 100644 --- a/gst/mpegtsmux/meson.build +++ b/gst/mpegtsmux/meson.build @@ -1,11 +1,13 @@ tsmux_sources = [ + 'mpegtsmuxplugin.c', 'mpegtsmux.c', + 'atscmux.c', 'mpegtsmux_aac.c', 'mpegtsmux_opus.c', 'mpegtsmux_ttxt.c', 'mpegtsmux_jpeg2000.c', 'tsmux/tsmux.c', - 'tsmux/tsmuxstream.c', + 'tsmux/tsmuxstream.c' ] gstmpegtsmux = library('gstmpegtsmux', diff --git a/gst/mpegtsmux/mpegtsmux.c b/gst/mpegtsmux/mpegtsmux.c index 6d145a6944..d0f82b6eb4 100644 --- a/gst/mpegtsmux/mpegtsmux.c +++ b/gst/mpegtsmux/mpegtsmux.c @@ -82,9 +82,6 @@ * */ -#ifdef HAVE_CONFIG_H -#include "config.h" -#endif #include #include @@ -247,6 +244,9 @@ mpegtsmux_class_init (MpegTsMuxClass * klass) GstElementClass *gstelement_class = GST_ELEMENT_CLASS (klass); GObjectClass *gobject_class = G_OBJECT_CLASS (klass); + GST_DEBUG_CATEGORY_INIT (mpegtsmux_debug, "mpegtsmux", 0, + "MPEG Transport Stream muxer"); + gst_element_class_add_static_pad_template (gstelement_class, &mpegtsmux_sink_factory); gst_element_class_add_static_pad_template (gstelement_class, @@ -2063,21 +2063,3 @@ mpegtsmux_send_event (GstElement * element, GstEvent * event) return FALSE; } - -static gboolean -plugin_init (GstPlugin * plugin) -{ - gst_mpegts_initialize (); - if (!gst_element_register (plugin, "mpegtsmux", GST_RANK_PRIMARY, - mpegtsmux_get_type ())) - return FALSE; - - GST_DEBUG_CATEGORY_INIT (mpegtsmux_debug, "mpegtsmux", 0, - "MPEG Transport Stream muxer"); - - return TRUE; -} - -GST_PLUGIN_DEFINE (GST_VERSION_MAJOR, GST_VERSION_MINOR, - mpegtsmux, "MPEG-TS muxer", - plugin_init, VERSION, "LGPL", GST_PACKAGE_NAME, GST_PACKAGE_ORIGIN); diff --git a/gst/mpegtsmux/mpegtsmuxplugin.c b/gst/mpegtsmux/mpegtsmuxplugin.c new file mode 100644 index 0000000000..2e043de288 --- /dev/null +++ b/gst/mpegtsmux/mpegtsmuxplugin.c @@ -0,0 +1,26 @@ +#ifdef HAVE_CONFIG_H +#include "config.h" +#endif + +#include "mpegtsmux.h" +#include "atscmux.h" + +static gboolean +plugin_init (GstPlugin * plugin) +{ + gst_mpegts_initialize (); + + if (!gst_element_register (plugin, "mpegtsmux", GST_RANK_PRIMARY, + mpegtsmux_get_type ())) + return FALSE; + + if (!gst_element_register (plugin, "atscmux", GST_RANK_PRIMARY, + atscmux_get_type ())) + return FALSE; + + return TRUE; +} + +GST_PLUGIN_DEFINE (GST_VERSION_MAJOR, GST_VERSION_MINOR, + mpegtsmux, "MPEG-TS muxer", + plugin_init, VERSION, "LGPL", GST_PACKAGE_NAME, GST_PACKAGE_ORIGIN);