Commit graph

783 commits

Author SHA1 Message Date
Alessandro Bono fcd983440e 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/3933>
2023-02-10 14:35:20 +00:00
Ma, Mingyang 99cdc3a965 msdkenc: Let runtime decide parameters
Some parameters can be determined by runtime instead of default values. So unset the default and let runtime choose the best parameters

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/3660>
2023-02-06 02:24:54 +00:00
Tim-Philipp Müller 85476eab08 kms: drop use of GSlice allocator and remove unnecessary check
g_new0() will never return NULL but just abort if it can't
allocate memory (same for g_slice_new).

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/3784>
2023-02-03 17:48:10 +00:00
Tim-Philipp Müller 35405de344 shm: drop use of GSlice allocator
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/3784>
2023-02-03 17:48:10 +00:00
Seungha Yang 10ade466ef nvenc: Use CUDA stream of memory if exists
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/3629>
2023-02-03 15:27:43 +00:00
Seungha Yang 7a8bb85523 cudaupload, cudadownload: Update for shared CUDA stream
Use CUDA stream of memory if exists

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/3629>
2023-02-03 15:27:43 +00:00
Seungha Yang aabcba16db nvdecoder: Skip synchronization if downstream buffer holds CUDA stream
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/3629>
2023-02-03 15:27:42 +00:00
Seungha Yang ddc5f1d425 cudaconvertscale: Add support for shared CUDA stream
If CUDA stream is shared by upstream/downstream, don't sync at
convert element

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/3629>
2023-02-03 15:27:42 +00:00
Seungha Yang 1cb47d549b cudaconverter: Don't sync per conversion
Caller should take care of synchronization

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/3629>
2023-02-03 15:27:42 +00:00
Seungha Yang 8d14194fdd nvencoder: Add support for shared CUDA stream
Sets CUDA stream on CUDA buffer pool so that CUDA stream object
can be shared

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/3629>
2023-02-03 15:27:42 +00:00
Seungha Yang 0a81c8deb3 nvcodec: Port to GstCudaStream
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/3629>
2023-02-03 15:27:42 +00:00
Seungha Yang 661b5f60c6 cuda: Provide single header include entry point
Add "gstcuda.h" header file

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/3629>
2023-02-03 15:27:42 +00:00
Seungha Yang bc0708eafb 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/3888>
2023-02-03 22:19:22 +09:00
Piotr Brzeziński ae200a4d62 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/3222>
2023-02-02 06:18:02 +00:00
He Junyan 60731adea6 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/3749>
2023-02-02 00:41:42 +00:00
Seungha Yang 29bd8de052 nvvp9dec: Fix return value
It should return GstFlowReturn value, not boolean

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/3870>
2023-02-02 05:07:44 +09:00
Mengkejiergeli Ba dfe16a5cf2 msdkallocator: Use const ptr of videoinfo in func param
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/3621>
2023-02-01 04:31:23 +00:00
Seungha Yang c6a6c56cdf win32ipc: Add support for zero-copy rendering
* Extend protocol so that client can notify of releasing shared memory
* Server will hold shared memory object until it's released by client
* Add allocator/buffer pool to reuse shared memory objects and buffers

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/3765>
2023-01-27 18:55:13 +00:00
Seungha Yang 983d78daa5 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/3782>
2023-01-26 13:31:20 +00:00
Nirbheek Chauhan eff9455ada 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/3776>
2023-01-25 10:08:10 +00:00
Nirbheek Chauhan 43ae6b421b 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/3776>
2023-01-25 10:08:10 +00:00
Seungha Yang 2e574a80d9 d3d11: Don't use g_alloca()
_alloca CRT function is deprecated. Moreover, stack allocation
for string is not a good idea. We can use _malloca inline
function instead, but all use of _alloca in d3d11 library/plugin
are not performance critical path at all.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/3652>
2023-01-24 20:27:43 +00:00
Seungha Yang 467a2408a1 d3d11compositor: Workaround blending artifacts on Intel platform
Disable vendor implemented converter in d3d11compositor to workaround
artifacts

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/3770>
2023-01-23 23:34:04 +09:00
Seungha Yang f983ec50b5 win32ipcvideosrc: Fix leak in fallback copy path
Clear shared memory after use

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/3751>
2023-01-19 17:40:59 +00:00
Edward Hervey b01ed725be va: Fix path leak
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/3755>
2023-01-19 16:41:44 +01:00
Rodrigo Bernardes 28f7a0ed2e dvbbasebin: don't rely on g_key_file_get_(integer|uint64) return
instead check if an error was returned, and fail if any

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/3688>
2023-01-05 12:51:28 +00:00
Seungha Yang aba7f7c7eb vajpegdec: Set maybe-leaked flag on template caps
The fixup function could return new caps object

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/3642>
2022-12-27 17:15:20 +00:00
Seungha Yang 040473f295 nvcudaenc: Don't use default CUDA stream
Set non-default CUDA stream via NvEncSetIOCudaStreams() if possible,
so that NVENC's internal kernel function can run on the given CUDA
stream instead of default CUDA stream

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/3615>
2022-12-22 15:01:52 +00:00
Evgeny Pavlov 9598ec6d95 amfcodec: add support of AMF AV1 encoder
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/3569>
2022-12-21 19:23:24 +00:00
Seungha Yang 15b2cd6565 cudabasetransform: Update CUDA stream on context update
CUDA stream must be associated with updated CUDA context

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/3618>
2022-12-21 16:18:36 +00:00
He Junyan ad0ba3ab7d va: Delay the VAProcPipelineCaps query after context created.
The VAAPI vaQueryVideoProcPipelineCaps() requires the context as the
parameter. So far, we always pass VA_INVALID_ID and it can succeed.
But the API does not say that and in theory, a valid context is required.
Now the new platform really needs a valid context and so we have to
delay that query until the context is created.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/3613>
2022-12-21 14:31:23 +00:00
Seungha Yang 14062c06a6 nvdecoder: Use own CUDA stream in GL output path
Use the same CUDA stream passed to CuvidMapVideoFrame()

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/3611>
2022-12-20 17:14:10 +00:00
Seungha Yang 9914ff9b4c nvdec: Don't use default CUDA stream
NVDEC launches CUDA kernel function (ConvertNV12BLtoNV12 or so)
when CuvidMapVideoFrame() is called. Which seems to be
NVDEC's internal post-processing kernel function, maybe
to convert tiled YUV to linear YUV format or something similar.

