platform/upstream/gstreamer.git
3 weeks agolibav:avviddec: Add videometa if there is no videometa in output buffer 01/308701/2 accepted/tizen_unified accepted/tizen_unified_x tizen accepted/tizen/unified/20240403.095029 accepted/tizen/unified/x/20240404.061922
Jeongmo Yang [Fri, 29 Mar 2024 03:07:06 +0000 (12:07 +0900)]
libav:avviddec: Add videometa if there is no videometa in output buffer

- The buffer from internal pool in avviddec has video meta,
  but, the output buffer is not from internal pool in avviddec
  and it's from other buffer pool which is made in gst_video_decoder_decide_allocation_default().
  As a result, the output buffer does not have video meta.

[Version] 1.22.8-7
[Issue Type] Improvement

Change-Id: I678ec172fdd92eddfe1a281f23d81f4106489f15
Signed-off-by: Jeongmo Yang <jm80.yang@samsung.com>
3 weeks agoappsrc: clear eos flag on flush stop event 29/308529/1 accepted/tizen/unified/20240328.123412 accepted/tizen/unified/x/20240401.142444
Jeongki Kim [Thu, 22 Feb 2024 14:41:12 +0000 (23:41 +0900)]
appsrc: clear eos flag on flush stop event

Change-Id: I8af57137343607e1bccfb7264843879ac34cf7b0
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/6186>
Signed-off-by: Jeongmo Yang <jm80.yang@samsung.com>
3 weeks agogood:v4l2bufferpool: Add video meta for GstV4l2TizenBuffer 27/308527/1
Jeongmo Yang [Wed, 27 Mar 2024 05:37:08 +0000 (14:37 +0900)]
good:v4l2bufferpool: Add video meta for GstV4l2TizenBuffer

[Version] 1.22.8-6
[Issue Type] Update

Change-Id: Ifa2f85a002f7c9616580bdac78039b6733e69187
Signed-off-by: Jeongmo Yang <jm80.yang@samsung.com>
2 months agortsp-server: separate tizen feature code using pre-processor 33/305733/6 accepted/tizen_unified_toolchain accepted/tizen/unified/20240216.161304 accepted/tizen/unified/toolchain/20240311.070012 accepted/tizen/unified/x/20240220.150001
Youngwoo Cho [Wed, 7 Feb 2024 04:10:10 +0000 (13:10 +0900)]
rtsp-server: separate tizen feature code using pre-processor

[Version] 1.22.8-5

Change-Id: I5db791f8e8e7c4b13b037e2dedd99486a5dbc003
Signed-off-by: Youngwoo Cho <young222.cho@samsung.com>
2 months agogstrtpbin: Fix coverity issue 00/305600/4 accepted/tizen/unified/20240208.163950 accepted/tizen/unified/x/20240214.051941
Jiyong [Mon, 5 Feb 2024 08:42:16 +0000 (17:42 +0900)]
gstrtpbin: Fix coverity issue

 - MISSING_LOCK

[Version] 1.22.8-4
[Issue Type] Coverity

Change-Id: I6c10ce5e02f90f1c14f36f6297036d7116136941

2 months agowebrtcbin: Lock data channel before accessing parent.prev_ready_state 72/305372/1
Sangchul Lee [Thu, 1 Feb 2024 03:08:44 +0000 (12:08 +0900)]
webrtcbin: Lock data channel before accessing parent.prev_ready_state

[Version] 1.22.8-3
[Issue Type] Coverity defect

Change-Id: I0f153febf36fd83112a33963719b59130a384a1c
Signed-off-by: Sangchul Lee <sc11.lee@samsung.com>
2 months agowebrtcdatachannel: Lock before accessing parent.ready_state 43/305243/2
Sangchul Lee [Tue, 30 Jan 2024 08:32:22 +0000 (17:32 +0900)]
webrtcdatachannel: Lock before accessing parent.ready_state

[Version] 1.22.8-2
[Issue Type] Coverity defect

Change-Id: Iffe1037ae2dd0cdd190fd282c507db74e5ce7d1c
Signed-off-by: Sangchul Lee <sc11.lee@samsung.com>
2 months agortsp-server: Fix coverity issue 50/305250/1 accepted/tizen/unified/20240201.165111 accepted/tizen/unified/x/20240205.063854
Youngwoo Cho [Tue, 30 Jan 2024 09:27:38 +0000 (18:27 +0900)]
rtsp-server: Fix coverity issue

- MISSING_LOCK

[Version] 1.22.8-1
[Issue Type] Coverity

