Commit graph

2286 commits

Author SHA1 Message Date
Víctor Manuel Jáquez Leal cc30854893 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>
2022-06-27 13:43:14 +00:00
Víctor Manuel Jáquez Leal f36d2671e4 va: build: Remove duplicated source.
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/1575>
2022-06-27 13:43:14 +00:00
Seungha Yang 16955ba672 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>
2022-06-27 20:28:31 +09:00
Tim-Philipp Müller c895cdbec8 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>
2022-06-27 07:05:00 +00:00
Tim-Philipp Müller 0e551871c4 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>
2022-06-24 16:00:37 +00:00
Víctor Manuel Jáquez Leal 8a2660dc7f 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>
2022-06-24 15:24:09 +02:00
Nicolas Dufresne 83c51c9812 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>
2022-06-24 14:14:03 +02:00
Seungha Yang 170271b86f 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>
2022-06-23 22:03:52 +09:00
Seungha Yang abd60b6b1e qsvdecoder: Fix system memory alignment
Do right padding, not left

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/2651>
2022-06-23 21:43:25 +09:00
Seungha Yang 513a1cbbb3 d3d11decoder: Fix texture download
Stride applied to src/dst was reversed

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/2651>
2022-06-23 21:41:24 +09:00
Víctor Manuel Jáquez Leal 56f9359136 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>
2022-06-22 18:44:11 +00:00
Jonas Danielsson 4068564880 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>
2022-06-22 09:43:02 +02:00
Víctor Manuel Jáquez Leal 685a611812 va: Use driver implementation macro rather than function.
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/2642>
2022-06-21 18:21:46 +00:00
Sebastian Dröge e1e2d8d58c 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>
2022-06-21 17:27:28 +00:00
He Junyan f0d4135b3a 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>
2022-06-21 15:47:45 +00:00
Seungha Yang 1dc24d23d2 d3d11: Fix some typos
Fix up spelling and d3d11testsrc class meta.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/2644>
2022-06-21 20:12:06 +09:00
Sebastian Dröge a3cbaa8209 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>
2022-06-21 06:00:15 +00:00
Seungha Yang a040450685 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>
2022-06-20 19:18:53 +00:00
Seungha Yang adcb3ec1f2 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>
2022-06-20 19:18:53 +00:00
Robert Mader 6aa0b0cae2 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>
2022-06-20 18:30:56 +00:00
Xavier Claessens 5fc953e838 Add GstMemoryMapInfo to be used with g_auto()
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/2412>
2022-06-20 16:17:50 +00:00
Xavier Claessens 18aa649f87 GstVideoFrame: Add g_auto() support
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/2412>
2022-06-20 16:17:50 +00:00
Xavier Claessens 8bf778bb1f 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>
2022-06-20 16:17:50 +00:00
Philippe Normand 190f15660f gst-inspect: Fix inspection of third-party plugins
Since commit de57657de1 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>
2022-06-20 15:29:21 +01:00
Seungha Yang eaa9943b98 d3d11decoder: Check 16K resolution support
16K decoding is supported by some GPUs

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/2629>
2022-06-18 18:02:44 +00:00
Mathieu Duponchelle 4b50e674c3 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>
2022-06-17 23:17:31 +00:00
Seungha Yang e1fd0f620f 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>
2022-06-17 20:15:02 +00:00
Seungha Yang 461416b5f1 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>
2022-06-17 19:40:48 +00:00
Seungha Yang 59f39724b7 d3d11converter: Objectify converter
... and set conversion options via property

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/2622>
2022-06-17 19:40:48 +00:00
Seungha Yang 3ed94c2dde 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>
2022-06-17 19:40:48 +00:00
Seungha Yang ec6384947b d3d11compositor: Don't use GstD3D11Quad
The helper object will be removed

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/2622>
2022-06-17 19:40:48 +00:00
Seungha Yang 93662da3d1 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>
2022-06-17 19:40:48 +00:00
Mathieu Duponchelle f10e2eb88f 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>
2022-06-17 14:11:46 +00:00
Marc Leeman db5a4b490d rtpsession: properly initialise favor-new property
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/2625>
2022-06-17 13:05:18 +00:00
Edward Hervey 74f25cca31 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>
2022-06-17 12:30:09 +00:00
Olivier Crête c4971a456e 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>
2022-06-17 08:08:43 +00:00
Vivia Nikolaidou b90d02741e 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>
2022-06-16 10:03:02 +00:00
Tim-Philipp Müller cdf5ee470b docs: ensure coretracers plugin index page is index.html
And not blank.html

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/2592>
2022-06-15 21:05:28 +00:00
Tim-Philipp Müller a6a298b2f3 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>
2022-06-15 21:05:28 +00:00
Tim-Philipp Müller de57657de1 gst-inspect: print link to documentation for gstreamer elements
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/2592>
2022-06-15 21:05:28 +00:00
Stéphane Cerveau 19972b8153 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>
2022-06-15 20:35:14 +00:00
Stéphane Cerveau eb1f21b484 srtsrc: remove dead code
Remove code useless since
132e3a1af9

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/967>
2022-06-15 20:35:14 +00:00
Seungha Yang 8e5a4246b9 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>
2022-06-15 19:58:59 +00:00
Seungha Yang a1b4c62b35 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>
2022-06-15 19:58:59 +00:00
Seungha Yang b48c8eaee6 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>
2022-06-15 19:58:59 +00:00
Seungha Yang 72975fbd6d 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>
2022-06-15 19:58:59 +00:00
Sebastian Dröge cf887f1b8e 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>
2022-06-15 18:35:12 +00:00
Sebastian Dröge 14d306da6d 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>
2022-06-15 17:50:55 +00:00
Sebastian Dröge ad6012159a 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>
2022-06-15 17:50:55 +00:00
Sebastian Dröge f503caad67 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>
2022-06-15 16:40:48 +00:00
Adam Doupe e77ed17f15 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>
2022-06-15 15:42:40 +00:00
Adam Doupe be11a6e26b 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>
2022-06-15 14:53:50 +00:00
Sebastian Dröge 87230db55c decklinkvideosink: Fix selection of > PAL widescreen modes
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/2601>
2022-06-15 13:23:51 +00:00
Víctor Manuel Jáquez Leal 428b66cfae docs: harness: Fix example
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/2602>
2022-06-15 13:22:20 +02:00
James Hilliard f34ee92999 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>
2022-06-15 07:19:30 +00:00
He Junyan e72c867bf8 vaapi: Do not disable the whole vpp when some va operations not available.
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/2578>
2022-06-15 03:47:36 +00:00
Piotr Brzeziński 0a2c490723 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>
2022-06-15 01:13:16 +00:00
Víctor Manuel Jáquez Leal bb84a533bf 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>
2022-06-15 00:00:53 +00:00
Tim-Philipp Müller e72434ba20 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>
2022-06-14 17:32:03 +00:00
James Hilliard 64ad82e00c 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>
2022-06-14 12:54:35 +00:00
Jan Schmidt 6e48a3ec28 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>
2022-06-14 13:06:49 +01:00
Jan Schmidt a4a805312d 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>
2022-06-14 13:06:49 +01:00
Matthew Waters 9df7a21ec9 vulkan: add vulkan overlay compositor element
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/2470>
2022-06-14 03:34:06 +00:00
Matthew Waters efe8e41b61 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>
2022-06-14 03:34:05 +00:00
Matthew Waters fe8b4514e9 vkfullscreenquad: support setting blend operations
Allows e.g. blending with an existing image.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/2470>
2022-06-14 03:34:05 +00:00
Matthew Waters 53596c2fc6 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>
2022-06-14 03:34:05 +00:00
Matthew Waters 32487878d9 vulkan: add some missing GAutoPtr definitions
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/2470>
2022-06-14 03:34:05 +00:00
Matthew Waters a5e4199e88 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>
2022-06-14 03:34:05 +00:00
Matthew Waters 81e601ccaa vulkan: move element register definition to relevant element headers
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/2470>
2022-06-14 03:34:05 +00:00
Seungha Yang 7b39a09f9d 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>
2022-06-14 05:04:53 +09:00
Seungha Yang 3a44d14ac8 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>
2022-06-14 04:41:40 +09:00
Seungha Yang f3f905b491 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>
2022-06-14 04:39:31 +09:00
Seungha Yang ac26860a80 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>
2022-06-14 04:37:30 +09:00
Benjamin Gaignard a6f8cc4b95 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>
2022-06-13 16:44:29 +02:00
Tim-Philipp Müller 5c8bbde1d4 docs: update technical howto in moving-plugins
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/2583>
2022-06-10 11:40:45 +01:00
Nirbheek Chauhan 604b92b9cb 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>
2022-06-10 06:01:41 +00:00
Tim-Philipp Müller 9d9e59622f 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>
2022-06-10 06:01:41 +00:00
Sebastian Dröge 92a4088621 decklink: Add support for 4K DCI, 8K/UHD2 and 8K DCI modes
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/2570>
2022-06-10 05:31:35 +00:00
Seungha Yang 44768b233a qsvencoder: Do not copy if input is D3D11 texture
In case that input is D3D11 texture, QSV seems to work regardless
of the alignment. Actually the alignment requirement seems to make
only sense for system memory.
Other Intel GPU dependent implementations (new VA encoder, and MediaFoundation)
do not require such alignment nor other vendor specific ones (NVENC and AMF)

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/2540>
2022-06-09 20:28:10 +00:00
Seungha Yang e8fdf9177a d3d11decoder: Fix for alternate interlacing signalling
Don't set d3d11+interlace caps feature. None of d3d11 elements
support it

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/2579>
2022-06-09 23:19:24 +09:00
Seungha Yang 45dd8bf35a d3d11: Add d3d11testsrc element
Adding Direct3D11 based videotestsrc element

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/2554>
2022-06-09 05:08:41 +09:00
Mathieu Duponchelle cf793d6678 -bad/docs: be more selective about header files to exclude
A few header files in -bad contain comments that start with the
/** gtk-doc pattern, but should not actually be parsed (and warned
about as such).

Previously, we were using far-reaching wildcard patterns to avoid
parsing those, but this had the unintended side effect of also
excluding legitimate files, and creating confusion when comments
were not parsed from those.

Switch to excluding specific files instead.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/2576>
2022-06-08 15:51:05 +00:00
Marc Leeman 8bdf7e8ad8 fix trivial distination -> destination
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/2573>
2022-06-08 14:40:09 +02:00
Ignacio Casal Quinteiro 408f37c1d9 osxaudio: remove usage of goto
It is easier to follow the code without the goto now

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/2251>
2022-06-08 06:28:17 +00:00
Ignacio Casal Quinteiro caa5972abd osxaudio: support hidden devices
macOS features hidden devices. These are devices that will
not be shown in the macOS UIs and that cannot be retrieved
without having the specific UID of the hidden device. There
are cases when you might want to have a hidden device, for example
when having a virtual speaker that forwards the data to a virtual
hidden input device from which you can then grab the audio.
The blackhole project supports these hidden devices and
this patch provides a way that if the device id is a hidden
device it will use it instead of check the hardware list of devices
to understand if the device is valid.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/2251>
2022-06-08 06:28:17 +00:00
Ignacio Casal Quinteiro 243f8e8882 osx: fix indent
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/2251>
2022-06-08 06:28:17 +00:00
Ignacio Casal Quinteiro 57fed3c911 osxaudio: iterate device only if needed
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/2251>
2022-06-08 06:28:17 +00:00
Ignacio Casal Quinteiro a4a4d295a1 osxaudio: reduce scope of default device id variable
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/2251>
2022-06-08 06:28:17 +00:00
Jan Schmidt d76ba0292f amc: Add H.265 encoder mapping.
Add mime type mapping to enable the use of Android H.265 encoders

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/2511>
2022-06-08 03:25:13 +00:00
Mengkejiergeli Ba 1fe5655c2a msdkdec: Decoder should use its own pool when downstream allocator is not recognizable
Msdkdec should use it own pool when the allocation from downstream query
is not any msdk_allocator (i.e. msdk_video_allocator,
msdk_dmabuf_allocator and msdk_system_allocator). Otherwise, when using
pipeline "msdkh264dec ! vah264enc !" to transcode a not 16-bit-aligned
stream (i.e. 1920x1080), the transcoding will fail due to the size
mismatch issue between decoder pool and encoder pool.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/2451>
2022-06-08 02:48:53 +00:00
Bastien Nocera e37c462f87 gtk: Fix double-free when OpenGL can't be initialised
gtk_gl_area_get_error() doesn't return a copy of the error, but just the
error. If initialising OpenGL fails, then GtkGstGLWidget will consume
the error, and cause GTK to try and display freed memory.

==50914== Invalid read of size 8
==50914==    at 0x4C4CB8A: gtk_gl_area_draw_error_screen (gtkglarea.c:663)
==50914==    by 0x4C4CB8A: gtk_gl_area_draw (gtkglarea.c:687)
==50914==    by 0x4E061CA: gtk_widget_draw_internal (gtkwidget.c:7084)
==50914==    by 0x4BAEFB1: gtk_container_propagate_draw (gtkcontainer.c:3854)
==50914==    by 0x4D4B6BF: gtk_stack_render (gtkstack.c:2207)
==50914==    by 0x4BB4B03: gtk_css_custom_gadget_draw (gtkcsscustomgadget.c:159)
==50914==    by 0x4BBA4C4: gtk_css_gadget_draw (gtkcssgadget.c:885)
==50914==    by 0x4D4D780: gtk_stack_draw (gtkstack.c:2119)
==50914==    by 0x4E061CA: gtk_widget_draw_internal (gtkwidget.c:7084)
==50914==    by 0x4BAEFB1: gtk_container_propagate_draw (gtkcontainer.c:3854)
==50914==    by 0x4BAF0C3: gtk_container_draw (gtkcontainer.c:3674)
==50914==    by 0x4E061CA: gtk_widget_draw_internal (gtkwidget.c:7084)
==50914==    by 0x4BAEFB1: gtk_container_propagate_draw (gtkcontainer.c:3854)
==50914==  Address 0x187a0818 is 8 bytes inside a block of size 16 free'd
==50914==    at 0x48480E4: free (vg_replace_malloc.c:872)
==50914==    by 0x49A5B8C: g_free (gmem.c:218)
==50914==    by 0x49C1013: g_slice_free1 (gslice.c:1183)
==50914==    by 0x4990DE4: g_error_free (gerror.c:870)
==50914==    by 0x4990FE9: g_clear_error (gerror.c:1052)
==50914==    by 0x1A489780: _get_gl_context (gtkgstglwidget.c:540)
==50914==    by 0x1A4863CB: gst_gtk_invoke_func (gstgtkutils.c:39)
==50914==    by 0x49A3834: g_main_context_invoke_full (gmain.c:6137)
==50914==    by 0x1A486450: gst_gtk_invoke_on_main (gstgtkutils.c:59)
==50914==    by 0x1A48A29E: gtk_gst_gl_widget_init_winsys (gtkgstglwidget.c:632)
==50914==    by 0x1A4887E7: gst_gtk_gl_sink_start (gstgtkglsink.c:267)
==50914==    by 0x6579810: gst_base_sink_change_state (gstbasesink.c:5662)
==50914==  Block was alloc'd at
==50914==    at 0x484586F: malloc (vg_replace_malloc.c:381)
==50914==    by 0x49A9278: g_malloc (gmem.c:125)
==50914==    by 0x49C1BA5: g_slice_alloc (gslice.c:1072)
==50914==    by 0x49C3BCC: g_slice_alloc0 (gslice.c:1098)
==50914==    by 0x499096B: g_error_allocate (gerror.c:708)
==50914==    by 0x4990AF1: UnknownInlinedFun (gerror.c:722)
==50914==    by 0x4990AF1: g_error_copy (gerror.c:892)
==50914==    by 0x4C4B9F9: gtk_gl_area_set_error (gtkglarea.c:1036)
==50914==    by 0x4C4BAF7: gtk_gl_area_real_create_context (gtkglarea.c:346)
==50914==    by 0x4B21B28: _gtk_marshal_OBJECT__VOIDv (gtkmarshalers.c:2730)
==50914==    by 0x4920B78: UnknownInlinedFun (gclosure.c:893)
==50914==    by 0x4920B78: g_signal_emit_valist (gsignal.c:3406)
==50914==    by 0x4920CB2: g_signal_emit (gsignal.c:3553)
==50914==    by 0x4C4B927: gtk_gl_area_realize (gtkglarea.c:308)

Reproduced by running:
MESA_GL_VERSION_OVERRIDE=2.7 totem

See https://gitlab.gnome.org/GNOME/totem/-/issues/522

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/2565>
2022-06-07 17:36:26 +02:00
Víctor Manuel Jáquez Leal a8c658d5b7 va: Update plugin cache.
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/2522>
2022-06-07 12:02:21 +00:00
Víctor Manuel Jáquez Leal 045b6f5ea3 vah264enc: Guard logging functions
.. and use spec for rate control rather than static switch.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/2522>
2022-06-07 12:02:21 +00:00
Víctor Manuel Jáquez Leal 261714e25d vah264enc: Support default and none rate control.
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/2522>
2022-06-07 12:02:21 +00:00
Víctor Manuel Jáquez Leal e27ad1a273 va: encoder: Rate control property.
Fixes: #1241
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/2522>
2022-06-07 12:02:21 +00:00
Philippe Normand c287711418 webrtcbin: Add a prepare-data-channel GObject signal
This new signal allows data-channel consumers to configure signal handlers on a
newly created data-channel, before any data or state change has been notified.

The webrtcin unit-tests were refactored to make use of this new signal.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/2427>
2022-06-07 11:29:33 +00:00
Philippe Normand 779ca38229 webrtcdatachannel: Chain to parent class constructed
And add a debug log statement.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/2427>
2022-06-07 11:29:32 +00:00
Sebastian Dröge 47aab6c832 flvdemux: Make use of the streams API if used in a streams-aware bin
This allows adding audio/video streams after 6s.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/2559>
2022-06-07 10:52:46 +00:00
Eric Knapp 1818374de2 decklinkvideosink: Add 3G-SDI Level A output support
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/2544>
2022-06-07 10:07:42 +03:00
He Junyan 91b7d3679e Docs: Add the design document for DMA buffer sharing.
Co-authored-by: Nicolas Dufresne <nicolas.dufresne@collabora.com>
Co-authored-by: Victor Jaquez <vjaquez@igalia.com>
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/1431>
2022-06-07 02:28:49 +00:00
He Junyan e2392e2e3e h264parser: Fix memory leaks in parse_user_data_unregistered().
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/2551>
2022-06-06 19:21:58 +00:00
Jan Alexander Steffens (heftig) 5ebc9427d9 rtmp2: Fix allocation of GstRtmpMeta
Use the right size.

On 64-bit platforms, `GstMetaInfo` is larger than `GstRtmpMeta`, which
masked this bug. On 32-bit platforms, it causes crashes. Thanks to
@maxatka for discovering this.

Fixes: https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/issues/1721
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/2553>
2022-06-06 15:51:07 +00:00
Jan Alexander Steffens (heftig) 637406cdb1 aacparse: Avoid mismatch between src_caps and output_header_type
If our downstream caps didn't intersect, we attempted to convert between
raw and ADTS stream formats, if possible. If the caps still did not
intersect, we then used the modified `src_caps` but left the
`output_header_type` unmodified.

This caused a mismatch between caps and actual stream format.

Avoid this by first copying the `src_caps` to `convcaps` for the
additional intersection tests, replacing `src_caps` if we succeed.

While we're here, clean up the code a bit and remove the `codec_data`
field from outgoing ADTS caps.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/2550>
2022-06-06 15:09:09 +00:00
Sebastian Dröge e5f9bb973f flvdemux: Actually make use of the debug category
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/2552>
2022-06-06 14:36:41 +00:00
Robert Mader eb915b662a gstwaylandsink: Add support for the "render-rectangle" property
We already implement the `set_render_rectangle` videooverlay interface,
thus install the videooverlay property accordingly.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/2479>
2022-06-06 14:36:39 +02:00
Robert Mader 8c3e33d494 gstwayland: Move reusable parts of the waylandsink into a library
In preparation for the new element `GstGtkWaylandSink`, move reusable
parts out of `GstWaylandSink` into the already exisiting but very
barebone library.

Notable changes include:
 - the `GstWaylandVideo` interface was dropped
 - support for `wl-shell` was dropped
 - lots of renaming in order to match established naming patterns
 - lots of code modernisations, reducing boilerplate
 - members were made private wherever possible

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/2479>
2022-06-06 14:36:39 +02:00
Jan Alexander Steffens (heftig) d86ad30be2 opencv: Allow building against 4.6.x
Replace the broken version checks with one modeled after
`GLIB_CHECK_VERSION`.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/2557>
2022-06-06 00:30:15 +02:00
Thibault Saunier a02f0ea392 validate: Fix running as a tracer
We need to rebuild runner.c as this is where the plugin is defined

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/2555>
2022-06-04 18:04:31 -04:00
Olivier Crête 9fe2e1c5eb webrtcbin: Reject answers that don't contain the same number of m-line as offer
Otherwise, it segfaults later. Also add test to validate this.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/2526>
2022-06-03 20:28:19 +00:00
Marc Leeman 955adc4564 rfbsrc: add uri interface
Adding a uri interface enables plugging in RFB/VNC sources to anything
that makes use of uridecodebin:

gst-play-1.0 rfb://:password@10.40.216.180:5903?shared=1

Use userinfo to pass user (ignored) and password, other key/value pairs
can be encoded in the query part of the URI (see shared)

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/1963>
2022-06-03 19:44:28 +00:00
Andoni Morales Alastruey 77937f9398 videoparse: rename from _free to _clear
The function does not free the structure but the data
contained within.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/1458>
2022-06-03 08:29:05 +00:00
Andoni Morales Alastruey efb8c5381c video: add new video-sei.h header to the list of video_headers
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/1458>
2022-06-03 08:29:05 +00:00
Andoni Morales Alastruey cb7e1a6576 h264parse: fix leak in user data unregistered
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/1458>
2022-06-03 08:29:05 +00:00
Andoni Morales Alastruey ffdc8634e8 test: update tests to include the new meta
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/1458>
2022-06-03 08:29:05 +00:00
Andoni Morales Alastruey 64a92b549d Fix documentation
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/1458>
2022-06-03 08:29:05 +00:00
Brad Hards 804a6054bb h264parse: add unit test for Precision Time Stamp in SEI messages
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/1458>
2022-06-03 08:29:05 +00:00
Brad Hards 9a2ce2683b h264parse: fix copying of data and UUID
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/1458>
2022-06-03 08:29:05 +00:00
Andoni Morales Alastruey ca2eb9f65f h264parse: add support Precision Time Stamp in SEI messages
Expose User Data Unregistered as a new Meta and add
API to parse Precision Time Stamp (ST 0604).

Fixes #927

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/1458>
2022-06-03 08:29:05 +00:00
Seungha Yang 9d0f792b66 meson: cuda: Add missing override_dependency()
Required for GstCuda library to be consumed via "gstreamer-cuda-1.0"
dependency.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/2539>
2022-06-02 19:14:12 +00:00
Seungha Yang dc1d5f798f cuda: Fix uninitialized debug category
Make sure debug category init

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/2542>
2022-06-02 18:33:30 +00:00
Mengkejiergeli Ba 7696ca83b2 msdkav1enc: Reorder pts
This is a workaround for pts because oneVPL cannot handle the pts
correctly when there is b-frames. We first cache the input frame pts in
a queue then retrive the smallest one for the output encoded frame as
we always output the coded frame when this frame is displayable.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/2089>
2022-06-02 13:39:11 +00:00
Mengkejiergeli Ba ae7dfb9680 msdkav1enc: Add b-pyramid and p-pyramid
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/2089>
2022-06-02 13:39:11 +00:00
Mengkejiergeli Ba 8ea23fd0da msdkav1enc: Add tile for encoding
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/2089>
2022-06-02 13:39:11 +00:00
Mengkejiergeli Ba 610b7ee66a msdk: Add msdkav1enc element
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/2089>
2022-06-02 13:39:11 +00:00
Stéphane Cerveau c3bb04f779 soup: fix soup debug category
Use soup debug category in souploader
for soup plugin element load.

Inititalize properly soup utils category.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/2535>
2022-06-02 12:55:13 +00:00
Jakub Adam 9fd396834a amfencoder: always empty the queue when pushing output samples
gst_amf_encoder_try_output() pushes at most one output buffer downstream
although more may be ready. As a consequence, output samples will keep
queueing up in AMFComponent whenever QueryOutput() returns AMF_REPEAT
(and do_wait is FALSE). This has negative impact on latency when the
video being encoded is a live stream.

In order to avoid it, always retrieve and push all samples available in
AMFComponent's output queue at once.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/2536>
2022-06-01 18:19:09 +02:00
Seungha Yang 238ce301b6 hlsdemux2: Adjust debug log level
HLS manifest might not be represented by a single common caps
when different codecs are mixed in a playlist, but it
does not seem to be a critical issue we need to warn.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/2516>
2022-06-01 14:32:55 +00:00
Guillaume Desmottes 0086d7b016 basetransform: handle gst_base_transform_query_caps() returning NULL
If gst_base_transform_transform_caps() returns NULL, gst_base_transform_query_caps()
will return NULL as well.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/2532>
2022-06-01 09:55:53 +02:00
Jan Alexander Steffens (heftig) 15c69c17ea clock: Avoid creating a weakref with every entry
Creating and destroying weakrefs takes a write lock on a global
`GRWLock`. This makes for a very contended lock when the pipeline has
many synchronizing elements.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/2530>
2022-06-01 06:03:28 +00:00
Nicolas Dufresne f1756493d2 video: Fix NV12_16L32 size calculation
The subsampling of the second plane was not taken into account, resulting in a
16bit per pixel buffers instead of 12.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/2512>
2022-05-31 16:23:01 +00:00
Guillaume Desmottes 4cb935bcea basetransform: fix critical if transform_caps() returned NULL
klass->transform_caps() may return NULL, which was raising this
critical:

  GStreamer-CRITICAL **: 12:23:56.243: gst_caps_is_subset: assertion 'subset != NULL' failed

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/2528>
2022-05-31 14:27:51 +02:00
Stéphane Cerveau 6b55f97529 adaptivedemux2: fix plugin/element init
In case of per features registration such as the
customizable gstreamer-full library, each
element should check that the soup library can be loaded to
facilitate the element registration.

Initialize the debug categories properly

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/2348>
2022-05-30 13:13:48 +00:00
Seungha Yang 7acfd0cdd1 directshow: Fix for uninitialized debug category warning
A method in the code is used in another place (device provider)

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/2519>
2022-05-30 12:00:43 +00:00
Víctor Manuel Jáquez Leal be948816d3 va: Register base classes as abstract.
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/2521>
2022-05-29 16:03:46 +00:00
Víctor Manuel Jáquez Leal ae9fe4a851 va: encoder: Use entrypoint type.
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/2521>
2022-05-29 16:03:46 +00:00
tom schuring d71a6bf457 plugin: add Apache 2 license to known licenses
the licence in gstreamer/subprojects/gstreamer/gst/gstplugin.c
currently is defined to be one of:
LGPL GPL QPL GPL/QPL MPL BSD MIT/X11 0BSD Proprietary
The open source project for the kinesis plugin is using an
Apache 2.0 license. Because "Apache 2.0" is not one of the
supported licenses it automatically falls back to Proprietary.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/2514>
2022-05-29 12:36:42 +00:00
Víctor Manuel Jáquez Leal 4474056f6f va264enc: Fix typo.
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/2508>
2022-05-29 11:56:39 +00:00
Víctor Manuel Jáquez Leal e83983d7ca va: encoder: Fix regression since commit 2042c2d4f0.
There's no need to compare with the open entrypoint to query the
encoder. This commit removes the checks to the configured entrypoint
with the parameter.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/2508>
2022-05-29 11:56:39 +00:00
Jan Schmidt a8f18aef18 rtpptdemux: Don't GST_FLOW_ERROR when ignoring invalid packets
https://bugzilla.gnome.org/show_bug.cgi?id=741398 changed
rtpptdemux in 2014 to not post a GST_ELEMENT_ERROR on the
bus when dropping an invalid (non-RTP) packet, but still
returned GST_FLOW_ERROR upstream - so the pipeline still
stops, but now without a useful bus error.

Return GST_FLOW_OK instead, so the pipeline keeps
running. Some old telephony equipment can send invalid
packets before the real RTP traffic starts.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/2520>
2022-05-29 20:27:38 +10:00
Seungha Yang 5762dfb15d mfvideoencoder: Handle dynamic property update
Re-init MFT on property update to apply new encoding options

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/2037>
2022-05-28 23:12:53 +09:00
Seungha Yang 2db6e0ac3c mediafoundation: Run indent
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/2037>
2022-05-28 23:12:53 +09:00
Seungha Yang 9fbf4f9c10 mfvideoenc: Remove redundant bitwise or operation
MFT_ENUM_FLAG_SORTANDFILTER_APPROVED_ONLY (0xc0) covers
MFT_ENUM_FLAG_SORTANDFILTER (0x40)

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/2037>
2022-05-28 23:12:53 +09:00
Seungha Yang 442d21ab2a mfvideoencoder: Early terminate d3d11 interop
Shared texture will work only for the same GPU

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/2037>
2022-05-28 23:12:53 +09:00
Seungha Yang 39dd92fa5e mfvideoencoder: Check HRESULT code as well for GPU sync
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/2037>
2022-05-28 23:12:53 +09:00
Seungha Yang 00ae87cbb5 mfvideoencoder: Don't specify keyed mutex misc flag
Current implemetation copies textures using non-keyed mutex way.
D3D11_RESOURCE_MISC_SHARED_KEYEDMUTEX is pointless

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/2037>
2022-05-28 23:12:53 +09:00
Nirbheek Chauhan a6db1a4c81 jack: Always use jack_free as specified by the docs
Fixes a crash on Windows due to a CRT mismatch. The JACK installation
still uses MSVCRT, and we the Universal CRT for both MinGW and MSVC.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/2497>
2022-05-28 11:34:23 +00:00
Nirbheek Chauhan 4865f36344 jack: Add support for detecting libjack on Windows
No source code changes were necessary to get the plugin working on
Windows with MSVC.

Run QJackCtl and audiotestsrc ! jackaudiosink just works.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/2497>
2022-05-28 11:34:23 +00:00
Víctor Manuel Jáquez Leal 24527856cb vacompositor: Pass video info pointer than copying it.
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/2496>
2022-05-28 00:00:39 +00:00
Víctor Manuel Jáquez Leal f9b631e0ea vacompositor: Remove useless consts.
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/2496>
2022-05-28 00:00:39 +00:00
Seungha Yang fe64295841 d3d11decoder: Work around Intel DXVA driver crash
Intel DXVA driver crashes sometimes (from GPU thread) if
ID3D11VideoDecoder is released while there are outstanding view objects.
To make sure the object life cycle, holds an ID3D11VideoDecoder refcount
in GstD3D11Memory object.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/2504>
2022-05-27 15:13:15 +00:00
Seungha Yang 7c8902c983 qsvencoder: Bind internal texture to render target
... so that memory allocator can initialize texture with black color

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/2502>
2022-05-27 14:03:49 +00:00
Seungha Yang 0deb73d9ba d3d11memory: Clear YUV texture with black color
We prefer black color as an initial texture color and
Direct3D11 runtime will initialize texture with zeros (except for alpha)
which is fine for RGB formats. But UV components of YUV texture
requires manual clear for black color.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/2502>
2022-05-27 14:03:49 +00:00
U. Artie Eoff 3c5d3ae7ea tests: vaapi: remove unused header
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/2503>
2022-05-27 10:25:20 +00:00
U. Artie Eoff 331e3af879 tests: vaapi: fix memleak in vaapioverlay test
Need to unmap the frame to ensure vaapioverlay can destruct/dispose.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/2503>
2022-05-27 10:25:20 +00:00
U. Artie Eoff becabd36da tests: va: add simple vacompositor test
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/2481>
2022-05-27 09:42:36 +00:00
Mengkejiergeli Ba 81d2982476 msdkh265enc: Add intra refresh parameters
Note that for msdkh265enc, intra refresh parameters are only supported
under low-power mode. If these parameters are set without enabling lowpower,
they will be simply ignored.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/2308>
2022-05-27 02:15:42 +00:00
Mengkejiergeli Ba 9c8cb97db9 msdkh264enc: Add intra refresh parameters
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/2308>
2022-05-27 02:15:42 +00:00
Seungha Yang aa835f5e64 tests: examples: Stop duplicating keyboard interaction handler code
Extract the code from QSV and use it for D3D11 and NVCODEC examples

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/2468>
2022-05-26 18:52:35 +00:00
Tim-Philipp Müller 962dc37d4f webrtc: fix build with older libnice versions
1) check for right macro name when checking for NICE_VERSION_CHECK

2) if libnice version is 0.1.18.1 this should not satisfy
   a NICE_VERSION_CHECK(0,1,19).

Fixes build with libnice 0.1.18.1 subproject checkout.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/2499>
2022-05-26 18:17:49 +00:00
Hou Qi 7f2fb3b783 v4l2: Reset transfer in gst_v4l2_object_acquire_format()
get_colorspace() checks input caps transfer when mapping V4L2_XFER_FUNC_709
back to V4L2_COLORSPACE_BT2020 and GST_VIDEO_TRANSFER_BT2020_12. After
receiving source change event, decoder will G_FMT and S_FMT again. So need
to reset transfer when acquiring format to avoid using the old transfer.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/2475>
2022-05-26 17:09:28 +00:00
Jan Schmidt 6c0423b861 amc: Don't map input buffer with write mode
When copying data out of a GStreamer buffer, we don't
need to map it writable.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/2492>
2022-05-26 12:44:03 +00:00
Philippe Normand eefd793011 webrtc: Use new libnice API to get the candidate relay address
Corresponding libnice API added in:
https://gitlab.freedesktop.org/libnice/libnice/-/merge_requests/229 (0.1.19)
https://gitlab.freedesktop.org/libnice/libnice/-/merge_requests/232 (0.1.20)

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/1998>
2022-05-26 10:54:59 +00:00
Philippe Normand 08021caa73 webrtc: Ensure the NICE_CHECK_VERSION macro is available
This macro was introduced in libnice 0.1.19.1, so until we bump our libnice
dependency to 0.1.20 we have to vendor the macro.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/1998>
2022-05-26 10:54:59 +00:00
Philippe Normand c19319c777 webrtc: Refactor ICECandidateStats freeing logic to a dedicated function
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/1998>
2022-05-26 10:54:59 +00:00
Philippe Normand dce8a7750d webrtcbin: Document IceCandidateStats and RTCIceCandidatePairStats
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/1998>
2022-05-26 10:54:59 +00:00
Sherrill Lin f335b40ae8 webrtcstats: Update unit test for outbound rtp stats
"remote-id" is not guaranteed to present after commit 1deb034e3d.
Thus, we should not fail the test if "remote-id" is not found.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/1998>
2022-05-26 10:54:59 +00:00
Sherrill Lin 3e7fb83393 webrtcstats: Improve selected candidate pair stats by adding ICE candidate info
The implementation follows w3.org specs:
* https://www.w3.org/TR/webrtc-stats/#icecandidate-dict*
* https://www.w3.org/TR/webrtc-stats/#candidatepair-dict*

Corresponding unit tests are also added.

Rebased and updated from
https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/1462

Fixes #1207

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/1998>
2022-05-26 10:54:59 +00:00
He Junyan 2042c2d4f0 va: H264enc: Add encoder for VAEntrypointEncSliceLP.
We name vah264lpenc to support H264's VAEntrypointEncSliceLP encoder.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/2472>
2022-05-25 20:40:48 +00:00
He Junyan d47416d3a2 va: encoder: Do not reset the frame count when reconfig().
We should not reset the input/output_frame_count when some configure
changes. For example, the if resolution changes, the current way just
resets the frame count and make the PTS of the output buffer restart
from the original PTS of the first frame. That causes a lot of QOS
event and drop all the new frames.
We should only reset them when encoder start().

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/2489>
2022-05-25 18:56:34 +00:00
He Junyan 994f2c56e2 va: encoder: change reset_state() to a virtual function of base class.
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/2489>
2022-05-25 18:56:34 +00:00
Seungha Yang b91093a2e6 playbin3: Configure combiner on pad-added if needed
When collection is updated, decodebin3 exposes pad first and then
streams-selected message is posted.
The condition can cause a situation where playbin3 links non-existing
combiner/playsink pads (since streams-selected is not posted yet) with
new decodebin output pad. This commit will re-check selected/active
streams condition on pad-added and reconfigure output if needed.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/2482>
2022-05-25 13:50:17 +00:00
Piotrek Brzeziński 5490189b9b cutter: Include running/stream-time in messages
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/2490>
2022-05-25 12:27:10 +00:00
U. Artie Eoff 8a161880fc vacompositor: check caps and info return values
Check return values for get caps and video info from caps.

This was flagged by static analysis.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/2480>
2022-05-25 10:16:00 +00:00
Stéphane Cerveau 39b13fcdbd soup: Fix plugin/element init
In case of per features registration such as the
customizable gstreamer-full library, each
element should check that the soup library can be loaded to
facilitate the element registration.

Initialize the debug category properly

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/2349>
2022-05-25 09:33:56 +02:00
Seungha Yang 9b128f1841 d3d11decoder: Don't print error log on negotiation failure
It may not be a critical error and even expected when shutting down
pipeline or flushing.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/2483>
2022-05-25 05:46:40 +09:00
Erwann Gouesbet 09a45c37ca d3d11screencapture: Fix missing/outdated cursor shape
d3d11screencapture can miss a cursor shape to draw or draw an outdated cursor shape.
 - AcquireNextFrame only provides cursor shape when there is one update
 - current d3d11screencapture skips cursor shape when mouse is not drawn

So, if a gstreamer application uses d3d11screencapture with cursor initially not drawn
"show-cursor"=false and then switches this property to true, the cursor will not be
actually drawn until AcquireNextFrame provides a new cursor shape.
This commit makes d3d11screencapture always update the cursor shape information, even
if the mouse is not drawn. d3d11screencapture will always have the latest cursor shape
when requested to draw it.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/2485>
2022-05-24 20:10:00 +00:00
Eli Schwartz 79c3bbc2ed meson: use better zlib dependency fallback
zlib is required, and if it isn't found it is checked several ways and
then forced via subproject(). This code was added in commit
b93e37592a, to account for systems where
zlib doesn't have pkg-config files installed.

But Meson already does dependency fallback, and also, since 0.54.0, does
the in-between checks for find_library('z') and has_header('zlib.h') via
the "system" type dependency. Simplify dependency lookup by marking it
as required, which also makes sure that the console log doesn't
confusingly list "not found".

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/2484>
2022-05-24 19:39:29 +00:00
Víctor Manuel Jáquez Leal 8433bab0b5 va: Avoid unused variable if logging is disabled.
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/2478>
2022-05-24 19:07:47 +00:00
Nicolas Dufresne 6d6ebbbb36 v4l2videodec: Fix missing handling of resolution-change
The pool process function may poll and get the resolution-change event
whenever it is not possible to share our buffers. This typically happen
when downstream does not support GstVideoMeta.

Not handling this would cause the decoder thread to exit silently and the
pipeline to stall.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/2457>
2022-05-24 18:02:12 +00:00
Nicolas Dufresne 4e441417b8 v4l2videodec: Downgrade to info resolution-change trace
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/2457>
2022-05-24 18:02:12 +00:00
Thibault Saunier 79e28368fc structure: Fix serializing with new format inside arrays/lists
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/1554>
2022-05-24 17:20:50 +00:00
Víctor Manuel Jáquez Leal 84c0d02755 va: Keep include's code style
Headers are in alphabetical order.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/2465>
2022-05-24 13:41:50 +00:00
Víctor Manuel Jáquez Leal 46e536898f vafilter: Fix logging of unsupported alpha blending.
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/2477>
2022-05-24 12:30:49 +00:00
Matthew Waters be2dfd0c36 webrtcbin: reuese the same fec/rtx/red payload types for the same media payload
WHen bundling, if multiple medias are used with the same media payload, then
each of the fec/rtx/red additions would add a distinct payload.  This could
very easily overflow the available payload space.

Instead, track the relationship between the media payload value and
the relevant fec/rtx/red payload values and reuse them whenever
necessary, even when bundling.

e.g.

...
a=group:BUNDLE video0 video1
m=video 9 UDP/SAVPF 96 97
a=mid:video0
a=rtpmap:96 VP8/90000
a=rtpmap:97 rtx/90000
a=fmtp:97 apt=96
...
m=video 9 UDP/SAVPF 96 97
a=mid:video1
a=rtpmap:96 VP8/90000
a=rtpmap:97 rtx/90000
a=fmtp:97 apt=96
...

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/2474>
2022-05-24 10:21:11 +00:00
Tim-Philipp Müller e64c6f0b93 shout2: fix compiler warnings and bump req to libshout >= 2.4.2
Fix compiler warnings with latest libshout version (2.4.6).

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/2473>
2022-05-23 20:23:38 +01:00
László Károlyi fedb48c68f shout2send: Adding send-title-info and user-agent options
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/2420>
2022-05-23 16:01:48 +00:00
Seungha Yang e22314a6bd tests: examples: Fix typo in QSV encoder example
Fixing width adjustment

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/2467>
2022-05-23 13:28:11 +00:00
Seungha Yang 4c384f8356 qsv: Add AV1 encoder element
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/2467>
2022-05-23 13:28:11 +00:00
Seungha Yang 8e665fa435 qsvencoder: Move common property to baseclass
adapter-luid and device-path are common for all codecs

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/2467>
2022-05-23 13:28:11 +00:00
He Junyan fc75e38496 va: baseenc: No need to check the frame pointer in handle_frame().
No need to check the NULL pointer of "frame" in error handling, it
is assured non-NULL by base class and we already use it everywhere
in this function.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/2471>
2022-05-23 15:03:03 +08:00
He Junyan de5952bc83 va: baseenc: include the "vacompat.h" for old version glib.
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/2463>
2022-05-22 15:03:54 +08:00
U. Artie Eoff d2651a1e0b va: vpp: enable compositor
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/2332>
2022-05-21 21:18:15 +02:00
U. Artie Eoff afe8723196 va: vpp: add compositor
New implementation of a VA-API compositor with blend feature.

Various chunks of code was taken from vavpp.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/2332>
2022-05-21 21:18:15 +02:00
He Junyan a2920411d3 va: Apply the va base encoder to the vah264enc.
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/2330>
2022-05-20 22:58:58 +02:00
He Junyan 21a9ba7e7e va: Add the GstVaBaseEnc common object for all va encoders.
Just like the GstVaBaseDec and GstVaBaseTransform, this base encoder
will handle all common logic for all va encoders.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/2330>
2022-05-20 22:58:58 +02:00
Seungha Yang e5ba099fd8 d3d11device: Enhance format enumeration and debugging
* Enhance debug log to print human readable D3D11_FORMAT_SUPPORT flags
  value, instead of packed numeric flagset value.
* Only device supported format will be added to format table.
  Depending on device feature level (i.e., D3D9 feature devices),
  16bits formats will not be supported. Although there might be formats
  we deinfed but not supported, it will not be a major issue in practice
  since our D3D11 implementation does not support legacy devices already
  (known limitation) and also old d3dvideosink will be promoted in that case.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/2441>
2022-05-21 02:37:45 +09:00
Sebastian Dröge 39568918de pbutils: Add GST_PBUTILS_CAPS_DESCRIPTION_FLAG_METADATA and ONVIF XML Timed MetaData
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/2453>
2022-05-20 13:01:44 +00:00
Sebastian Dröge 7273024ae5 qtdemux: Add support for ONVIF XML Timed MetaData
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/2453>
2022-05-20 13:01:44 +00:00
Sebastian Dröge 365a9af9c5 qtdemux: Add parsing/dumping of nmhd / metx boxes
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/2453>
2022-05-20 13:01:44 +00:00
Sebastian Dröge 04f6258863 qtdemux: Parse styp box for informational purposes
And include some more details in the debug logs for the ftyp box too.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/2453>
2022-05-20 13:01:44 +00:00
Hou Qi 85b53bb65d v4l2: set default resolution if caps has no such information
Output may attemp to set the width and height to zero values if
caps has no such information, which will cause capture get invalid
dimensions. Then decoder reports negotiation failure.

So need to set default resolution if caps has no such information.
Real values can be set again until source change event is signaled.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/2400>
2022-05-20 12:23:40 +00:00
Víctor Manuel Jáquez Leal 5542dd395d jpegparse: Rewrite element.
Now it uses the JPEG parser in libgstcodecparsers, while the whole
code is simplified by relying more in baseparser class for tag
handling.

The element now signals chroma-format and default framerate is 0/1,
which is for still-images.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/1473>
2022-05-20 08:51:23 +00:00
Víctor Manuel Jáquez Leal fa2b697389 tests: jpegparse: Mark data as static.
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/1473>
2022-05-20 08:51:23 +00:00
Víctor Manuel Jáquez Leal 17046fc1ad jpegformat: Use codecparsers' for JPEG markers.
Instead of repeating JPEG markers definition, this patch uses those
defined in gstcodecparsers library.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/1473>
2022-05-20 08:51:23 +00:00
Víctor Manuel Jáquez Leal 547d324325 jpegparse: Headers cleanup
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/1473>
2022-05-20 08:51:23 +00:00
Patricia Muscalu 6c3445a83f rtsp-media: Correct logic on GstRTSPStreamBlocking message reception
We must take into account the receiving streams as well when calculating
the expected number of the received GstRTSPStreamBlocking messages.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/2429>
2022-05-20 07:37:05 +00:00
Philippe Normand 556ee45bfa datachannel: Notify low buffered amount according to spec
Quoting
https://www.w3.org/TR/webrtc/#dom-rtcdatachannel-bufferedamountlowthreshold

The bufferedAmountLowThreshold attribute sets the threshold at which the
bufferedAmount is considered to be low. When the bufferedAmount decreases from
above this threshold to **equal** or below it, the bufferedamountlow event fires.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/2448>
2022-05-19 05:52:51 +00:00
WANG Xuerui b6076d7394 gstreamer/gst/gstconfig.h.in: Add support for LoongArch
While current and future LoongArch machines that are supposed to run
GStreamer all support unaligned accesses, there might be future
lower-end cores (e.g. the embedded product line) without such support,
and we may not want to penalize these use cases.

So, mark LoongArch as not supporting unaligned accesses for now, and
hope the compilers do a good job optimizing them. We can always flip
switch later.

Suggested-by: CHEN Tao <redeast_cn@outlook.com>
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/2443>
2022-05-18 16:08:39 +00:00
Thibault Saunier 3296c678b3 rtcpbuffer: Allow padding on first reduced size packets
It is valid to have the padding set to 1 on the first packet and it
happens very often from TWCC packets coming from libwebrtc. This means
that we were totally ignoring many TWCC packets.

Fix test that checked that a first packet with padding was not valid and
instead test a single twcc packet with padding to check precisely what
this patch was about.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/2422>
2022-05-18 14:34:44 +00:00
Sebastian Dröge bf79a6908c tsmux: Make sure to set srcpad caps under all conditions before outputting the first buffer
Fixes https://gitlab.freedesktop.org/gstreamer/gstreamer/-/issues/1218

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/2438>
2022-05-18 12:19:07 +00:00
Matthew Waters 2b94359765 ges/videourisource: handle non-1/1 PAR source videos
The automatic scaling done by framepositioner does not account for the
par of the video source.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/2423>
2022-05-17 20:49:30 +00:00
Seungha Yang ca7081c482 d3d11device: Don't print ERROR log on open failure
Device open can be failed in various reasons, but it's unlikely
our problem

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/2433>
2022-05-17 14:11:00 +00:00
Sebastian Dröge 3487c81ac2 sdpdemux: Release request pads from rtpbin when freeing a stream
Otherwise the pads of the rtpbin stay around forever and are leaked.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/2437>
2022-05-17 12:36:44 +00:00
Jan Schmidt 7322a6d004 splitmuxsrc: Re-queue sticky events after probing.
When processing the first event after probing the
file and being activated, requeue sticky events
as there's no requirement that demuxers send tag
and other events again after a seek - that's
why they're sticky.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/2432>
2022-05-17 11:55:40 +00:00
Jan Alexander Steffens (heftig) d0fdfa76ae deinterlace: Clean up error handling in chain and _push_history
- Consistently unref the chained buffer at the end of the chain
  function, if we're not handing it off to `gst_pad_push`. This avoids a
  few buffer leaks in the error paths in `_chain` and `_push_history`.
- When mapping the video frame fails, return a flow error instead of
  crashing.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/2428>
2022-05-17 10:56:23 +00:00
Jan Alexander Steffens (heftig) 718d31fe63 splitmuxsink: When flushing, exit handle_mq_input quickly
If we just break the loop, we might run into the `gop != NULL` assert
that follows it. Rather, exit immediately with flushing flow.

Also use this flushing mechanism when we release a pad. This avoids
having an extra flag.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/1030>
2022-05-17 09:24:10 +00:00
Jan Alexander Steffens (heftig) fd27ee1537 splitmuxsink: Avoid deadlock on release, harder
Unlock after broadcasting and wait for the pad to be free before
relocking the muxer, giving the input probe a chance to react to our
broadcast.

Improves the fix from
https://gitlab.freedesktop.org/gstreamer/gst-plugins-good/-/merge_requests/838.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/1030>
2022-05-17 09:24:10 +00:00
Alicia Boya García bf9092592e appsink: Fix race condition on caps handling
Background:

Whenever a caps event is received by appsink, the caps are stored in the
same internal queue as buffers. Only when enough buffers have been
popped from the queue to reach the caps, `priv->sample` gets its caps
updated to match, so that they are correct for the following buffers.

Note that as far as upstream elements are concerned, the caps of appsink
are updated immediately when the CAPS event is sent. Samples pulled from
appsink retain the old caps until a later buffer -- one that was sent by
upstream elements after the new caps -- is pulled.

The race condition:

When a flush is received, appsink clears the entire internal queue. The
caps of `priv->sample` are not updated as part of this process, and
instead remain as those of the sample that was last pulled by the user.

This leaves open a race condition where:
1. Upstream sends a new caps event, and possibly some buffers for the
   new caps.
2. Upstream sends a flush (possibly from a different thread).
3. Upstream sends a new buffer for the new caps. Since as far as
   upstream is concerned, appsink caps are the new caps already, no new
   CAPS event is sent.
4. The appsink user pulls a sample, having not pulled before enough
   samples to reach the buffers sent in step 1.

Bug: the pulled sample has the old caps instead of the new caps.

Fixing the race condition:

To avoid this problem, when a buffer is received after a flush,
`priv->sample`'s caps should be updated with the current caps before the
buffer is added to the internal queue.

Interestingly, before this patch, appsink already had code for this, in
gst_app_sink_render_common():

    /* queue holding caps event might have been FLUSHed,
     * but caps state still present in pad caps */
    if (G_UNLIKELY (!priv->last_caps &&
            gst_pad_has_current_caps (GST_BASE_SINK_PAD (psink)))) {
      priv->last_caps = gst_pad_get_current_caps (GST_BASE_SINK_PAD (psink));
      gst_sample_set_caps (priv->sample, priv->last_caps);
      GST_DEBUG_OBJECT (appsink, "activating pad caps %" GST_PTR_FORMAT,
          priv->last_caps);
    }

