Commit graph

948 commits

Author SHA1 Message Date
Sebastian Dröge
577c980a6d threadshare/socket: Implement Drop on the non-refcounted inner part of the socket
We don't want to run it every time a strong reference is dropped but
only at the very end. Otherwise dropping the socket stream will cause a
panic because the socket itself is still running.
2020-04-08 15:39:35 +03:00
Sebastian Dröge
f6120fcf98 fallbackswitch: Switch from lazy_static to once_cell 2020-04-08 15:39:35 +03:00
Sebastian Dröge
cb7741919d tutorial/progressbin: Fix downcast type 2020-04-08 15:25:29 +03:00
Sebastian Dröge
4206b53c09 Mark GMutex mutex guards as #[must_use]
See gstreamer-rs commit b21f5764309f9f65666016a9069e1b938935e6f2
2020-04-08 15:24:07 +03:00
Sebastian Dröge
7173790da2 threadshare/udpsink: Return Flushing if the sender gets disconnected
This can only happen if the receiver is dropped, which only happens when
the task is stopped. As such, Flushing should be returned instead of
panicking.
2020-04-06 14:01:16 +03:00
Guillaume Desmottes
acbd3066e8 cdg: update image and cdg_renderer deps 2020-04-06 10:49:14 +02:00
Arun Raghavan
39245734f3 doc: Add some documentation of what plugins are there 2020-04-05 19:10:47 +00:00
Arun Raghavan
bc5d05f5e8 Update all documentation to point to the updated repository name
Just gst-plugin-rs -> gst-plugins-rs
2020-04-05 19:10:47 +00:00
Arun Raghavan
9c0416b56d Rename flv directory as flavors
Follows the same convention as all the other plugins.
2020-04-05 19:10:47 +00:00
Arun Raghavan
dc3c8fd049 Drop gst-plugin- prefix in plugin directory name 2020-04-05 19:10:47 +00:00
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
Sebastian Dröge
5d992692f0 fallbackswitch: Update for new from_glib_borrow signature
See https://github.com/gtk-rs/glib/pull/605
2020-04-05 21:53:38 +03:00
Sebastian Dröge
0e2635221d rav1e: Update to rav1e 0.3 2020-04-05 17:17:43 +03:00
Sebastian Dröge
ded03ee9a9 version-helper: Update version to 0.2.0 2020-04-03 20:20:50 +03:00
Guillaume Desmottes
2341f73106 version-helper: always assume we are in a release if not in git
No longer need to have a 'release.txt' file in tarballs.
2020-04-03 20:17:59 +03:00
Guillaume Desmottes
6607377496 version-helper: stop using git2
The crate pulls openssl-sys which is an annoying dep to build.

Fix #103
2020-04-03 20:17:59 +03:00
Guillaume Desmottes
0e42c6b9b1 version-helper: git: return the commit date as well 2020-04-03 20:17:59 +03:00
Guillaume Desmottes
bbdf90d67c version-helper: copy git.rs from gtk-rs/gir
Bare copy from https://github.com/gtk-rs/gir/blob/master/src/git.rs
2020-04-03 20:17:59 +03:00
Mathieu Duponchelle
9ec6a02e13 task: do not resume when resume_receiver is cancelled
This could cause the state to go back to Started after
stop() was called, resulting in a panic in a subsequent
unprepare.
2020-04-03 16:43:53 +02:00
Sebastian Dröge
a9b43da6cd threadshare/inputselector: Prepare/unprepare any existing sinkpads together with the source pad
We need to reset the sinkpad states when going from/to NULL state.
2020-04-03 17:04:50 +03:00
Sebastian Dröge
bbf800f17f Update for gstreamer bindings API changes 2020-04-02 20:29:18 +03:00
Sebastian Dröge
9cdf09d106 threadshare/udpsink: Unconfigure all clients that are removed on clear()
Fixes https://gitlab.freedesktop.org/gstreamer/gst-plugins-rs/-/issues/101
2020-04-02 19:42:00 +03:00
Sebastian Dröge
3f05e448d7 audioloudnorm: Allow more than 2 channels
There's no limitation of the number of channels in the code, so allow
more in the caps too.
2020-04-02 17:01:33 +03:00
Sebastian Dröge
ba7186aa6e audioloudnorm: Fix some outdated comments 2020-04-02 16:01:27 +03:00
Sebastian Dröge
65dc7cc0eb audioloudnorm: Add some more tests
This covers the limiter too now and various other code paths that were
previously not covered. No new bugs found.
2020-04-02 14:53:38 +03:00
Sebastian Dröge
6c4aadee4e csound: Use gst-plugin-version-helper from this repository by path 2020-04-02 13:35:25 +03:00
Sebastian Dröge
666ec7d54d audiofx: Add audioloudnorm filter based on the ffmpeg af_loudnorm filter
This normalizes the loudness of an audio stream to a target loudness
with a given maximum peak based on EBU R128.

Conceptually it keeps a 3s lookahead for calculating the perceived
loudness and based on that calculates the gain required to reach the
target loudness. The calculated gains then go through a gaussian filter
for smoothening and are then applied to the audio in 100ms blocks. Each
of the 100ms blocks is then passed to a limiter filter to prevent going
above the maximum peak.

See http://k.ylo.ph/2016/04/04/loudnorm.html for some more details about
the algorithm.

It introduces 3s of latency and currently only works on 192kHz audio.
Using it with a different sample rate requires resampling before and
afterwards. The upsampling is required to calculate the true peak.

Other than the ffmpeg filter it currently does not support two-pass
processing but only one-pass/live processing.

Compared to the ffmpeg filter this code was refactored considerably and
the limiter implementation was fixed to actually work, as well as
various other bugs in different places that were fixed.
2020-04-01 23:55:48 +03:00
Guillaume Desmottes
4bfd1f76f3 threadshare: fix GstClockTime formatting
GstClockTime is a guint64 whose format is platform dependent.
2020-04-01 15:02:54 +02:00
Brian Gonzalez
e0695b637f Fall back to default unknown COMMIT_ID and BUILD_REL_DATE if unable to find commit in repo 2020-03-29 20:54:56 -04:00
Natanael Mojica
888f98e2f0 use the latest release of csound-rs bindings 2020-03-28 11:33:34 +00:00
François Laignel
20a9eba4c8 threadshare: separate Task from PadSrc 2020-03-27 19:57:39 +01:00
François Laignel
89682aa6a8 threadshare/jitterbuffer: fix a race condition when stopping
Don't hold the `state` while stopping as the task might attempt to
lock it before reaching an `await` point.
2020-03-27 19:35:25 +01:00
Sebastian Dröge
bb6ec76951 Fix/silence some clippy warnings 2020-03-26 10:59:43 +02:00
Mathieu Duponchelle
800d3435eb closedcaption: implement tttocea608 element 2020-03-24 21:24:03 +01:00
Natanael Mojica
cf59318ab4 Add csound-based filter plugin 2020-03-22 13:44:40 +02: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
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