A problem if we don't pass CUDA stream to the CuvidMapVideoFrame()
call is that the NVDEC's internel kernel function will use default CUDA stream.
Then lots of the other CUDA API calls will be blocked/serialized.

To avoid the unnecessary blocking, we should pass our own
CUDA stream object to the CuvidMapVideoFrame() call

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/3605>
2022-12-19 20:27:35 +00:00
Seungha Yang 7c92ed0bd0 d3d11videosink: Fixing focus lost on desktop layout change
Watch all message on the window thread, instead of internal window only.
Otherwise, some global window messages, such as desktop layout change,
wouldn't be handled by our window.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/3593>
2022-12-17 11:17:28 +00:00
Nirbheek Chauhan b3806da265 avfvideosrc: Report latency when doing screen capture
There is no `device` when doing screen capture, but there is always an
`input`, so use that to decide when we can reply to a latency query.
Without this, the latency query just fails.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/3589>
2022-12-16 23:58:07 +00:00
Victor Manuel Jaquez Leal 171a626c6c vaav1dec: Remove double caps unref.
There was a duplicated caps unref raising a warning.

Also it reorgs the sorrounding code for simplicity.

Fixes: #1196
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/3587>
2022-12-16 19:18:25 +00:00
Seungha Yang 068a5c1053 d3d11videosink: Move potentially time-consuming operations to ::prepare()
Move following tasks to ::prepare() from ::show_frame()
* CPU -> GPU upload
* GstD3D11Window object setup, including input caps change handling

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/3574>
2022-12-17 02:11:07 +09:00
Seungha Yang 04451b108a d3d11videosink: Call ShowWindow() from window thread
... when rendering on external HWND. ShowWindow() will cause
synchronous message passing to window thread and then can be blocked.
At the same time, window thread can wait for GStreamer thread.
Instead of the synchronous call, queue the task to window message
and performs from the window thread.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/3583>
2022-12-16 22:18:14 +09:00
Seungha Yang a27c5c81df d3d11videosink: Fix deadlock when parent window is busy
Deadlock sequence:
* From a streaming thread, d3d11videosink sends synchronous message
  to the parent window, so that internal (child) window can be
  constructed on the parent window's thread
* App thread (parent window thread) is waiting for pipeline's
  state change (to GST_STATE_NULL) but streaming thread is
  blocked and waiting for app thread

To avoid the deadlock, GstD3D11WindowWin32 should send message
to the parent window asynchronously.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/3570>
2022-12-15 17:37:48 +00:00
Brad Hards 29dd254f7a h264parser: typo fix in enum value
Old value is marked deprecated, new enum with same entry is added. Should be binary compatible.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/1318>
2022-12-12 21:43:14 +00:00
Seungha Yang e6585c89ea cuda: Hide memory copy util function
The method was intended to be used by only cudaupload/download elements
and not ready to be a part of public API

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/3545>
2022-12-08 19:52:23 +00:00
Seungha Yang f588932547 ksvideosrc: Warn for deprecated plugin use
This plugin should not be used any more

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/3544>
2022-12-08 17:48:11 +00:00
Seungha Yang 1e124682c8 winscreencap: Warn for deprecated plugin use
This plugin should not be used any more

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/3544>
2022-12-08 17:48:11 +00:00
Nirbheek Chauhan d4f8067064 directshow: Fix build error with glib 2.75 and newer
Starting with glib 2.75, `NULL` is `nullptr`, which cannot be
implicitly coerced to `0`, unlike `NULL`. So explicitly pass `0`.

