Commit graph

339 commits

Author SHA1 Message Date
Carlos Rafael Giani d5a9ca8ef6 gl: Separate viv direct texture checks from viv-fb winsys check
Vivante direct textures do not depend on the viv-fb windowing system.
Decouple these two to be able to use direct textures even when viv-fb
is not enabled.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/4950>
2023-07-03 05:25:13 +00:00
Jan Schmidt 2e5908d33f appsrc: Release priv->lock before pushing segment
Don't hold the private appsrc lock while pushing out a segment
event, which may block indefinitely.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/4951>
2023-06-30 16:05:57 +00:00
Jonas Kvinge fa46905aea discoverer: Only call handle_current_async if still processing
When gst_element_set_state is called in _setup_locked and errors, the
callback is already processed before we reach handle_current_async, and
the timer is started even though it's finished processing, which results
in a NULL pointer crash later in async_timeout_cb.

To fix this, we check that it's still processing before calling
handle_current_async.

Fixes #1683

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/4936>
2023-06-30 08:52:38 +03:00
He Junyan a10e05000d video-info-dma: add gst_video_info_dma_drm_to_video_info()
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/4883>
2023-06-26 16:18:24 +00:00
Carlos Rafael Giani 8febc4102a audiosink: Add support for DSD data
Code is partially based on the DSD of Robert Tiemann <rtie@gmx.de>:
https://gitlab.freedesktop.org/rtiemann/gstreamer/-/tree/dsd

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/3901>
2023-06-23 01:27:04 +00:00
Carlos Rafael Giani b65eab915a audioringbuffer: Add support for DSD data
Code is partially based on the DSD of Robert Tiemann <rtie@gmx.de>:
https://gitlab.freedesktop.org/rtiemann/gstreamer/-/tree/dsd

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/3901>
2023-06-23 01:27:03 +00:00
Carlos Rafael Giani 4cce9a77c9 audioringbuffer: Introduce accessor macros
This follows the design ideas behind GstVideoInfo to provide an API
capable of hiding any underlying ABI compatibility mechanisms.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/3901>
2023-06-23 01:27:03 +00:00
Carlos Rafael Giani 8c5a8f4466 dsd: Add code for DSD audio support
Related to:

https://gitlab.freedesktop.org/gstreamer/gst-plugins-base/-/issues/972

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/3901>
2023-06-23 01:27:03 +00:00
Sebastian Dröge 3144f63302 tags: Don't allow image tags with G_MAXUINT32 length
This will cause an integer overflow a little bit further down because we
allocate a bit more memory to allow for a NUL-terminator.

The caller should've avoided passing that much data in already as it's
not going to be a valid image and there's likely not even that much data
available.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/4894>
2023-06-20 10:02:19 +00:00
He Junyan 0b981a216c gl: Add a print function to dump all EGL image drm format
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/4877>
2023-06-19 12:58:02 +00:00
Nicolas Dufresne c17e648fcf video: Add NV12_10LE32_4L4 tiled format
This 10bit format is identical to NV12_4L4, but uses NV12_10LE40 format
internally. In show, the tiles is made af 4 rows of 5 bytes, which contains
4 fully packed 10bit values.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/3447>
2023-06-15 14:32:32 +00:00
Nicolas Dufresne b832a20d35 video: Fix tile info UV width
The width in pixel should consider a UV pair as 1 pixel, fix the metadata
accordingly.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/3447>
2023-06-15 14:32:32 +00:00
Haihua Hu 5716ee3513 glfilter: add parent meta to output buffer for input buffer
glfilter will unref input buffer after _transform() call immidiately,
but gpu may still reading input buffer for rendering because gl
api is executed async. Need hold reference for input buffer by
adding parent meta to output buffer.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/4801>
2023-06-13 07:53:49 +00:00
Philippe Normand ea9b837b07 video: convertframe: Add a debug category
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/4629>
2023-06-11 15:45:02 +00:00
Philippe Normand b115756338 video: convertframe: Fix annotation of gst_video_convert_sample()
The returned sample is pulled from appsink which transfers its ownership.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/4629>
2023-06-11 15:45:02 +00:00
Philippe Normand a0ac1cccbf appsink: Adjust annotations of pull- signals
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/4629>
2023-06-11 15:45:02 +00:00
Kevin Song 55926f0271 appsink: unref gstbuffer in prev sample early
Appsink will unref prev sample in dispose function. Which is later
when V4L2 video decoder link with appsink as V4L2 video decoder
will close V4L2 device fd during GST_STATE_CHANGE_READY_TO_NULL.
If the video buffer return to V4L2 video decoder after the decoder
closed V4L2 device fd, V4L2 can't release the video frame buffer
which allocated with MMAP mode as application can't call
VIDIOC_REQBUFS 0 to release the video frame buffer by V4L2 driver.
The memory of the video frame will leak.
Unref the gstbuffer in stop() function, so V4L2 video decoder
can received all video frame buffers and release it before close
V4L2 device fd.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/4818>
2023-06-09 13:13:17 +00:00
He Junyan 1a2d136438 gl: EGL image methods to import dmabufs with modifiers
This patch adds gst_egl_image_from_dmabuf_direct_target_with_dma_drm() and
add gst_egl_image_from_dmabuf_with_dma_drm() functions

