Commit graph

291 commits

Author SHA1 Message Date
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
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
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
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
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 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
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
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
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
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
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
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
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
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
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
Mathieu Duponchelle cc3a79d7f1 compositor: a pad without a frame can't obscure the background
Skip those when considering whether the background should be
drawn

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/708>
2022-04-22 17:43:50 +00:00
Olivier Crête 2613930372 videoscale: Add test to ensure that non-scaled metas are kept
Just make sure that we're not breaking non-scaled metas

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/1630>
2022-04-22 13:00:01 +00:00
James Cowgill 2290af332b videoscale: Add test for transform_meta function
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/1630>
2022-04-22 13:00:01 +00:00
James Cowgill c8a24146c4 videoscale: Don't copy scaled metas
Returning TRUE from the `transform_meta` function tells
GstBaseTransform to copy the meta into the new buffer. If videoscale
has already transformed a meta by scaling it, it should always return
FALSE to avoid duplicating the meta.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/1630>
2022-04-22 13:00:01 +00:00
Nirbheek Chauhan 52d7370311 x11: Fix unused variable warnings
These are emitted when XInput 2 is not available.

```
../subprojects/gst-plugins-base/sys/ximage/ximagesink.c: In function ‘gst_x_image_sink_handle_xevents’:
../subprojects/gst-plugins-base/sys/ximage/ximagesink.c:696:29: warning: unused variable ‘state’ [-Wunused-variable]
  696 |   GstNavigationModifierType state = GST_NAVIGATION_MODIFIER_NONE;
      |                             ^~~~~
../subprojects/gst-plugins-base/sys/ximage/ximagesink.c:694:35: warning: unused variable ‘touch_frame_open’ [-Wunused-variable]
  694 |   gboolean pointer_moved = FALSE, touch_frame_open = FALSE;
      |                                   ^~~~~~~~~~~~~~~~
../subprojects/gst-plugins-base/sys/xvimage/xvimagesink.c: In function ‘gst_xv_image_sink_handle_xevents’:
../subprojects/gst-plugins-base/sys/xvimage/xvimagesink.c:427:35: warning: unused variable ‘touch_frame_open’ [-Wunused-variable]
  427 |   gboolean pointer_moved = FALSE, touch_frame_open = FALSE;
      |                                   ^~~~~~~~~~~~~~~~
../subprojects/gst-plugins-base/sys/xvimage/xvimagesink.c:426:29: warning: unused variable ‘state’ [-Wunused-variable]
  426 |   GstNavigationModifierType state = GST_NAVIGATION_MODIFIER_NONE;
      |                             ^~~~~
```

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/2093>
2022-04-22 12:26:55 +00:00
Thibault Saunier add38d537c tests: convertscale: Do not log EOS events in validateflow
We already checked that we are getting an EOS before going back to ready
and adding the EOS at the end of the .validateflow is racy as the ERROR
message might reach the bus before it is logged.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/2264>
2022-04-21 12:50:43 -04:00
Thibault Saunier cd7a91cef1 videoconvertscale: Add properties to disable scaling/converting in videoconvert/videoscale
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/898>
2022-04-20 17:09:20 -04:00
Thibault Saunier f3fd4d7e90 videoconvertscale: Don't claim we can support any kind of memory
Since d0133a2d11 "videoconvert: Allow
passthrough for ANY caps features" videoconvert will always claim that
it supports any kind of memory which is true in very specific case (when
it is running in passthrough mode). To get elements that autoplug
converters depending on the caps running in the pipeline (like
autovideoconvert), we need to have converters no lie about what they can
do when queried `accept_caps` or `query_caps`.

This still accepts any caps feature as before but it introduces
a restriction in the way we handle memory capsfeatures.

We keep previous behaviour in videoconvert and videoscale.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/898>
2022-04-20 17:03:21 -04:00
Thibault Saunier d11f13f476 Introduce the videocolorscale element
Now that videoconvert and videoscale's are both based on
GstVideoConverter and are using the exact same code, it makes much more
sense to have one element doing the two operation, and it can be
more efficient in some cases (one single path for both operations).

