Commit graph

3474 commits

Author SHA1 Message Date
Víctor Manuel Jáquez Leal 901ad2b4f5 vajpegdec: Reenable element negotiation.
negotiation vmethod were overwritten by vabasedec, leading to errors.

This was a regression of commit b6538e0560.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/3509>
2022-12-02 08:37:02 +00:00
Edward Hervey 9f9e625776 gstinfo: Optimize color escape code creation
When coloring is in use, those escape codes are going to be created many times
for almost all debug lines.

Don't create plenty of temporary allocations, and instead build the escape code
ourselves statically

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/3498>
2022-12-02 06:02:48 +00:00
Johan Sternerup 4b96294f19 webrtc: Fix possible use-after-free of GstWebRTCICETransport
Because of the asynchronous resolving of mDNS ICE candidates it is
possible that GstWebRTCICE outlives webrtcbin. This in turn prolongs
the lifetime of the GstWebRTCNiceStream objects via refs in
nice_stream_map. Thus the GstWebRTCICETransport objects held in
GstWebRTCNiceStream may be invalid at the time they are accessed by
the _on_candidate_gathering_done() callback since GstWebRTCNiceStream
doesn't take a reference to them. Doing so would create a circular
reference, so instead this commit introduces weak references to the
transport objects and then we can check if the objects are valid before
accessing them.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/3502>
2022-12-02 03:37:29 +00:00
Aleksandr Slobodeniuk 38f6a0ba2e rtspsrc: fix seek event leaks
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/3500>
2022-12-01 23:52:40 +00:00
Victor Manuel Jaquez Leal 4cbdf43e7d va: Handle input caps change.
Update output caps if it's notified by baseclass

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

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/3480>
2022-12-01 18:54:14 +00:00
Victor Manuel Jaquez Leal 19b83bc156 vaav1dec: Use gst_va_base_dec_set_output_state().
And even that vaav1dec doesn't use vabasedec negotiate vmethod, it should align
with the new scheme of using base's width & height for surface size and
output_info structure for downstream display size negotiation.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/3480>
2022-12-01 18:54:14 +00:00
Victor Manuel Jaquez Leal e5417b2db7 vavp9dec: Use gst_va_base_dec_set_output_state().
As this element reopen the internal decoder differently, it only uses the helper
function to negotiate.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/3480>
2022-12-01 18:54:14 +00:00
Victor Manuel Jaquez Leal 6dfca46ada vampeg2dec: Streams are progressive by default.
By initializating progressive, then interlaced streams are detected correctly.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/3480>
2022-12-01 18:54:14 +00:00
Victor Manuel Jaquez Leal b6538e0560 va: Add and use common decode negotiate vmethod.
This vmethod can be used by decoders with the same VA decoder reopen logic:
same profile, chroma, width and height.

Also a new public method called gst_va_base_dec_set_output_state() with the
common GStreamer code for setting the output state, which is always called by
the negotiate vmethod.

In order to do this refactoring, new variables in vabasedec have to be populated
by the decoders:

* width and height define the resolution set in VA decoder. In the case of H264
  would be de coded_width and codec_height, or max_width and max_height in AV1.
* output_info is the downstream video info used for negotiation in
  gst_va_base_dec_set_output_state().
* input_state, from codec parent class shall be also held by vabasedec

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/3480>
2022-12-01 18:54:14 +00:00
Víctor Manuel Jáquez Leal 31c63a6e6c vaav1dec: Use gst_va_base_dec_prepare_output_frame().
And simplify a bit the code flow.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/3480>
2022-12-01 18:54:14 +00:00
Víctor Manuel Jáquez Leal 4a8ecc2dba va: Add and use gst_va_base_dec_prepare_output_frame().
This helper will do downstream negotiation and later will
allocate the output frame.

H265 and AV1 decoders don't use this approach since their output
frame allocation is different.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/3480>
2022-12-01 18:54:14 +00:00
Víctor Manuel Jáquez Leal f1a9728b30 va: Remove last_ret error handling in decoders.
It was used in the early development of the base classes. Now it
shouldn't be needed.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/3480>
2022-12-01 18:54:14 +00:00
Víctor Manuel Jáquez Leal de5b76a922 va: Add and use gst_va_base_dec_process_output().
This function will copy the frame, if it's needed, and will apply buffer flags.

The function is used by all the decoders.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/3480>
2022-12-01 18:54:14 +00:00
He Junyan 765adf5325 va: Fix the caps memory leak by gst_va_pool_new_with_config().
The gst_va_pool_new_with_config() will ref the caps, and so we need
to unref after that.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/3503>
2022-12-01 17:31:16 +00:00
Víctor Manuel Jáquez Leal c8a0d706ca va: Add render node name in non-first devices.
There could be multi-GPU setups where the non-first has more
entrypoints than the first one, and the elements names are not
homogeneous, leading to pipeline building error.

This patch add the render node in the elements names when they belong
to the non-first device.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/3491>
2022-12-01 16:00:55 +00:00
Victor Manuel Jaquez Leal cccbf1f02d vafilter: Increase the caps for HDR.
As they might be other medatadata types.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/3473>
2022-12-01 15:17:49 +00:00
Victor Manuel Jaquez Leal b25b1be70d vafilter: Increase the number of 3DLUT caps to 16.
To fix the warning on Alderlake

vafilter gstvafilter.c:534:gst_va_filter_ensure_filters:<vafilter0>
vaQueryVideoProcFiltersCaps: list argument exceeds maximum number

Increase the number of caps to 16 as vadumpcaps does.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/3473>
2022-12-01 15:17:49 +00:00
Bo Elmgreen 1f88f411bc qt: deactivate context if fill_info fails
Now the OpenGL context is deactivated if call to gst_gl_context_fill_info()
fails in gst_qt_get_gl_wrapcontext(), preventing that the context is left
activated, which could lead to invalid memory reads.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/3492>
2022-12-01 14:21:37 +00:00
Sebastian Dröge 925715c734 av{aud,vid}dec: Report decoding errors to the base class
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/1889>
2022-12-01 13:40:53 +00:00
Pawel Stawicki 94ba019397 v4l2: Fix SIGSEGV on 'change state' during 'format change'
Ensure all access to v4l2object->pool imply taking a lock and a hard ref on the pool

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/3481>
2022-12-01 12:47:54 +00:00
Edward Hervey 0841e846a3 gst-inspect: Don't leak list
Just iterate the list instead of trying to be smart...

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/3497>
2022-12-01 06:42:22 +00:00
Víctor Manuel Jáquez Leal 8f96453b0f example: vaenc-dynamic-reconfigure: Support H265.
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/2036>
2022-12-01 09:45:24 +08:00
He Junyan c365389930 va: Add H265 SCC profile support.
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/2036>
2022-12-01 09:45:19 +08:00
He Junyan 0952c556dc va: Add extended formats support such as 10/12 bits, 4:2:2 and 4:4:4.
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/2036>
2022-12-01 09:45:14 +08:00
He Junyan 17c416ca92 va: enable multi tile support for H265 encoder.
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/2036>
2022-12-01 09:45:07 +08:00
He Junyan 2f8ce208e8 va: enable vah265lpenc for low power mode H265 encoder.
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/2036>
2022-12-01 09:45:00 +08:00
He Junyan 2677d4c6db va: Add the low-delay-b frame support for H265.
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/2036>
2022-12-01 09:44:41 +08:00
He Junyan 9ee657cdee va: Add prediction direction attribute support for H265 encoder.
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/2036>
2022-12-01 09:44:33 +08:00
He Junyan 4e7eddeafe va: Register and enable and the vah265enc plugin.
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/2036>
2022-12-01 09:44:26 +08:00
He Junyan 3d99f24843 va: Implement the vah265enc plugin for va HEVC encoding.
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/2036>
2022-12-01 09:44:08 +08:00
Vivia Nikolaidou a0e61539f8 opusdec: Use proper guint/guint8 type conversion
Do not cast, that might yield wrong results.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/3494>
2022-11-30 21:11:55 +02:00
Vivia Nikolaidou c9afaf5cd9 opusdec: Negotiate default to 2 channels
In that place, dec->n_channels can still theoretically be 0. Default to
2 in that case.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/3494>
2022-11-30 20:56:30 +02:00
Vivia Nikolaidou cdf411e82d opusenc: Reverse channel order in template caps
We want to make it so that we prefer a higher, not lower, number of
channels. Otherwise, this pipeline would convert from 2 to 1 channels:

gst-launch-1.0 audiotestsrc ! audio/x-raw,channels=2 ! opusenc ! queue ! opusdec ! queue ! opusenc ! fakesink

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/3494>
2022-11-30 20:52:05 +02:00
Philippe Normand 090cf943ed avviddec: Report flow error when decoder refused packet
In cases where an invalid input packet is submitted to the decoder we emit a
warning but reporting the flow error upstream would also be useful. This came up
with a case were the application interacts directly with the decoder, using a
mechanism similar to GstHarness.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/3463>
2022-11-30 11:51:12 +00:00
Philippe Normand fa863b2b7f audiodecoder: Make data processing errors non-fatal by default
The previous default value of `max-errors` was too small and would potentially trigger the
decoder to emit errors too often for most cases.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/3478>
2022-11-30 10:27:50 +00:00
Philippe Normand 9e5cce0ab9 videodecoder: Make data processing errors non-fatal by default
The previous default value of `max-errors` was too small and would potentially trigger the
decoder to emit errors too often for most cases.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/3478>
2022-11-30 10:27:27 +00:00
Sebastian Dröge 12aa3925d0 sdpmessage: Annotate SDP message parameters for parse_uri() and parse_buffer() correctly
They are not actually `out` parameters but must be allocated and
initialized to a valid SDP message by the caller. Just allocating them
without initialization will cause memory corruptions because the
functions will try to clear/append to the existing SDP message.

As such they should be just marked as `transfer none`.

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

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/3484>
2022-11-29 14:02:55 +02:00
Seungha Yang a3b352c99d mfvideosrc: Fix buffer leak
The allocated buffer should be released

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/3479>
2022-11-28 18:50:03 +00:00
Seungha Yang 581481c12f mediafoundation: Chain up from GObject::constructed
... so that GstTracer can trace it

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/3479>
2022-11-28 18:50:03 +00:00
Seungha Yang b9b3a9c4e1 d3d11: Use correct ref/unref methods
Those objects are GstObject subclasses

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/3479>
2022-11-28 18:50:03 +00:00
Ignacio Casal Quinteiro 2aa34164f6 sdp: use g_strdup instead of strdup
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/3475>
2022-11-28 09:36:18 +00:00
Nicolas Dufresne b985c8eadd glimagesink: Fix render rect assertion
Whenever the surface is resized before the stream is negotiated, we endup
with an assertion in libgstvideo.

  gst_video_center_rect: assertion 'src->h != 0' failed

This fixes it, by following the style aready in place, which is to ensure
surfaces have a minimum size of 1x1.

Fixes #1139

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/3467>
2022-11-28 07:52:25 +00:00
Tim-Philipp Müller dec3aa55e9 audioconvert, audioresample, audiofilter: fix divide by 0 for input buffer without caps
gst-launch-1.0 audiotestsrc ! udpsink host=127.0.0.1
gst-launch-1.0 udpsrc ! audioconvert ! autoaudiosink

would crash with a floating point exception when clipping the input
buffer owing to a division by zero because no caps event was received.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/3469>
2022-11-26 08:47:49 +00:00
Seungha Yang 468b049a04 win32ipcvideosrc: Fix property name and enum value mismatch
Make them consistent

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/3465>
2022-11-25 15:50:33 +00:00
Seungha Yang 20e83fa45b win32ipcvideosrc: Protect pipe from flush thread
The pipe object must be protected against GstBaseSrc::unlock()
thread.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/3465>
2022-11-25 15:50:33 +00:00
He Junyan 25f90c828a h264parser: Fix a typo in pred_weight_table parsing.
When setting default values, the reference list number of l1 is wrong.

Fix: https://gitlab.freedesktop.org/gstreamer/gstreamer-vaapi/-/issues/336
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/3464>
2022-11-25 14:13:46 +00:00
Ma, Mingyang 66087b6276 msdkdec: Update decoding pts
Update frame pts before calling gst_video_decoder_finish_frame, or frames may be lost when transcoding in specific stream

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/3449>
2022-11-25 01:42:58 +00:00
Seungha Yang 4f846540cb win32ipc: Add WIN32 shared memory videosrc/sink elements
Windows supports various IPC methods but that's completely
different form that of *nix from implementation point of view.
So, instead of adding shared memory functionality to existing
shm plugin, new WIN32 shared memory source/sink elements
are implemented in this commit.

Each videosink (server) and videosrc (client) pair will communicate
using WIN32 named pipe and thus user should configure unique/proper
pipe name to them (e.g., \\.\pipe\MyPipeName).
Once connection is established, videosink will create named shared memory
object per frame and client will be able to consume the object
(i.e., memory mapped file handle) without additional copy operation.

Note that implementations under "protocol" directory are almost
pure C/C++ with WIN32 APIs except for a few defines and debug functions.
So, applications can take only the protocol part so that the application
can send/receive shared-memory object from/to the other end
even if it's not an actual GStreamer element.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/3441>
2022-11-24 12:41:18 +00:00
Matt Crane ca7f66f9b5 rtpsession: Support disabling late adjustment of ntp-64 header ext
Currently in rtp_session_send_rtp(), the existing ntp-64 RTP header
extension timestamp is updated with the actual NTP time before sending
the packet. However, there are some circumstances where we would like
to preserve the original timestamp obtained from reference timestamp
buffer metadata.

