Commit graph

421 commits

Author SHA1 Message Date
Sebastian Dröge
7b81945ca1 dav1ddec: Use AtomicRefCell instead of Mutex for the state
It's only accessed from the streaming thread.
2022-02-14 14:43:54 +02:00
Sebastian Dröge
03787ef857 rav1eenc: Use AtomicRefCell instead of Mutex for the state
It's only accessed from the streaming thread.
2022-02-14 14:36:50 +02:00
Sebastian Dröge
93bfa4d37a rav1enc: Put container sequence header into the caps 2022-02-08 12:18:48 +02:00
Sebastian Dröge
22ae31bfcb dav1ddec: Switch to dav1d 0.7 2022-02-07 16:06:03 +02:00
Sebastian Dröge
1b8ee90f83 rav1enc: Don't handle NeedMoreData as "soft" error 2022-02-07 07:30:57 +00:00
Sebastian Dröge
d3d483d0b5 rav1enc: Simplify code
Sending a `None` frame is equivalent to calling `flush()` so no need to
do both.
2022-02-07 07:30:57 +00:00
Sebastian Dröge
7654567201 rav1enc: Set mastering display info, content light level and HDR related colorimetry
Configurable behind the "hdr" cargo feature that is enabled by default
but requires GStreamer 1.18.
2022-02-07 07:30:57 +00:00
Sebastian Dröge
1451e267cc rav1enc: Expose various new settings 2022-02-07 07:30:57 +00:00
Sebastian Dröge
12f2b9282a rav1enc: Switch from speed preset 5 to 6 as default
This is the default of rav1e nowadays.
2022-02-07 07:30:57 +00:00
Guillaume Desmottes
c879b4ee2e cdg: update image and cdg_renderer
I pushed a cdg_renderer release using latest image.
2022-02-04 15:22:13 +01:00
Sebastian Dröge
858865b731 gtk4: Attach main context receiver from the main context's thread
Otherwise it will fail if the sink's state is changed from a different
thread.

See https://gitlab.freedesktop.org/dabrain34/GstPipelineStudio/-/issues/2
2022-02-04 13:51:31 +02:00
Sebastian Dröge
7c872bb92b dav1ddec: Fix compilation after some API changes 2022-02-03 15:51:46 +02:00
Sebastian Dröge
cf46d9439b dav1ddec: Add 8/16 bit grayscale support 2022-02-03 13:39:43 +02:00
Sebastian Dröge
240fa0b066 rav1enc: Support 8 bit grayscale input 2022-02-03 13:39:43 +02:00
Sebastian Dröge
5a4c8b9fc8 dav1ddec: Release input frames that immediately caused a decoding error
We're not going to get any output for them.
2022-02-03 11:04:57 +00:00
Sebastian Dröge
2c511fca50 dav1ddec: Require correct alignment and stream format when running with GStreamer 1.20 2022-02-03 11:04:57 +00:00
Sebastian Dröge
772fbaa073 rav1enc: Include stream-format and alignment in the caps 2022-02-03 11:04:57 +00:00
Sebastian Dröge
6ce3029e07 dav1ddec: Update for fixed dav1d-rs API
As a side effect this allows us also to handle errors more gracefully
and to reduce memory load by outputting decoded frames immediately.

Also the code was changed a bit to reduce the number of redundant mutex
lock/unlocks.
2022-02-03 11:04:57 +00:00
Sebastian Dröge
b795c0c392 dav1ddec: Clean up state tracking a bit
And especially don't keep a decoder instance around while in Null state.
2022-02-03 11:04:57 +00:00
Sebastian Dröge
6e28a17280 dav1ddec: Don't consider decoding errors as fatal
Instead use the `gst_video::video_decoder_error!` macro for allowing a
certain number of consecutive errors before actually failing.
2022-02-03 11:04:57 +00:00
Sebastian Dröge
c35d1cdc0c dav1ddec: Pass element instance to debug logs 2022-02-03 11:04:57 +00:00
Julian Sparber
e419c18a87 gtk4: Implement Default for PaintableSink 2022-01-31 14:11:03 +00:00
Sebastian Dröge
42f9f99690 Update to parking_lot 0.12 and hrtf 0.8 2022-01-31 15:20:44 +02:00
Sebastian Dröge
f44b86cd30 Simplify some code around event/query views 2022-01-22 12:18:02 +02:00
Sebastian Dröge
65fcd55160 Update for event/message/query view API changes 2022-01-19 15:07:45 +02:00
Sebastian Dröge
763ad0cb18 Rename self_ variables to imp for consistency 2022-01-17 20:09:18 +02:00
Sebastian Dröge
b2d0172422 Replace Foo::from_instance(foo) with foo.imp() 2022-01-17 19:36:41 +02:00
Sebastian Dröge
51f8e963d6 Add SPDX-License-Identifier to all file headers 2022-01-15 21:18:47 +02:00
Sebastian Dröge
326449b3e6 Re-license LGPL-2.1 plugins to MPL-2
Fixes https://gitlab.freedesktop.org/gstreamer/gst-plugins-rs/-/issues/168
2022-01-15 21:05:11 +02:00
Sebastian Dröge
0c7764fa40 Update versions to 0.9.0 2022-01-15 20:33:49 +02:00
Sebastian Dröge
ab14c50d1c Ignore clippy::non_send_fields_in_send_ty lint
It's useless in its current shape and wrongly triggering on all types.

See https://github.com/rust-lang/rust-clippy/issues/8045
2022-01-14 12:09:57 +02:00
Sebastian Dröge
81f5f0f60c Fix various clippy warnings 2022-01-12 19:51:08 +02:00
Mathieu Duponchelle
0bc7697600 sccenc: add output-padding property
When set to False, sccenc will only output non-padding byte pairs.

