Commit graph

45 commits

Author SHA1 Message Date
Sebastian Dröge
e729324cce threadshare: Refactor infrastructure
The biggest changes are
- Many functions are not asynchronous anymore as it would be difficult
  to run them correctly with our mix of synchronous C code and Rust
  code.
- The pad context and its corresponding custom event are gone and
  instead thread local storage and task local storage are used. This
  makes it easier to correctly pass it through the different layers
  of Rust and C code and back.
- Sink events have a different function for serialized and oob events,
  src events are handled correctly by default now by simply forwarding
  them.
- Task::prepare() has a separate variant that takes a preparation
  function as this is a very common task.
- The task loop function can signal via its return value if it wants to
  be called again or not.
2020-03-15 13:17:26 +02:00
Sebastian Dröge
af56755aaa Revert "threadshare: Temporarily pin quote to 1.0.2"
This reverts commit 90b9499909.

It was fixed in the meantime.
2020-03-06 11:16:37 +02:00
Philippe Normand
90b9499909 threadshare: Temporarily pin quote to 1.0.2
See https://github.com/rust-lang-nursery/failure/issues/342

https://gitlab.freedesktop.org/gstreamer/gst-build/issues/83
2020-03-05 13:10:52 +00:00
François Laignel
c60c6f0dc6 ts: use tag tokio-0.2.12-throttling 2020-02-28 16:05:48 +01:00
Mathieu Duponchelle
53e948b8da proxy: fix blocking upwards state change
ProxySink previously blocked on receiving the source pad
of ProxySrc in its ReadyToPaused transition, which meant
ProxySrc had to transition to Ready at the same time.

The usual use case is for the source and sink to reside in
two separate pipelines, and such an arrangement easily led
to deadlocks, as examplified by the new test case.

Instead we now maintain two more global hash maps holding
per-context sink pads and src pads weak references, and
forward events to those when needed.

As ProxySink may not have a source pad context to run
a future on when receiving FlushStart, gst::Element::call_async
is used instead, with a simple oneshot channel used to synchronize
flush start and flush stop handling.
2020-02-05 21:35:11 +01:00
François Laignel
3eed2f69d9 ts: have block_on panic if running on a Context thread 2020-01-16 00:18:16 +01:00
François Laignel
0221524a10 Update to tokio release 0.2.5 + throttling 2019-12-21 08:56:43 +01:00
François Laignel
e8f5191ee7 ts: Pad wrapper for async processing
See https://gitlab.freedesktop.org/gstreamer/gst-plugins-rs/merge_requests/170#note_276334
and https://gitlab.freedesktop.org/gstreamer/gst-plugins-rs/merge_requests/204
2019-12-21 08:56:43 +01:00
François Laignel
8eec141517 threadsharing: migrate to async/await and tokio 0.2.0-alpha.6
See https://gitlab.freedesktop.org/gstreamer/gst-plugins-rs/merge_requests/164
2019-12-19 20:44:00 +01:00
Sebastian Dröge
b05fb902f9 Remove usage of subclassing feature, it's the default now 2019-09-09 10:45:06 +03:00
Mathieu Duponchelle
b7e55836c1 WIP: thread-sharing jitterbuffer
Actual thread-sharing will follow!
2019-09-06 14:33:39 +00:00
Sebastian Dröge
acc4b6a7e2 Update versions to 0.6.0 2019-07-07 13:20:15 +03:00
Sebastian Dröge
11bd909bf1 Update rand to 0.7 and rusoto to 0.40 2019-07-02 18:16:23 +03:00
ahamedsajeer.15
dc45b7f8ac Add build.rs that provides a version number, release date and other details 2019-06-03 11:11:29 +00:00
Abdul Rehman
2f3139dea2 ts-udpsrc: Add retrieve-sender-address property
Fixes #41
2019-03-13 21:07:53 +05:00
François Laignel
e930133bdf Update for gstreamer-rs MR 200
See https://gitlab.freedesktop.org/gstreamer/gstreamer-rs/merge_requests/200
2019-01-12 18:00:04 +01:00
Sebastian Dröge
04955f61d7 Update to reqwest 0.9, rand 0.6 and parking_lot 0.7 2018-12-19 14:32:03 +02:00
Sebastian Dröge
e64a9b4a1a Port threadshare plugin to new subclassing API 2018-12-06 13:03:04 +02:00
Sebastian Dröge
9750195caa ts-udpsrc: Dup the socket so that both tokio and GIO can take ownership of it
Otherwise both would be closing the same socket, which a) breaks the
second user of the socket if any and b) could on the second close cause
a completely unrelated socket to be closed.