This commit provides the ability to configure whether or not to update
the ntp-64 header extension timestamp with the actual NTP time via the
update-ntp64-header-ext boolean property. The property is also exposed
via rtpbin. Default property value of TRUE will preserve existing
behavior (update ntp-64 header ext with actual NTP time).

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

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/3451>
2022-11-24 08:23:03 +00:00
Matthew Waters 18972fc942 add new plugin for Qt 6 rendering inside a QML scene
- Based heavily on the existing Qt5 integration however:
  - The sharing of OpenGL resources is slightly different
  - The integration with the scengraph is a bit different
- Wayland, XCB and KMS have been smoke tested.  Android, MacOS/iOS,
  Windows may or may not work.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/3281>
2022-11-24 16:11:04 +11:00
Jan Lorenz 47b8762774 mfvideosrc: check HRESULT of CreateClassEnumerator correctly
Fixes a crash during direct show device enumeration

Fixes: https://gitlab.freedesktop.org/gstreamer/gstreamer/-/issues/1599
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/3460>
2022-11-23 14:45:50 +00:00
Elliot Chen 63ff99ca8e v4l2: bypass check some transfer types in colorimetry
v4l2 will report fail for some streams whose colorimetry value such as 2:4:8:3.
Can bypass check these transfer types in colorimetry to avoid error.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/3440>
2022-11-23 13:06:29 +00:00
Edward Hervey 65e142c6ed docs/design: Add document detailing the new gapless/instant-uri changes
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/3457>
2022-11-23 12:19:22 +00:00
Edward Hervey 3a63eab2fa uridecodebin3: propagate about-to-finish for new inputs
If the pending next urisourcebin is already draining, make sure we propagate it
when activating it.

Fixes gapless playback of small entries

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

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/3457>
2022-11-23 12:19:22 +00:00
Edward Hervey def2515ae2 uridecodebin3: Remove old fixme
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/3457>
2022-11-23 12:19:22 +00:00
Edward Hervey 734a4554f3 (uri)decodebin3: Ensure group-id consistency
Make sure that group-id of a given play item are made consistent from the
start (sources) and all the way through the output.

This ensures that we can reliably detect that we have switched to the next play
item on the output of decodebin3 (and we can therefore properly free/release it)

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/3457>
2022-11-23 12:19:21 +00:00
Edward Hervey 353691602e uridecodebin3: Fix shutdown procedures in probe
When shutting down, we want to remove the urisourcebin blocking probes ... but
we also want to propagate a GST_FLOW_FLUSHING upstream (and not
GST_FLOW_NOT_LINKED) to make the upstream task gracefully stop instead of
posting an error message.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/3457>
2022-11-23 12:19:21 +00:00
Edward Hervey 7f5f7b3a77 decodebin3: Properly reset when going back to READY
Clear the remaining stream-related fields when going from PAUSED to READY, and
use when disposing.

Fixes various issues when re-using decodebin3/playbin3

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/3457>
2022-11-23 12:19:21 +00:00
Edward Hervey d12534d21d decodebin3: Don't output bogus GST_MESSAGE_STREAMS_SELECTED
When `is_selection_done` is called, it checks that all the requested streams are
present in the active stream list ...

... except there could very well be a (about to be removed) stream from the
previous selection present.

Therefore filter the list of streams we add to the message by the streams which
are actually requested.

Fixes issues when switching between different stream types (ex: video-only to
audio-only).

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/3457>
2022-11-23 12:19:21 +00:00
Johan Sternerup 9794c9bfd0 Use the correct SSRC(s) when routing a RTCB FB FIR
Previously we tried to route an incoming RTCP FB FIR to the correct ssrc
using the "media source" component of the RTCP FB message. However,
according to RFC5104 (section 4.3.1.2) the "media source" SHALL be set
to 0. Instead the ssrc(s) in use are propagated via the FCI data. Now
a specific GstForceKeyUnit event is sent for every ssrc.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/3292>
2022-11-23 11:31:23 +00:00
Jan Schmidt cb225b3682 rtpsource: Track the seqnum for senders
RTP source statistics are tracked for local senders by
treating them as a receiver of their own outbound packets.

Accordingly, track the highest packet seqnum so that the
packets-lost calculation generates a sensible number instead
of always reporting -$number_of_packets_sent

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/3454>
2022-11-23 10:26:29 +00:00
Jan Schmidt 843f10f7f9 adaptivedemux2: Add GStreamer to the deps list
Explicitly dep on GStreamer so as not to accidentally
link to the system version in a git build

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/3453>
2022-11-23 09:29:14 +00:00
Nicolas Dufresne 6981384184 kmssink: Fix compilation without kernel headers
There was a drm/drm_mode.h included added recently, drm/ is usually
referencing the linux kernel header, but we only requires the libdrm
headers to be installed. On top of this, including drm_mode.h is never
needed as its already included by drm.h.

Fixes #1596

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/3452>
2022-11-23 08:39:49 +00:00
Daniel Morin 855f84c558 onnx: Update to OnnxRT >= 1.13.1 API
- Replace deprecated methods
- Add a check on ORT version we are compatible with.
- Add clarification to the example given.
- Add the url to retrieve the model mentioned in the example.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/3388>
2022-11-22 22:36:34 +00:00
He Junyan e7d584a816 h265parse: Add the missing timestamp when splitting a frame.
When splitting a frame, the gst_buffer_copy_region() does not copy
the timestamp correctly for sub frames when the offset is not 0.
We still need those timestamps for each output sub frame.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/3448>
2022-11-22 21:47:49 +00:00
He Junyan dae73d6686 h264parse: Add the missing timestamp when splitting a frame.
When splitting a frame, the gst_buffer_copy_region() does not copy
the timestamp correctly for sub frames when the offset is not 0.
We still need those timestamps for each output sub frame.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/3448>
2022-11-22 21:47:49 +00:00
Sebastian Dröge 76eb870251 dvbsubenc: Write Display Definition Segment if a non-default width/height is used
Otherwise it can't be rendered by dvbsuboverlay or ffmpeg at least.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/3446>
2022-11-22 21:04:39 +00:00
Vivia Nikolaidou c6af0a39e7 inputselector: Add drop-backwards property
When sync-streams=true, drop backwards buffers on pad switch.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/3256>
2022-11-22 21:21:40 +02:00
Vivia Nikolaidou 5fb71dd55b inputselector: Fix waiting on sync-mode=clock
Basically copy over what clocksync does, but taking into account that we
have multiple upstream latencies.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/3256>
2022-11-22 21:21:40 +02:00
Seungha Yang 6c007b8936 av1dec: Demote rank to secondary
cerbero does not build this plugin for now, and there's altanative
dav1ddec

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/3287>
2022-11-22 17:48:25 +00:00
Jan Alexander Steffens (heftig) 1d7c936db0 rtspsrc: Don't replace 404 errors with "no auth protocol found"
When getting a "404 Not Found" response from the DESCRIBE request, the
source produced a "No supported authentication protocol was found" error
instead of passing on the 404, which was confusing.

Only produce this error message when we're handling a response of "401
Unauthorized" without a compatible WWW-Authenticate header.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/3414>
2022-11-22 13:07:17 +00:00
Mengkejiergeli Ba 261290d1e6 vaapipostproc: Fix the negotiation failure of some formats
This patch fixes issue https://gitlab.freedesktop.org/gstreamer/gstreamer/-/issues/1565

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/3399>
2022-11-22 06:54:18 +00:00
Bill Hofmann afb18e0e31 kmssink: add HDR10 infoframe support
If stream has HDR10 metadata and HDMI device EDID supports it, this patch
will set the DRM properties accordingly.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/3303>
2022-11-21 17:55:41 -05:00
Bill Hofmann daecbd1ff0 kmssink: Add skip-vsync property
The legacy emulation in DRM/KMS drivers badly interact with GStreamer and
may cause the framerate to be halved. With this property, users can disable
vsync (which is handled internally by the emulation) in order to regain the
full framerate.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/3303>
2022-11-21 17:55:20 -05:00
Edward Hervey f9dbf91539 adaptivedemux2: Don't leak caps in debug statements
Instead just directly use the stream object (which will report the caps)

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/3443>
2022-11-21 19:02:44 +00:00
Edward Hervey a742c3bf27 adaptivedemux2: Don't leak tags
If we got them from GstStream, we should unref them when done

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/3443>
2022-11-21 19:02:44 +00:00
Edward Hervey e36b1ae6ed adaptivedemux: Use gst_clear_tag_list_where applicable
Clearer and ensures fields are reset

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/3443>
2022-11-21 19:02:44 +00:00
Edward Hervey 948bc4291c oggdemux: Don't leak pending seek event
Make sure any pending seek event is released when going back down to READY.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/3443>
2022-11-21 19:02:44 +00:00
Edward Hervey f3c2f612ce rtspsrc: Don't leak sticky events
We have incremented the reference 2 lines above, and
gst_pad_store_sticky_event() does not take a reference, therefore release it

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/3443>
2022-11-21 19:02:44 +00:00
Edward Hervey 1774d5c87a parsebin: Don't leak parsepad list on shutdown
Free it as it is down in other cases

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/3443>
2022-11-21 19:02:44 +00:00
Sebastian Dröge 7af129b755 textrender: Don't pass plaintext as pango markup to Pango
Otherwise e.g. & in the text will cause Pango to complain about invalid
markup and render the text incorrectly.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/3445>
2022-11-21 18:47:50 +02:00
Sebastian Dröge 5b1a1c41b6 textrender: Don't blindly forward all events
Use gst_pad_event_default(), which does the right thing by default.
Especially it does not forward text/x-plain caps downstream.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/3445>
2022-11-21 18:43:54 +02:00
Jan Schmidt 2a32861ab3 event: Add transfer none annotation to gst_event_new_stream_collection()
Update the documentation

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/3387>
2022-11-21 10:32:02 +00:00
Jan Schmidt 8b08305ef9 adaptivedemux2: Fix sticky event storage.
Use the new gst_event_type_to_sticky_ordering() method to retrieve
the order that sticky events should be sent / stored in, instead
of assuming it's the event type value.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/3387>
2022-11-21 10:32:02 +00:00
Jan Schmidt bdaa8f83aa pad: Fix sticky event ordering for instant-rate-change
The event type for instant-rate-change events was poorly chosen,
leading to them being re-sent too late and even after EOS.

Add a mechanism in GstPad for the sticky event order to be
different to the value of the event type to fix that up.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/3387>
2022-11-21 10:32:02 +00:00
Seungha Yang 132eddd7b9 av1decoder: Clear highest_spatial_layer per sequence header
Clear the value to default zero, indicating that no spatial scalability
layer is used.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/3430>
2022-11-19 11:58:01 +00:00
Seungha Yang c92128f6b0 av1decoder: Don't error out by dropped OBU
OBU can be dropped if the current layer is not in selected operation
point

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/3430>
2022-11-19 11:58:01 +00:00
Seungha Yang f1a52c5ea0 av1decoder: Fix wrong spatial layer validation
Highest spatial id and temporal id is independent, and should not drop
temporal enhance layer by the previous condition. Note that
the decision for dropping OBU based on operation point is being
handled in gst_av1_parser_identify_one_obu() already.

Fixes: https://gitlab.freedesktop.org/gstreamer/gstreamer/-/issues/1585
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/3430>
2022-11-19 11:58:01 +00:00
Seungha Yang 55ca832d70 av1parser: Don't print warning for expected OBU drop
Dropping an OBU which is not in selected operation point is an
expected condition.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/3430>
2022-11-19 11:58:01 +00:00
Seungha Yang 3ef2955c7d av1parser: Remove impossible condition
unsigned integer cannot be negative

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/3430>
2022-11-19 11:58:01 +00:00
Célestin Marot 9d829b85e4 fakesrc: avoid time overflow with datarate
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/3433>
2022-11-19 11:13:33 +00:00
Jan Schmidt dfb5e3365e webrtcbin: Remove queue after rtpfunnel
The original BUNDLE support commit placed a queue after the
rtpfunnel that combines streams, but I don't see a good reason for
it. It has default settings, so if network output is slow might
accidentally store up to 1 second of pending data, increasing
latency.

Remove it in favour of doing any necessary buffering before
webrtcbin. If it turns out that there is a reason for it to
exist, the limits should probably be configurable and small.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/3437>
2022-11-19 10:31:50 +00:00
Jan Schmidt 8177588250 examples/sendrecv: Remove extra unref of webrtcbin
The code now constructs webrtcbin with a floating ref and then
gives it to the pipeline. The extra unref is one too many.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/3436>
2022-11-19 19:51:54 +11:00
Matt Crane b11169bd32 rtpbasedepayload: Drop redundant reference timestamp buffer meta in RTP depayloaders
Currently, when rtspsrc property add-reference-timestamp-metadata=true,
a downstream rtph264depay element will attach multiple copies of the
same GstReferenceTimestampMeta to the depayloaded media buffers. This
can have signficant performance impacts further downstream in a pipeline
like the following:

    rtspsrc add-reference-timestamp-metadata=true ! rtph264depay ! h264parse ! ... ! rtph264pay ! ...

