Whenever that caps changes does not imply that a new segment will start.
Don't reset the last_ts if only the caps have changed. This fixes issues
if you have a stream without only first frame with TS=0, and have resolution
change happening. This was a regression introduced by !3059, which issue was
described in #1352. The reported issue is still fix after this change.
Fixes#1034
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/5687>
The fake video decoder ignores input bitstream except
to enforce caps restrictions. It reads video width,
height and framerate from caps. Then it just pushes
video frames without doing any decoding.
The fake video decoder just draws a snake moving from
left to right in the middle of the frame. This is a
light weight drawing while it still provides an idea
about how smooth is the rendering.
The fake video decoder inherits from GstVideoDecoder.
It is useful to measure how smooth will be the whole
rendering pipeline if you had the most efficient video
decoder. Also useful to bisect issues for example when
suspecting issues in a specific video decoder.
Handles mpeg2, mpeg4, h263, h264, theora, vp8, wmv3, msmpeg,
flash-video, vp6, vp9, wmv1, wmv2, divx but more can be
added if needed.
For now it can only output RGBA, RGBx, BGRA, BGRx.
Its rank is 0 (none) but I added a property to change it so
that it can be selected by decodebin.
gst-launch-1.0 fakevideodec rank=512 \
playbin uri=http://clips.vorwaerts-gmbh.de/big_buck_bunny.mp4http://bugzilla.gnome.org/show_bug.cgi?id=723778Closes#679
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/5636>
From a multimedia perspective GLES >= 2 has the big advantage of
supporting external textures (`OES_EGL_image_external` /
`OES_EGL_image_external_essl3`), allowing various YUV formats to be
imported directly by drivers.
It appears unlikely by now that the extension will ever be ported to
GL with Vulkan becoming more popular, leaving GL without an "official"
way to import YUV formats.
Further more, for Gst internal purposes it's likely that GLES2 works
equally well if not better on most drivers these days, especially on
embedded devices.
Thus switch the default for EGL context creation to GLES2. This won't
affect apps that create their own context, but `gst-launch-1.0` etc.,
which are often used for testing so people don't have to pass
`GST_GL_API=gles2`.
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/5509>
By sealing for future writes, we broke Wayland SHM support. It seems like the
wayland library maps the SHM in read/write mode. This is visible through no
display and an error message like this:
wl_shm@7: error 2: failed mmap fd 43: Operation not permitted
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/5684>
If text width ever reached 1px, for example after resizing the output window, the overlay would stop rendering
and never return again. The 1px condition itself does not seem to make much sense here anyway.
This was a chain of events: width reached 1, so the composition was set to NULL. Then, after resizing the output window,
push_frame() was called but would not attempt to renegotiate because composition is NULL. This caused the width/height
to never be updated again, as that only happens during negotiation, so the overlay was gone for good.
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/5614>
In rare cases - notably on macOS, because of multiple GL contexts - the lack of a sync point was causing overlays
to disappear for a frame after being redrawn, or sometimes not appear at all. This change makes sure that the display
in one GL context will be correctly synchronised with the other GL context where the overlay texture was uploaded.
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/5610>
There is no guarantee that g_get_user_runtime_dir() is in a tmpfs. Using
an explicit shared memory API seems safer for all POSIX platforms.
Note that Android does not have shm_open() and only added memfd_create()
since API level 30 (Android 11).
Sponsored-by: Netflix Inc.
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/5328>
Followup to 75872c802b , clang version
While we ignore `discarded-qualifiers` already for gcc, clang seems
to assign this error to `incompatible-pointer-types-discards-qualifiers`
so we need to ignore that as well.
```
In file included from \
../subprojects/gst-plugins-base/ext/cdparanoia/gstcdparanoiasrc.h:37: \
/usr/include/cdda/cdda_interface.h:164:3: error: initializing 'char *' with an expression \
of type 'const char [8]' discards qualifiers [-Werror, \
-Wincompatible-pointer-types-discards-qualifiers]
"Success",
^~~~~~~~~
```
See 75872c802b for more
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/5474>
In _gl_memory_upload_propose_allocation(), when output target is "external-oes",
then we should not provide GL allocator and pool in the allocation query.
This is because the "external-oes" kind memory can never be mapped directly
and the upstream element may misuse it.
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/5468>
The propose and decide allocation vfuncs are called directly from
basetransform and need to use the locked accessor function for
retrieving a reliable reference to the GstGLContext (if available)
Fixes spurious crashes on shutdown during pad reconfiguration
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/5437>
The number of planes is a meta we carry around in the GstVideoMeta with
DMA_DRM format. In cannot be decuded correctly from knowledge of the
base format. Notably, some compression modifier may introduce an extra
plane to store the compression parameters.
So use n_planes from GstVideoMeta and pass this explicitly when
importing to EGLImage.
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/5461>
The DMAbuf accept function was ensuring the in_dma_info values was valid if
the in_caps have change. But the check was bogus since the in_caps was being
modified without a pointer change. As a side effect, on the second accept
call, the drm_fourcc was reset to 0, which cause the uploader to fallback.
Fix this by ensuring we always have a valid dma_frm info directly in the
set_caps() function. Also remove the bogus caps changed check and remove any
modification to the info structure and always do that inner checks.
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/5461>
DRM Modifiers are not generically transferrable from a format like NV12 to
their indirect shading format (R8 / RG88). So the helper to this do needs
to be removed from our API.
To make things worse, we support indirect formats that aren't DRM format in
the first place. Notably NV12_16L32 (aka MM21) is not (yet) a DRM format. Yet,
each plane can be indirectly imported using R8/RG88 and a detiling shader.
This patch also removes this constraint restoring zero-copy playback on
Mediatek SoC.
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/5461>
Update connection-speed at runtime in playbin, uridecodebin and decodebin
also do the same thing in urisourcebin.
With contributions from Philippe Normand <philn@igalia.com> (build fixes and
rebase on mono-repo).
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/4713>
This was causing a memory leak in cases like `gltestsrc ! gltransformation scale-x=0.5 ! glimagesink`.
Parent meta was being added in assumption that those buffers are different, which was not the case here,
creating a reference loop and never freeing the buffer.
Co-authored-by: Matthew Waters <matthew@centricular.com>
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/5445>
Back in the mists of time[1], we switched `giostream*` elements to not close the
stream on stop() so that applications that needed a handle to the stream after
the element stopped had it.
Unfortunately, we also have cases[2] where waiting for the element to be
finalized is too late for the stream to be closed.
In order to not change the behaviour of the element, we add a property to allow
users to select the desired behaviour.
[1]: https://bugzilla.gnome.org/show_bug.cgi?id=587896
[2]: gst-plugins-rs#423
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/5372>
By using the gst_caps_set_simple() to set the format on all structures, the
compositor may create invalid combinations as the caps may contain passthrough
caps. Avoid this issue by intersecting the resul with its original.
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/5386>
Adds list of formats that should be used by element in needs to passthrough
video. It contains the full list of video format plus DMA_DRM format
and will be extended in the future as needed. This patches includes 3 new
symbols:
- GST_VIDEO_FORMATS_ANY_STR
- GST_VIDEO_FORMATS_ANY
- gst_video_formats_any()
The last one can be used by bindings or for code that prefers having
GstVideoFormat values instead of strings.
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/5386>
Right now we split the RTP header from the current buffer into a new
buffer and aggregate those buffers for later processing if the
depayloader creates an output buffer.
This is cumbersome as it happens even if none of the incoming RTP
buffers carries RTP header extensions at all just because header
aggregation has been enabled in the depayloader class.
This commit will start aggregation only in case that there really are
RTP header extensions available on an incoming RTP buffer. The check
is trivial and cheap. Once activated we keep aggregation active for
all buffers. The active state is reset on state change READY_TO_PAUSE.
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/5278>
The GST_VIDEO_FORMAT_Y410, GST_VIDEO_FORMAT_Y412_LE and GST_VIDEO_FORMAT_Y412_BE
formats in fact are packed formats, which have just 1 plane. But we have special
setting for them rather than using get_single_planar_format_gl_swizzle_order().
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/5314>
As we don't have any mapping from YUV formats + modifiers to an equivalent
emulated format (e.g. NV12 + modifier -> R8+modifier/RG88+modifier), do no
allow these formats to be used with the indirect DMABuf uploader.
Fixes#2942
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/5270>
The same is done in the set_property function. This was noticed when attempting
to dump a pipeline containing glsinkbin sink=gtk4paintablesink to dot format.
Critical warnings were raised due to the missing force-aspect-ratio property on
that sink.
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/5311>
Fixes a potential GPU stall if an immediately freed texture/buffer is
attempted to be reused immediately by the CPU, e.g. when uploading.
Problematic scenario is this:
1. element does GPU processing reading from texture
2. frees the buffer back to the pool
3. pool acquire returns the just released buffer
4. GPU processing then has to wait for the previous GPU operation to
complete causing a stall
If there was a reliable way to know whether a buffer had been finished
with across all GPU drivers, we would use it. However as that does not
exist, this workaround is to keep the released buffer unusable until the
next released buffer.
This is the same approach as is used in the qml (Qt5) elements.
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/5144>
When using `gst_sdp_media_set_media_from_caps` on `application/x-rtp` caps
without `clock-rate` it wrongly reports missing payload type even if `payload`
is present in the caps.
This seems to be a copy&paste error from the error message for missing payload
type.
When using payload=10, both `clock-rate` and some other media properties are
defined by the RTP standard so I was wondering whether I could omit `clock-rate`
and was confused about the error message.
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/5250>
Add gst_audio_ring_buffer_set_errored() that will mark the
ringbuffer as errored only if it is currently started or paused,
so gst_audio_ringbuffer_stop() can be sure that the error
state means that the ringbuffer was started and needs stop called.
Fixes a crash with osxaudiosrc if the source element posts
an error, because the ringbuffer would not get stopped and CoreAudio
would continue trying to do callbacks.
Also, anywhere that modifies the ringbuffer state, make sure to
use atomic operations, to guarantee their visibility
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/5205>
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>
Don't call wait_event() at all for gap events, as basesink will
end up waiting for the time that the gap event would be rendered
out at the audio device. There's no need to render it at all,
just treat it as a handy point to resync the audio if needed,
let the ringbuffer render silence, and place the next buffer
into the ringbuffer where it belongs.
The only thing we really need to do is make sure the ringbuffer
and clock are running, and wait for preroll.
Fixes https://gitlab.freedesktop.org/gstreamer/gstreamer/-/issues/2749
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/5178>
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>
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>