Commit graph

7057 commits

Author SHA1 Message Date
Edward Hervey 1f4c1c18ca gstmessage: Allow retrieving and setting details on messages
This was only available on warning/error/info messages creator/parsers. These
new functions make it more generic and also add a writable variant for users who
want to add/extend the details

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/6929>
2024-05-29 22:24:07 +00:00
Nirbheek Chauhan fe1a7edda2 gl: Fix libdrm dependency detection and usage
drm_fourcc.h should be picked up via the pkgconfig dep, not the system
includedir directly. All this allows it to be picked up consistently
(via the subproject, for example).

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/6932>
2024-05-29 15:49:45 +00:00
Nirbheek Chauhan 907aca399f msdk: Fix libdrm dependency detection and usage
drm_fourcc.h should be picked up via the pkgconfig include, not the
system includedir directly.

Also consolidate the libdrm usage in va and msdk.

All this allows it to be picked up consistently (via the subproject,
for example).

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/6932>
2024-05-29 15:49:45 +00:00
Nirbheek Chauhan 82b7850c2f libdrm.wrap: Bump to latest 2.4.120
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/6932>
2024-05-29 15:49:45 +00:00
Nirbheek Chauhan 73cb87de4e libva.wrap: Bump to latest release 2.21.0, move to wrap-file
Since we no longer require a pre-release git commit, we an use
a tarball which is faster and easier to update/cache.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/6932>
2024-05-29 15:49:45 +00:00
Nirbheek Chauhan e3f086c648 meson: Don't use fallback: kwarg for libva deps
This will cause a fallback even when the `va` option is `auto`, not
giving the user a chance to provide the dependency via the system, and
likely building this feature unnecessarily.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/6932>
2024-05-29 15:49:45 +00:00
Nirbheek Chauhan deaa0aef79 va: Fix libdrm include
The libdrm/ prefix should not be used, it will be provided by the
pkgconfig file. Also HAVE_LIBDRM is necessary.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/6932>
2024-05-29 15:49:45 +00:00
Víctor Manuel Jáquez Leal 236d6714ec msdkcaps: fix ill-format string
This patch fixes this critical warning when registering MSDK:

_dma_fmt_to_dma_drm_fmts: assertion 'fmt != GST_VIDEO_FORMAT_UNKNOWN' failed

It was because the HEVC string with possible output formats has an extra space
that could not be parsed correctly.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/6853>
2024-05-29 13:08:55 +00:00
Edward Hervey 94646c642d decodebin3: Specify stream-id for missing decoder
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/6886>
2024-05-29 11:44:06 +00:00
Edward Hervey c987eaa427 pbutils: Missing plugin messages can contain the stream-id
In order to help users and applications, allow setting the stream-id for which
there is a missing plugin.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/6886>
2024-05-29 11:44:05 +00:00
Seungha Yang 96cf3d7063 d3d12encoder: Do not print error log for not-supported feature
gst_d3d12_result() will print message with ERROR level if failed.
Use FAILED/SUCCEEDED macros instead, since not-supported feature
is not a critical error

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/6955>
2024-05-29 10:45:13 +00:00
Seungha Yang ec11bb8253 d3d12memory: Allow null allocator in alloc()
Update code as documented

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/6940>
2024-05-29 09:45:26 +00:00
Jakub Adam 859b1c8b63 glcolorconvert: update existing sync meta if outbuf has one
Instead of always adding a new one, which means the buffer could end up
with multiple sync meta instances.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/6942>
2024-05-29 07:29:43 +00:00
Sebastian Dröge 529f2472b3 gstreamer: parse: Don't assume that child proxy child objects are GstObjects
The name is already passed via the signal parameters so it doesn't have
to be retrieved again via GstObject API, which would crash on other
GObjects. Child proxy child objects can be any kind of GObject and the
code here otherwise handles this correctly already.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/6938>
2024-05-29 05:33:03 +00:00
Nicolas Dufresne 79312357a6 av1parse: Properly transfer TU timestamp
When transforming from unknown alignment to frame or obu, the TU timestamp
was not properly transferred. Fix this by saving the TU DTS as the first
DTS seen within the the TU data, and the PTS as the last PTS seen in that
TU data. Finally, reset the TU timestamp after each TU have completed.

Fixes #1496

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/6895>
2024-05-28 23:59:36 +00:00
Nicolas Dufresne 5b1bc0f19f av1parse: Only place a marker on the last frame of a TU
Markers are meant to indicate the buffer that ends a frame, which imply
something can be displayed. The dependent decode only frames should not
have markers. This should also fix last subframe detection.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/6895>
2024-05-28 23:59:36 +00:00
Francisco Javier Velázquez-García 5fe7803128 docs: Correct pipeline examples in rawaudioparse
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/6933>
2024-05-28 22:20:08 +00:00
Sebastian Dröge bb6d737a1e typefind: Fix handling of ID_ODD_SIZE in WavPack typefinder
Chunks are always starting on an even position and this flag only
specifies that the last byte of the chunk is not valid.

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

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/6941>
2024-05-28 19:18:37 +00:00
Seungha Yang a4dfca3ae4 webview2: Add user-data-folder property
Adding a propery to specify location of WebView2's user data folder
location.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/6921>
2024-05-28 16:56:09 +00:00
Seungha Yang 05f9eadcaf qtmux: Handle time information value > UINT32_MAX
If any duration in timescale is larger than UINT32_MAX, use version 1
atom, otherwise file header will be constructed with truncated values.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/6843>
2024-05-28 16:09:58 +00:00
Seungha Yang c1b1c849f2 d3d12: Add support for Device Removed Extended Data (DRED)
Enable DRED if "d3d12dred > GST_LEVEL_ERROR", and print
DRED debug information on device removed.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/6718>
2024-05-28 15:09:21 +00:00
Edward Hervey c924e4cc1e hlsdemux2: Minor refactoring of starting segment check
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/6610>
2024-05-28 14:00:57 +00:00
Edward Hervey 5bc9883d68 hlsdemux2: Be more tolerant when matching segments with PDT
Some servers might not provide 100% matching PDT when doing updates, or accross
variants. This would cause the code matching segments using PDT to fail if the
segment PDT was 1 microsecond (or whatever small value) before the candidate
segment. And would pick the (wrong) following segment as the matching one.