For example, if there are 10 packet buffers for a frame of RTP H.264
video, each of those packet buffers will contain the same reference
timestamp meta. The rtph264depay element will then attach all 10
metadata to the depayloaded frame. And then later when we payload the
frame buffer again for proxying, we now have 10 more buffers each with
10 instance of the same metadata. Allocating/deallocating 100+ instances
of metadata @ 30fps for multiple streams has a pretty large performance
impact.

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

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/3431>
2022-11-19 07:57:44 +00:00
Jan Schmidt 6538ebbaf3 webrtc: Improve GstWebRTCStatsType docstring
Fix a typo of peer-connectiion -> peer-connection

Add a link to the w3c RTCStats type for a description
of what each statistics type is.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/3434>
2022-11-19 13:12:58 +11:00
Jan Schmidt 5fa4f0562c webrtcbin: Fix a typo in debug log
transceiever -> transceiver

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/3434>
2022-11-19 13:12:58 +11:00
Jan Schmidt f2ae481a69 examples/webrtc: Configure payload types
MR 2398 broke the webrtc sendrecv example
by not configuring the payload types, so both audio and video streams
get sent on payload 96.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/3434>
2022-11-19 13:12:58 +11:00
Seungha Yang f6327e25a7 qsv: Promote encoder rank to PRIMARY on Windows
QSV is very well integrated with GstD3D11 infrastructure on Windows,
and this is the recommended H/W encoder element over the MediaFoundation
plugins on Intel GPU system.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/3393>
2022-11-19 00:43:10 +00:00
Nicolas Dufresne e60a94c27d video-frame: Avoid using tile width
The tile width in pixel is not always available. Notably for
8L128 10bit format, the tile is 8x128 bytes, and the pixel
format is fully packed. That means that the tile contains at
least 6 pixels per line, but it also hold some bits of the
pixel from the same line on the previous or next tile.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/3424>
2022-11-18 22:59:29 +00:00
Nicolas Dufresne 5980fb76e7 video: Add arbitrary tile dimensions support
In current tile representation, only tiles with power of two
width and height in bytes are supported. This limitation
prevents adding more complex tiles formats.

In this patch, we deprecate tile_ws and tile_hs from GstVideoFormatInfo and
replace if with an array of GstVideoTileInfo. Each plane tiles are then
described with their pixels width/height, line stride and total size.
The helper gst_video_format_info_get_tile_sizes() that depends on the
deprecated API is also being removed. This can simply be removed as it wasn't
in any stable release yet.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/3424>
2022-11-18 22:59:29 +00:00
Colin Kinloch 7840db5384 gst: serialization of GLibDateTime
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/2980>
2022-11-18 21:11:07 +00:00
Mathieu Duponchelle b5cd758230 aggregator: Implement force_live API
Setting force_live lets aggregator behave as if it had at least one of
its sinks connected to a live source, which should let us get rid of the
fake live test source hack that is probably present in dozens of
applications by now.

+ Expose API for subclasses to set and get force_live
+ Expose force-live properties in GstVideoAggregator and GstAudioAggregator
+ Adds a simple test

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/3008>
2022-11-18 18:14:26 +00:00
Vivia Nikolaidou f29c19be58 splitmuxsink: Avoid assertion when WAITING_GOP_COLLECT on reference context
I have seen a backtrace out in the wild where this happened. Maybe after
receiving EOS and stream-start on the reference context.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/3005>
2022-11-18 15:52:03 +00:00
Johan Sternerup e708543039 webrtcbin: Add settings for HTTP proxy
Pass this to libnice which has a simple HTTP 1.0 proxy with basic
authentication only.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/2867>
2022-11-18 15:00:58 +00:00
Vivia Nikolaidou ccb0e6e435 tsdemux: Add pad-name to warning for continuity mismatch
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/3141>
2022-11-18 12:22:03 +00:00
Edward Hervey db2146d0ea decodebin2: Minor debug fix for decodepad
decodedad might have their name changed when exposing, causing a race when
trying to get their name without taking a lock. Just use GST_PTR_POINTER in
debug statements instead

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/3428>
2022-11-18 07:22:23 +00:00
Edward Hervey 845dcf7ec5 imagesequencesrc: Don't leak caps
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/3428>
2022-11-18 07:22:23 +00:00
Edward Hervey 5a08b22026 ges-launcher: Don't leak string
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/3428>
2022-11-18 07:22:23 +00:00
Edward Hervey 615fbb3f10 ges-demux: Don't leak string
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/3428>
2022-11-18 07:22:23 +00:00
Edward Hervey 4aaaf29761 ges-xml-formatter: Plug some leaks
* Don't leak the mainloop
* Don't leak temporary strings
* Don't leak id when searching in hash table

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/3428>
2022-11-18 07:22:23 +00:00
Edward Hervey ba5beb55ab ges-project: Don't leak string
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/3428>
2022-11-18 07:22:23 +00:00
Edward Hervey 40d9858371 ges-structure-parser: Don't leak failed strings
We pass the ownership of current_string to the list of wrong strings, it will be
cleared then.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/3428>
2022-11-18 07:22:23 +00:00
Edward Hervey 137d38c991 ges-launch: Don't leak help string
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/3428>
2022-11-18 07:22:23 +00:00
Stéphane Cerveau 1ba066bda2 validate: cleanup the use of GST_VALIDATE_API on Windows
Export or import properly the method from GST_VALIDATE_API
with a proper config.h

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/3429>
2022-11-18 02:17:27 +00:00
Tim-Philipp Müller f9fadeac4c subprojects: switch libsoup to a file wrap
With fallback_url.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/3432>
2022-11-18 00:56:25 +00:00
Tim-Philipp Müller 27b0bfbe07 subprojects: update glib-networking to 2.74.0 and switch to file wrap
Also has a fallback_url for the tarball.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/3432>
2022-11-18 00:51:48 +00:00
Tim-Philipp Müller e9f8c4f3fd subprojects: update glib to 2.74.1
With fallback_url for tarball now too.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/3432>
2022-11-18 00:50:56 +00:00
Enrique Ocaña González aafe07a802 hlsdemux2: Expose EXT-X-PROGRAM-DATE-TIME as tags.
This allows an application to use timestamps associated
with fragments.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/1417>
2022-11-17 22:11:12 +00:00
Enrique Ocaña González a2990020b2 hlsdemux: Expose EXT-X-PROGRAM-DATE-TIME as tags.
This allows an application to use timestamps associated
with fragments.

Patch by: Thomas Bluemel <tbluemel@control4.com>

See: https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/issues/195
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/1417>
2022-11-17 22:11:12 +00:00
Matthew Waters 8e355d23a1 qtmux: use trun with multiple entries in more cases
The only case where we definitely need to write a new trun is when the
data_offset value does not match the end of the list of entries.
Needing multiple trun atoms is required when interleaving multiple
streams together.

All other cases can be covered by adding more entries to the existing
trun atom.

Fixes playback of fragemented mp4 in ffplay and chrome.

Using e.g. mp4mux fragment-duration=1000 fragment-mode=dash-or-mss
and
mp4mux fragment-duration=1000 fragment-mode=first-moov-then-finalise

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/3426>
2022-11-17 21:04:57 +11:00
Boyuan Zhang 416446b25c libs: context: use queried value for attrib
Attribute's value should use returned value from get_attribute for
VAConfigAttribRTFormat, since VAProfileHEVCMain10, in AMD Mesa Gallium,
can process either VA_RT_FORMAT_420 and VA_RT_FORMAT_420_10, which isn't
considered in gstreamer-vaapi design, where encoder's src pads will
expose only 4:2:0 color formats but no 4:2:0 10bit. So, this is a workaround
for this issue while new vah265enc is released.

Signed-off-by: Boyuan Zhang <boyuan.zhang@amd.com>
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/3397>
2022-11-17 09:20:49 +00:00
Víctor Manuel Jáquez Leal b2bfb066ec vabaseenc: Reduce logging noise if finish_frame fails.
Fixes: #1579
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/3423>
2022-11-17 05:25:18 +00:00
Piotr Brzeziński 64aad21f98 gst-docs: Fix broken tables in Cerbero docs
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/3425>
2022-11-16 22:41:01 +01:00
Seungha Yang 433301d0e5 amfcodec: Promote encoder rank to PRIMARY
This H/W encoder implementation is the recommended element
on AMD system over the MediaFoundation one.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/3394>
2022-11-16 14:47:27 +00:00
Edward Hervey 92abb8daec urisourcebin: Remove un-needed define
This code hasn't use GValueArray in ages

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/2784>
2022-11-16 14:01:47 +00:00
Edward Hervey 5702568a7e urisourcebin: Use a non-buffering multiqueue for non-streamable URI
Even though buffering is not required, we need to ensure we are dealing with the
interleave (if any) before pushing the elementary streams further downstream.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/2784>
2022-11-16 14:01:47 +00:00
Edward Hervey c59397354c urisourcebin: Minor doc fix
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/2784>
2022-11-16 14:01:47 +00:00
Jan Schmidt 6e549b2fe5 uridecodebin3: Don't leak EOS event
Make sure to unref the EOS event in all code paths
when returning GST_PAD_PROBE_HANDLED

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/2784>
2022-11-16 14:01:47 +00:00
Edward Hervey 6bffbe283a playbin3: Move gapless to uridecodebin3
This was the intention from the start, just took me a few years *cough* to
actually implement it properly.

Gapless is handled by re-using as much as possible the same decoders and sinks
if present, and only pre-rolling switching at the sources level (with buffering
if/when needed).

In order to enable "gapless" playback, the "next" uri should be set at any time
between the moment the `about-to-finish` signal is emitted and the moment the
current play item is done. Previously this could only be done with the signal
emission.

This new implementation also allows "Instantaneous URI switching". This allows a
much faster way of switching playback entries while re-using as many elements as
possible. To enable this set `instant-uri` property to TRUE, the default being
FALSE.

API: instant-uri properties
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/2784>
2022-11-16 14:01:47 +00:00
Edward Hervey 1f2d98028b playbin3: Remove unused code
This was never used, and if ever it's needed at some point for reference it's
available in gstplaybin.c

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/2784>
2022-11-16 14:01:47 +00:00
Edward Hervey 78e43a6319 decodebin3: Clear input collection when linked again
The previous collection no longer applies to this input

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/2784>
2022-11-16 14:01:47 +00:00
Edward Hervey 8ce0a23a5e decodebin3: Improve collection merging
If the collections are the same, don't merge them

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/2784>
2022-11-16 14:01:47 +00:00
Edward Hervey 0bb2026890 decodebin3: doc cleanup
Remove old/invalid FIXME and cleanup some logs

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/2784>
2022-11-16 14:01:47 +00:00
Edward Hervey 4bfbc72663 decodebin3: Remove unused variable
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/2784>
2022-11-16 14:01:46 +00:00
Jan Schmidt d3a66f9851 multiqueue: Protect reconfiguration with a lock
Add a lock to prevent overlapping of request and release
pads, to close a race where multiqueue might try and
add a slot with an id that hasn't quite finished being
removed yet by another thread.

Fix for https://gitlab.freedesktop.org/bilboed/gstreamer/-/issues/5
and https://gitlab.freedesktop.org/bilboed/gstreamer/-/issues/11

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/2784>
2022-11-16 14:01:46 +00:00
Edward Hervey 4b8f411c5d multiqueue: Handle gapless input
When dealing with gapless input (i.e. streams with changing group-id in
GST_EVENT_STREAM_START), we need to take into account the elapsed
running-time (if applicable) in order to properly calculate levels and output
time. Without doing this all incoming data from future groups would be
considered as being "late" and would be consumed immediately.

This does **NOT** modify the actual segment and buffer times, and is only used
internally.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/2784>
2022-11-16 14:01:46 +00:00
Edward Hervey f785b3d584 decodebin3: Allow re-using inputs
DecodebinInput (and their backing parsebin or identity) are no longer released
when the corresponding sinkpad is unlinked, but when it's released.

The parsebin element will be resetted:
* If incoming caps are incompatible (was the case before)
* Or when unlinking and it was previously pull-based

This opens the way to use decodebin3 with changing inputs (i.e. gapless)

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/2784>
2022-11-16 14:01:46 +00:00
Edward Hervey 1f8d8b2df6 uridecodebin3: use urisourcebin parse-streams property
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/2784>
2022-11-16 14:01:46 +00:00
Edward Hervey 412c4cbca3 urisourcebin: Improve buffering handling
Introduce the option to have the streams be parsed with `parsebin` for
compatible sources (i.e. which are eligible for buffering in the same way as
before this commit).

By parsing the inputs directly, this allows more accurate buffering control:
* Instead of relying on potential bitrate information coming from somewhere
* and *without* being linked downstream

If `parse-streams` is activated and the stream is eligible for buffering, then a
`multiqueue` will be used on the output of `parsebin` in order to handle the
buffering.

API: `parse-streams`
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/2784>
2022-11-16 14:01:46 +00:00
Edward Hervey fa4a70d7fe parsebin: avoid bogus processing
If a parsebin pad is already exposed, don't try to rename it or cause extra
processing which isn't needed

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/2784>
2022-11-16 14:01:46 +00:00
Edward Hervey 5e2606cacd decodebin3: Avoid parsebin usage if not needed
If the incoming streams are already parsed, there is no need to add yet-another
parsebin to process it *IF* that stream is compatible with a decoder or the
decodebin3 output caps.

This only applies if all the following conditions are met:
* The incoming stream can *NOT* do pull-based scheduling
* The incoming stream provides a `GstStream` and `GstStreamCollection`
* The caps are compatible with either the decodebin3 output caps or a decoder
  input

