Commit graph

1619 commits

Author SHA1 Message Date
Sebastian Dröge 94a0d579d7 systemclock: Use futex_time64 syscall if available (32-bit systems) and use correct struct timespec definition
See also https://gitlab.gnome.org/GNOME/glib/-/issues/2634

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

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/3572>
2022-12-15 13:16:03 +00:00
A. Wilcox 551dd7df38 mpegts: Handle when iconv doesn't support ISO 6937
Systems like musl libc don't support ISO 6937 in iconv.  This ensures
that the MPEG-TS plugin can cope with that.  There is existing support
in the plugin for other methods, so it seems to have been the original
intent anyway.

Fixes: #1314
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/3563>
2022-12-12 13:55:18 +00:00
Tim-Philipp Müller 19566c3a06 timeoverlay: fix pad leak
Spotted by Jiri Uncovsky.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/3559>
2022-12-11 17:46:13 +00:00
Tim-Philipp Müller 448cb1c2c3 vaapi: prefix USE_FOO defines to fix build with mesa 22.3.0
Apparently mesa 22.3.0 has updated the egl headers, and eglplatform.h now
contains commit
3670d645f4
after which xlib headers don't get included by default anymore but are
dependent upon whether USE_X11 was defined.

This breaks headless builds of gstreamer-vaapi because we always define
an internal define USE_X11 as either 1 or 0.

Change these defines to GST_VAAPI_USE_XYZ instead to avoid this.

Fixes #1634

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/3558>
2022-12-11 11:13:17 +00:00
Edward Hervey 5b4653756e mpegts: Check continuity counter on section streams
This wasn't really done, and is needed in order to detect potential section
changes for sections that have got identical information (such as when switching
between streams that have the same PAT/PMT pid and subtable information).

Other checks exist in tsbase to detect if the "new" PAT/PMT really is an update or not.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/3556>
2022-12-11 00:37:18 +00:00
Xavier Claessens 68079f03f9 hotdoc: gst-hotdoc-plugins-scanner is not needed for libraries
Meson >= 0.64.0 does not allow any more to add executables into
hotdoc.generate_doc(..., dependencies: ...) and it should not be needed
any way.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/3554>
2022-12-10 13:49:06 +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
Sebastian Dröge c44ed8af36 textrender: Negotiate caps on a GAP event if none were negotiated yet
Otherwise downstream wouldn't have received a segment event either and
wouldn't know what to do with the gap event

And also forward any pending segment event.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/3548>
2022-12-08 13:05:15 +00:00
Marek Olejnik 14f6dbc39a h265decoder: Do not abort when failed to prepare ref pic set
Currently the element calls abort when failed to prepare reference
picture set. This can happent when the input stream is somehow
corrupted, like a rtsp strem with lost packets. Now it will only
return with GST_FLOW_ERROR instead of terminating whole process.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/3542>
2022-12-08 02:12:37 +09:00
Tim-Philipp Müller 7f093a779a meson: fix check for pthread_setname_np()
Need to define _GNU_SOURCE.

Fixes #1542

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/3539>
2022-12-07 12:06:03 +00:00
Sebastian Dröge fbffce6d0d dvbsubenc: Forward GAP events as-is if we wouldn't produce an end packet and are not in the middle of an existing subtitle
An end packet is only produced once for the last subtitle, so multiple
GAP events between subtitles would result only in a single end packet
and nothing else otherwise. This would potentially starve downstream
then, so instead forward the GAP events in that case.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/3536>
2022-12-07 10:41:39 +00:00
Nirbheek Chauhan c4ed258573 directshow: Fix build error with glib 2.75 and newer
Starting with glib 2.75, `NULL` is `nullptr`, which cannot be
implicitly coerced to `0`, unlike `NULL`. So explicitly pass `0`.

```
[3206/4524] Compiling C++ object subprojects/gst-plugins-bad/sys/directshow/gstdirectshow.dll.p/dshowvideosink.cpp.obj
FAILED: subprojects/gst-plugins-bad/sys/directshow/gstdirectshow.dll.p/dshowvideosink.cpp.obj
"cl" "-Isubprojects\gst-plugins-bad\sys\directshow\gstdirectshow.dll.p" "-Isubprojects\gst-plugins-bad\sys\directshow" "-I..\subprojects\gst-plugins-bad\sys\directshow" "-Isubprojects\gst-plugins-bad" "-I..\subprojects\gst-plugins-bad" "-Isubprojects\gst-plugins-base\gst-libs" "-I..\subprojects\gst-plugins-base\gst-libs" "-Isubprojects\gstreamer\libs" "-I..\subprojects\gstreamer\libs" "-Isubprojects\gstreamer" "-I..\subprojects\gstreamer" "-Isubprojects\orc" "-I..\subprojects\orc" "-I..\subprojects\gst-plugins-bad\sys\directshow\strmbase\baseclasses" "-Isubprojects\gst-plugins-base\gst-libs\gst\video" "-Isubprojects\gstreamer\gst" "-Isubprojects\gst-plugins-base\gst-libs\gst\audio" "-Isubprojects\gst-plugins-base\gst-libs\gst\tag" "-IC:/gst-install/include/glib-2.0" "-IC:/gst-install/lib/glib-2.0/include" "-IC:/gst-install/include" "/MD" "/nologo" "/showIncludes" "/utf-8" "/W2" "/EHsc" "/O2" "/Zi" "/wd4018" "/wd4146" "/wd4244" "/wd4305" "/utf-8" "/we4002" "/we4003" "/we4013" "/we4020" "/we4027" "/we4029" "/we4033" "/we4045" "/we4047" "/we4053" "/we4062" "/we4098" "/we4101" "/we4189" "/utf-8" "-D_MBCS" "/wd4189" "/wd4456" "/wd4701" "/wd4703" "/wd4706" "/wd4996" "-DHAVE_CONFIG_H" "/Fdsubprojects\gst-plugins-bad\sys\directshow\gstdirectshow.dll.p\dshowvideosink.cpp.pdb" /Fosubprojects/gst-plugins-bad/sys/directshow/gstdirectshow.dll.p/dshowvideosink.cpp.obj "/c" ../subprojects/gst-plugins-bad/sys/directshow/dshowvideosink.cpp
../subprojects/gst-plugins-bad/sys/directshow/dshowvideosink.cpp(62): warning C5051: attribute 'noinline' requires at least '/std:c++20'; ignored
../subprojects/gst-plugins-bad/sys/directshow/dshowvideosink.cpp(123): error C2664: 'LRESULT SendMessageA(HWND,UINT,WPARAM,LPARAM)': cannot convert argument 3 from 'nullptr' to 'WPARAM'
../subprojects/gst-plugins-bad/sys/directshow/dshowvideosink.cpp(123): note: A native nullptr can only be converted to bool or, using reinterpret_cast, to an integral type
C:\Program Files (x86)\Windows Kits\10\include\10.0.19041.0\um\winuser.h(3690): note: see declaration of 'SendMessageA'
../subprojects/gst-plugins-bad/sys/directshow/dshowvideosink.cpp(635): error C2664: 'BOOL SystemParametersInfoA(UINT,UINT,PVOID,UINT)': cannot convert argument 2 from 'nullptr' to 'UINT'
../subprojects/gst-plugins-bad/sys/directshow/dshowvideosink.cpp(635): note: A native nullptr can only be converted to bool or, using reinterpret_cast, to an integral type
C:\Program Files (x86)\Windows Kits\10\include\10.0.19041.0\um\winuser.h(13153): note: see declaration of 'SystemParametersInfoA'
../subprojects/gst-plugins-bad/sys/directshow/dshowvideosink.cpp(1593): error C2664: 'LRESULT SendMessageA(HWND,UINT,WPARAM,LPARAM)': cannot convert argument 3 from 'nullptr' to 'WPARAM'
../subprojects/gst-plugins-bad/sys/directshow/dshowvideosink.cpp(1593): note: A native nullptr can only be converted to bool or, using reinterpret_cast, to an integral type
C:\Program Files (x86)\Windows Kits\10\include\10.0.19041.0\um\winuser.h(3690): note: see declaration of 'SendMessageA'
```

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/3533>
2022-12-07 00:56:57 +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
Edward Hervey 363f8bcc1e gst-inspect: Don't leak list
Just iterate the list instead of trying to be smart...

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/3499>
2022-12-04 13:48:02 +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
Seungha Yang d87d33d3fe mfvideosrc: Fix buffer leak
The allocated buffer should be released

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/3496>
2022-12-01 00:02:19 +00:00
Seungha Yang 7300e51fbe mediafoundation: Chain up from GObject::constructed
... so that GstTracer can trace it

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/3496>
2022-12-01 00:02:19 +00:00
Seungha Yang 5996fad734 d3d11: Use correct ref/unref methods
Those objects are GstObject subclasses

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/3496>
2022-12-01 00:02: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 0881870219 audioconvert, audioresample, audiofilter: fix divide by 0 for input buffer without caps
gst-launch-1.0 audiotestsrc ! udpsink host=127.0.0.1
gst-launch-1.0 udpsrc ! audioconvert ! autoaudiosink