This code assumes `priv->last_caps` is reset when a flush is received,
which makes sense, but unfortunately, there was no code in the flush
code path resetting it.

This patch adds such code, therefore fixing the race condition. A unit
test demonstrating the bug and testing its behavior with the fix has
also been added.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/2413>
2022-05-17 08:49:30 +00:00
U. Artie Eoff c9417a1dea videoaggregator: unref temporary caps
The "possible_caps" needs unref after finished using to
avoid memory leak.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/2430>
2022-05-16 22:38:13 +00:00
Seungha Yang 909154a989 qsv: Disable non-MSVC build on Windows
... and remove pointless UWP consideration that will never work.

Cross-compiled binary has an issue which causes deadlock.
Although cerbero will not build this plugin for non-MSVC build,
people can still build this plugin and may complain its brokenness.

See also
https://gitlab.freedesktop.org/gstreamer/cerbero/-/merge_requests/854

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/2431>
2022-05-17 03:32:10 +09:00
Shingo Kitagawa 92c0a462ae wavparse: fix typo in debug message
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/2425>
2022-05-16 19:31:18 +09:00
Stéphane Cerveau a5cd1adc97 gst-examples: continue if webrtc deps are not satisfied
The WebRTC examples are disabled if one dependency is
not satisfied, especially libsoup.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/2261>
2022-05-14 09:49:33 +00:00
Stéphane Cerveau 5c46099b8d gst-examples: change include for gtk in gtk-play
The gdk.h is not necessary but the gtk.h yes for
the GTK_CHECK_VERSION macro.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/2261>
2022-05-14 09:49:33 +00:00
Seungha Yang 1aca8ad289 tools: gst-play: Print position even if duration is unknown
Gives better visual feedback regarding position information
although duration is unknown, live streams for example.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/2365>
2022-05-13 21:39:35 +00:00
Diogo Goncalves acfc9ae216 avfvideosrc: fix wrong framerate selected for caps
This fix solves an issue where a format that doesn't support the
requested framerate would be selected. It ensures that we use the first
format and framerate pair that supports the requested caps.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/2331>
2022-05-13 19:38:45 +00:00
George Kiagiadakis 5294a720f8 ges-video-transition: add a new "fade-in" transition type
This transition is meant to be very similar to crossfade, but
instead of fading out the background video at the same time as the
foreground fades in, the background video stays at 100% opacity
during the whole transition.

