Commit graph

464 commits

Author SHA1 Message Date
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 dd67dc87e3 gtk4: Update to windows-sys 0.52
Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-rs/-/merge_requests/1395>
2023-11-17 11:00:55 +02: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 74c04d79c9 gtk4: Use async-channel instead of the glib MainContext channel
The latter will be removed in favour of using async code in the future,
and async code generally allows for more flexible message handling than the
callback based MainContext channel.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-rs/-/merge_requests/1375>
2023-10-30 11:21:25 +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 450ffbe452 Update for VideoFrame / GLVideoFrame API changes
Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-rs/-/merge_requests/1345>
2023-10-02 13:25:25 +03:00
Sebastian Dröge 95a7a3c0ec gtk4: Only support RGBA/RGB in the GL code path
For all other component orderings a shader is necessary to re-order the
components for what GTK expects.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-rs/-/merge_requests/1312>
2023-09-20 13:22:41 +03:00
Ivan Molodetskikh c237cf2c34 gtk4: Premultiply alpha in GL textures
GTK expects GL textures to have premultiplied alpha. The ones we get
from GStreamer don't, leading to incorrect rendering of semitransparent
frames.

GTK 4.12 gained an API to set a different GL texture format, but it
won't help for older GTK versions. Plus, at the time of writing, it
causes a very slow download/upload path in GTK.

So, use a GTK GL shader node to premultiply the alpha without leaving
the GPU.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-rs/-/merge_requests/1312>
2023-09-20 13:04:59 +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
Bilal Elmoussaoui 2cc98bf410 Adapt to glib::Continue rename
Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-rs/-/merge_requests/1268>
2023-07-06 17:50:49 +03:00
yatinmaan 1ed9992775 gtk4: Add python example
Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-rs/-/merge_requests/1259>
2023-07-02 00:31:32 +00:00
Sebastian Dröge bbb88da9e0 videofx: Minimize dependencies of the image crate
Only the basic infrastructure is needed and none of the
decoders/encoders for various image formats.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-rs/-/merge_requests/1260>
2023-06-26 14:21:44 +03:00
Sebastian Dröge 042a297d1a gtk4: Update to windows-sys 0.48
Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-rs/-/merge_requests/1260>
2023-06-26 14:19:22 +03:00
Jayson Reis e58abf0705 gtk4: Make winegl code compilable
Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-rs/-/merge_requests/1255>
2023-06-23 11:16:40 +03:00
Jayson Reis d3d78846dc gtk4: Fix code to run on current main branch
Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-rs/-/merge_requests/1255>
2023-06-22 14:45:28 +02:00
Sebastian Dröge dcb80ac105 gtk4: Add support for GL on Windows
This implements all the workarounds for Windows-specific complications
that the GTK GStreamer mediafile implementation also does.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-rs/-/merge_requests/1255>
2023-06-22 07:43:57 +02: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
Sanchayan Maity 067d47f0ec videofx: border: Do not advertise I420 for non-zero border radius
In certain cases, roundedcorners would negotiate to I420 even when user
supplied a non-zero border radius.

For example, the below pipeline leads to I420 being negotiated even
though a non-zero border radius was given. Ideally, this pipeline
should have failed at the negotiation stage.

```bash
gst-launch-1.0 -v \
   videotestsrc num-buffers=1000 pattern=white ! \
   video/x-raw,width=320,height=180 ! \
   roundedcorners border-radius-px=10 ! videobox border-alpha=0 top=-10 left=-10 right=-10 bottom=-10 fill=yellow ! \
   compositor name=comp sink_0::xpos=960   sink_0::ypos=0  sink_0::width=320 sink_0::height=180 sink_0::alpha=1.0 sink_1::xpos=960 sink_1::ypos=180  sink_1::width=320 sink_1::height=180 sink_1::alpha=1.0  \
   sink_2::xpos=960 sink_2::ypos=360  sink_2::width=320 sink_2::height=180 sink_2::alpha=1.0 sink_3::xpos=0 sink_3::ypos=0  sink_3::width=960 sink_3::height=720 sink_3::alpha=1.0 ! \
   video/x-raw,width=1280,height=720! x264enc ! mp4mux ! filesink location=test.mp4 \
   videotestsrc num-buffers=1000 pattern=red ! \
   video/x-raw,width=320,height=180 ! roundedcorners border-radius-px=10 ! comp. \
      videotestsrc num-buffers=1000 pattern=blue ! \
   video/x-raw,width=320,height=180 ! roundedcorners border-radius-px=10 ! comp. \
      videotestsrc num-buffers=1000 pattern=green ! \
   video/x-raw,width=960,height=720 ! roundedcorners border-radius-px=10 ! comp.
```