would crash with a floating point exception when clipping the input
buffer owing to a division by zero because no caps event was received.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/3470>
2022-11-26 11:19:09 +01:00
He Junyan d6b4d7a071 h264parser: Fix a typo in pred_weight_table parsing.
When setting default values, the reference list number of l1 is wrong.

Fix: https://gitlab.freedesktop.org/gstreamer/gstreamer-vaapi/-/issues/336
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/3468>
2022-11-25 17:27:29 +01:00
Sebastian Dröge efc6d5d461 dvbsubenc: Write Display Definition Segment if a non-default width/height is used
Otherwise it can't be rendered by dvbsuboverlay or ffmpeg at least.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/3459>
2022-11-23 12:28:43 +00:00
Sebastian Dröge 7c0541f549 textrender: Don't pass plaintext as pango markup to Pango
Otherwise e.g. & in the text will cause Pango to complain about invalid
markup and render the text incorrectly.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/3458>
2022-11-23 12:49:47 +01:00
Sebastian Dröge 1bac733938 textrender: Don't blindly forward all events
Use gst_pad_event_default(), which does the right thing by default.
Especially it does not forward text/x-plain caps downstream.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/3458>
2022-11-23 12:49:47 +01:00
Célestin Marot 8e8a5d94d4 fakesrc: avoid time overflow with datarate
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/3438>
2022-11-19 12:02:18 +00:00
Edward Hervey 080818140d Revert "mpegtspacketizer: memcmp potentially seen_before data"
This reverts commit fcad4cc646.

This was wrong is so many ways.

* The memcmp was badly used (it should use == 0 to check the data is identical,
  and not != 0)
* There was no boundary checks on the present stream section_data when passing
  it to memcmp.
* The return value should have been TRUE (i.e. we have done all checks, none of
  them failed, therefore the section has been seen before)
* stream->section_data would *always* be NULL if the section had already been
  processed

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

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/3427>
2022-11-19 00:41:43 +00:00
Edward Hervey d0ed03fe3b mpegts: Check is program is identical before updating
There is no need to update the program if it's identical :)

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/3427>
2022-11-19 00:41:43 +00:00
Boyuan Zhang 5fc136bcf2 libs: context: use queried value for attrib
Attribute's value should use returned value from get_attribute for
VAConfigAttribRTFormat, since VAProfileHEVCMain10, in AMD Mesa Gallium,
can process either VA_RT_FORMAT_420 and VA_RT_FORMAT_420_10, which isn't
considered in gstreamer-vaapi design, where encoder's src pads will
expose only 4:2:0 color formats but no 4:2:0 10bit. So, this is a workaround
for this issue while new vah265enc is released.

Signed-off-by: Boyuan Zhang <boyuan.zhang@amd.com>
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/3435>
2022-11-19 00:08:35 +00: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
Seungha Yang f74e856255 d3d11screencapturesrc: Specify PAR 1/1 to template caps
... otherwise PAR can be wrongly signalled during the negotiation

Fixing below pipeline when desktop resolution is not 640x480
gst-launch-1.0.exe \
  d3d11screencapturesrc ! videoscale !
  video/x-raw,width=640,height=480,pixel-aspect-ratio=1/1 ! d3d11videosink

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/3372>
2022-11-15 11:26:09 +00:00
Edward Hervey 169bbd2fea oggdemux: Don't leak incoming EOS event
If we're going to drop it ... then do drop it :)

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/3412>
2022-11-15 05:31:57 +00:00
Jan Schmidt a44530df57 aesdec: Fix padding removal for per-buffer-padding=FALSE
When per-buffer-padding is FALSE, the OpenSSL context needs
to be told to remove any padding at the end of the ciphertext

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

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/3411>
2022-11-15 04:54:53 +00:00
Jan Alexander Steffens (heftig) 8c1243a595 rtmp2: Improve error messages
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/3368>
2022-11-15 02:38:32 +00:00
Jan Alexander Steffens (heftig) a4121afebb rtmp2/connection: Pass triggering GError in 'error' signal
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/3368>
2022-11-15 02:38:32 +00:00
Jan Alexander Steffens (heftig) 7a80611c3a rtmp2/connection: Pass triggering GError to _emit_error
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/3368>
2022-11-15 02:38:32 +00:00
Jan Alexander Steffens (heftig) 90f39a4c7e rtmp2/connection: Discern reasons for cancelling all commands
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/3368>
2022-11-15 02:38:32 +00:00
Jan Alexander Steffens (heftig) 7b9fbf9d4f rtmp2/connection: Handle EOF like error
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/3368>
2022-11-15 02:38:32 +00:00
Jan Alexander Steffens (heftig) aea80f0529 rtmp2/client: Make sure 'salt' is not NULL
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/3368>
2022-11-15 02:38:32 +00:00
Jan Alexander Steffens (heftig) c802180d6b rtmp2/client: Make sure 'reason' is not NULL
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/3368>
2022-11-15 02:38:32 +00:00
Jan Alexander Steffens (heftig) 1bc0e9e1cb rtmp2/client: Make sure 'desc' is not NULL
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/3368>
2022-11-15 02:38:32 +00:00
Jan Alexander Steffens (heftig) e2fa6916a9 rtmp2/client: Make sure 'code' is not NULL
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/3368>
2022-11-15 02:38: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
Sebastian Dröge 30d894866d allocator: Switch allow-none annotations to nullable / optional
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/3369>
2022-11-09 01:47:51 +00:00
Sebastian Dröge ef8474aad5 allocator: Copy allocator name in gst_allocator_register()
The parameter is not marked as `transfer full` and stays around in the
hash table, so we will have to copy it ourselves.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/3369>
2022-11-09 01:47:51 +00:00
Edward Hervey 3cc45d5a36 subparse: Fix non-closed tag handling.
Unclear what the goal was, but we could end up reading way past the next_tag.

Instead just move everything from after the end tag ('>') to the next_tag.

Fixes https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=53040

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/3351>
2022-11-07 12:45:29 +00:00
Seungha Yang b6309a569a d3d11videosink: Always clear back buffer on resize
Swapchain may not need to be resized if the size of backbuffer
is equal to the previous size. Then previously rendered frame will be stay
on the screen. Do clear back buffer whenever resize() is called

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/3342>
2022-11-06 03:26:31 +09: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
Edward Hervey 5ec482bdcf gstpad: Fix non-serialized sticky event push
With non-serialized sticky events, such as GST_EVENT_INSTANT_RATE, we both want
to store the event (for later re-linking) *AND* push the event in a non-blocking
way.

We therefore must *not* propagate pending sticky events if the event is "sticky
or serialized" but only if it's "serialized"

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/3332>
2022-11-04 19:33:12 +00:00
Jan Alexander Steffens (heftig) 39f4d5849f srt: Remove callers for which srt_bstats fails
This keeps them from accumulating in the element and in the stats while
the sink is not being fed, as long as we at least periodically grab
stats.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/3329>
2022-11-04 18:17:06 +00:00
Jan Alexander Steffens (heftig) 253a5cc125 srt: Use simpler list operations for callers
Avoid `g_list_append` and `g_list_remove` (which have to scan the list)
and replace them with `g_list_prepend` and `g_list_delete_link`.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/3329>
2022-11-04 18:17:06 +00:00
Jan Alexander Steffens (heftig) 68cd5e1de1 srt: Clean up poll/sock lifecycle
Make sure `srtobject->poll_id` is never invalid as long as `srtobject`
exists. Only remove our caller socket from it when the socket becomes
invalid.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/3329>
2022-11-04 18:17:06 +00:00
Jan Alexander Steffens (heftig) debb19868f srt: Clean up error handling
- Make the srt_epoll_wait loops more uniform.

- Error only via GError when possible; let the element send the error
  message. Avoids a second error message.

- Return 0 when cancelled. Avoids an error message from the element.

- Don't send an error message from send_headers when we're a server
  sink.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/3329>
