Commit graph

1804 commits

Author SHA1 Message Date
Robert Mader ba04085ba4 camerabin: Correctly relink viewfinderbin_queue
This reverts a part of de92a6c7f2. Unlike `image_filter` and
`video_filter`, `viewfinder_filter` does not get linked to `src` but
`viewfinderbin_queue`. Thus the fix in the mentioned commit does not
apply for it and should be reverted.

This was not spotted earlier as only the other filters are used in
the project that uncovered the issue.

Fixes: de92a6c7f2 ("camerabin: Fix source updates with user filters")
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/5842>
2023-12-20 10:19:28 +00:00
Philippe Normand fc31fd09b3 play: Fix error details parsing
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/5831>
2023-12-19 09:24:47 +00:00
Tim-Philipp Müller 79cdbc37d5 Back to development
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/5826>
2023-12-18 13:52:12 +00:00
Tim-Philipp Müller 4af14db10e Release 1.22.8 2023-12-18 12:09:37 +00:00
Seungha Yang a46737a731 av1parser: Fix array sizes in scalability structure
Since the AV1 specification is not explicitly mentioning about
the array size bounds, array sizes in scalability structure
should be defined as possible maximum sizes that can have.

Also, this commit removes GST_AV1_MAX_SPATIAL_LAYERS define from
public header which is API break but the define is misleading
and this patch is introducing ABI break already

ZDI-CAN-22300

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/5824>
2023-12-18 10:50:18 +00:00
Seungha Yang 912f859148 nvdec: Fix division by zero when calculating buffer duration
Don't try to calculate buffer duration from variable framerate

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/5774>
2023-12-14 12:05:08 +00:00
HuQian 01cc9d97d7 waylandsink: fix incorrect RGB and BGR mapping about GST DRM and WL_SHM
This commit corrects the mapping relationship between RGB and BGR in GST and DRM.
The previous mapping was incorrect, causing potential color mismatches in the output.

The changes are as follows:

  {WL_SHM_FORMAT_RGB888, DRM_FORMAT_RGB888, GST_VIDEO_FORMAT_BGR},
  {WL_SHM_FORMAT_BGR888, DRM_FORMAT_BGR888, GST_VIDEO_FORMAT_RGB},

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/5792>
2023-12-14 11:14:09 +00:00
Stefan Brüns 2aefdac995 ladspa: Make RDF parsing truely optional
If the ladspa plugin is enabled explicitly or via auto-features, the
liblrdf dependency can not be disabled.

As the RDF parsing currently provides hardly any features, the possibility
to disable it fairly useful.

Fixes: #3168
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/5802>
2023-12-12 17:36:50 +00:00
Seungha Yang ec9ddb6222 rtponviftimestamp: Fix drop-out-of-segment=false mode
Fixing unexpected buffer dropping and flow error in case that:
* use-reference-timestamps=false
* drop-out-of-segment=false
* Calculated utc offset is not valid because buffer is out-of-segment

The above case should be considered as a valid data flow without returning
errors.

Fixing regression introduced by
https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/1683

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/5788>
2023-12-09 15:41:26 +00:00
Guillaume Desmottes 511bf307d4 meson: update PACKAGE_BUGREPORT
Some were still using pre-monorepo links.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/5786>
2023-12-09 12:45:25 +00:00
Rabindra Harlalka 2c27ef8684 aesenc: Fix IV length addition to output buffer length
Add length of IV to output buffer length only for the first buffer.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/5785>
2023-12-09 11:47:03 +00:00
Alessandro Bono 8274c549ee gstdtlscertificate: Define _WINSOCKAPI_ before including windows.h
This avoid a build failure when compiling against OpenSSL 3.2.0. The
problem is when windows.h is included before WinSock2.h. Because
windows.h includes winsock.h[1]. Defining _WINSOCKAPI_ stops windows.h
including winsock.h.