If border radius is non-zero, we should not really allow negotiation
to select I420. Fix this by returning only A420 for border-radius > 0
in `transform_caps` instead of returning both like earlier.

Another example of a simpler pipeline like below which would earlier work

```bash
gst-launch-1.0 videotestsrc pattern=red ! videoconvert ! video/x-raw,width=1923,height=1087,format=I420 ! roundedcorners border-radius-px=40 ! video/x-raw,format=I420 ! videoconvert ! gtksink
```

now fails with

```bash
WARNING: erroneous pipeline: could not link roundedcorners0 to videoconvert1, roundedcorners0 can't handle caps video/x-raw, format=(string)I420
```

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-rs/-/merge_requests/1211>
2023-05-15 12:19:09 +05:30
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
Jan Beich 8d6751c88d gtk4: unbreak wayland, x11egl, x11glx features on non-Linux
As the features are non-default leave the responsibility to filter by
platform to consumers.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-rs/-/merge_requests/1191>
2023-04-22 12:58:29 +00:00
Sebastian Dröge cc3646640e Fix a couple of new Rust 1.69 clippy warnings
Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-rs/-/merge_requests/1186>
2023-04-20 16:47:45 +03:00
Sebastian Dröge 47159ad3c2 Make sure to keep around and drop bus watches after usage in all the examples 2023-04-14 12:46:43 +03:00
Arun Raghavan aabfb61834 ffv1dec: Drop rank for now
We'll keep the rank lower than avdec_ffv1, at least until we're
comfortable with support for the entire range of possible inputs working
well.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-rs/-/merge_requests/1174>
2023-04-13 15:58:49 +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
Carlo Cabrera 825fe9a4e2 gtk4: Fix compilation on macOS
Fixes https://gitlab.freedesktop.org/gstreamer/gst-plugins-rs/-/issues/332

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-rs/-/merge_requests/1138>
2023-03-18 16:05:30 +02:00
Sebastian Dröge f7c8940ff2 gtk4: Update for glib::Priority API changes
Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-rs/-/merge_requests/1132>
2023-03-12 10:27:16 +02: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 fc5ed15af5 Update for gst::Element::link_many() and related API generalization
Specifically, get rid of now unneeded `&`.
2023-03-09 16:46:52 +02:00
Sebastian Dröge 3ef8a48ded Fix a few new clippy warnings
Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-rs/-/merge_requests/1120>
2023-03-07 08:47:01 +00:00
Sebastian Dröge bca4af0c79 gtk4: Set sync point on the video frame after mapping it
Otherwise it is not always ready for use yet in GTK even after waiting
on the sync point, and a fully transparent texture is rendered instead.

Fixes https://gitlab.freedesktop.org/gstreamer/gst-plugins-rs/-/issues/320

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-rs/-/merge_requests/1103>
2023-02-24 11:52:28 +02:00
Jordan Petridis 90455a8111 video/gtk4: Add a flatpak snippet example in the README
Close #155

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-rs/-/merge_requests/1102>
2023-02-22 22:15:40 +02:00
Sebastian Dröge ce1faa6020 gtk4: Attach channel receiver to the default main context from the main thread
It requires acquiring the main context for thread-safety reasons and
that is only possible from the main thread itself.

Fixes https://gitlab.freedesktop.org/gstreamer/gst-plugins-rs/-/issues/319

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-rs/-/merge_requests/1099>
2023-02-22 10:02:45 +02:00
Sebastian Dröge f08b65ece1 gtk4: Don't unnecessarily set the sink to READY to retrieve the context
That's not needed and will cause the GL context messages to be not
distributed inside the pipeline.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-rs/-/merge_requests/1099>
2023-02-21 21:36:45 +02:00
Sebastian Dröge 8aa5125d5b gtk4: Refactor and simplify GL context handling
Create a single, global GDK GL context and the corresponding GStreamer
GL display and wrapped GStreamer GL context when initializing the first
sink and continue using that for all further sinks.