Change-Id: I0a5366474a3ba67a4a75a37eecb2a628d2ec6f54
Signed-off-by: Youngwoo Cho <young222.cho@samsung.com>
3 months agoMerge branch 'tizen_gst_1.22.8' into tizen 45/303745/1 accepted/tizen_unified_riscv accepted/tizen/unified/20240105.105444 accepted/tizen/unified/riscv/20240106.074907
Gilbok Lee [Thu, 4 Jan 2024 07:35:47 +0000 (16:35 +0900)]
Merge branch 'tizen_gst_1.22.8' into tizen

Change-Id: I32522d59f264d16e45a4f17672f7d3676f436395

3 months agofixup! Apply GStreamer 1.22.0 into Tizen 00/303700/1 accepted/tizen/unified/20240105.013025 accepted/tizen/unified/riscv/20240105.060143
Seungbae Shin [Wed, 3 Jan 2024 11:51:25 +0000 (20:51 +0900)]
fixup! Apply GStreamer 1.22.0 into Tizen

Add missing pie option for ges-launch

Change-Id: I4a6ec30c41a94b47afab662dca98bf8ba0d79bd7

3 months agoMerge branch 'tizen_gst_1.22.7' into tizen_gst_1.22.8 50/303350/2 tizen_gst_1.22.8
Gilbok Lee [Tue, 26 Dec 2023 06:02:43 +0000 (15:02 +0900)]
Merge branch 'tizen_gst_1.22.7' into tizen_gst_1.22.8

Change-Id: I98d135750db876b7e11c685e671a632a59b3b4aa

3 months agoMerge branch 'upstream/1.22.7' into tizen_gst_1.22.7 11/302511/8 tizen_gst_1.22.7
Gilbok Lee [Fri, 8 Dec 2023 02:27:27 +0000 (11:27 +0900)]
Merge branch 'upstream/1.22.7' into tizen_gst_1.22.7

Change-Id: Ifd237cb75154b3000f76c695a5234052de646535

4 months agoRelease 1.22.8 upstream/1.22.8 1.22.8
Tim-Philipp Müller [Mon, 18 Dec 2023 12:09:37 +0000 (12:09 +0000)]
Release 1.22.8

4 months agoav1parser: Fix array sizes in scalability structure
Seungha Yang [Thu, 23 Nov 2023 11:24:42 +0000 (20:24 +0900)]
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>

4 months agoavviddec: Calculate latency only for fixed framerate
Philippe Normand [Sat, 4 Nov 2023 10:59:39 +0000 (10:59 +0000)]
avviddec: Calculate latency only for fixed framerate

The framerate was checked correctly in _negotiate, but not in _set_format.

Also fix loss of precision in _negotiate when calculating the framerate.

Fixes #3093

Co-authored-by: Sebastian Dröge <sebastian@centricular.com>
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/5818>

4 months agortp: Fix incorrect RTP channel order lookup by name
Arun Raghavan [Fri, 15 Dec 2023 20:19:35 +0000 (15:19 -0500)]
rtp: Fix incorrect RTP channel order lookup by name

The g_ascii_strcasecmp() logic is inverted, since it returns 0 on equality.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/5817>

4 months agonvdec: Fix division by zero when calculating buffer duration
Seungha Yang [Tue, 5 Dec 2023 10:52:22 +0000 (19:52 +0900)]
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>

4 months agowaylandsink: fix incorrect RGB and BGR mapping about GST DRM and WL_SHM
HuQian [Wed, 8 Nov 2023 09:53:17 +0000 (09:53 +0000)]
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>

4 months agoladspa: Make RDF parsing truely optional
Stefan Brüns [Sun, 10 Dec 2023 03:26:59 +0000 (04:26 +0100)]
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>

4 months agoaudioringbuffer: Don't try to map MONO channel
Doug Nazar [Mon, 27 Nov 2023 14:01:38 +0000 (09:01 -0500)]
audioringbuffer: Don't try to map MONO channel

Avoids critical message:

gstaudioringbuffer.c: line 2155 (gst_audio_ring_buffer_set_channel_positions):
should not be reached

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/5793>

4 months agortponviftimestamp: Fix drop-out-of-segment=false mode
Seungha Yang [Thu, 27 Jul 2023 15:39:46 +0000 (00:39 +0900)]
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>

4 months agomatroska-demux: fix accumulated base offset in segment seeks
Tim-Philipp Müller [Sat, 29 Apr 2023 15:20:13 +0000 (16:20 +0100)]
matroska-demux: fix accumulated base offset in segment seeks

When doing a segment seek, the base offset in the new segment
would be increased by segment.position which is basically the
timestamp of the last packet. This does not include the duration
of the last packet though, so might be slightly shorter than the
actual duration of the clip or the requested segment.