I cannot find reference documentation for the format, but the closest
thing I find to it is
http://www.theneitherworld.com/mcpoodle/SCC_TOOLS/DOCS/SCC_FORMAT.HTML,
which doesn't have padding in the examples.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-rs/-/merge_requests/635>
2022-01-12 16:49:24 +00:00
Sanchayan Maity
a43e21a414 videofx: roundedcorners: Fix missing copyright attribution 2021-12-29 16:15:43 +00:00
Sebastian Dröge
3ed9e291c2 Update for decide/propose_allocation() API changes 2021-12-06 19:11:24 +02:00
Sebastian Dröge
66e987c174 Fix a couple of new clippy warnings 2021-12-02 22:31:52 +02:00
Sebastian Dröge
c46901d150 Fix or silence various new 1.57 clippy warnings 2021-11-30 16:31:50 +02:00
Sanchayan Maity
2c2cd8c2be Implement rounded corners
This plugin takes I420/YUV and appends an alpha plane to give YUVA/A420
to round the corners analogous to the border-radius in CSS. Other video
formats like NV12 not supported yet. Support for other planar formats
will follow.

Not all ways of specifying border-radius as in CSS are implemented at
the moment. Currently, we only support specifying it in pixels and it
gets applied uniformly to all corners.
2021-11-22 17:04:07 +05:30
Sebastian Dröge
86f422592b Update for glib::Enum / glib::Boxed / glib::flags! macro renames 2021-11-22 11:04:26 +02:00
Sebastian Dröge
55aad51141 Update for glib constructor renames
See https://github.com/gtk-rs/gtk-rs-core/pull/384
2021-11-20 14:31:06 +02:00
Sebastian Dröge
288acaa7cc cdg: Update test for child proxy property API changes 2021-11-20 10:47:02 +02:00
Sebastian Dröge
f817f6e9b9 Update to rav1e 0.5 and async-tungstenite 0.16
Also add an asm feature to rav1e, which requires nasm to be in place.
2021-11-17 10:10:00 +02:00
Mathieu Duponchelle
b738d5933d tttojson: fix row computation
I hadn't really tested the element with pop-on mode, and the row
for each line in the input text was hardcoded to 13, which was
clearly wrong.

Switch to incrementing it properly.
2021-11-16 07:51:41 +00:00
Sebastian Dröge
e81047b8a2 cea608overlay: Fix compilation after Pango API changes 2021-11-13 12:33:55 +02:00
Mathieu Duponchelle
78d7cbd7dd cea608overlay: expose timeout property
C.9 Automatic Caption Erasure (Preferred)

[...]

Some manufacturers have suggested building automatic timeout into their
decoders. They propose that if no data are received for the selected caption
channel within a given time, the decoder should automatically erase the
caption. Such erasure may supersede the intentions of the caption service
providers and institute one maximum display time for all captioning services.

If such a timeout is deemed necessary, however, the time limit should be no less
than 16 seconds, an amount of time said by caption service providers to be longer
than their most enduring caption. It is preferred, when automatic caption erasure
is used in a decoder, that only displayed memory be erased, since some caption
service providers may, contrary to recommended practice (see Section B.8.3), send
pop-on style caption data to non-displayed memory more than 16 seconds before
sending the EOC command which causes the caption to display.
2021-11-13 00:15:47 +01:00
Bilal Elmoussaoui
82be7b3ac5 adapt to ObjectExt improvements 2021-11-08 14:43:53 +02:00
Sebastian Dröge
d9bda62a47 Update for GLib/GStreamer API changes
And clean up a lot of related property/caps/structure code.
2021-11-06 09:34:10 +02:00
Sebastian Dröge
0a7d1639e7 Update to Rust edition 2021 and minimum supported Rust version to 1.56 2021-10-31 17:40:05 +02:00
Michael Farrell
5ae1f72162 cea608overlay: Update for multiple Pango API changes in gtk-rs-core#308
https://github.com/gtk-rs/gtk-rs-core/pull/308
2021-10-31 12:50:50 +02:00
Sebastian Dröge
da4122a721 closedcaption/mccenc: Update for glib::DateTime / TimeSpan API changes 2021-10-23 13:07:01 +03:00
Sebastian Dröge
b9541b2ca4 Update for GstObjectImpl API change 2021-10-23 12:31:33 +03:00
François Laignel
27b9f0d868 Improve usability thanks to opt-ops
The crate option-operations simplifies usage when dealing with
`Option`s, which is often the case with `ClockTime`.
2021-10-18 15:09:47 +02:00
Sebastian Dröge
70f0aa9758 gtk4: Add support for rendering overlay composition rectangles directly via GTK 2021-10-17 19:03:24 +00:00
Sebastian Dröge
c5d3a2efce Update for event API changes 2021-10-17 17:30:38 +03:00
Sebastian Dröge
01a551f2ac rav1enc/gifenc: Add VideoMeta to the supported metas in propose_allocation() 2021-10-16 16:21:49 +03:00
Sebastian Dröge
fe0075ad15 closedcaption/cea608overlay: Proxy the allocation query 2021-10-16 16:21:49 +03:00
Sebastian Dröge
cecacf5430 hsv: Port detecter/filter to VideoFilter base class 2021-10-16 16:21:49 +03:00
Sebastian Dröge
cf637d0288 gtk4: Add gst_video::VideoMeta to the allocation metas in propose_allocation() 2021-10-16 15:05:18 +03:00
Sebastian Dröge
d17c3483c1 video: Update for new decide_allocation() signature 2021-10-16 15:02:11 +03:00
Sebastian Dröge
6ec98ec5e4 Update to pretty-assertions 1.0 2021-10-14 10:20:19 +03:00
Bilal Elmoussaoui
30796fbe07 Add a GTK4 paintable sink plugin
Co-authored-by: Sebastian Dröge <sebastian@centricular.com>
Co-authored-by: Jordan Petridis <jordan@centricular.com>
2021-10-13 12:28:51 +03:00
Sebastian Dröge
21e8c6dcd1 pngenc: Don't recreate the encoder after every frame
Version 0.17.2 of the encoder allows again to encode frame after frame
without creating a new encoder instance.
2021-10-09 12:14:37 +03:00
Jan Schmidt
3260651671 jsontovtt: Add an element for fragmented WebVTT
This element converts the CC JSON format to fragmented WebVTT.