Windows part of the code is untested.
2018-11-30 19:39:39 +02:00
Sebastian Dröge
40426a2cf6 Use new boxed type support from the GLib bindings 2018-11-29 21:01:02 +02:00
Sebastian Dröge
941b83a1d6 ts-udpsrc: Rewrite unit test around gst_check::Harness 2018-11-13 18:50:54 +02:00
Sebastian Dröge
ab08cbd412 ts-udpsrc: Implement socket and used-socket properties like in udpsrc 2018-11-13 14:13:23 +02:00
Sebastian Dröge
4fb18382c2 threadshare: register plugin static in integration test
After a `cargo clean` the shared library is not yet present if the test is started with `cargo test`.
2018-11-05 13:47:34 +02:00
Sebastian Dröge
20bec35c68 Merge gst-plugin-threadshare into gst-plugin-rs 2018-11-05 13:40:43 +02:00
Sebastian Dröge
132986cf71 threadshare: Fix deprecation warnings and move to released versions of tokio 2018-11-05 13:36:47 +02:00
Sebastian Dröge
4e8c6fd293 threadshare: Change gobject-subclass repository URI 2018-11-05 13:36:47 +02:00
Sebastian Dröge
55f9b84008 threadshare: Drop support for multi-threaded runtime as it is consistently slower
And switch to the new built-in spawning support of CurrentThread
2018-11-05 13:36:47 +02:00
LEE Dongjun
20149c7293 threadshare: Rename udpsrc_benchmark.rs to benchmark.rs. 2018-11-05 13:36:47 +02:00
LEE Dongjun
6827b9509e threadshare: Add TcpClient elements and unit test. 2018-11-05 13:36:47 +02:00
Sebastian Dröge
987f78de42 threadshare: Move to tokio_threadpool and tokio_current_thread crates 2018-11-05 13:36:47 +02:00
Sebastian Dröge
23b25b210b threadshare: Update to rand 0.5 2018-11-05 13:36:47 +02:00
Sebastian Dröge
9adf663073 threadshare: Add property to udpsrc for allowing port/address reuse 2018-11-05 13:36:47 +02:00
Sebastian Dröge
be0403ce24 threadshare: Switch to gobject-subclass 2018-11-05 13:36:47 +02:00
Sebastian Dröge
8f9a42f486 threadshare: Switch back to main tokio now that the CurrentThread PR is merged 2018-11-05 13:36:47 +02:00
Sebastian Dröge
2dfca38977 threadshare: Turn the single-threaded executor until no futures are left to be run before waiting
Otherwise in e.g. a pipeline like
  ts-udpsrc ! ts-queue ! fakesink
the first turn would only get a packet and queue it up, then we would
wait due to throttling and only then we would forward the packet from
the queue (but not poll the socket again), wait again due to throttling
and only then poll and get the next packet.

See https://github.com/tokio-rs/tokio/issues/310
2018-11-05 13:36:47 +02:00
Sebastian Dröge
b56e1a9873 threadshare: Update udpsrc benchmark a bit 2018-11-05 13:36:47 +02:00
Sebastian Dröge
7939f95861 threadshare: Add very simple udpsrc/tonesrc benchmark application 2018-11-05 13:36:47 +02:00
Sebastian Dröge
30b2df753c threadshare: Set element flags correctly for sources and sinks
And let proxysink post EOS events
2018-11-05 13:36:20 +02:00
Sebastian Dröge
ab22d81f12 threadshare: Integrate new tokio-timer into the IOContext 2018-11-05 13:36:20 +02:00
Sebastian Dröge
7cd2945268 threadshare: Implement error handling for IO/data flow errors
Also create a proper stream id
2018-11-05 13:36:20 +02:00
Sebastian Dröge
e269e51524 threadshare: Refactor 2018-11-05 13:36:20 +02:00
Sebastian Dröge
6aa9f642ba threadshare: Allow running completely single-threaded 2018-11-05 13:36:20 +02:00
Sebastian Dröge
b939607693 threadshare: Stop using reactor::Background and implement it ourselves for now 2018-11-05 13:36:20 +02:00
Sebastian Dröge
0fe6fbc859 threadshare: Initial working version 2018-11-05 13:36:20 +02:00
Sebastian Dröge
1593c06595 threadshare: Initial commit 2018-11-05 13:36:20 +02:00