This essentially "restores" the old crossfade behaviour that was changed in:
eb48faf342
but using a new type enum, so that both behaviours are available,
letting applications choose.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/2385>
2022-05-13 17:17:06 +03:00
Thibault Saunier 1cb4c050d0 rtpbin: Avoid holding lock GST_RTP_BIN_LOCK when emitting pad-added
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/2411>
2022-05-13 06:25:03 +00:00
Sebastian Dröge 1223324246 qtdemux: Don't use tfdt for parsing subsequent trun boxes
The timestamp in the tfdt refers to the first trun box and if there are
multiple trun boxes then the distance between the first timestamps will
grow.

At some point this distance reaches a threshold and triggers the
resetting of the first sample's timestamp of this trun box to be reset
to the tfdt.

This threshold is implemented for files where there is a jump in the
timeline between fragments and where this can be detected via a jump
between the end timestamp of the previous fragment and the tfdt of the
next. This behaviour is preserved.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/2409>
2022-05-13 04:19:36 +00:00
Seungha Yang 858520932c d3d11decoder: Add hardcoded minimum resolution values to caps for NVIDIA
NVIDIA GPUs have undocumented limitation regarding minimum resolution
and it can be queried via a NVDEC API. However, since we don't want to
bring CUDA/NVDEC API into D3D11, use hardcoded values for now
until we find a nice way for capability check.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/2406>
2022-05-12 18:20:26 +00:00
Sebastian Dröge fbf0cc2279 element: Add sanity check with a critical warning if a pad is requested for a pad template that is not installed on the element class
Various elements are assuming that the pointer matches a pad template
they know about, and also randomly created pad templates might be
missing some important information that is necessary to create a valid
pad.