Co-authored by Mathieu Duponchelle <mathieu@centricular.com>
2021-09-30 19:37:32 +00:00
Mathieu Duponchelle
bc587a09f8 cea608tojson: expose "unbuffered" property
In this mode, cues are output as soon as they are ready for
display, without a duration. This can be useful in live mode,
when downstream is OK with determining the duration after the
fact, through clear=True.

The consequence of this is that the current roll-up window will
be output repetitively, it is up to downstream to deal with that
how it prefers.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-rs/-/merge_requests/554>
2021-09-30 17:05:01 +02:00
Mathieu Duponchelle
01cc9e23d8 transcriberbin: switch to passthrough on transcriber error
Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-rs/-/merge_requests/569>
2021-09-28 16:17:57 +00:00
Sebastian Dröge
ea2a313d01 ffv1dec: Add support for 4:1:0 and 4:1:1 YUV 2021-09-18 12:34:31 +03:00
Sebastian Dröge
2878e4ce7c ffv1dec: Fix decoding of 4:4:4 / 4:4:4:4 / 4:2:2 / 4:4:2:2 YUV formats 2021-09-18 12:34:31 +03:00
Sebastian Dröge
600d217e7d ffv1dec: Add support for >8 bit color formats 2021-09-18 12:34:31 +03:00
Sebastian Dröge
08229402cd ffv1dec: Don't copy decoded memory if the strides are not matching but downstream supports video meta 2021-09-18 12:34:31 +03:00
Sebastian Dröge
fd1c0a7518 ffv1dec: Drop decoder state before calling VideoDecoder::negotiate()
It calls into other elements via the allocation query and the caps
event, which makes it dangerous to keep a mutex locked at the same time.
2021-09-18 12:34:31 +03:00
Sebastian Dröge
4c8c398aa4 dav1d: Don't configure a buffer pool and don't require one for videometa support
dav1d is allocating memory itself and we directly forward that without
using any downstream buffer pool.
2021-09-18 11:58:59 +03:00
Sebastian Dröge
f4613bfc07 Use Buffer::from_mut_slice() in more places
This allows downstream to map the memory mutable.
2021-09-18 11:58:59 +03:00
Sebastian Dröge
b9864acad6 ffv1: Lower minimum required GStreamer version to 1.12 2021-09-10 09:42:25 +03:00
Sebastian Dröge
c8fc082968 ffv1: Update version to 0.8.0 like elsewhere 2021-09-10 09:22:11 +03:00
Arun Raghavan
bb3949aeda video: Add a new ffv1 decoder plugin 2021-09-10 06:20:31 +00:00
Sebastian Dröge
426dc4c54d flavors: Update to nom 7 2021-09-09 06:41:49 +00:00
Sebastian Dröge
96d86eaa06 Clean up clippy warnings and CI configuration
Put clippy overrides into the sources files instead of the CI
configuration, and fix various warnings / clean up code.
2021-09-08 12:35:41 +00:00
Sebastian Dröge
434fe8e56f closedcaption/mccenc: Fix unit test to not require changing the version number in the output every time 2021-09-03 09:12:25 +03:00
Mathieu Duponchelle
715418c005 tttocea608: don't erase display memory before loading new pop-on
There is no point to that, the code is already factored in such
a way that erase_display_memory is inserted at the correct time,
including while loading the next pop-on captions in non displayed
memory.
2021-09-02 00:21:24 +02:00
Sebastian Dröge
4a870af19c Update various dependencies 2021-08-26 09:44:43 +03:00
Sebastian Dröge
848b296390 Add capi feature to all plugin crates
This fixes the build with cargo-c 0.9.2.
2021-08-11 20:51:36 +03:00
Mathieu Duponchelle
b7d1c178a3 tttocea608: clean up locking
Locking order of state and settings was inconsistent, and causing
deadlocks. Fix and document it, consistently drop locks before
chaining up events / pushing and avoid sequentially unlocking /
relocking settings in the same local code path.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-rs/-/merge_requests/539>
2021-08-03 18:23:53 +02:00
Sebastian Dröge
052365ba1a Fix various needless-borrow clippy warnings and others 2021-07-30 13:53:35 +03:00
Ruben Gonzalez
54d8c5f6a9 Delete minimum GStremer required version for some plugins
Tested building the pluging with cargo-c and running gst-inspect-1.0
in a Ubuntu Xenial 18.04 LTS. It contains GStreamer 1.8.3.
2021-07-20 21:49:24 +02:00
Mathieu Duponchelle
5397f4bfaf transcriberbin: remove leftover debug dot dumps
Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-rs/-/merge_requests/531>
2021-07-15 23:24:29 +00:00
Sebastian Dröge
f733f90333 closedcaption/mccenc: Fix unit test
The expected output contains the plugin version.
2021-07-09 14:14:51 +03:00
Sebastian Dröge
24ec79cd1a Update versions to 0.8.0 for the master branch 2021-07-09 13:49:33 +03:00
Sebastian Dröge
1c3ae0f89a Update versions to 0.7.0 2021-07-09 13:49:21 +03:00
SeaDve
82df25694a gifenc: Add property to configure speed
Fixes #157.
2021-07-05 11:50:41 +03:00
Mathieu Duponchelle
3cdc5870a1 transcriberbin: new high-level bin for speech to Closed Caption
This new element puts together some of the elements we've written
in recent times (awstranscriber, tttocea608, textwrap, cccombiner)
into a convenience high-level element.