New function gst_egl_image_from_dmabuf_direct_target_with_dma_drm(), where
gst_egl_image_from_dmabuf_direct_target() is a specialization of the first.

And gst_egl_image_from_dmabuf() is a specialization of new function
gst_egl_image_from_dmabuf_with_dma_drm()

Co-authored-by: Victor Jaquez <vjaquez@igalia.com>
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/4680>
2023-05-30 20:09:27 +00:00
Víctor Manuel Jáquez Leal 9f7f54174a gl: add gst_egl_image_check_dmabuf_direct_with_dma_drm()
It internally uses gst_gl_context_egl_get_dma_formats() instead of fetching
modifiers by itself.

Thus gst_egl_image_check_dmabuf_direct() is a decorator of this new function.

Co-authored-by: He Junyan <junyan.he@intel.com>
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/4680>
2023-05-30 20:09:27 +00:00
Víctor Manuel Jáquez Leal 1477ed1ae5 video-info-dma: add gst_video_info_dma_drm_from_video_info()
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/4680>
2023-05-30 20:09:27 +00:00
Víctor Manuel Jáquez Leal af7b5023bd gl: replace _drm_direct_fourcc_from_info()
.. with gst_video_dma_drm_fourcc_from_format()

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/4680>
2023-05-30 20:09:27 +00:00
Víctor Manuel Jáquez Leal 7eed950caa gl: add a method to get DMA formats and modifiers
By calling the internal function gst_gl_context_egl_fetch_dma_formats() the an
array of structures holding a DMA fourcc format and its modifiers (another array of
structure holing modifier and if it's external only) will be stored.

Users would call gst_gl_context_egl_get_format_modifiers() to get the array of
modifiers of a specific DMA fourcc format.

Co-authored-by: He Junyan <junyan.he@intel.com>
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/4680>
2023-05-30 20:09:27 +00:00
Seungha Yang 5a68831d74 video-blend: Fix linking error with C++
Add missing extern "C"

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/4727>
2023-05-29 16:32:50 +00:00
He Junyan e23964cb5f glupload: Fix a memory leak point in gst_egl_image_cache_unref()
The image cache itself should be freed when ref_count is 0.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/4723>
2023-05-27 12:17:08 +00:00
Edward Hervey 75d6621c2a videodecoder: Only use subframes internal values in subframe mode
This clarifies the usage of it, and fixes issues with reverse playback.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/4694>
2023-05-24 18:50:56 +00:00
Edward Hervey 7a4916b251 videodecoder: Remove unused internal fields
Fixes https://gitlab.freedesktop.org/gstreamer/gstreamer/-/issues/2552

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/4694>
2023-05-24 18:50:56 +00:00
Edward Hervey 386a8dbae5 videodecoder: refactor and document finish_frame some more
* Move the in-flight iteration and handling code into the main block
* Document the intent a bit more

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/4694>
2023-05-24 18:50:56 +00:00
Edward Hervey bce9f3327d videodecoder: Refactor post-decode PTS/DTS recovery code
The code was a bit hard to follow. Use clear/explicity variable names and
comment a bit more on what is going on.

Also fold the double list iteration into a single one

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/4694>
2023-05-24 18:50:56 +00:00
He Junyan 1e9e976268 videometa: Only validate the alignment only when it contains some info
When the alignment contains nothing, all its fields are 0 and always
can be satisfied. So there is no need to validate it in this case.
And there are a lot of places just setting this alignment to default
all zero value, this validation generates lots of warnings.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/4674>
2023-05-24 16:22:21 +00:00
Seungha Yang a8bf19deda video: convertframe: Add D3D11 specific conversion path
Add d3d11 conversion path to make gst_video_convert_sample() work
for GstD3D11Memory.

Note that just adding "d3d11download" to the exisitng code is
suboptimal from GstD3D11 point of view because:
* d3d11convert element can support crop/colorspace-conversion/scale
  all at once while existing software pipeline needs intermediate steps
  for the conversion
* "Process everything on GPU then download it to CPU memory" would be likely
  faster than "download GPU memory to CPU then processing it on CPU"

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/2715>
2023-05-20 14:24:27 +00:00
Seungha Yang 9554a5c7fa video: convertframe: Remove pointless const qualifier
const keyword for refcounted object does not very make sense
and unnecessary in this case

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/2715>
2023-05-20 14:24:27 +00:00
Philippe Normand b2e121054d sdp: Add API to remove media from a SDP message
Based on initial patch by Stefano Buora.
https://gitlab.freedesktop.org/gstreamer/gst-plugins-base/-/merge_requests/579

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/4670>
2023-05-20 09:23:17 +01:00
Matthew Waters 8003acf5bb gl: update docs for mixer move
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/4608>
2023-05-18 19:34:15 +00:00
Matthew Waters e9bf1c79cc glmixer: don't add rgba templates by default
Subclasses may want to override the pad template with different formats
or with a different pad subclass.

The original beahviour is still available by calling
gst_gl_mixer_class_add_rgba_pad_templates() in _class_init() of the
subclass.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/4608>
2023-05-18 19:34:15 +00:00
Matthew Waters fc85b63c2b glmixer: remove set_caps() vfunc
All of its implementors can be moved to gl_start/stop() from
GstGLBaseMixer instead.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/4608>
2023-05-18 19:34:14 +00:00
Matthew Waters 331b1af468 glmixer: remove reset vfunc
This functionality is covered by GstGLBaseMixer's gl_stop() vfunc.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/4608>
2023-05-18 19:34:14 +00:00
Matthew Waters 14e7e991d3 gl/mixer: make fbo instance field private and provide accessor function
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/4608>
2023-05-18 19:34:14 +00:00
Matthew Waters 007a602726 gl: move gl(base)mixer to library
For use by applications/libraries outside of the opengl plugin.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/4608>
2023-05-18 19:34:14 +00:00
Nirbheek Chauhan 681f042f27 meson: Install viv-fb GL headers, needed by i.MX
Needed by qmlglsink at build time to allocate a viv-fb display.

Without this, the GL fastpath doesn't work, and performance is really
bad.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/4613>
2023-05-12 15:05:56 +05:30
Yinhang Liu f04a1eee71 video: video-info-dma: Fix return value
The return value of gst_video_info_dma_drm_new_from_caps is a pointer type,
and should not return a boolean type. Fix this issue.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/4612>
2023-05-12 15:38:08 +08:00
Piotr Brzeziński 5e45a1b1bd macos: Set activation policy in osxvideosink and glimagesink
Upon creating a window, glimagesink and osxvideosink now set the policy to
NSApplicationActivationPolicyRegular, which lets us show an icon in the Dock
for convenience and appear in the top menu bar like other apps.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/4573>
2023-05-12 01:14:44 +02:00
Piotr Brzeziński f60c87769f macos: Remove old NSApp workaround related code
This is no longer needed since the introduction of `gst_macos_main()` in 1.22.
Before that existed, we had a patch for GLib in Cerbero, which did work but made it
impossible to update GLib at all. The code being removed was a fail-safe in case of
running without said patch being applied. It's no longer needed, since for macOS
we just wrap our GStreamer with an NSApplication using `gst_macos_main()`.

Warnings will be displayed if no NSApp/NSRunLoop is found wherever needed,
pointing the user towards using the new API.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/4366>
2023-05-11 20:30:19 +02:00
Sebastian Dröge 4cbd8d6fc6 pbutils: discoverer: Mark gst_discoverer_stream_info_get_stream_id() as nullable
It can return NULL in certain situations.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/4572>
2023-05-08 15:26:58 +03:00
Thibault Saunier 40a6f2dc91 discover: Avoid double freee when creating info from cache file
Passing ownership to the function as the created info is made owner.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/3911>
2023-04-29 06:54:10 -04:00
Thibault Saunier 0f229aa62a discoverer: Add serializing unknown stream type support
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/3911>
2023-04-29 06:54:10 -04:00
Thibault Saunier 9e994ea616 discoverer: Add a signal to retrieve serialized GstDiscovererInfo
This allows user to serialize the GstDiscovererInfo in other places
than the default folder, like a database when running web services for
examples.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/3911>
2023-04-29 06:47:55 -04:00
Stéphane Cerveau 61416bc532 pbutils: add video/x-ivf to descriptions
Add missing description for video/x-ivf spotted
with gst-discoverer-1.0

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/4248>
2023-04-27 06:45:27 +00:00
Jordan Petridis 791a068c58 build: appease clang warning
Clang complains about these variables being (possibly) unitialized, even
when they are assigned to NULL or proper value inside the macro.

Might as well initialize them to avoid the warning.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/4281>
2023-04-24 12:37:07 +00:00
Thibault Saunier b14e675a27 gir: Checkout all .gir files and check that they are updated on the CI
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/3010>
2023-04-22 09:32:32 -04:00
Nicolas Dufresne e709e2d97c meson: Add a wrap file for libgudev
And allow fallback to it.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/4447>
2023-04-19 22:47:19 +00:00