2022-11-04 18:17:06 +00:00
Jan Alexander Steffens (heftig) 7425fdf2ba srt: Simplify socket stats
Don't hide stats depending on whether we're a sending or receiving
socket. While we're here, add some more debug logs.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/3329>
2022-11-04 18:17:06 +00:00
Jan Alexander Steffens (heftig) 34f9788dd6 srt: Replace stats accumulation with naive byte counting
srt_bstats cannot be used to get the stats of closed connections, so the
best we can do is keep the running count ourselves.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/3329>
2022-11-04 18:17:06 +00:00
Sebastian Dröge 4925002d87 core/base: Only post latency messages if the latency values have actually changed
Fixes https://gitlab.freedesktop.org/gstreamer/gstreamer/-/issues/1525

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/3291>
2022-10-27 23:18:37 +01:00
Edward Hervey 74ec0d4b0c videodecoder: Only post latency message if it changed
Posting latency messages causes a full and potentially expensive latency
recalculation of the pipeline. While subclasses should check whether the latency
really changed or not before calling this function, we ensure that we do not
post such messages if it didn't change.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/3291>
2022-10-27 23:15:31 +01:00
Nicolas Dufresne c29bfbe448 avdec_h265: Fix endless renegoation with alternate interlacing
The picture parameter picture->top_field_first is reused in this mode
to signal the TOP fields. As a side effect, it will change every frame
and current code assumed that if this changes then a renegotiation is
needed. Fixed this by ignoring that change whenever we are decoding one field
only.

Fixes #1523

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/3289>
2022-10-27 18:02:54 +01:00
Edward Hervey 5d22503a55 concat: Properly propagate EOS seqnum
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/3288>
2022-10-27 16:38:02 +01:00
Nicolas Dufresne 7071c4ec2f avviddec: Avoid flushing on framerate changes
A framerate change does not require flushing the decoder and causes
issues with some specific fragmented files if the two fragments have
different framerate.

Fixes #1522

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/3280>
2022-10-27 01:32:05 +01:00
Nicolas Dufresne ea1dc750ae alphacombine: Add missing query handler for gaps
The gap handling was in place, but there was no event handler to trigger it.
Implement the alpha sink event handler for the gaps. This fixes handling of
valid streams which may not refresh the alpha frames for every video frames.
It will also allow a clean error if the stream was missing the initial
alpha frame, at least until we find a better way to handle these
invalid frames.

Related to #1518

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/3279>
2022-10-26 23:42:43 +01:00
Ignacio Casal Quinteiro 049737966d avfdeviceprovider: do not leak the properties
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/3278>
2022-10-26 22:57:14 +01:00
Seungha Yang c865a2b9c3 videosink: Don't return unknown end-time from get_times()
... in case of reverse playback. Otherwise basesink will not
wait for clock

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/3277>
2022-10-26 22:03:16 +01:00
Patrick Griffis fef136b3d0 build: Fix building ges with tools disabled
If you configure with `tools=disabled` then ges_launch is undefined.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/3274>
2022-10-26 19:55:27 +01:00
Patrick Griffis c560ec47fb webrtc: Fix double free in webrtc-recvonly-h264 demo
The "message" signal does not transfer ownership of the GBytes passed
to it so calling g_bytes_unref() on it is incorrect.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/3272>
2022-10-26 18:28:35 +01: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
Patrick Griffis 98bc763f2b webrtc: Fix critical in webrtc-recvonly-h264 example
This signal only takes 2 properties yet a third was passed.
This would cause a critical in GLib.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/3269>
2022-10-26 15:42:42 +01:00
Nirbheek Chauhan d1d365373f gl/vulkan: Fix static linking on macOS
duplicate symbol '__invoke_on_main' in:
    /Library/Frameworks/GStreamer.framework/Versions/1.0/lib/libgstvulkan-1.0.a(cocoa_gstvkwindow_cocoa.m.o)
    /Library/Frameworks/GStreamer.framework/Versions/1.0/lib/libgstgl-1.0.a(cocoa_gstglwindow_cocoa.m.o)
ld: 1 duplicate symbol for architecture x86_64
clang: error: linker command failed with exit code 1 (use -v to see invocation)

Also make the same change in iOS for consistency.

Continuation of https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/issues/1132

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/3263>
2022-10-25 11:06:34 +01:00
Seungha Yang 8a7ae99567 padtemplate: Fix annotations
gst_caps_replace() does not take ownership of the new caps

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/3262>
2022-10-25 10:12:21 +01:00
Nirbheek Chauhan ccd032c569 FFmpeg.wrap: Fix to the 4.4.2 stable release
We've had a lot of changes in the meson-4.4 branch that can and have
broken builds, so let's fix it to the stable release right before
that.

https://gitlab.freedesktop.org/gstreamer/gstreamer/-/issues/1497

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/3187>
2022-10-23 23:40:02 +00:00
Tim-Philipp Müller a2a300a0e6 gst-plugins-base: bump core req to 1.20.4
For newly-added _gst_meta_tag_memory_reference symbol.

https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/2928#note_1591459

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/3185>
2022-10-23 17:29:40 +00:00
Matthew Waters a679a55ecc webrtcbin: also add rtcp-fb ccm fir for video mlines by default
In addition to the 'nack pli' already added.  Both are supported by
rtpbin/rtpsession by default already.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/3247>
2022-10-22 11:37:16 +01:00
Matthew Waters af92290306 build/gl: fix automatic dispmanx detection for rpi4
rpi4 doesn't contain dispmanx but still contains bcm_host.pc which
confuses the configure detection.  Add an explicit check for
EGL_DISPMANX_WINDOW_T to ensure that we only build with dispmanx when
the types are available.

Fixes: https://gitlab.freedesktop.org/gstreamer/gst-plugins-base/-/issues/893
Fixes: https://gitlab.freedesktop.org/gstreamer/gst-plugins-base/-/issues/952
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/3246>
2022-10-22 10:42:17 +01:00
Bunio_FH b7ae311c75 gstminiobject: shares capacity increase
during the MSE (WebKit) tests from Apple suite:
https://hls-streaming.cdn-apple.com/hls_conformance/dist/v1.1/index.html?pretty=true&whitelist=MSE%20Suite
webkit attempts to add a single audio buffer containing ~35.5k frames.
when corresponding GstSamples are pulled buffer is being referenced
more than object capacity allows: 2^15-1. since the case could be considered
malformed a surgical patch is applied to increase the capacity.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/3233>
2022-10-20 12:42:56 +00:00
Jordan Petridis e144ec015e cdparanoia: Ignore compiler warning coming from the cdparanoia header
When trying to build the plugin, GCC starts complaining about issues
with one of the cdparanoia headers and it block us from being able
to build the plugin with Werror.

The current warning in the header look like this:

```
[1/2] Compiling C object subprojects/gst-plugins-base/ext/cdparanoia/libgstcdparanoia.so.p/gstcdparanoiasrc.c.o
In file included from ../subprojects/gst-plugins-base/ext/cdparanoia/gstcdparanoiasrc.h:37,
                 from ../subprojects/gst-plugins-base/ext/cdparanoia/gstcdparanoiasrc.c:31:
/usr/include/cdda/cdda_interface.h:164:3: warning: initialization discards ‘const’ qualifier from pointer target type [-Wdiscarded-qualifiers]
  164 |   "Success",
      |   ^~~~~~~~~
...
/usr/include/cdda/cdda_interface.h:163:14: warning: ‘strerror_tr’ defined but not used [-Wunused-variable]
  163 | static char *strerror_tr[]={
      |              ^~~~~~~~~~~
[2/2] Linking target subprojects/gst-plugins-base/ext/cdparanoia/libgstcdparanoia.so
```

Last release of cdparanoia was in 2008, so our best bet for the
time is to ignore the warnings.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/3232>
2022-10-20 11:41:10 +01:00
Sam Van Den Berge 3e4f94db14 examples/webrtc/signalling: Fix compatibility with Python 3.10
Fix asyncio throwing a deprecation warning when using
asyncio.get_event_loop().

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/3201>
2022-10-17 14:15:04 +02:00
Mathieu Duponchelle 6bb564968b webrtc/nice: fix small leak of split strings
g_strfreev previously stopped at our manual NULL-termination. Fix by
restoring the pointer after joining.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/3190>
2022-10-15 11:01:23 +00:00
Arun Raghavan b0fa56a333 rtmp2sink: Correctly return GST_FLOW_ERROR on error
If there is an error while connecting, the streaming task will be stopped, and
is_running() will be false, causing a GST_FLOW_FLUSHING to be returned. Instead,
we perform the error check (!self->connection) first, to return an error if
that's what occured.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/3192>
2022-10-15 11:00:20 +01:00
Edward Hervey c9006504bb gst-play: Don't leak the stream collection
We are given a reference to the collection when parsing it from the
message. Just store it (instead of referencing it again).

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/3191>
2022-10-15 10:15:26 +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
Nicolas Dufresne 0c28e3cf26 opengl: Fix usage of eglCreate/DestroyImage
The implementation was inconsistent between create and destroy. EGLImage
creation and destruction is requires for EGL 1.5 and up, while
otherwise the KHR version is only available if EGL_KHR_image_base
feature is set. Not doing these check may lead to getting a function
pointer to a stub, which is notably the case when using apitrace.

