Commit graph

1043 commits

Author SHA1 Message Date
Thibault Saunier 049859c2cb 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/5435>
2023-10-05 20:55:00 +00:00
Nicolas Dufresne fc4bb5585f doc: Update plugin cache for added DMA_DRM format
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/5386>
2023-10-03 21:13:00 +00:00
Nicolas Dufresne aaed9272c1 video-filters: Fix passthrough with ANY caps feature
With the support for DRM modifiers, passthrough caps must now include DMA_DRM
format, otherwise pipeline using thhese filters unconditionally may fail
to negotiate.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/5386>
2023-10-03 21:13:00 +00:00
Sebastian Dröge 8af9cd9b1a docs: Update plugins caches
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/5412>
2023-10-02 09:39:21 +03:00
Sebastian Dröge abdd1967ad flacenc: Correctly handle up to 255 cue entries
The counter was using a signed 8 bit integer, which was overflowing
after 127 entries. That was then passed as an unsigned 32 bit integer to
libflac, which caused it to be converted to a huge unsigned number.
That then caused an invalid memory access inside libflac.

As a bonus, signed integer overflow is undefined behaviour.

Instead, use an unsigned 8 bit integer. Once this overflows the existing
code already catches it and stops adding the cue. While FLAC__metadata_object_cuesheet_insert_track()
takes an unsigned 32 bit integer for the track number, FLAC__StreamMetadata_CueSheet_Track is
limiting it to an unsigned 8 bit integer.

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

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/5420>
2023-09-30 15:46:52 +00:00
Dominique Leroux 7affa01e05 osxaudio: add individual elements registration for gst-full compatibility
Found that osxaudiosink could not be added standalone in gst-full build
using
-Dgst-full-elements=osxaudio:osxaudiosink because element registration
was
done at the plugin level. Now src/sink elements and deviceprovider have
their
individual registration.

Copied/adapted from the alsa plugin.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/5419>
2023-09-28 21:44:48 +00:00
Stéphane Cerveau 80cc1fcc03 mpdhelper: remove useless code
The audio/video codec name from mime type should be retrieved from
gst_codec_utils_caps_get_mime_codec instead

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/5404>
2023-09-28 18:31:07 +00:00
Xavier Claessens 0ab48250a9 GstCustomMeta: Use simplified API where possible
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/5385>
2023-09-27 18:46:34 +00:00
Florian Zwoch 4a9a9ed9fc adaptivedemux2: Call GTasks's return functions for blocking tasks
Gio/Task states the following:

If a GTask has been constructed and its callback set, it is an error to
not call g_task_return_*() on it. GLib will warn at runtime if this
happens (since 2.76).

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/5395>
2023-09-27 15:56:08 +00:00
Albert Sjölund 47dbdea469 souphttpsrc: Chain finalize call to parent
GstSoupSession finalize does not chain parent finalize,
causing it to leak memory, shown under g freeze notify.
In finalize method, ensure all branches call to parent
finalize.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/5398>
2023-09-27 09:01:43 +02:00
Daniel Moberg 0e6cd64232 rtspsrc: Property for adding custom http request headers
This commit adds a property which enables adding custom http request headers to
the rtspsrc element. Added headers will be appended to http requests
made during http tunneling.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/5268>
2023-09-26 06:35:43 +00:00
Stijn Last 4bda59f88d deinterlace: greedy, improve quality
scanlines->m1 = same line of the previous field
scanlines->t0 = line above of the current field
scanlines->b0 = line below of the current field
scanlines->mp = same line of the next field

Deinterlacing a field weaved frame:
When deinterlacing the top field, the next bottom field is available
(part of the same frame). but when deinterlacing the bottom field,
the next top field (part of the next frame) is not available and
scanlines->mp equals NULL.

In this case it's better to use greedy algorithm using the prevous field
(twice) rather then linear interpolation of the current field.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/5331>
2023-09-25 06:40:47 +00:00
Hou Qi be9d9371b7 v4l2videodec: Correctly free caps to avoid memory leak
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/5379>
2023-09-24 12:50:01 +00:00
Seungha Yang 69d1679914 video: Add GBR 16bits formats
Adding 16bits planar RGB formats

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/5375>
2023-09-23 13:12:55 +00:00
Sebastian Dröge 2a2ef23829 rtpsource: Don't store invalid running times and calculate with it
If we end up with GST_CLOCK_TIME_NONE as running time for an RTP packet
then this can't be used for bitrate estimation, and also not for
constructing the next RTCP SR. Both would end up with completely wrong
values, and an RTCP SR with wrong values can easily break
synchronization in receivers.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/5329>
2023-09-23 07:39:00 +00:00
Piotr Brzeziński f3d98341e3 qml: Fix leftover reference to gstqsgtexture
Made it impossible to build with qmake as per the readme. The file was renamed to gstqsgmaterial a while ago.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/5357>
2023-09-19 23:55:45 +00:00
Olivier Blin 4b891639da pulsedeviceprovider: fix incorrect usage of GST_ELEMENT_ERROR
The provider is not a GStreamer element.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/5349>
2023-09-19 14:13:49 +02:00
Sebastian Dröge fcd591c1af rtpjitterbuffer: Avoid integer overflow in max saveable packets calculation with negative offset
The timestamp offset can be negative, and it can be a bigger negative
number than the latency introduced by the rtpjitterbuffer so the overall
timeout offset can be negative.

