Commit graph

44 commits

Author SHA1 Message Date
Arun Raghavan
205b6040fb Reorganise plugins into directories by function
This should start making navigating the tree a little easier to start
with, and we can then move to allowing building specific groups of
plugins as well.

The plugins are moved into the following hierarchy:

  audio
    / gst-plugin-audiofx
    / gst-plugin-claxon
    / gst-plugin-csound
    / gst-plugin-lewton
  generic
    / gst-plugin-file
    / gst-plugin-sodium
    / gst-plugin-threadshare
  net
    / gst-plugin-reqwest
    / gst-plugin-rusoto
  utils
    / gst-plugin-fallbackswitch
    / gst-plugin-togglerecord
  video
    / gst-plugin-cdg
    / gst-plugin-closedcaption
    / gst-plugin-dav1d
    / gst-plugin-flv
    / gst-plugin-gif
    / gst-plugin-rav1e

  gst-plugin-tutorial
  gst-plugin-version-helper
2020-04-05 19:10:46 +00:00
François Laignel
20a9eba4c8 threadshare: separate Task from PadSrc 2020-03-27 19:57:39 +01:00
François Laignel
116cf9bd3c threadshare/*src: rework pause/flush_start/flush_stop
This commit fixes several issues with the `Ts*Src` elements.

The pause functions used cancel_task which breaks the Task loop at await
points. For some elements, this implies making sure no item is being lost.
Moreover, cancelling the Task also cancels downstream processing, which
makes it difficult to ensure elements can handle all cases.

This commit reimplements Task::pause which allows completing the running
loop iteration before pausing the loop.

See https://gitlab.freedesktop.org/gstreamer/gst-plugins-rs/-/merge_requests/277#note_439529

In the Paused state, incoming items were rejected by TsAppSrc and DataQueue.

See https://gitlab.freedesktop.org/gstreamer/gst-plugins-rs/-/merge_requests/277#note_438455

- FlushStart must engage items rejection and cancel the Task.
- FlushStop must purge the internal stream & accept items again.

If the task was cancelled, `push_prelude` could set `need_initial_events`
to `true` when the events weren't actually pushed yet.

TsAppSrc used to renew its internal channel which could cause Buffer loss
when transitionning Playing -> Paused -> Playing.

See https://gitlab.freedesktop.org/gstreamer/gst-plugins-rs/issues/98
2020-03-21 18:46:03 +00: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
François Laignel
d9cd48287e threadshare/appsrc: Port appsrc to new API 2020-03-15 13:17:26 +02:00
Sebastian Dröge
1e778e9827 Update for Seqnum/GroupId API changes 2020-01-25 01:21:22 +02: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
François Laignel
a15d60105b ts: fix FlushStart / FlushStop events handling 2020-01-16 00:44:45 +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
1ae57967ae Move debug categories from an instance member to lazy_static
Simplifies the code a bit and less state to carry around.
2019-10-31 23:35:11 +01:00
François Laignel
0e11ac87d3 Update for new {Value, StructureRef}::get signature
See https://github.com/gtk-rs/glib/pull/513
and https://gitlab.freedesktop.org/gstreamer/gstreamer-rs/merge_requests/310
2019-08-13 15:29:28 +02:00
Sebastian Dröge
b4efa42d8f Fix various clippy warnings 2019-07-04 18:56:33 +03: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
Guillaume Desmottes
53e530f7db port all plugins to new register API
Rank is now an enum rather than a u32
2019-06-04 14:35:10 +05:30
Sebastian Dröge
2fc89ced15 Fix various compiler warnings 2019-05-28 04:43:54 +02:00
Sebastian Dröge
9bccc50add Update for gstreamer-rs API changes 2019-05-24 13:09:32 +02:00
Sebastian Dröge
129f6a28b0 Update for gstreamer-rs/glib/etc API changes and add more explicit Some() 2019-04-16 10:10:16 +03:00
Sebastian Dröge
aa325ea98d Fix various clippy warnings 2019-02-21 20:12:09 +02:00
Sebastian Dröge
6286e496ba Fix build with GLib and GTK changes 2019-02-07 09:54:03 +02:00
Sebastian Dröge
9db02cb55e Fixes for gstreamer-rs API changes
Creating pad templates can return None now.
2019-01-29 17:33:06 +02: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
f374d7fedf Remove unneeded ObjectSubclass::new() functions where not needed 2018-12-19 13:23:02 +02:00
Sebastian Dröge
fb741f26f3 Update for glib property API changes 2018-12-18 11:23:45 +02:00
Sebastian Dröge
0792fe4f1a ts-appsrc: Fix deadlock during shutdown
The IO Context has to be alive longer than the other parts
of the state. Otherwise a deadlock can happen between shutting down
the IO context (thread join while the state lock is held) and stuff
happening on the IO context (which might take the state lock).
2018-12-13 17:13:40 +02:00
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
3a8ce35e60 threadshare: Revert "Push io-context sharing event before stream-start and anything else"
This reverts commit 083948e8ea1471f1d8a013a225200729cfcef2a9.

This has no effect because core is reordering events to have
stream-start and others always first.
2018-11-05 13:36:47 +02:00
Sebastian Dröge
135ec5ee7d threadshare: Push io-context sharing event before stream-start and anything else 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
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
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
96bc778f72 threadshare: Add code for canceling pending futures 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
82ab78fa3d threadshare: Minor appsrc refactoring 2018-11-05 13:36:20 +02:00
Sebastian Dröge
d52f1d49dd threadshare: Add a sample appsrc-like element plus test 2018-11-05 13:36:20 +02:00