The design of the element is AV in -> AV (+ CC metas) out.

The element exposes property to set and unset a "passthrough" mode,
during which the transcriber element's state is set to NULL but kept
in the bin, in order for the user to be able to set properties on
sub elements no matter what the current mode is, using the
GstChildProxy interface.

In addition, the element ensures that the latency it reports stays
fixed so that playback continues uninterrupted.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-rs/-/merge_requests/528>
2021-06-30 02:07:01 +02:00
Mathieu Duponchelle
23219c3c09 tttocea608: don't pad up to first input timestamp
When receiving data from a live upstream element, the first buffer
may have a non-0 timestamp (running time), and the element incorrectly
pushed padding buffers up to that timestamp, resulting in much confusion

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-rs/-/merge_requests/527>
2021-06-25 23:26:30 +00:00
Mathieu Duponchelle
d6f6f1a777 cea608overlay: expose "black-background" property
As stated in the spec:

> In addition, the user must have the capability to select a black
> background over which the captioned letters are displaced.

The property is MUTABLE_PLAYING
2021-06-18 09:48:44 +00:00
François Laignel
5439f14e57 fix clippy warnings 2021-06-05 10:36:22 +02:00
François Laignel
e16cad7c8f video: migrate to new ClockTime design 2021-06-05 10:36:21 +02:00
François Laignel
8dfc872544 use gst::glib where applicable 2021-06-03 20:53:16 +02:00
Blaxar Waldarax
e9f0a3b8ac hsv: added support for more RGB and BGR formats to hsvdetector and hsvfilter 2021-05-18 07:00:14 +00:00
Sebastian Dröge
04a60b8f46 Update repository URL for gtk-rs "core" crates 2021-05-13 09:50:08 +03:00
Sebastian Dröge
f4a3881dcf Fix new 1.52 clippy warnings 2021-05-05 12:13:16 +03:00
Sebastian Dröge
3d24f1da22 closedcaption/cea608overlay: Fix compilation with cairo API changes 2021-05-04 14:31:58 +03:00
Sebastian Dröge
8bda233d02 rav1e: Fix compilation after VideoColorRange::Range0255 got renamed to VideoColorRange::Range0_255 2021-05-01 10:49:36 +03:00
Sebastian Dröge
75959e8c63 cdgdec: Remove unneeded VideoDecoderExtManual import 2021-04-26 14:58:15 +03:00
Sebastian Dröge
15cf738616 Update for Value trait refactoring 2021-04-25 15:48:55 +03:00
Mathieu Duponchelle
7923e26545 tttocea608: implement word wrapping in roll-up modes.
In roll-up modes, we open new lines when the last column is reached.
This commit implements lookahead on a word basis, in order to avoid
splitting words unless absolutely necessary (when a word won't fit
on a full row)
2021-04-20 17:53:12 +00:00
François Laignel
95cdd43f4f manual fixes remove get prefix round 2 2021-04-20 18:19:58 +02:00
François Laignel
67c5871957 fix-getters-calls 0.3.0 pass 2021-04-20 18:19:58 +02:00
François Laignel
27bc5c89ca fix-getters-def 0.3.0 pass 2021-04-20 18:19:58 +02:00
Mathieu Duponchelle
61214b5788 tttocea608: only warn when we do drop characters
In roll-up mode, we drop out of the loop and warn when the 32nd
character is reached, the warning is unnecessary when there were
no characters left to loop on.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-rs/-/merge_requests/499>
2021-04-16 21:16:46 +02:00
Mathieu Duponchelle
f95b5ee666 closedcaption/caption.c: fix deletion
Trying to write "" in order to erase characters in the caption
frame simply fails silently, the proper way to implement
delete_to_end_of_row and backspace was to memset the relevant
cells.
2021-04-15 14:35:22 +00:00
François Laignel
7d17f88941 post fix-getters manual updates 2021-04-13 17:24:20 +02:00
François Laignel
06accc8d98 fix-getters-{def,calls} pass 2021-04-12 15:57:19 +02:00
Seungha Yang
3dda2aebe9 closedcaption: Fix build with MSVC
Undefined ssize_t is used in eia608.h file as well
2021-04-01 05:13:24 +00:00
Sebastian Dröge
bb8931c39b closedcaption: Don't needlessly create a full-range subslice of a slice 2021-03-25 22:59:14 +02:00
Sebastian Dröge
3a9a937bfd Add license files to all new plugins 2021-03-22 20:10:29 +02:00
Mathieu Duponchelle
d9e727050c video: implement webp decoder around libwebp-sys2 crate
Unlike webpdec from -bad, this element inherits from GstElement
and can decode animated webp data.
2021-03-20 10:53:20 +02:00
Mathieu Duponchelle
a500166082 cea608overlay: remove debug prints
Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-rs/-/merge_requests/480>
2021-03-17 14:22:00 +01:00
Mathieu Duponchelle
0335893559 closedcaption: implement cea608tojson element
This element outputs the same format expected by tttocea608 in
json mode.

It notably differs from cea608tott in that it only uses libcaption's
low-level API, as it needs to maintain its own view of the current
state of the screen, and make fine-grained decisions as to when
to output data and how to timestamp it.

It covers a large portion of the 608 spec, with the exception of
a few features that probably haven't ever seen widespread usage,
those are listed in a TODO list at the top.