Using the negative offset for calculating how many packets can still
arrive in time when encountering a lost packet in an equidistant stream
would then overflow and instead of considering fewer packets lost a lot
more packets are considered lost.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/5296>
2023-09-12 08:38:53 +00:00
Nicolas Dufresne c1e03081c0 v4l2: object: Handle video helper return value
gst_video_info_set_interlaced_format() can return an error if the
width/height causes integer overflow. Handle this case, so that we can
fail cleanly. This has been experienced while testing an in-progress
driver.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/5286>
2023-09-11 15:05:34 -04:00
Nicolas Dufresne 353cb2da92 v4l2: bufferpool: Avoid warnings on empty last buffer
Some drivers will push an buffer flagged LAST but empty. In decoder
case, this results in an "producing too many buffer" warning, even
though the result is entirely correct. Detect this case in order to
signal EOS earlier and avoid this warning.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/5286>
2023-09-11 18:08:21 +00:00
Nicolas Dufresne 65350b601e v4l2: bufferpool: Do not resize compressed buffer
Avoid resizing compressed buffer to their maximum size. This fixes a
regression that caused valid but very large streams to be generated.

Fixes #2953

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/5286>
2023-09-11 18:08:21 +00:00
Nicolas Dufresne c7e6463e9e doc: Update cache after template pixel formats changes
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/5304>
2023-09-10 19:13:28 -04:00
Matthew Waters 9e6891076c qml6glmixer: add support for non-RGBA inputs
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/5290>
2023-09-07 02:12:29 +00:00
Matthew Waters ba00a7efda qml6glovleray: add support for non-RGBA inputs
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/5290>
2023-09-07 02:12:29 +00:00
Matthew Waters 6efccf0ee1 qml6/sink: add support for non-RGBA input
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/5290>
2023-09-07 02:12:29 +00:00
Sebastian Dröge d50c842d87 video: Fix ordering of video formats in GST_VIDEO_FORMATS_ALL_STR
This now follows the algorithm again that is described in the
documentation and implemented in gstreamer-rs.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/5243>
2023-08-25 15:27:02 +00:00
Matthew Waters faf404a938 video: add support for A420/A422/A444 16-bit formats
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/5233>
2023-08-24 12:03:39 +10:00
Matthew Waters 202309fa2c video: add support for 12-bit A420/A422/A444
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/5226>
2023-08-24 00:56:43 +00:00
Matthew Waters 9a56945173 video: add support for 8-bit A422/A444
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/5213>
2023-08-23 01:00:24 +00:00
Nicolas Dufresne 1e7ff1ac45 gstv4l2object: fix TODO comment about HDR configure
add following todo list
- Missing capture (v4l2src) HDR10 configuration and/or reporting
- The API is not capable of HDR to HDR conversion as controls are
      not specific to queues

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/4403>
2023-08-22 21:20:11 +00:00
HuQian fc7b776387 gstv4l2object: passing HDR10 information
when playing some codec such as matroska with vp9 codec,
demuxer will save information like video_mastering_display_info
and video_content_light_level in caps that decoder need,
v4l2videodecoder can use it by calling V4L2_CTRL_CLASS_COLORIMETRY
ioctl.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/4403>
2023-08-22 21:20:11 +00:00
Ming Qian fd720fbf64 v4l2object: clear format lists if source change event is received
If decoder notify a source change event when the capture format is
changed, not the resolution changed.

then gst_v4l2_object_acquire_format will retuen false due to
unsupported format.

we need to clear the format lists in the source change flow,
and reenumerate format list

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/5218>
2023-08-22 19:26:22 +00:00
Jonas K Danielsson 749652e60c rtp: Add rtppassthroughpay element
This elements pass RTP packets along unchanged and appear as a RTP
payloader element.

This is useful, for example when using the gstreamer-rtsp-server
library, in the case where you are receiving RTP packets from a
different source and want to serve them over RTSP. Since the
gst-rtsp-server library expect the element marked as payX to be a RTP
payloader element and assumes certain properties are available.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/5204>
2023-08-22 14:01:09 +00:00
Nicolas Dufresne 54ae2fcf77 v4l2: allocator: Don't close foreign dmabuf
Imported dmabuf are not being duped, so they should never be closed. Instead,
we ensure their live time by having strong reference on their original
buffer. This should fix potential flickering due to dmabuf being closed
too early.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/5101>
2023-08-21 20:45:14 +00:00
Nicolas Dufresne 8974318003 v4l2: bufferpool: Fix hang when splitting buffer
Now that we can split GStreamer buffers over multiple v4l2 buffer, we may
endup waiting for these buffers to be processed. Avoid waiting for any of
the parts being processed. As a side effect, the pool will now try to
grow if the number of buffers is not sufficient, and will fail
otherwise.