In order to be more tolerant when matching, we instead check whether the
candidate segment is within the first segment of the segment we are trying to
match.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/6610>
2024-05-28 14:00:57 +00:00
Edward Hervey 81fd460c90 hlsdemux2: Fix failure to find a replacement segment on resync
If we end up with a segment with an internal time that varies from the supposed
one, this could be for two reasons:
* We guess-timated the wrong segment to go to when advancing or switching
  variants. In that case we try to find the actual segment to go to (just before
  this change).
* There was a complete playlist change (for whatever reason) and we can't find a
  replacement. In that case we want to carry on playback from this position but
  need to remember that we moved (by setting the stream to DISCONT, and
  resetting the new mapping).

Fixes playback on several broken stream

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/6610>
2024-05-28 14:00:57 +00:00
Edward Hervey 3e810a6721 hlsdemux2: Refactor update of GstHLSTimeMap values
This was also missing transferring the PDT if present

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/6610>
2024-05-28 14:00:57 +00:00
Edward Hervey 9a7f455aea hlsdemux2: Fix parsing of EXT-X-DISCONTINUITY-SEQUENCE:0
Since the default value of `m3u8->discont_sequence` (before parsing of the
playlist data) was 0 .. we would never properly detect the presence of that
field if it was present with a value of 0.

This would later on cause havoc in playlist synchronization where we would
assume it didn't have a discontinuity sequence specified (whereas it did, and it
was 0).

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/6610>
2024-05-28 14:00:57 +00:00
Edward Hervey d2b3262b71 hlsdemux2: Increase tolerance for discontinuity detection
A lot of streams will do a poor job of estimating proper duration of fragments
in the playlist, but over several fragments have it correct.

Instead of constantly trying to realign the estimated stream time, allow for a
more realistic tolerance of 3-4 video frames

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/6610>
2024-05-28 14:00:57 +00:00
Edward Hervey 8b6e7a018c hlsdemux2: Ensure a discont will be set when resetting for lost sync
This is to ensures we inform the demuxer/parsers that what follows is not contiguous

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/6610>
2024-05-28 14:00:57 +00:00
Edward Hervey 836bca461a hlsdemux2: Fix handling of variant switching and playlist updates
When updating playlists, we want to know whether the updated playlist is
continuous with the previous one. That is : if we advance, will the next
fragment need to have the DISCONT buffer set on it or not.

If that happens (because we switched variants, or the playlist all of a sudden
changed) we remember that there is a pending discont for the next fragment. That
will be used and resetted the next time we get the fragment information.

Previously this was only partially done. And it was racy because it was set
directly on `GstAdaptiveDemux2Stream->discont` when a playlist was updated,
instead of when the next fragment was prepared.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/6610>
2024-05-28 14:00:57 +00:00
Edward Hervey 7d49b1cc51 adaptivedemux2: Only set DISCONT on beginning of fragments
This avoids accidentally setting it in the middle of a fragment, which could
cause havoc in demuxer/parsers

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/6610>
2024-05-28 14:00:57 +00:00
Edward Hervey 81c42ee14b hlsdemux2: Fix getting starting segment on live playlists
When dealing with live streams, the function was assuming that all segments of
the playlist had valid stream_time. But that isn't TRUE, for example in the case
of failing to synchronize playlists.

Fixes losing sync due to not being able to match playlist on updates

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/6610>
2024-05-28 14:00:57 +00:00
Sebastian Dröge 9156b373e6 rtpbin: Regularly emit the sync signal
Even if no new synchronization information is available.

This is necessary because the timestamp offset logic in rtpbin depends
on the base RTP time that is determined by the jitterbuffer, but this
changes all the time (especially in mode=slave) and the timestamp
offsets have to be updated accordingly. Doing so is especially important
if they're only determined by the RTP-Info, which never changes from the
very beginning.

The interval can be configured via the new min-sync-interval property.
Synchronization happens at least that often, but at most as often as the
old sync-interval property allows.
Both intervals are now based on the monotonic system clock.

Additionally, clean up synchronization code a bit, only emit either
inband NTP or RTCP SR synchronization at the same time, based on which
one has the more recent time information, and only emit RTP-Info
synchronization if it wasn't provided previously at the same time as the
NTP-based synchronization information.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/6543>
2024-05-28 11:52:31 +00:00
Sebastian Dröge df8c29e340 rtpjitterbuffer: Set max-rtcp-rtp-sync-time to -1 (disabled)
There is generally no requirement to ignore RTCP SR if the RTP time of
the SR differs a lot from the last received RTP packet. The mapping
between RTP and NTP time stays valid until there was a stream reset, in
which case we wouldn't use that information anyway.

When using rtcp-sync-send-time=false the default of 1s difference can
easily be exceeded, e.g. if encoding of the stream after capture adds
more than 1s of latency.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/6543>
2024-05-28 11:52:30 +00:00
Sebastian Dröge 95a0649945 rtpbin: Allow synchronizing against RTP-Info without having received any RTCP
Previously the information was provided from rtpjitterbuffer to rtpbin
only once the first RTCP SR was received, which is not necessary at all
as all required information is available from the caps already.

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

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/6543>
2024-05-28 11:52:30 +00:00
Sebastian Dröge 8bfba72ea4 rtpbin: Add new never/ntp RTCP sync modes
Never is useful for some RTSP servers that report plain garbage both via
RTCP SR and RTP-Info, for example.