It has been tested with a reference file produced by CEA and covers
all the features it demonstrates.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-rs/-/merge_requests/480>
2021-03-17 14:22:00 +01:00
Mathieu Duponchelle
11238579a5 tttocea608: pad immediately for the duration of the input buffer
Pushing the pending padding once we receive the following gap
or buffer means we will push it too late otherwise.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-rs/-/merge_requests/480>
2021-03-12 11:20:44 +01:00
Sebastian Dröge
2cada57efc Update for the subclassing glib/gstreamer bindings API changes 2021-03-09 17:07:13 +02:00
Sebastian Dröge
aa354058f5 Update pretty-assertions to 0.7, async-tungstenite to 0.13 and num-rational to 0.4
Also get rid of the funty workaround as nom now depends on the right
version.
2021-03-09 11:42:33 +02:00
Sebastian Dröge
dc0c5f7611 Update for new #[glib::object_subclass] attribute macro 2021-03-07 18:27:00 +02:00
Mathieu Duponchelle
a7df50e68f ccdetect: fix 608 detection
When cc_type is 00 or 01 the CC is 608 data, the last bit only
denotes the field

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-rs/-/merge_requests/474>
2021-02-15 19:25:18 +00:00
Mathieu Duponchelle
cc402f769c cea608overlay: support all VideoCaptionType meta
Also expose a field property, to allow selecting CC for a
specific field when the information is available. Defaults
to automatically picking the first field encountered.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-rs/-/merge_requests/474>
2021-02-15 19:25:18 +00:00
Mathieu Duponchelle
3c982a3de0 ccdetect: extract CDP parser to a separate module
Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-rs/-/merge_requests/474>
2021-02-15 19:25:18 +00:00
Mathieu Duponchelle
19611f0ebe tttocea608: be more conservative when inserting spaces
We don't need to insert a space when starting a new line,
or before punctuation.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-rs/-/merge_requests/474>
2021-02-15 19:25:18 +00:00
Mathieu Duponchelle
20607fe346 tttocea608: expose origin-column and origin-row properties
These can be controlled more precisely using json as the input
format, but exposing them as properties is still useful when
the input format is text.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-rs/-/merge_requests/474>
2021-02-15 19:25:18 +00:00
Mathieu Duponchelle
126df546c0 tttocea608: make mode property mutable in PLAYING
Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-rs/-/merge_requests/474>
2021-02-15 19:25:18 +00:00
Sebastian Dröge
1cd5d5ef45 Temporarily depend on funty 1.1.0 to work around breakage in 1.2.0
See https://github.com/myrrlyn/funty/issues/3
2021-02-14 11:07:26 +02:00
Sebastian Dröge
cbda137fbf Fix various warnings from clippy 1.50 2021-02-09 18:57:34 +02:00
Sebastian Dröge
b649e9b076 Use gst::PARAM_FLAG_MUTABLE_PLAYING and others consistently everywhere
Fixes https://gitlab.freedesktop.org/gstreamer/gst-plugins-rs/-/issues/139
2021-01-31 15:43:00 +02:00
Sebastian Dröge
1a826caf75 cea608overlay: Handle errors when rendering captions more gracefully
Just don't output anything and log an error instead of panicking.
2021-01-31 11:18:37 +02:00
Sebastian Dröge
78c0ea6a4c dav1d: Update to dav1d-rs 0.6 2021-01-25 14:55:25 +02:00
Sebastian Dröge
d4ce1a33f2 Update for glib/gstreamer bindings API changes 2021-01-25 14:43:05 +02:00
Mathieu Duponchelle
875c3efb91 tttocea608: implement paint-on mode
That mode has been mostly obsoleted by roll-up modes, but let's
include it for completeness' sake.
2021-01-20 02:29:19 +01:00
Mathieu Duponchelle
13efa59252 closedcaption: implement a tttojson element
That new element can for example be used to serialize the output
of awstranscribe, ready for further editing
2021-01-20 02:29:19 +01:00
Mathieu Duponchelle
42b4defb5c tttocea608: in-depth refactoring, support for new input format
Up to now, tttocea608 supported text/utf8, and no interface to
control the positioning of closed captions apart from new lines
in the input text.

CEA 608 supports a larger set of features than that, such as
positioning CC precisely in its 32 x 15 grid, styling text,
switching from one mode to another, resetting the base row
in roll-up mode etc ..

A custom, JSON-based format is now supported by the element
(caps application/x-json, format=cea608), allowing users to
control those features in a pretty advanced manner.

A side effect of this is that the approach previously used
by the element to ensure frame-accurate CC display is now
untenable: where we knew before that an input buffer would
at most span 74 buffers and calculate a somewhat reasonable
latency based on that, this is no longer possible. Instead
we pick the approach most CC encoders seem to pick, and
accept a certain latency at display time: for example the
flipping of the back buffer to the display buffer for a
10-character text buffer will occur 7 frames after its
PTS. This has obvious benefits in terms of code complexity
and should generally be acceptable.

+ Removes a now irrelevant test, updates other tests

+ Extracts the Mode enum to the root of the crate, it will
  be used by another element in a follow-up commit
2021-01-20 02:29:19 +01:00
Mathieu Duponchelle
6267e00c20 libcaption: implement eia608_to_text 2021-01-19 16:40:00 +01:00
Mathieu Duponchelle
a7180e3995 libcaption: fix bit set on indent preambles
style preambles look like:

|P|0|0|1|C|0|ROW| |P|1|N|0|STYLE|U|

and column preambles look like:

|P|0|0|1|C|0|ROW| |P|1|N|1|CURSR|U|

Both preambles go through eia608_row_pramble(), the value they
pass as the x parameter is supposed to hold 4 bits, either
0|STYLE

or 1|CURSR

This value then gets bit-shifted by 1 and or'd in the second byte.

The value is also and' with 0x1E to ensure it can't leak into
the upper bits.

The previous code resulted in x being a 5-bit value, 0x10 (0b10000).
This resulted in outputting a style preamble, as 0x10 << 1 & 0x1E
is 0b00000. When the indent was 0 (the usual case), this went
undetected, but with any other value it resulted in no indent being
applied, but the text getting colored or italicized.