If all those conditions are met, a identity element is used instead of a
parsebin element and the same code paths are taken.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/2784>
2022-11-16 14:01:46 +00:00
Edward Hervey f010dce6e7 decodebin3: DecodebinInputStream: Hold a ref to srcpad
And move the locking outside of the input stream creation function

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/2784>
2022-11-16 14:01:46 +00:00
Edward Hervey e8f768212c urisourcebin: Bring high-watermark level in sync with legacy values
It was always 60%. For some reason this crept in during the initial urisourcebin
refactoring.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/2784>
2022-11-16 14:01:46 +00:00
Edward Hervey b589cf12f2 decodebin3: Don't leak collection when releasing inputs
And refactor the function slightly for clarity

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/2784>
2022-11-16 14:01:46 +00:00
Edward Hervey e276d3c836 decodebin3: Protect input freeing with the input lock
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/2784>
2022-11-16 14:01:46 +00:00
Edward Hervey f091d2445f decodebin3: Refactor parsebin output handling
* Instead of creating temporary `PendingPad` structures, always create a
  DecodebinInputStream for every pad of parsebin
* Remove never used `pending_stream` field from DecodebinInputStream
* When unblocking a given DecodebinInput (i.e. wrapping a parsebin), also make
  sure that other parsebins from the same GstStreamCollection are unblocked
  since they come from the same source

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/2784>
2022-11-16 14:01:46 +00:00
Edward Hervey d14c14dcc4 decodebin3: Store GstStreamCollection from upstream
If upstream provides stream collection, use/store them as soon as possible

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/2784>
2022-11-16 14:01:46 +00:00
Edward Hervey 64d775a44f urisourcebin: Move adaptive demuxer handling into ChildSrcPadInfo
It's part of that chain of elements

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/2784>
2022-11-16 14:01:46 +00:00
Edward Hervey a5f0085cda urisourcebin: Only remove components in PAUSED->READY
With the refactoring, we are guaranteed the components are only created in PAUSED

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/2784>
2022-11-16 14:01:46 +00:00
Edward Hervey 5b41ea2fe8 urisourcebin: Refactor ChildSrcPadInfo and OutputSlot usage
Make an explicit topology/tree of structures:
* ChildSrcPadInfo is created for each source element source pad
* ChildSrcPadInfo contains the chain of optional elements specific to that
  pad (ex: typefind)
* A ChildSrcPadInfo links to one or more OutputSlot, which contain what is
  specific to the output (i.e. optional buffering and ghostpad)
* No longer use GObject {set|get}_data() functions to store those structures and
  instead make them explicit
* Pass those structures around explicitely in each function/callback

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/2784>
2022-11-16 14:01:46 +00:00
Edward Hervey f42ca96ad9 urisourcebin: Remove duplicate call
We ensure sources are removed in PAUSED->READY->NULL. No need to call it when
creating the source.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/2784>
2022-11-16 14:01:46 +00:00
Edward Hervey 64c81b6972 urisourcebin: Remove pending pad handling
This was needed to support the legacy handling of changing streams (add new
pads, send EOS and remove old pads).

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/2784>
2022-11-16 14:01:46 +00:00
Edward Hervey b6584defd0 urisourcebin: Only expose pads once activation has completed
The following problem could happen:
* Thread 1 : urisourcebin gets activated from READY->PAUSED
* Thread 2 : some element causes a pad to be added to urisourcebin , which gets
linked downstream, which decides to activate upstream to pull-based.
  * That requires "activating" the pads from PUSH to NONE, and then from NONE to PULL
* Thread 1 : the base class state change handlers checks if all pads are
activated

The issue is that since going form PUSH to PULL requires going through NONE,
there is a window during which:
* Thread 1 : The pad was set to NONE (before being set to PULL)
* Thread 2 : The base class activates that pad (to PUSH)
* Thread 1 : The attempt to "activate" to PULL fails (silently or not)

This is very racy, so in order to avoid that, we make sure that we only add pads
once the transition from READY->PAUSED in the parent classes is done.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/2784>
2022-11-16 14:01:46 +00:00
Edward Hervey a347846698 urisourcebin: Only allow streams-aware adaptive demuxer
We no longer want to deal with elements that use the old-style of stream
switching and instead expose/remove streams as they appear/disappear

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/2784>
2022-11-16 14:01:46 +00:00
Edward Hervey e7eb9271ee urisourcebin: Simplify initial information collection
When iterating existing pads of a source, directly handle them:
* Raw pads are handled directly
* Pads without caps are connected to a typefind
* Other pads are handled via `handle_new_pad()`

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/2784>
2022-11-16 14:01:46 +00:00
Edward Hervey 80770fe0ec urisourcebin: Use iterator function where applicable
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/2784>
2022-11-16 14:01:46 +00:00
Edward Hervey 41617834d2 urisourcebin: Document and rename fields
Removes ambiguity when reading the code

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/2784>
2022-11-16 14:01:46 +00:00
Edward Hervey c8b9a7d640 urisourcebin: Remove unused lock/list
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/2784>
2022-11-16 14:01:46 +00:00
Edward Hervey 638633dea3 urisourcebin: Check for live source when generating element
Instead of at a later stage

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/2784>
2022-11-16 14:01:46 +00:00
Edward Hervey e8f9e17744 urisourcebin: Streamline demuxer removal
And since remove_source also removes the dmeuxer, we no longer need to call it
in addition

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/2784>
2022-11-16 14:01:46 +00:00
Edward Hervey 577febc29e urisourcebin: Clarify function name and arguments
* The "need_queue" variable is only used in one place, move it there
* Clarify the fact the function also exposes raw_pads

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/2784>
2022-11-16 14:01:46 +00:00
Edward Hervey 586ec1a672 urisourcebin: Error out if a source doesn't expose pads
Looks like this fell through the cracks. If a source element doesn't have
dynamic pads and doesn't provide any source pad ... we should properly error
out.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/2784>
2022-11-16 14:01:46 +00:00
Edward Hervey 3305d7ce8d tsdemux: Push GST_EVENT_STREAM_COLLECTION
Demuxers that are not streams-aware will have that handled by parsebin. This
created a difference in results downstream between streams-aware and
non-streams-aware demuxers

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/2784>
2022-11-16 14:01:46 +00:00
Edward Hervey e68baffcd9 adaptivedemux2: Notify that we are streams-aware
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/2784>
2022-11-16 14:01:46 +00:00
Nicolas Dufresne d3c5fc815e v4l2codecs: Allow output caps to be updated
This change allow output caps to be updated even though we stay in
streaming state. This is needed so that any upstream updated to fields
like framerate, hdr data, etc. can result in a downstream caps event
being pushed.

Previously, any of these changes was being ignored and the downstream
caps would not reflect it.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/3328>
2022-11-16 13:12:38 +00:00
Seungha Yang 0e4c520cf3 nvdecoder: Handle input caps change
Update output caps if it's notified by baseclass

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/3328>
2022-11-16 13:12:38 +00:00
Seungha Yang b4c19a96b7 nvdecoder: Don't hold decoder output state
It's not referenced by this implementation

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/3328>
2022-11-16 13:12:38 +00:00
Seungha Yang b886935e83 examples: Add test code to verify decoder caps update
Sample command lines
* Configures pipeline with video encoder
decoder-caps-update \
  --encoder="video/x-raw,format=NV12 ! qsvh264enc" \
  --decoder=d3d11h264dec \
  --videosink=d3d11videosink

* Playing exisiting file
decoder-caps-update \
  --location=test_file.mp4 \
  --decoder=d3d11h264dec \
  --videosink=d3d11videosink

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/3328>
2022-11-16 13:12:38 +00:00
Seungha Yang 349f8de13e d3d11decoder: Handle input caps change
Update output caps if it's notified by baseclass

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/3328>
2022-11-16 13:12:38 +00:00
Seungha Yang 2ede4011bf codecs: Keep track of non-decoding-essential input state change
In theory, input caps can be updated anytime at non-keyframe or
sequence boundary, such as HDR10 metadata, framerate, aspect-ratio
or so. Those information update might not trigger ::new_sequence()
or subclass may ignore the changes.

By this commit, input state change will be tracked by baseclass
and subclass will be able to know the non-decoding-essential
update by checking the codec specific picture struct
on ::output_picture()

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/3328>
2022-11-16 13:12:38 +00:00
Edward Hervey a40842545f Revert "mpegtspacketizer: memcmp potentially seen_before data"
This reverts commit fcad4cc646.

This was wrong is so many ways.

* The memcmp was badly used (it should use == 0 to check the data is identical,
  and not != 0)
* There was no boundary checks on the present stream section_data when passing
  it to memcmp.
* The return value should have been TRUE (i.e. we have done all checks, none of
  them failed, therefore the section has been seen before)
* stream->section_data would *always* be NULL if the section had already been
  processed

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

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/3421>
2022-11-16 12:20:41 +00:00
Edward Hervey a87b7da308 mpegts: Check is program is identical before updating
There is no need to update the program if it's identical :)

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/3421>
2022-11-16 12:20:41 +00:00
Nirbheek Chauhan 13723198a1 rtspsrc: Fix regression when using hostname in the location property
When the address can't be parsed as an IP address, it should just be
treated as a hostname and used as-is.

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

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/3420>
2022-11-16 11:30:26 +00:00
Edward Hervey c39400b52c avviddec: Report a latency even without upstream framerate
There are cases where upstream will not provide a framerate, or it won't be
fixed. But if there is latency introduced by the decoder we do want to report
it.

Therefore use the framerate stored in the actual decoder, which will have a
default.

Fixes hangs when playing back such streams with decodebin3 (where the multiqueue
will not have been informed of that downstream latency and not grow accordingly)

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/3391>
2022-11-16 10:42:18 +00:00
F. Duncanh d77fe9495a v4l2videodec: Fixes three H.264/HEVC ITU conformance tests
Postpone the cleanup of any consecutive sequence of lost frames
which starts at frame 0, until frame 100 is dequeued from driver.

This allows fluster tests JVT/CVWP2_TOSHIBA_E, JVC/CVWP3_TOSHIBA_E
and HEVC/POC_A_Bossen_3 that sends out-of-order frames to successfully
complete  (e.g., test of Amphion vpu driver).

Fixes #1569

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/3398>
2022-11-16 10:00:03 +00:00
Sebastian Dröge d815035e82 rtpjitterbuffer: Add test for rescheduling timers to negative times
This tests the changes introduced by 4d3b8d1129
for issue #571.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/3416>
2022-11-16 08:26:41 +00:00
Sebastian Dröge 3d79402344 rtpjitterbuffer: Reschedule timers when updating their offset
As EXPECTED timers are skipped the order of the timers relative to each
other can change if there are EXPECTED timers and rescheduling needs to
happen.

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

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/3416>
2022-11-16 08:26:41 +00:00
Sanchayan Maity 02fd7fb777 wavparse: Do not run all typefinders for all output
In order to figure out if the "raw" audio contained within the wav
container is actually DTS, wavparse calls the typefinder helper
except that means it runs all typefinders.

Since it only cares about checking for DTS, we should only run the
audio/x-dts typefinder (if present). Commit 858e516 did not really
fix things.

Use the new type helper with the caps to fix this.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/3417>
2022-11-16 10:32:25 +05:30
Sebastian Dröge 72c5105312 typefindhelper: Fix docs/annotations for the new functions
Follow-up for https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/3296

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/3418>
2022-11-16 04:07:09 +00:00
Sebastian Dröge 424e208170 rtspsrc: Consistently set seqnums on events
Set udpsrc seqnums on all events sent to the udpsrc's, and before
forwarding events out of rtspsrc set the latest seek seqnum on them if
any.

