Commit graph

811 commits

Author SHA1 Message Date
Seungha Yang
d016bf1bed d3d11convert: Fix for runtime property update
Every setup happens in set_caps() method but basetransform will not
call the set_caps() if in/out caps were not changed

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/4652>
2023-05-17 15:43:56 +00:00
Aleksandr Slobodeniuk
d0268db7e4 d3d11convert: protect 'add-borders' with mutex
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/4652>
2023-05-17 15:43:56 +00:00
Carlos Rafael Giani
c932134637 avdtputil: Use int instead of int range for fixed bitpool values
Fixes https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/issues/1698

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/4655>
2023-05-17 09:27:04 +00:00
Seungha Yang
81c1017e55 vavp8dec: Fix return type of decode_picture()
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/4614>
2023-05-12 10:49:21 +01:00
Seungha Yang
69e41e4b09 vajpegdec: Hide gst_jpeg_decoder_get_type() symbol
It's not a public symbol yet

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/4614>
2023-05-12 10:49:21 +01:00
Seungha Yang
9c08b2f53a vabaseenc: Fix return type of encode_frame vfunc
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/4614>
2023-05-12 10:49:21 +01:00
Seungha Yang
8508ce0bc0 va: Fix struct empty initialization syntax
"struct Foo bar; bar = {};" is not a valid syntax. Also remove use
of __typeof__ which is GCC specific

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/4614>
2023-05-12 10:49:21 +01:00
Seungha Yang
850c57bad7 d3d11videosink: Don't clear prepared buffer on unlock_stop()
That can be called between prepare() and render() which results in
unexpected error flow return

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/4596>
2023-05-11 01:29:37 +01:00
Seungha Yang
009fa58df1 mfvideoenc: Allow only even resolution numbers
Some H/W vendors support odd resolution if D3D11 texture is used
or via IMF2DBuffer, but not all vendors support it.
Also software MFT does not allow odd resolution.

Fixes: https://gitlab.freedesktop.org/gstreamer/gstreamer/-/issues/1165
Fixes: https://gitlab.freedesktop.org/gstreamer/gstreamer/-/issues/2537
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/4548>
2023-05-05 09:57:37 +01:00
Seungha Yang
b40bedb597 wasapi2: Allows process loopback capture on Windows 10
As per MS documentation[1], it requires Windows 10 Build 20348
but it seems to be supported by old versions too

[1] https://learn.microsoft.com/en-us/windows/win32/api/audioclientactivationparams/
ns-audioclientactivationparams-audioclient_process_loopback_params

Fixes: https://gitlab.freedesktop.org/gstreamer/gstreamer/-/issues/2524
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/4517>
2023-04-30 15:14:53 +00:00
Seungha Yang
a82e1fd5ad d3d11videosink: Fix for ignored initial render rectangle
Application can set target render rect before internal HWND
configuration

Fixes: https://gitlab.freedesktop.org/gstreamer/gstreamer/-/issues/2518
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/4496>
2023-04-27 10:18:58 +01:00
Seungha Yang
0d9f08ce9a d3d11compositor: Skip zero alpha input
Blending such input is a waste of resource since nothing will
be rendered

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/4456>
2023-04-21 17:27:49 +00:00
Seungha Yang
2c7a8739dd d3d11compositor: Reconfigure resource only when output caps is changed
GstD3D11Converter setup is heavy operation since it requires
shader compile, GPU resource allocation, some math, mutex, etc.
We can avoid it if negotiated caps is not changed.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/4440>
2023-04-17 19:34:17 +01:00
Aleksandr Slobodeniuk
936000f04e d3d11videosink: fix race conditions in win32 window
One race condition is the fact that the window object
can be destroyed while running some routine in the UI
thread (such as resizing). To avoid that situation we make
UI thread hold a reference on the window object while it's
running.
Other probpematic case is when the window handle is reused:
if we stop and start the pipeline very fast,
so the sink creates a new window object that is going to use
the same window handle as the previous one.
And finally the case when the pipeline is stopped immediatelly
right after starting, this one is also handled in this commit.