Increase the base offset by the segment duration instead when
accumulating segments, which is more correct as it doesn't cut
off the last frame and makes the effective loop segment duration
consistent with the actual duration returned from a duration
query.

In case a segment stop was specified it's also possible that
some data was sent beyond the stop that's necessary for decoding
so the base offset increment should be based on that then and
not on the timestamp of the last buffer pushed out.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/5787>

4 months agomeson: update PACKAGE_BUGREPORT
Guillaume Desmottes [Tue, 5 Dec 2023 08:28:25 +0000 (09:28 +0100)]
meson: update PACKAGE_BUGREPORT

Some were still using pre-monorepo links.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/5786>

4 months agoqtdemux: fix bug report URL
Guillaume Desmottes [Tue, 5 Dec 2023 08:25:22 +0000 (09:25 +0100)]
qtdemux: fix bug report URL

Using PACKAGE_BUGREPORT as in other modules.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/5786>

4 months agoaesenc: Fix IV length addition to output buffer length
Rabindra Harlalka [Mon, 17 Jul 2023 16:21:47 +0000 (16:21 +0000)]
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>

4 months agogstdtlscertificate: Define _WINSOCKAPI_ before including windows.h
Alessandro Bono [Wed, 6 Dec 2023 11:01:36 +0000 (12:01 +0100)]
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>

4 months agod3d11: fix building with address sanitizer
Alexander Slobodeniuk [Thu, 7 Dec 2023 14:36:26 +0000 (15:36 +0100)]
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>

4 months agobase:tizenmemory: Export gst_tizen_video_meta_map/unmap API and fix memory leak 69/302469/1 accepted/tizen/unified/20231211.095342 accepted/tizen/unified/riscv/20231226.211303
Jeongmo Yang [Tue, 5 Dec 2023 06:15:43 +0000 (15:15 +0900)]
base:tizenmemory: Export gst_tizen_video_meta_map/unmap API and fix memory leak

- Fixed memory leak
 : The return value of "gst_buffer_get_memory()" should be released after use, but it was not.
   This patch replaces it by "gst_buffer_peek_memory()" and we don't need to release it.

[Version] 1.22.0-38
[Issue Type] API export

Change-Id: I09e00e2282706e8d4e7a5ddf7cf87313b86277b0
Signed-off-by: Jeongmo Yang <jm80.yang@samsung.com>
4 months agoappsrc: Fix flow return when buffer is dropped
Seungha Yang [Fri, 1 Dec 2023 15:32:31 +0000 (00:32 +0900)]
appsrc: Fix flow return when buffer is dropped

Flow EOS on buffer drop (upstream leaky mode) was not
intended behavior. Appsrc should return OK instead.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/5755>

4 months agoqtdemux: Don't overflow sample index
Hosang Lee [Fri, 1 Dec 2023 05:51:49 +0000 (14:51 +0900)]
qtdemux: Don't overflow sample index

Don't reduce sample index if it is already at 0.
Assigning -1 to a guint32 variable causes unexpected behavior.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/5751>

4 months agodecodebin2: Properly free when shutting down in gst_decode_bin_expose
Jimmy Ohn [Fri, 1 Dec 2023 09:46:35 +0000 (18:46 +0900)]
decodebin2: Properly free when shutting down in gst_decode_bin_expose

missing_plugin_details causes memory leakages when shutting down.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/5750>

4 months agoencoding-target: Properly free when missing type field in parse_encoding_profile
Jimmy Ohn [Fri, 1 Dec 2023 08:55:28 +0000 (17:55 +0900)]
encoding-target: Properly free when missing type field in parse_encoding_profile

pname and description in parse_encoding_profile function causes
memory leakages when missing the 'type' field for streamprofile.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/5750>

4 months agoqtdemux: Fix reverse playback for pcm audio stream
Hosang Lee [Fri, 1 Dec 2023 06:05:41 +0000 (15:05 +0900)]
qtdemux: Fix reverse playback for pcm audio stream

Some raw lpcm or adpcm may have larger sample sizes than the max
buffer size value set.
Trimming the buffer causes bogus size error on reverse playback.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/5745>

4 months agocodecparsers: av1: Clip max tile rows and cols values
Benjamin Gaignard [Tue, 21 Nov 2023 13:26:54 +0000 (14:26 +0100)]
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>

4 months agoRevert "codecparsers: av1: Clip max tile rows and cols values"
Benjamin Gaignard [Tue, 21 Nov 2023 13:04:49 +0000 (14:04 +0100)]
Revert "codecparsers: av1: Clip max tile rows and cols values"

This reverts commit b76a801f57353b893c344025cac56413140fca6d.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/5734>

