Commit graph

4594 commits

Author SHA1 Message Date
Nirbheek Chauhan b87aaf4d28 python: More functions can be called before gst_init()
Configuration of our debugging system is possible before init, and in
fact is necessary too, otherwise the settings won't apply to logging
that happens during init.

For instance, since you cannot register a log function before you call
init in python, there is no way for you to log errors during init to
whatever logging service your app uses.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/4753>
2023-06-02 13:25:23 +00:00
Nirbheek Chauhan 62951ed379 python: auto-pep8 whitespace issues in overrides
Needed because the next commit edits this file.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/4753>
2023-06-02 13:25:23 +00:00
Nirbheek Chauhan ca4762168f meson: Support building qml6glsink on win32
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/4742>
2023-06-02 14:27:44 +05:30
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
Piotr Brzeziński 476d350b03 pngdec: Fix 16bit RGB images display
Due to the alpha value being inserted with _BEFORE, we were ending up
with ARGB instead of RGBA, thus displaying completely wrong colours.
According to libpng's manual, "to add an opaque alpha channel, use filler=0xff
or 0xffff and PNG_FILLER_AFTER which will generate RGBA pixels".

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/4756>
2023-06-02 05:38:54 +00:00
Seungha Yang e4c43db5d5 d3d11basefilter: Forward video related metas if needed
The same as in GstVideoFilter

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/4751>
2023-06-02 00:33:52 +00:00
Michael Grzeschik ea2764aa69 uvcsink: add probe handling for live pipelines
Currently the uvcsink is only capable to run in an application
that is handling the state transitions of the pipeline properly
by checking on streaming event from the uvcsink.

This code is improving the element by adding an fakesink to
consume possible videostream flow in case the pipeline state
is not changing on hosts streamoff.

This is helpfull when using local gst-launch pipelines where
the streaming event is not monitored to change the pipelines
state.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/1304>
2023-06-01 19:19:05 +00:00
Michael Grzeschik 5d82deb2c5 uvcsink: add new bin element around v4l2sink
This patch adds an element to stream video data to an uvc video gadget.
The element handles the uvc events STREAMON, STREAMOFF, SETUP and DATA.
to start, stop and configure the video buffer flow by the use of pad
probes. It works with linux kernels of versions higher than v6.1.

The element makes use of the v4l2sink proxy property v4l2sink::device
to locate the corresponding device to parse the configfs for additional
data.

The code in uvc.c is basically derived from /lib/uvc.c in
https://git.ideasonboard.org/uvc-gadget.git.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/1304>
2023-06-01 19:19:05 +00:00
Michael Grzeschik 6ef14df09b uvcsink: configfs.{c,h}: add helper function to parse by videodev
- add helper function video_find_config_name
- add helper function configfs_parse_uvc_videodev

With these helper functions it is possible to parse the
configfs entry corresponding to the used videodev.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/1304>
2023-06-01 19:19:05 +00:00
Michael Grzeschik 079fc8216c uvcsink: configfs.c: use G_N_ELEMENTS instead of ARRAY_SIZE
We don't have ARRAY_SIZE in glib.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/1304>
2023-06-01 19:19:05 +00:00
Michael Grzeschik fd3a6ce642 uvcsink: configfs.c: fix globing in uvc_video_device
The gadget in the sysfs can be postfixed with an index.
Fix the globbing by adding a wildcard after /gadget*/.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/1304>
2023-06-01 19:19:05 +00:00
Michael Grzeschik 38aa1fc414 uvcsink: configfs.c: refactor location of GUID formats
- move GUID handling to beginning

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/1304>
2023-06-01 19:19:05 +00:00
Michael Grzeschik da61d8f96d uvcsink: configfs.{c,h}: add parsing of more fields from format
- add parsing of dwMaxVideoFrameBufferSize

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/1304>
2023-06-01 19:19:05 +00:00
Michael Grzeschik e50dcac517 uvcsink: configfs.c: fix code for local usage
- use local header file and remove unused reference to tools.h

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/1304>
2023-06-01 19:19:05 +00:00
Michael Grzeschik 42c53f971c uvcsink: add configfs.{c,h} from https://git.ideasonboard.org/uvc-gadget.git
- imported both files and run gst-indent on them

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/1304>
2023-06-01 19:19:04 +00:00
Michael Grzeschik 1528ab2e7a gstreamer: gst-utils: add gst_util_simplify_fraction
We add the gst_util_simplify_fraction function to be able to convert
fractions such as 333333/10000000 to 1/30.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/1304>
2023-06-01 19:19:04 +00:00
Vivia Nikolaidou 395e0c3925 tsmux: Resend PMT whenever the language changes
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/4711>
2023-06-01 17:05:11 +00:00
Víctor Manuel Jáquez Leal 06d793033d vulkan/format: use basic features (v1) as fallback
if vkGetPhysicalDeviceFormatProperties2 isn't available.

