cudaipcsink: Disable stream ordered allocation

Legacy CUDA IPC does not support default CUDA memory pool

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/7427>
This commit is contained in:
Seungha Yang 2024-08-29 20:24:56 +09:00 committed by GStreamer Marge Bot
parent b266aa5e65
commit f72a775d03

View file

@ -459,6 +459,9 @@ gst_cuda_ipc_sink_set_caps (GstBaseSink * sink, GstCaps * caps)
if (priv->configured_ipc_mode == GST_CUDA_IPC_MMAP) {
gst_buffer_pool_config_set_cuda_alloc_method (config,
GST_CUDA_MEMORY_ALLOC_MMAP);
} else {
/* legacy CUDA ipc requires default cuda allocation */
gst_buffer_pool_config_set_cuda_stream_ordered_alloc (config, FALSE);
}
if (!gst_buffer_pool_set_config (priv->fallback_pool, config)) {
@ -514,6 +517,9 @@ gst_cuda_ipc_sink_propose_allocation (GstBaseSink * sink, GstQuery * query)
if (priv->configured_ipc_mode == GST_CUDA_IPC_MMAP) {
gst_buffer_pool_config_set_cuda_alloc_method (config,
GST_CUDA_MEMORY_ALLOC_MMAP);
} else {
/* legacy CUDA ipc requires default cuda allocation */
gst_buffer_pool_config_set_cuda_stream_ordered_alloc (config, FALSE);
}
size = GST_VIDEO_INFO_SIZE (&info);
@ -613,7 +619,10 @@ gst_cuda_ipc_sink_prepare (GstBaseSink * sink, GstBuffer * buf)
(priv->configured_ipc_mode == GST_CUDA_IPC_MMAP &&
alloc_method != GST_CUDA_MEMORY_ALLOC_MMAP) ||
(priv->configured_ipc_mode == GST_CUDA_IPC_LEGACY &&
alloc_method != GST_CUDA_MEMORY_ALLOC_MALLOC)) {
alloc_method != GST_CUDA_MEMORY_ALLOC_MALLOC) ||
(priv->configured_ipc_mode == GST_CUDA_IPC_LEGACY &&
alloc_method == GST_CUDA_MEMORY_ALLOC_MALLOC &&
gst_cuda_memory_is_stream_ordered (mem))) {
if (gst_buffer_pool_acquire_buffer (priv->fallback_pool, &cuda_buf,
nullptr) != GST_FLOW_OK) {
GST_ERROR_OBJECT (self, "Couldn't acquire fallback buffer");