4 months agoh264decoder: Fix GstVideoCodecFrame leak
Seungha Yang [Mon, 20 Nov 2023 16:41:16 +0000 (01:41 +0900)]
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>

4 months agobaseparse: Reset metadata for reverse playback fragment buffers
Jan Alexander Steffens (heftig) [Mon, 27 Nov 2023 12:16:47 +0000 (13:16 +0100)]
baseparse: Reset metadata for reverse playback fragment buffers

Don't let the adapter leak uncontrollable values.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/5720>

4 months agobaseparse: Add missing gst_buffer_make_writable
Jan Alexander Steffens (heftig) [Mon, 27 Nov 2023 11:29:08 +0000 (12:29 +0100)]
baseparse: Add missing gst_buffer_make_writable

When the subclass attempts to finish without an explicit `out_buffer`,
we take a buffer from our adapter. We need to make this buffer writable
before copying the metadata.

This led to data races such as in the following pipeline, which randomly
messed up the buffer PTS:

    gst-launch-1.0 -e audiotestsrc timestamp-offset=5555 num-buffers=100 \
      ! opusenc ! tee name=t ! queue ! opusparse ! fakesink silent=0 \
      t. ! queue ! opusparse ! fakesink silent=0 -v | grep '0000, dur'

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/5720>

4 months agopbutils: Don't include default vp9 parameters in resulting codec mime string
Philippe Normand [Mon, 27 Nov 2023 10:36:01 +0000 (10:36 +0000)]
pbutils: Don't include default vp9 parameters in resulting codec mime string

According to the document defining the vp9 codec string, the optional fields
should all be present only if at least one of them has a non-default value.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/5719>

4 months agovideorate: Don't forget last_ts on caps changes
Nicolas Dufresne [Fri, 17 Nov 2023 15:48:21 +0000 (10:48 -0500)]
videorate: Don't forget last_ts on caps changes

Whenever that caps changes does not imply that a new segment will start.
Don't reset the last_ts if only the caps have changed. This fixes issues
if you have a stream without only first frame with TS=0, and have resolution
change happening. This was a regression introduced by !3059, which issue was
described in #1352. The reported issue is still fix after this change.

Fixes #1034

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/5712>

4 months agoqsvdecoder: Fix stream format detection
Seungha Yang [Tue, 21 Nov 2023 12:14:12 +0000 (21:14 +0900)]
qsvdecoder: Fix stream format detection

Fixing typo

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/5711>

4 months agov4l2bufferpool: add lock as atomic operation for seek
jeri.li [Fri, 21 Apr 2023 01:58:36 +0000 (09:58 +0800)]
v4l2bufferpool: add lock as atomic operation for seek

When seek flush, gst v4l2 buffer pool flush is not atomic which will
lead double enqueue buffer (qbuf) issue, and v4l2 buffer pool qbuf is
also not atomic which will lead no free buffer found in the pool.
1. add lock for calculate enqueue number in streamon function
2. add lock for v4l2 capture end streamoff in pool flush function
3. lock the whole funciton of v4l2 buffer pool qbuf, then the buffer
   pool index and qbuf operation are atomic

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/5695>

4 months agogstbuffer: Add parent meta when a copy shares memory with parent
Xavier Claessens [Wed, 15 Mar 2023 13:11:51 +0000 (09:11 -0400)]
gstbuffer: Add parent meta when a copy shares memory with parent

When copying a buffer, for example with gst_buffer_make_writable(), the
new buffer might reference the same GstMemory as the src buffer,
making those memories not writable. If the src buffer gets disposed
first it should return to its buffer pool, but since some of its
memories are not writable it gets discarded and new buffer/memory gets
allocated.

Solves this by making the new buffer keep a reference to the src buffer,
that ensures that by the time the src buffer gets disposed no other
buffer are referencing its memories and it can thus return safely to its
pool.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/5696>

4 months agogstbuffer: Unref memories before metas
Xavier Claessens [Fri, 10 Mar 2023 06:18:12 +0000 (22:18 -0800)]
gstbuffer: Unref memories before metas

gst_buffer_add_parent_buffer_meta() is used when a GstBuffer uses
GstMemory from another buffer that was allocated from a pool. In that
case we want to make sure the buffer returns to the pool when the memory
is writable again, otherwise a copy of the memory is created. That means
the child buffer must drop its ref to the memory first, then drop the
ref to parent buffer so it can return to the pool when it is the only
owner of the memory.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/5696>

5 months agortpklvdepay: Recover after invalid fragmented KLV unit
Robin Gustavsson [Wed, 7 Jun 2023 12:38:18 +0000 (14:38 +0200)]
rtpklvdepay: Recover after invalid fragmented KLV unit

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/5686>