Fixes #1389

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/3170>
2022-10-12 23:43:49 +00: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
Linus Svensson 604e6a1336 rtsp-server: Free client if no connection could be created
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/3171>
2022-10-12 21:34:04 +00:00
Wojciech Kapsa 9dfb7b411e decklink: reset calculation of gst_decklink_video_src_update_time_mapping on no_signal. When the HDMI cable was disconnected for a long time, the calculation took too much time. SDI cable works fine.
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/3168>
2022-10-12 19:04:55 +00:00
Tim-Philipp Müller 825746d121 Back to development 2022-10-12 18:40:25 +01:00
Tim-Philipp Müller 642730bd67 Release 1.20.4 2022-10-12 16:39:51 +01:00
Tim-Philipp Müller 7275d3d136 Update ChangeLogs for 1.20.4 2022-10-12 16:39:40 +01:00
Seungha Yang 191b78a35a mxfdemux: Always calculate BlockAlign of raw audio
Workaround for nBlockAlign and nBitsPerSample mismatch. Always
use the formula described in the specification for BlockAlign value

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/3149>
2022-10-09 12:54:42 +01:00
Mathieu Duponchelle bda25f31a7 splitmuxsrc: don't consider unlinked pads when deactivating part
If splitmuxsrc exposes multiple pads, but only one is linked, part pads
will never see an EOS event. This shouldn't prevent the part from being
eventually deactivated.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/3148>
2022-10-08 11:08:41 +00:00
Jan Schmidt 1477dab01d xvimagesink: Don't leak XvShmImage
If allocating an XvShmImage generates an X error, but
still returns some allocated memory, make sure to free it
so it doesn't leak.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/3147>
2022-10-08 10:30:04 +00:00
Jan Schmidt 2a683372bc decodebin3: Make sure event is writable before modifying
Make sure we're operating on a private copy of an event when
modifying it.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/3146>
2022-10-08 10:42:59 +01:00
Jan Schmidt 32e175026f urisourcebin: Make sure event is writable before modifying.
Make sure we're operating on a private copy of an event before
modifying it.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/3146>
2022-10-08 10:42:59 +01:00
Jan Schmidt 6e61030ded decodebin3: Don't lose a ref on EOS event
Make sure not to give away the ref on the final EOS
event for which the probe handler is returning GST_PAD_PROBE_REMOVE
when pushing the event manually.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/3146>
2022-10-08 10:42:59 +01:00
Seungha Yang 05c503ff4a nvdec: Fix for HEVC decoding when coded resolution is larger than display resolution
As documented in the SDK header, we should set coded width/height
values to the corresponding decoder configuration option,
instead of display resolution

Fixes: https://gitlab.freedesktop.org/gstreamer/gstreamer/-/issues/1438
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/3143>
2022-10-07 22:18:28 +00:00
Guillaume Desmottes b5fde8d856 aggregator: fix input buffering
We need to be able to buffer at least the aggregator latency +
upstream latency, which is the value used to compute the aggregator
deadline.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/3142>
2022-10-07 21:40:24 +00:00
Stéphane Cerveau 317d2a814f ges: remove memory leak with description
free the capsdesc

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/3140>
2022-10-07 20:43:39 +00:00
Stéphane Cerveau aaa7a690fa nle: clear seek event properly
Use gst_clear_event instead of g_clear_object
avoiding a failing gobject unref

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/3140>
2022-10-07 20:43:39 +00:00
Sangchul Lee f8b248cb1a webrtcbin: Fix pointer dereference before null check
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/3133>
2022-10-07 19:51:17 +00:00
Sebastian Dröge 3b6234829a rtspsrc: Retry SETUP with non-compliant URL resolution on "Bad Request" and "Not found"
Various RTSP servers/cameras assume base and control URL to be simply
appended instead of being resolved according to the relative URL
resolution algorithm as mandated by the RTSP specification.

To work around this, try using such a non-compliant control URL if the
server didn't like the URL used in the first SETUP request.

Fixes https://gitlab.freedesktop.org/gstreamer/gstreamer/-/issues/1447
Fixes https://gitlab.freedesktop.org/gstreamer/gst-plugins-good/-/issues/922

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/3137>
2022-10-07 18:54:57 +00:00
Aleksandr Slobodeniuk c9219a0cb6 decodebin3: fix mutex leaks
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/3130>
2022-10-07 17:19:32 +00:00
Mathieu Duponchelle 397c4c3392 avauddec: address regression with WMA files ..
By outputting lead-in samples that FFmpeg now would like us to ignore,
and discarding trailing samples that it would now like us to output.

See https://gitlab.freedesktop.org/gstreamer/gstreamer/-/issues/1474

Fixes: https://gitlab.freedesktop.org/gstreamer/gstreamer/-/issues/1348
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/3125>
2022-10-07 16:31:09 +00:00
Sangchul Lee d6e8dc9077 webrtc/nice: Make sure to return NULL when validating turn server fails
It affects 'add-turn-server' signal action and 'turn-server' property
of webrtcbin.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/3124>
2022-10-07 15:19:50 +00:00
Jan Schmidt 4332635d9e playsink: Hold a reference to the soft volume element
Always hold a reference to the soft volume element
provided by the playsinkaudioconvert bin helper, the
same as when volume is provided by a sink element,
or the soft volume element gets unreffed too soon.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/3113>
2022-10-03 22:53:44 +01:00
Edward Hervey 4ab71ca3f1 queue2: Hold the lock when modifying sinkresult
As it's done elsewhere. Avoids a potential race of the field being modified in
the meantime.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/3111>
2022-10-03 17:19:53 +01:00
Tim-Philipp Müller 67245861a2 avauddec: fix unnecessary reconfiguration if the audio layout isn't specified
It would constantly want to renegotiate (and spam the debug log) even
though the channel layout hasn't actually changed. We use the same
fallback in gst_ffmpegauddec_negotiate() already.

This happens with WMA files for example.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/3105>
2022-10-01 11:39:00 +01:00
Tim-Philipp Müller 6b316052dc pbutils: descriptions: fix gst_pb_utils_get_caps_description_flags()
And add a little unit test.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/3098>
2022-09-30 12:51:46 +01:00
James Cowgill a08c972414 xmptag: Call gst_tag_register_musicbrainz_tags during init
We need to call this to register the MusixBrainz tags before we use
them in an XMP schema.

Fixes this critical when attempting to run jpegparse on a JPEG
containing MusicBrainz XMP tags:

  GStreamer-CRITICAL **: 20:41:07.885: gst_tag_get_type: assertion 'info != NULL' failed

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/3095>
2022-09-30 01:45:34 +01:00
Philipp Zabel 1c8244a19d buffer: drop parent meta in deep copy/foreach_metadata
The purpose of a deep buffer copy is to be able to release the source
buffer and all its dependencies. Attaching the parent buffer meta to
the newly created deep copy needlessly keeps holding a reference to the
parent buffer.

The issue this solves is the fact you need to allocate more
buffers, as you have free buffers being held for no reason. In the good
cases it will use more memory, in the bad case it will stall your
pipeline (since codecs often need a minimum number of buffers to
actually work).

Fixes #283

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/3090>
2022-09-29 11:57:53 +01:00
Mart Raudsepp b19116b786 tsdemux: Don't trigger a program change when falling back to ignore-pcr behaviour
Since commit a79a756b79 we could change to ignore-pcr automatically at 500ms
into a live stream when no PCR is seen by then. However the stream counting in
program change detection was wrongly considering ignore-pcr programs to have a
separate PCR PID, even though we are actually ignoring the PCR PID completely,
resulting in an erroneous program switch getting triggered from the different
stream count. This in turn would send an EOS and switch out the pads for what
actually is still the same program, while we intended to simply apply a
workaround for broken encoders.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/3089>
2022-09-28 12:27:19 +01:00
Edward Hervey 66064568de decodebin3: Fix memory issues with active selection list
This had a couple of issues:
* The backing strings (from GstStream) could disappear
* The actual list wasn't properly reset/freed when decodebin3 was re-used

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/3087>
2022-09-27 18:05:32 +00:00
Tim-Philipp Müller d5577bbe5c qtdemux: guard against timestamp calculation overflow in gap event loop
Could possibly cause an endless loop.