This fixes a hang if the very first frame did not fit. In this case, the
driver will retrain that buffer until the capture is setup, but
GStreamer won't setup the capture until process() function have
returned.

Fixes https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/5100

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/5143>
2023-08-21 20:01:39 +00:00
Guillaume Desmottes bc06c2109c flvmux: add 'enforce-increasing-timestamps' property
The hack enforcing strictly increasing timestamps was, according to the
code comments, because librtmp was confused with backwards timestamps.

rtmp2sink is not using librtmp as rtmpsink did, so this is no longer
required.
Also changing the timestamps is causing audio glitches when streaming to
Youtube.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/5212>
2023-08-21 14:26:06 +02:00
Jan Alexander Steffens (heftig) 314ffa3fb5 qt: Unbreak build with qt-egl enabled but viv_fb missing
Avoids an error message when the feature is explicitly enabled:

    ERROR: Feature qt-egl cannot be enabled: gstreamer-gl-viv_fb-1.0 is required

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/5083>
2023-08-16 06:10:13 +00:00
Sebastian Dröge 09045da073 rtpgstpay: Enable hdrext aggregation
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/4979>
2023-08-15 07:12:03 +02:00
Jochen Henneberg a97d3acb90 rtp/vp8depay+vp9depay: Enable hdrext aggregation for VP8 and VP9
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/4979>
2023-08-15 07:12:03 +02:00
Jochen Henneberg 2673a66e60 rtp/h264depay+h265depay: Enable hdrext aggregation for H264 and H265
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/4979>
2023-08-15 07:12:03 +02:00
Vivia Nikolaidou 3257ee4374 deinterlace: Fix vfir 16-bit orc calculations
memcpy works in bytes, but orc works in items, so given that the size
arguments is in bytes, we need to divide by the pixel stride.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/5172>
2023-08-11 17:47:27 +00:00
Vivia Nikolaidou 6145a5c7cb deinterlace: Fix greedyh crash for alternate-field interlacing
Fixes https://gitlab.freedesktop.org/gstreamer/gstreamer/-/issues/2645

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/5172>
2023-08-11 17:47:27 +00:00
Stéphane Cerveau 1e4cc59a3f isomp4: update isml documentation
Closing #2893

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/5165>
2023-08-09 09:15:30 +00:00
L. E. Segovia 171eefa06b subprojects: Add libvpx wrap
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/5105>
2023-08-08 18:08:24 +00:00
Nicolas Dufresne d604b3655e video: Add Mediatek 10bit formats
These 10bit formats are identical to NV12_16L32S, but 64bytes of data is being
prefixed with 16bytes data with four pixels of lower 2bits per byte. For
MT2110T, the lower two bits set so each bytes contains a column of 4 pixels,
also describe as tiled lower 2 bits. MT2110T has been chosen as a name to match
the vendor chosen name. This format is unlikely to exist for other vendors.