NTP is useful if synchronization should only ever happen based on RTCP
SR or NTP-64 RTP header extension.

Also slightly change the behaviour of always/initial to take RTP-Info
based synchronization into account too. It's supposed to give the same
values as the RTCP SR and is available earlier, so will generally cause
fewer synchronization glitches if it's made use of.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/6543>
2024-05-28 11:52:30 +00:00
Sebastian Dröge 158f12b5da rtpbin: Handle switches between RTP-Info and NTP-based stream association better
Instead of switching on the very first stream, require that all streams
have switched before switching to the different synchronization
mechanism.

Without this there will be a noticeable gap during the switch. E.g. when
going from RTP-Info to NTP-based association, first the first stream
only would get an offset, then the first two, ... then all of them.
Depending on the order of streams this will cause a lot of changes in
ts-offset during the transition.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/6543>
2024-05-28 11:52:30 +00:00
Sebastian Dröge b30671a8ee rtpbin: Pass NPT start from rtpjitterbuffer to rtpbin
And use it to detect synchronization changes (e.g. seeks) more reliably
when doing RTP-Info based synchronization.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/6543>
2024-05-28 11:52:30 +00:00
Sebastian Dröge 3eb22af88b rtpbin: Clean up stream association state
Use fewer magic numbers and keep track of the different synchronization
mechanisms separately. Also keep track of more state to detect more
situations when resynchronization should happen.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/6543>
2024-05-28 11:52:30 +00:00
Sebastian Dröge d8dabf142f rtpbin: Constify function parameters and use correct types
Previously these parameters were randomly changed in the body of the
function to avoid having to declare a new variable, which made the code
very hard to follow. By marking them as const this won't be possible
anymore in the future.

Also the RTP clock-base (RTP time from RTSP RTP-Info) is an unsigned
64 bit integer as it's an extended RTP timestamp.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/6543>
2024-05-28 11:52:30 +00:00
Sebastian Dröge 155c3fb3b2 rtpbin: Untangle NTP-based and RTP-Info based stream association
Both were entangled previously and very hard to follow what happens
under which conditions. Now as a very first step the code decides which
of the two cases it is going to apply, and then proceeds accordingly.
This also avoids calculating completely invalid values along the way and
even printing them int the debug output.

Also improve debug output in various places.

This shouldn't cause any behaviour changes.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/6543>
2024-05-28 11:52:30 +00:00
Sebastian Dröge 7d0c7144ba rtpbin: Remove unused variable / function parameter
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/6543>
2024-05-28 11:52:30 +00:00
Sebastian Dröge 4421c3de75 rtpbin: Handle ntp-sync=true before everything else
This simplifies the code as it's a much simpler case than the normal
inter-stream synchronization, and interleaving it with that only
reduces readability of the code.

Also improve some debug output in this code path.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/6543>
2024-05-28 11:52:30 +00:00
Sebastian Dröge 4b0e75a094 rtpbin: Add some documentation to gst_rtp_bin_associate()
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/6543>
2024-05-28 11:52:30 +00:00
Sebastian Dröge 70a435c0c4 rtpbin: Don't do any timestamp offsetting in rfc7273-sync=true mode
Fixes https://gitlab.freedesktop.org/gstreamer/gstreamer/-/issues/1160

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/6543>
2024-05-28 11:52:30 +00:00
Piotr Brzeziński 4612a6795a vtenc: Enable HEVC with alpha encoding
Adds a separate vtenc_h265a element (with a _hw variant as usual) for the HEVCWithAlpha codec type.
Decided to go with a separate element to not break existing uses of the normal HEVC encoder.
The preserve_alpha property is still only used for ProRes, no need for it here because we explicitly say we want alpha
when using the new element.

For now, the HEVCWithAlpha has an issue where it does not throttle the amount of input frames queued internally.
I added a quick workaround where encode_frame() will block until enqueue_frame() callback notifies it that some space
has been freed up in the internal queue. The limit was set to 5, which should be enough I guess? Hopefully this is not
too prone to race conditions.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/6664>
2024-05-28 10:53:25 +00:00
Piotr Brzeziński 2aa1f465e2 vtenc: Add missing vtenc_h265 docs
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/6664>
2024-05-28 10:53:25 +00:00
Edward Hervey 39f62862d8 decodebin3: Ensure we get a collection for parsed inputs
When we are dealing with parsed inputs (i.e. using identity), we need to ensure
that we have a valid stream collection (and therefore DBCollection) before
anything flows dowsntream.

In those cases, we hold onto those events until we get such a collection.

Fixes #3356

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/6774>
2024-05-28 08:31:17 +00:00
Edward Hervey daa022b9ee decodebin3: New mechanism for handling collection and selections
This commit separates collection and selections into a new separate structure:
DecodebinCollection.

This provides a much cleaner/saner way of dealing with collections being
updated, gapless playback, etc...

There is now a list of DecodebinCollection in flight, of which two are special:
* input_collection, the currently inputted/merged collection
* output_collection, the currently active collection on the output of multiqueue

Handling GST_EVENT_SELECT_STREAMS is split, by looking for the collection to
which it applies. And the requested streams are stored in it. IIF that
collection is output_collection we can do the switch, else it will be updated
when it becomes active.

