2 * Copyright (C) 2012 Smart TV Alliance
3 * Author: Thiago Sousa Santos <thiago.sousa.santos@collabora.com>, Collabora Ltd.
7 * This library is free software; you can redistribute it and/or
8 * modify it under the terms of the GNU Library General Public
9 * License as published by the Free Software Foundation; either
10 * version 2 of the License, or (at your option) any later version.
12 * This library is distributed in the hope that it will be useful,
13 * but WITHOUT ANY WARRANTY; without even the implied warranty of
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
15 * Library General Public License for more details.
17 * You should have received a copy of the GNU Library General Public
18 * License along with this library; if not, write to the
19 * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
20 * Boston, MA 02111-1307, USA.
24 * SECTION:element-mssdemux
27 * Demuxes a Microsoft's Smooth Streaming manifest into its audio and/or video streams.
34 * = Smooth streaming in a few lines
35 * A SS stream is defined by a xml manifest file. This file has a list of
36 * tracks (StreamIndex), each one can have multiple QualityLevels, that define
37 * different encoding/bitrates. When playing a track, only one of those
38 * QualityLevels can be active at a time (per stream).
40 * The StreamIndex defines a URL with {time} and {bitrate} tags that are
41 * replaced by values indicated by the fragment start times and the selected
42 * QualityLevel, that generates the fragments URLs.
44 * Another relevant detail is that the Isomedia fragments for smoothstreaming
45 * won't contains a 'moov' atom, nor a 'stsd', so there is no information
46 * about the media type/configuration on the fragments, it must be extracted
47 * from the Manifest and passed downstream. mssdemux does this via GstCaps.
49 * = How mssdemux works
50 * There is a gstmssmanifest.c utility that holds the manifest and parses
51 * and has functions to extract information from it. mssdemux received the
52 * manifest from its sink pad and starts processing it when it gets EOS.
54 * The Manifest is parsed and the streams are exposed, 1 pad for each, with
55 * a initially selected QualityLevel. Each stream starts its own GstTaks that
56 * is responsible for downloading fragments and pushing them downstream.
58 * When a new connection-speed is set, mssdemux evaluates the available
59 * QualityLevels and might decide to switch to another one. In this case it
60 * pushes a new GstCaps event indicating the new caps on the pads.
62 * All operations that intend to update the GstTasks state should be protected
63 * with the GST_OBJECT_LOCK.
70 #include <glib/gi18n-lib.h>
76 #include "gstadaptivedemuxelements.h"
77 #include "gstmssdemux.h"
79 GST_DEBUG_CATEGORY (mssdemux2_debug);
80 #define GST_CAT_DEFAULT mssdemux2_debug
82 static GstStaticPadTemplate gst_mss_demux_sink_template =
83 GST_STATIC_PAD_TEMPLATE ("sink",
86 GST_STATIC_CAPS ("application/vnd.ms-sstr+xml")
89 static GstStaticPadTemplate gst_mss_demux_videosrc_template =
90 GST_STATIC_PAD_TEMPLATE ("video_%02u",
95 static GstStaticPadTemplate gst_mss_demux_audiosrc_template =
96 GST_STATIC_PAD_TEMPLATE ("audio_%02u",
101 typedef struct _GstMssDemux2 GstMssDemux2;
102 typedef struct _GstMssDemux2Class GstMssDemux2Class;
104 #define gst_mss_demux2_parent_class parent_class
105 G_DEFINE_TYPE (GstMssDemux2, gst_mss_demux2, GST_TYPE_ADAPTIVE_DEMUX);
107 #define gst_mss_demux_stream_parent_class stream_parent_class
108 G_DEFINE_TYPE (GstMssDemuxStream, gst_mss_demux_stream,
109 GST_TYPE_ADAPTIVE_DEMUX2_STREAM);
111 static gboolean mssdemux_element_init (GstPlugin * plugin);
113 GST_ELEMENT_REGISTER_DEFINE_CUSTOM (mssdemux2, mssdemux_element_init);
115 static void gst_mss_demux_dispose (GObject * object);
117 static gboolean gst_mss_demux_is_live (GstAdaptiveDemux * demux);
118 static gboolean gst_mss_demux_process_manifest (GstAdaptiveDemux * demux,
120 static GstClockTime gst_mss_demux_get_duration (GstAdaptiveDemux * demux);
121 static void gst_mss_demux_reset (GstAdaptiveDemux * demux);
122 static GstFlowReturn gst_mss_demux_stream_seek (GstAdaptiveDemux2Stream *
123 stream, gboolean forward, GstSeekFlags flags, GstClockTimeDiff ts,
124 GstClockTimeDiff * final_ts);
125 static gboolean gst_mss_demux_stream_has_next_fragment (GstAdaptiveDemux2Stream
128 gst_mss_demux_stream_advance_fragment (GstAdaptiveDemux2Stream * stream);
129 static gboolean gst_mss_demux_stream_select_bitrate (GstAdaptiveDemux2Stream *
130 stream, guint64 bitrate);
132 gst_mss_demux_stream_update_fragment_info (GstAdaptiveDemux2Stream * stream);
133 static gboolean gst_mss_demux_seek (GstAdaptiveDemux * demux, GstEvent * seek);
135 gst_mss_demux_get_manifest_update_interval (GstAdaptiveDemux * demux);
137 gst_mss_demux_stream_get_fragment_waiting_time (GstAdaptiveDemux2Stream *
140 gst_mss_demux_update_manifest_data (GstAdaptiveDemux * demux,
142 static gboolean gst_mss_demux_get_live_seek_range (GstAdaptiveDemux * demux,
143 gint64 * start, gint64 * stop);
144 static GstFlowReturn gst_mss_demux_stream_data_received (GstAdaptiveDemux2Stream
145 * stream, GstBuffer * buffer);
147 gst_mss_demux_requires_periodical_playlist_update (GstAdaptiveDemux * demux);
148 GstStreamType gst_stream_type_from_mss_type (GstMssStreamType mtype);
151 gst_mss_demux_stream_class_init (GstMssDemuxStreamClass * klass)
153 GstAdaptiveDemux2StreamClass *adaptivedemux2stream_class =
154 GST_ADAPTIVE_DEMUX2_STREAM_CLASS (klass);
156 adaptivedemux2stream_class->stream_seek = gst_mss_demux_stream_seek;
158 adaptivedemux2stream_class->get_fragment_waiting_time =
159 gst_mss_demux_stream_get_fragment_waiting_time;
160 adaptivedemux2stream_class->advance_fragment =
161 gst_mss_demux_stream_advance_fragment;
162 adaptivedemux2stream_class->has_next_fragment =
163 gst_mss_demux_stream_has_next_fragment;
164 adaptivedemux2stream_class->select_bitrate =
165 gst_mss_demux_stream_select_bitrate;
166 adaptivedemux2stream_class->update_fragment_info =
167 gst_mss_demux_stream_update_fragment_info;
169 adaptivedemux2stream_class->data_received =
170 gst_mss_demux_stream_data_received;
174 gst_mss_demux_stream_init (GstMssDemuxStream * stream)
179 gst_mss_demux2_class_init (GstMssDemuxClass * klass)
181 GObjectClass *gobject_class;
182 GstElementClass *gstelement_class;
183 GstAdaptiveDemuxClass *gstadaptivedemux_class;
185 gobject_class = (GObjectClass *) klass;
186 gstelement_class = (GstElementClass *) klass;
187 gstadaptivedemux_class = (GstAdaptiveDemuxClass *) klass;
189 gst_element_class_add_static_pad_template (gstelement_class,
190 &gst_mss_demux_sink_template);
191 gst_element_class_add_static_pad_template (gstelement_class,
192 &gst_mss_demux_videosrc_template);
193 gst_element_class_add_static_pad_template (gstelement_class,
194 &gst_mss_demux_audiosrc_template);
195 gst_element_class_set_static_metadata (gstelement_class,
196 "Smooth Streaming demuxer (v2)", "Codec/Demuxer/Adaptive",
197 "Parse and demultiplex a Smooth Streaming manifest into audio and video "
198 "streams", "Thiago Santos <thiago.sousa.santos@collabora.com>");
200 gobject_class->dispose = gst_mss_demux_dispose;
202 gstadaptivedemux_class->process_manifest = gst_mss_demux_process_manifest;
203 gstadaptivedemux_class->is_live = gst_mss_demux_is_live;
204 gstadaptivedemux_class->get_duration = gst_mss_demux_get_duration;
205 gstadaptivedemux_class->get_manifest_update_interval =
206 gst_mss_demux_get_manifest_update_interval;
207 gstadaptivedemux_class->reset = gst_mss_demux_reset;
208 gstadaptivedemux_class->seek = gst_mss_demux_seek;
210 gstadaptivedemux_class->update_manifest_data =
211 gst_mss_demux_update_manifest_data;
213 gstadaptivedemux_class->get_live_seek_range =
214 gst_mss_demux_get_live_seek_range;
215 gstadaptivedemux_class->requires_periodical_playlist_update =
216 gst_mss_demux_requires_periodical_playlist_update;
221 gst_mss_demux2_init (GstMssDemux * mssdemux)
226 gst_mss_demux_reset (GstAdaptiveDemux * demux)
228 GstMssDemux *mssdemux = GST_MSS_DEMUX_CAST (demux);
230 if (mssdemux->manifest) {
231 gst_mss_manifest_free (mssdemux->manifest);
232 mssdemux->manifest = NULL;
234 g_free (mssdemux->base_url);
235 mssdemux->base_url = NULL;
239 gst_mss_demux_dispose (GObject * object)
241 gst_mss_demux_reset (GST_ADAPTIVE_DEMUX_CAST (object));
243 G_OBJECT_CLASS (parent_class)->dispose (object);
247 gst_mss_demux_is_live (GstAdaptiveDemux * demux)
249 GstMssDemux *mssdemux = GST_MSS_DEMUX_CAST (demux);
251 g_return_val_if_fail (mssdemux->manifest != NULL, FALSE);
253 return gst_mss_manifest_is_live (mssdemux->manifest);
257 gst_mss_demux_get_duration (GstAdaptiveDemux * demux)
259 GstMssDemux *mssdemux = GST_MSS_DEMUX_CAST (demux);
261 g_return_val_if_fail (mssdemux->manifest != NULL, FALSE);
263 return gst_mss_manifest_get_gst_duration (mssdemux->manifest);
267 gst_mss_demux_stream_update_fragment_info (GstAdaptiveDemux2Stream * stream)
269 GstMssDemuxStream *mssstream = (GstMssDemuxStream *) stream;
270 GstMssDemux *mssdemux = GST_MSS_DEMUX_CAST (stream->demux);
274 gst_adaptive_demux2_stream_fragment_clear (&stream->fragment);
275 ret = gst_mss_stream_get_fragment_url (mssstream->manifest_stream, &path);
277 if (ret == GST_FLOW_OK) {
278 GstUri *base_url, *frag_url;
280 base_url = gst_uri_from_string (mssdemux->base_url);
281 frag_url = gst_uri_from_string_with_base (base_url, path);
283 g_free (stream->fragment.uri);
284 stream->fragment.uri = gst_uri_to_string (frag_url);
285 stream->fragment.stream_time =
286 gst_mss_stream_get_fragment_gst_timestamp (mssstream->manifest_stream);
287 stream->fragment.duration =
288 gst_mss_stream_get_fragment_gst_duration (mssstream->manifest_stream);
290 gst_uri_unref (base_url);
291 gst_uri_unref (frag_url);
299 gst_mss_demux_stream_seek (GstAdaptiveDemux2Stream * stream, gboolean forward,
300 GstSeekFlags flags, GstClockTimeDiff ts, GstClockTimeDiff * final_ts)
302 GstMssDemuxStream *mssstream = (GstMssDemuxStream *) stream;
304 gst_mss_stream_seek (mssstream->manifest_stream, forward, flags, ts,
310 gst_mss_demux_stream_advance_fragment (GstAdaptiveDemux2Stream * stream)
312 GstMssDemuxStream *mssstream = (GstMssDemuxStream *) stream;
314 if (stream->demux->segment.rate >= 0)
315 return gst_mss_stream_advance_fragment (mssstream->manifest_stream);
317 return gst_mss_stream_regress_fragment (mssstream->manifest_stream);
321 create_mss_caps (GstMssDemuxStream * stream, GstCaps * caps)
323 return gst_caps_new_simple ("video/quicktime", "variant", G_TYPE_STRING,
324 "mss-fragmented", "timescale", G_TYPE_UINT64,
325 gst_mss_stream_get_timescale (stream->manifest_stream), "media-caps",
326 GST_TYPE_CAPS, caps, NULL);
330 gst_mss_demux_apply_protection_system (GstCaps * caps,
331 const gchar * selected_system)
335 g_return_if_fail (selected_system);
336 s = gst_caps_get_structure (caps, 0);
337 gst_structure_set (s,
338 "original-media-type", G_TYPE_STRING, gst_structure_get_name (s),
339 GST_PROTECTION_SYSTEM_ID_CAPS_FIELD, G_TYPE_STRING, selected_system,
341 gst_structure_set_name (s, "application/x-cenc");
346 gst_mss_demux_setup_streams (GstAdaptiveDemux * demux)
348 GstMssDemux *mssdemux = GST_MSS_DEMUX_CAST (demux);
349 GSList *streams = gst_mss_manifest_get_streams (mssdemux->manifest);
350 GSList *active_streams = NULL;
352 const gchar *protection_system_id =
353 gst_mss_manifest_get_protection_system_id (mssdemux->manifest);
354 const gchar *protection_data =
355 gst_mss_manifest_get_protection_data (mssdemux->manifest);
356 gboolean protected = protection_system_id && protection_data;
357 const gchar *selected_system = NULL;
358 guint64 max_bitrate = G_MAXUINT64;
360 if (streams == NULL) {
361 GST_INFO_OBJECT (mssdemux, "No streams found in the manifest");
362 GST_ELEMENT_ERROR (mssdemux, STREAM, DEMUX,
363 (_("This file contains no playable streams.")),
364 ("no streams found at the Manifest"));
369 const gchar *sys_ids[2] = { protection_system_id, NULL };
371 selected_system = gst_protection_select_system (sys_ids);
372 if (!selected_system) {
373 GST_ERROR_OBJECT (mssdemux, "stream is protected, but no "
374 "suitable decryptor element has been found");
379 if (demux->connection_speed != 0)
380 max_bitrate = demux->connection_speed;
382 for (iter = streams; iter; iter = g_slist_next (iter)) {
383 GstAdaptiveDemux2Stream *stream = NULL;
384 GstMssDemuxStream *mss_stream;
385 GstMssStream *manifeststream = iter->data;
386 GstAdaptiveDemuxTrack *track;
387 GstStreamType stream_type =
388 gst_stream_type_from_mss_type (gst_mss_stream_get_type
390 const gchar *lang = gst_mss_stream_get_lang (manifeststream);
391 const gchar *name = gst_mss_stream_get_name (manifeststream);
394 GstTagList *tags = NULL;
396 if (stream_type == GST_STREAM_TYPE_UNKNOWN) {
397 GST_WARNING_OBJECT (mssdemux, "Skipping unknown stream %s", name);
403 g_strdup_printf ("mss-stream-%s-%s",
404 gst_stream_type_get_name (stream_type),
405 gst_mss_stream_get_name (manifeststream));
408 g_strdup_printf ("mss-stream-%s-%s",
409 gst_stream_type_get_name (stream_type), lang);
412 g_strdup_printf ("mss-stream-%s",
413 gst_stream_type_get_name (stream_type));
416 g_object_new (GST_TYPE_MSS_DEMUX_STREAM, "name", stream_id, NULL);
418 stream = GST_ADAPTIVE_DEMUX2_STREAM_CAST (mss_stream);
419 stream->stream_type = stream_type;
421 mss_stream->manifest_stream = manifeststream;
422 gst_mss_stream_set_active (manifeststream, TRUE);
424 /* Set the maximum bitrate now that the underlying stream is active. This
425 * ensures that we get the proper caps and information. */
426 gst_mss_stream_select_bitrate (manifeststream, max_bitrate);
428 caps = gst_mss_stream_get_caps (mss_stream->manifest_stream);
429 gst_adaptive_demux2_stream_set_caps (stream, create_mss_caps (mss_stream,
432 tags = gst_tag_list_new (GST_TAG_LANGUAGE_CODE, lang, NULL);
434 track = gst_adaptive_demux_track_new (demux, stream_type,
435 GST_STREAM_FLAG_NONE, (gchar *) stream_id, create_mss_caps (mss_stream,
439 gst_adaptive_demux2_add_stream (demux, stream);
440 gst_adaptive_demux2_stream_add_track (stream, track);
441 gst_adaptive_demux_track_unref (track);
443 GST_DEBUG_OBJECT (stream, "Current quality bitrate %" G_GUINT64_FORMAT,
444 gst_mss_stream_get_current_bitrate (manifeststream));
447 gst_adaptive_demux2_stream_set_tags (stream, tags);
449 active_streams = g_slist_prepend (active_streams, mss_stream);
452 for (iter = active_streams; iter; iter = g_slist_next (iter)) {
453 GstMssDemuxStream *stream = iter->data;
456 GstBuffer *protection_buffer =
457 gst_buffer_new_wrapped (g_strdup (protection_data),
458 strlen (protection_data));
460 gst_event_new_protection (protection_system_id, protection_buffer,
463 GST_LOG_OBJECT (stream, "Queueing Protection event on source pad");
464 gst_adaptive_demux2_stream_queue_event ((GstAdaptiveDemux2Stream *)
466 gst_buffer_unref (protection_buffer);
470 g_slist_free (active_streams);
475 gst_mss_demux_update_base_url (GstMssDemux * mssdemux)
477 GstAdaptiveDemux *demux = GST_ADAPTIVE_DEMUX_CAST (mssdemux);
481 g_free (mssdemux->base_url);
484 g_strdup (demux->manifest_base_uri ? demux->manifest_base_uri : demux->
487 base_url = gst_uri_from_string (mssdemux->base_url);
488 path = gst_uri_get_path (base_url);
489 GST_DEBUG ("%s", path);
491 if (!g_str_has_suffix (path, "/Manifest")
492 && !g_str_has_suffix (path, "/manifest"))
493 GST_WARNING_OBJECT (mssdemux, "Stream's URI didn't end with /manifest");
496 gst_uri_unref (base_url);
500 gst_mss_demux_process_manifest (GstAdaptiveDemux * demux, GstBuffer * buf)
502 GstMssDemux *mssdemux = GST_MSS_DEMUX_CAST (demux);
504 gst_mss_demux_update_base_url (mssdemux);
506 mssdemux->manifest = gst_mss_manifest_new (buf);
507 if (!mssdemux->manifest) {
508 GST_ELEMENT_ERROR (mssdemux, STREAM, FORMAT, ("Bad manifest file"),
509 ("Xml manifest file couldn't be parsed"));
512 return gst_mss_demux_setup_streams (demux);
516 gst_mss_demux_stream_select_bitrate (GstAdaptiveDemux2Stream * stream,
519 GstMssDemuxStream *mssstream = (GstMssDemuxStream *) stream;
520 gboolean ret = FALSE;
522 GST_DEBUG_OBJECT (stream,
523 "Using stream download bitrate %" G_GUINT64_FORMAT, bitrate);
525 if (gst_mss_stream_select_bitrate (mssstream->manifest_stream,
526 bitrate / MAX (1.0, ABS (stream->demux->segment.rate)))) {
529 GstMssDemux *mssdemux = GST_MSS_DEMUX_CAST (stream->demux);
530 const gchar *protection_system_id =
531 gst_mss_manifest_get_protection_system_id (mssdemux->manifest);
532 const gchar *protection_data =
533 gst_mss_manifest_get_protection_data (mssdemux->manifest);
534 gboolean protected = protection_system_id && protection_data;
536 caps = gst_mss_stream_get_caps (mssstream->manifest_stream);
538 GST_DEBUG_OBJECT (stream,
539 "Starting streams reconfiguration due to bitrate changes");
542 const gchar *sys_ids[2] = { protection_system_id, NULL };
543 const gchar *selected_system = gst_protection_select_system (sys_ids);
545 if (!selected_system) {
546 GST_ERROR_OBJECT (mssdemux, "stream is protected, but no "
547 "suitable decryptor element has been found");
548 gst_caps_unref (caps);
552 gst_mss_demux_apply_protection_system (caps, selected_system);
555 msscaps = create_mss_caps (mssstream, caps);
557 GST_DEBUG_OBJECT (stream,
558 "Stream changed bitrate to %" G_GUINT64_FORMAT " caps: %"
560 gst_mss_stream_get_current_bitrate (mssstream->manifest_stream), caps);
562 gst_caps_unref (caps);
564 gst_adaptive_demux2_stream_set_caps (stream, msscaps);
566 GST_DEBUG_OBJECT (stream, "Finished streams reconfiguration");
571 #define SEEK_UPDATES_PLAY_POSITION(r, start_type, stop_type) \
572 ((r >= 0 && start_type != GST_SEEK_TYPE_NONE) || \
573 (r < 0 && stop_type != GST_SEEK_TYPE_NONE))
576 gst_mss_demux_seek (GstAdaptiveDemux * demux, GstEvent * seek)
581 GstSeekType start_type, stop_type;
583 GstMssDemux *mssdemux = GST_MSS_DEMUX_CAST (demux);
585 gst_event_parse_seek (seek, &rate, &format, &flags, &start_type, &start,
588 GST_DEBUG_OBJECT (mssdemux,
589 "seek event, rate: %f start: %" GST_TIME_FORMAT " stop: %"
590 GST_TIME_FORMAT, rate, GST_TIME_ARGS (start), GST_TIME_ARGS (stop));
592 if (SEEK_UPDATES_PLAY_POSITION (rate, start_type, stop_type)) {
594 gst_mss_manifest_seek (mssdemux->manifest, rate >= 0, start);
596 gst_mss_manifest_seek (mssdemux->manifest, rate >= 0, stop);
603 gst_mss_demux_stream_has_next_fragment (GstAdaptiveDemux2Stream * stream)
605 GstMssDemuxStream *mssstream = (GstMssDemuxStream *) stream;
607 return gst_mss_stream_has_next_fragment (mssstream->manifest_stream);
611 gst_mss_demux_get_manifest_update_interval (GstAdaptiveDemux * demux)
613 GstMssDemux *mssdemux = GST_MSS_DEMUX_CAST (demux);
614 GstClockTime interval;
616 /* Not much information about this in the MSS spec. It seems that
617 * the fragments contain an UUID box that should tell the next
618 * fragments time and duration so one wouldn't need to fetch
619 * the Manifest again, but we need a fallback here. So use 2 times
620 * the current fragment duration */
622 interval = gst_mss_manifest_get_min_fragment_duration (mssdemux->manifest);
623 if (!GST_CLOCK_TIME_IS_VALID (interval))
624 interval = 2 * GST_SECOND; /* default to 2 seconds */
626 interval = 2 * (interval / GST_USECOND);
632 gst_mss_demux_stream_get_fragment_waiting_time (GstAdaptiveDemux2Stream *
635 /* Wait a second for live streams so we don't try premature fragments downloading */
640 gst_mss_demux_update_manifest_data (GstAdaptiveDemux * demux,
643 GstMssDemux *mssdemux = GST_MSS_DEMUX_CAST (demux);
645 gst_mss_demux_update_base_url (mssdemux);
647 gst_mss_manifest_reload_fragments (mssdemux->manifest, buffer);
652 gst_mss_demux_get_live_seek_range (GstAdaptiveDemux * demux, gint64 * start,
655 GstMssDemux *mssdemux = GST_MSS_DEMUX_CAST (demux);
657 return gst_mss_manifest_get_live_seek_range (mssdemux->manifest, start, stop);
661 gst_mss_demux_stream_data_received (GstAdaptiveDemux2Stream * stream,
664 GstMssDemux *mssdemux = GST_MSS_DEMUX_CAST (stream->demux);
665 GstMssDemuxStream *mssstream = (GstMssDemuxStream *) stream;
668 if (!gst_mss_manifest_is_live (mssdemux->manifest)) {
669 return gst_adaptive_demux2_stream_push_buffer (stream, buffer);
672 if (gst_mss_stream_fragment_parsing_needed (mssstream->manifest_stream)) {
673 gst_mss_manifest_live_adapter_push (mssstream->manifest_stream, buffer);
675 gst_mss_manifest_live_adapter_available (mssstream->manifest_stream);
676 // FIXME: try to reduce this minimal size.
677 if (available < 4096) {
680 GST_LOG_OBJECT (stream, "enough data, parsing fragment.");
682 gst_mss_manifest_live_adapter_take_buffer (mssstream->manifest_stream,
684 gst_mss_stream_parse_fragment (mssstream->manifest_stream, buffer);
688 return gst_adaptive_demux2_stream_push_buffer (stream, buffer);
692 gst_mss_demux_requires_periodical_playlist_update (GstAdaptiveDemux * demux)
698 gst_stream_type_from_mss_type (GstMssStreamType mtype)
701 case MSS_STREAM_TYPE_AUDIO:
702 return GST_STREAM_TYPE_AUDIO;
703 case MSS_STREAM_TYPE_VIDEO:
704 return GST_STREAM_TYPE_VIDEO;
706 return GST_STREAM_TYPE_UNKNOWN;
711 mssdemux_element_init (GstPlugin * plugin)
715 GST_DEBUG_CATEGORY_INIT (mssdemux2_debug, "mssdemux2", 0,
716 "mssdemux2 element");
718 if (!adaptivedemux2_base_element_init (plugin))
722 gst_element_register (plugin, "mssdemux2", GST_RANK_PRIMARY + 1,
723 GST_TYPE_MSS_DEMUX2);