This patch fixes x to have the correct value of 0x8 | indent.
2021-01-19 16:40:00 +01:00
Mathieu Duponchelle
a3dafea688 libcaption: fix parity code calculation
A misplaced parenthesis was causing the odd parity bit to
be set based on an incomplete version of the preamble
2021-01-19 16:40:00 +01:00
Sebastian Dröge
27b2de1d05 rav1enc: Make use of the opaque API to map frames/packets to the video encoder frames 2021-01-15 11:58:26 +02:00
Sebastian Dröge
fa4cd38f75 rav1enc: Update to rav1e 0.4 2021-01-15 11:38:31 +02:00
Sebastian Dröge
84896e6468 Update to rand 0.8 2021-01-09 12:34:42 +02:00
Guillaume Desmottes
8bc2e5ebb8 use cargo-c to produce cdy and static libs
cargo-c will produce a pkg-config file making it easier to statically
link plugins.

Also add 'static' features for plugins depending on < 1.14 as this is the
minimal required version to use static linking because of ABI changes in
core.
2021-01-04 12:26:45 +01:00
Sebastian Dröge
078bf81b85 sccparse: Work around invalid drop-frame timecodes
Various SCC files have invalid drop frame timecodes.

Every full minute the first two timecodes are skipped, except for every
tenth minute, which means that e.g. "00:01:00;00" is not a valid
timecode and the next valid timecode would be "00:01:00;02".
2020-12-30 13:33:25 +02:00
Sebastian Dröge
3b739530bf sccparse: Parse timecode only once when seeking
Also avoids an unwrap().
2020-12-30 13:04:55 +02:00
Sebastian Dröge
02310d8720 sccparse: Simplify timecode handling a bit 2020-12-30 13:02:09 +02:00
Sebastian Dröge
a88fe95fee mccparse: Use the last known timecode as duration even if there were more invalid ones afterwards 2020-12-30 13:01:41 +02:00
Sebastian Dröge
38ecd43074 Use typed integer literals instead of casting 2020-12-29 17:29:46 +02:00
Sebastian Dröge
005c62425b closedcaption: Update for glib::DateTime API changes 2020-12-24 13:36:07 +02:00
Blaxar Waldarax
348b865187 Added hsv plugin with hsvfilter and hsvdetector elements 2020-12-23 18:40:20 +01:00
Sebastian Dröge
3d617371af Update for macro renames 2020-12-20 20:43:45 +02:00
Sebastian Dröge
ea6c05e16c Update everything for glib macro renamings 2020-12-18 00:44:49 +02:00
Sebastian Dröge
89b72b53d1 mccparse/sccparse: Ignore if pausing a task that does not exist anymore
Not really a problem anywhere here.
2020-12-07 10:47:14 +00:00
Mathieu Duponchelle
2131d5bfda sccparse, mccparse: fix deadlock on seek
Don't try to pause the sinkpad task while holding the state lock,
that's a bit rude.
2020-12-07 10:47:14 +00:00
Sebastian Dröge
6aed1ed926 Remove various unneeded unwraps 2020-12-05 20:29:50 +02:00
Seungha Yang
58786fa0b5 sccparse: Add support for seeking
Only pull mode can support seeking for now and reverse playback
is not implemented yet. Note that this restriction is the same as that of
mccparse.
2020-12-01 11:07:34 +00:00
Seungha Yang
8b8380992f sccparse: Remove unnecessary timecode handling
Wasn't intended to be a part of commit d56ae71e0e
2020-12-01 11:07:34 +00:00
Guillaume Desmottes
b81bdd823a gif: rename plugin to 'gif'
It's more coherent and what's actually used as library name.
2020-12-01 11:26:46 +01:00
Sebastian Dröge
f81d7b61b5 video: Update to 2018 edition 2020-11-23 10:28:35 +02:00
Sebastian Dröge
d7044589f4 flavors: Update to nom 6 2020-11-19 18:59:57 +02:00
Sebastian Dröge
a97d1da3ab closedcaption: Silence type complexity warning 2020-11-19 18:27:54 +02:00
Sebastian Dröge
ea95c31939 closedcaption: Remove combine dependency 2020-11-19 18:27:54 +02:00
Sebastian Dröge
cbe54c0827 closedcaption: Move duplicated test into a single place 2020-11-19 18:27:54 +02:00
Sebastian Dröge
82c8a7b7e8 closedcaption: Switch MCC parser from combine to nom
nom gives easier to understand compiler errors when something is wrong
and compiles considerably faster.
2020-11-19 18:27:54 +02:00
Sebastian Dröge
0ff11b2cc1 closedcaption: Move common parsers into a separate file 2020-11-19 18:27:54 +02:00
Sebastian Dröge
ffae72cb0f closedcaption: Switch SCC parser from combine to nom
nom gives easier to understand compiler errors when something is wrong
and compiles considerably faster.
2020-11-19 18:27:54 +02:00
Sebastian Dröge
d56ae71e0e Update for ObjectImpl::get_property() being infallible now 2020-11-19 18:25:53 +02:00
Guillaume Desmottes
b9f8ce9995 meson: add support for static build
There is no way to dynamically ask Cargo to build static or dynamic lib
so we have to build both and pick the one we care when doing the meson
processing.

Fix #88
2020-11-16 15:30:32 +01:00
Sebastian Dröge
717477fd36 video: Update for subclassing API changes 2020-11-15 18:50:31 +02:00
Sebastian Dröge
41a660ba4f flavors: Pin to a version that doesn't require nom 6 yet
See https://gitlab.freedesktop.org/gstreamer/gst-plugins-rs/-/merge_requests/423
2020-11-03 11:54:49 +02:00
Sebastian Dröge
1f446f6b64 Switch to the combined gtk-rs and gstreamer-rs repositories 2020-11-01 10:24:57 +02:00
François Laignel
7c3e69bb4a Fix ClockTime comparisons not being Ord and use saturating_sub
See:
https://gitlab.freedesktop.org/gstreamer/gstreamer-rs/-/merge_requests/607
2020-10-20 23:45:01 +02:00
Sebastian Dröge
88bf03bedf Update muldiv dependency to 1.0 2020-10-13 12:56:49 +03:00
Seungha Yang
6559287bea cdg: Fix assertion failure while typefinding with too short file
thread '<unnamed>' panicked at 'assertion failed: step != 0', ...