Detecting which collection/selection is active is done by looking at the
GST_EVENT_STREAM_START on the output of the multiqueue.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/6774>
2024-05-28 08:31:17 +00:00
Edward Hervey c4b625a3fe decodebin3: minor refactoring to identify selected stream
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/6774>
2024-05-28 08:31:17 +00:00
Edward Hervey bfb64f7f44 decodebin3: Debug line cleanups
Use identifiable items in log lines instead of random pointers

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/6774>
2024-05-28 08:31:17 +00:00
Edward Hervey 39f2d96105 decodebin: Remove unused includes
* config.h is not used, plugin/element is registered in another file
* play-enum.h is not used

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/6774>
2024-05-28 08:31:17 +00:00
Edward Hervey 48cbb1c96f decodebin3: Remove un-needed variable
We don't do anything with the unknown streams. Detecting that a list of
requested streams don't apply to a given collection should be handled
before-hand

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/6774>
2024-05-28 08:31:17 +00:00
Edward Hervey 3acb219b76 decodebin3: Remove un-needed variable
pending_select_streams was only set just before releasing/taking the selection
lock in a single place. That temporary lock release is not needed and therefore
the variable isn't needed either

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/6774>
2024-05-28 08:31:17 +00:00
Edward Hervey 1ab0936196 decodebin3: Remove active_selection list
It's a duplicate of the list of slots which have an output. Use that instead.

Also when we fail to (re)configure an output, remove it.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/6774>
2024-05-28 08:31:17 +00:00
Edward Hervey ec468e9524 decodebin3: Cache slot stream_id and rename more variables
* Move the handling of GST_EVENT_STREAM_START on a slot to a separate function

* There was a lot of usage of `gst_stream_get_stream_id()` for the slot
active_stream. Cache that instead of constantly querying it.

* Rename the variables in `handle_stream_switch()` to be clearer

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/6774>
2024-05-28 08:31:16 +00:00
Edward Hervey 49cd8213bf decodebin3: Refactor slot/output (re)configuration
* Re-use existing function where possible
* Only set/reset keyframe probe at unique places

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/6774>
2024-05-28 08:31:16 +00:00
Edward Hervey faaedd2bb9 decodebin3: Refactor linking input to slot
The same sequence of calls was done when doing that

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/6774>
2024-05-28 08:31:16 +00:00
Edward Hervey a96c761ed7 decodebin3: input_unblock_streams: Clarify variable
It's a list of pads, not slots

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/6774>
2024-05-28 08:31:16 +00:00
Edward Hervey ceeea8afd6 decodebin3: Rename multiqueue related functions
To make clear on what they apply

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/6774>
2024-05-28 08:31:16 +00:00
Edward Hervey fc96e29606 decodebin3: Refactor/rename slot/output
* Centralize associating an output to a slot in one function, including properly
  resetting those fields
* Rename functions to be more explicit
* Move code to "reset" an output stream into a dedicated function (will be used
later)

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/6774>
2024-05-28 08:31:16 +00:00
Edward Hervey 1185a560c2 decodebin3: Refactor removal of slot/output from streaming thread
The code was identical in several places

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/6774>
2024-05-28 08:31:16 +00:00
Edward Hervey b825b3547c decodebin3: rename/clarify eos and draining usage around multiqueue
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/6774>
2024-05-28 08:31:16 +00:00
Edward Hervey f7207c24ff decodebin3: Document/refactor DecodebinInput handling
* Rename the function names to be clearer, with prefixes
* Pass the input (or stream) directly where appropriate
* Document usage, inputs, ownership
* Rename variables for clarity where applicable
* Avoid double lock/unlock if callee can handle it directly

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/6774>
2024-05-28 08:31:16 +00:00
Edward Hervey 8fd4502ebc decodebin3: Move gstdecodebin3-parse.c into gstdecodebin3.c
Makes it easier to work with LSP

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/6774>
2024-05-28 08:31:16 +00:00
Edward Hervey aeea856f4e decodebin3: Refactor incoming collection handling
Simplify its usage by having it directly create the message if the collection
changed. This is what caller were always doing and avoids releasing selection
locks yet-another-time

Also use it in more places to avoid code repetition

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/6774>
2024-05-28 08:31:16 +00:00
Edward Hervey 17e385a6ff decodebin3: Rename variable for clarity
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/6774>
2024-05-28 08:31:16 +00:00
Edward Hervey c0c62388a3 decodebin3: Refactor GST_EVENT_SELECT_STREAMS handling
* The same code is used for the event, regardless of whether it's coming from
via a pad or directly on the element
* The pending_select_streams list content was never used, switch it to a boolean

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/6774>
2024-05-28 08:31:16 +00:00
Edward Hervey dadaa33749 decodebin3: Don't forward select streams if we are handling it
Since the introduction of the "SELECTABLE" query, the usage of selection was
clarified. We don't need to forward the GST_EVENT_SELECT_STREAMS at this point.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/6774>
2024-05-28 08:31:15 +00:00
Sebastian Dröge 2a58e6de8f gstreamer: ptp-helper: Use u64 instead of c_ulong for ifa_flags on Solaris/Illumos
See https://gitlab.freedesktop.org/gstreamer/gstreamer/-/issues/3553#note_2429400

