Commit graph

250 commits

Author SHA1 Message Date
Matthew Waters a8b46f1bf4 closedcaption: add cea608tocea708 element
Implement an element that can take an input 608 caption stream and
generate a valid 708 caption stream by parsing the 608 data and
generating the equivalent DTVCCPackets and Service blocks.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-rs/-/merge_requests/1112>
2023-04-05 13:00:32 +10:00
Matthew Waters c0dc6eb35c cea608utils: track last channel for characters without channel embedded
If a basicna character is received, it will always have a channel of 0
even if it's directed at a different data channel.  Fix by keeping track
of the last channel from other commands and using that when producing
text in the basicna subset.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-rs/-/merge_requests/1112>
2023-04-05 12:18:15 +10:00
Matthew Waters 9a5e5db271 closedcaption: move 608 utility functions to a separate file
Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-rs/-/merge_requests/1112>
2023-04-05 12:18:15 +10:00
Tim-Philipp Müller 8845f6a4c6 git: replace LICENSE file symlinks with copies
Git will de-duplicate the contents for us anyway, and
symlinks can cause problems with some versions of git
and also on Windows.

https://github.com/mesonbuild/meson/issues/11646
https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/4326

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-rs/-/merge_requests/1157>
2023-04-04 14:26:37 +01:00
Seungha Yang 8576af247b transcriberbin: Set start-time-selection=first to cea608mux
We don't want to modify running time of caption stream

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-rs/-/merge_requests/1155>
2023-04-03 13:32:55 +00:00
Mathieu Duponchelle 8cb328b6f2 transcriberbin: add support for translations
With this, if the transcriber element in use supports "translation_src_"
request source pads, the user can now specify what languages to
translate to and how to map them to 608 channels (only CC1 and CC3 are
supported).

For instance, translation-languages="languages, CC3=transcript, CC1=fr"
will cause the original transcript to be muxed into the CC3 channel, and
the French translation to be muxed into the CC1 channel.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-rs/-/merge_requests/1149>
2023-03-29 01:58:37 +02:00
Mathieu Duponchelle 002e22510f transcriberbin: fix deadlock on construction error
Don't post an error message on the bus while holding the state lock

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-rs/-/merge_requests/1148>
2023-03-24 23:36:30 +01:00
Mathieu Duponchelle 93f61483b5 tttocea608: fix disappearing text after special character in non-popon
To avoid special characters getting de-duplicated by the decoder, we
insert no-op control commands after those. The no-op command must be
picked according to the mode we're in however, inserting
"resume_caption_loading" commands in roll-up mode caused obvious issues.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-rs/-/merge_requests/1147>
2023-03-24 21:41:21 +01:00
Mathieu Duponchelle 82ccba4267 tttocea608: fix pushing unfixed caps downstream
Allowed downstream caps might hold multiple structures, simply fixating
the first structure is not enough, tttocea608 must also create caps with
a single structure from there (or remove the remaining structures, but
new caps seems cleaner)

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-rs/-/merge_requests/1146>
2023-03-24 17:51:01 +01:00
Mathieu Duponchelle 9e3110988c transcriberbin: fix initial transcription bin setup
When passthrough=false at construction and the transcription bin
is linked after receiving video caps (and not on state change),
there could be a race where transcription-bin was linked with
tee but state change of the transcription-bin was not finished.

If upstream pushed a buffer at that point, it got a flushing flow
return and stopped streaming.

This is the same issue and the same fix as 558656deb5
for the initial passthrough=false case.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-rs/-/merge_requests/1142>
2023-03-22 23:39:32 +01:00
Sebastian Dröge 82f1789589 Fix indentation broken by cargo clippy --fix
... and another clippy warning.
2023-03-09 17:38:41 +02:00
Sebastian Dröge b025d068f2 Update for remaining gst::Element::link_many() and related API generalization
Specifically, get rid of now unneeded `&`.
2023-03-09 17:30:57 +02:00
Sebastian Dröge 9fc1404415 Update minimum supported Rust version to 1.66
Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-rs/-/merge_requests/1096>
2023-02-20 11:09:01 +02:00
Sebastian Dröge 04e101c605 Optimize various error message / debug message formatting
Directly make use of format strings instead of formatting a string
beforehand and then passing it to the macros.
2023-02-13 11:50:57 +02:00
Sebastian Dröge 1e13dbb99c Update versions to 0.11.0-alpha.1 2023-02-10 00:23:56 +02:00
Sebastian Dröge 3b4c48d9f5 Fix various new clippy warnings
Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-rs/-/merge_requests/1062>
2023-01-25 10:31:19 +02:00
Sebastian Dröge 458b2386ed Update for glib API changes 2023-01-21 18:13:48 +02:00
Sebastian Dröge 6132788b02 Update for caps/structure-related string API changes
Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-rs/-/merge_requests/1048>
2023-01-15 22:58:44 +02:00
Sebastian Dröge 27435ad82e Update for API changes 2023-01-05 12:33:54 +02:00
Sebastian Dröge 3f904553ea Fix various new clippy warnings
Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-rs/-/merge_requests/1011>
2022-12-13 11:43:16 +02:00
Sebastian Dröge 08c716d110 tttocea608: Don't fail if a gap event contains no duration
Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-rs/-/merge_requests/1002>
2022-12-07 14:04:54 +00:00
Sebastian Dröge 456fb276d6 Revert "Update for pango API changes"
This reverts commit 6e54d3cea9.