For MT2110R, the 2 low bits are in raster order.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/3444>
2023-08-08 16:08:16 +00:00
Jan Schmidt 461f943b52 osxaudio: Interpolate clock by counting elapsed time since render calls
When advancing the ringbuffer, store the processed CoreAudio sample
time, then interpolate the clock in the _get_delay() calls to smooth
the clock. CoreAudio's "latency" report is always a constant and
otherwise leads to the clock generating a latency-time staircase.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/5140>
2023-08-07 21:33:45 +00:00
Jan Schmidt e22c7fb3e4 osxaudio: Share debug category in the internal coreaudio object
Make the internal coreaudio object output debug to the same
debug category by making it shared between code units.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/5140>
2023-08-07 21:33:45 +00:00
Jan Schmidt f5d2ea76b4 osxaudio: Attempt to configure the segment size in CoreAudio
Set the BufferFrame size in CoreAudio so it will deliver data
in ringbuffer segment units when recording. Otherwise, CoreAudio
will provide data in whatever granularity it wants, with no
relationship to the requested latency-time.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/5140>
2023-08-07 21:33:45 +00:00
Jan Schmidt 2df9283d3f osxaudiosrc: Set sample timestamps
Set the timestamp on output buffers based on the incoming sample
times from Core Audio

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/5140>
2023-08-07 21:33:45 +00:00
Tim-Philipp Müller b575f6c683 soup: use GST_PARAM_DOC_SHOW_DEFAULT for libsoup2-specific properties
Otherwise the value in the gst_plugins_cache.json will vary depending
on the libsoup version picked up at runtime.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/5090>
2023-08-07 10:41:16 +00:00
Tim-Philipp Müller be2a3780c1 flvmux: use version template in metadata creator properties
Avoids documentation churn when the version changes.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/5090>
2023-08-07 10:41:16 +00:00
Tim-Philipp Müller e1d4b546c0 souphttpsrc: use version template in user-agent property
Avoids documentation churn when the version changes.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/5090>
2023-08-07 10:41:16 +00:00
Tim-Philipp Müller 8d73b65789 shout2send: use version template in user-agent property
Avoids documentation churn when the version changes.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/5090>
2023-08-07 10:41:16 +00:00
Tim-Philipp Müller 5bbd8c2d71 rtspsrc: use version template in user-agent property
Avoids documentation churn when the version changes.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/5090>
2023-08-07 10:41:16 +00:00
Wang Chuan e89a64cd1f gstadaptivedemux: fix memory leak
GstQuery leaks when using invalid url

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/5154>
2023-08-07 14:18:21 +08:00
Nirbheek Chauhan 14503a7d08 qmlgl: Can't use frame info if we don't have a frame
Fixes segfault accessing vinfo in: GST_VIDEO_FRAME_N_PLANES (&this->v_frame)

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/5148>
2023-08-04 15:34:38 +00:00
Nirbheek Chauhan 223a0e3b27 meson: Fix searching of qt5/qt6 tools with qmake
If the pkg-config files are broken, we want to ensure that qmake is
used. This can easily happen on macOS with the official Qt binaries.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/5147>
2023-08-04 14:52:10 +00:00
Matthew Waters 8a7614e814 qml: handle multiple items with different input formats
Issue was that Qt was caching multiple different shadersbased on a static
variable location.  This static variable location was the same no matter
the input video format and so if an item had an input video format of
RGB and another of RGBA, they would eventually end up using the same
GL shader leading to incorrect colours.

Fix by providing different static variable locations for each of the
different shaders that will be produced.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/5145>
2023-08-04 13:22:59 +00:00
Charlie Blevins 05cffc19dd rtpjitterbuffer: Allow earlier reference-timestamp-meta
Allow reference-timestamp-meta to be added earlier if an RTCP sender
report is sent before the first RTP packet.

Fixes #2843

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/5084>
2023-08-03 17:26:42 +00:00
Matthew Waters ea2a44cb97 qml/gl: fix array definition
Some implementations require the [N] to suffixed to the variable name.

Error message example: 'syntax error: Array size must appear after
variable name'

Follow up with https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/5123
of https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/5119

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/5137>
2023-08-02 21:17:26 +10:00
Nicolas Dufresne 76fbc79494 v4l2: bufferpool: Keep processing bitstream buffer
Bitstream buffers may no fit a single v4l2 buffer, following spec
recommendation, keep processing the buffer until all the data has been
queued.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/5100>
2023-08-01 11:02:12 +00:00
Nicolas Dufresne de5e1e334e v4l2: bufferpool: Fix buffer resize asserstion
When we fill a bitstream buffer the buffer might be too small to hold
the entire frame. Only resize to the filled size, preventing the
following assertion to happen.

  gst_buffer_resize_range: assertion 'bufmax >= bufoffs + offset + size' failed

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/5100>
2023-08-01 11:02:12 +00:00
Matthew Waters 65fc381403 qml: add support for non-RGBA formats as input format
Currently supported are RGBA, BGRA and YV12

Output is still RGBA textures

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/5119>
2023-08-01 01:36:40 +00:00
Edward Hervey 176b884ec7 adaptivedemux2: Remove API lock
The various fields this was protecting were for the legacy design.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/5113>
2023-07-28 12:27:09 +00:00
Alicia Boya García 5fd3c8a16c qtdemux: Fix premature EOS when some files are played in push mode
Fixes https://gitlab.freedesktop.org/gstreamer/gstreamer/-/issues/2771

This EOS branch exists so that if a seek with a stop is made, qtdemux
stops accepting bytes from the sink after the entire requested playback
range is demuxed, as otherwise we could keep download content that is
not being used.

This patch fixes two flaws that were present in that EOS check:

1) A comparison was made between track time and movie time without conversion.
This made the check trigger early in files with edit lists. This patch fixes
this by converting the track PTS to movie PTS (stream time) for the check.

2) To avoid sending a EOS prematurely when the segment stop is within a GOP and
B-frames are present, the check for EOS should only be done for keyframes. I
gather this was already the intention with the existing code, but because it
used `stream->on_keyframe` instead of the local variable `keyframe` the old
code was checking if the *previous* frame was a keyframe.

