Commit graph

99 commits

Author SHA1 Message Date
Jochen Henneberg d086491909 rtpbasedepayload: Fixed HdrExt handling for aggregated output buffer
If a depayloader aggregates multiple RTP buffers into one buffer only
the last RTP buffer was checked for header extensions. Now the
depayloader remembers all RTP packets pushed before a output buffer is
pushed and checks all RTP buffers for header extensions.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/4979>
2023-08-15 07:12:03 +02:00
Nicolas Dufresne d604b3655e video: Add Mediatek 10bit formats
These 10bit formats are identical to NV12_16L32S, but 64bytes of data is being
prefixed with 16bytes data with four pixels of lower 2bits per byte. For
MT2110T, the lower two bits set so each bytes contains a column of 4 pixels,
also describe as tiled lower 2 bits. MT2110T has been chosen as a name to match
the vendor chosen name. This format is unlikely to exist for other vendors.

For MT2110R, the 2 low bits are in raster order.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/3444>
2023-08-08 16:08:16 +00:00
Roman Lebedev 8b1500d7ff volume: support arbitrarily-large positive gains
The current limit is `x10`, which allows just `+20 dB` of gain.

While it may seem sufficient, this came up as a problem
in a real-world, non-specially-engineered situation,
in strawberry's EBU R 128 loudness normalization.
(https://github.com/strawberrymusicplayer/strawberry/pull/1216)

There is an audio track (that was not intentionally engineered that way),
that has integrated loudness of `-38 LUFS`,
and if we want to normalize it's loudness to e.g. `-16 LUFS`,
which is a very reasonable thing to do,
we need to apply gain of `+22 dB`,
which is larger than `+20 dB`, and we fail...

I think it should allow at least `+96 dB` of gain,
and therefore should be at `10^(96/20) ~= 63096`.

But, i don't see why we need to put any specific restriction
on that parameter in the first place, other than the fact
that the fixed-point multiplication scheme does not support volume
larger than 15x-ish.

So let's just implement a floating-point fall-back path
that does not involve fixed-point multiplication
and lift the restriction altogether?

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/5063>
2023-08-07 13:17:45 +00:00
Matthew Waters 5bf85e7588 gl/colorconvert: use swizzle indices instead of chars
Allows using a uniform to control which value goes where and not rewrite
the shader for every format combination.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/5109>
2023-07-28 03:29:08 +00:00
He Junyan 3593d5eea8 test: video: Fix the caps comparing typo for video drm test case
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/5107>
2023-07-26 20:49:02 +00:00
Seungha Yang 792eb0cf48 tests: compositor: Fix race in buffer unref
Don't assume that compositor will output only single buffer
for single input buffer. If buffer's running time is not completly
aligned to output buffer running time or duration, compositor
can generate multiple buffers. If that happens, two threads,
one is aggregator output thread and main thread were trying
to modify buffer in this test. Clear the buffer after
shutting down pipeline to avoid the race.

Fixes: https://gitlab.freedesktop.org/gstreamer/gstreamer/-/issues/2836
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/5081>
2023-07-21 00:59:59 +09:00
Seungha Yang 3a5978def1 tests: compositor: Remove whitespace
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/5081>
2023-07-21 00:46:55 +09:00
Roman Lebedev dfe67ba7c6 volume: print actual produced values, not bytes
`map.data` is a pointer to a byte array,
we need to first cast it to the pointer to the expected element type,
otherwise we will get not what we are expecting.

I have stumbled into this in https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/5063#note_2007447

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/5075>
2023-07-19 19:54:38 +00:00
He Junyan e14d4e08c1 test: Update all video related tests because of adding DMA_DRM format
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/4981>
2023-07-19 09:57:50 +00:00
Ruslan Khamidullin 9ec5ee2984 video: add extensive tests for gst_video_time_code_is_valid()
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/5028>
2023-07-18 13:46:57 +00:00
Andoni Morales Alastruey fcf2d8c350 videodecoder: fix segfault copying buffer metas
The current implementation copies metas without checking if the buffer
is writable.

The operation that needs to be done, replacing the input buffer and
copying the metas, is only part of that process. We create a new function
that does both.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/4912>
2023-07-18 07:39:02 +00:00
Nirbheek Chauhan 8e1b6accbd meson: Always use forward slashes in defines with paths
Fixes the following build failure on MSYS2:

```
../subprojects/gstreamer/tests/check/elements/filesrc.c: In function 'test_seeking':
../subprojects/gstreamer/tests/check/elements/filesrc.c:107:53: error: incomplete universal character name \U
  107 |   g_object_set (G_OBJECT (src), "location", TESTFILE, NULL);
      |                                                     ^
../subprojects/gstreamer/tests/check/elements/filesrc.c:107:53: warning: unknown escape sequence: '\A'
../subprojects/gstreamer/tests/check/elements/filesrc.c:107:53: warning: unknown escape sequence: '\g'
../subprojects/gstreamer/tests/check/elements/filesrc.c:107:53: warning: unknown escape sequence: '\s'
../subprojects/gstreamer/tests/check/elements/filesrc.c:107:53: warning: unknown escape sequence: '\g'
../subprojects/gstreamer/tests/check/elements/filesrc.c:107:53: warning: unknown escape sequence: '\c'
```

Due to: `-DTESTFILE=\"C:\\Users\\Administrator\[...]`

https://gitlab.freedesktop.org/nirbheek/gstreamer/-/jobs/45317733

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/5018>
2023-07-12 21:17:25 +00:00
Matthew Waters cae434c6ff videorate: properly handle variable framerate input and drop-only=true
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/4969>
2023-07-05 19:33:59 +00:00
Alicia Boya García 8c628fa325 validate tests: include debugutilsbad to be able to use testsrcbin
Fixes test: validate.uridecodebin.expose_raw_pad_caps

testsrcbin (currently part of debugutilsbad) is an useful element for
validate tests.

validate.uridecodebin.expose_raw_pad_caps makes use of it.
Unfortunately, because validate tests with GStreamer only run with
whitelisted plugins and `debugutilsbad` wasn't in the whitelist, the
test was failing and being auto-skipped.

This patch adds debugutilsbad to the whitelists used by validate tests
in subprojects with a validate/meson.build.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/4931>
2023-06-27 10:13:19 +00:00
Carlos Rafael Giani 8c5a8f4466 dsd: Add code for DSD audio support
Related to:

https://gitlab.freedesktop.org/gstreamer/gst-plugins-base/-/issues/972

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/3901>
2023-06-23 01:27:03 +00:00
Nicolas Dufresne c17e648fcf video: Add NV12_10LE32_4L4 tiled format
This 10bit format is identical to NV12_4L4, but uses NV12_10LE40 format
internally. In show, the tiles is made af 4 rows of 5 bytes, which contains
4 fully packed 10bit values.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/3447>
2023-06-15 14:32:32 +00:00
Seungha Yang e953f38789 tests: compositor: Add tests for data flow after EOS scenario
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/4783>
2023-06-09 19:58:38 +09:00
Stéphane Cerveau dd17beb681 gstreamer-full: add full static support
Allow a project to use gstreamer-full as a static library
and link to create a binary without dependencies.

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

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

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

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

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

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/4741>
2023-05-31 04:26:12 +00:00
Víctor Manuel Jáquez Leal 1477ed1ae5 video-info-dma: add gst_video_info_dma_drm_from_video_info()
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/4680>
2023-05-30 20:09:27 +00:00
Philippe Normand b2e121054d sdp: Add API to remove media from a SDP message
Based on initial patch by Stefano Buora.
https://gitlab.freedesktop.org/gstreamer/gst-plugins-base/-/merge_requests/579

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/4670>
2023-05-20 09:23:17 +01:00
Michael Olbrich b660f258a6 theoradec: make sure the selected pool accepts the new config
If gst_buffer_pool_set_config() fails then the pool will use its old
config. This may include different width or height when
pic_width/pic_height != frame_width/frame_height.
As a result, the assertions in theora_handle_image() will fail.

So check the result of gst_buffer_pool_set_config() and only use the pool
if it succeeds. Otherwise let the parrent decide_allocation() create a new
pool.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/4600>
2023-05-12 14:37:06 +02:00
Sebastian Dröge 83106de7e7 video: timecode: Add support for framerates lower than 1fps
These are not explicitly defined but the existing calculations can be
extended to also cover that case by inverting them to avoid floating
point calculations.

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

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/4374>
2023-04-17 10:26:11 +00:00
Jan Alexander Steffens (heftig) 77bc9b4a33 tests: allocators: Fix fdmem test with recent GLib
The test failed with recent GLib, where `g_close` emits a critical
warning on EBADF. Remove the `g_close` check from `test_fdmem` and add
another version that tests `GST_FD_MEMORY_FLAG_DONT_CLOSE`.

We will depend on the Valgrind test run to warn us about leaked FDs.

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

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

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

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

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/4297>
2023-04-05 11:11:46 +00:00
Guillaume Desmottes 4587a70998 tests: appsrc: test_appsrc_send_custom_event: check that event was actually received
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/4297>
2023-04-05 11:11:46 +00:00
Shengqi Yu 96a46e31c7 appsink: add propose_allocation support
Adding propose_allocation is to meet the requirement of Application to
request buffers. Application sometimes need to create buffer pool
and request buffers to maintain buffer management itself, and Gstreamer plugin
import Application's buffers to use. So, add propose_allocation in
appsink like waylandsink and kmssink etc.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/4185>
2023-03-27 12:34:16 +03:00
Tobias Rapp c467ac0869 gst-plugins-base: Add FourCC and type description for FFVHuff video
The FFVHuff video codec is a FFmpeg-specific variant of the lossless
HuffYUV codec with increased coverage of supported pixel formats and bit
depths.

Fixes #2389.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/4250>
2023-03-23 14:30:59 +00:00
Tim-Philipp Müller 8759b77a50 gst-plugins-base: re-indent with GNU indent 2.2.12
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/4182>
2023-03-17 03:18:53 +00:00
Víctor Manuel Jáquez Leal 6c71654991 tests: add tests for GstVideoInfoDmaDrm
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/4043>
2023-03-12 03:09:01 +00:00
Seungha Yang 5249b09e04 examples: win32-videooverlay: Fix for window freezing
Read and flush console buffer from the console thread immediately,
instead of main thread. Otherwise (if main thread is busy)
the console thread will keep adding idle source and then main thread
will be unresponsive.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/4067>
2023-02-25 20:53:55 +09:00
Tim-Philipp Müller 7657b8cb51 tests: rtp: drop use of GSlice
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/3695>
2023-01-24 15:25:06 +00:00
Tim-Philipp Müller d2ef7819d3 tests: interactive: test-effect-switch: use autovideosink
Also works on Windows.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/3703>
2023-01-10 13:28:30 +00:00
Sebastian Dröge 4df3da3bab rtpbuffer: Initialize extended timestamp to the first wraparound period
This allows correct handling of wrapping around backwards during the
first wraparound period and avoids the infamous "Cannot unwrap, any
wrapping took place yet" error message.

It allows makes sure that for actual timestamp jumps a valid value is
returned instead of 0, which then allows the caller to handle it
properly. Not having this can have the caller see the same timestamp (0)
for a very long time, which for example can cause rtpjitterbuffer to
output the same timestamp for a very long time.

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

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/3202>
2022-10-18 06:09:08 +00:00
Thibault Saunier 11b83fb2fc videorate: Handle closing segment on EOS right after caps event
The scenario is what we try in the tests:
- we have a segment with .stop set
- some frame(s) flow
- we get a CAPS event
- we get an EOS (before getting buffers after the CAPS event)

in that case, without that patch, the segment is not properly closed
which is not correct. In this patch we keep track of previous caps until
a new buffer arrives, this way in that situation we set previous caps
again, and close the segment with the previous buffer.

Fixes: https://gitlab.freedesktop.org/gstreamer/gstreamer/-/issues/1352
in this specific case

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/3059>
2022-10-11 11:48:09 -03:00
Tim-Philipp Müller 4c8a621809 pbutils: descriptions: add meta/x-klv
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/3094>
2022-09-30 11:08:45 +03:00
Tim-Philipp Müller 2d53f9f97c pbutils: descriptions: fix gst_pb_utils_get_caps_description_flags()
And add a little unit test.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/3094>
2022-09-30 11:08:45 +03:00
Sebastian Dröge d2c13f0c26 test-effect-switch: Fix some memory leaks and make effect element ownership clearer
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/3091>
2022-09-29 22:34:37 +00:00
Thibault Saunier bb840bd116 videorate: Add a max-closing-segment-duplication-duration property
This allows users to let videorate fully fill the segments when received
EOS or on new segment, removing an arbitrary limit of 25 duplicates which
might not be what the user wants (for example on low FPS stream in GES,
that sometimes leaded to broken behavior)

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/3000>
2022-09-20 13:23:02 +00:00
Thibault Saunier 1c6adcab89 uridecodebin: Ensure that pads caps are set before exposing them
We are supposed to guarantee that pads that are exposed have the caps
set, but for sources that have pad with "all raw caps" templates, we end
up exposing pads that don't have caps set yet, which can break code (in
GES for example).

