mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2025-04-05 07:40:01 +00:00
gstmediasourcetrackbuffer: Added method to wait until any new data
The source buffer currently has a thread for each track that feeds the track with all data in the track buffer until EOS is reached. Each pass over the track buffer currently waits for the EOS to appear when it's done iterating the track buffer which is too restrictive. When the source buffer reaches the end of the track buffer, it should wait for any new data to be processed -- not just an EOS -- then check for cancellation if the deadline expires without new data. Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/8512>
This commit is contained in:
parent
eec05ffeac
commit
3b32f53d7b
2 changed files with 5 additions and 8 deletions
|
@ -78,7 +78,7 @@ gboolean gst_media_source_track_buffer_is_eos (
|
|||
GstMediaSourceTrackBuffer * self);
|
||||
|
||||
GST_MSE_PRIVATE
|
||||
gboolean gst_media_source_track_buffer_await_eos_until (
|
||||
void gst_media_source_track_buffer_await_new_data_until (
|
||||
GstMediaSourceTrackBuffer * self, gint64 deadline);
|
||||
|
||||
GST_MSE_PRIVATE
|
||||
|
|
|
@ -188,16 +188,13 @@ gst_media_source_track_buffer_is_eos (GstMediaSourceTrackBuffer * self)
|
|||
return is_eos (self);
|
||||
}
|
||||
|
||||
gboolean
|
||||
gst_media_source_track_buffer_await_eos_until (GstMediaSourceTrackBuffer * self,
|
||||
gint64 deadline)
|
||||
void
|
||||
gst_media_source_track_buffer_await_new_data_until (GstMediaSourceTrackBuffer *
|
||||
self, gint64 deadline)
|
||||
{
|
||||
NEW_DATA_LOCK (self);
|
||||
while (!is_eos (self) && NEW_DATA_WAIT_UNTIL (self, deadline)) {
|
||||
/* wait */
|
||||
}
|
||||
NEW_DATA_WAIT_UNTIL (self, deadline);
|
||||
NEW_DATA_UNLOCK (self);
|
||||
return is_eos (self);
|
||||
}
|
||||
|
||||
gint
|
||||
|
|
Loading…
Reference in a new issue