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
@ -529,6 +529,7 @@ gst_mss_demux_create_streams (GstMssDemux * mssdemux)
|
|||||||
_set_src_pad_functions (srcpad);
|
_set_src_pad_functions (srcpad);
|
||||||
|
|
||||||
stream = gst_mss_demux_stream_new (mssdemux, manifeststream, 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);
|
mssdemux->streams = g_slist_append (mssdemux->streams, stream);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -64,6 +64,7 @@ struct _GstMssStream
|
|||||||
{
|
{
|
||||||
xmlNodePtr xmlnode;
|
xmlNodePtr xmlnode;
|
||||||
|
|
||||||
|
gboolean active; /* if the stream is currently being used */
|
||||||
gint selectedQualityIndex;
|
gint selectedQualityIndex;
|
||||||
|
|
||||||
GList *fragments;
|
GList *fragments;
|
||||||
@ -504,6 +505,12 @@ end:
|
|||||||
return caps;
|
return caps;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void
|
||||||
|
gst_mss_stream_set_active (GstMssStream * stream, gboolean active)
|
||||||
|
{
|
||||||
|
stream->active = active;
|
||||||
|
}
|
||||||
|
|
||||||
guint64
|
guint64
|
||||||
gst_mss_stream_get_timescale (GstMssStream * stream)
|
gst_mss_stream_get_timescale (GstMssStream * stream)
|
||||||
{
|
{
|
||||||
@ -606,6 +613,8 @@ gst_mss_stream_get_fragment_url (GstMssStream * stream, gchar ** url)
|
|||||||
GstMssStreamFragment *fragment;
|
GstMssStreamFragment *fragment;
|
||||||
GstMssStreamQuality *quality = stream->current_quality->data;
|
GstMssStreamQuality *quality = stream->current_quality->data;
|
||||||
|
|
||||||
|
g_return_val_if_fail (stream->active, GST_FLOW_ERROR);
|
||||||
|
|
||||||
if (stream->current_fragment == NULL) /* stream is over */
|
if (stream->current_fragment == NULL) /* stream is over */
|
||||||
return GST_FLOW_UNEXPECTED;
|
return GST_FLOW_UNEXPECTED;
|
||||||
|
|
||||||
@ -630,6 +639,8 @@ gst_mss_stream_get_fragment_gst_timestamp (GstMssStream * stream)
|
|||||||
guint64 timescale;
|
guint64 timescale;
|
||||||
GstMssStreamFragment *fragment;
|
GstMssStreamFragment *fragment;
|
||||||
|
|
||||||
|
g_return_val_if_fail (stream->active, GST_FLOW_ERROR);
|
||||||
|
|
||||||
if (!stream->current_fragment)
|
if (!stream->current_fragment)
|
||||||
return GST_CLOCK_TIME_NONE;
|
return GST_CLOCK_TIME_NONE;
|
||||||
|
|
||||||
@ -648,6 +659,8 @@ gst_mss_stream_get_fragment_gst_duration (GstMssStream * stream)
|
|||||||
guint64 timescale;
|
guint64 timescale;
|
||||||
GstMssStreamFragment *fragment;
|
GstMssStreamFragment *fragment;
|
||||||
|
|
||||||
|
g_return_val_if_fail (stream->active, GST_FLOW_ERROR);
|
||||||
|
|
||||||
if (!stream->current_fragment)
|
if (!stream->current_fragment)
|
||||||
return GST_CLOCK_TIME_NONE;
|
return GST_CLOCK_TIME_NONE;
|
||||||
|
|
||||||
@ -662,6 +675,8 @@ gst_mss_stream_get_fragment_gst_duration (GstMssStream * stream)
|
|||||||
GstFlowReturn
|
GstFlowReturn
|
||||||
gst_mss_stream_advance_fragment (GstMssStream * stream)
|
gst_mss_stream_advance_fragment (GstMssStream * stream)
|
||||||
{
|
{
|
||||||
|
g_return_val_if_fail (stream->active, GST_FLOW_ERROR);
|
||||||
|
|
||||||
if (stream->current_fragment == NULL)
|
if (stream->current_fragment == NULL)
|
||||||
return GST_FLOW_UNEXPECTED;
|
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);
|
GstMssStreamType gst_mss_stream_get_type (GstMssStream *stream);
|
||||||
GstCaps * gst_mss_stream_get_caps (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);
|
guint64 gst_mss_stream_get_timescale (GstMssStream * stream);
|
||||||
GstFlowReturn gst_mss_stream_get_fragment_url (GstMssStream * stream, gchar ** url);
|
GstFlowReturn gst_mss_stream_get_fragment_url (GstMssStream * stream, gchar ** url);
|
||||||
GstClockTime gst_mss_stream_get_fragment_gst_timestamp (GstMssStream * stream);
|
GstClockTime gst_mss_stream_get_fragment_gst_timestamp (GstMssStream * stream);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user