For example, creating a new pad template for audiomixer's sinkpad
without providing the correct GType would cause audiomixer to create a
GstAggregatorPad. That will then later fail spectacularly because it
assumes that it got a GstAudioAggregatorPad.

Passing a pad template that does not belong to the element class in here
will easily lead to undefined behaviour.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/2410>
2022-05-12 17:29:26 +00:00
Guillaume Desmottes aa3b6a11e0 vpxenc: enforce strictly increasing pts
From vpx_codec_encode() documentation:
  "The presentation time stamp (PTS) MUST be strictly increasing."

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/2405>
2022-05-12 13:00:53 +02:00
Guillaume Desmottes 10b837ae5e vpxenc: conver input pts to running time
The input pts needs to be strictly increasing, see vpx_codec_encode() doc, so convert it to
running time as we don't want to reset the encoder for each segment.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/2405>
2022-05-12 13:00:53 +02:00
Guillaume Desmottes 1e829696e8 vpxenc: fix crash if encoder produces unmatching ts
If for some reason the encoder produces frames with a pts higher than
the input one, we were dropping all the video encoder frames and ended
up crashing when trying to access the pts of a NULL pointer returned by
gst_video_encoder_get_oldest_frame().

I hit this scenario by feeding a decreasing timestamp to vp8enc which
seem to confuse the encoder.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/2405>
2022-05-12 13:00:53 +02:00
Edward Hervey 7ac4dd3d9d mxfdemux: Handle files produced by legacy FFmpeg
Until March 2022, the FFmpeg MXF muxer would write the various index table
segments with the same instance ID, which should only be used if it is a
duplicate/repeated table.

