Commit graph

458 commits

Author SHA1 Message Date
Olivier Crête f5d5f2cf1a meta: Add API to register metas in two steps
And also remove the specific registration APIs for
serializable meta.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/5830>
2023-12-19 22:41:31 +00:00
Xavier Claessens 06d9d934f9 meta: Add serialize/deserialize API
This allows metas to be serialized to be transmitted or stored. This is
intended to be used for example by gdppay or unixfdsink.

Implemented on GstCustomMeta, GstVideoMeta, GstReferenceTimestampMeta,
and GstAudioMeta.

Sponsored-by: Netflix Inc.
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/5355>
2023-12-17 16:13:26 +00:00
Sebastian Dröge c4789e6de5 audio: Consider the expected timestamp for discont-wait handling
Otherwise if there is a huge gap it will only be considered a
discontinuity after another discont-time amount of buffers has passed.

Like this it will be immediately a discontinuity if the gap between the
expected and received time becomes bigger than the discont-time.

The last part of the test was actually testing for this behaviour and
expected the previous behaviour. Most other tests also had to be
adjusted because discont will now happen at slightly different times
than before.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/5759>
2023-12-17 12:01:27 +00:00
Doug Nazar 155224de96 audioringbuffer: Don't try to map MONO channel
Avoids critical message:

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

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/5721>
2023-12-09 17:01:41 +00:00
Jan Schmidt 3304eae3e8 audio: Extra documentation for gst_audio_ring_buffer_set_timestamp()
Clarify the documentation that gst_audio_ring_buffer_set_timestamp()
expects timestamps sampled directly from the pipeline clock

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/5657>
2023-12-05 12:42:17 +00:00
Seungha Yang 75d1b3f92f appsrc: Fix flow return when buffer is dropped
Flow EOS on buffer drop (upstream leaky mode) was not
intended behavior. Appsrc should return OK instead.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/5753>
2023-12-02 01:09:59 +09:00
Seungha Yang 269df73f92 gl: Add RBGA format support
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/5738>
2023-12-01 12:19:12 +00:00
Seungha Yang 9b41666cfd video: Fix RBGA format poffset
The offset array should be [0, 2, 1, 3]

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/5738>
2023-12-01 12:19:12 +00:00
Jimmy Ohn 2c19c92041 encoding-target: Properly free when missing type field in parse_encoding_profile
pname and description in parse_encoding_profile function causes
memory leakages when missing the 'type' field for streamprofile.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/5744>
2023-12-01 09:39:47 +00:00
Seungha Yang 5cbd062856 video: Add RBGA format
This new format is intended to be used by hardware decoders
where VUYA is only supported 4:4:4 decoding surface but
stream is encoded with GBR color space, HEVC and VP9 GBR streams
for example.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/5703>
2023-11-29 16:54:16 +00:00
Maksym Khomenko 20f48f0fd0 rtpbasepayload: add extensions property
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/5694>
2023-11-28 15:05:24 +00:00
Maksym Khomenko 4eff26ee1c rtpbasepayload: fix documentation formatting
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/5694>
2023-11-28 15:05:24 +00:00
Philippe Normand 986a36273f pbutils: Don't include default vp9 parameters in resulting codec mime string
According to the document defining the vp9 codec string, the optional fields
should all be present only if at least one of them has a non-default value.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/5716>
2023-11-27 10:36:01 +00:00
Robert Mader 414512d922 glcontext/egl: Prefer GLES2 over GL/GL3 by default
From a multimedia perspective GLES >= 2 has the big advantage of
supporting external textures (`OES_EGL_image_external` /
`OES_EGL_image_external_essl3`), allowing various YUV formats to be
imported directly by drivers.

It appears unlikely by now that the extension will ever be ported to
GL with Vulkan becoming more popular, leaving GL without an "official"
way to import YUV formats.

Further more, for Gst internal purposes it's likely that GLES2 works
equally well if not better on most drivers these days, especially on
embedded devices.