Error:
```
[748/1041] Compiling C object ext/dtls/gstdtls.dll.p/gstdtlscertificate.c.obj
FAILED: ext/dtls/gstdtls.dll.p/gstdtlscertificate.c.obj
[...]
Windows Kits\10\include\10.0.17763.0\shared\ws2def.h(235): error C2011: 'sockaddr': 'struct' type redefinition
Windows Kits\10\include\10.0.17763.0\um\winsock.h(482): note: see declaration of 'sockaddr'
```

[1] https://stackoverflow.com/a/1372836

Closes: https://gitlab.freedesktop.org/gstreamer/gstreamer/-/issues/3167
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/5783>
2023-12-08 11:28:44 +00:00
Alexander Slobodeniuk 86b277fb93 d3d11: fix building with address sanitizer
When building with address sanitizer it gives next error:
"gstd3d11window_corewindow.cpp : fatal error C1128: number of sections
exceeded object file format limit: compile with /bigobj"

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/5782>
2023-12-08 10:19:18 +00:00
Benjamin Gaignard cedd529178 codecparsers: av1: Clip max tile rows and cols values
Clip tile rows and cols to 64 as describe in AV1 specification
to avoid writing outside array range but preserve sb_cols
and sb_rows value which are used to futher computation.

Fixes ZDI-CAN-22226 / CVE-2023-44429

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/5734>
2023-11-29 18:27:44 +00:00
Benjamin Gaignard 75ffbf7c30 Revert "codecparsers: av1: Clip max tile rows and cols values"
This reverts commit b76a801f57.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/5734>
2023-11-29 18:27:44 +00:00
Seungha Yang 6b89494e2e h264decoder: Fix GstVideoCodecFrame leak
If current buffer has no slice data, frame should be released.
Otherwise frames will stay in decoder baseclass forever.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/5733>
2023-11-29 17:04:51 +00:00
Seungha Yang 6e40624f20 qsvdecoder: Fix stream format detection
Fixing typo

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/5711>
2023-11-23 17:36:14 +00:00
Robert Mader e3f6818003 camerabin: Fix source updates with user filters
Take the case into account when user filters have been set before the
source gets updated.

Note that the further linking of the filters, if present, happens below
in the `gst_camera_bin_check_and_replace_filter()` calls.

The audio filter is still affected by the same issue but left out for
now.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/5682>
2023-11-16 18:39:26 +00:00
Seungha Yang d2646e0a19 d3d11screencapturesrc: Fix wrong color with HDR enabled
Even if IDXGIOutput6 says current display colorspace is HDR,
captured texture via IDXGIOutputDuplication::AcquireNextFrame()
is converted frame by OS unless we use IDXGIOutput5::DuplicateOutput1()
with DXGI_FORMAT_R16G16B16A16_FLOAT format, in order for captured
frame to be scRGB color space. Then application should perform
tonemap operation based on reported display white level, color primaries, etc.

Since we don't have any tonemapping implementation, ignores colorimetry
reported by IDXGIOutput6.

Fixes: https://gitlab.freedesktop.org/gstreamer/gstreamer/-/issues/3128
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/5679>
2023-11-16 12:53:31 +00:00
Sebastian Dröge 07cb8432cc player: Without dispatcher emit signals directly instead of via the default main context
This is how it was documented and how it worked before the port to GstPlay.

Without this, applications expecting signals to be emitted directly
without anything running the main context will simply not receive any
signals.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/5673>
2023-11-15 18:15:54 +00:00
Olivier Crête a4c3e15528 webrtcsdp: Don't require fingerprint in inactive media
Inactive m-lines don't need a fingerprint as they may not
have a connection.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/5663>
2023-11-14 19:50:48 +00:00
Olivier Crête 2112c3c6b8 webrtcsdp: Remove comparison between media and session fingerprint
The code seems to validate that the media-level fingerprint matches
the fingerprint of the previous media or of the whole session. There
is no such requirement in any RFC I found. The session-session one
is just meant to act as a fallback when there is no media-level
fingerprint.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/5663>
2023-11-14 19:50:48 +00:00
Sebastian Dröge dc1dc56c2d play: Automatically flush the bus when disposing the signal adapter
See https://gitlab.freedesktop.org/gstreamer/gstreamer/-/issues/3107

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/5653>
2023-11-13 16:33:03 +00:00
Tim-Philipp Müller b1067c023d Back to development
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/5650>
2023-11-13 14:57:09 +00:00
Tim-Philipp Müller 4d13eddc8b Release 1.22.7 2023-11-13 11:04:22 +00:00
Sebastian Dröge 7dfaa57b6f mxfdemux: Store GstMXFDemuxEssenceTrack in their own fixed allocation
Previously they were stored inline inside a GArray, but as references to
the tracks were stored in various other places although the array could
still be updated (and reallocated!), this could lead to dangling
references in various places.