It's interesting to note that these two flaws in the old code mask each other
in most cases: the track PTS will have reached the movie end PTS, but EOS would
only be sent if the previous frame was a keyframe. A simple case where they
wouldn't mask each other, reproducing the bug, is a sequence of 3 frame GOPs
with structure I-B-P.

The following validateflow tests have been added to future-proof the
fix:

 * validate.test.mp4.qtdemux_ibpibp_non_frag_pull.default
 * validate.test.mp4.qtdemux_ibpibp_non_frag_push.default

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/5021>
2023-07-26 19:14:43 +00:00
Guillaume Desmottes 6b339b5d39 videoflip: fix concurrent access when modifying the tag list
We were checking if the tag list is writable, but it may actually be
shared through the same event (tee upstream or multiple consumers).

Fix a bug where multiple branches have a videoflip element checking the
taglist. The first one was changing the orientation back to rotate-0
which was resetting the other instances.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/5097>
2023-07-25 15:18:05 +02:00
Xabier Rodriguez Calvar 5114fb4170 qtdemux: attach cbcs crypt info at the right moment
Before it was always added but that can cause issues when the stream begins
unencrypted.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/5085>
2023-07-25 10:06:48 +00:00
Bastien Nocera 913f6013a8 gtk: Fix critical caused by pointer movement when stream is getting ready
This check fixes a critical warning that can happen when a pointer motion
happens and the video doesn't have its width/height information available.

GStreamer-Video-CRITICAL **: gst_video_center_rect: assertion 'src->h != 0' failed

 #0  g_logv (log_domain=0x7ffff705e176 "GStreamer-Video", log_level=G_LOG_LEVEL_CRITICAL, format=<optimized out>, args=<optimized out>) at ../../../../Projects/jhbuild/glib/glib/gmessages.c:1422
 #1  0x00007ffff7e1a81d in g_log (log_domain=<optimized out>, log_level=log_level@entry=G_LOG_LEVEL_CRITICAL, format=format@entry=0x7ffff7e77a9d "%s: assertion '%s' failed") at ../../../../Projects/jhbuild/glib/glib/gmessages.c:1460
 #2  0x00007ffff7e1b749 in g_return_if_fail_warning (log_domain=<optimized out>, pretty_function=<optimized out>, expression=<optimized out>) at ../../../../Projects/jhbuild/glib/glib/gmessages.c:2930
 #3  0x00007ffff701d90b in gst_video_sink_center_rect (src=..., dst=..., result=result@entry=0x7fffffffc6d0, scaling=scaling@entry=1) at ../../../../Projects/jhbuild/gstreamer/subprojects/gst-plugins-base/gst-libs/gst/video/gstvideosink.c:105
 #4  0x00007fffe5652dbb in _fit_stream_to_allocated_size (result=0x7fffffffc6d0, allocation=0x7fffffffc6c0, base_widget=0x9396f0) at ../../../../Projects/jhbuild/gstreamer/subprojects/gst-plugins-good/ext/gtk/gtkgstbasewidget.c:326
 #5  gtk_gst_base_widget_display_size_to_stream_size (base_widget=base_widget@entry=0x9396f0, x=1207.7109375, y=811.84765625, stream_x=stream_x@entry=0x7fffffffc720, stream_y=stream_y@entry=0x7fffffffc728) at ../../../../Projects/jhbuild/gstreamer/subprojects/gst-plugins-good/ext/gtk/gtkgstbasewidget.c:344
 #6  0x00007fffe5651a4b in gst_gtk_base_sink_navigation_send_event (navigation=0x5ff990, event=0x178a730) at ../../../../Projects/jhbuild/gstreamer/subprojects/gst-plugins-good/ext/gtk/gstgtkbasesink.c:340
 #7  0x00007fffe5652432 in gtk_gst_base_widget_motion_event (widget=<optimized out>, event=event@entry=0x1f14b60) at ../../../../Projects/jhbuild/gstreamer/subprojects/gst-plugins-good/ext/gtk/gtkgstbasewidget.c:404

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/5049>
2023-07-17 14:53:43 -04:00
Olivier Crête 48c43e5b7f gst-omx: Retire the whole package
The OpenMAX standard is long dead and even the Raspberry Pi OS
no longer supports it.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/4976>
2023-07-16 19:10:03 +00:00
Nirbheek Chauhan 62d3e8fc32 meson: Ensure that soup plugin is built on Windows
The libpsl subproject wasn't building successfully and CI didn't
notice because:

1. The plugin wasn't explicitly enabled
2. Even when the plugin is explicitly enabled, the dep is not required
   at build time when not building a static plugin

So fix all of these issues.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/5038>
2023-07-15 05:06:35 +00:00
Michael Tretter a92a64ae67 v4l2videoenc: remove empty sink_query
The sink_query() function simply calls the sink_query() function of the parent
videoencoder class. Remove the override to simply directly call the parent's
function.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/5034>
2023-07-13 16:25:06 +00:00
Michael Tretter a28b81fb4f v4l2videoenc: replace custom QUERY_CAPS handling with getcaps callback
The videoencoder base class uses getcaps() to ask a subclass for the caps in its
sink_query_default() implementation.

