diff --git a/sys/nvcodec/gstnvdecoder.c b/sys/nvcodec/gstnvdecoder.c index 4a2c9091b3..ba18b3db5b 100644 --- a/sys/nvcodec/gstnvdecoder.c +++ b/sys/nvcodec/gstnvdecoder.c @@ -50,6 +50,7 @@ #include #endif +#include "gstcudamemory.h" #include "gstnvdecoder.h" #include @@ -915,15 +916,23 @@ gst_nv_decoder_check_device_caps (CUcontext cuda_ctx, cudaVideoCodec codec, src_templ = gst_caps_from_string (GST_VIDEO_CAPS_MAKE ("NV12")); -#if HAVE_NVCODEC_GST_GL { - GstCaps *gl_caps = gst_caps_copy (src_templ); - gst_caps_set_features_simple (gl_caps, - gst_caps_features_from_string (GST_CAPS_FEATURE_MEMORY_GL_MEMORY)); - gst_caps_append (src_templ, gl_caps); - } + GstCaps *cuda_caps = gst_caps_copy (src_templ); + gst_caps_set_features_simple (cuda_caps, + gst_caps_features_from_string (GST_CAPS_FEATURE_MEMORY_CUDA_MEMORY)); + +#if HAVE_NVCODEC_GST_GL + { + GstCaps *gl_caps = gst_caps_copy (src_templ); + gst_caps_set_features_simple (gl_caps, + gst_caps_features_from_string (GST_CAPS_FEATURE_MEMORY_GL_MEMORY)); + gst_caps_append (src_templ, gl_caps); + } #endif + gst_caps_append (src_templ, cuda_caps); + } + sink_templ = gst_caps_from_string (codec_map->sink_caps_string); *src_template = src_templ; @@ -1042,16 +1051,24 @@ gst_nv_decoder_check_device_caps (CUcontext cuda_ctx, cudaVideoCodec codec, gst_caps_set_value (src_templ, "format", &format_list); - /* OpenGL specific */ -#if HAVE_NVCODEC_GST_GL { - GstCaps *gl_caps = gst_caps_copy (src_templ); - gst_caps_set_features_simple (gl_caps, - gst_caps_features_from_string (GST_CAPS_FEATURE_MEMORY_GL_MEMORY)); - gst_caps_append (src_templ, gl_caps); - } + GstCaps *cuda_caps = gst_caps_copy (src_templ); + gst_caps_set_features_simple (cuda_caps, + gst_caps_features_from_string (GST_CAPS_FEATURE_MEMORY_CUDA_MEMORY)); + + /* OpenGL specific */ +#if HAVE_NVCODEC_GST_GL + { + GstCaps *gl_caps = gst_caps_copy (src_templ); + gst_caps_set_features_simple (gl_caps, + gst_caps_features_from_string (GST_CAPS_FEATURE_MEMORY_GL_MEMORY)); + gst_caps_append (src_templ, gl_caps); + } #endif + gst_caps_append (src_templ, cuda_caps); + } + sink_templ = gst_caps_from_string (codec_map->sink_caps_string); gst_caps_set_simple (sink_templ, "width", GST_TYPE_INT_RANGE, min_width, max_width,