In order to cope with those, we first compare the other index table segment
properties (body/index SID, start position) before comparing the instance
ID. This will ensure that we don't consider them as duplicate, but can still
detect "real" duplicates (which would have the same other properties).

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/2407>
2022-05-12 07:27:57 +02:00
Matthew Waters a1f30f5b9b gl/context: disable timer queries for ARM Mali-G52
Performing a timer query with a default framebuffer that is incomplete
(from using a surfaceless context) will produce GL errors.  Disable the
timer query on this platform to avoid the errors.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/2396>
2022-05-12 00:22:21 +00:00
Víctor Manuel Jáquez Leal 4c97ffeafb va: basedec: Always select first available format.
If the stream chroma doesn't match with any video format in the source
caps template (generated from va config surface formats) instead of
return unknown, return the first available format in the template,
assuming that the driver would be capable to do color conversions.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/2404>
2022-05-11 15:03:54 +02:00
Stéphane Cerveau 260c085a59 tests: test fixed caps
Add a test entry to check wether a caps is fixed
or not.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/2290>
2022-05-11 08:59:55 +02:00
Stéphane Cerveau 7f7084cd3a caps: warn with wrong mediatype in gst_caps_new_empty_simple
If passing ANY/EMPTY to gst_caps_new_empty_simple
as a mediatype, a warning will be displayed to alert
on this misuse of the API.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/2290>
2022-05-11 08:59:37 +02:00
Seungha Yang 8d40531f23 h265decoder: Improve robustness against malformed NAL packets
Use newly added gst_h265_parser_identify_and_split_nalu_hevc()
method to handle broken streams where packetized NAL unit
contain start code prefix in it.

