Commit graph

316 commits

Author SHA1 Message Date
Matt Feury bb711444b6 rtspsrc: Consider "451: Parameter Not Understood" when handling broken control urls
similar to https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/3854

it seems that some implementations return this when
the server does not implement URL handling correctly

this fixes https://gitlab.freedesktop.org/gstreamer/gstreamer/-/issues/2334

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/4173>
2023-03-14 21:33:21 +00:00
Tim-Philipp Müller 4599796488 Back to development 2023-02-24 00:23:26 +00:00
Tim-Philipp Müller b7d3037cca Release 1.20.6 2023-02-23 18:23:11 +00:00
Tim-Philipp Müller 1c37d0ddec Update ChangeLogs for 1.20.6 2023-02-23 18:22:59 +00:00
Seungha Yang 3553194926 qtmux: Fix assertion on caps update
GstQTMuxPad.configured_caps should be protected since it's
updated from streaming thread and accessed in aggregate thread

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/4048>
2023-02-22 17:46:02 +00:00
Sebastian Dröge 3e596c9038 qtmux: Implement writing of av1C version 1 box
Version 0 is ancient and not specified in any documents. Take it
directly from the `codec_data` if presents or otherwise try to construct
a reasonably looking `av1C` box.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/4028>
2023-02-21 19:11:34 +00:00
Sebastian Dröge 9ab884833b qtdemux: Drop av1C version 0 parsing and implement version 1 parsing
The av1C box is optional so dropping parsing does not break anything
fundamentally, and there seems to be no historical record how version 0
even looks like while the comments and the parsing disagreed with each
other.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/4028>
2023-02-21 19:11:34 +00:00
Enrique Ocaña González eb5e90905c qtdemux: Don't emit GstSegment correcting start time when in MSE mode
When using qtdemux in a pipeline that should only work as a pure demuxer (not
for actual playback), qtdemux shouldn't emit new GstSegments to correct
the start time (jump to the future) to ensure that the user experiences no
playback delay. By doing so, it's generating the wrong segments when an append
of data from the past happens. When that happens, downstream elements such as
parsers (eg: aacparse) may clip those buffers laying before the GstSegment and
create problems on the GStreamer client app (eg: WebKit).

Getting buffers clipped out because of the wrong GstSegments started becoming
a problen when this commit was introduced:

ab6e49e9cc audioparsers: add back segment clipping to parsers that have lost it

This clipping makes test DASH shaka 35 from MVT tests[1] to fail in
WebKitGTK/WPE (at least) and can potentially cause a number of other problems
in the WebKit Media Source Extensions (MSE) code.

Note that this new behaviour of not emitting new GstSegments only makes sense
when qtdemux is being used as a pure demuxer and not as part of a regular
pipeline. This is why the variant field has been added. When equal to
VARIANT_MSE_BYTESTREAM, it will make qtdemux behave differently in push mode,
taking decisions that meet the expectations for an MSE-like processing mode.
This kind of tweaks have been done in the past for MSS streams, for instance.
That code has been refactored to use VARIANT_MSS_FRAGMENTED now, instead of
its own dedicated boolean flag.

Co-authored by: Alicia Boya García <ntrrgc@gmail.com>

...who suggested to use "variant: mse-bytestream" in the caps to identify that
mode, as proposed in her unmerged patch:

https://gitlab.freedesktop.org/gstreamer/gst-plugins-good/-/issues/467

[1] https://github.com/rdkcentral/mvt

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/3995>
2023-02-21 11:35:37 +00:00
Marek Vasut 997c3f4013 jpegdec: Disable libjpeg-turbo SIMD acceleration support for now
The libjpeg-turbo SIMD acceleration support suffers from multiple
unresolved cornercases. Disable the libjpeg-turbo for now until
those cornercases are resolved.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/3704>
2023-02-08 10:50:00 +00:00
Sebastian Dröge 37999359a9 rtspsrc: Also consider "Method Not Valid In This State" error in broken control URL handling workaround
Some servers send a 455 error instead of any reasonable error when using
a correctly constructed control URL.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/3861>
2023-02-01 14:17:21 +00:00
Jan Schmidt f3b8f1d5b0 qmlglsrc: Handle HiDPI scaling
When calculating the capture framebuffer size, include
any device scaling applied to the rendered framebuffer

