Commit graph

730 commits

Author SHA1 Message Date
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
Xavier Claessens b687e19e10 opus: Fix crash when getting unexpected channel position
gst_opus_channel_names is a static array with only 13 items.
GstAudioChannelPosition have bigger values than that.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/4798>
2023-06-12 20:00:52 +00:00
Xabier Rodriguez Calvar 4769a2ab97 playbin2: improve transference doc of get-*-pad actions
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/2081>
2023-06-12 10:26:26 +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
William Manley 04bcff4dce basetextoverlay: Fix typo in "text-y" property description
Looks like a copy and paste error.

Co-authored-by: Fabian Orccon <cfoch.fabian@gmail.com>
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/4823>
2023-06-10 16:52:29 +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
Seungha Yang e953f38789 tests: compositor: Add tests for data flow after EOS scenario
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/4783>
2023-06-09 19:58:38 +09:00
Matthew Waters b291efe44b gldownload: handle passthrough without a critical
With passthrough mode, gldownload/glbasefilter may not ever retrieve a
relevant GstGLContext as it doesn't actually query the surrounding
elements.  Guard against that.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/4791>
2023-06-07 22:15:39 +00:00
Hou Qi 95ac8b0cea decodebin3: filter error message and store latency message for candidate decoder
If the GST_MESSAGE_SRC of error message belongs to candidate decoders,
filter the error message and don't forward it as there might be a
following candidate decoder that can be used.

If the GST_MESSAGE_SRC of error message belongs to candidate decoders,
store the latency message and handle it after decoder is accepted.
This is to avoid the selection lock failure if decodebin3 needs to
handle latency message for candidate decoders when sending sticky event.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/4677>
2023-06-02 14:51:38 +00:00
Hou Qi 887ae4d9e0 decodebin3: try candidate decoders to select the first one that works
Send sticky events to the new created decoder after it switches
to PAUSED state. It it fails, just skip this decoder and try the
next one until finding one that works. Otherwise remove this
failing stream after trying all decoders and no one can work.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/4677>
2023-06-02 14:51:38 +00:00
Hou Qi 6fc6e934aa decodebin3: send sticky event to decoder after setting it to PAUSED
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/4677>
2023-06-02 14:51:38 +00:00
Hou Qi 837169a221 decodebin3: add function remove_decoder_link()
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/4677>
2023-06-02 14:51:38 +00:00
Hou Qi 536c344111 decodebin3: copy sticky event
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/4677>
2023-06-02 14:51:38 +00:00
Edward Hervey 9befb81036 urisourcebin: Set source element to READY before querying it
Generating the source element is done when urisourcebin is doing the READY to
PAUSED state change, so it is reasonable to set the new source element to that
state.

This also allows detecting early failures with backing libraries or
hardware (checks done in NULL->READY).

Finally it makes more sense to have an element in READY when attempting to query
information from it (such as SCHEDULING queries or probing live-ness).

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/3856>
2023-06-02 07:00:43 +00:00
Guillaume Desmottes b3d27da397 streamsynchronizer: check reset-time when handling FLUSH_STOP
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/4749>
2023-06-01 09:45:50 +02:00
Guillaume Desmottes c2d8f4f729 streamsynchronizer: reset eos on STREAM_START
self->eos was never reset after streamsynchronizer has sent EOS
(except on explicit flush or switching back to PAUSED).
As a result, synchronization was broken if new streams were pushed later
as gst_stream_synchronizer_wait() does not wait if self->eos is set.

Fix this by reseting self->eos on STREAM_START as that means a new
stream is being sent upstream and so a new EOS will follow later on.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/4749>
2023-06-01 09:45:15 +02:00
Stéphane Cerveau 5873747a59 tools: add bad/ges/omx tools to gst_tools
In static mode, these tools must be built
after the gstreamer-full library to use
the symbol gst_init_static_plugins.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/4128>
2023-05-31 15:17:11 +00:00
Stéphane Cerveau dd17beb681 gstreamer-full: add full static support
Allow a project to use gstreamer-full as a static library
and link to create a binary without dependencies.

Introduce the option 'gst-full-target-type' to
select the build type, dynamic(default) or static.

In gstreamer-full/static build configuration gstreamer (gst.c)
needs the symbol gst_init_static_plugins which is defined
in gstreamer-full.
All the tests and examples are linking with gstreamer but the
symbol gst_init_static_plugins is only defined in the gstreamer-full
library. gstreamer-full can not be built first as it needs to know what plugins
will be built.

One option would be to build all the examples and tests after
gstreamer-full as the tools.

Disable tools build in subprojects too as it will be built at the end of
build process.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/4128>
2023-05-31 15:17:11 +00:00
Philippe Normand a7b09098b9 oggdemux: vp8: Detect keyframe packets
decodebin3 drops data on video streams until a keyframe or header is detected,
so for Ogg/VP8 we now need to correctly flag and signal keyframes downstream.
The first buffer pushed from each src pad also has the HEADER flag set.

Fixes playback of
https://github.com/web-platform-tests/wpt/raw/master/media/test.ogv in playbin3.

Fixes #1418

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/4725>
2023-05-31 06:30:48 +00:00
Matthew Waters cd4b84b60b gl/tests: fix unused-but-set warning if built with gles2-only
../tests/check/pipelines/gl-launch-lines.c:314:12: error: variable 'have_gldifferencematte'
set but not used [-Werror,-Wunused-but-set-variable]
  gboolean have_gldifferencematte;
           ^
1 error generated.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/4741>
2023-05-31 04:26:12 +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 d6f1c517f3 decodebin3: Handle changes in stream type
While decodebin3 could handle changes in inputs (ex: changing codecs), there was
still one limitation which was when changing between sources which had
non-intersecting stream types (ex: switching from a video-only source to a
audio-only source). While the decoder *could* change to the proper codec ... it
would carry on using a `DecodebinOutputStream` associated to that stream
type (and therefore with pads with the wrong name).

In order to handle this:

* We notify the `MultiQueueSlot` of the change in `GstStreamType` if it already
  had an associated inputstream (ex: the one associated with the static sink
  pad)

* We detect such changes on the output of multiqueue as soon as
  possible (i.e. when we get the GST_EVENT_STREAM_START for the new stream type)
  by discarding the associated output.

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

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/4703>
2023-05-25 21:23:21 +00:00
Edward Hervey f51283b57b uridecodebin3: Also re-use decodebin3 static sink pad
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/4703>
2023-05-25 21:23:21 +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
Nicolas Beland 3a9c103b58 alsasink: Fix stall for transition of alsasink from PAUSED to READY with USB speakerphone
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/4642>
2023-05-24 11:16:06 +00:00
Guillaume Desmottes 58f80c180c uridecodebin3: notify when 'current-(sub)uri' properties are updated
Assume both uri and suburi are changed when the main item changes.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/4543>
2023-05-24 09:28:58 +00:00
Thibault Saunier 7eca75130d encodebin: Plug a parser before timestamper
Timestamper might not support all stream formats so we need to make sure
some element is able to convert between those formats

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/4122>
2023-05-22 15:10:52 +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
Ruben Gonzalez 059965fe53 doc: Fix newline char between authors
Found running `gst-inspect-1.0 -a |& grep -v ":" | grep @`

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/4682>
2023-05-20 05:48:23 +00:00
Haihua Hu 9f67b866b9 decodebin3: avoid identity, sinkpad, parsebin leakage when reset input
when reset_input, need remove identity/parsebin from decodebin3
when release_pad, need call free or reset input if collection
didn't change

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/4664>
2023-05-19 16:24:08 +00: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