It's obviously wrong stream but we know how to work around it
and even need to support such broken streams since
stateless decoder implementations are being a primary
decoder element.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/2394>
2022-05-10 03:59:47 +09:00
Seungha Yang be84fc23ca h265parser: Add a new NAL parsing API to handle malformed packets
Add gst_h265_parser_identify_and_split_nalu_hevc() method to
handle a case where packetized stream contains start-code prefix.
This new method behaves similar to exisiting gst_h265_parser_identify_nalu_hevc()
but it will scan start-code prefix to split given data into
NAL units.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/2394>
2022-05-10 03:58:51 +09:00
Víctor Manuel Jáquez Leal c47255d148 va: basedec: Select format from template or negotiated caps.
Instead of using a hard-coded list of preferred formats according the
chroma type, now if now caps are pre-negotiated, from template caps
will choose the first format with the same chroma type. If
pre-negotiated, then it will choose the first format, with same chroma
type, from the first caps structure.

Also all the decoders will check if GST_VIDEO_FORMAT_UNKNOWN is
returned, failing the negotiation.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/2351>
2022-05-09 08:50:58 +00:00
Nicolas Dufresne 522f19e013 v4l2videoenc: Setup crop rectangle if needed
Hantro H1 and Rockchip VEPU2 drivers will pad the width/height to a
multiple of 16. In order to obtain the right JPEG size, the image needs
to be cropped using the S_SELECTION API. This support is added as best
effort since older drivers may emulate this by looking at the capture
queue width/height.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/2329>
2022-05-07 11:35:14 +00:00
Víctor Manuel Jáquez Leal 13fbcde1e7 libs: va: Add O_CLOEXEC flag at opening drm device.
So any other potential subprocess won't have access to it.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/2386>
2022-05-07 09:55:36 +00:00
Olivier Crête 86105a4774 pcapparse: Set timestamp in DTS, not PTS
This matches the behaviour of basesrc, in particular, it matches the
behaviour of udpsrc, so it's easier to use to as a replacement to test
rtpjitterbuffer and other similar elements.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/2388>
2022-05-07 07:32:41 +00:00
Seungha Yang 66f017f8ea tools: device-monitor: Print string property as-is without serialize
gst_value_serialize() does more than what's needed to printf-ing
especially when given GValue is already string. Just print string
value as-is without gst_value_serialize() to avoid unreadable
string print, especially for multi-bytes character encoding cases.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/2387>
2022-05-07 04:43:49 +09:00
Dmitry Osipenko fd694d840a v4l2codecs: h264: Set frame type flags
V4L spec now requires decode_params flags to be set in accordance to the
frame's type. In particular this is required by H.264 decoder of NVIDIA
Tegra SoC to operate properly. Set the flags based on type of parsed
slices.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/1757>
2022-05-06 13:35:59 +00:00
Mengkejiergeli Ba efdd63d875 tests: Skip test if srtp element not built
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/2383>
2022-05-06 09:13:31 +00:00
Edward Hervey 53bb864244 playbin3: Cleanup and refactor combiner sourcecombine
* Remove fields no longer used, or that can be replaced by smaller code
* Rename "channels" to a more meaningful "input pads"
* Directly handle/use combiner pads in the combiners instead of on the playbin3
  main structure

Remove the corresponding combiner sinkpad whenever a uridecodebin3 source pad
goes away
* If used, store the corresponding combiner sink pad in the SourcePad helper
  structure

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/2384>
2022-05-06 09:10:09 +02:00
Seungha Yang 47ff41bcd2 d3d11memory: Protect against concurrent access from GPU and CPU to staging texture
Staging texture does not allow GPU access while it's CPU mapped.
But because we cannot block concurrent READ access by GstMemory design,
additional staging texture is still required.

Fixes: https://gitlab.freedesktop.org/gstreamer/gstreamer/-/issues/1182
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/2375>
2022-05-05 18:59:05 +00:00
Seungha Yang e0a9a73adf d3d11screencapturesrc: Fix crash when d3d11 device is different from owned one
GstD3D11ScreenCapture object is pipeline-independent global object
and the object can be shared by multiple src elements,
in order to overcome a limitation of DXGI Desktop Duplication API.
Note that the API allows only single capture session in a process for
a monitor.

Therefore GstD3D11ScreenCapture object must be able to handle a case
where a src element holds different GstD3D11Device object. Which can
happen when GstD3D11Device context is not shared by pipelines.

What's changed:
* Allocates capture texture with D3D11_RESOURCE_MISC_SHARED for the
  texture to be able to copied into other device's texture
* Holds additional shader objects per src element and use it when drawing
  mouse

Fixes: https://gitlab.freedesktop.org/gstreamer/gstreamer/-/issues/1197
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/2366>
2022-05-05 18:18:57 +00:00
Sebastian Dröge b247305bfd aggregator: Don't send multiple caps events with the same caps
Every time aggregator is reconfiguring it will try to negotiate new
caps. If these resulting caps are the same as the previously negotiated
caps then don't send a new caps event with the same caps again.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/2372>
2022-05-05 17:41:58 +00:00
Sebastian Dröge d2c6f21fc1 mp4mux: Disable aggregator's default negotiation
mp4mux can't negotiate caps with upstream/downstream and always outputs
specific caps based on the input streams. This will always happen before
it produces the first buffers.

By having the default aggregator negotiation enabled the same caps
would be pushed twice in the beginning, and again every time a
reconfigure event is received.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/2372>
2022-05-05 17:41:58 +00:00
Sebastian Dröge 7a679cc1f1 mxfmux: Disable aggregator's default negotiation
mxfmux can't negotiate caps with upstream/downstream and always outputs
specific caps based on the input streams. This will always happen before
it produces the first buffers.

By having the default aggregator negotiation enabled the same caps
would be pushed twice in the beginning, and again every time a
reconfigure event is received.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/2372>
2022-05-05 17:41:58 +00:00
Sebastian Dröge 52c419b799 mpegtsmux: Disable aggregator's default negotiation
mpegtsmux can't negotiate caps with upstream/downstream and always outputs
specific caps based on the input streams. This will always happen before
it produces the first buffers.

By having the default aggregator negotiation enabled the same caps
would be pushed twice in the beginning, and again every time a
reconfigure event is received.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/2372>
2022-05-05 17:41:58 +00:00
Sebastian Dröge 841cba4182 flvmux: Disable aggregator's default negotiation
flvmux can't negotiate caps with upstream/downstream and always outputs
specific caps based on the input streams. This will always happen before
it produces the first buffers.

By having the default aggregator negotiation enabled the same caps
would be pushed twice in the beginning, and again every time a
reconfigure event is received.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/2372>
2022-05-05 17:41:58 +00:00
Sebastian Dröge 90584e29d7 aggregator: Only send events up to CAPS event from gst_aggregator_set_src_caps()
Otherwise setting the srcpad caps based on the sinkpad caps event will
already push a segment event downstream before the upstream segment is
known.

If the upstream segments are just forwarded when the upstream segment
event arrives this would result in two segment events being sent
downstream, of which the first one will usually be simply wrong.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/2372>
2022-05-05 17:41:58 +00:00
Seungha Yang 8ec4452d67 h264decoder: Fix for unhandled low-delay decoding case
Baseclass calls get_preferred_output_delay() in a chain of
sequence header parsing and then new_sequence() is called
with required DPB size (includes render-delay) information.
Thus latency query should happen before the sequence header
parsing for subclass to report required render-delay accordingly
via get_preferred_output_delay() method.
(e.g., zero delay in case of live pipeline)

This commit is to fix wrong liveness signalling in case of
upstream packetized format.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/2363>
2022-05-05 14:54:54 +00:00
Seungha Yang ad136cb2c5 h265decoder: Fix for unhandled low-delay decoding case
Baseclass calls get_preferred_output_delay() in a chain of
sequence header parsing and then new_sequence() is called
with required DPB size (includes render-delay) information.
Thus latency query should happen before the sequence header
parsing for subclass to report required render-delay accordingly
via get_preferred_output_delay() method.
(e.g., zero delay in case of live pipeline)

This commit is to fix wrong liveness signalling in case of
upstream packetized format.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/2364>
2022-05-05 14:10:39 +00:00
Seungha Yang 58c94eed84 nvh264dec,nvh265dec: Don't realloc bitstream buffer per slice
Allocated memory size has not been updated which results in
realloc per slice. Fixing it and also release bitstream buffer
on ::close(), not finalize.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/2361>
2022-05-05 12:15:27 +00:00
Edward Hervey db758558e3 multiqueue: Increase initial interleave growth rate
In the case where not all streams have received any data, growing the interleave
by only 100ms is too restrictive and would cause some (valid) mpeg-ts streams to
hang.

Bump up the interleave growth rate for those use-cases to 500ms per input (still
up to the limit of 5s).

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/2370>
2022-05-05 09:02:05 +02:00
Jakub Adam 03b6dab006 d3d11screencapture: Set viewport when drawing mouse cursor
If there weren't any moved/dirty regions in the captured frame, the
viewport of the ID3D11DeviceContext would be left at whatever previous
value it had, which could lead to the cursor being drawn in a wrong
position and/or in an incorrect size.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/2362>
2022-05-04 17:18:32 +02:00
Matthew Waters f4f342aa78 wavparse: ensure that any pending segment is sent before an EOS event is sent
Specifically fixes seqnum handling when an aggregator-based element
(audiomixer et al) is downstream and a seek is performed that
immediately causes an EOS from wavparse.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/2356>
2022-05-04 08:00:02 +00:00
Edward Hervey 17aa70b888 parsebin: Don't modify inexistant GstStream
When handling exposing un-handled streams, we can only replace the GstStream for
those we are creating ourselves (i.e. the fallback collection).