5 months agoavviddec: Unlock stream lock while waiting for decoded frame
Seungha Yang [Thu, 16 Nov 2023 16:01:36 +0000 (01:01 +0900)]
avviddec: Unlock stream lock while waiting for decoded frame

FFmpeg might request buffer from other threads, it will result
in deadlock

Fixes: https://gitlab.freedesktop.org/gstreamer/gstreamer/-/issues/2558
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/5683>

5 months agocamerabin: Fix source updates with user filters
Robert Mader [Sun, 22 Oct 2023 09:06:27 +0000 (11:06 +0200)]
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>

5 months agod3d11screencapturesrc: Fix wrong color with HDR enabled
Seungha Yang [Wed, 15 Nov 2023 13:41:47 +0000 (22:41 +0900)]
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>

5 months agogstpad: Recheck pads when linking after temporary unlock
Daniel Moberg [Wed, 15 Nov 2023 10:03:52 +0000 (10:03 +0000)]
gstpad: Recheck pads when linking after temporary unlock

This commit makes sure that pads are valid for linking
after the pads has been temporarily unlocked in the linking process.
Not doing this opens up for a race condition where
pads potentially can be linked twice.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/5678>

5 months agospec: remove excluding the debug path 50/301450/2 accepted/tizen/unified/20231120.174020
Eunhye Choi [Thu, 16 Nov 2023 04:54:59 +0000 (13:54 +0900)]
spec: remove excluding the debug path

- if debug path is excluded, debug info is added in main rpm
  that is not intended and the info is added in /usr/lib/debug/.build-id/xx
- can not exclude /usr/lib/debug/.build-id/ explicitly
  because the path is not recognized.
  warning : file / dir not found

Change-Id: Id6a5774460c31a6401823e6080fcf188b47b3f89

5 months agoqtdemux: Ignore raw audio streams when adjusting seek
Piotr Brzeziński [Thu, 29 Jun 2023 13:20:29 +0000 (15:20 +0200)]
qtdemux: Ignore raw audio streams when adjusting seek

Because we treat raw audio chunks/samples as keyframes, they were interfering
with seek time adjustment.
Became apparent when the accompanying video stream was I-frame only,
for example ProRes.
Since raw audio streams can be seeked freely, it's fine to just ignore them here,
giving priority to the real keyframes in the video stream.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/5674>

5 months agoplayer: Without dispatcher emit signals directly instead of via the default main...
Sebastian Dröge [Wed, 15 Nov 2023 17:13:08 +0000 (19:13 +0200)]
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>

5 months agortpac3depay: should output audio/x-ac3 not audio/ac3
Tim-Philipp Müller [Thu, 12 Oct 2023 16:23:00 +0000 (17:23 +0100)]
rtpac3depay: should output audio/x-ac3 not audio/ac3

audio/x-ac3 is the canonical media format in GStreamer.
audio/ac3 is sometimes accepted as input (e.g. in rtpac3pay
or ac3parse), but shouldn't be output.

Fixes #3038.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/5662>

5 months agodcaparse: keep upstream buffer meta
Dongyun Seo [Tue, 14 Nov 2023 06:36:34 +0000 (15:36 +0900)]
dcaparse: keep upstream buffer meta

Some audio decoders cannot decode DTS stream if there is no
valid timestamp. So, keep upstream buffer meta.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/5664>

5 months agowebrtcsdp: Don't require fingerprint in inactive media
Olivier Crête [Mon, 8 Aug 2022 18:46:16 +0000 (14:46 -0400)]
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>

5 months agowebrtcsdp: Remove comparison between media and session fingerprint
Olivier Crête [Tue, 12 Oct 2021 15:29:21 +0000 (11:29 -0400)]
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>

5 months agoplay: Automatically flush the bus when disposing the signal adapter
Sebastian Dröge [Sat, 11 Nov 2023 12:10:37 +0000 (14:10 +0200)]
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>

5 months agoBack to development
Tim-Philipp Müller [Mon, 13 Nov 2023 14:57:09 +0000 (14:57 +0000)]
Back to development

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/5650>

5 months agoRelease 1.22.7 upstream/1.22.7 1.22.7
Tim-Philipp Müller [Mon, 13 Nov 2023 11:04:22 +0000 (11:04 +0000)]
Release 1.22.7

5 months agomxfdemux: Store GstMXFDemuxEssenceTrack in their own fixed allocation
Sebastian Dröge [Thu, 19 Oct 2023 21:09:57 +0000 (00:09 +0300)]
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>