Replace the custom handling of the QUERY_CAPS in the v4l2videoenc with an
implementation of getcaps() that returns the caps that are supported by the
v4l2videoenc to return these caps in the query.

This getcaps() implementation also calls the provided proxy_getcaps(), which
sends a caps query to downstream. This fixes the v4l2videoenc element to respect
limits of downstream elements in a sink query.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/5034>
2023-07-13 16:25:06 +00:00
Nirbheek Chauhan 8e1b6accbd meson: Always use forward slashes in defines with paths
Fixes the following build failure on MSYS2:

```
../subprojects/gstreamer/tests/check/elements/filesrc.c: In function 'test_seeking':
../subprojects/gstreamer/tests/check/elements/filesrc.c:107:53: error: incomplete universal character name \U
  107 |   g_object_set (G_OBJECT (src), "location", TESTFILE, NULL);
      |                                                     ^
../subprojects/gstreamer/tests/check/elements/filesrc.c:107:53: warning: unknown escape sequence: '\A'
../subprojects/gstreamer/tests/check/elements/filesrc.c:107:53: warning: unknown escape sequence: '\g'
../subprojects/gstreamer/tests/check/elements/filesrc.c:107:53: warning: unknown escape sequence: '\s'
../subprojects/gstreamer/tests/check/elements/filesrc.c:107:53: warning: unknown escape sequence: '\g'
../subprojects/gstreamer/tests/check/elements/filesrc.c:107:53: warning: unknown escape sequence: '\c'
```

Due to: `-DTESTFILE=\"C:\\Users\\Administrator\[...]`

https://gitlab.freedesktop.org/nirbheek/gstreamer/-/jobs/45317733

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/5018>
2023-07-12 21:17:25 +00:00
Michael Tretter 5de27e0620 v4l2videoenc: always allocate CAPTURE buffer from our pool
The videoencoder base class always uses the negotiated allocator for allocating
coded buffers and ignores the negotiated buffer pool. Therefore, the
v4l2videoenc always has to copy buffers from the pool into the allocated
output buffers.

This breaks downstream elements that want to import the CAPTURE buffers of the
v4l2videoenc, since the v4l2videoenc copies the exported CAPTURE buffers and
sends the copies downstream.

Always use the CAPTURE buffer pool for acquiring CAPTURE buffers instead of
allocating the buffers in the base class.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/4230>
2023-07-12 16:15:06 +00:00
Carlos Rafael Giani da3b51c0c4 gl: Take into account viv-fb vs. viv_fb naming in meson scripts
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/5020>
2023-07-12 21:35:57 +10:00
Matthew Waters a2d9584b27 gl: provide a pkg-config/gir file for the viv-fb backend
Required to be able to generate coherent bindings for window system
specific APIs due to limitations in gobject-introspection.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/5020>
2023-07-12 21:35:55 +10:00
Seungha Yang 521ba8f65a qt6: Set sampler filtering method
QQuickItem::smooth property doesn't seem to be propagated to
newly created QSGSimpleTextureNode automatically.

Fixes: https://gitlab.freedesktop.org/gstreamer/gstreamer/-/issues/2793
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/5004>
2023-07-11 12:14:17 +00:00
David Craven c79d16ae80 matroska: demux: Strip signal byte from encrypted blocks
Removes the signal byte when the frame is unencrypted to
be consistent with when the frame is encrypted.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/4997>
2023-07-11 10:26:36 +00:00
Nicolas Dufresne bc294bd89d v4l2: videodec: Don't wait for src_ch if active
If the capture pool is already active, like when handling gaps at the
start of a stream, do not setup the decoder to wait for src_ch event.
Otherwise the decoder will endup waiting for that at the wrong moment
and exit the decoding thread unexpectedly.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/4590>
2023-07-07 16:23:48 -04:00
Nicolas Dufresne c293ebc039 v4l2: videodec: Move pool setup inside negotiate()
Move all the pool configuration inside the negotiate() virtual function.
This allow settting up a pool with default format whenever the base
class wants to start without input data, like gaps.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/4590>
2023-07-07 16:23:48 -04:00
Hou Qi 8230c927f0 v4l2videodec: correctly register v4l2mpeg2dec
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/4977>
2023-07-07 13:49:27 +00:00
Guillaume Desmottes 7b31c89f25 videoflip: fix critical when tag list is not writable
Fix this pipeline where the tag list is not writable:

gst-launch-1.0 videotestsrc ! taginject tags="image-orientation=rotate-90" ! videoflip video-direction=auto \
  ! autovideosink

