Commit graph

17 commits

Author SHA1 Message Date
Sebastian Dröge
33cb599464 threadshare/iocontext: Add custom interval timer implementation
This knows about our throttled event loop and ensures that timers are
triggered at most 1 throttle time later instead of 2.
2019-09-06 14:33:39 +00:00
Sebastian Dröge
50037325ff Explicitly add dyn keyword to trait objects
Trait objects without are deprecated with the latest nightly and this
makes it more clear that we're doing dynamic dispatch anyway.
2019-06-06 09:26:02 +03:00
Sebastian Dröge
9bccc50add Update for gstreamer-rs API changes 2019-05-24 13:09:32 +02:00
Sebastian Dröge
f5b88d37c5 threadshare: Don't drift slowly when throttling the main context
Instead of taking a new time every iteration, take it once in the
beginning and add our wait time on every iteration. This prevents
accumulating errors and slowly drifting.
2019-04-15 18:43:01 +03: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
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
987f78de42 threadshare: Move to tokio_threadpool and tokio_current_thread crates 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
da8390ef7b threadshare: Update for tokio API changes 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
099093e9be threadshare: Refactor pending future draining to get rid of some duplicated code 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
82cc63551c threadshare: Don't set a fallback reactor
This should not be needed and fails if we have multiple contexts
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
21f905739f threadshare: Implement error handling 2018-11-05 13:36:20 +02:00
Sebastian Dröge
e269e51524 threadshare: Refactor 2018-11-05 13:36:20 +02:00