Instead now store them in a GPtrArray in their own allocation so each
track's memory position stays fixed.

Fixes ZDI-CAN-22299

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

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/5638>
2023-11-10 16:20:43 +00:00
Benjamin Gaignard b76a801f57 codecparsers: av1: Clip max tile rows and cols values
Clip tile rows and cols to 64 as describe in AV1 specification.

Fixes ZDI-CAN-22226 / CVE-2023-44429

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

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/5637>
2023-11-10 15:13:25 +00:00
Guillaume Desmottes c44e6be7de audiobuffersplit: disable max-silence-time if set to 0
According to the property documentation max-silence-time is supposed to be
disabled when set to 0 but it was not.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/5632>
2023-11-09 19:17:41 +00:00
Balló György 6d81b5bd85 gstwayland: Don't depend on wayland-protocols
wayland-protocols are needed to build gstwayland, but not for dependent projects.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/5618>
2023-11-07 18:58:03 +00:00
Seungha Yang 4f62047b7d wasapi2device: Ignore activation failed device
Enumerates all devices even if activation error is detected

Fixes: https://gitlab.freedesktop.org/gstreamer/gstreamer/-/issues/3090
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/5609>
2023-11-06 13:19:13 +00:00
He Junyan 8defcf9b72 libde265dec: Only decode the main profile
The src caps of the libde265 is now fixed to I420, and so if the
stream is other format, such as 4:4:4 or 10 bits format, the pipeline
will crash because the dowstream element accesses the video buffer as
I420 format.
We now restrain the input caps to "main" profile, which only contains
4:2:0 8 bits stream.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/5596>
2023-11-04 18:04:56 +00:00
Marek Vasut a0755e5d74 v4l2codecs: Avoid QBUF/DQBUF struct timeval .tv_usec wrap-around at frame 1000000
When decoding stream using hardware V4L2 decoder element, in any of the
currently supported formats, the decoding will fail once frame number
1000000 is reached. The reported error clearly indicates a wrap-around
occured, instead of receiving decoded frame 1000000, frame 0 is received
from the hardware V4L2 decoder driver.

The problem is actually not in the driver itself, but rather in gstreamer,
which uses `struct v4l2_buffer` member `.timestamp` in a special way. The
timestamp of buffers with encoded data added to the SINK (input) queue of
the driver is copied by the driver into matching buffers with decoded data
added to the SOURCE (output) queue of the driver. In fact, the timestamp
is not a timestamp at all, but rather in this special case, only part of
it is used as an incrementing frame counter.

The `.timestamp` is of type `struct timeval`, which is defined in
`sys/time.h` [1]. Only the `tv_usec` member of this structure is used
for the incrementing frame counter. However, suseconds_t tv_usec [2]
may be limited to range [-1, 1000000]:
"
[XSI] The type suseconds_t shall be a signed integer type capable of
      storing values at least in the range [-1, 1000000].
"
Therefore, once frame 1000000 is reached, a rollover occurs and decoding
fails.

Fix this by using both `struct timeval` members, `.tv_sec` and `.tv_usec`
with matching modular arithmetic, this way the failure would occur again
just short of 2^84 frames, which should be plenty.

[1] https://pubs.opengroup.org/onlinepubs/9699919799/basedefs/sys_time.h.html
[2] https://pubs.opengroup.org/onlinepubs/9699919799/basedefs/sys_types.h.html