GStreamer-CRITICAL **: 12:34:36.310: gst_tag_list_add: assertion 'gst_tag_list_is_writable (list)' failed

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/4987>
2023-07-07 11:17:43 +00:00
Michael Olbrich c6a7c88fd9 v4l2src: handle resolution change when buffers are copied
When buffers are copied then GST_V4L2_FLOW_RESOLUTION_CHANGE is returned by
gst_v4l2_buffer_pool_process() so do renegotiation here as well.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/4980>
2023-07-06 14:59:22 +02:00
Sebastian Dröge e63548906c video: Move NV12_10LE40_4L4 before the BE variant on LE platforms
This keeps the sorting rules for the format list intact.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/4974>
2023-07-06 00:11:45 +01:00
Philipp Zabel 32dfa102b3 qtglrenderer.cc: Add missing QCoreApplication and QEventLoop includes
This fixes a build error if Qt was build without accessibility support:

../../../../../gstreamer/subprojects/gst-plugins-good/ext/qt/qtglrenderer.cc:
    In member function 'bool GstQuickRenderer::init(GstGLContext*, GError**)':
../../../../../gstreamer/subprojects/gst-plugins-good/ext/qt/qtglrenderer.cc:341:13:
    error: 'QCoreApplication' was not declared in this scope; did you mean 'QApplication'?
../../../../../gstreamer/subprojects/gst-plugins-good/ext/qt/qtglrenderer.cc:341:31:
    error: 'app' was not declared in this scope
../../../../../gstreamer/subprojects/gst-plugins-good/ext/qt/qtglrenderer.cc:341:37:
    error: 'QCoreApplication' is not a class, namespace, or enumeration
[...]
../../../../../gstreamer/subprojects/gst-plugins-good/ext/qt/qtglrenderer.cc:458:5:
    error: 'QEventLoop' was not declared in this scope; did you mean 'QEvent'?
../../../../../gstreamer/subprojects/gst-plugins-good/ext/qt/qtglrenderer.cc:459:9:
    error: 'loop' was not declared in this scope

If accessibility is enabled, the includes for QCoreApplication and QEventLoop
are indirectly pulled via QWidget.

Add the required headers as documented in [1] and [2].

[1] https://doc.qt.io/qt-5/qcoreapplication.html
[2] https://doc.qt.io/qt-5/qeventloop.html

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/4815>
2023-07-05 17:52:09 +00:00
Jordan Petridis 1ef13dda12 pngenc: Allocate a single GstMemory per frame
Previously, we would create a new GstMemory per write operation
and then append them to the GstBuffer. This would cause a reallocation
every 16 Memories which is an issue since the png encoder will usually
do write in a pattern of 4, 8 and 8k bytes repeating until the frame
is done.

Instead allocate a single GstMemory and keep writting it into it
with a manual index. Much like the jpegenc does.

Doing some basic testing With a testsrc snow pattern at 4k and 8k
the same pipeline would take ~3.30s to encode a 4k frame and ~23s
for an 8k. At 4k 0.70s/33% is taken by memory allocations, while at
8k its ~10.5s/45%.

With this patch, at 4k the pipeline takes ~2.40s and at 8k only 9.60s
making this 28% and 58% faster accordingly on my laptop, and
allocation runtime is dropped to subsecond times.

Here's the test pipeline used, increase num-buffers in image freeze
to gather more samples.

```
gst-launch-1.0 videotestsrc num-buffers=1 pattern=snow ! imagefreeze num-buffers=1 ! \
  video/x-raw,width=7680,height=4320 ! pngenc ! fakesink
```

Close #2717

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/4944>
2023-07-05 08:41:14 +00:00
Seungha Yang 794cde703c rtspsrc: Fix crash when is-live=false
The pad's parent (i.e., rtspsrc) can be nullptr since we add pads
later.

Co-authored-by: Jan Schmidt <jan@centricular.com>

Fixes: https://gitlab.freedesktop.org/gstreamer/gstreamer/-/issues/2751
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/4965>
2023-07-05 06:48:37 +00:00
Edward Hervey 711198a1a9 hlsdemux2: Ensure processed webvtt ends with empty new line
Parsers downstream will use empty new lines to detect where an entry
ends. Failure to have a newline would cause the entry to be either
discarded or (wrongly) concatenated with the next entry

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

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/4963>
2023-07-04 10:57:01 +02:00
Arnaud Rebillout 56e636b60c examples: gtk: Add example to illustrate usage of accept-certificate with souphttpsrc
The aim of this example is to show how to make use of the accept-certificate
signal from a GTK GUI, and prompt user in case of invalid certificate.

There are two subtleties to be aware of:

1. the signal is emitted from the GStreamer streaming thread, therefore the
   caller can't modify the GUI straight away, instead they must do it from the
   main thread (eg. by using g_idle_add())