Also produce a consistent seqnum in rtspsrc from the very beginning.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/3409>
2022-11-16 02:36:30 +00:00
Sebastian Dröge e6efd288c2 rtspsrc: Make segment event writable before overriding the seqnum and use the proper API to do so
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/3409>
2022-11-16 02:36:30 +00:00
Sebastian Dröge 4099fd064b rtspsrc: Intercept and handle events when using no manager too
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/3409>
2022-11-16 02:36:30 +00:00
Sebastian Dröge e6a2e41c06 rtspsrc: Don't blindly copy over sticky events from manager pad to external source pad
This would get around the code that modifies some events when they go
through the ghost pad's proxypad. Instead go via the event function.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/3409>
2022-11-16 02:36:30 +00:00
Sebastian Dröge a4674a1e17 rtspsrc: Don't make udpsrc segment events writable just to retrieve their seqnum
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/3409>
2022-11-16 02:36:30 +00:00
Sebastian Dröge b181686211 rtspsrc: Reset EOS flag also on FLUSH_STOP and not only on ssrc-active
Also don't bother not sending EOS if EOS was sent already:
gst_pad_push_event() takes care of that for us already.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/3409>
2022-11-16 02:36:30 +00:00
Víctor Manuel Jáquez Leal f74fb5142d pbutils: Fix vp9 mime mapping when caps when no chroma-site.
It's possible to have 4:2:0 chroma format without chroma-site in caps, but it
isn't validated by the current code. This patch fixes it.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/3405>
2022-11-16 01:29:50 +00:00
Tim-Philipp Müller 202dc49f8b gdkpixbufoverlay: fix docs - changing images at runtime is supported
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/3415>
2022-11-15 22:43:01 +00:00
Sebastian Dröge 416dae67b2 videodecoder: Consider having output data when the subclass drops a frame
The subclass might drop a frame for QoS reasons (e.g. vpxdec) and if all
frames are dropped because of that it wouldn't make sense to post an
error message on EOS.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/3408>
2022-11-15 21:18:50 +00:00
Seungha Yang 721f059397 codectimestamper: Remove duplicated GstSegment struct
Use the one in priv struct. And use gst_segment_is_equal()
to compare GstSegment

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/3380>
2022-11-15 19:32:10 +00:00
Matthew Waters 6265fc8424 h264/5timestamper: provide a workaround for h264/5parse producing pts=NONE buffers
A workaround for
https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/649
and
https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/287
which is hard to change baseparse behaviour for both video and audio
parsers.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/3380>
2022-11-15 19:32:10 +00:00
Edward Hervey 30886fa9ea rtpjitterbuffer: Unlock timer waits on flushing
If there is a pending EOS wait for example, we would never unblock on flushing

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/3401>
2022-11-15 18:30:43 +00:00
Thibault Saunier 9dc787755d inspect: Print default value of ValueArray properties
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/3377>
2022-11-15 17:20:56 +00:00
Seungha Yang a4733eb33d nvcodec: Update plugin cache
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/3389>
2022-11-15 16:25:45 +00:00
Seungha Yang 5f1bc553f4 tests: cudaconvert: Update test code
Adding more formats, and rescale test with borders

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/3389>
2022-11-15 16:25:44 +00:00
Seungha Yang 9d30f9dd59 cudaconvertscale, cudascale: Add "add-borders" property and support 8bits RGB planar formats
Adding "add-borders" property which is identical to that of
videoscale and this will be enabled by default.
And adding RGBP/BGRP/GBR/GBRA format support.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/3389>
2022-11-15 16:25:44 +00:00
Seungha Yang c11f8fa930 cuda: Rewrite colorspace/rescale object
Rewriting GstCudaConverter object, since the old implementation was not
well organized and it's hard to add new features.
Moreover, the conversion operations were not very optimized.

Major change of this implementation:
* Remove redundant intermediate conversion operations such as
  any RGB -> ARGB(64) conversion or any YUV -> Y444 (or 16bits Y444).
  That's not required most of cases. The only required case is
  converting 24bits (such as RGB/BGR) packed format to 32bits format
  because CUDA texture object does not support sampling 24bits format
* Use normalized sample fetching (i.e., [0, 1] range float value)
  and also normalized coordinates system for CUDA texture.
  It's consistent with the other graphics APIs such as Direct3D
  and OpenGL, that makes sampling operations much easier.
* Support a kind of viewport and adopt math for colorspace conversion
  from GstD3D11 implementation

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/3389>
2022-11-15 16:25:44 +00:00
Seungha Yang c1efa9ac4b cudaupload,cudadownload: Add support for planar 8bits RGB formats
Defines RGBP, BGRP, and GBR formats, which have the same memory
layout as already supported Y444. And defines GBRA format as well
which needs just one additional alpha plane

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/3389>
2022-11-15 16:25:44 +00:00
Seungha Yang 9c4c8c3932 cudacontext: Store texture alignment
it was missed in the previous refactoring

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/3389>
2022-11-15 16:25:44 +00:00
Seungha Yang 950dad201d cudaconvert, cudascale: Port to GstCudaBaseCovert baseclass
Don't need to hold duplicated code in the source tree

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/3389>
2022-11-15 16:25:44 +00:00
Seungha Yang eb2ef5a4fd cuda: Add convertscale element
GstCudaConverter object can do colorspace conversion and scale at once.
Adding new element "cudaconvertscale" to do that, this can
save unnecessary GPU operation if colorspace conversion and
rescale is required for given input stream format.

Most of codes are taken from d3d11convert element

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/3389>
2022-11-15 16:25:44 +00:00
Sanchayan Maity 30841dae99 typefindhelper: Use the new GstTypeFind * API
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/3296>
2022-11-15 14:05:40 +00:00
Sanchayan Maity 89da632219 typefindhelper: Introduce a new API for working with a GstTypeFind *
Introduce a new API that can return a GstTypeFind * with helper functions
and data set around buffer data.

While at it, drop factory field from GstTypeFindBufHelper. While it was
useful for logging, it was not passed through function arguments and keeping
it for logging would require an additional API increasing the API surface
and making it harder to use.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/3296>
2022-11-15 14:05:40 +00:00
Sanchayan Maity 036b77b519 typefindhelper: Add helpers to improve type finding given the caps
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/3296>
2022-11-15 14:05:40 +00:00
Sanchayan Maity 58f7d88585 typefindhelper: Update annotation for function parameters
Fix the nullable/optional situation. allow-none is deprecated and
replaced by either or both of the others.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/3296>
2022-11-15 14:05:40 +00:00
Edward Hervey 0c59e3ce2a validate-scenario: Avoid timeouts on EOS
If there is an EOS and the next action is waiting for a playback time, execute
it since we are guaranteed the position won't change anymore.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/3403>
2022-11-15 07:47:49 +01:00
Elliot Chen b09b246fc8 gstplay: add warning message details check before post it
For some warning message which has no detail data, need check to avoid printing critical log.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/3382>
2022-11-15 01:01:10 +00:00
Rafał Dzięgiel e93f391139 tests: Add DASH MPD baseURL with query test
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/1147>
2022-11-14 23:45:53 +00:00
Rafał Dzięgiel 30c2bdad61 mpdparser: Fix missing baseURL query
When no initializationURL or mediaURL, return baseURL that also
contains original URI query if available. This fixes a problem
where URI query was being omitted in the HTTP requests.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/1147>
2022-11-14 23:45:53 +00:00
Rafał Dzięgiel 548bbc3147 mpdparser: Be consistent about returning duplicated URL
Instead of returning a "const gchar" or a "gchar" that should not be freed, always
return a duplicated string as those functions were used together with g_strdup anyway.

This is needed to prepare support for returning modified strings in next commit.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/1147>
2022-11-14 23:45:53 +00:00
Rafał Dzięgiel 0d79dbedf3 mpdparser: Return correct mediaURL value
This fixes a problem where get_mediaURL was returning NULL when segmentURL
was unavailable instead of baseURL as a fallback.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/1147>
2022-11-14 23:45:53 +00:00
Seungha Yang 837881ad29 d3d11converter: Fix YUY2 conversion error
Always configure shader conversion path, then fallback to the
shader path if processor is not available

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/3392>
2022-11-14 20:14:27 +00:00
Seungha Yang d0572622fa d3d11: Add support for planar RGB formats
Adding RGBP, BGRP, GBR, GBR_10LE, GBR_12LE, GBRA, GBRA_10LE, and
GBRA_12LE format support

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/3392>
2022-11-14 20:14:27 +00:00
Seungha Yang b4d59e4e43 d3d11screencapturesrc: Update plugin cache
Missed in
https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/3360

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/3392>
2022-11-14 20:14:26 +00:00
Edward Hervey 5c1cb960b3 oggdemux: Don't leak incoming EOS event
If we're going to drop it ... then do drop it :)

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/3400>
2022-11-14 16:51:40 +00:00
Víctor Manuel Jáquez Leal 64cb38685b matroskademux: Handle element's duration query.
This is small regression from commit f7abd81a.

When calling `gst_element_query()` no pad is associated with that query, but the
current code always forwards the query to the associated pad, which is NULL in
previous case. This patch checks for the pad before forwarding the query.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/3404>
2022-11-14 15:10:44 +00:00
Jan Schmidt 452890093d aesdec: Fix padding removal for per-buffer-padding=FALSE
When per-buffer-padding is FALSE, the OpenSSL context needs
to be told to remove any padding at the end of the ciphertext

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

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/3406>
2022-11-15 00:13:15 +11:00
Rafał Dzięgiel 9e74c728cb adaptivedemux2: Fix parent object leak
gst_object_get_parent() method is transfer-full, thus unref is needed

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/3396>
2022-11-13 11:35:09 +00:00
Edward Hervey 7988144048 pbutils/encoding-profile: Streamline cleanup
Cleanup all local variables in one place, and ensure failure cases go through there.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/3390>
2022-11-13 06:59:11 +01:00
Edward Hervey 6582cd514a avvidenc: Don't leak AVPacket on EOF
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/3390>
2022-11-13 06:59:11 +01:00
Edward Hervey 47833c8b36 avcfg: Don't leak the support GArray when registering flag/enums
* Only create it if we are attempting to put values in it
* If we sucessfully registered the values, only free the GArray
* IF we didn't, also free the backing memory

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/3390>
2022-11-13 06:59:11 +01:00
Edward Hervey 1c8a57a85c transcodebin: Use const arguments for clarity
And rename it when it classhes with existing local variable

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/3390>
2022-11-13 06:59:11 +01:00
Edward Hervey 2e2bc0da54 transcodebin: Don't leak GstStream
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/3390>
2022-11-13 06:59:11 +01:00
Edward Hervey 8e09b645c0 transcode: Don't leak caps
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/3390>
2022-11-13 06:59:11 +01:00
Edward Hervey c82f9c9f8c transcode: Don't leak timer
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/3390>
2022-11-13 06:59:11 +01:00
Edward Hervey e821b65a64 validate-scenario: Don't leak GFile
And use specific variables for clarity in loops.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/3390>
2022-11-13 06:59:11 +01:00
Edward Hervey 3f95779c30 validate: Don't leak discoverer information
The various streaminfo were being overwritten without being unreffed first

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/3390>
2022-11-13 06:59:11 +01:00
Edward Hervey 00133ebbe4 mpegtsbase: Don't leak GList
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/3390>
2022-11-13 06:59:10 +01:00
Edward Hervey f8f3615585 validate: Don't deinit too early
If we are going to use the validate functions ... do that *before*
deinit'ing.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/3390>
2022-11-12 12:24:21 +01:00
Edward Hervey eebb794a4f streamsynchronizer: Don't leak the syncstream object
It was leaked when breaking out early when handling GST_EVENT_STREAM_START

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/3390>
2022-11-12 12:24:21 +01:00
Edward Hervey 45e8137e6e uritranscodebin: Don't leak uris, profile, sinkpad and filters
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/3390>
2022-11-12 10:33:51 +01:00
Edward Hervey a301c92ca3 transcodebin: Don't leak profile
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/3390>
2022-11-12 10:33:51 +01:00
Edward Hervey 9b67028759 transcodebin: Actually free the TranscodingStream structure
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/3390>
2022-11-12 10:33:51 +01:00
Edward Hervey 90a1d9f873 transcoder: Don't leak API bus and GMainLoop
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/3390>
2022-11-12 10:33:51 +01:00
Edward Hervey 052f23a310 avvidenc: Don't leak filename
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/3390>
2022-11-12 10:33:51 +01:00
Edward Hervey c00da50c61 encodebasebin: Don't leak muxer pad
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/3390>
2022-11-12 10:33:51 +01:00
Edward Hervey 872b0a65cb pbutils/encoding-profile: Don't leak string array
It was never freed

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/3390>
2022-11-12 10:33:51 +01:00
Edward Hervey ba0c95312e streams: Reset stream id field on finalize
If debugging is activated, the parent class finalize might attempt to read it

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/3390>
2022-11-12 10:33:50 +01:00
Seungha Yang 219c5cf330 meson: d3d11: Clarify the message for WGC support check
Even Windows10 SDK seems to have required symbols depending on installed
SDK version

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/3376>
2022-11-11 19:42:19 +00:00
Seungha Yang 12a2c1dffe d3d11screencapturesrc: Fix build error with MSVC x86
Delete the code for now. Note that the code block is unnecessary already

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/3375>
2022-11-11 18:58:54 +00:00
Taruntej Kanakamalla 0d5c89a3b4 Updated the Pango broken link
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/2723>
2022-11-11 12:17:40 +00:00
Taruntej Kanakamalla ba49efa8f2 Updated the GObject tutorial link
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/2723>
2022-11-11 12:17:40 +00:00
Nicolas Dufresne b57135e09c rawvideoparse: Fix support for sub-sampled tile
This element was missed as it does not use the new helpers to calculate the
plane size. The code is relatively simple though, so adding support for
subsample tiles was easy enough.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/3385>
2022-11-11 11:02:15 +00:00
Matthew Waters 5ca3988420 webrtc/datachannel: handle error messages from appsrc/sink
Fixes a possible race where closing a data channel may produce e.g.
not-linked errors.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/3381>
2022-11-11 10:13:27 +00:00
Matthew Waters a34e380e2e sctpdec: fix stream reset (src pad removal) if no data is ever received
If we don't receive any data from usrsctp, then there will be no src pad
for the stream id and the stream reset will fail to remove the relevant
src pad.  Workaround by first attempting to add the relevant src pad, then
almost immediately removing it.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/3381>
2022-11-11 10:13:27 +00:00
He Junyan b010f00d36 test: Correct the test suite name of the h264 and h265 bitwriter.
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/3384>
2022-11-11 08:19:01 +00:00
Colin Kinloch 99fc124f25 videocrop, videobox: Simplify navigation event handling and support touch events
Signed-off-by: Colin Kinloch <colin.kinloch@collabora.com>
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/3053>
2022-11-11 06:45:49 +00:00
Colin Kinloch 841f50f0d9 va: Fix vapostproc navigation event co-ordinate mapping
Signed-off-by: Colin Kinloch <colin.kinloch@collabora.com>
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/3053>
2022-11-11 06:45:49 +00:00
Colin Kinloch e1d71aedbc vaapi: Use gst_video_orientation_from_tag to parse orientation
Signed-off-by: Colin Kinloch <colin.kinloch@collabora.com>
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/3053>
2022-11-11 06:45:48 +00:00
Colin Kinloch d7aba91518 videoflip: Use gst_video_orientation_from_tag to parse orientation
Signed-off-by: Colin Kinloch <colin.kinloch@collabora.com>
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/3053>
2022-11-11 06:45:48 +00:00
Colin Kinloch d54e597278 va: Use gst_video_orientation_from_tag to parse orientation
Signed-off-by: Colin Kinloch <colin.kinloch@collabora.com>
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/3053>
2022-11-11 06:45:48 +00:00
Tong Wu ef4fc11193 msdkvpp: delete the macros to make video memory work on Windows
Since gst_msdk_import_to_msdk_surface has been implemented for d3d11, we
delete the macros to make it work on Windows.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/3231>
2022-11-11 06:02:28 +00:00
Tong Wu 7becf35221 msdkvpp: modify the way of copying system memory to msdk surface
Replace video_copy with memcpy to fix the issue when the sizes of the
src frame and dst frame don't match. Moreover, for Windows, you have to
do the copy first and call gst_msdk_import_to_msdk_surface later.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/3231>
2022-11-11 06:02:28 +00:00
Tong Wu 9a6dd525f7 msdkvpp: add d3d11 support during negotiation
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/3231>
2022-11-11 06:02:28 +00:00
Tong Wu a55808d299 msdkvpp: add d3d11 video memory to sink and src caps
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/3231>
2022-11-11 06:02:28 +00:00
Tong Wu 78523c5130 msdkvpp: delete use_sinkpad_va and use_srcpad_va
This two variables are no longer useful. Delete them for now.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/3231>
2022-11-11 06:02:28 +00:00
Tong Wu f25f528120 msdkenc: modify the way of copying system memory to msdk surface
Replace video_copy with memcpy to fix the issue when the sizes of the
src frame and dst frame don't match. Moreover, for Windows, you have to
do the copy first and call gst_msdk_import_to_msdk_surface later.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/3231>
2022-11-11 06:02:28 +00:00
Tong Wu f6e207eb1b msdkallocator_d3d: add d3d11 video memory and import it to msdk surface
This patch introduces d3d11 texture and index to GstMsdkMemoryID and
implements gst_msdk_import_to_msdk_surface in order to wrap the surface
to mfxMemId.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/3231>
2022-11-11 06:02:28 +00:00
Tong Wu 7f18f11a90 msdkallocator_d3d: implement GetHDL callback function
During encoding process, oneVPL runtime will call GetHDL callback function.
This patch implements this function for the use of msdk.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/3231>
2022-11-11 06:02:28 +00:00
Tong Wu 86d22b2e38 msdkallocator: add a parameter to function gst_msdk_import_to_msdk_surface
Add a flags parameter to function gst_msdk_import_to_msdk_surface and
move the function declaration to gstmsdkallcator.h to prepare for adding
Windows implementation.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/3231>
2022-11-11 06:02:28 +00:00
Tong Wu abe47f3fa0 msdkenc: add d3d11 pool during negotiation
This patch adds Windows specific set_format and propose_allocation
functions to enable creating d3d11 pools during negotiation.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/3231>
2022-11-11 06:02:28 +00:00
Tong Wu c62deb6fe9 msdkenc: add D3D11 caps for msdkenc
This patch adds D3D11 feature to sink factory for msdkenc.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/3231>
2022-11-11 06:02:28 +00:00
Tong Wu d61a248ac8 MSDK: Introduce d3d11 device to MSDK context
Currently MSDK context does not support d3d11va. Now introduce d3d11va
device to MSDK context, making it able to create msdk session with d3d11
device and to easily share with upstream and donwstream.