Fixes #1400.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/3085>
2022-09-27 15:04:06 +01:00
Sebastian Dröge c2c20d2437 gsturi: When setting the same string again do nothing
Otherwise code like gst_uri_set_host(uri, gst_uri_get_host(uri)) would
first free the string, then create a copy of the freed string and then
assigned that.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/3081>
2022-09-27 09:37:20 +01:00
Paweł Stawicki 0589e3ca80 queue2: Fix deadlock when deactivate is called in pull mode
check is flush was called before waiting on condition

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/3058>
2022-09-20 17:22:05 +01:00
Andrew Pritchard b91c2c1c65 Fix GstAmcSurfaceTexture segfault
Check that `self` and `self->callback` are defined. `self` can be set to
`NULL` in `remove_listener`, and `self->callback` can be set to `NULL`
inside `gst_amc_surface_texture_jni_set_on_frame_available_callback`.
This can cause a segfault since the Java object can outlive the C
object, and call the callback after `remove_listener` is called.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/3056>
2022-09-20 15:37:47 +01:00
Matthew Waters 2a4f96861e subparse: fix crash when parsing invalid timestamps in mpl2
Fixes https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=49245

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/2999>
2022-09-07 15:41:13 +01:00
Bruce Liang ebf3aa046e gst-rtsp-server: Fix pushing backlog to client
Check back pressure of a stream transport before popping buffer from its backlog.

If the stream transport is not experiencing back pressure, the buffer can be popped from backlog and pushed to client.

Fixes:#1298

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/2998>
2022-09-07 11:57:49 +00:00
Sebastian Dröge 1c3636f184 rtpjitterbuffer: Add test for crash caused by removing timers twice
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/2996>
2022-09-07 11:26:41 +00:00
Sebastian Dröge 773b7f61f2 rtpjitterbuffer: Make it more explicit that update_rtx_timers() takes ownership of the passed in timer
It is not valid anymore afterwards and must not be used, otherwise an
already freed pointer might be used.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/2996>
2022-09-07 11:26:41 +00:00
Sebastian Dröge 646766629f rtpjitterbuffer: Don't shadow variable
While this didn't cause any problems in this context it is simply
confusing.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/2996>
2022-09-07 11:26:41 +00:00
Sebastian Dröge 94122ba11b rtpjitterbuffer: Change RTX timer availability checks to assertions
It's impossible to end up in the corresponding code without a timer for
RTX packets because otherwise it would be an unsolicited RTX packet and
we would've already returned early.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/2996>
2022-09-07 11:26:41 +00:00
Sebastian Dröge dc408d56c5 rtpjitterbuffer: Only unschedule timers for late packets if they're not RTX packets and only once
Timers for RTX packets are dealt with later in update_rtx_timers(), and
timers for non-RTX packets would potentially also be unscheduled a
second time from there so avoid that.

Also don't shadow the timer variable from the outer scope but instead
make use of it directly.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/2996>
2022-09-07 11:26:40 +00:00
Sebastian Dröge 2b9009f504 rtsp-server: stream: Don't loop forever if binding to the multicast address fails
The address/port is pre-defined by the caller of the function, so
retrying is only going to loop forever.

Ideally the multicast address should be checked after allocating but
this doesn't happen currently, so it's better to error out cleanly then
to loop forever trying the same address.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/2997>
2022-09-07 11:55:29 +01:00
Raul Tambre 8bb230b72a rtpjitterbuffer: remove lost timer for out of order packets
When receiving old packets remove the running lost timer if present.
This fixes incorrect reporting of a lost packet even if it arrived in time.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/2995>
2022-09-07 11:17:54 +01:00
Martin Dørum 674bb309d8 gstpluginloader: Don't hang on short reads/writes
If read_one or write_one was called but the stream closed before it could
read/write a whole packet, read_one/write_one would hang indefinitely,
consuming 100% CPU. This commit fixes that by treating a short read/write
as an error.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/2994>
2022-09-07 10:15:51 +01:00
Xavier Claessens 1ba67eab9e gst_init: Initialize static plugins just before dynamic plugins
All plugins needs to be initialized after `gst_initialized = TRUE;`
otherwise they could complain that gst_init() has not been called.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/2991>
2022-09-07 09:38:20 +01:00
Sebastian Dröge 186d8bd789 rtpvp8depay: If configured to wait for keyframes after packet loss, also do that if incomplete frames are detected
This can happen if the data inside the packets is incomplete without the
seqnums being discontinuous because of ULPFEC being used.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/2988>
2022-09-07 00:52:32 +00:00
Rafael Caricio 4414271a02 audiovisualizer: fix buffer mapping to not increase refcount
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/2987>
2022-09-07 01:02:54 +01:00
Olivier Crête fa10a28016 value: Use g_critical() when trying to serialize things that can't be
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/2986>
2022-09-06 23:05:21 +01:00
Olivier Crête 1d32310089 gstvalue: Don't loop forever when serializing invalid flag
The serialization code would loop forever if an invalid flag was sent into it.

With unit test for this corner case.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/2986>
2022-09-06 23:05:20 +01:00
Piotr Brzeziński 8a81e5b9ff avfvideosrc: Fix wrong default framerate value
Current default G_MAXINT is not a correct value under any circumstances.
This creates an issue with screen capture, during which we currently do
not get any framerate info causing G_MAXINT to show up, where elements
downstream can possibly misbehave - for example, `vtenc` causes
a kernel panic.
Replace with 30/1 to avoid such scenarios.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/2946>
2022-09-06 19:49:27 +00:00
Jianhui Dai 24bf32cf54 v4l2allocator: Fix invalid imported dmabuf fd
Fix a typo that set userptr to dmabuf fd. It leads to failure of
dmabuf-import io-mode.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/2940>
2022-09-06 18:40:01 +00:00
Tim-Philipp Müller 3fb943472e subprojects: remove pcre.wrap
Remove pcre.wrap since it is pulled in automatically by glib and not
used by gstreamer.

Hopefully this fixes the msvc ci on the 1.20 branch which failed with
"gregex.c.obj : error LNK2001: unresolved external symbol pcre_free"
on pcre-8.45.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/2985>
2022-09-06 18:22:11 +01:00
zhiyuan.liu ede7bf44cf isoff: Fix earliest pts field parse issue
earliest pts will be covered by first_offset field on version 0 case.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/2934>
2022-08-24 11:03:45 +02:00
Philippe Normand d2110dfe1d openh264: Register debug categories earlier
Otherwise the GST_ERROR message logged in case of ABI mismatch would be done on
an uninitialized category.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/2924>
2022-08-22 22:28:19 +02:00
Philippe Normand 8d4f105fb7 openh264enc: Fix constrained-high encoding
constrained-high is high without B-frames, there is no EProfileIdc for this, so
assume high instead of hitting an assert down the line.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/2921>
2022-08-21 11:55:02 +01:00
Víctor Manuel Jáquez Leal 74b3e07616 vaapi: plugin: Handle when no encoders/decoders available.
Nouveau driver currently only exposes postproc entry. But
vaapidecodebin is registered independent if there are decoders or not,
exposing a segmentation fault.

This patch removes the encoder/decoder/codec arrays if no entries are
found, and if no decoders are found vaapidecodebin is not
registered. Also for vaapipostproc if no postproc entry is found.

Also, if general decoder, used by vaapidecodebin, doesn't have a sink
pad string, don't register the glib type.

Fixes: #1349
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/2906>
2022-08-17 12:58:24 +01:00
Daniel Morin 043727c4d5 gst-play: missing cleanup for g_autoptr
Without this change cleanup function for g_autoptr is not defined for
GstPlayMediaInfo, GstPlaySignalAdapter, GstPlayVideoRenderer,
GstPlayVideoOverlayVideoRenderer and GstPlayVisualization. Cleanup
function was defined in gstplay.h, but missing in other header files.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/2904>
2022-08-17 10:23:02 +01:00
Jan Schmidt 268db7160f splitmuxsrc: Stop pad task before cleanup
When stopping the element, make sure the pad task
is stopped before destroying the part readers.

Closes a race where the pad task might access
a freed pointer.