Patch by Marcel Telka <marcel@telka.sk>.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/6934>
2024-05-28 09:06:57 +03:00
Sergey Krivohatskiy 1c5e1798b6 flacparse: fix buffer overflow in gst_flac_parse_frame_is_valid
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/6835>
2024-05-27 23:31:44 +00:00
Elliot Chen 7b547e044c autovideoconvert: should not forward the allocation query if no element is selected
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/6927>
2024-05-27 22:46:31 +00:00
Francisco Javier Velázquez-García b792b558ce meson: Correct typo in 'xptv formatter' description
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/6931>
2024-05-27 19:28:20 +00:00
Sebastian Dröge a7908b05da info: Make gst_debug_print_object() and gst_debug_print_segment() public
It can be useful in custom logging code to easily get string
representations of all kinds of objects or a segment.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/6820>
2024-05-27 17:08:03 +00:00
Philippe Normand 299a000917 webrtcbin: Allow session level setup attribute in SDP
An SDP answer can declare its setup attribute at the session level or at the
media level. Until this patch we were validating only the latter case and an
assert was raised in the former case.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/6930>
2024-05-27 14:21:15 +00:00
Guillaume Desmottes 0b17b17a8a basetextoverlay: use GST_DEBUG_OBJECT instead of GST_DEBUG
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/6918>
2024-05-27 08:36:17 +02:00
Sebastian Dröge 1c88b06912 gstreamer: ptp-helper: Use if_nametoindex and setsockopt on Solaris / Illumos too
Patch by Marcel Telka <marcel@telka.sk>.

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

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/6925>
2024-05-26 12:34:26 +03:00
Sebastian Dröge 354623a246 gstreamer: ptp-helper: Don't import Context trait multiple times unnecessarily
This only affected the Solaris / Illumos code path.

Patch by Marcel Telka <marcel@telka.sk>.

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

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/6925>
2024-05-26 12:34:21 +03:00
Sebastian Dröge 8bff6b4988 gstreamer: ptp-helper: Use c_ulong for ifa_flags on Solaris/Illumos
Based on a patch by Marcel Telka <marcel@telka.sk>.

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

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/6925>
2024-05-26 12:34:13 +03:00
Sebastian Dröge 1f12493787 gstreamer: Solaris/Illumos require linking to libnsl / libsocket for various socket APIs
Patch by Tim Mooney <Tim.Mooney@ndsu.edu> from OpenIndiana/oi-userland

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/6925>
2024-05-26 12:33:50 +03:00
Víctor Manuel Jáquez Leal ecf852d529 vulkanh264dec: code style fix
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/6901>
2024-05-24 17:40:04 +00:00
Víctor Manuel Jáquez Leal 4a88137b2f vulkanh265dec: fix reference set
`StdVideoDecodeH265PictureInfo.flags.IsReference` refers to section 3.132 ITU-T
H.265 specification:

reference picture: A picture that is a short-term reference picture or a
long-term reference picture.

`GstH265Picture.ref` doesn't reflect this, but we need to query the NAL type of
the processed slice.

This patch fixes the validation layer error
`VUID-vkCmdBeginVideoCodingKHR-slotIndex-07239` while using the NVIDIA driver.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/6901>
2024-05-24 17:40:04 +00:00
Seungha Yang 84aecab150 d3d12videosink: Add overlay signal to support d3d12/d3d11/d2d overlay
Conceptually identical to the present signal of d3d11videosink.
This signal will be emitted with current render target
(i.e., swapchain backbuffer) and command queue. Signal handler
can record GPU commands for an overlay image or to blend
an image to the render target.

In addition to d3d12 resources, videosink will send
d3d11 and d2d resources depending on "overlay-mode"
property, so that signal handler can render by using
preferred/required DirectX API.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/6838>
2024-05-24 15:55:17 +00:00
Seungha Yang 4d779d7de8 d3d12videosink: Use device's main direct queue
The idea of using separate command queue per videosink was that
swapchain is bound to a command queue and we need to flush the
command queue when window size is changed. But the separate
queue does not seem to improve performance a lot.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/6838>
2024-05-24 15:55:17 +00:00
Sebastian Dröge c051982c0f dtlsconnection: Fix overflow in timeout calculation on systems with 32 bit time_t
If a timeout of more than 4295s was scheduled, the calculation would
overflow and a too short timeout would be used instead.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/6870>
2024-05-24 11:43:19 +00:00
Sebastian Dröge 562cecaef4 clock: Fix 32 bit assertions in GST_TIME_TO_TIMEVAL and GST_TIME_TO_TIMESPEC
On various 32 bit systems, time_t is actually 64 bits while long is
still only 32 bits. The macro would wrongly trigger its assertion in
this case if a value with more than 68 years worth of seconds is
converted.

Examples are various newer 32 bit platforms and old ones that are
compiled with -D_TIME_BITS=64.

Also statically assert that time_t is either 32 or 64 bits. Other values
might need adjustments in the macro.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/6869>
2024-05-24 09:27:01 +00:00
Hou Qi d1c81cbd79 glcolorconvert: traverse all structures in caps when transform_caps
This is used to avoid negotiation failure between glcolorconvert
and downstream element.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/6908>
2024-05-24 14:49:41 +09:00
Tim-Philipp Müller 8bd1a3213e level: fix old "message" property doc chunk
In the online documentation the new post-messages
property would show up as deprecated refering to
itself.

Fixes #3561

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/6911>
2024-05-23 21:36:37 +00:00
He Junyan ea0dce26e0 kmssink: Do not close the DRM prime handle twice
The prime_fds for multi planes may be the same. For example, on Intel's
platform, the NV12 surface may have the same FD for the plane0 and the
plane1. Then, the DRM_IOCTL_GEM_CLOSE will close the same handle twice
and get an "Invalid argument 22" error the second time.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/6914>
2024-05-23 15:45:24 -04:00
Víctor Manuel Jáquez Leal e913b4870a vkformat: try UNORM format first and decouple them from colorimetry
From the spec (chapter 34, v1.3.283):

````
UNORM: the components are unsigned normalized values in the range [0, 1]

SRGB: the R, G and B components are unsigned normalized value that represent
      values using sRGB nonlinear encoding, while the A component (if one
      exists) is a regular unsigned normalized value
