Commit graph

2977 commits

Author SHA1 Message Date
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
Sebastian Dröge
d58cdc41b7 Require Rust 1.40 for the CI
At least one dependency of one plugin uses 1.40 features now.
2020-02-25 10:10:13 +02:00
Mathieu Duponchelle
49f73fbf61 proxy: fix items mistakenly discarded
When emptying the pending queue, we need to break as soon as
as we failed to push an item to the data queue, otherwise only
the last failed item is pushed back to the front of the pending
queue, and all the previously failed items in the loop get
discarded
2020-02-05 21:35:12 +01:00
Mathieu Duponchelle
bcae2423f5 proxy: signal the pending queue in ProxySrc.start()
If the proxy sink has already queued buffers in the shared
context pending queue and is waiting for space in the data
queue, we should signal that space is available when creating
it!
2020-02-05 21:35:12 +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
Mathieu Duponchelle
4abb389269 socket based sources: close socket stream on unprepare
the socket was otherwise leaked
2020-02-04 20:09:27 +01:00
Alfonso Rodríguez Pereira
9d4e427e14
Merge pull request #47 from sdroege/device-provider
Add device provider
2020-01-31 10:09:25 +01:00
Alfonso Rodríguez Pereira
21d7298843
Merge pull request #46 from sdroege/ndi-sdk-4
Port to NDI SDK v4
2020-01-31 10:08:56 +01:00
Guillaume Desmottes
90cb42fdf9 meson: check for openssl on not Windows/Mac platforms 2020-01-30 10:57:00 +00:00
Guillaume Desmottes
1b84dd1f6b meson: add sodium option
Allow us to pick between the built-in libsodium, use the one from the
system or disable the plugin.
2020-01-30 10:57:00 +00:00
Sebastian Dröge
a43ad8f2dd lewton: Don't copy decoded samples if no channel reordering is needed 2020-01-30 09:02:55 +00:00
Guillaume Desmottes
87f2c3b025 lewton: update to lewton 0.10
New version of the crate has just been released.
2020-01-30 13:53:36 +05:30
Sebastian Dröge
c25a3e13e3 tutorial: Port to once_cell::Lazy 2020-01-26 08:38:10 +00:00
Sebastian Dröge
1e778e9827 Update for Seqnum/GroupId API changes 2020-01-25 01:21:22 +02:00
François Laignel
e2add3f2c8 ts-jitterbuffer: add dedicated functions for state transitions + tests
fixes https://gitlab.freedesktop.org/gstreamer/gst-plugins-rs/issues/95
2020-01-23 19:10:21 +01:00
Mathieu Duponchelle
c50aa09034 threadshare: fix latency query handlers
Returning 0 as the max latency in those sources is incorrect,
and may lead to sinks incorrectly complaining about insufficient
buffering elements.

Reproduce with:

gst-launch-1.0 ts-udpsrc port=50000 address=127.0.0.1 \
  caps="application/x-rtp, media=(string)audio, clock-rate=(int)8000, encoding-name=(string)PCMA, payload=(int)8" ! \
  rtppcmadepay ! alawdec ! autoaudiosink

gst-launch-1.0 audiotestsrc do-timestamp=true samplesperbuffer=400 ! \
  alawenc ! rtppcmapay max-ptime=50000000 min-ptime=50000000 ! \
  udpsink host=127.0.0.1 port=50000

Logs:

Not enough buffering available for  the processing deadline of 0:00:00.020000000,
add enough queues to buffer  0:00:00.020000000 additional data.
Shortening processing latency to 0:00:00.000000000.

This then causes glitches, there are many other ways for the problems
to manifest.
2020-01-23 15:36:22 +00:00
Mathieu Duponchelle
decc1e2029 threadshare: make live sources return NoPreroll from PlayingToPaused
Not returning NoPreroll in that transition causes downstream sinks
to wait for preroll forever.

Reproduce with:

gst-launch-1.0 audiotestsrc ! udpsink host=127.0.0.1 port=50000
gst-launch-1.0 ts-udpsrc address=127.0.0.1 port=50000 ! fakesink

ctrl + C in the receiver pipeline -> hangs forever
2020-01-23 15:56:11 +01:00
Sebastian Dröge
92941d7f92 closedcaption: Fix compilation after buffer copy flags were changed to a constant 2020-01-23 08:21:32 +02:00
François Laignel
d1cc8eaec8 ts: don't panic when operating on a Context without a valid PadContext
Fixes https://gitlab.freedesktop.org/gstreamer/gst-plugins-rs/issues/94
2020-01-22 06:16:17 +00:00
Mathieu Duponchelle
0aa5b15564 jitterbuffer: return NoPreroll when going from READY to PAUSED
This is useful when upstream is not a live source

Fixes potential issue discussed in:

https://gitlab.freedesktop.org/gstreamer/gst-plugins-rs/issues/93#note_388528
2020-01-21 22:14:33 +01:00
Mathieu Duponchelle
1823ca525e jitterbuffer: don't try to lock in query handlers
Instead, add position and latency fields to the PadSrcHandler

Fixes #93
2020-01-21 22:14:06 +01:00
Sebastian Dröge
4d620cd737 Allow connecting to either an NDI name or URL/address again
Apparently the SDK allows both but the documentation was a bit
confusing.
2020-01-20 22:01:33 +02:00
Sebastian Dröge
8d2c025e47 Allow creating source elements from the device provider and don't do discovery during element setup anymore
While making it possible to create elements from the device provider,
this also speeds up the connection generally when starting up the
elements.

Also add the url-address property for additional filtering in addition
to the NDI name.
2020-01-20 22:01:33 +02:00
Sebastian Dröge
f2a4699d13 Add a device provider for listing available sources
Fixes https://github.com/teltek/gst-plugin-ndi/issues/36
2020-01-20 22:01:33 +02:00
Sebastian Dröge
5047ed480d claxondec: Fix/silence a few clippy warnings 2020-01-20 08:13:43 +02:00
Sebastian Dröge
1ad4e39cc9 meson: Add claxon plugin 2020-01-20 08:01:14 +02:00
Ruben Gonzalez
7d3ab342d2 Add claxon based FLAC decoder.
Audio decoder element structure is based in `gst-plugin-lewton` (a lewton based Vorbis decoder created by @slomo)

The element assumes correctly parsed input from `flacparse`.

Implementation details:

* Claxon returned frames does not contain audio channels interleaved, the reorganization of the channels is done by the element.
* Claxon output buffers are always Vec<i32>, mapping to the correct type (depending on the audio format) is also done by the element.

Mono s16 and stereo_s32 test are provided.

Complete pipelines to test are:

```
gst-launch-1.0  -v souphttpsrc location=https://archive.org/download/MLKDream/MLKDream.flac ! queue2 !  flacparse ! flacdec ! audioconvert ! autoaudiosink
gst-launch-1.0  -v audiotestsrc ! audio/x-raw, format=S16LE, layout=interleaved, rate=44100, channels=1 ! audioconvert ! flacenc ! flacparse ! claxondec ! autoaudiosink
```

Fixes #71
2020-01-19 16:01:23 +00:00
Sebastian Dröge
b84831c94f reqwesthttpsrc: Switch back to hyperx
It was updated to the new versions of its dependencies and provides
typed header types for more of the headers that we're using.
2020-01-18 10:51:25 +00:00
François Laignel
676ae87aed ts: queue & proxy: spawn on src_pad in PadSinkHandlers...
... instead of copying the src_pad's Context
2020-01-17 15:37:54 +01:00