5 months agocodecparsers: av1: Clip max tile rows and cols values
Benjamin Gaignard [Wed, 4 Oct 2023 09:14:38 +0000 (11:14 +0200)]
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>

5 months agoaudiobuffersplit: disable max-silence-time if set to 0
Guillaume Desmottes [Fri, 6 Oct 2023 11:49:15 +0000 (13:49 +0200)]
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>

5 months agogst-validate: Fixed compatibility with Python 3.12
Jordan Yelloz [Tue, 7 Nov 2023 18:42:19 +0000 (11:42 -0700)]
gst-validate: Fixed compatibility with Python 3.12

config.readfp() was removed in python 3.12 and config.read_file() does the same
thing and has been available since Python 3.2

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/5627>

5 months agobasetextoverlay: Fix overlay never rendering again if width reaches 1px
Piotr Brzeziński [Mon, 6 Nov 2023 23:27:57 +0000 (00:27 +0100)]
basetextoverlay: Fix overlay never rendering again if width reaches 1px

If text width ever reached 1px, for example after resizing the output window, the overlay would stop rendering
and never return again. The 1px condition itself does not seem to make much sense here anyway.

This was a chain of events: width reached 1, so the composition was set to NULL. Then, after resizing the output window,
push_frame() was called but would not attempt to renegotiate because composition is NULL. This caused the width/height
to never be updated again, as that only happens during negotiation, so the overlay was gone for good.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/5623>

5 months agogstwayland: Don't depend on wayland-protocols
Balló György [Fri, 26 May 2023 17:38:13 +0000 (17:38 +0000)]
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>

5 months agoadaptivedemux2: Do not submit_transfer when cancelled
Thibault Saunier [Wed, 4 Oct 2023 14:09:37 +0000 (11:09 -0300)]
adaptivedemux2: Do not submit_transfer when cancelled

There is a race condition where transfer has not been submitted yet while the
request is cancelled which leads to the transfer state going back to
`DOWNLOAD_REQUEST_STATE_OPEN` and the user of the request to get signalled about
its completion (and the task actually happening after it was cancelled) leading
to assertions and misbehaviours.

To ensure that this race can't happen, we start differentiating between the
UNSENT and CANCELLED states as in the normal case, when entering `submit_request`
the state is UNSENT and at that point we need to know that it is not because
the request has been cancelled.

In practice this case lead to an assertion in
`gst_adaptive_demux2_stream_begin_download_uri` because in a previous call to
`gst_adaptive_demux2_stream_stop_default` we cancelled the previous request and
setup a new one while it had not been submitted yet and then got a `on_download_complete`
callback called from that previous cancelled request and then we tried to do
`download_request_set_uri` on a request that was still `in_use`, leading to
something like:

```
 #0: 0x0000000186655ec8 g_assert (request->in_use == FALSE)assert.c:0
 #1: 0x00000001127236b8 libgstadaptivedemux2.dylib`download_request_set_uri(request=0x000060000017cc00, uri="https://XXX/chunk-stream1-00002.webm", range_start=0, range_end=-1) at downloadrequest.c:361
 #2: 0x000000011271cee8 libgstadaptivedemux2.dylib`gst_adaptive_demux2_stream_begin_download_uri(stream=0x00000001330f1800, uri="https://XXX/chunk-stream1-00002.webm", start=0, end=-1) at gstadaptivedemux-stream.c:1447
 #3: 0x0000000112719898 libgstadaptivedemux2.dylib`gst_adaptive_demux2_stream_load_a_fragment [inlined] gst_adaptive_demux2_stream_download_fragment(stream=0x00000001330f1800) at gstadaptivedemux-stream.c:0
 #4: 0x00000001127197f8 libgstadaptivedemux2.dylib`gst_adaptive_demux2_stream_load_a_fragment(stream=0x00000001330f1800) at gstadaptivedemux-stream.c:1969
 #5: 0x000000011271c2a4 libgstadaptivedemux2.dylib`gst_adaptive_demux2_stream_next_download(stream=0x00000001330f1800) at gstadaptivedemux-stream.c:2112