NOTE: a unit test that reproduces this cases have been added
in the previous commit.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/4417>
2023-04-14 02:09:07 +00:00
Seungha Yang
e972c43916 d3d11videosink: Enhancement for initial window size decision
Use AdjustWindowRect() method to calculate window size so that
video scene can be rendered on client area without black borders

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/4416>
2023-04-14 02:08:47 +01:00
Wang Chuan
08b4f38310 gstd3d11window: fix memory leak
GstStructure may leak when using external HWND

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/4382>
2023-04-10 15:33:44 +00:00
Seungha Yang
5f17cb9f3d decklinkaudiosink: Fix playback when video caps is configured before audio
Scheduled playback starts on videosink's state change or on caps
but it's possible that audiosink is configure without caps yet.
Try start scheduled playback on audiosink's caps event as well

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/4368>
2023-04-08 00:00:16 +01:00
Wojciech Kapsa
601b306aaa decklink: fix 10 bit RGB (r210) format auto detection
Fixes https://gitlab.freedesktop.org/gstreamer/gstreamer/-/issues/2391

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/4342>
2023-04-05 10:38:45 +00:00
Seungha Yang
df6a3d091f nvh264encoder: Fix template caps
It should include progressive as well

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/4253>
2023-03-24 14:00:23 +00:00
Adrien De Coninck
6e37f49f4a ksdeviceprovider: Fix leak in gst_dshow_device_provider_start
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/4227>
2023-03-20 13:10:55 +00:00
Adrien De Coninck
df679c145e dshowdeviceprovider: Fix leak in gst_dshow_device_provider_start
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/4227>
2023-03-20 13:10:55 +00:00
Sebastian Dröge
5ddc082710 plugins: Fix various trivial clang compiler warnings
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/4221>
2023-03-18 19:52:40 +00:00
Seungha Yang
d884c8f5a1 nvencoder: Fix CQP option setting
... and zero initialize LUID and CUDA device list to address
coverity issue

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/4217>
2023-03-18 05:14:47 +00:00
Seungha Yang
3401c4caa9 wasapi2: Fix potential crash on device activation failure
The activation object is live in COM thread already and therefore
self refcount hack is pointless.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/4207>
2023-03-18 02:01:30 +00:00
Seungha Yang
00bb3a171e d3d11videosink: Fix tearing in case of fullscreen mode
DXGI_SWAP_CHAIN_FLAG_ALLOW_TEARING and DXGI_PRESENT_ALLOW_TEARING should
be used only if required, when user wants Vsync off for example.

Fixes: https://gitlab.freedesktop.org/gstreamer/gstreamer/-/issues/2376
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/4188>
2023-03-16 15:33:37 +00:00
Seungha Yang
a81498c9de d3d11compositor: Fix composition error on release_pad()
Composition might be still in progress while it's being released

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/4186>
2023-03-16 09:25:55 +00:00
Piotr Brzeziński
2f534432d6 vtdec: Correctly retrieve reorder queue length from SPS
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/4110>
2023-03-03 20:39:29 +00:00
Jan Schmidt
5df656cee3 avfvideosrc: Fix description and trailing whitespace
Minor fix to mention that the element is also useful on MacOS,
and remove some trailing whitespace

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/4096>
2023-03-01 22:52:01 +00:00
Jan Schmidt
633cbbaddb avfvideosrc: Don't wait on main thread for permissions request
Recursively invoking the NSMainLoop can cause crashes in
applications that don't expect it. Instead of waiting for
permission to be granted, move the wait later - until we
actually need device permissions when starting the capture
session. That moves the wait into the streaming thread
instead of the application thread that's setting the pipeline
state to READY.

Instead of a manual state change implementation to open
and close the device, use the basesrc start/stop methods that
are intended for the purpose.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/4096>
2023-03-01 22:52:01 +00:00
Piotr Brzeziński
9a2462391b vtenc: Fix checking for certain CPU variants when running in VMs
These checks were introduced to prevent exposing ARGB64/RGBA64 in the caps
when running on M1 Pro/Max with macOS <13 because of a bug in VideoToolbox.
Unfortunately, the initial buffer size of 15 is too short when running
in a VM - the CPU brand string there looks like "Apple M1 Pro (Virtual)",
which due to its length causes sysctlbyname to return -1, resulting in
broken formats still showing up in the caps.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/4082>
2023-02-28 17:31:54 +00:00
Seungha Yang
359e5fd327 nvencoder: Fix b-frame encoding on Linux
On Windows, Win32 event handle is used to wait for encoded output,
but it's not available on Linux. We should delay bitstream locking
if encoder returns "need-more-input"

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/4008>
2023-02-25 16:33:53 +00:00
He Junyan
4c762b7717 jpegdecoder: fail early if no input caps have been provided
The jpegdecoder class does not implement the ->parse() virtual function,
and we always need to add the jpegparse element before it. So we should
set_needs_format of the decoder to TRUE, then if no parse before it, it
can fail with a "not-negotiated" error early, rather than go on and
generate unexpected error.

Fixes: https://gitlab.freedesktop.org/gstreamer/gstreamer/-/issues/1829
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/4066>
2023-02-25 10:54:49 +00:00
Célestin Marot
c34ac2a3e8 d3d11overlaycompositor: fix texture width and height
The dimension of the overlay texture directly corresponds to the size of the overlay **buffer** which is given by its video meta.
The dimension at which the overlay should be displayed directly correspond to the overlay `render_width`and `render_height`.

