Commit graph

235 commits

Author SHA1 Message Date
Matthew Waters df30d2fbd3 transcriberbin: add support for generating cea708 captions
Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-rs/-/merge_requests/1406>
2024-03-28 13:46:28 +11:00
Matthew Waters b0cf7e5c81 cea708mux: add element muxing multiple 708 caption services together
Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-rs/-/merge_requests/1406>
2024-03-28 13:46:28 +11:00
Matthew Waters 756abbf807 tttocea708: add element converting from text to cea708 captions
Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-rs/-/merge_requests/1406>
2024-03-28 13:46:28 +11:00
Philippe Normand be12c0a5f7 Fix clippy warnings after upgrade to Rust 1.77
Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-rs/-/merge_requests/1512>
2024-03-21 17:33:32 +00:00
Seungha Yang 237f22d131 sccparse: Ignore invalid timecode during seek as well
sccparse holds last timecode in order to ignore invalid timecode
and fallback to the previous timecode. That should happen
when sccparse is handling seek event too. Otherwise single invalid
timecode before the target seek position will cause flow error.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-rs/-/merge_requests/1485>
2024-03-06 11:12:04 +00:00
Sebastian Dröge 5df7c01cb5 closedcaption: Port from nom to winnow
Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-rs/-/merge_requests/1475>
2024-02-26 14:00:08 +02:00
Bilal Elmoussaoui 0615a16124 Use workspace features for crates metadata/deps
Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-rs/-/merge_requests/1446>
2024-02-05 15:34:31 +01:00
Sebastian Dröge 1a55c70114 Switch git dependencies to explicitly name branch
Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-rs/-/merge_requests/1445>
2024-02-05 12:51:36 +02:00
Sebastian Dröge 4ad101b53b Use once_cell crate directly again
The glib crate does not depend on it anymore and also does not re-export
it anymore.

Also switch some usages of OnceCell to OnceLock from std.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-rs/-/merge_requests/1441>
2024-01-31 18:07:57 +02:00
Sebastian Dröge 763739e3ae Update for Buffer / Memory API changes
Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-rs/-/merge_requests/1409>
2023-12-17 14:07:12 +02:00
Matthew Waters d644bcd79a closedcaption: update to cea708-types 0.3
Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-rs/-/merge_requests/1398>
2023-11-22 10:07:45 +11:00
Matthew Waters 5739a3d86f cea608tocea708: create service's as requested
Allows the ability to push multiple Service blocks of the same service
into the same packet if necessary (unlikely but possible).

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-rs/-/merge_requests/1398>
2023-11-22 00:12:50 +11:00
Matthew Waters ded4261971 closedcaption: move some textstyle helpers to shared files
Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-rs/-/merge_requests/1398>
2023-11-21 23:33:09 +11:00
Matthew Waters fb9b511e15 closedcaption: move 708 service writing to shared file
Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-rs/-/merge_requests/1398>
2023-11-21 23:33:09 +11:00
Matthew Waters 4333e90220 tttocea608: use crate defined is_* functions instead of reeimplementing them
Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-rs/-/merge_requests/1398>
2023-11-21 23:33:09 +11:00
Sebastian Dröge a33f29365a sccparse: Fix leading spaces between the tab and caption data
CCExtractor is creating files like this.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-rs/-/merge_requests/1378>
2023-11-02 21:59:02 +02:00
Sebastian Dröge 16b917abb1 Update for gst::Rank API changes 2023-11-02 14:10:59 +02:00
Sebastian Dröge 855b03a9ea Use let-else instead of match for weak reference upgrades
Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-rs/-/merge_requests/1375>
2023-10-30 11:34:35 +02:00
Sebastian Dröge d468e1e4a6 Clean up usage of pad probes
Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-rs/-/merge_requests/1361>
2023-10-17 08:44:06 +03:00
Sebastian Dröge d688aeb184 Update versions to 0.12.0-alpha.1 2023-08-10 17:21:11 +03:00
Sebastian Dröge 3b41f206bc Don't generate .def files for plugins
Fixes https://gitlab.freedesktop.org/gstreamer/gst-plugins-rs/-/issues/389

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-rs/-/merge_requests/1299>
2023-08-09 13:54:34 +03:00
Seungha Yang 516c623df5 transcriberbin: Configure audioresample in front of transcriber
Allows any samplerate and make it negotiable. Fixing a scenario
where transcriberbin is configured with passthrough enabled,
(and negotiated samplerate is not supported by transcriber)
and then setting passthrough=false later during playback.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-rs/-/merge_requests/1287>
2023-07-24 22:51:07 +09:00
Sebastian Dröge 31b1cb8ca6 Update minimum supported Rust version to 1.70
gtk-rs will update soonish too.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-rs/-/merge_requests/1280>
2023-07-19 09:19:34 +03:00
Sebastian Dröge bbd3d9ffe0 Remove unnecessary mut everywhere
Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-rs/-/merge_requests/1273>
2023-07-11 10:09:35 +03:00
Bilal Elmoussaoui dd2d7d9215 Use re-exported once_cell
Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-rs/-/merge_requests/1268>
2023-07-06 17:50:49 +03:00
Seungha Yang 02c77d2e44 mccparse: Map timecode to PTS directly without offset
Assumes that caption stream's timeline starts from zero,
and maps timecode time_since_daily_jam() to PTS directly without
subtracting the first seen timecode.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-rs/-/merge_requests/1246>
2023-06-16 01:06:26 +09:00
François Laignel 7ba0073052 use Pad builders for optional name definition
Also, apply auto-naming in the following cases