```
[3206/4524] Compiling C++ object subprojects/gst-plugins-bad/sys/directshow/gstdirectshow.dll.p/dshowvideosink.cpp.obj
FAILED: subprojects/gst-plugins-bad/sys/directshow/gstdirectshow.dll.p/dshowvideosink.cpp.obj
"cl" "-Isubprojects\gst-plugins-bad\sys\directshow\gstdirectshow.dll.p" "-Isubprojects\gst-plugins-bad\sys\directshow" "-I..\subprojects\gst-plugins-bad\sys\directshow" "-Isubprojects\gst-plugins-bad" "-I..\subprojects\gst-plugins-bad" "-Isubprojects\gst-plugins-base\gst-libs" "-I..\subprojects\gst-plugins-base\gst-libs" "-Isubprojects\gstreamer\libs" "-I..\subprojects\gstreamer\libs" "-Isubprojects\gstreamer" "-I..\subprojects\gstreamer" "-Isubprojects\orc" "-I..\subprojects\orc" "-I..\subprojects\gst-plugins-bad\sys\directshow\strmbase\baseclasses" "-Isubprojects\gst-plugins-base\gst-libs\gst\video" "-Isubprojects\gstreamer\gst" "-Isubprojects\gst-plugins-base\gst-libs\gst\audio" "-Isubprojects\gst-plugins-base\gst-libs\gst\tag" "-IC:/gst-install/include/glib-2.0" "-IC:/gst-install/lib/glib-2.0/include" "-IC:/gst-install/include" "/MD" "/nologo" "/showIncludes" "/utf-8" "/W2" "/EHsc" "/O2" "/Zi" "/wd4018" "/wd4146" "/wd4244" "/wd4305" "/utf-8" "/we4002" "/we4003" "/we4013" "/we4020" "/we4027" "/we4029" "/we4033" "/we4045" "/we4047" "/we4053" "/we4062" "/we4098" "/we4101" "/we4189" "/utf-8" "-D_MBCS" "/wd4189" "/wd4456" "/wd4701" "/wd4703" "/wd4706" "/wd4996" "-DHAVE_CONFIG_H" "/Fdsubprojects\gst-plugins-bad\sys\directshow\gstdirectshow.dll.p\dshowvideosink.cpp.pdb" /Fosubprojects/gst-plugins-bad/sys/directshow/gstdirectshow.dll.p/dshowvideosink.cpp.obj "/c" ../subprojects/gst-plugins-bad/sys/directshow/dshowvideosink.cpp
../subprojects/gst-plugins-bad/sys/directshow/dshowvideosink.cpp(62): warning C5051: attribute 'noinline' requires at least '/std:c++20'; ignored
../subprojects/gst-plugins-bad/sys/directshow/dshowvideosink.cpp(123): error C2664: 'LRESULT SendMessageA(HWND,UINT,WPARAM,LPARAM)': cannot convert argument 3 from 'nullptr' to 'WPARAM'
../subprojects/gst-plugins-bad/sys/directshow/dshowvideosink.cpp(123): note: A native nullptr can only be converted to bool or, using reinterpret_cast, to an integral type
C:\Program Files (x86)\Windows Kits\10\include\10.0.19041.0\um\winuser.h(3690): note: see declaration of 'SendMessageA'
../subprojects/gst-plugins-bad/sys/directshow/dshowvideosink.cpp(635): error C2664: 'BOOL SystemParametersInfoA(UINT,UINT,PVOID,UINT)': cannot convert argument 2 from 'nullptr' to 'UINT'
../subprojects/gst-plugins-bad/sys/directshow/dshowvideosink.cpp(635): note: A native nullptr can only be converted to bool or, using reinterpret_cast, to an integral type
C:\Program Files (x86)\Windows Kits\10\include\10.0.19041.0\um\winuser.h(13153): note: see declaration of 'SystemParametersInfoA'
../subprojects/gst-plugins-bad/sys/directshow/dshowvideosink.cpp(1593): error C2664: 'LRESULT SendMessageA(HWND,UINT,WPARAM,LPARAM)': cannot convert argument 3 from 'nullptr' to 'WPARAM'
../subprojects/gst-plugins-bad/sys/directshow/dshowvideosink.cpp(1593): note: A native nullptr can only be converted to bool or, using reinterpret_cast, to an integral type
C:\Program Files (x86)\Windows Kits\10\include\10.0.19041.0\um\winuser.h(3690): note: see declaration of 'SendMessageA'
```

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/3528>
2022-12-05 14:18:14 +00:00
Seungha Yang ac6b3e9a45 d3d11av1dec: Promote rank to primary + 1
... so that this element can have higher rank than the other software
AV1 decoders

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/3495>
2022-12-02 17:56:22 +00:00
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
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