Also add a guard against this sort of thing
by holding a ref to the reader in the pad loop.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/2902>
2022-08-17 00:43:17 +00:00
Jan Schmidt f679fdff84 qtdemux: Avoid crash on reconfiguring.
When reconfiguring a stream that never created
an output pad, don't access a NULL GstPad pointer.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/2900>
2022-08-17 00:02:29 +01:00
Nicolas Dufresne 29910e233a v4l2bufferpool: Fix debug trace
The tracing of the buffer pointer was done on the secondary pointer, which
does not match with other traces of the same buffer. This made the trace
confusing and less useful.

Fixes #1379

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/2898>
2022-08-16 17:48:49 +01:00
Nirbheek Chauhan aaa75d022a meta: Set the parent refcount of the GstStructure correctly
The parent refcount is of the *transformed* buffer, not the input
buffer.

Also update the docs to clarify that @transbuf is the transformed
buffer, and not the buffer on which a transformation is being
performed.

Due to this bug, modifying the structure of a meta that has been
copied to another buffer fails with:

gst_structure_set: assertion 'IS_MUTABLE (structure) || field == NULL' failed

Add a test for the same.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/2894>
2022-08-15 22:52:49 +01:00
Khem Raj 73947c7e5f ssaparse: include required system headers for isspace() and sscanf() functions
Newer compilers ( clang 15 ) have turned stricter and errors out instead
of warning on implicit function declations

Fixes
gstssaparse.c:297:12: error: call to undeclared library function 'isspace' with type 'int (int)'; ISO C99 and later do not support implicit function declarations [-Wimplicit-function-declaration]
    while (isspace(*t))

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/2882>
2022-08-14 12:46:06 +01:00
Sebastian Dröge de470d0932 player: Don't leak wrapped video info
Fixes https://gitlab.freedesktop.org/gstreamer/gstreamer/-/issues/1373

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/2881>
2022-08-14 10:45:50 +01:00
Sebastian Dröge 23c438fdbc play: Make ownership of video-sink clearer in combination with floating references
And correctly handle the case of VideoRenderer::create_video_sink() not
actually returning a floating reference, which might be tricky for some
bindings.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/2881>
2022-08-14 10:45:50 +01:00
Sebastian Dröge b655e3fb94 play: Fix object construction
Ideally new() functions should simply call g_object_new() and not much
else, so let's do that here and handle all the construction properly in
a GObject way.

Now a play object created via g_object_new() is actually usable.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/2881>
2022-08-14 10:45:50 +01:00
Sebastian Dröge 828f2f692b player: Fix object construction
Ideally new() functions should simply call g_object_new() and not much
else, so let's do that here and handle all the construction properly in
a GObject way.

Now a player object created via g_object_new() is actually usable.

In addition, also fix the video-renderer property so that reading it
returns an object of the correct type.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/2881>
2022-08-14 10:45:50 +01:00
Sebastian Dröge 080ae01d86 player: Release signal adapter on finalize
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/2881>
2022-08-14 10:45:50 +01:00
Sebastian Dröge 7f9d689572 rtspsrc: Consider the actual control base URI also in case the connection URI contains a query string
That is, get rid of unnecessary and wrong special-casing.

This could always use gst_rtsp_url_get_request_uri_with_control() but as
we only have the control base URI as string it is easier to just call
gst_uri_join_strings().

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/2877>
2022-08-12 20:38:23 +01:00
Sebastian Dröge 54e29f0244 rtspurl: Use gst_uri_join_strings() in gst_rtsp_url_get_request_uri_with_control() instead of a hand-crafted, wrong version
For example the query string of the base must not be taken over to the
request URL unless there is no control path, and control paths can be
absolute and must not be considered relative if they start with a /.

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

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/2877>
2022-08-12 20:38:23 +01:00
Sebastian Dröge 7d7c608c2c rtspurl: Use fail_unless_equals_string() in tests
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/2877>
2022-08-12 20:38:23 +01:00
Matthias Clasen ad45d803e1 gstplayer: Plug a memory leak
This was showing up as a memory leak in GTK's
gstreamer media backend:

40 bytes in 1 blocks are definitely lost in loss record 18,487 of 40,868
   at 0x484586F: malloc (vg_replace_malloc.c:381)
   by 0x50D5278: g_malloc (gmem.c:125)
   by 0x50EDBA5: g_slice_alloc (gslice.c:1072)
   by 0x50EFBCC: g_slice_alloc0 (gslice.c:1098)
   by 0x51F2F45: g_type_create_instance (gtype.c:1911)
   by 0x51DAE37: g_object_new_internal (gobject.c:2011)
   by 0x51DC080: g_object_new_with_properties (gobject.c:2181)
   by 0x51DCB20: g_object_new (gobject.c:1821)
   by 0x9855F86: UnknownInlinedFun (gstplayer-wrapped-video-renderer.c:109)
   by 0x9855F86: gst_player_new (gstplayer.c:579)

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

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/2876>
2022-08-12 17:52:08 +01:00
Nirbheek Chauhan d6955cc227 rtpst2022-1-fecenc: Drain column packets on EOS
Otherwise we won't send the protection packets for the last few
packets when a stream ends.

Also send EOS on the FEC src row pad immediately, and on the FEC src
column pad after draining is complete. This makes it so that the FEC
src pads on rtpbin behave the same way as the RTCP src pads on rtpbin
when EOS is received on the send_rtp_sink pad.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/2874>
2022-08-12 15:04:02 +01:00
Jan Schmidt e237ed08ac basetextoverlay: Don't miscalculate text running times
When a new segment event arrives, it immediately updates
the current stored segment, which was used for calculating
the running time of the current text buffer for every
passing video frame. This means a segment that arrives
after the text buffer might get used to (mis)calculate
the running times subsequently.

Instead, calculate and store the right running time
using the current segment when storing the buffer. Later
the stored segment can get freely updated.

This fixes the case where pieces of video and text streams
are seamlessly concatenated and fed through the text overlay.
Previously, it could lead to the current text buffer suddenly
have a massive running time and blocking all further input.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/2872>
2022-08-12 14:13:16 +01:00
Edward Hervey 9551f909d7 qtdemux: Don't use invalid values from failed trex parsing
If parsing the fragment default values (`trex` atom) failed, don't try to
compute a bogus sample_description_id value.

Fixes #1369

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/2862>
2022-08-11 12:19:35 +01:00
Krystian Wojtas 7ef60aa0f9 docs: copy-paste fix
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/2861>
2022-08-11 12:09:09 +01:00
Sebastian Dröge 3aafef7955 gst: Protect initialization state with a recursive mutex.
Otherwise a gst_init() call from a plugin would deadlock if the plugin
is loaded as part of registry updating.

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

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/2858>
2022-08-10 16:05:51 +01:00
Sebastian Dröge d80589592d registry: Remove dead code
Initialization/updating of the registry can't possible fail and all code
paths always returned TRUE.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/2858>
2022-08-10 16:05:51 +01:00
Sebastian Dröge e192116c37 gst: Don't fail gst_init() if updating the registry fails
Everything is already marked as initialized at that point and by failing
no tracers would be loaded or plugin feature rank overrides would be
applied.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/2858>
2022-08-10 16:05:51 +01:00
Tim-Philipp Müller e7858b38f9 opusenc: improve inband-fec property documentation
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/2855>
2022-08-10 08:15:58 +01:00
Haihua Hu ea29b20556 alpha: fix stride issue when out buffer has padding on right
if outbuf has padding on right, need jump to next line use stride,
otherwise downstream element will show a wrong picture when use the
same stride

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/2854>
2022-08-09 23:26:37 +01:00
Tim-Philipp Müller 703f05b6f9 tracers: leaks: delay type name lookup
Micro optimisation: Store the quark of the type name when tracking
objects and only do the quark to string conversion (hashtable lookup)
later when we actually need the string.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/2846>
2022-08-05 23:37:24 +01:00
Corentin Damman 6212831f04 tracers: leaks: fix potentially invalid memory access when trying to detect object type
The is_gst_mini_object_check would sometimes detect a proper GObject
as a mini object, and then bad things happen.

We know whether a pointer is a proper GObject or a MiniObject here
though, so just pass that information to the right code paths and
avoid the heuristics altogether.

Eliminates all remaining uses of object_is_gst_mini_object().

Fixes #1334

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/2846>
2022-08-05 23:37:24 +01:00
Tim-Philipp Müller 5948da1a1f tracers: leaks: fix potentially invalid memory access when trying to detect object type
The is_gst_mini_object_check would sometimes detect a proper GObject
as a mini object, and then bad things happen.

