mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2025-01-12 02:15:31 +00:00
real: Implement SEGMENT query
This commit is contained in:
parent
1ce9d7b2d1
commit
eb5dfd5436
2 changed files with 52 additions and 0 deletions
|
@ -934,6 +934,32 @@ gst_real_audio_demux_src_query (GstPad * pad, GstObject * parent,
|
||||||
ret = TRUE;
|
ret = TRUE;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
case GST_QUERY_SEGMENT:
|
||||||
|
{
|
||||||
|
GstFormat format;
|
||||||
|
gint64 start, stop;
|
||||||
|
|
||||||
|
format = demux->segment.format;
|
||||||
|
|
||||||
|
start =
|
||||||
|
gst_segment_to_stream_time (&demux->segment, format,
|
||||||
|
demux->segment.start);
|
||||||
|
if ((stop = demux->segment.stop) == -1)
|
||||||
|
stop = demux->segment.duration;
|
||||||
|
else
|
||||||
|
stop = gst_segment_to_stream_time (&demux->segment, format, stop);
|
||||||
|
|
||||||
|
if (demux->segment.rate < 0.0) {
|
||||||
|
gint64 tmp;
|
||||||
|
tmp = stop;
|
||||||
|
stop = start;
|
||||||
|
start = tmp;
|
||||||
|
}
|
||||||
|
|
||||||
|
gst_query_set_segment (query, demux->segment.rate, format, start, stop);
|
||||||
|
ret = TRUE;
|
||||||
|
break;
|
||||||
|
}
|
||||||
default:
|
default:
|
||||||
ret = gst_pad_query_default (pad, parent, query);
|
ret = gst_pad_query_default (pad, parent, query);
|
||||||
break;
|
break;
|
||||||
|
|
|
@ -647,6 +647,32 @@ gst_rmdemux_src_query (GstPad * pad, GstObject * parent, GstQuery * query)
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
case GST_QUERY_SEGMENT:
|
||||||
|
{
|
||||||
|
GstFormat format;
|
||||||
|
gint64 start, stop;
|
||||||
|
|
||||||
|
format = rmdemux->segment.format;
|
||||||
|
|
||||||
|
start =
|
||||||
|
gst_segment_to_stream_time (&rmdemux->segment, format,
|
||||||
|
rmdemux->segment.start);
|
||||||
|
if ((stop = rmdemux->segment.stop) == -1)
|
||||||
|
stop = rmdemux->segment.duration;
|
||||||
|
else
|
||||||
|
stop = gst_segment_to_stream_time (&rmdemux->segment, format, stop);
|
||||||
|
|
||||||
|
if (rmdemux->segment.rate < 0.0) {
|
||||||
|
gint64 tmp;
|
||||||
|
tmp = stop;
|
||||||
|
stop = start;
|
||||||
|
start = tmp;
|
||||||
|
}
|
||||||
|
|
||||||
|
gst_query_set_segment (query, rmdemux->segment.rate, format, start, stop);
|
||||||
|
res = TRUE;
|
||||||
|
break;
|
||||||
|
}
|
||||||
default:
|
default:
|
||||||
res = gst_pad_query_default (pad, parent, query);
|
res = gst_pad_query_default (pad, parent, query);
|
||||||
break;
|
break;
|
||||||
|
|
Loading…
Reference in a new issue