Commit graph

330 commits

Author SHA1 Message Date
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
Sebastian Dröge 83106de7e7 video: timecode: Add support for framerates lower than 1fps
These are not explicitly defined but the existing calculations can be
extended to also cover that case by inverting them to avoid floating
point calculations.

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

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/4374>
2023-04-17 10:26:11 +00:00
Seungha Yang 5765eb8dce sdpmessage: Don't set "source-filter" to caps
Multiple "source-filter" can exist, and it requires special handling

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/3485>
2023-04-12 16:32:07 +00:00
Matthias Fuchs 769cc48e49 glcontext_wgl: fix missing unref
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/4392>
2023-04-11 20:05:17 +00:00
Philippe Normand 4e4cb3bcf5 glbasesrc: Reverse order of error/debug messages
Addressing follow-up review from Tim in !4222, the first string is meant to be
shown to the user and should be translatable. The second one is more suited for
debugging purposes and should not be translated.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/4389>
2023-04-11 12:28:27 +01:00
Sebastian Dröge 8ed0b03c78 appsink: Use a class handler callback instead of vfunc for propose-allocation
There would otherwise be no padding left in the class struct anymore and
we might need it for something else in the future.

A class handler callback can be overridden by subclasses via
`g_signal_override_class_handler()` and chained up via
`g_signal_chain_from_overridden_handler()`.

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

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/4356>
2023-04-06 15:21:35 +00:00
Sebastian Dröge 51a2adb837 allocators: drm-dumb: Annotate allocator instance parameters with the correct type
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/4360>
2023-04-06 17:04:45 +03:00
Sebastian Dröge edcb8e8f35 allocators: drm-dumb: Annotate device-path as a filename
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/4358>
2023-04-06 15:41:27 +03:00
Rouven Czerwinski 7ad84674ab gst-plugins-base: gl: wayland: cleanup on close
The proxy and queue are created in the gst_gl_window_wayland_egl_open()
function and will be recreated on open. This leaks both objects, the
wayland client documentation mentions that they should be destroyed
using the appropriate destroy functions.

Found during valgrind memory leak testing, these blocks were marked as
definitely lost.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/4354>
2023-04-06 08:09:36 +02:00
Guillaume Desmottes 84dea99132 appsrc: properly handle events received before sending the segment
The first serialized events that can be send on a src pad are a CAPS and then a
SEGMENT event.

When handling events from user in appsrc, we used to send a segment
automatically if the SEGMENT has not been sent yet.
This breaks if the CAPS event was not send either as we were now sending
a SEGMENT before the CAPS.

Fix this by delaying such events until the CAPS has been configured.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/4297>
2023-04-05 11:11:46 +00:00