The change was wrong and the pango bindings work the same as before
again.
2022-11-18 10:58:41 +02:00
Sebastian Dröge 6e54d3cea9 Update for pango API changes
pango::Language::from_string() can fail and also can accept None as
argument.
2022-11-18 09:46:50 +02:00
Sebastian Dröge 1981ffbea0 Provide explicit type to Iterator::sum() calls to avoid ambiguity 2022-11-17 10:16:26 +02:00
Sebastian Dröge bf9f7a747e closedcaption: Update for deprecated chrono functions
Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-rs/-/merge_requests/978>
2022-11-12 18:41:08 +02:00
Sebastian Dröge a8250abbf1 Fix various new clippy warnings 2022-11-01 10:27:48 +02:00
Sebastian Dröge f2223cf2cb Update versions to 0.10.0-alpha.1 2022-10-24 19:31:19 +03:00
Sebastian Dröge 9a68f6e221 Move from imp.instance() to imp.obj()
It's doing the same thing and is shorter.
2022-10-23 23:08:46 +03:00
François Laignel 86776be58c Remove & for obj in log macros
This is no longer necessary.

See https://gitlab.freedesktop.org/gstreamer/gstreamer-rs/-/merge_requests/1137
2022-10-23 21:22:31 +02:00
Sebastian Dröge f045099fc1 Fix GObject type names, GStreamer debug category names and element factory names
Fixes https://gitlab.freedesktop.org/gstreamer/gst-plugins-rs/-/issues/198
2022-10-23 20:46:08 +03:00
Sebastian Dröge 20ad9175d8 Make GStreamer plugin/crate/library/directory names and descriptions consistent
Fixes https://gitlab.freedesktop.org/gstreamer/gst-plugins-rs/-/issues/238
2022-10-23 20:25:08 +03:00
Sebastian Dröge f058a5e229 Various minor cleanups 2022-10-22 19:50:24 +03:00
Sebastian Dröge 12400b6b87 Update everything for element factory builder API changes
And set properties as part of object construction wherever it makes
sense.
2022-10-19 19:43:29 +03:00
François Laignel 8011eadfd2 Use new format constructors
See https://gitlab.freedesktop.org/gstreamer/gstreamer-rs/-/merge_requests/1128
2022-10-18 10:36:59 +00:00
Sebastian Dröge e17688a2da Update for pango API changes 2022-10-17 20:02:02 +03:00
Vivia Nikolaidou 0ab965335f onvifmetadataoverlay, cea608overlay: Fix pangocairo::FontMap::new()
It doesn't return an Option anymore.
2022-10-14 18:12:33 +03:00
Sebastian Dröge e49138516c Update for pad default functions API changes 2022-10-12 19:50:15 +03:00
François Laignel bd14e476f1 Fix direct access to the inner specific formatted values
This is no longer available as this could lead to building a defined
value in Rust which could be interpreted as undefined in C due to
the sentinel `u64::MAX` for `None`.

Use the constants (e.g. `ONE`, `K`, `M`, ...) and operations to build
a value and deref (`*`) to get the quantity as an integer.
2022-10-10 19:28:13 +02:00
Seungha Yang b1b707008f jsontovtt: Print object information to debug message
Use GST_*_OBJECT() variant debug printing method whenever possible
2022-10-10 22:28:30 +09:00
Seungha Yang 3d317b976e jsontovtt: Add timeout property
As described in the spec D.4 Automatic Caption Blanking,
allows automatic clear if user specified timeout value
2022-10-10 22:16:15 +09:00
Sebastian Dröge 7ee4afacf4 Change *Impl trait methods to only take &self and not Self::Type in addition 2022-10-10 15:03:25 +03:00
François Laignel 7818ac658b Use GFV::none_for_format where applicable 2022-10-08 18:29:10 +02:00
Nirbheek Chauhan 1d4d3e4cb0 build: Update versions to be 0.9.0-alpha.1
0.9.0 is the next release, so we can't name things that already.