Fixes only capturing part of the window when there is
a global scale factor.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/3622>
2023-01-31 12:21:27 +00:00
Jan Schmidt 64ec73f313 qmlglsrc: Unmap buffer before adding sync meta
Adding a sync meta to a GstBuffer requires that it
be writable. Mapping the buffer with the video frame API
holds an extra ref on the buffer, so unmap before
trying to modify it.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/3622>
2023-01-31 12:21:27 +00:00
Jan Schmidt d43ef0165e qmlglsrc: Stop when basesrc calls unlock()
Instead of stopping capture when the state changes,
handle other cases of basesrc stopping capture by - such
as handling an EOS event - by implementing an unlock()
method

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/3622>
2023-01-31 12:21:27 +00:00
Pawel Stawicki d8bef5c7e7 v4l2h264dec: Fix Raspberry Pi4 will not play video in application
Ensure object v4l2object->pool will be released by
correctly releasing the temporary thread-safety lock

Fixes issue #1729

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/3795>
2023-01-26 03:55:49 +00:00
Mathieu Duponchelle f08994583f redenc: fix setting of extension ID for twcc
1 was previously hardcoded in, and the bug went under the radar because
webrtcsink hardcodes the number too.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/3793>
2023-01-26 02:49:50 +00:00
Tim-Philipp Müller d7bc595acd gst-plugins-good: update translations
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/3764>
2023-01-21 11:15:53 +00:00
Sebastian Dröge 44532db218 matroska: Add stream-format = (string) obu-stream to AV1 caps
Anything else is not allowed in Matroska/WebM.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/3741>
2023-01-19 19:54:01 +02:00
Sebastian Dröge c03a6d0ea2 isomp4: Add stream-format = (string) obu-stream to AV1 caps
Anything else is not allowed in MP4.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/3741>
2023-01-19 19:54:01 +02:00
Mathieu Duponchelle 903289613b qtmux: For video with N/1001 framerates use N as timescale instead of centiframes
This is recommended by various specifications for such framerates, while
for integer framerates we continue using centiframes to allow for some
more accuracy.

Using N means that no rounding error accumulates, eventually leading to
outputting a packet with a different duration.

Some tools such as MediaInfo determine that a stream is variable
framerate if any packet has a different duration than the others, and
there is no reason I can see for not using the full 4 bytes of
resolution that the mp4 timescale offers.

Example problematic pipeline:

```
videotestsrc num-buffers=5001 ! video/x-raw,framerate=60000/1001,width=320,height=240 ! \
videoconvert ! x264enc bitrate=80000 speed-preset=1 tune=zerolatency ! h264parse ! \
video/x-h264,profile=high-10 ! mp4mux ! filesink location="result2.mp4"
```

This results in a media file that MediaInfo detects as variable
framerate because the 5000th packet has duration 99 instead of 100.

With this patch, the timescale is 60000 and all packets have duration
1001.

Related issue for context: https://bugzilla.gnome.org/show_bug.cgi?id=769041

Co-authored-by: Sebastian Dröge <sebastian@centricular.com>
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/3683>
2023-01-04 18:01:50 +00:00
Seungha Yang e2f30cd947 gtkbasesink: Fix widget leak
gst_gtk_base_sink_get_widget() will increase refcount and it should
be released after use

Fixing regression introduced by the commit
941c0e81dd

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/3650>
2022-12-28 11:46:14 +01:00
Seungha Yang d5086a1091 rtspsrc: Fix string leak
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/3648>
2022-12-27 21:43:02 +01:00
Seungha Yang 620974352d rtptimerqueue: Fix memory leak
Should chain up to parent's finalize

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/3648>
2022-12-27 21:43:02 +01:00
Matthias Fuchs 10fee807b9 qmlglsrc: Fix deadlock when stopping
This fix makes sure that streaming thread stops waiting when the
qmlglsrc element transitions from playing to paused.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/3619>
2022-12-22 01:57:36 +00:00
Tim-Philipp Müller 4a99827d4c Back to development 2022-12-20 00:39:36 +00:00
Tim-Philipp Müller f7806a854a Release 1.20.5 2022-12-19 23:34:46 +00:00
Tim-Philipp Müller 554efedd44 Update ChangeLogs for 1.20.5 2022-12-19 23:34:34 +00:00
Edward Hervey ec2f30c4db imagesequencesrc: Don't leak caps
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/3597>
2022-12-18 19:14:19 +00:00
Nirbheek Chauhan 66ef101cf5 rtspsrc: Fix regression when using hostname in the location property
When the address can't be parsed as an IP address, it should just be
treated as a hostname and used as-is.

Fixes https://gitlab.freedesktop.org/gstreamer/gstreamer/-/issues/1576

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/3596>
2022-12-18 18:16:16 +00:00
Nirbheek Chauhan 0b2db215e9 rtspsrc: Fix usage of IPv6 connections in SETUP
If the SETUP request returns an IPv6 server address in the Transport
field, we would generate an incorrect URI, and multiudpsink would fail
to initialize:

```
     rtspsrc gstrtspsrc.c:9780:dump_key_value:<source>    key: 'Transport', value: 'RTP/AVP;unicast;source=fe80::dc27:25ff:fe5e:bd13:8080;client_port=62696-62697;server_port=4000-4001'
...
     rtspsrc gstrtspsrc.c:4595:gst_rtspsrc_stream_configure_udp_sinks:<source> configure RTP UDP sink for fe80::dc27:25ff:fe5e:bd13:8080:4000
...
multiudpsink gstmultiudpsink.c:1229:gst_multiudpsink_configure_client:<udpsink0> error: Invalid address family (got 23)
```

We can't look at stream->is_ipv6 because we can't rely on the server
returning the right value there. In the issue reported about this,
server reported itself as `KuP RTSP Server/0.1`, and the SDP was:

```
c=IN IP4
m=video 54608 RTP/AVP 96
a=rtpmap:96 H264/90000
```

So we need to parse the string value and figure out the family
ourselves.

Fixes https://gitlab.freedesktop.org/gstreamer/gstreamer/-/issues/1058

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/3596>
2022-12-18 18:15:26 +00:00
Nicolas Dufresne d9ebd9203c v4l2videodec: Fix activation of internal pool
If the driver does not support VIDIOC_CREATE_BUFS ioctl, the pool
configuration may get changed, which requires a validation. This would
fail to activate a pool in a case it shouldn't normally fail unless we
are out of memory.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/2677>
2022-12-18 13:33:27 +00:00
A. Wilcox 9be676306d tests: Cast drop-messages-interval type properly
The rtpjitterbuffer test drop_messages_interval uses a GstClockTime for
the message drop interval.  This property is defined as a guint.  On
systems with 64-bit time_t but 32-bit uint, this can cause the
g_object_set function to fail to read the arguments properly.

Fixes: #1656
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/3582>
2022-12-16 09:36:58 +00:00
Edward Hervey d729dbb717 oss4: Fix debug category initialization
Fixes https://gitlab.freedesktop.org/gstreamer/gstreamer/-/issues/1456

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/3577>
2022-12-15 21:08:48 +00:00
Bo Elmgreen b07f383ba6 qt: deactivate context if fill_info fails
Now the OpenGL context is deactivated if call to gst_gl_context_fill_info()
fails in gst_qt_get_gl_wrapcontext(), preventing that the context is left
activated, which could lead to invalid memory reads.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/3575>
2022-12-15 19:49:14 +00:00
Nicolas Dufresne e14daafdae v4l2src: Fix crash in renegotiation
This regression was introduce by fix for making buffer pool thread safe. When
we renegotiate, the pool will be setup after we set the format. But the code
has been simplified to only get the pool once before, which caused a null
pointer deref.

Fixes 94ba019 ("v4l2: Fix SIGSEGV on 'change state' during 'format change'")
Related to !3481
Fixes #1626

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/3504>
2022-12-10 12:18:51 +00:00
Pawel Stawicki bcd127524f v4l2: Fix SIGSEGV on 'change state' during 'format change'
Ensure all access to v4l2object->pool imply taking a lock and a hard ref on the pool

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/3504>
2022-12-10 12:18:51 +00:00
Jacek Skiba bd39e259e2 qtdemux: exit when protection caps are not defined during PIFF parsing
Reproduction testcase (uses PlayReady):
https://developers.canal-plus.com/rx-player/upc/?appTileLocation=[object%20Object]

In test streams we are using PIFF box, but caps did not had
present GST_PROTECTION_SYSTEM_ID_CAPS_FIELD. In consequence, invalid
system_id was returned which caused SIGSEGV crash.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/3549>
2022-12-10 11:39:48 +00:00
Aleksandr Slobodeniuk ddf3bdd5cf rtspsrc: fix seek event leaks
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/3507>
2022-12-04 14:36:38 +00:00
Philippe Normand bfc0c05e18 flacparse: Fix handling of headers advertising 32bps
According to the flac bitstream format specification, the sample size in bits
corresponding to `111` is 32 bits per sample.

https://xiph.org/flac/format.html#frame_header

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/3518>
2022-12-04 13:18:19 +00:00
Jan Alexander Steffens (heftig) f4bf977719 rtspsrc: Don't replace 404 errors with "no auth protocol found"
When getting a "404 Not Found" response from the DESCRIBE request, the
source produced a "No supported authentication protocol was found" error
instead of passing on the 404, which was confusing.