Don't iterate with zero step size.
2020-10-04 20:44:44 +09:00
Guillaume Desmottes
fab361d32d cdg: disable default features for the image crate
We don't need JPEG, GIF, etc. support so depending on the whole
dependency chain of them is not needed and only wastes CPU time.

As a result we can remove the gif crate exception in deny.toml.
2020-09-23 10:28:55 +02:00
Guillaume Desmottes
b81c7e2fd7 cdg: update cdg_renderer 2020-09-23 10:12:44 +02:00
Sebastian Dröge
6de1ca7ed3 video/gif: Update gif dependency to 0.11 2020-09-22 14:40:07 +03:00
Matthew Waters
dc8b722f72 video/closedcaption: add a ccdetect element
Detects whether valid closed caption data is available in CC708 data.
2020-09-10 20:54:09 +10:00
Sebastian Dröge
0eb777cf5a Update for removal of ObjectImpl::get_type_data() 2020-07-26 18:46:32 +03:00
Sebastian Dröge
1730de6cea video/gif: Add description to Cargo.toml 2020-07-10 13:07:17 +03:00
Sebastian Dröge
ad34160083 video/gif: Don't set NON_DROPPABLE flag on buffers
It doesn't make sense in this context and the flag only exists since
1.12.
2020-07-10 13:07:17 +03:00
Sebastian Dröge
6061d22fad video/dav1d/rav1e: Depend on gstreamer-video 1.12 for the 12 bit formats
Can be made conditional if someone needs that.
2020-07-10 13:07:07 +03:00
Sebastian Dröge
e9b61b733d Add LICENSE files to each individual crate 2020-07-10 13:06:28 +03:00
Sebastian Dröge
bde998ce50 video/cdgdec: Box CdgInterpreter state to prevent GObject private size to become too big
Only 64k are allowed for the sum of all private instance structs in the
class hierarchy, as well as for the public instance structs.

The CdgInterpreter itself is huge and adding just another two integers
to GstVideoDecoderPrivate in libgstvideo is causing the limit to be
reached, so let's allocate it in a separate memory area.
2020-07-01 01:51:23 +03:00
Sebastian Dröge
a28455f0ce Update for Element::post_message() signature change 2020-06-30 21:28:02 +00:00
Sebastian Dröge
48c20471d5 Fix compilation after flags cleanup 2020-06-30 12:04:50 +03:00
Sebastian Dröge
d03c6cb26a Update various dependencies 2020-06-30 10:49:27 +03:00
Sebastian Dröge
f62c11f851 Update for functions returning a Builder being renamed to builder() instead of new()
And new video event APIs.
2020-06-25 19:49:07 +03:00
François Laignel
e40267e95d event,message,query: update instantiation
See https://gitlab.freedesktop.org/gstreamer/gstreamer-rs/-/merge_requests/532
2020-06-25 11:26:32 +02:00
Sebastian Dröge
fc20df294e Remove a few unused dependencies 2020-06-22 16:29:13 +03:00
Sebastian Dröge
9bb3e75fb9 Update to use the new pad builders for safely setting pad functions
Only two uses of unsafely setting the pad functions is left:
- fallbacksrc for overriding the chain function of the proxy pad of a
  ghost pad
- threadshare for overriding the pad functions after creationg, which
  probably needs some fixing at some point
2020-06-22 11:28:19 +03:00
Sebastian Dröge
f4e7f127d9 flavors: Update num-rational dependency to 0.3 2020-06-18 13:07:09 +03:00
Sebastian Dröge
60321edb8c Update for new_with_XXX/new_from_XXX function renaming 2020-06-16 11:56:48 +03:00
Guillaume Desmottes
e85799b9d6 use new constructor names 2020-06-11 13:07:01 +02:00
Mathieu Duponchelle
ed4fa7fde4 tttocea608: insert preambles in roll-up mode
I thought I could spare some bandwidth by letting renderers pick
the base row, but it turns out this triggers some unwanted behaviours
with compliant renderers.

Instead, we now follow the protocol laid out in EIA/CEA-608-B,
section B.8.1

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-rs/-/merge_requests/355>
2020-06-10 22:05:02 +02:00
Sebastian Dröge
321f418518 video: Handle Result returned by VideoMeta::add()
By simply unwrapping for now, which is still better silently having no
VideoMeta.
2020-06-08 11:08:27 +03:00
Mathieu Duponchelle
0bb626c653 closedcaption: implement cea608overlay
Useful complement to cea708overlay, that can only render native
708.

The element isn't an aggregator, and simply parses and renders
closed caption meta on its input video buffers.

No property is exposed, the rendering is done using a monospace
font, over a 32 x 15 grid with the font size fitted to fill as
much of the viewport as possible.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-rs/-/merge_requests/343>
2020-06-04 16:53:04 +02:00
Mathieu Duponchelle
f27173e2b9 tttocea608: fix pts incrementation in roll up mode
Simple operator mistake

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-rs/-/merge_requests/351>
2020-06-03 00:51:40 +02:00
Sebastian Dröge
13d3fd1cc8 Remove now unneeded gobject_sys imports 2020-05-30 11:15:33 +03:00
Mathieu Duponchelle
83b0596242 tttocea608: add roll-up modes
In roll-up mode, the element expects input text without layout
(eg new lines), and the characters it outputs are displayed
immediately, without double-buffering as in pop-on mode.