We know whether a pointer is a proper GObject or a MiniObject here
though, so just pass that information to the right code paths and
avoid the heuristics altogether.

There are probably more cases where the check should be eliminated.

Fixes #1334, maybe

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/2846>
2022-08-05 23:37:23 +01:00
James Hilliard 1fff4ef635 decodebin3: fix EOS event sequence
See docs:
https://gstreamer.freedesktop.org/documentation/additional/design/seqnums.html?gi-language=c#seqnums-sequence-numbers

Per docs:
When a sink element receives an EOS event and creates a new EOS
message to post, it should copy the seqnum from the event to the
message because the EOS message is a consequence of the EOS event
being received.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/2837>
2022-08-03 19:44:04 +01:00
Edward Hervey afa0549c0c subparse: Handle GAP events before buffers
Make sure we did initial negotiation and segment pushing if we get GAP events
before buffers.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/2834>
2022-08-03 17:27:06 +01:00
Edward Hervey 7d0ca03998 tagdemux: Properly propagate sequence numbers
If we received a time segment from upstream, we need to make sure we propagate
it downstream with the same sequence number.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/2834>
2022-08-03 17:27:06 +01:00
Edward Hervey 80a8702de2 parsebin: Avoid crash with unknown streams
With the new addition of handling unknown sream types we *could* end up with a
chain which doesn't have a current_pad (it's an intermediary one)

Fixes #1287

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/2827>
2022-08-02 00:41:38 +01:00
Rafael Sobral 43b15a5b01 aggregator: fix reversed active/flushing arguments in debug log output
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/2826>
2022-08-01 23:53:25 +01:00
Nirbheek Chauhan bf95145b5a meson: Update ogg.wrap from wrapdb
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/2821>
2022-07-31 14:33:59 +01:00
Nirbheek Chauhan 0d49446f8c build: Fix some compiler warnings by upgrading wraps
03d9f144cb

2913e72d85

c945c99fba

There's one more pygobject warning that will be fixed with this:

https://gitlab.gnome.org/GNOME/pygobject/-/merge_requests/210

Also bump the image versions to regen them.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/2821>
2022-07-31 14:32:41 +01:00
Nirbheek Chauhan 4c576e1234 meson: Don't pass -Werror to vendored code
Do it the correct way with libusrsctp -- override the option so that
it's done in a compiler-agnostic and future-proof way.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/2818>
2022-07-30 16:08:33 +01:00
Nirbheek Chauhan d9d05bb97d rtsp+rtmp: Forward warning added to tls-validation-flags to our users
With the 2.72 release, glib-networking developers have decided that
TLS certificate validation cannot be implemented correctly by them, so
they've deprecated it.

In a nutshell: a cert can have several validation errors, but there
are no guarantees that the TLS backend will return all those errors,
and things are made even more complicated by the fact that the list of
errors might refer to certs that are added for backwards-compat and
won't actually be used by the TLS library.

Our best option is to ignore the deprecation and pass the warning onto
users so they can make an appropriate security decision regarding
this.

We can't deprecate the tls-validation-flags property because it is
very useful when connecting to RTSP cameras that will never get
updates to fix certificate errors.

Relevant upstream merge requests / issues:

https://gitlab.gnome.org/GNOME/glib/-/merge_requests/2214

https://gitlab.gnome.org/GNOME/glib-networking/-/issues/179

https://gitlab.gnome.org/GNOME/glib-networking/-/merge_requests/193

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/2818>
2022-07-30 16:06:05 +01:00
Nirbheek Chauhan a93b5f06f1 dtls: Disable OpenSSL 3.0 deprecation warnings for now
Fedora 36 ships with OpenSSL 3.0, which deprecates all low-level APIs,
so this code needs to be rewritten. There is no easy fix in the
porting guide, and it recommends disabling the warnings if you can't
use the high-level API.

https://wiki.openssl.org/index.php/OpenSSL_3.0#Upgrading_to_OpenSSL_3.0_from_OpenSSL_1.1.1

Here's the replacement API:

https://www.openssl.org/docs/man3.0/man7/migration_guide.html#Deprecated-low-level-object-creation

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/2818>
2022-07-30 16:05:55 +01:00
Nirbheek Chauhan ba06a8a79d harfbuzz.wrap: Fix wrap type, and remove unnecessary patch
Forgot to change the wrap type in e0014ef4fe which broke the
subproject. Wasn't noticed by CI because the subproject cache wasn't
regenerated.

The accompanied patch was included in 2.8.2, so it is not needed. It
was originally needed with 2.8.1

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/2808>
2022-07-30 13:10:19 +00:00
Tim-Philipp Müller 9dff3c5bf5 subprojects: fix pango wrap diff file location
Must match the version of the pango wrap.

Fixes ci windows docker image rebuild issue.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/2808>
2022-07-30 13:10:19 +00:00
Seungha Yang cdb757ca47 wasapi2: Fix initial mute/volume setting
Fix up volume/mute change flag setting

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/2817>
2022-07-30 12:24:19 +01:00
Matthew Waters 91d0a48eea rtspconnection: protect cancellable by a mutex
It is entirely possible for the cancellable to be cancelled (and freed)
in gst_rtsp_connection_flush() while there may be an ongoing read/write
operation.

Nothing prevents gst_rtsp_connection_flush() from waiting for the
outstanding read/writes.

This could lead to a crash like (where cancellable has been freed
within gst_rtsp_connection_flush()):

 #0  0x00007ffff4351096 in g_output_stream_writev (stream=stream@entry=0x7fff30002950, vectors=vectors@entry=0x7ffe2c6afa80, n_vectors=n_vectors@entry=3, bytes_written=bytes_written@entry=0x7ffe2c6af950,  cancellable=cancellable@entry=0x7fff300288a0, error=error@entry=0x7ffe2c6af958) at ../subprojects/glib/gio/goutputstream.c:377
 #1  0x00007ffff44b2c38 in writev_bytes (stream=0x7fff30002950, vectors=vectors@entry=0x7ffe2c6afa80, n_vectors=n_vectors@entry=3, bytes_written=bytes_written@entry=0x7ffe2c6afb90, block=block@entry=1, cancellable=0x7fff300288a0) at ../subprojects/gst-plugins-base/gst-libs/gst/rtsp/gstrtspconnection.c:1320
 #2  0x00007ffff44b583e in gst_rtsp_connection_send_messages_usec (conn=0x7fff30001370, messages=messages@entry=0x7ffe2c6afcc0, n_messages=n_messages@entry=1, timeout=timeout@entry=3000000) at ../subprojects/gst-plugins-base/gst-libs/gst/rtsp/gstrtspconnection.c:2056
 #3  0x00007ffff44d2669 in gst_rtsp_client_sink_connection_send_messages (sink=0x7fffac0192c0, timeout=3000000, n_messages=1, messages=0x7ffe2c6afcc0, conninfo=0x7fffac019610) at ../subprojects/gst-rtsp-server/gst/rtsp-sink/gstrtspclientsink.c:1929
 #4  gst_rtsp_client_sink_try_send (sink=sink@entry=0x7fffac0192c0, conninfo=conninfo@entry=0x7fffac019610, requests=requests@entry=0x7ffe2c6afcc0, n_requests=n_requests@entry=1, response=response@entry=0x0, code=code@entry=0x0) at ../subprojects/gst-rtsp-server/gst/rtsp-sink/gstrtspclientsink.c:2845
 #5  0x00007ffff44d3077 in do_send_data (buffer=0x7fff38075c60, channel=<optimized out>, context=0x7fffac042640) at ../subprojects/gst-rtsp-server/gst/rtsp-sink/gstrtspclientsink.c:3896
 #6  0x00007ffff4281cc6 in gst_rtsp_stream_transport_send_rtp (trans=trans@entry=0x7fff20061f80, buffer=<optimized out>) at ../subprojects/gst-rtsp-server/gst/rtsp-server/rtsp-stream-transport.c:632
 #7  0x00007ffff4278e9b in push_data (stream=0x7fff40019bf0, is_rtp=<optimized out>, buffer_list=0x0, buffer=<optimized out>, trans=0x7fff20061f80) at ../subprojects/gst-rtsp-server/gst/rtsp-server/rtsp-stream.c:2586
 #8  check_transport_backlog (stream=0x7fff40019bf0, trans=0x7fff20061f80) at ../subprojects/gst-rtsp-server/gst/rtsp-server/rtsp-stream.c:2645
 #9  0x00007ffff42793b3 in send_tcp_message (idx=<optimized out>, stream=0x7fff40019bf0) at ../subprojects/gst-rtsp-server/gst/rtsp-server/rtsp-stream.c:2741
 #10 send_func (stream=0x7fff40019bf0) at ../subprojects/gst-rtsp-server/gst/rtsp-server/rtsp-stream.c:2776
 #11 0x00007ffff7d59fad in g_thread_proxy (data=0x7fffbc062920) at ../subprojects/glib/glib/gthread.c:827
 #12 0x00007ffff7a8ce2d in start_thread () from /lib64/libc.so.6
 #13 0x00007ffff7b12620 in clone3 () from /lib64/libc.so.6

