platform/upstream/gstreamer.git
2 years agohlsdemux2: Fix position tracking
Edward Hervey [Tue, 17 May 2022 05:16:48 +0000 (07:16 +0200)]
hlsdemux2: Fix position tracking

Remove the "pending advance" hack and instead rely on the base stream current
position to track our position (instead of a potentially NULL "current
segment").

Also ensure the media playlists are always refreshed with valid stream time,
even if there is no current segment.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/2679>

2 years agohlsdemux2: Add a new method to synchronize two media playlist
Edward Hervey [Tue, 17 May 2022 05:11:17 +0000 (07:11 +0200)]
hlsdemux2: Add a new method to synchronize two media playlist

This allows transfering the stream time of the playlist to an updated
variant/rendition.

This allows updating that information without having a "current segment"

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/2679>

2 years agoadaptivedemux2: Initialize and use stream start/current position
Edward Hervey [Tue, 17 May 2022 05:07:23 +0000 (07:07 +0200)]
adaptivedemux2: Initialize and use stream start/current position

The stream start and current position would be properly set when seeking or
activating a stream after playback started. But it would never be properly
initialized.

Set it to NONE initially to indicate to subclasses that no position has been
tracked yet. This will allow them to detect initial stream usage.

Futhermore, once the initial streams setup is done, make sure that it is set to
a valid initial value:
* The minimum stream time in live
* Or else the period start

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/2679>

2 years agov4l2videodec: Fix activation of internal pool
Nicolas Dufresne [Thu, 19 May 2022 19:51:03 +0000 (15:51 -0400)]
v4l2videodec: Fix activation of internal pool

If the driver does not support VIDIOC_CREATE_BUFS ioctl, the pool
configuration may get changed, which requires a validation. This would
fail to activate a pool in a case it shouldn't normally fail unless we
are out of memory.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/2456>

2 years agodv, opusparse: fix duplicate symbols in static build
Tim-Philipp Müller [Tue, 28 Jun 2022 00:29:06 +0000 (01:29 +0100)]
dv, opusparse: fix duplicate symbols in static build

Fixes https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/issues/1262

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/2670>

2 years agod3d11: Enumerate devices via native DXGI API
Seungha Yang [Sun, 26 Jun 2022 19:07:04 +0000 (04:07 +0900)]
d3d11: Enumerate devices via native DXGI API

D3D11CreateDevice() can fail for some reason (e.g., buggy GPU driver)
and then gst_d3d11_device_new() will return nullptr.
Use DXGI API directly instead of relying on the gst_d3d11_device_new()

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/2663>

2 years agoexamples: Add an example for application texture sharing
Seungha Yang [Fri, 24 Jun 2022 16:15:17 +0000 (01:15 +0900)]
examples: Add an example for application texture sharing

This example shows GstD3D11BufferPool usage and a way of
D3D11 texture sharing between application and GStreamer via appsrc.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/2646>

2 years agoexamples: Add d3d11decoder zero-copy rendering example
Seungha Yang [Thu, 23 Jun 2022 22:06:00 +0000 (07:06 +0900)]
examples: Add d3d11decoder zero-copy rendering example

This example code demonstrates D3D11 device sharing between
application and GStreamer. Application can access texture
using appsink and it can be rendered on application's window without
any copy operation.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/2646>

2 years agod3d11: Add a helper method for GstContext creation
Seungha Yang [Fri, 24 Jun 2022 13:17:28 +0000 (22:17 +0900)]
d3d11: Add a helper method for GstContext creation

Add gst_d3d11_context_new() method for application to create
GstContext using GstD3D11Device.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/2646>

2 years agod3d11memory: Add support for wrapping application texture
Seungha Yang [Thu, 23 Jun 2022 16:00:00 +0000 (01:00 +0900)]
d3d11memory: Add support for wrapping application texture

Add gst_d3d11_allocator_alloc_wrapped() method to support wrapping
application texture using GstD3D11Memory without copy.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/2646>

2 years agod3d11: Install library headers
Seungha Yang [Thu, 23 Jun 2022 16:25:07 +0000 (01:25 +0900)]
d3d11: Install library headers

Our Direct3D11 abstraction layer has been improved and
it gained good shape from API point of view.
Also, On Windows, GstD3D11 has various advantages over GstGL
in terms of compatibility/stability/feature/performance.
Note that WGL implementation is known to be buggy for some
drivers/vendors/scenario (that's a reason why Google implemented ANGLE).
Moreover, GstGL is not fully optimized for Windows unfortunately.

It's the time to open this interface to application developers
for various optimized processing using our Direct3D11
infrastructure.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/2646>

2 years agod3d11: Update gst_d3d11_allocation_params_new() interface
Seungha Yang [Thu, 23 Jun 2022 16:21:48 +0000 (01:21 +0900)]
d3d11: Update gst_d3d11_allocation_params_new() interface

Define GST_D3D11_ALLOCATION_FLAG_DEFAULT (0) value instead of
casting enum type everywhere. And pass D3D11_RESOURCE_MISC_FLAG value

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/2646>

2 years agova: postproc: add scale-method property
U. Artie Eoff [Mon, 27 Jun 2022 16:06:50 +0000 (12:06 -0400)]
va: postproc: add scale-method property

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/2654>

2 years agova: filter/postproc: move unconditional props to vavpp
U. Artie Eoff [Mon, 27 Jun 2022 15:54:28 +0000 (11:54 -0400)]
va: filter/postproc: move unconditional props to vavpp

Only conditional/dynamic properties should be installed/handled
by vafilter.  Thus, move and install the unconditional/static
properties in vavpp.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/2654>

2 years agova: compositor/filter: use scale method setter
U. Artie Eoff [Thu, 23 Jun 2022 15:39:57 +0000 (11:39 -0400)]
va: compositor/filter: use scale method setter

Use the filter's scale method member instead of the sample's member.

Removes the filter_flags member from the composite sample.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/2654>

2 years agova: filter: add scale method field and setter
U. Artie Eoff [Thu, 23 Jun 2022 15:11:16 +0000 (11:11 -0400)]
va: filter: add scale method field and setter

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/2654>

2 years agova: Add vajpegdec element.
Víctor Manuel Jáquez Leal [Fri, 21 Jan 2022 20:33:52 +0000 (21:33 +0100)]
va: Add vajpegdec element.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/1575>

2 years agova: allocator: Add hack for no fourcc when surface creation.
Víctor Manuel Jáquez Leal [Fri, 24 Jun 2022 17:42:36 +0000 (19:42 +0200)]
va: allocator: Add hack for no fourcc when surface creation.

This patch adds general mechanism for handling specific hacks. In this
case for jpeg decoder in i965 driver, which cannot create surfaces
with fourcc specified.

From jpeg decoder to the allocator, which creates the surfaces,
there's a non-simple path: basedec pseudo-class adds a hacks guint32
which will be set by actual elements (vajpegdec, in this case) and
basedec will always set the hack to the allocator when the allocator
is instantiated.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/1575>

2 years agova: Add RGBP format definition.
Víctor Manuel Jáquez Leal [Fri, 24 Jun 2022 17:54:51 +0000 (19:54 +0200)]
va: Add RGBP format definition.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/1575>

2 years agova: caps: Add jpeg fields in coded caps.
Víctor Manuel Jáquez Leal [Thu, 28 Apr 2022 11:16:03 +0000 (13:16 +0200)]
va: caps: Add jpeg fields in coded caps.

Given the supported rt formats in a profile/entrypoint config it's
possible to know the supported JPEG colorspace and subsampling. This
patch adds this information in coded caps to a safer autoplugging
after jpegparser.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/1575>

2 years agova: Add jpegdecoder base class.
Víctor Manuel Jáquez Leal [Mon, 17 Jan 2022 14:43:47 +0000 (15:43 +0100)]
va: Add jpegdecoder base class.

This base class is intented for hardware accelerated decoders, but since
only VA uses it, it will be kept internally in va plugin.

It follows the same logic as the others video decoders in the library but.
as JPEG are independet images, there's no need to handle a DBP so no need
of a picture object. Instead a scan object is added with all the structures
required to decode the image (huffman and quant tables, mcus, etc.).

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/1575>

2 years agova: build: Remove duplicated source.
Víctor Manuel Jáquez Leal [Mon, 27 Jun 2022 10:36:29 +0000 (12:36 +0200)]
va: build: Remove duplicated source.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/1575>

2 years agocudamemorycopy: Make sure writable caps before removing fields
Seungha Yang [Mon, 27 Jun 2022 10:58:58 +0000 (19:58 +0900)]
cudamemorycopy: Make sure writable caps before removing fields

The caps to be modified may not be writable when D3D11/GL/NVMM
are all disabled.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/2664>

2 years agotests: skip unit tests for dependency-less elements that have been disabled
Tim-Philipp Müller [Sat, 25 Jun 2022 18:50:10 +0000 (19:50 +0100)]
tests: skip unit tests for dependency-less elements that have been disabled

Fixes https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/issues/1136

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/2660>

2 years agoexamples: don't try and build jack examples if jack was disabled
Tim-Philipp Müller [Fri, 24 Jun 2022 11:10:02 +0000 (12:10 +0100)]
examples: don't try and build jack examples if jack was disabled

Fixes meson build ERROR: Unknown variable "libjack_dep".

Fixes #1301

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/2656>

2 years agova: allocator: Use always lseek to get dmabuf size.
Víctor Manuel Jáquez Leal [Thu, 23 Jun 2022 12:31:10 +0000 (14:31 +0200)]
va: allocator: Use always lseek to get dmabuf size.

Gallium drivers historically have reported strange dmabuf sizes, from always
zero to the whole frame (multiple fds). The simplest solution is to use lseek
SEEK_END to get the prime descriptor size.

Also the allocator raises a warning if both values differ in order to report
it to driver.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/2574>

2 years agova: allocator: Fix translation of VADRMPRIMESurfaceDescriptor
Nicolas Dufresne [Wed, 8 Jun 2022 13:02:52 +0000 (09:02 -0400)]
va: allocator: Fix translation of VADRMPRIMESurfaceDescriptor

VADRMPRIMESurfaceDescriptor structure describes the offsets from the
point of view of the specific handle (DMABuf). While GstVideoInfo
(and the meta) describes offsets from the point of the view of the
GstBuffer, an aggregate of all the GstMemory (1 per handle).

This changes combined with [Mesa Fix](https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/16813)
fixes decoding failure with AMD driver.

Fixes #1223

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/2574>

2 years agod3d11: Revert staging buffer pool implementation
Seungha Yang [Thu, 23 Jun 2022 12:43:11 +0000 (21:43 +0900)]
d3d11: Revert staging buffer pool implementation

The staging buffer pool implementation was added to improve
throughput performance since we can avoid per-frame
CPU copy operation via staging texture but it turned out that
we can not make it thread safe. See
https://gitlab.freedesktop.org/gstreamer/gstreamer/-/issues/1182

Reverting the staging texture implementation as it does not show
any visible value.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/2651>

2 years agoqsvdecoder: Fix system memory alignment
Seungha Yang [Thu, 23 Jun 2022 12:35:23 +0000 (21:35 +0900)]
qsvdecoder: Fix system memory alignment

Do right padding, not left

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/2651>

2 years agod3d11decoder: Fix texture download
Seungha Yang [Thu, 23 Jun 2022 12:41:24 +0000 (21:41 +0900)]
d3d11decoder: Fix texture download

Stride applied to src/dst was reversed

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/2651>

2 years agojpegparse: Add YUV440 sampling support.
Víctor Manuel Jáquez Leal [Thu, 16 Jun 2022 15:02:43 +0000 (17:02 +0200)]
jpegparse: Add YUV440 sampling support.

Found some samples with this sampling, so in order to support it,
JPEG2000 header cannot be used anymore, a this patch also adds the
enums for each supported colorspace and sampling, avoiding hacks.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/2641>

2 years agogst: add missing define guard
Jonas Danielsson [Wed, 22 Jun 2022 07:43:02 +0000 (09:43 +0200)]
gst: add missing define guard

If compiled with -Dgstreamer:gst_debug=false and we have
GST_REMOVE_DISABLED defined we will get the following compiler error:

```
[...]/libgstreamer-1.0.so.0.2100.0.p/gst.c.o: in function `gst_deinit':
[...]/gst/gst.c:1258: undefined reference to `_priv_gst_debug_cleanup'
[...] hidden symbol `_priv_gst_debug_cleanup' isn't defined
```

Add the missing define guard to avoid this.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/2648>

2 years agova: Use driver implementation macro rather than function.
Víctor Manuel Jáquez Leal [Thu, 16 Jun 2022 14:33:14 +0000 (16:33 +0200)]
va: Use driver implementation macro rather than function.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/2642>

2 years agobin: Fix race conditions in tests
Sebastian Dröge [Tue, 21 Jun 2022 08:51:35 +0000 (11:51 +0300)]
bin: Fix race conditions in tests

The latency messages are non-deterministic and can arrive before/after
async-done or during state-changes as they are posted by e.g. sinks from
their streaming thread but bins are finishing asynchronous state changes
from a secondary helper thread.

To solve this, expect latency messages at any time and assert that we
receive one at some point during the test.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/2643>

2 years agoh265parse: Fix uninitialized width and height when update src caps.
He Junyan [Sat, 18 Jun 2022 02:36:53 +0000 (10:36 +0800)]
h265parse: Fix uninitialized width and height when update src caps.

The commit b90d0274 introduces uninitialized width and height when we
consider to change the "pixel-aspect-ratio" for some interlaced stream.
We need to check the resolution in the src caps, and if no resolution
info found, there is no need to consider the aspect ratio.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/2630>

2 years agod3d11: Fix some typos
Seungha Yang [Tue, 21 Jun 2022 11:04:15 +0000 (20:04 +0900)]
d3d11: Fix some typos

Fix up spelling and d3d11testsrc class meta.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/2644>

2 years agoelement: Fix requesting of pads with string templates
Sebastian Dröge [Mon, 20 Jun 2022 13:45:19 +0000 (16:45 +0300)]
element: Fix requesting of pads with string templates

Previously it was only possible to request them with the exact template
name, e.g. 'src_%s', but not with "instantiated" names that would match
this template, e.g.'src_foo_bar'.

This is now possible and a test was added for this, in addition to
fixing a previously invalid test.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/2635>

2 years agod3d11compositor: Performance optimization
Seungha Yang [Sat, 18 Jun 2022 11:14:22 +0000 (20:14 +0900)]
d3d11compositor: Performance optimization

Removing glvideomixer-like nuance (it was initially referenced)
and rewriting element since it's not an optimal design at all
from performance point of view.

* Remove wrapper bin (and internal conversion/upload/download elements)
  which will waste CPU/GPU resources. Conversion/blending can be done by the
  d3d11compositor element at once.
* Add support YUV blending without RGB conversion.
  The RGB <-> YUV conversion is completely unnecessary since YUV textures
  support blending as well.
* Remove complicated blending operation properties since it's hard
  to use from application point of view. Instead, adding "operator" property
  like what compositor element does.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/2631>

2 years agod3d11converter: Fix alpha factor update
Seungha Yang [Sat, 18 Jun 2022 11:40:40 +0000 (20:40 +0900)]
d3d11converter: Fix alpha factor update

converter should set entire constant buffer values since it's mapped
with write-discard flag

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/2631>

2 years agogstwaylandsink: Add rotate-method property
Robert Mader [Thu, 2 Jun 2022 12:22:21 +0000 (14:22 +0200)]
gstwaylandsink: Add rotate-method property

Similar to and inspired by glimagesink and gtkglsink.

Using the Wayland buffer transform API allows to offload
rotate operations to the Wayland compositor. This can have
several advantages:
 - The Wayland compositor may be able to use hardware plane
   capabilities to do the rotation.
 - In case of pre-rotated content on rotated outputs the
   rotations may equal out, potentially allowing the
   compositor to use hardware planes even if they don't
   support rotate operations.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/2543>

2 years agoAdd GstMemoryMapInfo to be used with g_auto()
Xavier Claessens [Tue, 17 May 2022 17:18:28 +0000 (10:18 -0700)]
Add GstMemoryMapInfo to be used with g_auto()

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/2412>

2 years agoGstVideoFrame: Add g_auto() support
Xavier Claessens [Fri, 13 May 2022 16:57:06 +0000 (12:57 -0400)]
GstVideoFrame: Add g_auto() support

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/2412>

2 years agoAdd GstBufferMapInfo to be used with g_auto()
Xavier Claessens [Fri, 13 May 2022 15:51:09 +0000 (11:51 -0400)]
Add GstBufferMapInfo to be used with g_auto()

We need a separate typedef for this feature because GstMapInfo itself
can be initialized by gst_memory_map() in which case info.memory should
not be unreffed.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/2412>

2 years agogst-inspect: Fix inspection of third-party plugins
Philippe Normand [Mon, 20 Jun 2022 14:29:21 +0000 (15:29 +0100)]
gst-inspect: Fix inspection of third-party plugins

Since commit de57657de1d1916503b4ad451ac13a3e191465f8 inspecting a third-party
plugin would trigger a segfault (Address boundary error) due to the missing
sentinel in the list of GStreamer modules.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/2636>

2 years agod3d11decoder: Check 16K resolution support
Seungha Yang [Fri, 17 Jun 2022 19:05:53 +0000 (04:05 +0900)]
d3d11decoder: Check 16K resolution support

16K decoding is supported by some GPUs

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/2629>

2 years agoges/gstframepositioner: don't create one compositor per frame meta
Mathieu Duponchelle [Thu, 16 Jun 2022 20:40:21 +0000 (22:40 +0200)]
ges/gstframepositioner: don't create one compositor per frame meta

Instead, cache the looked up operator property

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/2623>

2 years agod3d11decoder: Add support for non-zero crop-{x,y} position
Seungha Yang [Thu, 16 Jun 2022 20:11:08 +0000 (05:11 +0900)]
d3d11decoder: Add support for non-zero crop-{x,y} position

AVC and HEVC define crop rectangle and the x/y coordinates might
not be zero. This commit will address the non-zero x/y offset coordinates
via GstVideoCropMeta if downstream supports the meta and d3d11 memory.
Otherwise decoder will copy decoded texture into output frame.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/2624>

2 years agod3d11converter: Implement filling border color
Seungha Yang [Thu, 16 Jun 2022 17:45:51 +0000 (02:45 +0900)]
d3d11converter: Implement filling border color

Equivalent to GST_VIDEO_CONVERTER_OPT_BORDER_ARGB and
GST_VIDEO_CONVERTER_OPT_FILL_BORDER options of GstVideoConverter

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/2622>

2 years agod3d11converter: Objectify converter
Seungha Yang [Wed, 15 Jun 2022 17:18:43 +0000 (02:18 +0900)]
d3d11converter: Objectify converter

... and set conversion options via property

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/2622>

2 years agod3d11shader: Remove GstD3D11Quad helper object
Seungha Yang [Wed, 15 Jun 2022 15:52:16 +0000 (00:52 +0900)]
d3d11shader: Remove GstD3D11Quad helper object

It's not very generic to be used for various scenario. Use native D3D11
APIs directly instead.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/2622>

2 years agod3d11compositor: Don't use GstD3D11Quad
Seungha Yang [Wed, 15 Jun 2022 15:50:12 +0000 (00:50 +0900)]
d3d11compositor: Don't use GstD3D11Quad

The helper object will be removed

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/2622>

2 years agod3d11overlaycompositor: Fix HLSL compiler warning
Seungha Yang [Wed, 15 Jun 2022 14:46:27 +0000 (23:46 +0900)]
d3d11overlaycompositor: Fix HLSL compiler warning

warning X3206: 'Sample': implicit truncation of vector type

And don't use GstD3D11Quad since it will result in redundant API calls

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/2622>

2 years agocccombiner: expose output-padding property
Mathieu Duponchelle [Tue, 1 Feb 2022 22:46:43 +0000 (23:46 +0100)]
cccombiner: expose output-padding property

When schedule=true and output-padding=false, cccombiner will not
inject padding in the output closed caption meta stream.

The property has no effect when schedule=false.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/1621>

2 years agortpsession: properly initialise favor-new property
Marc Leeman [Fri, 17 Jun 2022 12:02:54 +0000 (14:02 +0200)]
rtpsession: properly initialise favor-new property

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/2625>

2 years agohlsdemux2: Look for mpegts synchronization point further
Edward Hervey [Fri, 27 May 2022 09:20:06 +0000 (11:20 +0200)]
hlsdemux2: Look for mpegts synchronization point further

Some mpeg-ts streams have extra data at the beginning. While it's not ideal, we
should be able to cope with it.

Therefore increase the initial search window for at least 4 consecutive
synchronization points to 1kB.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/2626>

2 years agowebrtcbin: Limit sink query to sink pads
Olivier Crête [Wed, 15 Jun 2022 19:06:20 +0000 (15:06 -0400)]
webrtcbin: Limit sink query to sink pads

This allows the reception of streams that don't exactly match
the codec preferences. In particular, the ssrc in the codec preferences
is local sender SSRC, the other side is expected to send a different SSRC.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/2615>

2 years agoavviddec, video.c, h265parse: Workaround for broken field-based interlaced encoders
Vivia Nikolaidou [Wed, 8 Jun 2022 16:18:48 +0000 (19:18 +0300)]
avviddec, video.c, h265parse: Workaround for broken field-based interlaced encoders

Some encoders (e.g. Makito) have H265 field-based interlacing, but then
also specify an 1:2 pixel aspect ratio. That makes it kind-of work with
decoders that don't properly support field-based decoding, but makes us
end up with the wrong aspect ratio if we implement everything properly.
As a workaround, detect 1:2 pixel aspect ratio for field-based
interlacing, and check if making that 1:1 would make the new display
aspect ratio common. In that case, we override it with 1:1.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/2577>

2 years agogst-env.py: drop 'gst-' prefix from branch name in prompt
Tim-Philipp Müller [Tue, 14 Jun 2022 10:37:13 +0000 (11:37 +0100)]
gst-env.py: drop 'gst-' prefix from branch name in prompt

Probably leftover from the days where we would have a gst-foo.sh
script to set up the devenv for a particular checkout/branch.

Kind of confusing now if you're working on a named branch and
it just adds an extra gst- prefix in the prompt.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/2594>

2 years agodocs: ensure coretracers plugin index page is index.html
Tim-Philipp Müller [Tue, 14 Jun 2022 15:30:08 +0000 (16:30 +0100)]
docs: ensure coretracers plugin index page is index.html

And not blank.html

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/2592>

2 years agodocs: make sure rtspclientsink plugin docs index page is called index.html
Tim-Philipp Müller [Tue, 14 Jun 2022 15:18:35 +0000 (16:18 +0100)]
docs: make sure rtspclientsink plugin docs index page is called index.html

.. instead of plugin-index.html.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/2592>

2 years agogst-inspect: print link to documentation for gstreamer elements
Tim-Philipp Müller [Sun, 12 Jun 2022 22:28:21 +0000 (23:28 +0100)]
gst-inspect: print link to documentation for gstreamer elements

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/2592>

2 years agosrtsrc: add "keep-listening" property to avoid EOS on disconnect
Stéphane Cerveau [Wed, 19 May 2021 14:03:22 +0000 (16:03 +0200)]
srtsrc: add "keep-listening" property to avoid EOS on disconnect

The property 'keep-listening' avoids EOS
when the remote client disconnects.

It can be useful to a keep a pipeline alive
when the srt connection drops remotely.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/967>

2 years agosrtsrc: remove dead code
Stéphane Cerveau [Wed, 19 May 2021 14:00:13 +0000 (16:00 +0200)]
srtsrc: remove dead code

Remove code useless since
132e3a1af9deb1d2cdf84d22b954967207bcc03a

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/967>

2 years agoqsvh264dec: Use newly added avcC data parsing API
Seungha Yang [Wed, 18 May 2022 20:24:08 +0000 (05:24 +0900)]
qsvh264dec: Use newly added avcC data parsing API

Use gst_h264_parser_parse_decoder_config_record() method to parse
codec_data.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/2449>

2 years agoh264parse: Use newly added avcC data parsing API
Seungha Yang [Wed, 18 May 2022 20:06:04 +0000 (05:06 +0900)]
h264parse: Use newly added avcC data parsing API

Use gst_h264_parser_parse_decoder_config_record() method to parse
codec_data.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/2449>

2 years agoh264decoder: Use newly added avcC data parsing API
Seungha Yang [Wed, 18 May 2022 19:49:36 +0000 (04:49 +0900)]
h264decoder: Use newly added avcC data parsing API

Use gst_h264_parser_parse_decoder_config_record() method to parse
codec_data.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/2449>

2 years agoh264parser: Add an API for AVCDecoderConfigurationRecord parsing
Seungha Yang [Wed, 18 May 2022 19:25:38 +0000 (04:25 +0900)]
h264parser: Add an API for AVCDecoderConfigurationRecord parsing

Add a method for AVC configuration date parsing

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/2449>

2 years agomatroskademux: Avoid integer-overflow resulting in heap corruption in WavPack header...
Sebastian Dröge [Wed, 18 May 2022 07:23:15 +0000 (10:23 +0300)]
matroskademux: Avoid integer-overflow resulting in heap corruption in WavPack header handling code

blocksize + WAVPACK4_HEADER_SIZE might overflow gsize, which then
results in allocating a very small buffer. Into that buffer blocksize
data is memcpy'd later which then causes out of bound writes and can
potentially lead to anything from crashes to remote code execution.

Thanks to Adam Doupe for analyzing and reporting the issue.

CVE: CVE-2022-1920

https://gstreamer.freedesktop.org/security/sa-2022-0004.html

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

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/2612>

2 years agoqtdemux: Fix integer overflows in zlib decompression code
Sebastian Dröge [Mon, 30 May 2022 07:15:37 +0000 (10:15 +0300)]
qtdemux: Fix integer overflows in zlib decompression code

Various variables were of smaller types than needed and there were no
checks for any overflows when doing additions on the sizes. This is all
checked now.

In addition the size of the decompressed data is limited to 200MB now as
any larger sizes are likely pathological and we can avoid out of memory
situations in many cases like this.

Also fix a bug where the available output size on the next iteration in
the zlib decompression code was provided too large and could
potentially lead to out of bound writes.

Thanks to Adam Doupe for analyzing and reporting the issue.

CVE: tbd

https://gstreamer.freedesktop.org/security/sa-2022-0003.html

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

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/2610>

2 years agomatroskademux: Fix integer overflows in zlib/bz2/etc decompression code
Sebastian Dröge [Wed, 18 May 2022 08:24:37 +0000 (11:24 +0300)]
matroskademux: Fix integer overflows in zlib/bz2/etc decompression code

Various variables were of smaller types than needed and there were no
checks for any overflows when doing additions on the sizes. This is all
checked now.

In addition the size of the decompressed data is limited to 120MB now as
any larger sizes are likely pathological and we can avoid out of memory
situations in many cases like this.

Also fix a bug where the available output size on the next iteration in
the zlib/bz2 decompression code was provided too large and could
potentially lead to out of bound writes.

Thanks to Adam Doupe for analyzing and reporting the issue.

CVE: CVE-2022-1922, CVE-2022-1923, CVE-2022-1924, CVE-2022-1925

https://gstreamer.freedesktop.org/security/sa-2022-0002.html

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

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/2610>

2 years agoavidemux: Fix integer overflow resulting in heap corruption in DIB buffer inversion...
Sebastian Dröge [Wed, 18 May 2022 09:00:48 +0000 (12:00 +0300)]
avidemux: Fix integer overflow resulting in heap corruption in DIB buffer inversion code

Check that width*bpp/8 doesn't overflow a guint and also that
height*stride fits into the provided buffer without overflowing.

Thanks to Adam Doupe for analyzing and reporting the issue.

CVE: CVE-2022-1921

See https://gstreamer.freedesktop.org/security/sa-2022-0001.html

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

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/2608>

2 years agoqueuearray: Fix potential heap overflow when expanding GstQueueArray
Adam Doupe [Thu, 19 May 2022 04:59:58 +0000 (04:59 +0000)]
queuearray: Fix potential heap overflow when expanding GstQueueArray

Check that elt_size*newsize doesn't overflow when expanding a
GstQueueArray, which has the potential for a heap overwrite.

Co-authored-by: Sebastian Dröge <sebastian@centricular.com>
Fixes https://gitlab.freedesktop.org/gstreamer/gstreamer/-/issues/1232

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/2606>

2 years agosmpte: Fix integer overflow with possible heap corruption in GstMask creation.
Adam Doupe [Thu, 19 May 2022 04:16:25 +0000 (04:16 +0000)]
smpte: Fix integer overflow with possible heap corruption in GstMask creation.

Check that width*height*sizeof(guint32) doesn't overflow when
allocated user_data for mask, potential for heap overwrite when
inverting.

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

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/2603>

2 years agodecklinkvideosink: Fix selection of > PAL widescreen modes
Sebastian Dröge [Wed, 15 Jun 2022 07:07:26 +0000 (10:07 +0300)]
decklinkvideosink: Fix selection of > PAL widescreen modes

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/2601>

2 years agodocs: harness: Fix example
Víctor Manuel Jáquez Leal [Wed, 15 Jun 2022 10:56:13 +0000 (12:56 +0200)]
docs: harness: Fix example

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/2602>

2 years agodecodebin3: fix EOS event sequence
James Hilliard [Sun, 12 Jun 2022 11:35:27 +0000 (05:35 -0600)]
decodebin3: fix EOS event sequence

See docs:
https://gstreamer.freedesktop.org/documentation/additional/design/seqnums.html?gi-language=c#seqnums-sequence-numbers

Per docs:
When a sink element receives an EOS event and creates a new EOS
message to post, it should copy the seqnum from the event to the
message because the EOS message is a consequence of the EOS event
being received.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/2588>

2 years agovaapi: Do not disable the whole vpp when some va operations not available.
He Junyan [Thu, 9 Jun 2022 12:00:35 +0000 (20:00 +0800)]
vaapi: Do not disable the whole vpp when some va operations not available.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/2578>

2 years agoadaptivedemux2: Prevent duplicate symbols on static builds
Piotr Brzeziński [Tue, 14 Jun 2022 21:03:26 +0000 (23:03 +0200)]
adaptivedemux2: Prevent duplicate symbols on static builds

Uses prelude header files with #defines to rename DASH and MSS
symbols duplicated in their old standalone versions.
Also redefines soup-related functions when building it for
adaptivedemux2 to prevent symbol conflicts there.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/2534>

2 years agova: basedec: Select output format with the used chroma in decoder.
Víctor Manuel Jáquez Leal [Tue, 7 Jun 2022 14:30:36 +0000 (16:30 +0200)]
va: basedec: Select output format with the used chroma in decoder.

Currently, video format is decided with downstream caps intersection,
but that's not correct since chroma is not considered. The video
decoders have to decide the output format given the used chroma, not
by the downstream caps negotiation.

This patch changes that. Still, caps feature is selected by caps
negotiation, then, with the preferred caps feature, the output format
is search within that caps feature.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/2569>

2 years agomultiqueue: fix potential crash on shutdown
Tim-Philipp Müller [Tue, 14 Jun 2022 16:29:31 +0000 (17:29 +0100)]
multiqueue: fix potential crash on shutdown

The mq we get out of the weak ref might be NULL if we're
shutting down, which could cause assertion failures or
crashes.

It might also cause miscompilations where the compiler just
optimises away the NULL check because it jumps to a code path
that then dereferences the pointer which clearly isn't going
to work. Seems like something like this happens with gcc 11.

Fixes #1262

Co-authored-by: Doug Nazar <nazard@nazar.ca>
Co-authored-by: Sebastian Dröge <sebastian@centricular.com>
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/2599>

2 years ago.editorconfig: Add some indentation settings
Jan Alexander Steffens (heftig) [Mon, 28 Feb 2022 13:21:52 +0000 (14:21 +0100)]
.editorconfig: Add some indentation settings

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/1812>

2 years agomultiqueue: fix warning: ‘is_query’ may be used uninitialized in this function
James Hilliard [Tue, 14 Jun 2022 09:29:41 +0000 (03:29 -0600)]
multiqueue: fix warning: ‘is_query’ may be used uninitialized in this function

Fixes:
../plugins/elements/gstmultiqueue.c: In function ‘gst_multi_queue_loop’:
../plugins/elements/gstmultiqueue.c:2394:19: warning: ‘is_query’ may be used uninitialized in this function [-Wmaybe-uninitialized]
 2394 |     if (object && !is_query)
      |                   ^~~~~~~~~

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/2593>

2 years agoadaptivedemux2: Improve reverse playback buffering.
Jan Schmidt [Wed, 11 May 2022 16:51:00 +0000 (02:51 +1000)]
adaptivedemux2: Improve reverse playback buffering.

In reverse playback, store the lowest running time in each GOP
as the input_time for buffering purposes. That means we end up
storing at least a complete GOP before declaring buffering
100%

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/2510>

2 years agoadaptivedemux2: reverse playback running times
Jan Schmidt [Fri, 8 Apr 2022 13:06:09 +0000 (23:06 +1000)]
adaptivedemux2: reverse playback running times

Account for running time moving non-monotonically in
reverse playback by tracking the highest running time
seen at each point.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/2510>

2 years agovulkan: add vulkan overlay compositor element
Matthew Waters [Mon, 23 May 2022 01:41:17 +0000 (11:41 +1000)]
vulkan: add vulkan overlay compositor element

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/2470>

2 years agovkfullscreenquad: add support for disabling clearing
Matthew Waters [Mon, 23 May 2022 01:26:24 +0000 (11:26 +1000)]
vkfullscreenquad: add support for disabling clearing

e.g. if drawing over the top of an existing image, we don'w want to
clear.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/2470>

2 years agovkfullscreenquad: support setting blend operations
Matthew Waters [Mon, 23 May 2022 01:25:03 +0000 (11:25 +1000)]
vkfullscreenquad: support setting blend operations

Allows e.g. blending with an existing image.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/2470>

2 years agovkfullscreenaud: create the vulkan command pool upfront
Matthew Waters [Mon, 23 May 2022 01:24:04 +0000 (11:24 +1000)]
vkfullscreenaud: create the vulkan command pool upfront

Allows outside to reuse the same command buffer pool much more easily.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/2470>

2 years agovulkan: add some missing GAutoPtr definitions
Matthew Waters [Tue, 17 May 2022 07:07:49 +0000 (17:07 +1000)]
vulkan: add some missing GAutoPtr definitions

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/2470>

2 years agovulkan: remove unneeded #ifdef for GAutoPtr
Matthew Waters [Tue, 17 May 2022 06:32:09 +0000 (16:32 +1000)]
vulkan: remove unneeded #ifdef for GAutoPtr

Not necessary anymore as we depend on a new enough Glib version

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/2470>

2 years agovulkan: move element register definition to relevant element headers
Matthew Waters [Tue, 17 May 2022 03:22:33 +0000 (13:22 +1000)]
vulkan: move element register definition to relevant element headers

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/2470>

2 years agod3d11converter: Add support for colorimetry conversion
Seungha Yang [Sun, 12 Jun 2022 18:29:11 +0000 (03:29 +0900)]
d3d11converter: Add support for colorimetry conversion

Handle color primaries and gamma functions.
HDR <-> SDR conversion (tone mapping) should be implemented as well
but not a part of this patch.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/2581>

2 years agod3d11convert: Don't passthrough if colorimetry conversion is required
Seungha Yang [Mon, 13 Jun 2022 18:15:42 +0000 (03:15 +0900)]
d3d11convert: Don't passthrough if colorimetry conversion is required

Different input/output colorimetry requires conversion

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/2581>

2 years agod3d11window: Use SDR colorspace whenever possible
Seungha Yang [Mon, 13 Jun 2022 15:24:41 +0000 (00:24 +0900)]
d3d11window: Use SDR colorspace whenever possible

PQ uses completely different light level scale
and it should not be used for SDR bt2020.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/2581>

2 years agod3d11converter: Rewrite conversion object
Seungha Yang [Sun, 5 Jun 2022 18:41:52 +0000 (03:41 +0900)]
d3d11converter: Rewrite conversion object

Rewriting GstD3D11Converter (equivalent to GstVideoConverter)
to optimize some conversion path and clean up.

* Extract YUV <-> RGB conversion matrix building method to
  utils. It will be used by other implementation
* Use calculated offset values for YCbCr <-> YPbPr conversion
  instead of hardcoded values
* Handle color range adjustment
* Move transform matrix building helper function to utils.
  The method will be used by other elements
* Use single constant buffer. Multiple constatne buffer for
  conversion pipeline is almost pointless
* Remove lots of duplicated HLSL code and split pixel shader
  code path into sampling -> colorspace conversion ->
  shader output packing
* Avoid floating point precision error around UV coordinates
* Optimize RGB -> YUV conversion path

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/2581>

2 years agov4l2codecs: Add P010 pixel format
Benjamin Gaignard [Tue, 24 May 2022 08:40:26 +0000 (10:40 +0200)]
v4l2codecs: Add P010 pixel format

Copy V4L2_PIX_FMT_P010 define from linux header.
V4L2_PIX_FMT_P010 is the little endian definition of P010 so map
it GST_VIDEO_FORMAT_P010_10LE.
Add it v4l2 default video formats to allows v4l2 decoders to
enumerate and use it.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/2590>

2 years agodocs: update technical howto in moving-plugins
Tim-Philipp Müller [Fri, 10 Jun 2022 10:40:18 +0000 (11:40 +0100)]
docs: update technical howto in moving-plugins

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/2583>

2 years agoci: Disable werror for documentation build
Nirbheek Chauhan [Thu, 9 Jun 2022 00:08:19 +0000 (05:38 +0530)]
ci: Disable werror for documentation build

The documentation build is running on an ancient Fedora 30 image that
cannot be updated at present, and it's now triggering deprecation
warnings in system headers:

https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/2568#note_1418956

Disable werror here, it's not actually useful.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/2568>

2 years agoclock: Use g_atomic_rc_box for refcounting entry clocks
Nirbheek Chauhan [Wed, 8 Jun 2022 06:03:22 +0000 (11:33 +0530)]
clock: Use g_atomic_rc_box for refcounting entry clocks

g_atomic_rc_box was added in GLib 2.58, and we require 2.62 now, so we
can fix the FIXME and use this.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/2568>

2 years agoBump GLib requirement to >= 2.62
Tim-Philipp Müller [Wed, 6 Apr 2022 11:56:30 +0000 (12:56 +0100)]
Bump GLib requirement to >= 2.62

Can't require 2.64 yet because of
https://gitlab.freedesktop.org/gstreamer/cerbero/-/issues/323

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/2568>