2. in case of a redirection, then a TLS failure, the caller won't know
   about the redirection. Actually, it's possible to be notified of the
   redirection by watching "message:element" and inspecting http-headers,
   but even in that case, the signal will be received *after* the signal
   "accept-certificate" (even though the redirection happened *before*).

This second point is tricky. It's not uncommon to have servers that redirect
http requests to https. So errors of the type "HTTP -> HTTPS -> TLS error"
happen, and if the caller doesn't care about redirection, they might prompt
users with a message such as "TLS error for URL http://...", which wouldn't make
much sense.

This example shows how to handle that right, by connecting to the signal
"message:element", inspecting the http-headers, and in case of redirection,
updating the TLS error dialog to indicate that the request was redirected.

Here are a few examples of streams that exhibit TLS failure (at the time of
this commit, of course):
* https://radiolive.sanjavier.es:8443/stream: unknown-ca
* https://am981.ddns.net:9005/stream.ogg: unknown-ca
* http://stream.diazol.hu:7092/zene.mp3: redir then bad-identity
* https://streaming.fabrik.fm/izwi/echocast/audio/index.m3u8: unknown-ca
  (this one is a HLS stream)

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/4925>
2023-06-29 16:27:31 +00:00
Arnaud Rebillout c4cf06c017 souphttpsrc: forward accept-certificate signal from libsoup-3
With libsoup 2.x, it was possible to know when there was a TLS failure, as
libsoup provided the "special http status code" SOUP_STATUS_SSL_FAILED.

However these special codes were dropped with libsoup 3.x: now libsoup emits
the accept-certificate signal when there's a TLS failure.

This commit adds a signal "accept-certificate" to SoupHttpSrc, which is in fact
just about forwarding the signal from SoupMessage (which is, itself, forwarded
from GTlsConnection). Note that, in case of libsoup 2.x, the signal is never
emitted.

Fixes: #2379
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/4925>
2023-06-29 16:27:31 +00:00
Peter Stensson 33fb3bfd60 rtpvp9pay: Only mark first outgoing packet as non delta-unit
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/4937>
2023-06-29 09:48:41 +00:00
Peter Stensson af43648bdf rtpvp8pay: Only mark first outgoing packet as non delta-unit
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/4937>
2023-06-29 09:48:41 +00:00
Peter Stensson fa4200a605 rtph264pay: Add unit tests verifying delta-unit flag
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/4937>
2023-06-29 09:48:41 +00:00
Peter Stensson b40b4ffb81 rtph265pay: Only mark first NAL as non delta-unit
When the input buffer contained multiple NAL's the second one would keep
the non delta-unit flag for a key frame.

The delta-unit flag will now be set per NAL when preparing the buffer
list to payload.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/4937>
2023-06-29 09:48:41 +00:00
Mathieu Duponchelle 7445b73e76 rtpsession: expose timeout-inactive-sources property
In some situations it is not desirable to time out when no data is
received any longer, users can opt in to this behavior via a new
property.

The property is also exposed on rtpbin and sdpdemux

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/4880>
2023-06-28 18:45:25 +00:00
Nicolas Dufresne 170dcd58db v4l2: Fix support for left and top padding
In the current implementation, we support for most pixel format left
and top padding by changing the offset in the video meta. Though, to
align driver bytesused to the offset, we recalculate the offset, which
removed the modification we did before.

Instead, save the plane size, and truncate the driver reported bytesused
to the expected size, which ensures that the offsets still match. This
should also fix issues were the buffer size ended up bigger then the
pool size due to driver introduced padding.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/4920>
2023-06-28 01:56:05 +00:00
Matthieu Volat d228b8d96f oss: add a GstDeviceProvider plugin
Based on Alsa's GstDeviceProvider structure, relies on sndstat
file for OSS device enumeration but uses already existing utils
to query caps and names.

Reviewed and thanks to @slomo

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/4879>
2023-06-27 09:34:33 +03:00
Elliot Chen c1a284a221 dashdemux2: fix some mpeg-ts issue with no audio output
For dashdemux2, one stream will create one track.
Maybe there are multiple tracks in one stream such as
some mpeg-ts streams, need add the function to check
and create the other tracks if needed.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/4706>
2023-06-26 10:52:08 +08:00
Edward Hervey 2f95cbd551 matroska-demux: Properly handle early time-based segments
Refusing an incoming segment in < GST_MATROSKA_READ_STATE_DATA should only be
done if the incoming segment is not in GST_FORMAT_TIME.

In GST_FORMAT_TIME, we are just storing the values and returning, so we can
invert the order of the checks.

Fixes proper segment propagation in matroska/webm DASH use-cases

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/3914>
2023-06-22 06:56:33 +00:00
Edward Hervey 4b5352570a adaptivedemux2: Handle early SEEKING query
No pads are present yet, but we can still answer the query

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/3914>
2023-06-22 06:56:33 +00:00