Fix by adding a cancellable lock and returning an extra reference used
across all read/write operations.  gst_rtsp_connection_flush() can free
the in-use cancellable and it will no longer affect any in progress
read/write.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/2816>
2022-07-30 11:33:26 +01:00
Adrian Fiergolski 3907c8d72f videoflip: Fix caps negotiation when method is selected
The caps negotiation should respect the selected method to the test pipeline below works properly.
gst-launch-1.0 videotestsrc ! video/x-raw,width=320,height=600 ! videoflip method=clockwise ! video/x-raw,width=600,height=320 ! fakesink

Signed-off-by: Adrian Fiergolski <adrian.fiergolski@fastree3d.com>
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/2815>
2022-07-30 00:04:46 +01:00
fduncanh 89853c556b v4l2object.c: add support for Apple's full-range bt709 colorspace variant
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/2806>
2022-07-28 12:46:54 +01:00
Elliot Chen 41b36b4c26 v4l2: fix the critical log when unreference the buffer with no data
In the trick mode, driver may queue a valid buffer follow by an
empty buffer which has no valid data to indicate EOS.For the empty
buffer whose memory is multi-plane, need to resize it before
unreference it.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/2794>
2022-07-25 17:30:51 +01:00
Jan Schmidt 66abd61be9 video: Fix scaling in 4x horizontal co-sited chroma
4x downscaling of chroma with co-sited chroma has never worked
it seems.

Fixes incorrect videotestsrc output and videoconvert conversions
to Y41B, YUV9, YVU9 and IYU9 with co-sited chroma.

e.g.
gst-launch-1.0 videotestsrc ! video/x-raw,format=Y41B,width=1280,height=720 ! \
  videoconvert ! autovideosink

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/2791>
2022-07-23 11:51:28 +01:00
Sebastian Dröge aaae84d44b audiobuffersplit: Actually store number of samples to drop in gapless mode
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/2783>
2022-07-22 09:56:30 +01:00
Sebastian Dröge 6d3af5c6cd audiobuffersplit: Use input running time for comparison instead of the currently tracked running time
Otherwise gapless mode would do completely wrong calculations on
discontinuities and cause input/output to drift slowly.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/2783>
2022-07-22 09:56:30 +01:00
Sebastian Dröge 09ab09e3f2 audiobuffersplit: Combine two if expressions to reduce indentation
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/2783>
2022-07-22 09:56:30 +01:00
Jordan Petridis f0cc913621 openmpt: update from now deprecated api
https://lib.openmpt.org/doc/classopenmpt_1_1module.html#ab2695af0baa274054f5687741fa7c05b

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/2779>
2022-07-21 10:01:17 +01:00
Ignazio Pillai aea9cb1b2b wasapi: Implement default audio channel mask
Some multichannel capture devices does not provide a channel mask value
which will result in a pipeline failure due to the empty channel mask.

Implemented the same fix used for wasapi2

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

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/2714>
2022-07-20 17:02:33 +00:00
Jan Alexander Steffens (heftig) 185c231871 gstinfo: Parse "NONE" as a valid level name
This allows using `NONE` in `GST_DEBUG`,
`gst_debug_set_threshold_from_string`, etc. It was accessible before,
but only via the integer `0`.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/2775>
2022-07-19 18:22:13 +02:00
Seungha Yang 4ec952af29 proxysink: Fix GstProxySrc leak
Clear weak pointer to peer src when disposing.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/2774>
2022-07-19 15:44:55 +02:00
Seungha Yang 5cf0b1eeac proxysink: Make sure stream-start and caps events are forwarded
There might be a sequence of event and buffer flow:
- Got stream-start/caps/segment events
- Got flush events
- And then buffers with a new segment event

In the above case, stream-start and caps event might not be reached to
peer proxysrc if peer proxysrc is not ready to receive them.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/2774>
2022-07-19 15:44:55 +02:00
Sebastian Dröge 4a8e37d22e aggregator: Reset EOS flag after receiving a stream-start event
And also don't assert that there are no buffers queued up when handling
an EOS event. The pad's streaming thread might've already received a new
stream-start event and queued up a buffer in the meantime.

This still leaves a race condition where the srcpad task sees all pads
in EOS state and finishes the stream, while shortly afterwards a pad
might receive a stream-start event again, but this doesn't seem to be
solveable with the current aggregator design.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/2772>
2022-07-19 01:03:48 +02:00
Sebastian Dröge 0e143a00dd qt: Fix another instance of Qt/GStreamer both defining GLsync differently
In file included from ../gstreamer1.0-plugins-good/1.20.3-r0/recipe-sysroot/usr/include/gstreamer-1.0/gst/gl/gstglfuncs.h:87,
                 from ../gst-plugins-good-1.20.3/ext/qt/qtglrenderer.cc:14:
../gstreamer1.0-plugins-good/1.20.3-r0/recipe-sysroot/usr/include/gstreamer-1.0/gst/gl/glprototypes/gstgl_compat.h:40:18: error: conflicting declaration 'typedef void* GLsync'
   40 | typedef gpointer GLsync;
      |                  ^~~~~~
In file included from ../gstreamer1.0-plugins-good/1.20.3-r0/recipe-sysroot/usr/include/QtGui/qopengl.h:127,
                 from ../gstreamer1.0-plugins-good/1.20.3-r0/recipe-sysroot/usr/include/QtQuick/qsggeometry.h:44,
                 from ../gstreamer1.0-plugins-good/1.20.3-r0/recipe-sysroot/usr/include/QtQuick/qsgnode.h:43,
                 from ../gstreamer1.0-plugins-good/1.20.3-r0/recipe-sysroot/usr/include/QtQuick/qsgrendererinterface.h:43,
                 from ../gstreamer1.0-plugins-good/1.20.3-r0/recipe-sysroot/usr/include/QtQuick/qquickwindow.h:44,
                 from ../gstreamer1.0-plugins-good/1.20.3-r0/recipe-sysroot/usr/include/QtQuick/QQuickWindow:1,
                 from ../gst-plugins-good-1.20.3/ext/qt/qtglrenderer.cc:6:
../gstreamer1.0-plugins-good/1.20.3-r0/recipe-sysroot/usr/include/QtGui/qopengles2ext.h:24:26: note: previous declaration as 'typedef struct __GLsync* GLsync'
   24 | typedef struct __GLsync *GLsync;
      |                          ^~~~~~

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/2771>
2022-07-19 00:06:45 +02:00
Nirbheek Chauhan d0ed9fdab5 osxaudio: Fix deprecation in macOS 12.0
kAudioObjectPropertyElementMaster has been renamed to
kAudioObjectPropertyElementMain

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/2764>
2022-07-16 10:54:26 +02:00
Nirbheek Chauhan 87a4391698 meson: Fix compile failures on macOS in harfbuzz and pango
These patches are taken from upstream, and they fix compile failures
with latest clang. These can be dropped when upgrading these wraps.

This is currently causing a warning because we do not require the
version of meson that ships with this feature: 0.63.0. The version has
not been bumped because older Meson versions gracefully ignore the
wrap field, this fix is optional and only needed on macOS, and 0.63.0
is a very new release with a bug that partially breaks this feature:

https://github.com/mesonbuild/meson/pull/10602

We can consider bumping the requirement once 0.63.1 is released.

Also switch from git to tarballs, no reason to use git here anymore.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/2764>
2022-07-16 10:54:14 +02:00
Nirbheek Chauhan ea4a5942d9 meson: Fix warning about check kwarg
This place was missed when we fixed this everywhere else.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/2764>
2022-07-16 10:53:54 +02:00
Matthew Waters cb73ad2b6f glimagesink: only allow setting the GL display/context if it is a valid value
Otherwise, when setting the external application context, then the
display may be cleared and then not used and the asharing mechanism does
not work anymore.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/2757>
2022-07-13 14:14:51 +02:00