This approach assumes that, for basic features flags symbols,
VkFormatFeatureFlagBits and VkFormatFeatureFlagBits2 are binary equivalent.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/4746>
2023-06-01 13:58:47 +00:00
Matthew Waters 0a74a967e3 vulkan/format: don't rely on vulkan header version for function availability
e.g. android will have update vulkan.h headers but old platforms will
not contain the function and will result in a link error.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/4746>
2023-06-01 13:58:47 +00:00
Nirbheek Chauhan 37aab17be3 meson: Update webrtc-audio-processing wrap to 1.1
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/2943>
2023-06-01 09:34:37 +00:00
Arun Raghavan d5755744c3 webrtcdsp: Update code for webrtc-audio-processing-1
Updated API usage appropriately, and now we have a versioned package to
track breaking vs. non-breaking updates.

Deprecates a number of properties (and we have to plug in our own values
for related enums which are now gone):

  * echo-suprression-level
  * experimental-agc
  * extended-filter
  * delay-agnostic
  * voice-detection-frame-size-ms
  * voice-detection-likelihood

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/2943>
2023-06-01 09:34:37 +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
Mathieu Duponchelle 211928ca41 webrtc/nice: put usage of OPTION_CONSENT_FRESHNESS behind check
See https://gitlab.freedesktop.org/libnice/libnice/-/merge_requests/257

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/4750>
2023-06-01 00:42:28 +00:00
Thibault Saunier 4a4d7821a5 cudabasetransform: Handle video related meta as appropriate
This implements the same logic as GstVideoFilter

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/4731>
2023-05-31 20:09:42 +00:00
Thibault Saunier 8d3f90eb8d cuda: memory: Enhance debug when CU_GL_DEVICE_LIST_ALL fails
Ensuring error from cuda is logged

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/4731>
2023-05-31 20:09:42 +00:00
Colin Kinloch 82c449ce00 waylandsink: Emit "map" signal boarder surface is ready
This allows gtkwaylandsink to queue a draw of its gtk widget at the
correct time, avoiding a race.

Signed-off-by: Colin Kinloch <colin.kinloch@collabora.com>
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/4722>
2023-05-31 18:57:56 +00:00
Thibault Saunier c79574c2d3 python: Do not link GStreamer in the overrides
Symbols will already be present thanks to pygobject dlopenning the correct lib

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/4128>
2023-05-31 15:17:11 +00:00
Stéphane Cerveau 353f8911bf libnice: disable gst tests in static mode
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/4128>
2023-05-31 15:17:11 +00:00
Stéphane Cerveau 9b277d68c5 gstreamer-full: add GST_STATIC_COMPILATION for Windows
In the case of a gstreamer-full target type to static,
the GST_STATIC_COMPILATION is necessary on Windows to avoid
a different mangling from the external project using the
gstreamer-full libraries (ie dllimport).

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/4128>
2023-05-31 15:17:11 +00:00
Stéphane Cerveau 3973b56e26 validate: disable plugins in static build
As the plugins can not be used in gstreamer-full,
disable the plugins.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/4128>
2023-05-31 15:17:11 +00:00
Stéphane Cerveau 8a28136627 gstreamer-full: helpers built as tools
gst-plugin-scanner and gst-completion-helper
are now built part of the helpers as tools.

