summaryrefslogtreecommitdiff
path: root/gst/mpegtsmux/tsmux
diff options
context:
space:
mode:
authorSebastian Dröge <sebastian@centricular.com>2018-03-21 13:42:30 +0200
committerSebastian Dröge <sebastian@centricular.com>2018-03-21 13:42:30 +0200
commit93e56ed4735cb525cac9bf3f833a8342f7543671 (patch)
treefafeab1700fce126cf603afd3eac9c32c60d3ac8 /gst/mpegtsmux/tsmux
parent3f0463c43e2c61ba5509c9466dc2a023dc866ad4 (diff)
downloadgstreamer-plugins-bad-93e56ed4735cb525cac9bf3f833a8342f7543671.tar.gz
mpegtsmux: Explicitly resend PAT/SI/PMT on force-keyunit events
And don't randomly change the PCR stream, which would cause a new PMT version to be generated instead and could confuse players.
Diffstat (limited to 'gst/mpegtsmux/tsmux')
-rw-r--r--gst/mpegtsmux/tsmux/tsmux.c43
-rw-r--r--gst/mpegtsmux/tsmux/tsmux.h3
2 files changed, 46 insertions, 0 deletions
diff --git a/gst/mpegtsmux/tsmux/tsmux.c b/gst/mpegtsmux/tsmux/tsmux.c
index 95d7306c9..6fa9e0d12 100644
--- a/gst/mpegtsmux/tsmux/tsmux.c
+++ b/gst/mpegtsmux/tsmux/tsmux.c
@@ -229,6 +229,20 @@ tsmux_get_pat_interval (TsMux * mux)
}
/**
+ * tsmux_resend_pat:
+ * @mux: a #TsMux
+ *
+ * Resends the PAT before the next stream packet.
+ */
+void
+tsmux_resend_pat (TsMux * mux)
+{
+ g_return_if_fail (mux != NULL);
+
+ mux->last_pat_ts = G_MININT64;
+}
+
+/**
* tsmux_set_si_interval:
* @mux: a #TsMux
* @freq: a new SI table interval
@@ -261,6 +275,21 @@ tsmux_get_si_interval (TsMux * mux)
}
/**
+ * tsmux_resend_si:
+ * @mux: a #TsMux
+ *
+ * Resends the SI tables before the next stream packet.
+ *
+ */
+void
+tsmux_resend_si (TsMux * mux)
+{
+ g_return_if_fail (mux != NULL);
+
+ mux->last_si_ts = G_MININT64;
+}
+
+/**
* tsmux_add_mpegts_si_section:
* @mux: a #TsMux
* @section: (transfer full): a #GstMpegtsSection to add
@@ -428,6 +457,20 @@ tsmux_get_pmt_interval (TsMuxProgram * program)
}
/**
+ * tsmux_resend_pmt:
+ * @program: a #TsMuxProgram
+ *
+ * Resends the PMT before the next stream packet.
+ */
+void
+tsmux_resend_pmt (TsMuxProgram * program)
+{
+ g_return_if_fail (program != NULL);
+
+ program->last_pmt_ts = G_MININT64;
+}
+
+/**
* tsmux_program_add_stream:
* @program: a #TsMuxProgram
* @stream: a #TsMuxStream
diff --git a/gst/mpegtsmux/tsmux/tsmux.h b/gst/mpegtsmux/tsmux/tsmux.h
index dd1185a65..11a1480bb 100644
--- a/gst/mpegtsmux/tsmux/tsmux.h
+++ b/gst/mpegtsmux/tsmux/tsmux.h
@@ -189,6 +189,7 @@ void tsmux_set_write_func (TsMux *mux, TsMuxWriteFunc func, void *user_data)
void tsmux_set_alloc_func (TsMux *mux, TsMuxAllocFunc func, void *user_data);
void tsmux_set_pat_interval (TsMux *mux, guint interval);
guint tsmux_get_pat_interval (TsMux *mux);
+void tsmux_resend_pat (TsMux *mux);
guint16 tsmux_get_new_pid (TsMux *mux);
/* pid/program management */
@@ -196,10 +197,12 @@ TsMuxProgram * tsmux_program_new (TsMux *mux, gint prog_id);
void tsmux_program_free (TsMuxProgram *program);
void tsmux_set_pmt_interval (TsMuxProgram *program, guint interval);
guint tsmux_get_pmt_interval (TsMuxProgram *program);
+void tsmux_resend_pmt (TsMuxProgram *program);
/* SI table management */
void tsmux_set_si_interval (TsMux *mux, guint interval);
guint tsmux_get_si_interval (TsMux *mux);
+void tsmux_resend_si (TsMux *mux);
gboolean tsmux_add_mpegts_si_section (TsMux * mux, GstMpegtsSection * section);
/* stream management */