Thus switch the default for EGL context creation to GLES2. This won't
affect apps that create their own context, but `gst-launch-1.0` etc.,
which are often used for testing so people don't have to pass
`GST_GL_API=gles2`.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/5509>
2023-11-17 15:02:50 +00:00
Nicolas Dufresne e523dd9f08 allocators: shm: Remove future write sealing
By sealing for future writes, we broke Wayland SHM support. It seems like the
wayland library maps the SHM in read/write mode. This is visible through no
display and an error message like this:

  wl_shm@7: error 2: failed mmap fd 43: Operation not permitted

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/5684>
2023-11-17 08:17:05 +00:00
Thibault Saunier a2bb04c899 discoverer: Fix accumulating discoverer info when loading from cache
With the previous accumualator loading stopped after the first handler,
even if it return NULL which is unexpected, instead we want to use the
first non-value returned by handlers.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/5665>
2023-11-14 22:01:04 +00:00
qian hu b8455ae989 video: dma-drm: add color format mappping about RGB and BGR
add mapping relationship between GST and DRM about RGB888/BGR888

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/5641>
2023-11-13 17:44:56 +00:00
Daniel Morin 1fc3d43952 audiodecoder: propagate resync flag
- propagate resync flag on last input frame to output frame
- resync TS when RESYNC flag is set

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/5529>
2023-11-10 21:45:13 +00:00
Piotr Brzeziński 4c5aaa742f gloverlaycompositor: Add GL sync point when uploading overlays
In rare cases - notably on macOS, because of multiple GL contexts - the lack of a sync point was causing overlays
to disappear for a frame after being redrawn, or sometimes not appear at all. This change makes sure that the display
in one GL context will be correctly synchronised with the other GL context where the overlay texture was uploaded.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/5610>
2023-11-07 00:32:39 +01:00
Xavier Claessens 19832bd3b3 GstShmAllocator: Add documentation
Sponsored-by: Netflix Inc.
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/5328>
2023-11-03 18:22:00 +00:00
Xavier Claessens 5b4d37d6f2 GstShmAllocator: Respect allocation params
Sponsored-by: Netflix Inc.
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/5328>
2023-11-03 18:22:00 +00:00
Xavier Claessens f57dabe65c GstShmAllocator: Seal memfd for future write
The GstMemory we created is kept mapped RW, but any future mapping that
uses the fd should be RO.

Sponsored-by: Netflix Inc.
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/5328>
2023-11-03 18:22:00 +00:00
Xavier Claessens c0ce677dfc GstShmAllocator: Use shm_open() instead of temporary file
There is no guarantee that g_get_user_runtime_dir() is in a tmpfs. Using
an explicit shared memory API seems safer for all POSIX platforms.

Note that Android does not have shm_open() and only added memfd_create()
since API level 30 (Android 11).

Sponsored-by: Netflix Inc.
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/5328>
2023-11-03 18:22:00 +00:00
Xavier Claessens d59ea1caf0 GstShmAllocator: Use GST_ALLOCATOR_FLAG_NO_COPY flag
Sponsored-by: Netflix Inc.
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/5328>
2023-11-03 18:22:00 +00:00
Xavier Claessens 7df22b338b GstShmAllocator: New shared memory allocator
This makes Wayland's allocator public. It is generally useful to have a
shared memory allocator that can create memfd on Linux.

Sponsored-by: Netflix Inc.
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/5328>
2023-11-03 18:22:00 +00:00
Slava Andrejev 3dd9411b36 glcolorconvert: add reordering for plain GBR color format
Fixes #2991

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/5582>
2023-11-01 06:02:20 +00:00
Sebastian Dröge f7d4ea6eec audioaggregator: Make access to the pad list thread-safe while mixing
When mixing every single buffer the object lock is shortly released and
acquired again. In the meantime the pad list can become invalid because
a pad was removed or added, and equally the current pad might as well
have been finalized in the meantime.

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

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

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/5510>
2023-10-25 07:56:40 +00:00
Loïc Le Page e1ca575408 gl: add support for surfaceless display in GstGL
Use of the EGL_MESA_platform_surfaceless EGL extension to create an EGL
display that is not depending on any kind of windowing system.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/5511>
2023-10-20 12:46:48 +00:00
Loïc Le Page 34694bbfcf gl: fix "winrt" string comparison in gst_gl_display_type_from_environment
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/5511>
2023-10-20 12:46:48 +00:00
He Junyan c5f50b1602 gl: upload: gl memory method should not provide pool for system memory caps
In _gl_memory_upload_propose_allocation(), when output target is "external-oes",
then we should not provide GL allocator and pool in the allocation query.
This is because the "external-oes" kind memory can never be mapped directly
and the upstream element may misuse it.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/5468>
2023-10-18 19:56:30 +00:00
He Junyan ea35adc55f gl: upload: Implement the fixate_caps virtual function
We now prefer the 2D target than other targets when fixating src caps.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/5468>
2023-10-18 19:56:30 +00:00
He Junyan b46d84ee7f gl: upload: rename the _dma_buf_check_target() helper function
Make it a common helper function, not only for the DMA buffer method.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/5468>
2023-10-18 19:56:30 +00:00
Jan Schmidt 23097e35e6 glfiter: Protect GstGLContext access
The propose and decide allocation vfuncs are called directly from
basetransform and need to use the locked accessor function for
retrieving a reliable reference to the GstGLContext (if available)

Fixes spurious crashes on shutdown during pad reconfiguration

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/5437>
2023-10-18 11:22:31 +00:00
Nicolas Dufresne 516073f9d0 glupload: egl: Use n_plane values from the GstVideoInfo
The number of planes is a meta we carry around in the GstVideoMeta with
DMA_DRM format. In cannot be decuded correctly from knowledge of the
base format. Notably, some compression modifier may introduce an extra
plane to store the compression parameters.