Add libraries to the summary to know
what library will be built and can be exposed
by gstreamer-full

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/4128>
2023-05-31 15:17:11 +00: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
Sebastian Dröge 98c5ceb73f ptp: On Windows handle socket polls that result in no error but also no FD_READ event
According to the documentation this should never happen but apparently
does under certain circumstances. As the sockets are set non-blocking,
trying to read from them regardless should not cause any problems.

In all cases that were observed so far, the socket in question actually
has a packet queued up for reading.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/4748>
2023-05-31 13:11:39 +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
Matthew Waters 74f914077d qt6/glrenderer: don't attempt to use QWindow from non-Qt main thread
Use QObject::deleteLater() to schedule deletion in the main thread.

Remove the moveToThread of the QWindow.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/4728>
2023-05-31 02:10:26 +00:00
Matthew Waters c64efe494d qt/glrenderer: don't attempt to use QWindow from non-Qt main thread
Use QObject::deleteLater() to schedule deletion in the main thread.

Remove the moveToThread of the QWindow.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/4728>
2023-05-31 02:10:26 +00:00
Thibault Saunier 5bb0e374ce ges: tests: Use assert_equals_int where it makes sense
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/4732>
2023-05-30 22:37:32 +00:00
Thibault Saunier 3bb03179c9 ges: launcher: Never put sinks in a GstPipeline
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/4732>
2023-05-30 22:37:32 +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
Jan Alexander Steffens (heftig) 4008b872bb fdkaacdec: Support up to 5 rear channels
The `switch (n_rear)` supports up to 5 rear channels, but our channel
set only had space for 3. Size the set properly to fix this.

This didn't actually cause any memory unsafety as `PUSH_CHAN` would stop
incrementing `n_rear` if the channel set is already full.