A test case using stateless hardware h264 decoder, the WARN/ERROR output
in gstreamer log indicates a failure occurred. With this change, that
error no longer occurs and the WARN/ERROR are not present:
```
pc$ gst-launch-1.0 videotestsrc num-buffers=1001001 pattern=6 ! \
                   video/x-raw,width=16,height=16,format=I420 ! \
                   x264enc ! filesink location=/tmp/test.h264

dut$ GST_DEBUG="*:3" gst-launch-1.0 filesrc location=/tmp/test.h264 ! \
                                    h264parse ! v4l2slh264dec ! fakesink
...
0:03:51.393677606 12111     0x370df400 WARN      \
  v4l2codecs-decoder gstv4l2decoder.c:1157:gst_v4l2_request_set_done:<v4l2decoder2> \
  Requested frame 1000000, but driver returned frame 0.
0:03:51.394140597 12111     0x370df400 WARN      \
  v4l2codecs-decoder gstv4l2decoder.c:1157:gst_v4l2_request_set_done:<v4l2decoder2> \
  Requested frame 1000001, but driver returned frame 1.
0:03:51.394425216 12111     0x370df400 WARN      \
  v4l2codecs-decoder gstv4l2decoder.c:1157:gst_v4l2_request_set_done:<v4l2decoder2> \
  Requested frame 1000002, but driver returned frame 2.
0:03:51.394665211 12111     0x370df400 WARN      \
  v4l2codecs-decoder gstv4l2decoder.c:1157:gst_v4l2_request_set_done:<v4l2decoder2> \
  Requested frame 1000003, but driver returned frame 3.
0:03:51.394785833 12111     0x370df400 WARN      \
  v4l2codecs-h264dec gstv4l2codech264dec.c:1059:gst_v4l2_codec_h264_dec_output_picture:<v4l2slh264dec0> \
  error: Failed to decode frame 1000000
ERROR: from element /GstPipeline:pipeline0/v4l2slh264dec:v4l2slh264dec0: Failed to decode frame 1000000
```

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/5603>
2023-11-04 16:59:51 +00:00
Kalev Lember f44f36482c openh264: Fail gracefully if openh264 encoder/decoder creation fails
This can happen with the dummy "noopenh264" library that the freedesktop
flatpak runtime ships, and Fedora is planning on shipping as well. In
both cases the dummy implementation gets replaced with the actual
openh264 library that's downloaded directly from Cisco, but just to be
on safe side, this patch makes it careful to check the return values to
avoid crashing if the underlying library hasn't been swapped out yet.

The patch is taken from freedesktop-sdk and was originally written by
Valentin David <valentin.david@codethink.co.uk>.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/5586>
2023-11-01 17:10:01 +00:00
Seungha Yang cb6955944f wasapi2: Don't use global volume control object
ISimpleAudioVolume controls volume of corresponding audio session
and there would be only single input/output audio session
in case of share-mode, which means that it controls audio volume of the
process. Instead, use IAudioStreamVolume interface which controls
volume of the stream.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/5579>
2023-10-31 10:23:24 +00:00
Seungha Yang 1a5a965846 d3d11videosink: Fix window switching in case of fullscreen mode
Other Windows applications allow window switching even when
an application window is in fullscreen mode. Also fixing
regression introduced in 15248d8b84
which makes restored window is always located at topmost
since we do not call SetWindowPos() anymore when restoring

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/5578>
2023-10-30 22:51:15 +00:00
Seungha Yang 7171849c3e d3d11screencapturesrc: Fix mouse cursor blending
Ignore alpha component of source (mouse cursor texture)
when blending alpha channel, otherwise the background area of source
(which has zeros) will be written to render target. Then it will result
in black rectangle if output texture is converted to premultiplied alpha
texture

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/5577>
2023-10-30 14:03:49 +00:00
Seungha Yang 738e274fab mfvideoencoder: Fix typo in template caps
Fixes: https://gitlab.freedesktop.org/gstreamer/gstreamer/-/issues/3058
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/5556>
2023-10-26 00:40:56 +01:00
Jan Alexander Steffens (heftig) 4299be47ab tsmux: Fix default get_es_descrs_func
`tsmux_stream_default_get_es_descrs` is missing the `user_data`
parameter and shouldn't be cast to `TsMuxStreamGetESDescriptorsFunc`.