Fixes assertions when the demuxer creates those streams

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/2353>
2022-05-04 07:26:39 +00:00
Edward Hervey 4be8b1b0a1 playbin3: Don't use unknown types for default selection
When creating a fallback default selection from a collection, don't attempt to
use unknown stream types

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/2353>
2022-05-04 07:26:39 +00:00
Olivier Crête 0e0c14c822 subprojects: Update libnice to 0.1.19
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/2354>
2022-05-03 18:49:36 -04:00
Seungha Yang 33e77782c6 nvcodec: Add AV1 decoder
Adding GstCodecs based AV1 decoder element

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/1453>
2022-05-04 01:23:25 +09:00
Seungha Yang 07cd1dcc6b av1decoder: Add support for render delay
Sync up with other decoder baseclass implementations

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/1453>
2022-05-04 01:23:25 +09:00
Seungha Yang 1b4121fded av1decoder: Hold OBU temporal and spatial id in picture struct
NVDEC API requires the information

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/1453>
2022-05-04 01:23:11 +09:00
Seungha Yang 1444dd91c5 meson: nvcodec: Remove unnecessary override option and fix build with non-MSVC
cpp_std=c++11 was hack for macOS build but we don't build this plugin
for Apple device anymore. And add "-Wno-deprecated-declarations"
compile option for gcc/clang

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/1453>
2022-05-04 01:10:07 +09:00
Seungha Yang fe4d6bb469 nvcodec: Bump SDK header version to 11.1
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/1453>
2022-05-03 23:56:34 +09:00
Seungha Yang 29aab904a8 nvdecoder: Handle DPB size margin in a single place
... instead of each subclass

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/2343>
2022-05-03 14:17:49 +00:00
Seungha Yang a8b2fbf77f d3d11decoder: Handle DPB size margin in a single place
... instead of each subclass

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/2343>
2022-05-03 14:17:49 +00:00
Seungha Yang 6a4c42c03f codecs: Signal required DPB size for AV1,MPEG2,VP8, and VP9 via new_sequence()
Make all codecs consistent so that subclass can know additional DPB
size requirement depending on render-delay configuration regardless
of codec. Note that render-delay feature is not implemented for AV1
yet but it's planned.

Also, consider new_sequence() is mandatory requirement, not optional

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/2343>
2022-05-03 14:17:49 +00:00
Sebastian Dröge 2eee3f4ca4 audioconvert: If no channel-mask can be fixated then use a NONE channel layout
Otherwise this is generating caps without a channel-mask, which is
invalid for >1 channels and will always fail negotiation.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/2350>
2022-05-03 13:41:07 +03:00
Nicolas Dufresne f35a507b19 doc: Update cache for NV12_4L4 and NV12_16LE32 gl support
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/2190>
2022-05-02 19:10:43 +00:00
Nicolas Dufresne 79ea87f256 opengl: Add NV12_4L4 conversion support
This format is produced notably by Hantro G1/G2 HW. Using a shader instead of
the Hantro embedded converter helps reduce drastrictly the memory usage at a
relatively small GPU overhead.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/2190>
2022-05-02 19:10:43 +00:00
Nicolas Dufresne 39615e4f3c opengl: Add NV12_16L32S conversion support
This adds a first detiling shader with initial support for
NV12_16L32S as produced by Mediatek decoders.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/2190>
2022-05-02 19:10:43 +00:00
Nicolas Dufresne 77a88c4572 glsl: Enable GLSL 1.30 if we have OpenGL 3.0/3.1
As implemented, we only support OpenGL 3 API from version 3.2. Though, there
is no issue enabling GLSL 1.30 even if we are going to restrict our API usage
to 2. This allows using texelFetch() on OpenGL 3.0 and 3.1 drivers.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/2190>
2022-05-02 19:10:43 +00:00
Nicolas Dufresne 4b4d607f4c opengl: Add low level support for tiled formats
This adds support for tiled format in stride and plane size
code.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/2190>
2022-05-02 19:10:43 +00:00
Nicolas Dufresne ab839f3642 v4l2codecs: Port to the new tile size helper
This will complete the scaling of width/height shift scaling
as only a partial implementation was made.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/2190>
2022-05-02 19:10:43 +00:00
Nicolas Dufresne 6a6c3687f1 video: Port video frame to the new tile size helper
This is now moved to the library, so it can be used in multiple
places.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/2190>
2022-05-02 19:10:43 +00:00
Nicolas Dufresne 8fcfc44c15 video: Add a helper to get the tile size information
Since the addition of tiling format with subsampled tile size
(NV12_16L32S), getting the tile width/height shifts and tile
size have become more complex. Add a helper to extract and
scale this information for the selected plane and format.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/2190>
2022-05-02 19:10:43 +00:00
Nicolas Dufresne 04339c8df5 eglimage: Add missing NV21/61 support
Caps would allow that, but selecting this format would lead to
an "no reached" assertion in the code.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/2190>
2022-05-02 19:10:43 +00:00
Thibault Saunier dd585ecfcc cuda: Fix introspection warnings
Fixes https://gitlab.freedesktop.org/gstreamer/gstreamer/-/issues/1183

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/2344>
2022-05-02 18:30:22 +00:00
Seungha Yang 1fb3804408 Revert "cuda: Fix GstCudaContext refcount bug"
This reverts commit df7ee0e215.

We should not unref it since gst_message_new_have_context()
takes ownership of the GstContext.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/2342>
2022-05-02 17:19:13 +00:00
Tim-Philipp Müller 5687568144 filesink: fix handling of non-existing paths with musl
Fixes #1194

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/2341>
2022-05-02 16:46:44 +00:00
Edward Hervey 89780341e8 tsdemux: Demote warning to simple debug
That issue is actually handled, so don't pollute the logs with such warning.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/2340>
2022-05-02 09:15:57 +02:00
Tim-Philipp Müller 1fbf1b30b3 registry: skip Rust dep builddirs when searching for plugins recursively
These artefacts confuse the plugin scanner and may cause noisy warnings
(and slow down things).

Fixes https://gitlab.freedesktop.org/gstreamer/gst-build/-/issues/68

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/2146>
2022-04-30 08:48:22 +00:00
Sebastian Dröge bf89c80d74 interlace: Also handle a missing "interlace-mode" field as progressive
Otherwise caps negotiation will fail in situations that are supposed
to work, like:

  "video/x-raw,framerate=(fraction)60/1" ! interlace field-pattern=0 ! "video/x-raw,framerate=(fraction)30/1"

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/2335>
2022-04-29 23:08:50 +00:00
Sebastian Dröge c7db9ce70b interlace: Add some more debug output to the getcaps function
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/2335>
2022-04-29 23:08:50 +00:00
Myles Inglis df7ee0e215 cuda: Fix GstCudaContext refcount bug
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/2334>
2022-04-29 22:22:25 +00:00
Ludvig Rappe 26263c194e webrtc: Fix memory leak in icestream
Since both g_value_set_object() and g_weak_ref_get() takes a reference
there will be two new references to the GstWebRTCICE object when there
should be only one. g_value_take_object() has the same functionality as
g_value_set_object() but does not take a reference.

Without this change, the GstWebRTCICE object will be leaked.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/2333>
2022-04-29 21:52:43 +00:00
Seungha Yang 9cd6f9d51e cuda: Correct CUDA device id field in GstContext structure
device id is unsigned int, not signed.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/2311>
2022-04-29 21:21:04 +00:00
Sebastian Dröge 7466444b63 rtpjitterbuffer: Free CNAME/SSRC mappings on finalize and PAUSED->READY
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/2336>
2022-04-29 23:33:47 +03:00
Sebastian Dröge 2c405da921 rtpmanager: Refactor RTCP packet loops to fix control flow
Mixing C loops with switch statements is a bad idea as break has a
different meaning in both. Breaking inside the switch statements wrongly
caused further loop iterations.

Instead use goto to get out of the loop and continue to do another loop
iteration, and never ever use break except for the end of a case.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/2336>
2022-04-29 23:13:15 +03:00
Seungha Yang 6619f1611f rtpjitterbuffer: Initialize variables
Avoid use of uninitialized variable
Fixing MSVC warning
gstrtpjitterbuffer.c(4733) : warning C4700: uninitialized local variable 'have_sdes' used

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/2315>
2022-04-28 12:37:13 +00:00
Víctor Manuel Jáquez Leal 245e5e3dfd codecs: h265decoder: Fix documentation.
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/2328>
2022-04-28 11:58:20 +00:00
Edward Hervey 7c9eb0335f mssdemux2: Don't expose/use streams we can't handle yet
Avoids issues further down

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/2319>
2022-04-28 10:45:37 +00:00
Edward Hervey 2ec79418df mssdemux2: Ensure stream/track uniqueness
If there is more than one track of the same type (say audio), we would end up
creating several stream/types with the same name.

Instead use the MSS stream name property to make them unique

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/2319>
2022-04-28 10:45:37 +00:00
Edward Hervey 10f72da504 mpegts: Handle "empty" PMT gracefully
Some streams have 2 PMT sections in a single TS packet. The first one is "valid"
but doesn't contain/define any streams. That causes an unrecoverable issue when
we try to activate the 2nd (valid) PMT.

Instead of doing that, pre-emptively refuse to process PMT without any streams
present within. We still do post that section on the bus to inform applications.

Fixes #1181

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/2310>
2022-04-28 09:36:54 +00:00
Stéphane Cerveau 853963ba21 pythonplugin: fails silently on plugin issue
If a gst python plugin fails to load, the meta plugin
should continue to try loading the following.
If no plugin can be loaded, the meta plugin should
not be blacklisted by returning false.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/2253>
2022-04-28 08:57:47 +00:00
Stéphane Cerveau fcc6fa21e9 srtp: fix flaky unit test
Use different port for each test to avoid other UDP
packet to be received.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/2294>
2022-04-28 07:53:19 +00:00
Philippe Normand b8e3d167ea videodecoder: release stream lock after handling gap events
The stream lock is taken before handling gap events but was not released in all
possible runtime situations. This issue was introduced in:
https://gitlab.freedesktop.org/gstreamer/gst-plugins-base/-/merge_requests/1274

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/2307>
2022-04-28 07:12:28 +00:00
Matthew Waters 0f9f179bec subparse: don't deref a potentially NULL variable
If the html SAMI data is malformed, then retrieving the attribute name
may fail.  We then cannot retrieve the attribute value.

Fixes: https://oss-fuzz.com/testcase-detail/4700130671984640
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/2317>
2022-04-28 15:35:12 +10:00
Seungha Yang 4047653275 d3d11h265dec: Assign PRIMARY + 1 rank
Promote d3d11h265dec to be default one if available

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/2314>
2022-04-27 20:06:53 +00:00
Seungha Yang dce45586e8 nvvp9sldec: Increase DPB size to cover render delay
This should've included in the previous MR
https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/987
already, but missed.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/2313>
2022-04-27 18:35:07 +00:00
Edward Hervey 0125d7525a parsebin: Expose streams of unknown type
This actually respects the existing `expose-all-streams` property by exposing
them and having them present in the stream collection (as streams of type
unknown).

Fixes #1179

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/2309>
2022-04-27 16:24:55 +00:00
Thibault Saunier 4fd3886f5d qroverlay: Reset data_changed after we use the info
It was never reset so it was always TRUE once the data was changed!

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/2299>
2022-04-27 15:09:47 +00:00
Thibault Saunier 1b31a2af45 qroverlay: Add a GstQROverlay meta
See documentation

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/2299>
2022-04-27 15:09:47 +00:00
dongil.park 5b11e6a3d0 wavparse: Unset DISCONT buffer flag for divided into multiple buffers in push mode
In push mode (streaming), if the received chunk buffer size from _chain is bigger
than output buffer size, the flags of the divided-buffers are propagated to the
DISCONT flag from first received chunk buffer. This unexpected buffers contained DISCONT
flags are abnormally transformed when changing the sampling rate by audioresample element.
So unset unnecessary DISCONT flag before pad_push().

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/2305>
2022-04-27 14:29:10 +00:00
Edward Hervey 9e2bb037f0 playbin2: Remove dead code
blacklisted_mimes has been empty for ages. Remove the code "using" it.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/2306>
2022-04-27 13:13:17 +00:00
Mathieu Duponchelle 14b37268f6 timeoverlay: add support for reference timestamp time mode
+ update date-time mode to actually use the timestamp that
  was selected with the time-mode property