Also the version in meson.build was 0.13.0, which is completely wrong.
2022-10-04 21:27:23 +05:30
Seungha Yang 9740140798 jsontovtt: Don't push zero-duration cue data
It will likely confuse players. We can drop corresponding
cue since the text line will be included in the next cue
2022-09-29 23:02:38 +09:00
Seungha Yang 6772e49712 cea608tojson: Clip column number if it exceeds allowed value
... as described in the spec
2022-09-28 01:41:36 +09:00
Sebastian Dröge 1a40186485 Update for GLib ParamSpec builder API changes 2022-09-05 11:45:47 +03:00
Sebastian Dröge 46dddaf31c Update minimum supported Rust version to 1.63 2022-09-04 21:31:55 +03:00
Thibault Saunier 67e651f57c Allow "unused_doc_comments" as we use hotdoc and not rustdoc 2022-08-29 18:33:22 -04:00
Thibault Saunier 31a53bba8a Generate plugins documentation using hotdoc
Which will automatically be integrated in gstreamer documentation
2022-08-29 18:33:22 -04:00
Vivia Nikolaidou 5606111345 plugins: Simplify code using ParamSpecBuilder 2022-08-22 17:58:43 +03:00
Sebastian Dröge 2b61d51e91 Remove unnecessary unsafe blocks for Buffer::as_ptr() 2022-08-12 18:12:22 +03:00
François Laignel 5c5c15d36a Simplify Formatted value handling
See https://gitlab.freedesktop.org/gstreamer/gstreamer-rs/-/merge_requests/1059
2022-07-11 21:21:54 +02:00
Sebastian Dröge 51c7d0652e Fix/silence a couple new clippy warnings 2022-06-30 16:07:32 +03:00
Mathieu Duponchelle 806d101d87 transcriberbin: remove print statement
Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-rs/-/merge_requests/784>
2022-06-17 16:14:54 +02:00
Mathieu Duponchelle 05ece5560e tttocea608: expose roll-up timeout property
In roll-up mode, when no more timed text comes in, the closed
captions may remain displayed on screen indefinitely (unless the
decoder implements a timeout, but that is not mandatory).

Expose a property to erase the display memory after a configurable
amount of time has elapsed instead.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-rs/-/merge_requests/754>
2022-05-11 01:47:52 +02:00
Mathieu Duponchelle 6b80fdc270 cea608overlay: handle CLEAR status
+ log errors

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-rs/-/merge_requests/754>
2022-05-10 18:52:56 +02:00
Sebastian Dröge 4a2c93299e mccparse/sccparse: Don't log gst::FlowError::Flushing or Eos as error to the debug logs 2022-05-03 15:32:07 +03:00
Sebastian Dröge ae32cc7f2b closedcaption: Update to uuid 1.0 2022-04-22 13:18:26 +00:00
Seungha Yang 558656deb5 transcriberbin: Protect runtime "passthrough=false" change
There can be small race where transcription-bin is linked with
tee but state change of the transcription-bin is not finished.
And at the same time, upstream pushes event/buffer to the
transcription-bin. Do state change first then link to avoid
the condition

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-rs/-/merge_requests/716>
2022-04-08 21:55:54 +00:00
Sebastian Dröge 518e43fc5f cea608tott: Don't zero-pad SRT indices but zero-pad hours to at least two digits
Zero-padding is not specified for the indices but all time components
need to be zero-padded (3 digits for fractional seconds, 2 digits for
everything else).
2022-03-28 12:17:34 +03:00
Ray Tiley dd028ce97e [transcriberbin] - make audioqueue leaky
If transcription runs slow or has issues the queue can fill up and block
all audio processing. This gives the queue a sufficent buffer and allows
it to drop audio if it eventually fills up. This was most noticable with
bad internet connections using the `awstrnascriber` where it would take
quite a while for the websocket to eventually timeout and the bin to
enter `passthrough=true`.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-rs/-/merge_requests/688>
2022-03-15 20:27:02 +00:00
Seungha Yang aac7e52d87 transcriberbin: Don't notify signal inside lock
That can potentially cause deadlock
2022-03-10 20:10:30 +09:00
Seungha Yang 9e6fc2983f transcriberbin: Add caption-source property
By using this new property, application can select exclusive caption
source. There are three source types
- Both: Inband and transcription captions are combined if exist.
  This is default behavior.
- Inband: Transcription buffers will be dropped
- Transcription: Caption meta of each video buffer will be dropped

In this version, transcriberbin doesn't provide any hint
for application to help caption source decision. That can be done
by application's strategy, passthrough status or probing inband
caption meta for example.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-rs/-/merge_requests/684>
2022-03-08 23:51:28 +09:00
Seungha Yang ecf03d0e5c transcriberbin: Fix deadlock
Fix race between latency query handler and setup_transcription()
method.

Locking order of setup_transcription() is
state lock -> setup_transcription() -> settings lock
So taking state lock inside of setting lock in src_query()
can cause deadlock.
2022-03-08 22:38:55 +09:00
Sebastian Dröge b38f6cc731 Remove now unnecessary Send+Sync impls for element/etc subclasses
This is now automatically implemented.
2022-02-28 18:56:58 +02:00
François Laignel 2cf84d5ce8 Update minimum supported Rust version to 1.57 2022-02-21 23:32:32 +01:00
François Laignel 422ea740ca Update to gst::_log_macro_
See the details:
https://gitlab.freedesktop.org/gstreamer/gstreamer-rs/-/merge_requests/980
2022-02-21 20:50:01 +01: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 b2d0172422 Replace Foo::from_instance(foo) with foo.imp() 2022-01-17 19:36:41 +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
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
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
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 c5d3a2efce Update for event API changes 2021-10-17 17:30:38 +03:00
Sebastian Dröge fe0075ad15 closedcaption/cea608overlay: Proxy the allocation query 2021-10-16 16:21:49 +03:00
Sebastian Dröge 6ec98ec5e4 Update to pretty-assertions 1.0 2021-10-14 10:20:19 +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 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