Commit graph

812 commits

Author SHA1 Message Date
Mathieu Duponchelle
3c82f7d82e sccparse: fix timestamps
There is no reason to have the buffers' PTS start at 0
2020-03-21 01:26:41 +01:00
Mathieu Duponchelle
f271ac8f75 cea608tott: port to updated libcaption API 2020-03-21 01:26:28 +01:00
Mathieu Duponchelle
96cfcff4cf caption_frame_decode: rework API
* pop_on mode requires incrementing the frame timestamp until
  end_of_caption is encountered.

* caption_frame_decode now always updates the timestamp of the
  frame when the timestamp parameter != -1. This requires that callers
  only pass a valid timestamp when a new one is encountered, for
  example with SCC the timestamp at the start of the cue, then -1
  until the next new timestamp.

* A new enum member is added for the return value, LIBCAPTION_CLEAR.
  It allows the caller to determine that closed captions should not
  be displayed anymore, in order to finish the previous cue earlier
  than the start of the next cue.
2020-03-20 22:50:13 +01:00
Sebastian Dröge
09f332f31f reqwest: Don't use deprecated Error::description() anymore 2020-03-19 13:24:10 +02:00
Sebastian Dröge
5dd80e0706 Fix/silence various new clippy warnings 2020-03-19 12:55:29 +02:00
Sebastian Dröge
cd2957679d Don't include gst-ci template
It disables all our other tests apparently.
2020-03-19 11:43:13 +02:00
Sebastian Dröge
dcf2befe52 threadshare/inputselector: Send a reconfigure event when the active pad changes 2020-03-19 11:37:27 +02:00
Sebastian Dröge
4c0ba5c374 threadshare/inputselector: Query all sinkpads for their latency and post latency messages when the pads change 2020-03-19 11:37:27 +02:00
Mathieu Duponchelle
c01ef0e774 threadshare/inputselector: port to new API 2020-03-19 11:37:27 +02:00
Sebastian Dröge
ad4597a40e threadshare/inputselector: Set DISCONT flag on first buffer after each pad switch 2020-03-19 11:37:25 +02:00
Sebastian Dröge
625798c5db threadshare/inputselector: Fix sticky event handling
Whenever a new sticky event arrives we must make sure to forward it
downstream before the next buffer.

Also make sure to unlock all our mutexes when they're not needed
anymore.
2020-03-19 11:37:22 +02:00
Sebastian Dröge
6c4108671f threadshare/inputselector: Implement a correct chain_list() function
Instead of directly forwarding the list, handle each buffer separately
for now. Previously we would directly forward the lists from any pad,
including inactive ones, downstream.
2020-03-19 11:37:18 +02:00
Mathieu Duponchelle
0b240b829e threadshare/inputselector: fix tearing down
GstElementClass.release_pad() may be called after the element
has transitioned back to NULL, we need to keep our sink_pads
map around until then.

They should also not be affected by state transitions at all but only be
removed once the user does so or the element is destroyed, so they need
to live independent of the state.
2020-03-19 11:20:24 +02:00
Sebastian Dröge
575efcab7e threadshare/inputselector: Port to latest API 2020-03-19 11:20:24 +02:00
Mathieu Duponchelle
b3becb01c3 threadshare: New input selector element 2020-03-19 11:20:24 +02:00
Sebastian Dröge
cbfd80d75f Update for new GLib boxed deriving API 2020-03-19 11:18:17 +02:00
Sebastian Dröge
56895f35bc threadshare/runtime: Add a dummy context when blocking the current thread
This allows downstreams to function as if a normal context thread is
operating upstream apart from not being able to spawn new tasks.