Co-authored-by: Sebastian Dröge <sebastian@centricular.com>
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/2252>
2022-04-27 12:35:21 +00:00
Sebastian Dröge 9d5179ad3f rtpjitterbuffer: add the reference timestamp meta in more situations
Previously, we only added it when actually performing synchronization
based on the NTP time.

The information can be useful downstream in other situations too, and
we can compute a NTP time as soon as we get a sender report with the
relevant information.

Co-authored-by: Mathieu Duponchelle <mathieu@centricular.com>
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/2252>
2022-04-27 12:35:21 +00:00
Sebastian Dröge ed425e2785 rtpgstpay: Don't push packets before the first input buffer is received
It's not possible to create a valid RTP timestamp for them, which would
cause a potentially very big RTP timestamp discontinuity between those
first packets (created from initial events) and the packet based on the
first input buffer.

As a side-effect, also simplify the packet aggregation code a bit and
work with only a single level of buffer lists.

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

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/2250>
2022-04-27 11:55:17 +00:00
Mathieu Duponchelle a03db32bbe rtpbasepayload: always store input buffer meta before negotiation
The decision to store the input buffer depends on whether extensions
are to be added to the output buffer, I assume as an optimization.

This creates an issue for subclasses that call negotiate(), where
header_exts is actually populated, from their handle_buffer()
implementation: at chain time, no header extension has been negotiated
yet, which means that we don't add extensions to the first batch of
buffers that comes out.

Keep track of whether negotiate has been called (this is different
from the negotiated field) and always store the input buffer until
then. This fixes the issue while largely preserving the optimization.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/2304>
2022-04-27 08:43:30 +00:00
Mathieu Duponchelle 4cd3830bc8 tests/onvif: improve robustness
The previous iteration of the code was inferring the type of the
frame by looking at the overall size of the gst-payloaded packet.

It is more robust to actually parse the payload and look at the
actual data buffers it contains.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/2303>
2022-04-27 06:39:24 +00:00
Mathieu Duponchelle 9689693534 tests/onvif: don't push buffers outside segment
segment->stop is exclusive, so in reverse playback mode we do not
need to output a buffer at that position as it will simply get
clipped in basesink.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/2303>
2022-04-27 06:39:24 +00:00
Mathieu Duponchelle efc29565d6 rtponviftimestamp: add extension data to all packets ..
regardless of whether they are input as individual buffers or
buffer lists.

The ONVIF specification requires all packets to hold the extension,
it makes no sense to behave differently when handling buffer lists.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/2303>
2022-04-27 06:39:24 +00:00
Thibault Saunier 3c959ff53e cudaconvert: Enhance debugging when setting video info fails
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/2300>
2022-04-26 19:04:06 +00:00
He Junyan 9ec4041a51 codecparsers: bitwriter: Calculate PicSizeInCtbsY when writing slice header.
The slice->pps->PicWidthInCtbsY/PicHeightInCtbsY values are calculated when
 we parse the slice header. But they are not calculated in bitwriter and so
 may not have valid value when writing slice header.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/2287>
2022-04-26 16:04:15 +00:00
He Junyan abf19020a4 codecparsers: bitwriter: Fix some coverity issues of H265 bitwriter.
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/2287>
2022-04-26 16:04:15 +00:00
He Junyan f55b36e6aa videoscale: Fix the src video info error in transfer_colorimetry_from_input()
Pipeline such as:
gst-launch-1.0 -vf videotestsrc ! video/x-raw,format=NV12,colorimetry=\(string\)bt709 \
 ! videoscale ! video/x-raw,format=I420 ! fakesink
Always trigger a error:
ERROR             video-info video-info.c:556:gst_video_info_from_caps: no width property given

Because it is called before the fixate_size(), the src caps' resolution
may be absent or not fixed. That causes that the src video info can not
be created correctly and we can not inherit the colorimetry and chroma-site
from the input caps.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/2289>
2022-04-26 14:17:50 +00:00
Guillaume Desmottes c0d7d5c2c8 videorate: fix assertion when pushing last and only buffer without duration
Fixing this pipeline:
  gst-launch-1.0 filesrc location=sample.png ! pngdec ! videorate ! fakesink

- videorate receives a single buffer with pts = 0, duration = invalid;
- then it receives eos triggering this buffer to be pushed downstream;
- the pushing code was assuming that a duration was set, which is
  impossible as we received a single buffer and no output framerate was
  set either. So the best we can do is to push the buffer without
  duration.

Fix #1177

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/2296>
2022-04-26 13:43:56 +00:00
He Junyan 264e577e7e va: dec: Use gst_buffer_pool_config_set_va_alignment() to set alignment.
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/2282>
2022-04-26 20:26:09 +08:00
He Junyan 163cbd5892 va: pool: Replace all tabs with spaces in header file.
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/2282>
2022-04-26 20:26:06 +08:00
He Junyan fac57fcb8d va: pool: Delete the GST_BUFFER_POOL_OPTION_VIDEO_ALIGNMENT.
The va pool is used for GPU side surface/image, its alignment should
not be changed arbitrarily by others. So we decide not to expose the
GST_BUFFER_POOL_OPTION_VIDEO_ALIGNMENT flag anymore.
Instead, user can call gst_buffer_pool_config_set_va_alignment() to
set its surface/image alignment.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/2282>
2022-04-26 20:26:02 +08:00
He Junyan fd81cb2ad4 va: pool: Add set_va_alignment() API.
We want to use gst_buffer_pool_config_set_va_alignment() to replace
gst_buffer_pool_config_get_video_alignment(). The later one is specific
for GST_BUFFER_POOL_OPTION_VIDEO_ALIGNMENT option.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/2282>
2022-04-26 20:25:57 +08:00
Havard Graff 390ec99f1b rtptwcc: don't map the buffer twice
...and use the pt extracted rather than the one from RTPPacketInfo
when logging.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/2271>
2022-04-26 10:27:25 +00:00
Thibault Saunier d673a90aea rtpsession: Emit "notify::stats" when we update stats from RR or SR
Sensibily optimizing caching the pspecs and using them directly

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/2266>
2022-04-26 08:49:42 +00:00
Edward Hervey 7b5f867e40 oggdemux: Protect against invalid framerates
This check wasn't done for all mappings.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/2295>
2022-04-26 09:29:39 +02:00
He Junyan b2aaf0f2e5 av1parse: Fix a latent memory leak in colorimetry setting.
Also delete the useless "have_cinfo" judgement.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/2288>
2022-04-26 02:14:15 +00:00
He Junyan 164e01b14e av1parse: Correct the meaning of color_range flag.
According to spec:
color range equal to 0 shall be referred to as the studio swing
representation and color range equal to 1 shall be referred to as
the full swing representation.

The current status is just the opposite.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/2288>
2022-04-26 02:14:15 +00:00
Seungha Yang 81ee2a9f2a qsvencoder: Workaround for invalid DTS with VP9
SDK runtime seems to report zero DTS for all frames in case of VP9 but
we don't need to use DTS for the codec.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/2291>
2022-04-26 04:51:54 +09:00
Seungha Yang 205a23f456 nvcodec: Stop building for non-{Windows,Linux} target
The other platforms, specifically macOS have not been supported already
because this plugin loads so or dll. Moreover, NVIDIA dropped
support for macOS as of CUDA 11.0. See also
https://developer.nvidia.com/nvidia-cuda-toolkit-11_0_0-developer-tools-mac-hosts

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/2283>
2022-04-25 15:50:52 +00:00
Stéphane Cerveau 12776ba0fd srtp: add unit tests
Enable unit tests in meson.build
Add test_play_key_error to check the stats

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/2027>
2022-04-25 13:57:42 +00:00
Stéphane Cerveau c77d07752a srtpdec: add counts in stats
In order to count the buffers which have been received and dropped for
decryption reason, add a stats to track it.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/2027>
2022-04-25 13:57:42 +00:00
Seungha Yang 9f19ca68b3 d3d11videosink: Fix for unhandled mouse double click events
Only window created with CS_DBLCLKS style can receive those mouse
double click events, so we need to use the style for internal/external
windows can get double click events.

Also, passthrough mouse events to parent window in the same message pumping
threads instead of manually forwarding each mouse event.

Fixes: https://gitlab.freedesktop.org/gstreamer/gstreamer/-/issues/1172
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/2277>
2022-04-23 13:20:54 +00:00
Mathieu Duponchelle 3391a7d499 rtpredenc: quieten warning about ignoring header extensions
Turn it into a FIXME, and only log once

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/2279>
2022-04-23 01:04:54 +00:00
Xavier Claessens 1a0eea3299 Meson: Fix deprecation warnings
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/1876>
2022-04-23 00:33:00 +00:00
Stéphane Cerveau 9d6a7dbdf3 rvsg: fix cairo include
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/2276>
2022-04-23 00:00:23 +00:00
Sebastian Dröge 760b070db9 Revert "videorate: Update the base time on segment updates"
This reverts commit 75b4809ebc.

See https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/2186

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/2254>
2022-04-22 23:05:57 +00:00
Sebastian Dröge c39fb85c9b Revert "videorate: Add test for segment update"
This reverts commit a76f38b2c7.

See https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/2186

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/2254>
2022-04-22 23:05:57 +00:00
Sebastian Dröge 2599cf573a Revert "videorate: Only "close" the segment if it is discontinous"
This reverts commit 6f7922b4db.

See https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/2186

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/2254>
2022-04-22 23:05:57 +00:00
Sebastian Dröge 98112a3ddc Revert "videorate: Drop incoming buffers that are outside of the segment"
This reverts commit 24fd80344d.

See https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/2186

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/2254>
2022-04-22 23:05:57 +00:00
Sebastian Dröge a797962d26 Revert "videorate: Add unit test for closing a segment and opening a separate one"
This reverts commit 98f2a84a28.

See https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/2186

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/2254>
2022-04-22 23:05:57 +00:00
Havard Graff b7b71e6974 rtprtxsend: mark RTX buffers with GST_RTP_BUFFER_FLAG_RETRANSMISSION
It is useful for elements downstream from rtxsend to know if the RTP
buffer they are dealing with is an RTX buffer or not.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/2272>
2022-04-22 19:27:45 +00:00
Corentin Damman df64280874 cuda-converter: fix nvrtc compilation on non-English locale systems
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/2268>
2022-04-22 18:57:22 +00:00
Pierre Bourré 4ac544d5aa rtspclientsink: fix possible shutdown deadlock collect_streams()
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/1696>
2022-04-22 18:14:04 +00:00
Mathieu Duponchelle 4ef3b1ad8f videoaggregator: keep old buffer when processing a MISSING_DATA gap
GAP events flagged with MISSING_DATA are transformed into GAP buffers
flagged with CORRUPTED.

In these cases, it is preferable to simply keep rendering the previous
buffer (if there was one) instead of flashing the pad in and out of
view.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/708>
2022-04-22 17:43:50 +00:00
Mathieu Duponchelle 7988acad36 compositor: fix prepare_frame obscuring check
A pad without a buffer or with a GAP buffer cannot obscure a
pad below it. Ignore those when considering whether a pad should
be drawn.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/708>
2022-04-22 17:43:50 +00:00