Prefer not casting at all to make sure we don't miss such an issue.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/5516>
2023-10-20 08:53:19 +00:00
Jan Alexander Steffens (heftig) da02db0d95 tsmux: Fix default new_stream_func
`tsmux_stream_new` is missing the `user_data` parameter and shouldn't be
cast to `TsMuxNewStreamFunc`.

Prefer not casting at all to make sure we don't miss such an issue.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/5516>
2023-10-20 08:53:19 +00:00
Jan Alexander Steffens (heftig) 2d938d37a6 tsmux: Add missing include
We need `GstMpegtsPMTStream` here.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/5516>
2023-10-20 08:53:19 +00:00
Jan Alexander Steffens (heftig) 77429e4096 tsmux: Simplify tsmux_section_write_packet
- Don't try to make the parameters match `GHFunc`. Use a dedicated
  callback for `g_hash_table_foreach`.
- Don't try to be clever with buffer memories. We're allocating a full
  packet anyway, might as well memcpy and save on a lot of complexity.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/5516>
2023-10-20 08:53:19 +00:00
Jan Alexander Steffens (heftig) c205086f2b tsmux: tsmux_packet_out should always consume its buffer
Consuming the buffer only when successful is an antipattern and easily
leads to leaks.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/5516>
2023-10-20 08:53:19 +00:00
Jan Alexander Steffens (heftig) 6198c4b8a1 tsmux: Don't memset in pad_stream when writing a PCR packet
tsmux_write_ts_header will write a stuffing adaptation field, so we
don't need to prefill the buffer.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/5516>
2023-10-20 08:53:19 +00:00
Jan Alexander Steffens (heftig) 4e9cb5d8eb tsmux: Move out parameters of tsmux_write_ts_header
Move them to the end of the parameter list and also allow passing NULLs
to ignore the payload information, but assert that the payload length is
zero in this case.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/5516>
2023-10-20 08:53:19 +00:00
Jan Alexander Steffens (heftig) a65035ac25 tsmux: Fix two more uses of gst_buffer_map
The buffers should be used for writing.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/5516>
2023-10-20 08:53:19 +00:00
Jan Alexander Steffens (heftig) 61c62919a7 tsmux: Fix error handling in pad_stream
Don't leak the map or the buffer if we encounter an error.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/5513>
2023-10-19 23:22:33 +01:00
Jan Alexander Steffens (heftig) 5e78ef7a10 tsmux: Fill padding packets with stuffing bytes
Instead of leaving it uncleared, emitting probably old packet data but
potentially also random or sensitive application data.

Also fix the mapping mode.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/5513>
2023-10-19 23:22:33 +01:00
Nicolas Dufresne a92050493a v4l2codecs: h265: Fix entry_point_offsets array leak
This array was being leaked.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/5503>
2023-10-18 00:17:54 +00:00
Detlev Casanova 99435dc499 codecs: h265: Do not free slice header before using it
The v4l2codecs H.265 decoder uses the
GstH265SliceHdr::entry_point_offset_minus1 array so make sure that it is not
freed before decoding the frame.

Before this patch, some H.265 input would segfault in
gst_v4l2_codec_h265_dec_fill_slice_params() when executing the line:

guint32 entry_point_offset = slice_hdr->entry_point_offset_minus1[i] + 1;

Make sure that the array is not freed before using it.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/5503>
2023-10-18 00:17:54 +00:00
Rahul T R a7bc4ff3bb kmssink: Add TIDSS auto-detection
Add Texas Instruments TIDSS display controller into list of
auto-detected modules.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/5486>
2023-10-15 23:17:29 +00:00