Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.freedesktop.org/gstreamer/gst-plugins-rs.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
AgeCommit message (Collapse)Author
2022-08-09ts/Task: return a future for state transitionsFrançois Laignel
State transitions request functions hid the synchronization details to the caller: - If the transition was requested from a Context, a subtask was added or the transition ack was not awaited if the new transition was requested from a running transition or an iteration function. - If the transition was not requested from a Context, current thread was blocked until the ack was received. This strategy facilitated code in elements, but it suffered from the following shortcomings: - The `prepare` transition request didn't comply with the above strategy and would always return an `Async` form. This was designed to accomodate the `Prepare` function for elements such as `ts-tcpclientsrc` which takes times due to the TCP socket connection delays. The idea was that the actual transition result would be available after calling `start`. This was a disadvantage for elements which would prefer to error immediately in the event of a preparation failure. - Hidding the transition request synchronization to the caller meant that they had no options but relying on the internal mechanism. E.g.: it was not possible to `start` from another async runtime without blocking. Also it was not possible to request a transition and choose not to await for the ack. This commit introduces a more flexible API for state transitions requests: - The transition request function now return a `TransitionStatus`, which is a Future. - When an error occurs immediately (e.g. the transition request is not autorized due to current state of the Task), the `TransitionStatus` is resolved immediately and can be `check`ed for errors. This is useful for functions such as `pepare` in the case of `ts-tcpclientsrc` (see above). This is also useful for `pause`, because in current design, the transition is always async. Note however, that `pause` is forseen to adhere to the same behaviour as the other transition requests in the near future [1]. - If the caller chooses to await for the ack and they don't know if they are running on a ts Context (e.g. in `Pad{Src,Sink}` handlers), they can call `await_maybe_on_context`. This is mostly the same behaviour as the one that used to be performed internaly. - If the caller knows for sure they can't possibly block an async executor, they can call `block_on` which is more explicite, but will nonetheless make sure no ts Context is being blocked. This last check was introduced as it was considered low overhead while it should ease preventing missues in cases where the above functions should be used. [1]: https://gitlab.freedesktop.org/gstreamer/gst-plugins-rs/-/merge_requests/793#note_1464400
2022-08-09ts/Task: spawn StateMachine on ts ContextFrançois Laignel
Task state machines used to execute in an executor from the Futures crate. State transitions actions and iteration functions were then spawned on the target threadshare Context. This commit directly spawns the task state machine on the threadshare Context. This simplifies code a bit and paves the way for the changes described in [1]. Also introduces struct `StateMachineHandle`, which gather together fields to communicate and synchronize with the StateMachine. Renamed `StateMachine::run` as `spawn` and return `StateMachineHandle`. [1]: https://gitlab.freedesktop.org/gstreamer/gst-plugins-rs/-/merge_requests/793#note_1464400
2022-08-09ts-udpsrc: align default port with C counterpartFrançois Laignel
... and also with the default settings for ts-udpsink.
2022-08-09fmp4: Update to m3u8-rs 5Sebastian Dröge
2022-08-09ts/scheduler: rename awake / wake_up as unparkFrançois Laignel
2022-08-09ts/Task: wake up after the triggering event is pushedFrançois Laignel
The scheduler is awaken when aborting a task loop, but not after a triggering event is pushed. This can cause throttling to induce long state transitions for pipelines with many streams. Observed for Unprepare with: GST_DEBUG=ts-benchmark:4 ../../target/debug/examples/benchmark 2000 ts-udpsrc 2 20 5000
2022-08-09ts/udpsink: fix default clients not leading to socket configurationFrançois Laignel
During MR !793, the socket configuration mechanism was changed to use commands passed to the Task via a channel. This worked properly for user changes via settings and signals, however the default clients setting was not used. A simple solution could have been to send a command at initialization to add the default clients, but it was considered a better solution to just wait for the Task preparation to configure the sockets based on the value of settings.clients at that time, thus avoiding unnecessary successive removals and additions of clients which could have happened before preparation. Of course, users can still add or remove clients as before, before and after Task preparation. See also https://gitlab.freedesktop.org/gstreamer/gst-plugins-rs/-/merge_requests/793
2022-07-21Update per glib::SignalBuilder changesBilal Elmoussaoui
2022-07-20generic/fmp4: use opt_opsFrançois Laignel
2022-07-20Revert "fmp4mux: Dequeue as many buffers as are available in each aggregate ↵François Laignel
call" This reverts commit 402500f79cdaf3cc267a25285428f76f3d7c1773. This commit introduces race conditions. It was intended as solving an issue with some pipelines which had their queues filling up, causing the streams to stall. It is reverted as this solution is considered a workaround for another issue. See discussion in: https://gitlab.freedesktop.org/gstreamer/gst-plugins-rs/-/merge_requests/803
2022-07-19generic/fmp4: update Signed return typeFrançois Laignel
See: https://gitlab.freedesktop.org/gstreamer/gstreamer-rs/-/merge_requests/1068
2022-07-11Simplify Formatted value handlingFrançois Laignel
See https://gitlab.freedesktop.org/gstreamer/gstreamer-rs/-/merge_requests/1059
2022-07-09ts/tests/pad: minor ckeanupsFrançois Laignel
2022-07-09ts/tcpclientsrc: reduce sync primitives in async hot pathFrançois Laignel
2022-07-09ts: Queue & Proxy: minor cleanupsFrançois Laignel
2022-07-09ts/appsrc: reduce sync primitives in async hot pathFrançois Laignel
2022-07-09ts/udpsrc: reduce sync primitives in async hot pathFrançois Laignel
- Moved UdpSrcPadHandlerState and related funtions to UdpSrcTask. - Moved Socket preparation in UdpSrcTask. No longer need for Context::enter.
2022-07-09ts/udpsink: reduce sync primitives in async hot pathFrançois Laignel
The way the runtime::Task is implemented, UdpSinkTask is available as a mutable ref in all the TaskImpl functions, which offers the opportunity to avoid using Mutexes. Main higlights: - Removed the back and forth calls between UdpSinkPadHandler and UdpSinkTask. - Udp sockets are now part of UdpSinkTask, which is also in charge of preparing them instead of leaving this to UdpSink. This removed the need for Context::enter since TaskImpl::prepare already operates under the target Context. - In order for the clients list to be visible from the UdpSink, this list was maintained by UdpSinkPadHandler which was also in charge of (un)configuring the Udp sockets. The sockets are now part of UdpSinkTask, which is also in charge of the (un)configuration. Add/remove/replace requests are passed as commands to the UdpSinkTask via a channel. - The clients list visible to the UdpSink is now part of the Settings (it is also a read/write property). Since the actual socket (un)configuration is asynchronously handled by the Task, the clients list is updated by the add/remove/replace signals and set_property("clients", ..). Should a problem occur during the async (un)configuration, and only in this case, the UdpSinkTask would update the clients lists in Settings accordingly so that it stays consistent with the internal state. - The function clear_clients was renamed as replace_with_clients. - clients is now based on a BTreeSet instead of a Vec. All the managing functions perform some sort of lookup prior to updating the collection. It also ease implementation. - Removed the UdpSinkPadHandler RwLock. Using flume channels, we are able to clone the Receiver so it can be stored in UdpSink and reused when preparing the UdpSinkTask.
2022-06-30fmp4mux: Handle PTS<segment.start when requesting keyframesSebastian Dröge
2022-06-30fmp4mux: Ensure that DTS (or PTS for intra-only streams) are monotonically ↵Sebastian Dröge
increasing
2022-06-30fmp4mux: Dequeue as many buffers as are available in each aggregate callSebastian Dröge
2022-06-30fmp4mux: Add debug output for each fragment's start PTSSebastian Dröge
2022-06-30fmp4mux: Fix draining if there are no GOPs for a streamSebastian Dröge
2022-06-30fmp4mux: Fix some clippy warningsSebastian Dröge
2022-06-30fmp4mux: Write header as late as possibleSebastian Dröge
Especially do it only after the initial fragment's information are all known.
2022-06-30fmp4mux: Refactor timestamp handling for writing out dataSebastian Dröge
Pass less data around and calculate the values we need to work with earlier.
2022-06-30fmp4mux: Write `tref` box for ONVIF timed metadata tracks to reference the ↵Sebastian Dröge
first video track
2022-06-30fmp4mux: Fix usage of first_sample_flags/default_sample_flagsSebastian Dröge
Previously first_sample_flags was never used so if the first sample was a keyframe and all others not then each sample got its own flags.
2022-06-30Fix/silence a couple new clippy warningsSebastian Dröge
2022-06-30ts/async_wrapper: remove fd from reactor before dropping its handleFrançois Laignel
The I/O handle was dropped prior to removing it from the reactor, which caused `Poller::delete` to fail due to an invalid file descriptor. This used to happen silently unless the same fd was added again, e.g. by changing states in the pipeline as follow: Null -> Playing -> Null -> Playing. In which case `Poller::add` failed due to an already existing file. This commit makes sure the fd is removed from the reactor prior to dropping the handle. In order to achieve this, a new task is spawned on the `Context` on which the I/O was originally registered, allowing it to access the proper `Reactor`. The I/O can then safely be dropped. Because the I/O handle is moved to the spawned future, this solution requires adding the `Send + 'static` bounds to the I/O handle used within the `Async` wrapper. This appears not too restrictive for existing implementations though. Other attempts were considered, but they would cause deadlocks. This new approach also solves a potential race condition where a fd could be re-registered in a `Reactor` before it was removed.
2022-06-30ts: add test pipeline::socket_play_null_playFrançois Laignel
2022-06-28Fix a couple of new 1.62 clippy warningsSebastian Dröge
2022-06-14sodium: Update to no-deprecated clap 3.2 APISebastian Dröge
See https://github.com/clap-rs/clap/issues/3822
2022-05-20fmp4mux: Use saturing_sub() in more placesSebastian Dröge
On unclean input, PTS/DTS might go backwards a bit and in those cases calculate a duration of 0 instead of panicking.
2022-05-20fmp4mux: Implement interleaving based on start timestamps instead of ↵Sebastian Dröge
accumulated durations Durations might accumulate rounding errors and streams might not actually start at the same time. For that reason also start with the stream that has the lowest timestamp.
2022-05-20fmp4mux: Implement handling of GAP eventsSebastian Dröge
2022-05-20fmp4mux: In live pipelines use the current fragment end time as timeoutSebastian Dröge
This allows muxing even if some streams are sparse or have big gaps.
2022-05-19fmp4mux: Add support for ONVIF timed XML metadataSebastian Dröge
2022-05-19fmp4mux: Add ONVIF variant with support for additional codecsSebastian Dröge
This variant supports H264/5, JPEG, alaw, mulaw and G726.
2022-05-19fmp4mux: Check for force-keyunit events on both pads in the multistream testSebastian Dröge
2022-05-13fmp4mux: Use saturing subtraction to calculate sample durationsSebastian Dröge
PTS/DTS might go backwards if the input is borderline broken but that shouldn't cause a panic.
2022-05-12fmp4mux: Add test for muxing of multiple streamsSebastian Dröge
2022-05-12fmp4mux: Add support for multiple input streamsSebastian Dröge
2022-05-12fmp4mux: Add support for writing out multiple tracks in the serialization codeSebastian Dröge
Not yet exposed from the element.
2022-05-12fmp4mux: Port to aggregator as base class as preparation for supporting ↵Sebastian Dröge
multiple streams
2022-05-12fmp4mux: Write sample flags in `tfhd` if there's only a single sampleSebastian Dröge
Instead of declaring them to be in the `tfhd` but not writing them into the `tfhd` but also not the `trun`.
2022-05-11ts-jitterbuffer: set jbuf delay when instantiating itMathieu Duponchelle
The internal (C) jitterbuffer needs to know about the configured latency when calculating a PTS, as it otherwise may consider that the packet is too late, trigger a resync and cause the element to discard the packet altogether. I could not identify when this was broken, but the net effect was that in the current state, ts-jitterbuffer was discarding up to half of all the incoming packets.
2022-05-08threadshare: Use `into_glib_ptr()` instead of `into_ptr()`Sebastian Dröge
2022-04-28fmp4mux: adding headers when data resumes after EOSJulien Vary
2022-04-27threadshare: fix build on WindowsTim-Philipp Müller