mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2025-02-17 03:35:21 +00:00
mssdemux: add an 'active' flag to manifest stream
mssdemux should set the streams it has exposed as active so that the manifest won't use the non-active streams to compute total bitrates or providing fragments
This commit is contained in:
parent
4726115e83
commit
4b6900999a
3 changed files with 17 additions and 0 deletions
|
@ -529,6 +529,7 @@ gst_mss_demux_create_streams (GstMssDemux * mssdemux)
|
|||
_set_src_pad_functions (srcpad);
|
||||
|
||||
stream = gst_mss_demux_stream_new (mssdemux, manifeststream, srcpad);
|
||||
gst_mss_stream_set_active (manifeststream, TRUE);
|
||||
mssdemux->streams = g_slist_append (mssdemux->streams, stream);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -64,6 +64,7 @@ struct _GstMssStream
|
|||
{
|
||||
xmlNodePtr xmlnode;
|
||||
|
||||
gboolean active; /* if the stream is currently being used */
|
||||
gint selectedQualityIndex;
|
||||
|
||||
GList *fragments;
|
||||
|
@ -504,6 +505,12 @@ end:
|
|||
return caps;
|
||||
}
|
||||
|
||||
void
|
||||
gst_mss_stream_set_active (GstMssStream * stream, gboolean active)
|
||||
{
|
||||
stream->active = active;
|
||||
}
|
||||
|
||||
guint64
|
||||
gst_mss_stream_get_timescale (GstMssStream * stream)
|
||||
{
|
||||
|
@ -606,6 +613,8 @@ gst_mss_stream_get_fragment_url (GstMssStream * stream, gchar ** url)
|
|||
GstMssStreamFragment *fragment;
|
||||
GstMssStreamQuality *quality = stream->current_quality->data;
|
||||
|
||||
g_return_val_if_fail (stream->active, GST_FLOW_ERROR);
|
||||
|
||||
if (stream->current_fragment == NULL) /* stream is over */
|
||||
return GST_FLOW_UNEXPECTED;
|
||||
|
||||
|
@ -630,6 +639,8 @@ gst_mss_stream_get_fragment_gst_timestamp (GstMssStream * stream)
|
|||
guint64 timescale;
|
||||
GstMssStreamFragment *fragment;
|
||||
|
||||
g_return_val_if_fail (stream->active, GST_FLOW_ERROR);
|
||||
|
||||
if (!stream->current_fragment)
|
||||
return GST_CLOCK_TIME_NONE;
|
||||
|
||||
|
@ -648,6 +659,8 @@ gst_mss_stream_get_fragment_gst_duration (GstMssStream * stream)
|
|||
guint64 timescale;
|
||||
GstMssStreamFragment *fragment;
|
||||
|
||||
g_return_val_if_fail (stream->active, GST_FLOW_ERROR);
|
||||
|
||||
if (!stream->current_fragment)
|
||||
return GST_CLOCK_TIME_NONE;
|
||||
|
||||
|
@ -662,6 +675,8 @@ gst_mss_stream_get_fragment_gst_duration (GstMssStream * stream)
|
|||
GstFlowReturn
|
||||
gst_mss_stream_advance_fragment (GstMssStream * stream)
|
||||
{
|
||||
g_return_val_if_fail (stream->active, GST_FLOW_ERROR);
|
||||
|
||||
if (stream->current_fragment == NULL)
|
||||
return GST_FLOW_UNEXPECTED;
|
||||
|
||||
|
|
|
@ -48,6 +48,7 @@ gboolean gst_mss_manifest_seek (GstMssManifest * manifest, guint64 time);
|
|||
|
||||
GstMssStreamType gst_mss_stream_get_type (GstMssStream *stream);
|
||||
GstCaps * gst_mss_stream_get_caps (GstMssStream * stream);
|
||||
void gst_mss_stream_set_active (GstMssStream * stream, gboolean active);
|
||||
guint64 gst_mss_stream_get_timescale (GstMssStream * stream);
|
||||
GstFlowReturn gst_mss_stream_get_fragment_url (GstMssStream * stream, gchar ** url);
|
||||
GstClockTime gst_mss_stream_get_fragment_gst_timestamp (GstMssStream * stream);
|
||||
|
|
Loading…
Reference in a new issue