Fixes https://gitlab.freedesktop.org/gstreamer/gst-plugins-rs/issues/96
2020-03-16 15:19:39 +02:00
Sebastian Dröge
12dcca3f17 threadshare/runtime: Drain pending sub tasks in a loop
A pending sub task might add new pending sub tasks that have to be
handled first.
2020-03-16 15:02:30 +02:00
Sebastian Dröge
fa7cc9826d appsrc: Don't make pushing of buffers/eos asynchronous
We can directly use try_send(), which has the same effect.
2020-03-16 15:01:06 +02:00
Sebastian Dröge
d2ad227a2f threadshare/udpsink: Some more refactoring
Let's take locks less often.
2020-03-16 12:42:33 +02:00
Sebastian Dröge
85cbbf5240 threadshare/udpsink: Properly remove clients
Leave any multicast groups they might have joined.
2020-03-16 12:33:18 +02:00
Sebastian Dröge
ac574cd112 threadshare/udpsink: Minor cleanup / optimizations for client addition 2020-03-16 12:31:41 +02:00
Sebastian Dröge
9ddcae4ed2 threadshare: Fix some clippy warnings 2020-03-15 13:40:45 +02:00
François Laignel
bfedca6cfe threadshare/proxy: Port proxysrc/sink to new API 2020-03-15 13:18:02 +02:00
Mathieu Duponchelle
5f9e923a04 threadshare/jitterbuffer: Avoid buffer copies
Replaces the RTPJitterBufferItem.get_buffer() method with an
into_buffer() version, ensuring that when we make it mutable we
don't make a copy (unless necessary)
2020-03-15 13:18:02 +02:00
Sebastian Dröge
776708bee6 threadshare/jitterbuffer: Port jitterbuffer to new API and completely refactor 2020-03-15 13:17:59 +02:00
François Laignel
95b2641056 threadshare/queue: Port queue to the new API 2020-03-15 13:17:26 +02:00
Sebastian Dröge
ded3af31c1 threadshare/tcpclientsrc: Port tcpclientsrc to new API 2020-03-15 13:17:26 +02:00
Mathieu Duponchelle
5f5f0fe866 threadshare/udpsink: Port udpsink to new API 2020-03-15 13:17:26 +02:00
François Laignel
d9cd48287e threadshare/appsrc: Port appsrc to new API 2020-03-15 13:17:26 +02:00
Sebastian Dröge
f5eb91ebe2 threadshare/udpsrc: Port udpsrc to new API 2020-03-15 13:17:26 +02:00
François Laignel
4c584fd162 threadshare: Pad{Src,Sink}::unprepare: release all functions 2020-03-15 13:17:26 +02:00
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
3ea465907d threadshare: Disable all elements for now 2020-03-15 13:17:26 +02:00
Mathieu Duponchelle
03fda100d4 threadshare/udpsink: pass correct defaults to v6 bind properties 2020-03-15 12:38:20 +02:00
Mathieu Duponchelle
bcbf862ded threadshare/udpsink: don't error out when socket can't be prepared for protocol
Instead, error out at chain time if a client with the unavailable
protocol (eg IPv6) has been added.
2020-03-15 12:38:20 +02:00
Sebastian Dröge
b8f8705c47 threadshare/udpsink: Add Element::send_event() impl and handle latency event
We need to add the latency to the running time we're waiting for, and
also should push all upstream events (apart from Step events) upstream.
2020-03-15 12:38:20 +02:00
Sebastian Dröge
160ae4d11c threadshare/udpsink: Port to latest API 2020-03-15 12:38:20 +02:00
Mathieu Duponchelle
382b9f118c threadshare: Initial version of a UDP sink 2020-03-15 12:38:20 +02:00
Sebastian Dröge
4c27d560a9 closedcaption: Add libcaption based CEA-608 to SRT/WebVTT converter 2020-03-07 11:20:19 +02:00
Sebastian Dröge
9202e8fddd tutorial: Update for Caps API changes 2020-03-07 00:56:35 +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
Mathieu Duponchelle
9e665ae807 ts-jitterbuffer: fix request-pt-map emission
When a new payload type is encountered, we first check whether
it matches the caps received as an event before emitting the
request-pt-map signal if not, which means we shouldn't consider
errors from the first call to parse_caps as fatal.
2020-03-04 17:30:01 +01:00
Sebastian Dröge
e5e29b18d1 threadshare/rtpjitterbuffer: Use different GType names than used by the C rtpjitterbuffer
Otherwise there are conflicts when using them both in the same process.
2020-03-04 15:08:59 +00:00
Mathieu Duponchelle
1bfa20a656 ts-jitterbuffer: reset on unprepare
.. and reset earliest_pts in reset()
2020-03-04 15:13:41 +01:00
François Laignel
c60c6f0dc6 ts: use tag tokio-0.2.12-throttling 2020-02-28 16:05:48 +01:00
Stéphane Cerveau
1c7f9041e0 meson: update cargo to minimum 1.40 2020-02-25 13:44:46 +01:00
Markus Ebner
750b29b76c gif: Add initial implementation of a gif encoder
- Implemented a simple gif encoder based on the rust crate "gif".
- Currently supported input pixel formats are RGB and RGBA
- The encoder dynamically changes frame delays to approximate the actual
  input framerate
- For the moment, each frame uses its own local colorpalette, leading to
  good image quality, but big files
- Every frame is currently a full frame. No incremental frames for now
- The produced GIF is currently compressed (LZW)
2020-02-25 08:45:22 +00:00
Sebastian Dröge
4dac77bb93 Fix some clippy warnings 2020-02-25 10:12:55 +02:00