To avoid that we let uridecodebin plug a `decodebin` after such pads and
let decodebin to handle that for us. In the end the only thing that
decodebin does in those cases is to wait for pads to be ready and expose
them, after that `uridecodebin` will expose those pads.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/3009>
2022-09-15 19:25:01 +00:00
Guillaume Desmottes cb1dc5c9ac base: video-converter: add accessors for input and output formats
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/2905>
2022-08-17 12:33:54 +00:00
Seungha Yang 0d5c937642 Revert "videoconvertscale: Add properties to disable scaling/converting in videoconvert/videoscale"
This reverts commit cd7a91cef1.

Reverting properties, scaling in videoconvert and converting in
videoscale will be disabled by the other commit

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/2778>
2022-08-16 12:08:36 +00:00
Sebastian Dröge edb0e47074 rtspurl: Use gst_uri_join_strings() in gst_rtsp_url_get_request_uri_with_control() instead of a hand-crafted, wrong version
For example the query string of the base must not be taken over to the
request URL unless there is no control path, and control paths can be
absolute and must not be considered relative if they start with a /.

Fixes https://gitlab.freedesktop.org/gstreamer/gst-plugins-good/-/issues/971

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/2868>
2022-08-12 18:52:29 +00:00
Sebastian Dröge d69616b6ba rtspurl: Use fail_unless_equals_string() in tests
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/2868>
2022-08-12 18:52:29 +00:00
Seungha Yang 2ed64cad6a video-color: Add primaries and colorimetry compare functions
SMPTE 170M and 240M use the same RGB and white point coordinates
and therefore both primaries can be considered functionally
equivalent.
Also, some transfer functions have different name but equal
gamma functions. Adding another colorimetry compare function
to deal with thoes cases at once

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/2765>
2022-07-18 08:56:45 +00:00
Tim-Philipp Müller 84a3b0ef87 samiparse: fix handling of self-closing tags
We would check the wrong string (rest of line rather than element)
for the / suffix of self-closing tags, which is not only wrong but
also has atrocious performance with certain strings like the garbled
nonsense clusterfuzz feeds us, which might cause discoverer to time
out when processing garbled SAMI files.

Fixes https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=47461

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/2685>
2022-07-01 17:24:52 +00:00
James Hilliard 4902076968 videorate: remove property-value quotes
Fixes warnings like:
Received a structure string that contains '="0.5"'. Reading as a gdouble value, rather than a string value. This is undesired behaviour, and with GStreamer 1.22  onward, this will be interpreted as a string value instead because it is wrapped in '"' quotes. If you want to guarantee this value is read as a string, before this change, use '=(string)"0.5"' instead. If you want to read in a gdouble value, leave its value unquoted.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/2621>
2022-06-29 00:36:17 +00: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
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