Additionally, don't create a full GStreamer GL context inside the sink
but only distribute the wrapped GL context in the pipeline so that
elements that actually need a full GL context can create one that is
sharing with that one. The sink itself does not need a full GStreamer GL
context.

Then inside the sink check that any GL memory that arrives was created
by a GL context that can share with the wrapped GDK GL context and only
then use it.

And lastly, use the correct GL contexts for a) creating a sync point and
b) actually waiting on it.

Fixes https://gitlab.freedesktop.org/gstreamer/gst-plugins-rs/-/issues/318

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-rs/-/merge_requests/1099>
2023-02-21 21:36:45 +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 44405e0cd7 dav1ddec: Make sure to call get_picture() twice in a row when draining
The first time might return `EAGAIN` if there are pending frames but
there is no decoded frame available yet. The second time it will
actually wait for frames to become available and only start returning
`EAGAIN` again once no more frames are left.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-rs/-/merge_requests/1080>
2023-02-08 11:26:25 +02:00
Sebastian Dröge 5c2de6aeb6 gtk4: Update for GLDisplay object lock requirements 2023-02-06 11:10:02 +02:00
Sebastian Dröge c7209dbd4f Return exit code from gio::Application::run() from main()
Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-rs/-/merge_requests/1065>
2023-01-27 18:50:01 +00:00
Sebastian Dröge 62bfc545d3 gtk4: Fix compilation after gst_gl::Display API changes 2023-01-27 20:46:22 +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 e0e63dd4da dav1d: Don't treat any kind of bitstream error immediately as fatal
Instead use the videodecoder error handling to allow up to max-errors
consecutive decoding errors, i.e. infinite by default in 1.22 and newer.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-rs/-/merge_requests/1057>
2023-01-23 10:46:38 +02:00
Sebastian Dröge 037294b077 dav1d: Get rid of some unnecessary unwrap()s
Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-rs/-/merge_requests/1055>
2023-01-22 00:32:52 +02:00
Sebastian Dröge f62d07633d dav1d: Remove unnecessary frame dropping loop
After flushing there are no frames left anymore that could be dropped.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-rs/-/merge_requests/1055>
2023-01-22 00:28:15 +02:00
Sebastian Dröge c5a625ae28 dav1d: Don't flush the decoder when draining
This directly discards all frames and it won't be possible to output
them anymore.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-rs/-/merge_requests/1055>
2023-01-22 00:27:22 +02:00
Sebastian Dröge d110977580 dav1d: Only drain at most one decoded frame per input frame unless the decoder requires more before accepting new data
This works around a race condition in dav1d where the decoder deadlocks
if multiple threads are used, and also is generally beneficial as it
allows for proper frame threading.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-rs/-/merge_requests/1055>
2023-01-22 00:25:23 +02:00
Sebastian Dröge 458b2386ed Update for glib API changes 2023-01-21 18:13:48 +02:00
Sebastian Dröge b6af64b970 gtk4: Only provide a buffer pool to upstream if it requested one 2023-01-19 16:37:02 +02:00
Sebastian Dröge d1196c3e28 gtk4: Update for allocation query caps API changes
And make no caps into a non-error.
2023-01-19 16:36:37 +02:00
Sebastian Dröge 03df4f253c gtk4: Asynchronously flush frames from GDK
There is no need to wait until the frames are flushed as the textures
will be kept alive until GDK is finished with them, and doing so can
cause deadlocks.

Fixes https://gitlab.freedesktop.org/gstreamer/gst-plugins-rs/-/issues/287

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-rs/-/merge_requests/1052>
2023-01-19 13:53:21 +02:00
Sebastian Dröge b161f56a5c gtk4: Keep GstGLMemory alive as long as it is used inside GDK
Otherwise the texture might be released in the meantime and GDK would
use an invalid GL texture ID.

