summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMark Nauwelaerts <mnauw@users.sourceforge.net>2014-02-22 20:54:08 (GMT)
committerMark Nauwelaerts <mnauw@users.sourceforge.net>2014-02-22 20:54:08 (GMT)
commitfef710efc355e869b12ecddaced0c68c5f974cba (patch)
treeed69f08014832f23b4c3bebda62b317e38e555e9
parent9a1c9096dc6182c826bbc9a6806f2258f34d947c (diff)
downloadgst-libav-fef710efc355e869b12ecddaced0c68c5f974cba.tar.gz
gst-libav-fef710efc355e869b12ecddaced0c68c5f974cba.tar.xz
avmux: stream-start and segment event before data-flow
-rw-r--r--ext/libav/gstavmux.c17
1 files changed, 17 insertions, 0 deletions
diff --git a/ext/libav/gstavmux.c b/ext/libav/gstavmux.c
index afc2825..3a3fecf 100644
--- a/ext/libav/gstavmux.c
+++ b/ext/libav/gstavmux.c
@@ -646,6 +646,23 @@ gst_ffmpegmux_collected (GstCollectPads * pads, gpointer user_data)
open_flags |= GST_FFMPEG_URL_STREAMHEADER;
}
+ /* some house-keeping for downstream before starting data flow */
+ /* stream-start (FIXME: create id based on input ids) */
+ {
+ gchar s_id[32];
+
+ g_snprintf (s_id, sizeof (s_id), "avmux-%08x", g_random_int ());
+ gst_pad_push_event (ffmpegmux->srcpad, gst_event_new_stream_start (s_id));
+ }
+ /* segment */
+ {
+ GstSegment segment;
+
+ /* let downstream know we think in BYTES and expect to do seeking later on */
+ gst_segment_init (&segment, GST_FORMAT_BYTES);
+ gst_pad_push_event (ffmpegmux->srcpad, gst_event_new_segment (&segment));
+ }
+
if (gst_ffmpegdata_open (ffmpegmux->srcpad, open_flags,
&ffmpegmux->context->pb) < 0) {
GST_ELEMENT_ERROR (ffmpegmux, LIBRARY, TOO_LAZY, (NULL),