```

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/5611>

5 months agowasapi2device: Ignore activation failed device
Seungha Yang [Sat, 4 Nov 2023 10:36:06 +0000 (19:36 +0900)]
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>

5 months agowavparse: fix buffer leak with adtl tag
Johan Adam Nilsson [Mon, 9 Oct 2023 09:11:47 +0000 (09:11 +0000)]
wavparse: fix buffer leak with adtl tag

Fixes: https://gitlab.freedesktop.org/gstreamer/gstreamer/-/issues/3020
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/5597>

5 months agolibde265dec: Only decode the main profile
He Junyan [Sat, 28 Oct 2023 14:55:04 +0000 (22:55 +0800)]
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>

5 months agov4l2codecs: Avoid QBUF/DQBUF struct timeval .tv_usec wrap-around at frame 1000000
Marek Vasut [Sat, 4 Nov 2023 02:16:47 +0000 (03:16 +0100)]
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>

5 months agoopenh264: Fail gracefully if openh264 encoder/decoder creation fails
Kalev Lember [Tue, 31 Oct 2023 16:59:32 +0000 (17:59 +0100)]
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>

5 months agowasapi2: Don't use global volume control object
Seungha Yang [Wed, 25 Oct 2023 12:37:24 +0000 (21:37 +0900)]
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>

5 months agod3d11videosink: Fix window switching in case of fullscreen mode
Seungha Yang [Sun, 29 Oct 2023 13:42:52 +0000 (22:42 +0900)]
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 15248d8b84db9e79e6d4587b212b12ca82fc4a6b
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>

5 months agod3d11screencapturesrc: Fix mouse cursor blending
Seungha Yang [Fri, 27 Oct 2023 16:23:36 +0000 (01:23 +0900)]
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>

5 months agopngenc: mark output frames as I-frames
Tim-Philipp Müller [Tue, 24 Oct 2023 17:20:34 +0000 (18:20 +0100)]
pngenc: mark output frames as I-frames

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/5564>

5 months agopngenc: output one frame only in snapshot mode
Tim-Philipp Müller [Tue, 24 Oct 2023 17:12:44 +0000 (18:12 +0100)]
pngenc: output one frame only in snapshot mode

In snapshot mode pngenc should output exactly one frame
and then return FLOW_EOS to upstream. If upstream sends
more input frames before shutting down, it should keep
returning FLOW_EOS but not output any more encoded frames.

After a flushing seek it should output frames again though.

Fixes #3069.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/5564>

5 months agodebugutils: Ensure we always expose a bin_to_dot_data implementation
Philippe Normand [Wed, 25 Oct 2023 12:58:55 +0000 (13:58 +0100)]
debugutils: Ensure we always expose a bin_to_dot_data implementation

Fixes a linking issue when building with `-Dgst_debug=false`.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/5563>

5 months agomfvideoencoder: Fix typo in template caps
Seungha Yang [Wed, 25 Oct 2023 14:19:51 +0000 (23:19 +0900)]
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>

5 months agoaggregator: Allow passing unparented pads to gst_aggregator_pad_is_inactive()
Sebastian Dröge [Thu, 19 Oct 2023 16:44:21 +0000 (19:44 +0300)]
aggregator: Allow passing unparented pads to gst_aggregator_pad_is_inactive()

It's very difficult to ensure that a pad is still child of the
aggregator during aggregation, so simply consider unparented pads as
inactive instead of asserting.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/5553>

5 months agoaggregator: Also release clipped buffer when releasing an aggregator pad
Sebastian Dröge [Thu, 19 Oct 2023 16:43:26 +0000 (19:43 +0300)]
aggregator: Also release clipped buffer when releasing an aggregator pad

Instead of waiting until the pad is actually finalized.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/5553>

5 months agoaggregator: Take pad lock while releasing buffers when removing pads
Sebastian Dröge [Thu, 19 Oct 2023 16:43:26 +0000 (19:43 +0300)]
aggregator: Take pad lock while releasing buffers when removing pads

Accessing the buffers in all other places requires the pad lock and not
taking it here can cause access to already freed buffers if there's
concurrent access from another thread.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/5553>

5 months agoaudioaggregator: Make access to the pad list thread-safe while mixing
Sebastian Dröge [Thu, 19 Oct 2023 16:41:27 +0000 (19:41 +0300)]
audioaggregator: Make access to the pad list thread-safe while mixing

When mixing every single buffer the object lock is shortly released and
acquired again. In the meantime the pad list can become invalid because
a pad was removed or added, and equally the current pad might as well
have been finalized in the meantime.

To get around that, take a snapshot of all sinkpads before mixing and
work with that list of pads.

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

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/5553>

5 months agogood:rtsp: Fix the issue that gst_uri_join_strings() construct missing uri 98/300398/8 accepted/tizen/unified/20231025.093257 accepted/tizen/unified/20231025.120151
jiyong.min [Mon, 23 Oct 2023 23:09:33 +0000 (08:09 +0900)]
good:rtsp: Fix the issue that gst_uri_join_strings() construct missing uri

Change-Id: I09177a09255de0ec05cf70d06b1f4d83c9dafd7f

5 months agoglfiter: Protect GstGLContext access
Jan Schmidt [Thu, 5 Oct 2023 02:49:16 +0000 (13:49 +1100)]
glfiter: Protect GstGLContext access

The propose and decide allocation vfuncs are called directly from
basetransform and need to use the locked accessor function for
retrieving a reliable reference to the GstGLContext (if available)

Fixes spurious crashes on shutdown during pad reconfiguration

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/5518>

5 months agotsmux: Fix default get_es_descrs_func
Jan Alexander Steffens (heftig) [Tue, 10 Oct 2023 08:39:55 +0000 (10:39 +0200)]
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>

5 months agotsmux: Fix default new_stream_func
Jan Alexander Steffens (heftig) [Tue, 10 Oct 2023 08:22:44 +0000 (10:22 +0200)]
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>

5 months agotsmux: Add missing include
Jan Alexander Steffens (heftig) [Tue, 10 Oct 2023 08:12:44 +0000 (10:12 +0200)]
tsmux: Add missing include

We need `GstMpegtsPMTStream` here.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/5516>

5 months agotsmux: Simplify tsmux_section_write_packet
Jan Alexander Steffens (heftig) [Mon, 16 Oct 2023 22:57:56 +0000 (00:57 +0200)]
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>

5 months agotsmux: tsmux_packet_out should always consume its buffer
Jan Alexander Steffens (heftig) [Mon, 16 Oct 2023 22:54:38 +0000 (00:54 +0200)]
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>

5 months agotsmux: Don't memset in pad_stream when writing a PCR packet
Jan Alexander Steffens (heftig) [Mon, 16 Oct 2023 21:54:20 +0000 (23:54 +0200)]
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>

5 months agotsmux: Move out parameters of tsmux_write_ts_header
Jan Alexander Steffens (heftig) [Mon, 16 Oct 2023 21:52:48 +0000 (23:52 +0200)]
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>

5 months agotsmux: Fix two more uses of gst_buffer_map
Jan Alexander Steffens (heftig) [Mon, 16 Oct 2023 21:50:16 +0000 (23:50 +0200)]
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>

5 months agoqmlglsrc: sync on the streaming thread
Matthias Fuchs [Tue, 17 Oct 2023 13:24:22 +0000 (15:24 +0200)]
qmlglsrc: sync on the streaming thread

After rendering a QML scene the qmlglsrc element copies the contents of
the scene to a GStreamer buffer. This happens on the Qt render thread.
Then it attaches a sync point to the destination buffer. This sync point
must be awaited by other threads which use the buffer later on. The
current implementation relies on the downstream elements to wait for the
sync point. However, there are situation where this does not work. The
GstBaseTransform e.g. copies the buffer metadata (which overwrites the
sync point without waiting for it) *before* waiting for the sync point.

This commit waits for the sync point inside the qmlglsrc element before
sending it downstream. The wait command is issued on the streaming
thread with the pipeline OpenGL context, i.e. it will synchronize with
the GStreamer OpenGL thread.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/5515>

5 months agotsmux: Fix error handling in pad_stream
Jan Alexander Steffens (heftig) [Mon, 16 Oct 2023 13:41:48 +0000 (15:41 +0200)]
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>

5 months agotsmux: Fill padding packets with stuffing bytes
Jan Alexander Steffens (heftig) [Mon, 16 Oct 2023 13:31:04 +0000 (15:31 +0200)]
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>

6 months agov4l2codecs: h265: Fix entry_point_offsets array leak
Nicolas Dufresne [Tue, 17 Oct 2023 18:56:34 +0000 (14:56 -0400)]
v4l2codecs: h265: Fix entry_point_offsets array leak

This array was being leaked.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/5503>

6 months agocodecs: h265: Do not free slice header before using it
Detlev Casanova [Tue, 17 Oct 2023 16:42:59 +0000 (12:42 -0400)]
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>

6 months agortspclientsink: Don't leak previous server_ip
Doug Nazar [Fri, 14 May 2021 02:25:55 +0000 (22:25 -0400)]
rtspclientsink: Don't leak previous server_ip

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/5502>

6 months agokmssink: Add TIDSS auto-detection
Rahul T R [Thu, 12 Oct 2023 10:55:59 +0000 (16:25 +0530)]
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>

6 months agoimagesequencesrc: fix regular image deadlock
Stéphane Cerveau [Thu, 12 Oct 2023 14:05:18 +0000 (16:05 +0200)]
imagesequencesrc: fix regular image deadlock

With one regular image file path provided (without %05d),
the element was stuck in a dead loop counting the frames:

gst_image_sequence_src_count_frames

This allows to display any image file out of the element
for a given number of buffers.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/5487>