Fixes https://gitlab.freedesktop.org/gstreamer/gst-plugins-rs/-/issues/287

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-rs/-/merge_requests/1052>
2023-01-19 13:51:57 +02:00
Sebastian Dröge 4464bf2eaa Update for gtk::Application constructor API changes 2023-01-16 11:51:10 +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 1a06f5e671 rav1e: Enable threading support
Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-rs/-/merge_requests/1039>
2023-01-09 14:04:13 +02:00
Sebastian Dröge 58c21d9868 gtk4: Propagate the GL display to the remainder of the pipeline
This allows sharing it with other parts of the pipeline and avoids
creating different, incompatible displays/contexts in different parts of
the pipeline.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-rs/-/merge_requests/1037>
2023-01-07 12:42:42 +02:00
Sebastian Dröge 27435ad82e Update for API changes 2023-01-05 12:33:54 +02:00
Sebastian Dröge de23ea7f29 video: Fix compilation after API changes 2023-01-04 13:39:14 +02:00
Sebastian Dröge 439ada614c gtk4: Rename a variable to make more sense
Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-rs/-/merge_requests/1032>
2022-12-29 11:13:25 +02:00
Sebastian Dröge f72540f5c2 gtk4: Handle more GL context creation failures gracefully
Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-rs/-/merge_requests/1032>
2022-12-29 11:13:25 +02:00
Sebastian Dröge 9ec06199b1 gtk4: Reset app context and display if GL context creation fails
No need to keep them around and that way we either have all 3 values set
or none of them.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-rs/-/merge_requests/1032>
2022-12-29 11:13:25 +02:00
Sebastian Dröge 4ee70913bd gtk4: Reduce number of unwraps during GL context creation and query handling
Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-rs/-/merge_requests/1032>
2022-12-29 11:13:25 +02:00
Jordan Petridis cf0ba40115 video/gtk4: Fix typo in info logs
Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-rs/-/merge_requests/1030>
2022-12-29 02:59:26 +00:00
Nirbheek Chauhan 9ee7118bf6 gtk4: Remove 'gst' prefix from another debug category
Missed it last time. Caught all of them this time. Continuation from:

https://gitlab.freedesktop.org/gstreamer/gst-plugins-rs/-/merge_requests/1029

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-rs/-/merge_requests/1025>
2022-12-28 23:55:10 +05:30
Nirbheek Chauhan 06123d74ba gtk4: Use GL implicitly without the gst_gl feature on macOS
We already require gstreamer-gl as a dependency on macOS, so reflect
that in the code too.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-rs/-/merge_requests/1025>
2022-12-28 23:55:10 +05:30
Sebastian Dröge 4fe0786bbd gtk4: Add support for GL on macOS
Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-rs/-/merge_requests/1025>
2022-12-28 23:55:10 +05:30
Nirbheek Chauhan ae9ac872c0 gtk4: Remove 'gst' from gtksink debug category name
Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-rs/-/merge_requests/1029>
2022-12-28 19:38:57 +05:30
Sebastian Dröge ca17c9bc4f gtk4: Release GStreamer GL context and display when going back to NULL state
And acquire it again next time when going to READY state.

Also clean up the whole GL context initialization.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-rs/-/merge_requests/1024>
2022-12-22 22:56:48 +00:00
Sebastian Dröge 1026949b2b gtk4: Use glib::ThreadGuard instead of the fragile crate
Fixes https://gitlab.freedesktop.org/gstreamer/gst-plugins-rs/-/issues/272

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-rs/-/merge_requests/1024>
2022-12-22 22:56:48 +00:00
Sebastian Dröge 52764e140e gtk4: Don't try to use GL mapped video frames as raw RGB memory
This will fail badly because the memory pointers are actually GL texture
IDs, however this case can't really happen in practice so simply assert
on this.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-rs/-/merge_requests/1024>
2022-12-22 22:56:48 +00:00
Sebastian Dröge 30e501e7b0 gtk4: Don't error out when the main context channel does not exist anymore when rendering
But instead return flushing to shut down silently.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-rs/-/merge_requests/1024>
2022-12-22 22:56:48 +00:00