This match the behavior of glimagesink

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/4053>
2023-02-23 10:25:15 +00:00
Mengkejiergeli Ba
fbab40bd5e va: Fix some code defects
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/4007>
2023-02-22 00:19:45 +00:00
Seungha Yang
8ddf39f560 d3d11videosink: Fix rendering on external handle
Partial revert of the commit 068a5c1053.
That introduced size mismatch between internal and external HWND

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/4010>
2023-02-21 00:36:31 +00:00
Víctor Manuel Jáquez Leal
b3af05c193 vah265enc: Use helper to update properties.
This is a continuation of the original patch by
 Mengkejiergeli Ba <mengkejiergeli.ba@intel.com>

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/4009>
2023-02-20 23:41:44 +00:00
Yinhang Liu
e30b0e906a msdkav1enc: fix the category for msdkav1enc debug
The msdkav1enc debug initialized with gst_msdkav1dec_debug,
fix this.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/3991>
2023-02-18 11:48:08 +00:00
Seungha Yang
bf4f2a3325 amfav1enc: Set stream-format on caps
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/3961>
2023-02-15 11:14:12 +00:00
Seungha Yang
11ef5ce745 qsvav1enc: Set stream-format on caps
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/3961>
2023-02-15 11:14:12 +00:00
Piotr Brzeziński
ae213c1c59 vtenc/vtdec: Fix typo in RGBA64_LE availability define
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/3962>
2023-02-15 01:15:01 +00:00
Piotr Brzeziński
62e385ad35 vtenc: Disable ARGB/RGBA64 caps on M1 Pro/Max with macOS <13
Fixes #1358.
Passing ARGB64/RGBA64 to vtenc caused the encoding to fail
when running on M1 Pro/Max variants with macOS 12.x, so let's
remove these formats from caps when such scenario is detected.
This issue appears to have been fixed OS-side in macOS 13.0.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/3962>
2023-02-15 01:15:01 +00:00
Piotr Brzeziński
8fd9c82360 vtdec: Fix not waiting for async frames when flushing
This was causing incorrect output when seeking, especially
when used with a multithreaded source like `videotestsrc n-threads=2`.
It should now correctly wait for frames still being processed by VT
while vtdec is flushing.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/3937>
2023-02-10 20:29:15 +00:00
Alessandro Bono
b87371d0ce win32ipcutils: Add missing include
We are using std::isspace() with one parameter. That function is defined
in the cctype header.

```
win32ipcutils.cpp(34): error C2672: 'std::isspace': no matching overloaded function found
win32ipcutils.cpp(34): error C2780: 'bool std::isspace(_Elem,const std::locale &)': expects 2 arguments - 1 provided
```

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/3936>
2023-02-10 19:34:35 +00:00
Seungha Yang
04910ac6c1 nvencoder: Fix min buffers parameter of allocation query in auto GPU mode
At the time when propose_allocation() get called, encoder session
would not be initialized yet.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/3891>
2023-02-04 12:13:58 +01:00
He Junyan
1e34b35044 va: Avoid the array index overflow when filling 8x8 scaling list.
The VA API has not defined the scaling list entries for U/V planes
for the 4:4:4 stream. In fact, we do not meet the 4:4:4 format output
for H264 so far, and scaling list is not used frequently, so we just
print out some warning and ignore these scaling list values.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/3877>
2023-02-02 16:21:34 +00:00
Piotr Brzeziński
26978734fe vtenc: Disable HW acceleration for interlaced ProRes
Due to a bug in the VT API, attempting to encode interlaced content
with ProRes results in an error, halting the pipeline instead of
gracefully falling back to software encoding.
Should be removed in the future if Apple ever fixes this issue.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/3878>
2023-02-02 11:29:29 +00:00
Seungha Yang
ba91964a70 nvvp9dec: Fix return value
It should return GstFlowReturn value, not boolean

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/3874>
2023-02-02 02:07:04 +00:00
Seungha Yang
e62800f20c wasapi2src: Fix loopback capture on Windows 10 Anniversary Update
... or older. Work around an OS bug that loopback capture
device doesn't notify event.

Fixes: https://gitlab.freedesktop.org/gstreamer/gstreamer/-/issues/1738
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/3820>
2023-01-27 03:23:05 +00:00
Nirbheek Chauhan
1eae03486e nvcodec: Log readable errors when initializing CUDA
It is really difficult for people to figure out why nvcodec has
0 features. Even the debug log is cryptic. Also make sure the errors
go to the ERROR log level, which is more likely to be enabled by
default.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/3813>
2023-01-26 19:40:27 +00:00
Nirbheek Chauhan
5ab15e1738 nvcodec: Fix reporting of CuDeviceGetCount error
cuda_ret is was always going to be CUDA_SUCCESS in the error log.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/3813>
2023-01-26 19:40:27 +00:00