gst_dash_demux_stream_update_fragment_info;
adaptivedemux2stream_class->has_next_fragment =
gst_dash_demux_stream_has_next_fragment;
+ adaptivedemux2stream_class->stream_seek = gst_dash_demux_stream_seek;
adaptivedemux2stream_class->advance_fragment =
gst_dash_demux_stream_advance_fragment;
adaptivedemux2stream_class->get_fragment_waiting_time =
gstadaptivedemux_class->has_next_period = gst_dash_demux_has_next_period;
gstadaptivedemux_class->advance_period = gst_dash_demux_advance_period;
- gstadaptivedemux_class->stream_seek = gst_dash_demux_stream_seek;
gstadaptivedemux_class->get_live_seek_range =
gst_dash_demux_get_live_seek_range;
gstadaptivedemux_class->get_period_start_time =
void gst_adaptive_demux2_stream_on_output_space_available (GstAdaptiveDemux2Stream *stream);
gboolean gst_adaptive_demux2_stream_has_next_fragment (GstAdaptiveDemux2Stream * stream);
-GstFlowReturn gst_adaptive_demux2_stream_seek (GstAdaptiveDemux * demux,
- GstAdaptiveDemux2Stream * stream, gboolean forward, GstSeekFlags flags,
+GstFlowReturn gst_adaptive_demux2_stream_seek (GstAdaptiveDemux2Stream * stream,
+ gboolean forward, GstSeekFlags flags,
GstClockTimeDiff ts, GstClockTimeDiff * final_ts);
gboolean gst_adaptive_demux_get_live_seek_range (GstAdaptiveDemux * demux,
gint64 * range_start, gint64 * range_stop);
if (GST_CLOCK_STIME_IS_VALID (stream_time)) {
/* TODO check return */
- gst_adaptive_demux2_stream_seek (demux, stream, demux->segment.rate >= 0,
+ gst_adaptive_demux2_stream_seek (stream, demux->segment.rate >= 0,
0, stream_time, &stream_time);
stream->current_position = stream->start_position;
return ret;
}
+/* must be called from the scheduler */
+GstFlowReturn
+gst_adaptive_demux2_stream_seek (GstAdaptiveDemux2Stream * stream,
+ gboolean forward, GstSeekFlags flags,
+ GstClockTimeDiff ts, GstClockTimeDiff * final_ts)
+{
+ GstAdaptiveDemux2StreamClass *klass =
+ GST_ADAPTIVE_DEMUX2_STREAM_GET_CLASS (stream);
+
+ if (klass->stream_seek)
+ return klass->stream_seek (stream, forward, flags, ts, final_ts);
+ return GST_FLOW_ERROR;
+}
+
static gboolean
gst_adaptive_demux2_stream_select_bitrate (GstAdaptiveDemux *
demux, GstAdaptiveDemux2Stream * stream, guint64 bitrate)
gboolean (*has_next_fragment) (GstAdaptiveDemux2Stream * stream);
GstFlowReturn (*advance_fragment) (GstAdaptiveDemux2Stream * stream);
+ GstFlowReturn (*stream_seek) (GstAdaptiveDemux2Stream * stream,
+ gboolean forward,
+ GstSeekFlags flags,
+ GstClockTimeDiff target_ts,
+ GstClockTimeDiff * final_ts);
+
/**
* can_start:
* @stream: a #GstAdaptiveDemux2Stream
* different positions, so just pick one and align all others to that
* position.
*/
- if (IS_SNAP_SEEK (flags) && demux_class->stream_seek) {
- GstAdaptiveDemux2Stream *stream = NULL;
+
+ GstAdaptiveDemux2Stream *stream = NULL;
+ GList *iter;
+ /* Pick a random active stream on which to do the stream seek */
+ for (iter = demux->output_period->streams; iter; iter = iter->next) {
+ GstAdaptiveDemux2Stream *cand = iter->data;
+ if (gst_adaptive_demux2_stream_is_selected_locked (cand)) {
+ stream = cand;
+ break;
+ }
+ }
+
+ if (stream && IS_SNAP_SEEK (flags)) {
GstClockTimeDiff ts;
GstSeekFlags stream_seek_flags = flags;
- GList *iter;
- /* snap-seek on the stream that received the event and then
+ /* snap-seek on the chosen stream and then
* use the resulting position to seek on all streams */
-
if (rate >= 0) {
if (start_type != GST_SEEK_TYPE_NONE)
ts = start;
}
}
- /* Pick a random active stream on which to do the stream seek */
- for (iter = demux->output_period->streams; iter; iter = iter->next) {
- GstAdaptiveDemux2Stream *cand = iter->data;
- if (gst_adaptive_demux2_stream_is_selected_locked (cand)) {
- stream = cand;
- break;
- }
- }
- if (stream) {
- demux_class->stream_seek (stream, rate >= 0, stream_seek_flags, ts, &ts);
+ if (gst_adaptive_demux2_stream_seek (stream, rate >= 0, stream_seek_flags,
+ ts, &ts) != GST_FLOW_OK) {
+ GST_ADAPTIVE_SCHEDULER_UNLOCK (demux);
+
+ GST_API_UNLOCK (demux);
+ gst_event_unref (event);
+ return FALSE;
}
/* replace event with a new one without snapping to seek on all streams */
return FALSE;
}
-/* must be called from the scheduler */
-GstFlowReturn
-gst_adaptive_demux2_stream_seek (GstAdaptiveDemux * demux,
- GstAdaptiveDemux2Stream * stream, gboolean forward, GstSeekFlags flags,
- GstClockTimeDiff ts, GstClockTimeDiff * final_ts)
-{
- GstAdaptiveDemuxClass *klass = GST_ADAPTIVE_DEMUX_GET_CLASS (demux);
-
- if (klass->stream_seek)
- return klass->stream_seek (stream, forward, flags, ts, final_ts);
- return GST_FLOW_ERROR;
-}
-
static void
handle_manifest_download_complete (DownloadRequest * request,
DownloadRequestState state, GstAdaptiveDemux * demux)
*/
void (*advance_period) (GstAdaptiveDemux * demux);
- GstFlowReturn (*stream_seek) (GstAdaptiveDemux2Stream * stream,
- gboolean forward,
- GstSeekFlags flags,
- GstClockTimeDiff target_ts,
- GstClockTimeDiff * final_ts);
-
/**
* get_live_seek_range:
* @demux: #GstAdaptiveDemux
gst_hls_demux_stream_update_fragment_info;
adaptivedemux2stream_class->has_next_fragment =
gst_hls_demux_stream_has_next_fragment;
+ adaptivedemux2stream_class->stream_seek = gst_hls_demux_stream_seek;
adaptivedemux2stream_class->advance_fragment =
gst_hls_demux_stream_advance_fragment;
adaptivedemux2stream_class->select_bitrate =
adaptivedemux_class->update_manifest = gst_hls_demux_update_manifest;
adaptivedemux_class->reset = gst_hls_demux_reset;
adaptivedemux_class->seek = gst_hls_demux_seek;
- adaptivedemux_class->stream_seek = gst_hls_demux_stream_seek;
}
static void