Add environment variable to enable user to choose GPU device in multi-GPU
environment. This variable is only valid when there's no context
returned by upstream or downstream. Otherwise it will use the device
that created by upstream or downstream.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/3231>
2022-11-11 06:02:28 +00:00
Tong Wu 11e13b189d MSDK: Add gst d3d11 lib into MSDK's dependency
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/3231>
2022-11-11 06:02:28 +00:00
Víctor Manuel Jáquez Leal eb0f90f6ec vafilter: Log out processed surfaces for debug.
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/3373>
2022-11-11 04:19:54 +00:00
Víctor Manuel Jáquez Leal bc4aa017ac vadeinterlace, vapostproc: Drop output buffer if process failed.
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/3373>
2022-11-11 04:19:54 +00:00
Daniel ccfb77c775 debugutils: videocodectestsink: add support for more formats
Add support for more formats so as to run the libvpx high bit depth test suite.
This means the files under CONFIG_VP9_HIGHBITDEPTH

This also allows running the yuv444p 8bit file in the regular 8 bit vp9 suite.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/3356>
2022-11-10 15:26:22 +00:00
Elliot Chen 4020542b3c gstplay: fix segmentation fault caused by subtitle info update
For subtitle stream played by subrui, gstplay will update subtitle
information before select the stream by using playbin3. Need check
the subtitle_sid value to avoid segmentation fault.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/3383>
2022-11-10 14:07:39 +00:00
Christian Wick 60a7366d27 gst-rtsp-server: compile example for onvif backchannel testing
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/3363>
2022-11-10 13:04:04 +02:00
Christian Wick 2498457b2f rtspsrc: Introduce new action signal push-backchannel-sample with correct ownership semantics
Signals are not supposed to take ownership of their arguments but only
borrow them for the scope of the signal emission.

The old action signal `push-backchannel-buffer` is now marked deprecated.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/3363>
2022-11-10 13:04:04 +02:00
Guillaume Desmottes 9eee5adb24 gssink: add 'content-type' property
Useful when one wants to upload a video as `video/mp4` instead of
'video/quicktime` for example.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/3371>
2022-11-10 09:53:29 +00:00
Matthew Waters e2ff6b61ce cccombiner: initial implementation of using CCBuffer helper
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/3211>
2022-11-10 00:52:14 +00:00
Matthew Waters 088597b430 closedcaption: move CC buffering to helper object
Move most of the interesting code from ccconverter to this new helper
object.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/3211>
2022-11-10 00:52:14 +00:00
Matthew Waters 06a20f9243 closedcaption: move cdp->cc_data into shared location
So it can be used by both ccconverter and cccombiner

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/3211>
2022-11-10 00:52:14 +00:00
Matthew Waters fde92ec43f closedcaption: move cc_data->cdp to shared file
Used by both ccconverter and cccombiner

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/3211>
2022-11-10 00:52:14 +00:00
Matthew Waters 9f1b54f6ee ccconverter: avoid different indent versions indenting !! differently.
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/3211>
2022-11-10 00:52:14 +00:00
Matthew Waters 067185e7da closedcaption: move cdp framerate table to common file
shared by both cccombiner and ccconverter

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/3211>
2022-11-10 00:52:14 +00:00
Matthew Waters 5dd199f7e8 cccombiner: don't assume a single cea608 data packet per buffer
e.g. 24fps can have up to 3 and would include either two field0 or
field1 cea608 data.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/3211>
2022-11-10 00:52:14 +00:00
Matthew Waters 741cfd18b5 ccconverter: drop data when overflow on extracting cea608 from cc_data
If the buffer overflows, then drop rather than causing a failure and
fropping the output buffer indefinitely.  This may have caused downstream to
be waiting for data the will never arrive.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/3211>
2022-11-10 00:52:14 +00:00
Matthew Waters 542060fea7 ccconverter: fix framerate passthrough with malformed input
If an input is malformed (only produces cea608 field 1 cc_data) then
when in passthrough we would effectively be dropping every second cea608
on output as we would not store any unused cea608 data.

Fix by having all code paths go through the framerate conversion code
which will store and retrieve any relevant data across buffers.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/3211>
2022-11-10 00:52:14 +00:00
Seungha Yang b36b9c7821 amfcodec: Fix typos
Fixing typo surfrace -> surface

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/3378>
2022-11-09 23:02:21 +00:00
Seungha Yang 93b6cf7adb mfvideosrc: Return S_OK from ISampleGrabberCB callback
The Microsoft's ISampleGrabber implementation seems to be ignoring
the HRESULT return value from the callback though,
S_OK is the right HRESULT code.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/3379>
2022-11-10 06:03:45 +09:00
Nicolas Dufresne aaa01ac30a gstgl: Fix handling of padded tile formats
When a tile format is padded and imported as DMABuf, the stride
contains the information about the actual width and height in
number of tiles. This information is needed by the detiling shader
in order accuratly calculate the location of pixels. To fix that,
we also copy the offset and strides into the otuput format and
the converter will ensure that the shader is recompiled whenever
the stride changes.

This fixes video corruptions observed when decoding on MT8195
with videos that aren't not aligned to 64bytes in width.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/3365>
2022-11-09 17:15:32 +00:00
Edward Hervey e3637e3207 childproxy: Fix documentation
Warning: Gst: gst_child_proxy_get_child_by_name_recurse: unknown parameter
'parent' in documentation comment, should be 'child_proxy'

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/3370>
2022-11-09 16:03:58 +00:00
Mengkejiergeli Ba 51f92fd15f vaapi: Add new dmabuf mem type when building caps
Media-driver will return dmabuf mem type GST_VAAPI_BUFFER_MEMORY_TYPE_DMA_BUF2
on the latest platform like Gen12. To enable build caps using dmabuf, need to
add the check for this type at gst_vaapi_build_caps_from_format.

This patch is a portion from Junyan.He@intel.com
https://gitlab.freedesktop.org/gstreamer/gstreamer-vaapi/-/merge_requests/393

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/1287>
2022-11-09 13:41:26 +00:00
Mengkejiergeli Ba d8a477338f vaapipostproc: Enable to use DMABuf mem at sink and src pad
Enable DMABuf mem at both sink and src pad for vaapipostproc caps which
helps to apply DMABuf for more generic use cases: such as "! vaapih264dec !
video/x-raw(memory:DMABuf) ! vaapipostproc ! video/x-raw (memory:DMABuf)
! vaapih265enc"  . Or other mem converions like from DMABuf to VASurface
through vaapipostproc.

This patch is a portion from Junyan.He@intel.com
https://gitlab.freedesktop.org/gstreamer/gstreamer-vaapi/-/merge_requests/393

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/1287>
2022-11-09 13:41:26 +00:00
Seungha Yang 99b83f33f7 d3d11screencapturesrc: Specify PAR 1/1 to template caps
... otherwise PAR can be wrongly signalled during the negotiation

Fixing below pipeline when desktop resolution is not 640x480
gst-launch-1.0.exe \
  d3d11screencapturesrc ! videoscale !
  video/x-raw,width=640,height=480,pixel-aspect-ratio=1/1 ! d3d11videosink

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/3360>
2022-11-09 11:22:06 +00:00
Víctor Manuel Jáquez Leal 7f4f11503c tests: examples: va: Add encoders dynamic reconfiguration.
Take the QSV encoder test and used it for VA.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/2466>
2022-11-09 06:15:23 +01:00
Víctor Manuel Jáquez Leal 1f7cf1d408 va: caps: Fix raw caps for H264 encoding.
Mesa gallium and Intel i965 ill reports unsupported video formats.

This commit reverts ecb12a05 and adds a deeper workaround, since
ecb12a05 only fix the template caps, but not when renegotation
happens.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/2466>
2022-11-09 06:15:23 +01:00
Víctor Manuel Jáquez Leal 4994487b8f vabaseenc: Log out the flow error name.
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/2466>
2022-11-09 06:15:23 +01:00
Víctor Manuel Jáquez Leal dbf8c38667 vah264enc: Enable parameters change while running.
1. Removes the verification if the internal encoder is not opened
   yet to allow the property setting.

2. And toggles on the base class' reconf flag for each property
   variable that can be modified at run time.

3. Mark those modifiable properties as mutable while playing.

Currently the run-time modifiable properties are:

qpi, qpp, qpb, bitrate, target percentage, target usage and rate control

Other properties can be enabled too, but they need testing.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/2466>
2022-11-09 06:15:21 +01:00
Víctor Manuel Jáquez Leal bd3c50e50f vabaseenc: Enable encoder reconfiguration.
Adds an internal function reset() which drains the internal queues and
calls the reconfig() vmethod.

This reset() method is called inconditionally at set_format() and in
handle_frame() if the instance's reconf flag is enabled.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/2466>
2022-11-09 06:13:26 +01:00
Víctor Manuel Jáquez Leal 351a107ecc vah264enc: Avoid reopen encoder or renegotiate.
If parameters remain similar enough to avoid either encoder reopening
or downstream renegotiation, avoid it.

This is going to be useful for dynamic parameters setting.

To check if the stream parameters changed, so the internal encoder has
to be closed and opened again, are required two steps:

1. If input caps, profile, chroma or rate control mode have changed.
2. If any of the calculated variables and element properties have
   changed.

Later on, only if the output caps also changed, the pipeline
is renegotiated.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/2466>
2022-11-09 06:13:26 +01:00
Víctor Manuel Jáquez Leal 38f1a4ee3d vaencoder: Add gst_va_encoder_get_reconstruct_pool_config()
This method will return the caps configured in the reconstruct buffer
pool, and its maxium number of buffers to allocate.

