diff options
author | Jesper Larsen <jesper.larsen@ixonos.com> | 2013-11-20 11:14:46 +0100 |
---|---|---|
committer | Jesper Larsen <jesper.larsen@ixonos.com> | 2014-02-06 15:55:46 +0100 |
commit | 93a8137be62075fbcfa2b21cc7dd13e25b8d70af (patch) | |
tree | 9ab551a29a75d8b5aae1101f00b1f0ee2c3dce42 /gst/mpegtsmux/tsmux/tsmux.h | |
parent | b7d256b4c292d0a83f8c7eb2a02de9700082700b (diff) | |
download | gstreamer-plugins-bad-93a8137be62075fbcfa2b21cc7dd13e25b8d70af.tar.gz |
mpegtsmux: Add support for muxing SI tables
The muxer is now able to include DVB sections in the transport stream.
The si-interval property will determine how often the SI tables are
muxed into the stream.
The section is handled by the mpeg-ts library. Below is a small example
that will include a Netork Information Table with a Network Name
descriptor in the stream.
GstMpegTsNIT *nit;
GstMpegTsDescriptor *descriptor;
GstMpegTsSection *section;
GstElement *mpegtsmux;
gst_mpegts_initialize ();
nit = gst_mpegts_section_nit_new ();
nit->actual_network = TRUE;
descriptor = gst_mpegts_descriptor_from_dvb_network_name ("Network name");
g_ptr_array_add (nit->descriptors, descriptor);
section = gst_mpegts_section_from_nit (nit);
// mpegtsmux should be retrieved from the pipeline
gst_mpegts_section_send_event (section, mpegtsmux);
gst_mpegts_section_unref (section);
Diffstat (limited to 'gst/mpegtsmux/tsmux/tsmux.h')
-rw-r--r-- | gst/mpegtsmux/tsmux/tsmux.h | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/gst/mpegtsmux/tsmux/tsmux.h b/gst/mpegtsmux/tsmux/tsmux.h index acebcb5d3..93eba33a7 100644 --- a/gst/mpegtsmux/tsmux/tsmux.h +++ b/gst/mpegtsmux/tsmux/tsmux.h @@ -82,6 +82,8 @@ #include <glib.h> +#include <gst/mpegts/mpegts.h> + #include "tsmuxcommon.h" #include "tsmuxstream.h" @@ -104,6 +106,7 @@ typedef void (*TsMuxAllocFunc) (GstBuffer ** buf, void *user_data); struct TsMuxSection { TsMuxPacketInfo pi; + GstMpegTsSection *section; /* Private sections can be up to 4096 bytes */ guint8 data[TSMUX_MAX_SECTION_LENGTH]; @@ -148,6 +151,9 @@ struct TsMux { guint16 next_pmt_pid; guint16 next_stream_pid; + /* Table with TsMuxSection to write */ + GHashTable *si_sections; + TsMuxSection pat; /* PAT transport_stream_id */ guint16 transport_id; @@ -160,6 +166,13 @@ struct TsMux { /* last time PAT written in MPEG PTS clock time */ gint64 last_pat_ts; + /* trigger writing Service Information Tables */ + gboolean si_changed; + /* interval between SIT in MPEG PTS clock time */ + guint si_interval; + /* last time SIT written in MPEG PTS clock time */ + gint64 last_si_ts; + /* callback to write finished packet */ TsMuxWriteFunc write_func; void *write_func_data; @@ -188,6 +201,11 @@ void tsmux_program_free (TsMuxProgram *program); void tsmux_set_pmt_interval (TsMuxProgram *program, guint interval); guint tsmux_get_pmt_interval (TsMuxProgram *program); +/* SI table management */ +void tsmux_set_si_interval (TsMux *mux, guint interval); +guint tsmux_get_si_interval (TsMux *mux); +gboolean tsmux_add_mpegts_si_section (TsMux * mux, GstMpegTsSection * section); + /* stream management */ TsMuxStream * tsmux_create_stream (TsMux *mux, TsMuxStreamType stream_type, guint16 pid, gchar *language); TsMuxStream * tsmux_find_stream (TsMux *mux, guint16 pid); |