This removes the `videoscale` and `videoconvert` plugins but keeps the element
but makes them also do both operations (adding some APIs to each element).

There is a small change in API for the `videoscale:dither` property which
was previously a totally unused boolean, it is now an enum and is used.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/898>
2022-04-20 17:03:21 -04:00
Sebastian Dröge 06f90deb5f sdp: Parse the RFC5576 Source-specific media SDP attributes into caps
The format of the caps fields is
    ssrc-(SSRC_VALUE)-(ATTRIBUTE_NAME)=(ATTRIBUTE_VALUE)
.

Parsing of the attributes from the caps into the SDP is not implemented
as this depends not only a single stream's caps but on the whole rtpbin
configuration.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/2132>
2022-04-20 14:40:25 +00:00
Camilo Celis Guzman 4c0d64dd10 gstglmixerbin: minor refactor of _find_element_pad_template
As suggested by @slomo, make the loop more readable and prevent returning
a garbage value to the caller from the previous implementation.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/2232>
2022-04-20 07:04:44 +00:00
Xavier Claessens e950095867 Always define ENABLE_NLS
GLib guarantees libintl API is always available, provided by
proxy-libintl as last resort. GLib itself unconditionally define
ENABLE_NLS.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/2028>
2022-04-19 18:01:06 +00:00
Xavier Claessens 82ca0e291b Delete unused i18n headers
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/2028>
2022-04-19 18:01:06 +00:00
Xavier Claessens b99ecc78ca Replace gst-i18n-*.h with gi18n-lib.h
GLib guarantees libintl is always present, using proxy-libintl as
last resort. There is no need to mock gettex API any more.

This fix static build on Windows because G_INTL_STATIC_COMPILATION must
be defined before including libintl.h, and glib does it for us as part
as including glib.h.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/2028>
2022-04-19 18:01:06 +00:00
Xavier Claessens 50b58aa974 gst-play: Do not split translatable string
Concatenating N_() strings does not work with gi18n.h macro, was working
only with GStreamer's redefinition.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/2028>
2022-04-19 18:01:06 +00:00
Thibault Saunier c033f8fad2 cuda: Factor out a public GstCUDA library
So applications and elements implemented outside GStreamer can reuse
our infrastructure

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/1472>
2022-04-19 16:39:43 +00:00
Nicolas Dufresne b7ded51382 video: Fix possible overrun when iterating comp[] array
Fix 2 iterations that can overrun the array if the number of component is
equal to the size of the array.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/2239>
2022-04-19 11:12:42 -04:00
Nicolas Dufresne e0ad0eda23 Revert "video-frame: avoid possible out of bound memory access"
This reverts commit c4255f08f7.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/2239>
2022-04-19 10:57:14 -04:00
Nirbheek Chauhan 97655eb8ac meson: Add -Wl,-rpath,${libdir} on macOS
We made the gstreamer installation prefix relocatable by picking up
plugins relative to the location of libgstreamer-1.0.dylib, similar to
how it's done for Windows:

https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/1627

This had a lot of side-effects:

https://gitlab.freedesktop.org/gstreamer/gstreamer/-/issues/1051
https://gitlab.freedesktop.org/gstreamer/cerbero/-/issues/363
https://gitlab.freedesktop.org/gstreamer/cerbero/-/issues/371
https://gitlab.freedesktop.org/gstreamer/cerbero/-/issues/362

A partial fix for the cerbero side of these was:

https://gitlab.freedesktop.org/gstreamer/cerbero/-/merge_requests/807

However, this relied on the consumers knowing that they need to add
`LC_RPATH` entries to the libdir of the prefix. This is done
automatically by build systems like Meson, but not by others, such as
Autotools, CMake, Cargo, XCode, etc. For those, we need to add the
RPATH entries to the gstreamer-1.0.pc file.

This also has the side-effect of fixing the loading of gstreamer rust
plugins on macOS:

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

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

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/2218>
2022-04-19 12:11:17 +00:00