Allow the use of a single file for media. Media playlist will use byte
range tags like below while referencing the same single media file.
```
#EXT-X-PLAYLIST-TYPE:VOD
#EXT-X-MAP:URI="main.mp4",BYTERANGE="768@0"
#EXT-X-BYTERANGE:198120@768
#EXTINF:10,
main.mp4
#EXT-X-BYTERANGE:197426@198888
#EXTINF:10,
main.mp4
```
Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-rs/-/merge_requests/2439>
When an incoming buffer is received, a deadlock can occur if:
1. 1st buffer is currently being handled by the src pad's task
=> holds semaphore.
2. 1st buffer reaches downstream AudioDecoder => Latency query.
3. src pad's task still holding semaphore while relaying Latency query.
4. `src_query()` calls `Pad::default()` which calls `iterate_internal_links()`.
5. `iterate_internal_links()` tries to acquire the `state` `Mutex` which is
already locked by `handle_push_jitterbuffer()`.
This commit temporarily releases the `state` `Mutex` until the semaphore is
acquired.
Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-rs/-/merge_requests/2466>
When a threadshare element streams buffers to an element which synchronizes on
the clock or which uses a limited blocking queue, the threadshare context is
perdiodically blocked, preventing other async tasks from progressing.
One workaround is to use a regular `queue` with enough buffering to cope with
early buffers. This is suboptimal though because this `queue` doesn't propagate
backpressure upstream.
The `ts-blocking-adapter` applies an async backpressure when downstream blocks,
allowing the threadshare context to process other tasks. This is achieved by
having the 'sink' Pad forward serialized items (buffers, ...) to the 'src' Pad
Task (thread) via a rendezvous channel.
Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-rs/-/merge_requests/2427>
Prevent calling clamp() with invalid bounds where min > max, which would
cause a panic with "assertion failed: min <= max". This panic would poison
the mutex lock, causing all subsequent lock().unwrap() calls to fail with
PoisonError.
This can happen when min-bitrate and max-bitrate properties are set
individually, creating a temporary inconsistent state between the values.
Fix by validating the bitrate range before calling clamp() and using
max_bitrate for both bounds when min > max to ensure safe operation.
Use LogContext to log the error only once per unique invalid pair.
Fixes#711
Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-rs/-/merge_requests/2456>
This extracts metadata from an S302M audio stream and interpolates PTS
as needed, but still requires a properly packetized stream from
upstream.
Parsing S302M without packetization is not easily possible because of
the lack of synchronization markers.
Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-rs/-/merge_requests/2435>
The `glimagesink` can handle video conversion just fine, we don't need to use
a `videoconvert` in that branch.
This commit also moves the `handle_media_stream()` branches within
`on_incoming_stream()` as the factorization is no longer justified.
Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-rs/-/merge_requests/2216>
The way media handling was implemented was suboptimal:
* The media elements were linked after being synchronized with their parent.
Any initial queries would fail.
* The window handle was initialized after the video elements were linked and
synchronized with their parent. It was not available at GL context creation,
but assigned afterwards.
This commit fixes the above. The behaviour is unchanged, but it makes more sense
in my opinion.
Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-rs/-/merge_requests/2216>
When stopping `ts-queue` & `ts-proxysink`, the pending queue is removed. There
is a short period of time when a buffer can be handled after the pending queue
is removed but before the element is actually stopped. Since the dataqueue no
longer accepts buffers and the pending queue is removed, a new pending queue was
created and the element was set to wait for queue space.
The stopping procedure is handled with `last_res` `Mutex` locked and set to
`Flushing`.
This commit adds a check to `last_res` before creating a new pending queue and
aborts if the element is `Flushing`.
Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-rs/-/merge_requests/2428>