Thanks to @alatiera for noticing this.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/4712>
2023-05-30 14:18:08 +02:00
Hyung Song d68a7fbd94 aacparse: parse GASpecificConfig for channels
Some media have valid channel information in GASpecificConfig which is
not yet implemented in gstaacparse. Parse data according to ISO/IEC
14496-3 just enough to get channels.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/4720>
2023-05-30 09:09:16 +00:00
Guillaume Desmottes 0fd3c28620 flvmux: push metadata on caps change
The metdata contains tags but also caps dependent info such as the
resolution and the framerate.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/4730>
2023-05-30 09:35:43 +02:00
Guillaume Desmottes 3ae2904f3d flvmux: rename 'new_tags' to 'new_metadata'
The metadata contains more than just tags: resolution, framerate, etc.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/4730>
2023-05-30 08:27:18 +02:00
Guillaume Desmottes 853fad001e flvmux: add some logs when input is changing
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/4730>
2023-05-30 08:27:18 +02:00
Tim-Philipp Müller 0cd1a57b0e orc: update subproject wrap to 0.4.34
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/4736>
2023-05-30 01:21:20 +00:00
Tim-Philipp Müller 81174152aa gst-python: add proper README and delete useless placeholder files
Fixes https://gitlab.freedesktop.org/gstreamer/gst-python/-/issues/54

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/4693>
2023-05-29 23:46:49 +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
Michael Olbrich 2197cdc289 flvmux: use the correct timestamp to calculate wait times
Since c0bf793c05 ("flvmux: Set PTS based on
running time") the timestamp of the output buffer is already in running
time. So using that for 'srcpad->segment.position' does not work correctly
because gst_aggregator_simple_get_next_time() will convert it again with
gst_segment_to_running_time().
This means that the timestamp returned by
gst_aggregator_simple_get_next_time() may be incorrect. For example, if
flvmux is added to a already runinng pipeline then the timestamp is too
small and gst_aggregator_wait_and_check() returns immediately. As a result,
buffers may be muxed in the wrong order.

To fix this, use the PTS of the incoming buffer instead of the outgoing
buffer. Also add the duration as get_next_time() is supposed to return the
timestamp of the next buffer, not the current one.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/4701>
2023-05-29 14:56:13 +00:00
Mengkejiergeli Ba a15a16c99b msdkenc: Add a property to insert pic timing SEI for avc and hevc
User can decide whether to insert pic timing sei with pic_struct
syntax via oneVPL API mfxExtCodingOption.PicTimingSEI.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/4673>
2023-05-29 02:11:20 +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
Tim-Philipp Müller 26a451b59d docs: contributing: mention user verification to get forking rights
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/4708>
2023-05-26 23:24:16 +00:00
Jordan Petridis 6032f51162 openjpegenc: do not set bpp field on opj_image_cmptparm_t
It's deprecated in favor of the .prec field which we already set.

https://github.com/uclouvain/openjpeg/pull/1383/

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/4715>
2023-05-26 20:24:27 +00:00
Víctor Manuel Jáquez Leal 8b75e5fb57 vkvideoutils: fix code-style
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/4716>
2023-05-26 10:08:27 +02:00
Víctor Manuel Jáquez Leal b982fae9c7 tests: check if vulkan h264 decoding is supported
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/4716>
2023-05-26 10:08:27 +02:00
Víctor Manuel Jáquez Leal 365454790a vkphysicaldevice: fetch queue family query result support
And merged in a single structure the queue family operations report.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/4716>
2023-05-26 10:08:27 +02:00
Víctor Manuel Jáquez Leal e2a40c58bf vkimagebufferpool: chain the correct structure
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/4716>
2023-05-26 09:45:07 +02:00
Víctor Manuel Jáquez Leal e9414b9582 vkvideoutils: fix bug for chroma string comparison
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/4716>
2023-05-26 09:45:07 +02: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
Michael Olbrich 285811e7a7 jpegdec: be stricter when detecting interlaced video
There are broken(?) mjpeg videos that are incorrectly detected as
interlaced. This happens because 'info.height > height' (e.g. 1088 > 1080).

In the interlaced case info.height is approximately 'height * 2' but not
exactly because height is a multiple of DCTSIZE. Make the check more
restrictive but take the rounding effect into account.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/4696>
2023-05-25 18:34:34 +00:00
Michael Olbrich 59290feca4 jpegdec: decode the correct number of lines for interlaced frames
For interlaced jpeg, gst_jpeg_dec_decode_direct() is called twice, once for each
field. In this case, stride[n] is plane_stride[n] * 2 to ensure that only every
other line is written. So the loop must stop at height / num_fields.

If the frame is really interlaced then continuing beyound this, is not harmful,
because jpeg_read_raw_data() will do nothing and return 0, so am info message is
printed.

However, if the frame is not actually interlaced, just misdetected as interlaced
then there is still data available from the second half of the frame. Now
line[0][j] is set to the scratch buffer. If the scratch buffer is not allocated
(because the height is a multiple of v_samp[0] * DCTSIZE) then the result is a
segfault due to a null-pointer dereference.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/4696>
2023-05-25 18:34:34 +00:00
Mathieu Duponchelle 2b4dca84dd gst-python: overrides: provide default to Gst.init()
Allows using Gst.init() as without the overrides, can be convenient.

Fixes: https://gitlab.freedesktop.org/gstreamer/gst-python/-/issues/51
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/4692>
2023-05-25 16:32:44 +00:00
Tim-Philipp Müller e6d512a3b5 validate: remove known issue for mxfdemux that's fixed now
https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/issues/1020

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/4659>
2023-05-25 16:07:26 +00:00
Tim-Philipp Müller 7ad92c364a testsuites: remove wontfix issues for legacy HLS elements
Chances that will ever get fixed are about zero, so there's
no point leaving these issues open.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/4659>
2023-05-25 16:07:26 +00:00
Seungha Yang 8e1677bd6a d3d11videosink: Fix error on pause and play
The show_frame() can be called without prepare() call on paused to
playing state change. Thus the prepared buffer should not be cleared
on show_frame()

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/4700>
2023-05-25 13:24:43 +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
Sebastian Dröge fa8fbab0f7 ptp: Parse PTP messages in the helper process and filter earlier
This drops invalid, unknown or uninteresting PTP messages in the helper
process already instead of forwarding them to the main process.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/4665>
2023-05-24 14:16:23 +00:00
Sebastian Dröge 61a6b79e62 ptp: Ignore DELAY_RESP messages not for us earlier in the main process
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/4665>
2023-05-24 14:16:23 +00:00
Sebastian Dröge 5a79d230ce ptp: Set UDP sockets as non-blocking
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/4665>
2023-05-24 14:16:23 +00:00
Sebastian Dröge b76f9c8392 ptp: Capture actual send/receive times in the helper process
While this doesn't yet use any OS provided times from the actual network
stack, this still gets rid of any IPC jitter between the helper process
and the main process as part of the PTP time calculations and should
improve accuracy.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/4665>
2023-05-24 14:16:23 +00:00
YURI FEDOSEEV 8dd51501d0 v4l2videoenc: support force keyframe event in v4l2 encoder
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/4663>
2023-05-24 12:42:24 +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
Tim-Philipp Müller f58416b1a4 docs: tutorials: fix 0.10-isms in "Shortcutting the pipeline"
GST_BUFFER_DATA and GST_BUFFER_SIZE are no more.

https://gitlab.freedesktop.org/gstreamer/gst-docs/-/merge_requests/121

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/4691>
2023-05-23 23:48:27 +00:00
Michael Bunk dc64f3e6cf docs: fix typos and grammar
https://gitlab.freedesktop.org/gstreamer/gst-docs/-/merge_requests/50

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/4690>
2023-05-23 23:36:49 +00:00
Vivia Nikolaidou 1781b26ad2 tsmux.h: Remove TSMUX_MAX_ES_INFO_LENGTH dead code
Also TsMux.es_info_buf which was also not used anywhere

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/4681>
2023-05-23 14:00:11 +00:00
Vivia Nikolaidou 9e84b737cb tsmux: Separate DVB and ATSC AC3 descriptors
The previous code was ATSC-specific. Separated it into gstatscmux.c and
added the DVB-specific one from ETSI EN 300 468 V1.11.1 (2010-04)

https://www.etsi.org/deliver/etsi_en/300400_300499/300468/01.11.01_60/en_300468v011101p.pdf

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/4681>
2023-05-23 14:00:11 +00:00
Vivia Nikolaidou 866d5d87c4 tsmux: Refactor AC3 descriptor to use GstByteWriter
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/4681>
2023-05-23 14:00:11 +00:00
Vivia Nikolaidou 637e263504 tsmux: Parse bitrate from tags into the stream
Instead of parsing a hardcoded zero and always writing the highest
limit.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/4681>
2023-05-23 14:00:11 +00:00
Vivia Nikolaidou 7a98a4214b tsmux: Fix 0x81 descriptor for AC3 streams
According to ATSCA/52:2018

https://prdatsc.wpenginepowered.com/wp-content/uploads/2021/04/A52-2018.pdf

Used wireshark as ground truth for detection/parsing.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/4681>
2023-05-23 14:00:11 +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
Sebastian Dröge c52212604e gst: clock: Clean up code to get the monotonic / realtime clock a bit
On Windows and macOS always use the proper monotonic clock, including
for gst_util_get_timestamp(), and initialize its state only once.

Also on macOS use clock_gettime() for the realtime clock, if available
instead of always falling back to GLib.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/4658>
2023-05-22 11:48:27 +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
Seungha Yang f435d192e1 d3d11videosink: Don't use CS_OWNDC style
It's completely unnecessary since we never use
the device context (e.g., BeginPaint() or GetDC() never called).

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/4684>
2023-05-20 03:16:47 +00:00
Shengqi Yu b092c3f580 h264parse: adjust some logs printing level in h264parse
adjust log level from GST_ERROR to GST_WARNING when h264 caps have
codec_data but no avc format or have no codec data or stream-format.
Because theses are not real errors, it is easy to mislead if print error
logs.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/4675>
2023-05-20 02:07:36 +00:00
Nicolas Dufresne 0c9ab49579 v4l2: videodec: Fix stalls on empty buffer
Drivers may signal end of sequence using an empty buffer and LAST buffer
set, or just an empty buffer on certain legacy implementation. When this
occured, we'd send GST_V4L2_FLOW_LAST_BUFFER were the code expected
GST_FLOW_EOS. Stop abusing GST_FLOW_EOS and port all the code to the new
GST_V4L2_FLOW_LAST_BUFFER.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/4669>
2023-05-19 23:06:06 +00:00