The caps are needed later to know if the internal encoder has to be
reopened if the stream properties change.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/2466>
2022-11-09 06:13:25 +01:00
Seungha Yang ded3e7c81a directshow: Demote rank of device provider to GST_RANK_NONE
Current directshow plugin seems to be unstable and unmaintained
for many many years.

See
https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/3323
and
https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/1828

Disable this device provider by default to avoid any side-effect
of this plugin

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/3355>
2022-11-09 00:30:45 +00:00
Victor Manuel Jaquez Leal bb86728a1a vah264enc: Fix properties documentation.
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/3361>
2022-11-08 21:49:05 +00:00
Victor Manuel Jaquez Leal c60504bd9e va: Document device-path property.
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/3361>
2022-11-08 21:49:05 +00:00
Victor Manuel Jaquez Leal 98a3aee6cb va: Reenable plugin cache.
This basically a revert of commit 9bb560e7

Also it adds vaav1dec.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/3361>
2022-11-08 21:49:05 +00:00
Victor Manuel Jaquez Leal 0918910a7d vavp8dec, vampeg2dec: Fix type name.
The camel case name is wrong when registering the type.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/3361>
2022-11-08 21:49:05 +00:00
Talha Khan 6c8b7204e5 videoconvert, videoscaleconvert: fix element description
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/3362>
2022-11-08 16:51:58 +00:00
Sebastian Dröge 82f09d64d7 allocator: Switch allow-none annotations to nullable / optional
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/3364>
2022-11-08 17:45:37 +02:00
Sebastian Dröge aadebd6921 allocator: Copy allocator name in gst_allocator_register()
The parameter is not marked as `transfer full` and stays around in the
hash table, so we will have to copy it ourselves.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/3364>
2022-11-08 17:44:54 +02:00
Guillaume Desmottes c624900a44 tracers: latency: document the 'reported' flag
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/3359>
2022-11-08 10:10:09 +00:00
Víctor Manuel Jáquez Leal 96a6b33029 vacaps: Sort raw caps according their efficiency.
Caps negotiations considers template caps order. This patch sets the
correct order according the feture caps: VAMemory, DMABuf and
SystemMemory.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/3349>
2022-11-08 05:15:09 +00:00
Tim-Philipp Müller db450689db Back to development
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/3358>
2022-11-08 02:08:08 +00:00
Tim-Philipp Müller a1fcf2b90a subprojects: pin gst-plugins-rs for GStreamer 1.21.2 release 2022-11-08 01:51:20 +00:00
Tim-Philipp Müller 3e29ac35c4 Release 1.21.2 2022-11-07 23:54:03 +00:00
Tim-Philipp Müller 98d2f958a9 Update ChangeLogs for 1.21.2 2022-11-07 23:53:57 +00:00
Xavier Claessens e8eddf46ea hotdoc: gst-hotdoc-plugins-scanner is not needed for libraries
Meson >= 0.64.0 does not allow any more to add executables into
hotdoc.generate_doc(..., dependencies: ...) and it should not be needed
any way.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/3352>
2022-11-07 23:06:32 +00:00
Jan Alexander Steffens (heftig) 28628a67e5 srt: Add a property to disable automatic reconnect
This adds a new boolean property `auto-reconnect`, defaulting to `true`.

Setting it to `false` makes the elements (in caller mode) immediately
report an error to the application instead of trying to reconnect.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/3326>
2022-11-07 22:23:02 +00:00
Sebastian Dröge 40800fa117 discoverer: Annotate DiscovererInfo::get_audio_streams() and others with the concrete stream info type
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/3353>
2022-11-07 19:04:49 +00:00
Víctor Manuel Jáquez Leal bbd2bce11d vabasetransform: Fail if cannot import the input buffer.
Otherwise got a buffer double free.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/3348>
2022-11-07 17:57:05 +00:00
Seungha Yang 4b05736c63 mfvideosrc: Add support for DirectShow capture filter
Adding DirecShow video capture filter mode, in addition
to existing MediaFoundation and WinRT(UWP) mode, to support
DirectShow only filters (not KS driver compatible)
such as custom virtual camera filters.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/3350>
2022-11-08 01:33:14 +09:00
Jan Alexander Steffens (heftig) a51d492445 tests: gstinfo: Test set_threshold_from_string's new reset behavior
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/605>
2022-11-07 14:49:45 +00:00
Jan Alexander Steffens (heftig) 38a2453f23 tests: gstinfo: Make logging tests pass when GST_DEBUG is set
Use gst_debug_set_threshold_from_string's new reset behavior to undo
GST_DEBUG and ensure the logging tests have a known configuration.

`gst_debug_set_threshold_from_string ("LOG", TRUE)` has the same effect
as `gst_debug_set_threshold_from_string ("", TRUE)` followed by
`gst_debug_set_default_threshold (GST_LEVEL_LOG)`.

Don't bother remembering the default log level set when the test
started. It will get reset by the next test, anyway.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/605>
2022-11-07 14:49:44 +00:00
Jan Alexander Steffens (heftig) 58013b4b21 info: Reset patterns with set_threshold_from_string
TLDR: Make `gst_set_threshold_from_string ("", TRUE)` reset *all*
threshold settings, including those set by previous invocations of
`gst_debug_set_threshold_from_string`.

The docs say:

    @reset: %TRUE to clear all previously-set debug levels before setting
        new thresholds

What actually happens is it sets the default threshold to `ERROR`,
leaves the patterns in place and calls
`gst_debug_category_reset_threshold` on each category.

In effect, any category that is matched by a pattern gets reset to that
threshold if the app changed it by directly invoking
`gst_debug_category_set_threshold`. All other categories are reset to
`ERROR`.

In my opinion this parameter currently has little value, as the same
effect can be achieved by including `ERROR` (without a pattern) in the
string, as in `"foo*:WARNING,*bar:INFO,ERROR"`.

What I actually expect it to do is reset *all* threshold settings,
including those set by previous invocations of
`gst_debug_set_threshold_from_string`, starting off with a clean slate
for the patterns provided with the call.

Otherwise there is no API to do this, besides:

  - Painfully removing patterns one-by-one via
    `gst_debug_unset_threshold_for_name` *if* you know what the patterns
    are.
  - Adding a `*:FOO` pattern to affect all categories, which makes the
    default threshold useless and practically leaks all the old
    patterns.

In my opinion this also makes it fit better into the layers of threshold
config, which is:

1. Temporary:
  - `gst_debug_category_set_threshold`
  - `gst_debug_category_reset_threshold`
2. Patterns:
  - `gst_debug_set_threshold_for_name`
  - `gst_debug_unset_threshold_for_name`
  - `gst_debug_set_threshold_from_string`
  - `GST_DEBUG`
3. Default:
  - `gst_debug_set_default_threshold`

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/605>
2022-11-07 14:49:44 +00:00
Jan Alexander Steffens (heftig) b22093be3c rtmp2: Improve error messages
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/1403>
2022-11-07 12:31:08 +00:00
Jan Alexander Steffens (heftig) f2d7b98ea4 rtmp2/connection: Pass triggering GError in 'error' signal
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/1403>
2022-11-07 12:31:08 +00:00
Jan Alexander Steffens (heftig) 9952be2ab3 rtmp2/connection: Pass triggering GError to _emit_error
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/1403>
2022-11-07 12:31:08 +00:00
Jan Alexander Steffens (heftig) 39bab56a08 rtmp2/connection: Discern reasons for cancelling all commands
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/1403>
2022-11-07 12:31:08 +00:00
Jan Alexander Steffens (heftig) 297cdaa381 rtmp2/connection: Handle EOF like error
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/1403>
2022-11-07 12:31:08 +00:00
Jan Alexander Steffens (heftig) 031d52672b rtmp2/client: Make sure 'salt' is not NULL
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/1403>
2022-11-07 12:31:08 +00:00
Jan Alexander Steffens (heftig) dcada94046 rtmp2/client: Make sure 'reason' is not NULL
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/1403>
2022-11-07 12:31:07 +00:00
Jan Alexander Steffens (heftig) a13f234be3 rtmp2/client: Make sure 'desc' is not NULL
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/1403>
2022-11-07 12:31:07 +00:00
Jan Alexander Steffens (heftig) 2037f1ed0a rtmp2/client: Make sure 'code' is not NULL
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/1403>
2022-11-07 12:31:07 +00:00
Edward Hervey a100f36b69 webrtcbin: Don't duplicate enum string values
Some were leaked when debugging was enabled. Instead just directly use the
static strings as-is.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/3347>
2022-11-07 11:21:00 +00:00
Edward Hervey 605cb6a4d4 gstpad: Avoid race in (un)setting EOS flag on sinkpads
The scenario is the following:

* Thread 1 is pushing an EOS event on a sinkpad
* Thread 2 is pushing a STREAM_START event on the same sinkpad before Thread 1
returns. Note : It starts pushing the event after Thread 1 took the object lock.

There is a potential race between:

* The moment Thread 1 sets the EOS flag once it has finished sending the
event (via store_sticky_event). When it does that it has both the STREAM and
OBJECT lock

* The moment Thread 2 sends the STREAM_START event (Which should release that
EOS status), but removing the EOS flag is only done while holding the OBJECT
lock and not the STREAM_LOCK, which means it could be re-set by Thread 1 before
it then checks again the EOS flag (without the STREAM lock taken).

The EOS flag unsetting by STREAM_START should be done with the STREAM lock
taken, otherwise it will be racy.

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

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/3320>
2022-11-07 06:28:39 +01:00
Nicolas Dufresne e81e212610 videocodectestsink: Add YUV422 support
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/3331>
2022-11-07 00:40:25 +00:00
Tim-Philipp Müller 62f8d292a1 gst-inspect: print doc urls for Rust plugins
We have documentation for them now after all.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/3346>
2022-11-06 18:10:44 +00:00
Justin Chadwell fd96fc23c5 qtdemux: use unsigned int types to store result of QT_UINT32
In a few cases throughout qtdemux, the results of QT_UINT32 were being
stored in a signed integer, which could cause subtle bugs in the case of
an integer overflow, even allowing the the result to equal a negative
number!

This patch prevents this by simply storing the results of this function
call properly in an unsigned integer type. Additionally, we fix up the
length checking with stsd parsing to prevent cases of child atoms
exceeding their parent atom sizes.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/3344>
2022-11-06 12:00:31 +00:00
Seungha Yang 0405e0cfc7 d3d11videosink: Always clear back buffer on resize
Swapchain may not need to be resized if the size of backbuffer
is equal to the previous size. Then previously rendered frame will be stay
on the screen. Do clear back buffer whenever resize() is called

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/3341>
2022-11-05 17:23:24 +00:00
Edward Hervey 24a0e5bdfd subparse: Fix non-closed tag handling.
Unclear what the goal was, but we could end up reading way past the next_tag.

Instead just move everything from after the end tag ('>') to the next_tag.

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

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/3340>
2022-11-05 16:19:53 +00:00
Nicolas Dufresne e283c99358 avutils: Add missing space in doc
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/3330>
2022-11-05 15:12:08 +00:00
Nicolas Dufresne 7b70de580c avviddec: Initialize std_compliance to default
This was missed in the initial patch.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/3330>
2022-11-05 15:12:08 +00:00
Seungha Yang e1e9ee5506 qsv: Fix encoding error when input memory belongs to other GPU
Copy frame if VA display of input buffer is different from that
of encoder, like we've been doing on Windows

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/3335>
2022-11-05 13:59:45 +00:00
Tim-Philipp Müller 04581fad6a identity: fix "handoff" signal docs
The docs list an extra pad argument, which doesn't
match the actual signal function signature. Probably
a copy'n'paste mistake when copying things from fakesink.

Fixes #1546

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/3337>
2022-11-05 11:58:34 +00:00
He Junyan 1881d1826a va: baseenc: Do not import the VA surface from other display.
Fixes: https://gitlab.freedesktop.org/gstreamer/gstreamer/-/issues/1167
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/3322>
2022-11-05 13:39:34 +08:00
He Junyan d51b29b1dc va: compositor: Do not use allocator and pool from other display.
Just like the va decoder, the compositor should not use allocator
and pool from other display. Also, when importing the input buffer,
if it is from other display, we should fallback to memory copy.

Fixes: https://gitlab.freedesktop.org/gstreamer/gstreamer/-/issues/1167
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/3322>
2022-11-05 13:39:34 +08:00
He Junyan b9b211c1d1 va: basetransform: Do not use allocator and pool from other display.
Just like the va decoder, the vpp and deinterlace should not use allocator
and pool from other display. Also, when importing the input buffer, if it
is from other display, we should fallback to memory copy.

Fixes: https://gitlab.freedesktop.org/gstreamer/gstreamer/-/issues/1167
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/3322>
2022-11-05 13:39:34 +08:00
He Junyan a8330686cb va: basedec: Do not use allocator and pool from other display.
The command line such as:
  gst-launch-1.0 -vf filesrc location=1.264 ! h264parse !
  vah264dec ! varenderD129postproc ! fakesink
The decoder here gets the allocation proposal from the vpp which is
on another GPU device. The allocator and pool belong to other display
and should not be used in the decoder.