* When building from a non wildcard-named template, the name of the template is
  automatically assigned to the Pad. User can override with a specific name by
  calling `name()` on the `PadBuilder`.
* When building with a target and no name was provided via the above, the
  GhostPad is named after the target.

See https://gitlab.freedesktop.org/gstreamer/gstreamer-rs/-/issues/448
Auto-naming discussion: https://gitlab.freedesktop.org/gstreamer/gstreamer-rs/-/merge_requests/1255#note_1891181

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-rs/-/merge_requests/1197>
2023-05-12 12:55:31 +02:00
François Laignel 8e93d294e5 Update to argumentless {Bin,Pipeline}::new
See https://gitlab.freedesktop.org/gstreamer/gstreamer-rs/-/issues/449

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-rs/-/merge_requests/1197>
2023-05-12 12:55:31 +02:00
Seungha Yang 773fcd0780 transcriberbin: Add "language-code" property
Proxy the child transcriber element's property so that transcriberbin
can apply the property with required state management

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-rs/-/merge_requests/1205>
2023-05-10 19:12:01 +00:00
Mathieu Duponchelle 355f925954 tttocea608: specify raw 608 field
The element can only output field=0 raw 608 data.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-rs/-/merge_requests/1166>
2023-04-11 09:26:24 +10:00
Guillaume Desmottes 403004a85e fix typos
Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-rs/-/merge_requests/1170>
2023-04-10 13:35:32 +02:00
Seungha Yang 6e36e2ddfd transcriberbin: Allow video with ANY caps features
transcriberbin does not read/write video buffers actually.
Allow ANY caps features in order to avoid unnecessary GPU
upload/download

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-rs/-/merge_requests/1165>
2023-04-08 02:40:49 +09:00
Mathieu Duponchelle c846147275 transcriberbin: require final framerate from cea608mux
Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-rs/-/merge_requests/1164>
2023-04-07 17:46:45 +02:00
Seungha Yang 538e2e0c9e transcriberbin: Add support for runtime translation-languages update
Allows updating translation-languages at runtime

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-rs/-/merge_requests/1162>
2023-04-06 21:43:04 +09:00
Seungha Yang 65c6117962 transcriberbin: Wrap conversion channel elements into bin
Make dynamic reconfiguration easier

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-rs/-/merge_requests/1162>
2023-04-06 11:49:36 +00:00
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