Once the last column is reached, the element simply outputs
a carriage return and the text scrolls up, potentially splitting
words with no hyphenation.

The main advantage of this mode is its simplicity and the near-zero
latency it introduces.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-rs/-/merge_requests/347>
2020-05-30 01:36:11 +02:00
neithanmo
d130b29146 video/png: Add PNG encoder element
It can encode raw video formats like Gray8/16, RGB and RGBA and
uses the PNG crate which is a decoding and encoding library in pure Rust
2020-05-15 08:30:32 -06:00
Sebastian Dröge
36bcd54306 closedcaption/{scc,mcc}parse: Allow an optional UTF-8 BOM at the beginning
Some software is apparently writing an UTF-8 BOM at the beinning of the
file.
2020-05-13 10:10:45 +03:00
Guillaume Desmottes
6c6917077d cdgdec: fix test with gst master
Test was relying on 'blocksize' property on the source which can
only be used in push mode.

This change in baseparse broke it:
e906197c62
so ensure we are actually in push mode by using pushfilesrc.
2020-05-01 10:29:28 +02:00
Sebastian Dröge
36f032ef15 Configure crate-type to cdylib/rlib consistently in Cargo.toml
And not in the source code, it's a build decision.
2020-04-24 15:02:12 +03:00
Sebastian Dröge
5a7fcfad7f Fix various new clippy warnings with clippy 1.43 2020-04-24 13:55:01 +03:00
Mathieu Duponchelle
510c1cf2df tttocea608: use mul_div_round
Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-rs/-/merge_requests/314>
2020-04-23 20:58:54 +02:00
Mathieu Duponchelle
5c82e6fe6c tttocea608: forward gaps from upstream
taking our own latency into account

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-rs/-/merge_requests/314>
2020-04-23 20:10:42 +02:00
Mathieu Duponchelle
fbb2022b25 tttocea608: protect State with a simple mutex
There was no reason to use AtomicRefcell in this context,
aside from the dubious pleasure of panicing when attempting
to borrow mutably while another mutable borrow was already
held.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-rs/-/merge_requests/314>
2020-04-23 20:10:42 +02:00
Mathieu Duponchelle
de796c95f0 tttocea608: refactor to fit more scenarios
- Report a latency:
  By design, tttocea608 will output buffers in the "past" when
  receiving an input buffer: we want the second to last buffer
  in the buffer list that we output to have the same pts as the
  input buffer, as it contains the end_of_caption control code
  which determines when the current closed caption actually gets
  displayed in pop_on mode. The previous buffers have timestamps
  decreasing as a function of the framerate, for up to potentially
  74 byte pairs (the breakdown is detailed in a comment).

  The element thus has to report a latency, at 30 frames per second
  it represents around 2.5 seconds.

- Refactor timestamping:
  Stop using a frame duration, but rather base our timestamps on
  a scaled frame index. This is to avoid rounding errors, and
  allow for exactly one byte pair per buffer if the proper framerate
  is set on the closed caption branch, and the video branch has
  perfect timestamps, eg videorate. In practice, that one byte
  pair per frame requirement should only matter for line 21 encoding,
  but we have to think about this use case too.

- Splice in erase_display_memory:
  When there is a gap between the end of a buffer and the start
  of the next one, we want to erase the display memory (this
  is unnecessary otherwise, as the end_of_caption control code
  will in effect ensure that the display is erased when the
  new caption is displayed). The previous implementation only
  supported this imperfectly, as it could cause timestamps to
  go backwards.

- Output last erase_display_memory:
  The previous implementation was missing the final
  erase_display_memory on EOS

- Output gaps

- Write more tests

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-rs/-/merge_requests/314>
2020-04-23 20:10:42 +02:00
Guillaume Desmottes
92163c46b2 flavors: remove git suffix from git dep
Not needed and will make cargo deny sources list homogeneous.
2020-04-16 14:04:21 +02:00
Guillaume Desmottes
bdb0e72cc7 fix LGPL-2.1+ license in Cargo.toml
The proper SPDX name is LGPL-2.1-or-later, see https://spdx.org/licenses/
2020-04-16 13:07:21 +02:00
Mathieu Duponchelle
2d6a220c00 Update all versions to 0.6.0 2020-04-15 20:39:50 +02:00
Sebastian Dröge
f1e3212477 closedcaption: Convert bitfields to uint8_t for portability reasons
Contrary to what one might believe, this actually reduces the size of
the structs due to alignment constraints. On Linux x86-64 clang/gcc it
reduces the size of the caption_frame_t struct from 7760 bytes to 6800
bytes, on Windows x86-64 MSVC from 11600 bytes to 6800 bytes.

It also causes simpler and potentially faster assembly to be generated
as the values can be directly accessed as uint8_t instead of having to
extract the corresponding bits with bitwise operations.

It also gives us the same ABI with clang/gcc and MSVC.
2020-04-14 20:01:30 +03:00
Sebastian Dröge
70ef91fb4a closedcaption: Update bindgen generated FFI bindings to latest version 2020-04-14 19:34:57 +03:00
Sebastian Dröge
8370fb8a11 closedcaption: Port to combine 4 2020-04-14 09:22:43 +00:00
Sebastian Dröge
3c226a05d5 closedcaption/mccparse: Refactor parser state handling a bit
To make it a bit less confusing. The name of the state previously was
what was previously parsed, not what is expected now.
2020-04-13 15:00:23 +03:00
Sebastian Dröge
163e8cf1a0 closedcaption/sccparse: Don't strictly require empty lines between each caption line
There is some broken software out there not inserting the empty lines
and we don't really need them for proper parsing. Only require an empty
line between header and the first caption line.
2020-04-13 15:00:11 +03:00
Guillaume Desmottes
acbd3066e8 cdg: update image and cdg_renderer deps 2020-04-06 10:49:14 +02: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