Fixes: https://gitlab.freedesktop.org/gstreamer/gstreamer/-/issues/1167
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/3322>
2022-11-05 13:39:34 +08:00
He Junyan 3875c420f7 libs: va: Add API to peek the va buffer's display.
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/3322>
2022-11-05 13:39:34 +08:00
He Junyan 464650a5d0 libs: va: Add API to peek the va memory's display.
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/3322>
2022-11-05 13:39:34 +08:00
He Junyan b1a98433f8 libs: va: Add API to peek the allocator's display.
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/3322>
2022-11-05 13:39:34 +08:00
He Junyan 028920cfc4 libs: va: Fix code style in gstvaallocator.h
Replace all tabs with spaces.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/3322>
2022-11-05 13:39:34 +08:00
Seungha Yang 4db4f08227 d3dvideosink: Update plugin description
Direct3D is too generic (there are various version numbers).
Clarify that this element is using the Direct3D9 API

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/3333>
2022-11-04 22:48:41 +00:00
Tim-Philipp Müller edc2e8312e qt: initialize GError properly in gst_qt_get_gl_wrapcontext()
Spotted by Claus Stovgaard.

Fixes #1545

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/3327>
2022-11-04 20:39:16 +00:00
Sebastian Dröge b368a5fcd2 qtmux: Add durations to raw audio buffers from the raw audio adapter in prefill mode
This ensures that a duration can also be calculated and stored for the
last buffer at EOS.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/3321>
2022-11-04 19:02:22 +00:00
Sebastian Dröge 7b60e48c8c qtmux: Release object lock before posting an error message
GST_ELEMENT_ERROR() also takes the object lock and this would then
deadlock.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/3321>
2022-11-04 19:02:22 +00:00
Edward Hervey 73762156f3 gst-validate-1.0: Don't leak arguments and context
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/3319>
2022-11-04 17:59:22 +00:00
Edward Hervey 3beec9bad3 validate-scenario: Don't leak temporary path value
It's only use in the structure iterator

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/3319>
2022-11-04 17:59:22 +00:00
Edward Hervey 2114490b9b validate-scenario: Don't leak temporary local variables structures
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/3319>
2022-11-04 17:59:21 +00:00
Edward Hervey f4d0537b3e lv2: Don't leak plugin information on registration
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/3319>
2022-11-04 17:59:21 +00:00
Edward Hervey 685a4aaaa7 ladspa: Don't leak plugin information on registration
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/3319>
2022-11-04 17:59:21 +00:00
Edward Hervey 8ca2a2a230 fdkaacenc: Properly terminate GEnumValue table
It should be terminated with a NULL entry, otherwise we just stray into the
realms of cryptographic libraries^W^W random memory usage.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/3319>
2022-11-04 17:59:21 +00:00
Edward Hervey 0213536f77 libav: avcfg: Avoid brittle comparision
Subtracting a gint from another (or a guint from another) has no guarantees that
it will result in a gint.

Therefore do the actual comparision instead.

Also use the *actual* type for comparing flags (the field value types are different)

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/3319>
2022-11-04 17:59:21 +00:00
Edward Hervey cadc067bde libav: avcfg: Don't leak duplicate enumvalue entries
If we discard the duplicates, we also need to free the allocated strings.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/3319>
2022-11-04 17:59:21 +00:00
Edward Hervey 97bfb8b6cb imagesequencesrc; Fix leaks
* The path was leaked
* The custom buffer was never freed

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/3319>
2022-11-04 17:59:21 +00:00
Edward Hervey 6ffae88a9f qtdemux: Fix cenc-related leaks
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/3319>
2022-11-04 17:59:21 +00:00
Edward Hervey aa61662632 deinterlace: Don't leak metas
There is no correlation between the frame being NULL and the metas not being
present.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/3319>
2022-11-04 17:59:21 +00:00
Edward Hervey 094d27585e validate: plug some leaks
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/3319>
2022-11-04 17:59:21 +00:00
Edward Hervey 7f86e925e2 adaptivedemux2: Fix collection leaks
* The collection on the period was never unreffed
* The collection in the message handler was never unreffed

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/3319>
2022-11-04 17:59:21 +00:00
Edward Hervey 93d8b3f660 parsebin: Fix leak
Release the reference on the collection which was given to us when extracting it
from the event/message.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/3319>
2022-11-04 17:59:21 +00:00
Jan Schmidt b2f2a9125c mssdemux2: Update for adaptivedemux2 refactoring
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/3314>
2022-11-05 04:00:31 +11:00
Jan Schmidt 565f47b4f3 adaptivedemux2: Move stream_seek() to the Stream class
Move the last stream specific vfunc from the demux
class to the stream class.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/3314>
2022-11-05 04:00:31 +11:00
Jan Schmidt 2fe641353d adaptivedemux2: Refactor stream methods into the stream
Unlike the legacy elements, GstAdaptiveDemuxStream is a GObject now,
so a bunch of things that were actually stream methods on the
parent demux object can directly become stream methods now.

Move the stream class out to a header of its own.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/3314>
2022-11-05 04:00:31 +11:00
Jan Schmidt 9f89b8e3ef hlsdemux2/m3u8: Implement EXT-X-GAP parsing
Read the EXT-X-GAP tag and set is_gap on the segment.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/3314>
2022-11-05 03:24:27 +11:00
Jan Schmidt 55db033570 hlsdemux2/m3u8: Refactor parsing for readability
Small readability improvements in the parsing code

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/3314>
2022-11-05 03:24:27 +11:00
Jan Schmidt bfeb3c5625 adaptivedemux2/downloadhelper: Remove return val for download_request_add_buffer()
The function can't actually fail, and the only caller
was ignoring the result anyway, so remove the return value.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/3314>
2022-11-05 03:24:27 +11:00
Jan Schmidt 0f8c38c190 adaptivedemux2/downloadhelper: Add debug output of response headers
Dump the HTTP response headers at TRACE level

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/3314>
2022-11-05 03:24:27 +11:00
Jan Schmidt d1ae35f08a adaptivedemux2/downloadhelper: Don't mark transfer as complete/error if cancelled.
If the state of the download request was reset to UNSENT,
it was cancelled. Don't update the state to COMPLETE or ERRORED
in on_read_ready().

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/3314>
2022-11-05 03:24:26 +11:00
Jan Schmidt 46517d5aca adaptivedemux2/downloadhelper: Ignore spurious read failure
Sometimes g_input_stream_read_all_finish() can return
0 bytes, but still succeed (return TRUE) and have more
data available later. Only finish the transfer
if it returns 0 bytes *and* FALSE with no error.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/3314>
2022-11-05 03:24:26 +11:00
Jan Schmidt 1751f555f2 adaptivedemux2/downloadhelper: Fix function name
Fix a typo in the name of function download_request_despatch_progress()

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/3314>
2022-11-05 03:24:26 +11:00
Jan Schmidt c9de81edd4 adaptivedemux2: Remove scheduler_lock mutex
Remove the old unused scheduler_lock

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/3314>
2022-11-05 03:24:26 +11:00
Jan Schmidt b691aece65 adaptivedemux2: Hold tracks lock accessing input_period
The input_period is protected by the TRACKS_LOCK,
so make sure to hold that when accessing it.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/3314>
2022-11-05 03:24:26 +11:00
Jan Schmidt 93f80bb061 adaptivedemux2: Add state checks and clean up obsolete variables
The cancelled flag was only set in the stream finalize()
method, after all activity on the stream has stopped anyway.
Replace uses of cancelled with checks on the stream state.

Remove the replaced flag, which was checked but never set
to TRUE anywhere any more.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/3314>
2022-11-05 03:24:26 +11:00
Edward Hervey 730ed3a69a gstpad: Fix non-serialized sticky event push
With non-serialized sticky events, such as GST_EVENT_INSTANT_RATE, we both want
to store the event (for later re-linking) *AND* push the event in a non-blocking
way.

We therefore must *not* propagate pending sticky events if the event is "sticky
or serialized" but only if it's "serialized"

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/3254>
2022-11-04 14:20:36 +00:00
Jan Alexander Steffens (heftig) 424b331afc srt: Remove callers for which srt_bstats fails
This keeps them from accumulating in the element and in the stats while
the sink is not being fed, as long as we at least periodically grab
stats.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/3156>
2022-11-04 13:07:34 +00:00
Jan Alexander Steffens (heftig) d575a41145 srt: Use simpler list operations for callers
Avoid `g_list_append` and `g_list_remove` (which have to scan the list)
and replace them with `g_list_prepend` and `g_list_delete_link`.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/3156>
2022-11-04 13:07:34 +00:00
Jan Alexander Steffens (heftig) 3c23c16f40 srt: Clean up poll/sock lifecycle
Make sure `srtobject->poll_id` is never invalid as long as `srtobject`
exists. Only remove our caller socket from it when the socket becomes
invalid.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/3156>
2022-11-04 13:07:34 +00:00
Jan Alexander Steffens (heftig) 4e05100e8c srt: Clean up error handling
- Make the srt_epoll_wait loops more uniform.

- Error only via GError when possible; let the element send the error
  message. Avoids a second error message.

- Return 0 when cancelled. Avoids an error message from the element.

- Don't send an error message from send_headers when we're a server
  sink.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/3156>
2022-11-04 13:07:34 +00:00
Jan Alexander Steffens (heftig) a3cc5cf257 srt: Simplify socket stats
Don't hide stats depending on whether we're a sending or receiving
socket. While we're here, add some more debug logs.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/3156>
2022-11-04 13:07:34 +00:00
Jan Alexander Steffens (heftig) b6974b6afc srt: Replace stats accumulation with naive byte counting
srt_bstats cannot be used to get the stats of closed connections, so the
best we can do is keep the running count ourselves.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/3156>
2022-11-04 13:07:34 +00:00
Seungha Yang bfed80a82c directshow: Validate enumerated AM_MEDIA_TYPE struct
The video info struct can be null if format is undefined

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/3323>
2022-11-04 10:01:39 +00:00
Seungha Yang 786b7699d1 vpx: Complete high bitdepth vp9 en/decoding support
Adding 12bits variant formats to en/decoder, and high bitdepth
4:4:4 (except for GBR) encoding support

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/3298>
2022-11-04 05:37:58 +09:00
Seungha Yang 1ce38adfe3 vpx: Define formats for compatibility
ifdef for enum values never work. Instead, define new enum type
and use it

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/3298>
2022-11-04 05:14:23 +09:00
Seungha Yang 6d46a9c3c7 examples: d3d11: Fix GCC build error/warning
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/3318>
2022-11-04 02:17:22 +09:00
Seungha Yang f7cc753274 qsvjpegenc: Add support for YUY2 format
Now GstD3D11 defines YUY2 format

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/3316>
2022-11-03 06:40:10 +09:00
Seungha Yang 1853dd56a4 qsv: Add JPEG decoder
Because DXVA does not define JPEG decoding, we need this
vendor specific API for Windows

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/3316>
2022-11-03 06:40:10 +09:00
Seungha Yang 3f94df9487 d3d11: Add support for YUY2 format
YUY2 is a primary YUV 4:2:2 format for DXVA.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/3316>
2022-11-03 06:40:09 +09:00
Nicolas Dufresne 5fe360dec4 doc: avviddec: Update plugin cache
This is to add std-compliance property and GstFFMpegVidDec base class.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/3311>
2022-11-02 19:23:14 +00:00
Nicolas Dufresne 99ec53073a avviddec: Introduce a class for shared properties
Without a parent class,the documentation would need to be duplicated for
every CODECs. This patch adds an abstract class in between GstVideoDecoder
and the element.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/3311>
2022-11-02 19:23:14 +00:00
Seungha Yang af05abdb79 avviddec: Expose std-compliance option
Default compliance mode (i.e., FF_COMPLIANCE_NORMAL) might not
strictly follow specification. This property will allow user
to specifiy expected compliance mode.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/3311>
2022-11-02 19:23:14 +00:00
Michael Gruner 2cdfa8f419 parse: do delayed set only if the target child was not found and fail otherwise
When using the child proxy notation (child::property=value) it may
happen that the target child does not exist at the time of parsing
(i.e: decodebin creates the encoder according to the contents of the
stream). On this cases, we want to delay the setting of the property
to later, when new elements are added. Previous logic performed a
delayed set even if the target child was found but the property
was not found in it. This should be treated as a failure because,
unlike missing elements, properties should not appear dynamically.
By not failing, typos in property names may go unnoticed to the end
user.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/2908>
2022-11-02 13:21:09 +00:00
Michael Gruner ded2fed3b9 childproxy: Implement a new ::get_child_by_name_recurse() API
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/2908>
2022-11-02 13:21:09 +00:00
Tong Wu 60f7467dfe msdkcontext: use gst_object_unref instead of g_object_unref
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/3301>
2022-11-02 07:40:59 +00:00
Tong Wu bae66c8ae0 msdkcontext: use gst_object_ref for GstVaDisplay
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/3301>
2022-11-02 07:40:59 +00:00
Tong Wu c9cc92a20a msdkcontext: g_object_new() must not return nullptr
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/3301>
2022-11-02 07:40:59 +00:00
Tong Wu 7b03da634b msdkenc: use GST_CAPS_FEATURE_MEMORY_VA to check the feature
Add macros to protect sinkpad_is_va(), since it is not defined on
Windows.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/3301>
2022-11-02 07:40:59 +00:00
Guillaume Desmottes a92f41e0c7 wpe: fix wpevideosrc gst-play example
wpe:// no longer works since 1.20, see wpesrc examples.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/3306>
2022-11-02 00:21:21 +00:00
Eric Knapp 87e9952b8f vah264enc: Added option to insert CEA-708 closed captions
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/2910>
2022-11-01 23:22:03 +00:00
Seungha Yang be1771126d qsv: Check 16K resolution support
... and remove duplicated code

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/3310>
2022-11-01 17:23:52 +00:00