Only produce this error message when we're handling a response of "401
Unauthorized" without a compatible WWW-Authenticate header.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/3493>
2022-11-30 16:05:08 +01:00
Tim-Philipp Müller 989ac0f0c0 Revert "rtspsrc: Only EOS on timeout if all streams are timed out/EOS"
This reverts commit d186e19568.

This unearthed a whole bunch of other issues for which lots of
other fixes all over the place were required, so let's revert
the backport into the stable branch for now.

https://gitlab.freedesktop.org/gstreamer/gstreamer/-/issues/1530
https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/3271

Fixes #1532

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/3422>
2022-11-16 10:36:32 +00:00
Justin Chadwell 7954f0539f qtdemux: use unsigned int types to store result of QT_UINT32
In a few cases throughout qtdemux, the results of QT_UINT32 were being
stored in a signed integer, which could cause subtle bugs in the case of
an integer overflow, even allowing the the result to equal a negative
number!

This patch prevents this by simply storing the results of this function
call properly in an unsigned integer type. Additionally, we fix up the
length checking with stsd parsing to prevent cases of child atoms
exceeding their parent atom sizes.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/3367>
2022-11-09 10:39:51 +00:00
Tim-Philipp Müller c2f58cf2e3 qt: initialize GError properly in gst_qt_get_gl_wrapcontext()
Spotted by Claus Stovgaard.

Fixes #1545

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/3339>
2022-11-05 01:14:37 +00:00
Sebastian Dröge 4dca76396e qtmux: Add durations to raw audio buffers from the raw audio adapter in prefill mode
This ensures that a duration can also be calculated and stored for the
last buffer at EOS.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/3338>
2022-11-05 00:26:26 +00:00
Sebastian Dröge afa15e6284 qtmux: Release object lock before posting an error message
GST_ELEMENT_ERROR() also takes the object lock and this would then
deadlock.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/3338>
2022-11-05 00:26:25 +00:00
Sebastian Dröge d186e19568 rtspsrc: Only EOS on timeout if all streams are timed out/EOS
Otherwise a stream that is just temporarily inactive might time out and
then can never become active again because the EOS event was sent
already.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/3271>
2022-10-26 17:44:57 +01:00
Jonas Bonn cba7eb67d0 multiudpsink: allow binding to IPv6 address
When the sink is configured to create sockets with an explicit bind
address, then the created socket gets set to the udp_socket field
irregardless of whether the bind address indicated that the socket
family should be IPv4 or IPv6.  When binding to an IPv6 address, this
results in the following error:

gstmultiudpsink.c:1285:gst_multiudpsink_configure_client:<rtcpsink>
error: Invalid address family (got 10)

This patch adds a check of the address family being bound to and sets
the created socket to used_socket or used_socket_v6, accordingly.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/3183>
2022-10-14 11:57:12 +01:00
Devin Anderson 3286e0942f wavparse: Avoid occasional crash due to referencing freed buffer.
We've seen occasional crashes in the `wavparse` module associated with
referencing a buffer in `gst_wavparse_chain` that's already been freed.  The
reference is stolen when the buffer is transferred to the adapter with
`gst_adapter_push` and, IIUC, assuming the source doesn't hold a reference to
the buffer, the buffer could be freed during interaction with the adapter in
`gst_wavparse_stream_headers`.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/3181>
2022-10-14 10:40:24 +01:00
Devin Anderson 80de451c06 wavparse: Fix crash that occurs in push mode when header chunks are corrupted
in certain ways.

In the case that a test is provided for, the size of the `fmt ` chunk is
changed from 16 bytes to 18 bytes (bytes 17 - 20 below):
```
$ hexdump -C corruptheadertestsrc.wav
00000000  52 49 46 46 e4 fd 00 00  57 41 56 45 66 6d 74 20  |RIFF....WAVEfmt |
00000010  12 00 00 00 01 00 01 00  80 3e 00 00 00 7d 00 00  |.........>...}..|
00000020  02 00 10 00 64 61 74 61                           |....data|
00000028
```

(Note that the original file is much larger.  This was the smallest sub-file
I could find that would generate the crash.)

Note that, while the same issue doesn't cause a crash in pull mode, there's a
different issue in that the file is processed successfully as if it was a .wav
file with zero samples.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/3174>
2022-10-13 12:15:03 +01:00
Mathieu Duponchelle 2ae4abcf99 splitmuxsrc: don't queue data on unlinked pads
Once a pad has returned NOT_LINKED, the part reader shouldn't let its
corresponding data queue run full and eventually (after 20 seconds)
stall playback.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/3169>
2022-10-12 22:38:54 +00:00
Tim-Philipp Müller 825746d121 Back to development 2022-10-12 18:40:25 +01:00