Commit graph

19 commits

Author SHA1 Message Date
Sebastian Dröge e64a9b4a1a Port threadshare plugin to new subclassing API 2018-12-06 13:03:04 +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 73a7be5ef5 Run gst-plugin-threadshare through cargo fmt 2018-11-05 13:43:38 +02:00
Sebastian Dröge 6c32b702f0 Fix build with gst-plugin-rs API changes 2018-11-05 13:43:11 +02:00
Sebastian Dröge fbc0a04cff threadshare: Run everything through rustfmt again 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
Sebastian Dröge c5d901609f threadshare: Try pushing pending items immediately if we did not schedule a future for it yet
It might not be necessary to first go through a future, we might
directly be able to push them now.
2018-11-05 13:36:47 +02:00
Sebastian Dröge 7ac9534322 threadshare: Don't drain the queue when trying to push pending items
Otherwise we'll have to collect all failed items and push them back.
Instead pop items one by one, and if one fails just push that single
item back to the front.

The previous code would've lost all items after the first one that
failed
2018-11-05 13:36:47 +02:00
Sebastian Dröge 51aa06d013 threadshare: Schedule the pending queue in queue/proxysink only on EOS or the first buffer/buffer list
We will get the custom sticky downstream event with the IO context only
after stream-start and others, so would potentially block the current
thread from another futures executor, which then panics. Instead let's
just queue up those events for the time being until a later time.
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 099093e9be threadshare: Refactor pending future draining to get rid of some duplicated code 2018-11-05 13:36:20 +02:00
Sebastian Dröge a9d979a988 threadshare: Use catch_panic_pad_function from gst-plugin crate 2018-11-05 13:36:20 +02:00
Sebastian Dröge 88933790e7 threadshare: Add FIXME comment for refactoring opportunities 2018-11-05 13:36:20 +02:00
Sebastian Dröge f5b3e9481f threadshare: Run everything through rustfmt 2018-11-05 13:36:20 +02:00
Sebastian Dröge 6ebc8988b2 threadshare: Make sure to shutdown sockets/queues without any mutexes locked
And make sure that the IOContext stays alive until they are fully done.
2018-11-05 13:36:20 +02:00
Sebastian Dröge c26299277e threadshare: Move DataQueue to its own module 2018-11-05 13:36:20 +02:00
Sebastian Dröge 811893ccf9 threadshare: Only take the current queue levels into account instead of the future ones
Otherwise we might never ever enqueue a single buffer if it is already
by itself going over the limits.
2018-11-05 13:36:20 +02:00
Sebastian Dröge e03c27814b threadshare: Implement pending futures that could be scheduled downstream as result of a push
This is used by the queue to schedule putting data into the queue once
it has space again.

Also implement blocking-wait in the queue on the sinkpad if there is no
IOContext upstream and generally clean up various things.
2018-11-05 13:36:20 +02:00
Sebastian Dröge 1e26ca6365 threadshare: Add a first version of a queue 2018-11-05 13:36:20 +02:00