So use n_planes from GstVideoMeta and pass this explicitly when
importing to EGLImage.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/5461>
2023-10-16 17:30:32 +00:00
Nicolas Dufresne 0e5f5b413c glupload: Plane size is not known for DMA_DRM
For these format, the plane size is not known, simply use 1 when
searching for the memory object in the GstBuffer array.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/5461>
2023-10-16 17:30:32 +00:00
Nicolas Dufresne e00682a4c0 egl: Fix direct dmabuf upload without DMABuf caps feature
The DMAbuf accept function was ensuring the in_dma_info values was valid if
the in_caps have change. But the check was bogus since the in_caps was being
modified without a pointer change. As a side effect, on the second accept
call, the drm_fourcc was reset to 0, which cause the uploader to fallback.

Fix this by ensuring we always have a valid dma_frm info directly in the
set_caps() function. Also remove the bogus caps changed check and remove any
modification to the info structure and always do that inner checks.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/5461>
2023-10-16 17:30:32 +00:00
Nicolas Dufresne a869760199 egl: Fix indirect dmabuf importation of none DRM formats
DRM Modifiers are not generically transferrable from a format like NV12 to
their indirect shading format (R8 / RG88). So the helper to this do needs
to be removed from our API.

To make things worse, we support indirect formats that aren't DRM format in
the first place. Notably NV12_16L32 (aka MM21) is not (yet) a DRM format. Yet,
each plane can be indirectly imported using R8/RG88 and a detiling shader.
This patch also removes this constraint restoring zero-copy playback on
Mediatek SoC.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/5461>
2023-10-16 17:30:32 +00:00
Matthew Waters 714c78ac51 glcolorconvert: add A422/A444 to output switch statement
Fixes glcolorconvert writing to A422 or A444 formats.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/5455>
2023-10-10 22:47:59 +11:00
Piotr Brzeziński 64a58c37ac glfilter: Only add parent meta if inbuf != outbuf
This was causing a memory leak in cases like `gltestsrc ! gltransformation scale-x=0.5 ! glimagesink`.
Parent meta was being added in assumption that those buffers are different, which was not the case here,
creating a reference loop and never freeing the buffer.

Co-authored-by: Matthew Waters <matthew@centricular.com>
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/5445>
2023-10-10 03:17:07 +00:00
Nicolas Dufresne 0eee03d688 videoaggregator: Avoid creating caps that are not in the template
By using the gst_caps_set_simple() to set the format on all structures, the
compositor may create invalid combinations as the caps may contain passthrough
caps. Avoid this issue by intersecting the resul with its original.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/5386>
2023-10-03 21:13:00 +00:00
Nicolas Dufresne 0fc63b58d0 video: Add support for a list of any video formats
Adds list of formats that should be used by element in needs to passthrough
video. It contains the full list of video format plus DMA_DRM format
and will be extended in the future as needed. This patches includes 3 new
symbols:

  - GST_VIDEO_FORMATS_ANY_STR
  - GST_VIDEO_FORMATS_ANY
  - gst_video_formats_any()

The last one can be used by bindings or for code that prefers having
GstVideoFormat values instead of strings.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/5386>
2023-10-03 21:13:00 +00:00
Sebastian Dröge 510f71fbe4 video-format: Fix up video formats ordering by quality
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/5412>
2023-10-02 09:39:21 +03:00
Nicolas Dufresne 63da298b84 glupload: Fix always true compiler warning
There was an if case that was always true. After re-reading the Khronos
spec, this case is actually undefined. It is better to just always ignore
the format.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/5410>
2023-09-28 20:56:35 +00:00
Jochen Henneberg d9cd8b375e rtpbasedepayload: Fixes for cleanup of header ext. aggregation
* Free delayed buffer on _finalize()
* Reset header aggregation cache and delayed buffer on state change
  from READY_TO_PAUSE

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/5278>
2023-09-27 11:49:11 +00:00
Jochen Henneberg 372709400f rtpbasedepayload: Only aggregate RTP header extensions if in use
Right now we split the RTP header from the current buffer into a new
buffer and aggregate those buffers for later processing if the
depayloader creates an output buffer.

This is cumbersome as it happens even if none of the incoming RTP
buffers carries RTP header extensions at all just because header
aggregation has been enabled in the depayloader class.

This commit will start aggregation only in case that there really are
RTP header extensions available on an incoming RTP buffer. The check
is trivial and cheap. Once activated we keep aggregation active for
all buffers. The active state is reset on state change READY_TO_PAUSE.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/5278>
2023-09-27 11:49:10 +00:00
Matthew Waters 237d195209 gl/format: fix swizzle indices for RGB10A2/BGR10A2
Fixes: https://gitlab.freedesktop.org/gstreamer/gstreamer/-/issues/3003
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/5400>
2023-09-27 19:45:57 +10:00
Daniel Moberg 7446839e0d rtspconnection: Add API for adding extra http request headers
This commit adds capability to add custom headers to any http requests
during http tunnel mode. If header exist new header will replace old.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/5268>
2023-09-26 06:35:43 +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
Eric f7cb79874a rtspconnection: Ignore trailing whitespace in headers
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/5358>
2023-09-21 22:06:22 +00:00
Michiel Westerbeek 03bf8e9386 video-scaler, audio-resampler: downgrade 'can't find exact taps' to debug
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/5369>
2023-09-20 16:31:47 +00:00