```

The difference is the storage encoding, the first one is aimed for image
transfers, while the second is for shaders, mostly in the swapchain stage in the
pipeline, and it's done automatically if needed [1].

As far as I have checked, other frameworks (FFmpeg, GTK+), when import or export
images from/to Vulkan, use exclusively UNORM formats, while SRGB formats are
ignored.

My conclusion is that Vulkan formats are related on how bits are stored in
memory rather their transfer functions (colorimetry).

This patch does two interrelated changes:

1. It swaps certain color format maps to try first, in both
gst_vulkan_format_from_video_info() and gst_vulkan_format_from_video_info_2(),
the UNORM formats, when comparing its usage, and later check for SRGB.

2. It removes the code that check for colorimetry in
gst_vulkan_format_from_video_info_2(), since it not storage related.

1. https://community.khronos.org/t/noob-difference-between-unorm-and-srgb/106132/7

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/6797>
2024-05-23 17:41:30 +00:00
Seungha Yang 417e784463 Revert "tests/d3d11: add concurrency test for gstd3d11device"
This reverts commit 8e0046a738.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/6904>
2024-05-23 15:16:02 +00:00
Seungha Yang f47a198977 Revert "d3d11device: protect device_lock vs device_new"
This reverts commit 926d5366b9.

AcquireSRWLockExclusive seems to be acquiring lock in exclusive mode
when the same lock is combined with write lock access.
Reverting the commit because of this is unexpected behavior
and unavoidable OS bug.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/6904>
2024-05-23 15:16:02 +00:00
Daniel Stone 2f2279abf4 wayland: Use wl_display_create_queue_with_name
Wayland 1.23 and above allow us to attach names to an event queue, which
are printed out when debugging. Do this to make the logs easier to read.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/6900>
2024-05-23 13:38:01 +00:00
Seungha Yang e813ea8367 cudamemory: Fix offset of subsampled planar formats
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/6903>
2024-05-23 11:47:16 +00:00
Sebastian Dröge fece9235a2 av1enc: Add timebase property to allow configuring a specific timebase
This mirrors the same property in vp8enc / vp9enc.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/6891>
2024-05-23 09:15:34 +00:00
Sebastian Dröge fbc968d06c av1enc: Use 1/90000 as timebase and don't use the framerate at all
This mirrors the behaviour in vp8enc / vp9enc and is generally more
useful than using any framerate from the caps as it provides some degree
of accuracy if the stream doesn't have timestamps perfectly according to
the framerate.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/6891>
2024-05-23 09:15:34 +00:00
Sebastian Dröge f82a512387 av1enc: Fix last timestamp tracking so it actually works
This behaves exactly the same as in vp8enc / vp9enc now.

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

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/6891>
2024-05-23 09:15:34 +00:00
Sebastian Dröge cd606696a6 gtk: Fail initialization of the sink if GTK4 is already initialized in the same process
Initializing GTK3 and GTK4 in the same process does not work and is not
supported.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/6892>
2024-05-23 08:15:44 +00:00
Sebastian Dröge 1a8e7aa92d bufferlist: get() is not actually nullable in its return value
Passing an out of bounds index is the only way to get a NULL buffer but
this causes an assertion so is not to be considered for the
annotations.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/6884>
2024-05-23 06:34:59 +00:00
Matthew Waters 0f8b599ded glcolorconvert: handle rectangle textures for v210/UYVY/YUY2
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/6795>
2024-05-23 04:42:07 +00:00
Matthew Waters 4c27a2d5eb glcolorconvert: add support for v210->UYVY/YUY2 (and reverse)
Also support YUY2/UYVY->YUY2/UYVY conversion

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/6795>
2024-05-23 04:42:06 +00:00
Matthew Waters f6d3aca076 glcolorconvert: add support for UYVY/YUY2->planar yuv (and reverse)
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/6795>
2024-05-23 04:42:06 +00:00
Matthew Waters 8dac641889 glcolorconvert: add support for v210->planar YUV (and reverse)
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/6795>
2024-05-23 04:42:06 +00:00
Matthew Waters 96939db249 glcolorconvert: add support for converting to/from v210
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/6795>
2024-05-23 04:42:06 +00:00
Matthew Waters b0b185112d glmemory: use the GL stride calculation also for downloading into sysmem
Allows writing into sysmem with arbitrary strides.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/6795>
2024-05-23 04:42:06 +00:00
Piotr Brzeziński 477beab403 osxaudio: Avoid using private APIs on iOS
Turns out AudioConvertHostTimeToNanos and AudioGetCurrentHostTime are macOS-only APIs, which prevents apps using
GStreamer on iOS from being accepted into App Store.

This commit replaces those functions with a manual version of what they do - mach_absolute_time() for the current time,
and data from mach_timebase_info() at the beginning to convert host timestamps to nanoseconds.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/6789>
2024-05-22 08:58:24 +00:00
Elliot Chen 2dd4a7c6df autovideoconvert: fix double unref
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/6865>
2024-05-22 06:56:39 +00:00
Fotis Xenakis 2f03afd8ba docs: basic-tutorial-5: Don't unref floating reference
The `videosink` refernce in main() is a floating one, so it should not
be unref'ed (the playbin practically takes ownership of it).

This prevents a "gst_object_unref: assertion '((GObject *)
object)->ref_count > 0' failed" at runtime.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/6883>
2024-05-21 23:40:42 +02:00
Fotis Xenakis 85fa81c7c8 docs: basic-tutotial-1: Don't crash on error
Using g_error() crashes the application, producing a coredump e.g. when
the user closes the video window, which can be confusing (especially on
the very first tutorial).

Let's change this to log the error message without crashing, using
g_printerr(), like subsequent tutorials.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/6883>
2024-05-21 23:40:42 +02:00
Jordan Petridis b7357fd316 tests/check: Avoid using "bool" for the variable name
Glib 2.82 will be aliasing [1] TRUE and FALSE to the C99
definitions, which means it will be including stdbool.h

As such, having variables named "bool" causes issues
since it conflicts with the symbol defined in stdbool.h

[1] https://gitlab.gnome.org/GNOME/glib/-/merge_requests/4001

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/6893>
2024-05-21 19:15:36 +00:00
Joshua Breeden bf97b2fe56 videotestsrc: add mutex around cache buffer to prevent race condition
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/6849>
2024-05-21 12:14:59 +00:00
Diego Nieto 453a6f1800 rtsp-server: Remove unused define in backchannel test
The caps match with the ones used in test-onvif-backchannel,
but they are actually not used here.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/6885>
2024-05-21 13:25:44 +02:00
Yacine Bandou 03febb5048 streamsynchronizer: Fix deadlock when streams have been flushed before others start
To simplify the description, I'm assuming we only have two streams: video and audio.

For the video stream, we have the following events :
- STREAM_START => stream->wait set to true
- NEW_SEGMENT(1) => blocked waiting in gst_stream_synchronizer_wait
- FLUSH_START => unblocked
- FLUSH_STOP => stream->wait reset to false
- NEW_SEGMENT(2) => not waiting, since stream->wait is false

Then for the audio stream, we have the following events :
- STREAM_START => stream->wait set to true
- NEW_SEGMENT(2) => blocked waiting in gst_stream_synchronizer_wait for ever.

Note: The first NEW_SEGMENT event and the FLUSH_START, FLUSH_STOP events of the audio stream
are dropped before being received by the streamsynchronizer element, because the decodebin audio pad src
is not yet linked to the playsink audio pad sink.

To fix this deadlock, we don't reset stream->wait to false in the FLUSH_STOP event when it is not
waiting for the EOS of the other streams.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/6763>
2024-05-20 20:31:11 +00:00
Sebastian Dröge 0f342da7f6 subparse: Don't unref seek event twice if forwarding it directly failed
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/6882>
2024-05-20 16:16:06 +00:00
Jan Schmidt 64133b40a7 rtpmp4gdepay: Set duration on outgoing buffers
If we have constant duration buffers, set the duration on
outgoing buffers, like rtpmp4adepay does. This fixes
problems with (for example) muxers like mp4mux not writing
the duration of the final sample into the index.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/6878>
2024-05-20 15:24:32 +00:00
Sebastian Dröge b8a8eacdb2 examples: gst-play: Fix signature of the error callback
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/6880>
2024-05-20 17:32:27 +03:00
Seungha Yang e56d3d3e07 filesrc: Don't abort on _get_osfhandle()
_get_osfhandle() expects valid fd and CRT will abort program
if given paramerter is invalid. The fd can be invalidated
in various way, file was deleted by other process after
we open a file. To avoid it, our own exception
handler must be installed so that _get_osfhandle() can return
INVALID_HANDLE_VALUE if fd is invalid.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/6877>
2024-05-20 08:32:43 +00:00
Olivier Crête 87ec3bd399 ssdobjectdetector: Add size threshold to drop too big detections
There is a known "failure" mode where the SSD detector finds an object
which is the whole frame. So skip objects which are "too big" to avoid
this.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/6810>
2024-05-17 23:35:29 +00:00
Thibault Saunier 5be3f255b0 encoding-profile: Add a way to specify a factory-name when specifying caps
In some cases you want to ensure that a specific element factory is used
while requiring some specific caps but this was not possible. You can
now do `qtmux:video/x-prores,variant=standard|factory-name=avenc_prores_ks`
to ensure that the `avenc_prores_ks` factory is used to produce the
'standard' variant of prores video stream.

This also enhances a bit the documentation

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/6875>
2024-05-17 22:46:52 +00:00
Hyunwoo f4fdae1ce0 gst-python: Fix README.md
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/6876>
2024-05-17 14:12:08 +00:00
Edward Hervey afc1eadfdc streamsynchronizer: Split up event handler code
No changes to behaviour, just split up the big parts into dedicated function for
readability

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/6825>
2024-05-17 13:13:41 +00:00
He Junyan a3a3264f02 vah26{4,5}enc: No need to assert i>=0 in frame_setup_from_gop()
The value is an uint here and never be negative.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/6868>
2024-05-17 14:42:20 +08:00
Víctor Manuel Jáquez Leal 0233a2a7cf vah26xenc: factorize the encoder frame setup
A simple removal of duplicated code.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/6854>
2024-05-17 02:41:18 +00:00
Brad Reitmeyer a564440020 nvcodec: Accept progressive-high profiles for h264
Videos using progressive-high used to work on 1.16 before the parser added progressive-high. It looks like partial
support was added to nvcodec in https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/merge_requests/1634
but accidentally ommited gstnvh264dec

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/6862>
2024-05-16 16:05:52 -05:00
Víctor Manuel Jáquez Leal 51c2030efd examples: va: add option for enabling alive stream
This is useful to test va encoding for live streams which should enable output
delay.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/4359>
2024-05-16 14:54:40 +02:00
He Junyan 7a03813ee9 vabaseenc: Set the correct min_buffers for propose_allocation()
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/4359>
2024-05-16 14:54:40 +02:00
He Junyan 941d0c417f va: av1enc: Set preferred_output_delay value to increase performance
Also calculate the correct latency.
In live mode, preferred_output_delay is disabled.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/4359>
2024-05-16 14:54:40 +02:00
He Junyan ba2b053444 va: vp9enc: Set preferred_output_delay value to increase performance
Also calculate the correct latency.
In live mode, preferred_output_delay is disabled.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/4359>
2024-05-16 14:54:40 +02:00
He Junyan 47db542689 va: h265enc: Set preferred_output_delay value to increase performance
Also calculate the correct latency.
In live mode, preferred_output_delay is disabled.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/4359>
2024-05-16 14:54:40 +02:00
He Junyan fe25ed22e1 va: h264enc: Set preferred_output_delay value to increase performance
Also calculate the correct latency.
In live mode, preferred_output_delay is disabled.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/4359>
2024-05-16 14:54:40 +02:00
He Junyan a73474827b va: baseenc: Add is_live field to check the live stream
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/4359>
2024-05-16 14:54:39 +02:00
He Junyan 556a254e59 va: baseenc: Add a preferred_output_delay field for GPU parallel processing
The encoder can specify the a preferred_output_delay value to get better throughput
performance. The higher delay may get better HW performance, but it may increases
the encoder and pipeline latency.
When the output queue length is smaller than preferred_output_delay, the encoder
will not block to waiting for the encoding output. It will continue to prepare and
send more commands to GPU, which may improve the encoder throughput performance.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/4359>
2024-05-16 14:54:39 +02:00
He Junyan 0694c4a1c3 va: encoder: Do not continue when push_buffer gets error
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/4359>
2024-05-16 14:54:39 +02:00
He Junyan 9e2f0ea8dc va: libs: Use va_check_surface_has_status() to implement va_check_surface()
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/4359>
2024-05-16 14:54:39 +02:00
He Junyan 2ec51dab7d va: libs: Add va_check_surface_has_status() helper function
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/4359>
2024-05-16 14:54:39 +02:00
He Junyan 933a155b1a va: encoder: Use GstVaEncFrame as the base object for all Enc Frame
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/4359>
2024-05-16 14:54:39 +02:00
Guillaume Desmottes 210487b50a wavparse: reset when receiving STREAM_START
We need to reset the internal state to be able to parse a new stream.
When doing so keep seek event and do not destroy the adapter.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/6840>
2024-05-16 11:35:02 +00:00
Seungha Yang b01305f60c decodebin3: Fix caps and stream leaks
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/6858>
2024-05-16 10:46:33 +00:00
Sebastian Dröge 0a2e0a4f64 buffer: Use C11 atomics if available for 64 bit atomic operations
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/6740>
2024-05-16 06:52:58 +00:00
Sebastian Dröge 8ea355e52c audioringbuffer: Avoid overflows of segment done counter
This counter is incremented once for every segment, meaning it would
e.g. overflow after 24 days when using 1ms segments. Once that happens,
completely wrong positions are reported and invalid memory is handed out
for writing/reading the next segments.

As the affected variables are unfortunately part of the public API of
the struct, a second set of variables is added together with accessor
functions and both variables are kept in sync for backwards
compatibility.

All existing users of the two variables are moved to the new ones but
external code might still run into the overflow.

This also slightly breaks API as external code updating the variables
will have no effect anymore but the only known user of this is
pulsesink.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/6740>
2024-05-16 06:52:58 +00:00
Sebastian Dröge f8246327ef mpegtsmux: Allow pads to have no caps until they receive their first buffer
If the muxer times out because of the latency deadline it can happen
that some pads have no caps yet. In that case skip creation of streams
for these pads and create updated section tables once the first buffer
arrives later.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/6823>
2024-05-15 18:31:43 +00:00
Sebastian Dröge 4f33bc8932 mpegtsmux: Correctly time out and mux anyway in live pipelines
This makes sure that for sparse streams (KLV, DVB subtitles, ...) the
muxer does not wait until the next buffer is available for them but
times out on the latency deadline and outputs data.

For non-live pipelines it will still be necessary for upstream to
correctly produce gap events for sparse streams.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/6823>
2024-05-15 18:31:43 +00:00
Seungha Yang 15c24abf5d nvcodec: Add AV1 encoder
Adding CUDA mode "nvav1enc", D3D11 mode "nvd3d11av1enc" and auto GPU
mode "nvautogpuav1enc" elements

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/6754>
2024-05-15 14:35:52 +00:00
Seungha Yang da019bf137 nvcodec: Rename nvcuda{h264,h265}enc to nv{h264,h265}enc
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/6754>
2024-05-15 14:35:52 +00:00
Seungha Yang b74422dcbc nvcodec: Remove old nvenc implementation
Stop shipping deprecated implementation

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/6754>
2024-05-15 14:35:52 +00:00
Seungha Yang 0ffbe20d31 nvcodec: Bump minimum supported SDK version to 10.0
New preset (i.e., P1 ~ P7) requires SDK 10.0 or newer

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/6754>
2024-05-15 14:35:52 +00:00
Seungha Yang 60637b96c8 nvcodec: Update SDK header to 12.0.16
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/6754>
2024-05-15 14:35:52 +00:00
Seungha Yang ff6d6e1b3c nvencoder: Enhance lagacy encoding profile mapping
Updated based on the NVENC Preset Migration Guide

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/6754>
2024-05-15 14:35:52 +00:00
Seungha Yang cfd92819d9 nvencoder: Update property names and default value
... to be the same as old NVENC elements

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/6754>
2024-05-15 14:35:51 +00:00
Edward Hervey aab2f59d02 avviddec: Rename variables and fuse function
* gst_ffmpegviddec_frame() is the only caller of gst_ffmpegviddec_video_frame()
  and has the same signature. Just move the checks into a single function and
  use that.
* Make it clear which frames are the input and output ones in
  gst_ffmpegviddec_video_frame() to make issues like the one fixed in the previous
  commit more obvious.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/6851>
2024-05-15 13:20:54 +00:00
He Junyan f858179d01 vah265enc: Let FORCE_KEYFRAME be IDR frame rather than just I frame
The FORCE_KEYFRAME frame which has GST_VIDEO_CODEC_FRAME_FLAG_FORCE_KEYFRAME
bit set should be the sync point. So we should let it be an IDR frame to begin
a new GOP, rather than just promote it to an I frame.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/6619>
2024-05-15 09:55:49 +00:00