mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2024-12-24 17:20:36 +00:00
nvcodec: Add missing CUDAMemory src caps in h264 decoder
Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/merge_requests/1633>
This commit is contained in:
parent
45cc831efd
commit
36030158c4
1 changed files with 30 additions and 13 deletions
|
@ -50,6 +50,7 @@
|
||||||
#include <gst/gl/gstglfuncs.h>
|
#include <gst/gl/gstglfuncs.h>
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
#include "gstcudamemory.h"
|
||||||
#include "gstnvdecoder.h"
|
#include "gstnvdecoder.h"
|
||||||
#include <string.h>
|
#include <string.h>
|
||||||
|
|
||||||
|
@ -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"));
|
src_templ = gst_caps_from_string (GST_VIDEO_CAPS_MAKE ("NV12"));
|
||||||
|
|
||||||
#if HAVE_NVCODEC_GST_GL
|
|
||||||
{
|
{
|
||||||
GstCaps *gl_caps = gst_caps_copy (src_templ);
|
GstCaps *cuda_caps = gst_caps_copy (src_templ);
|
||||||
gst_caps_set_features_simple (gl_caps,
|
gst_caps_set_features_simple (cuda_caps,
|
||||||
gst_caps_features_from_string (GST_CAPS_FEATURE_MEMORY_GL_MEMORY));
|
gst_caps_features_from_string (GST_CAPS_FEATURE_MEMORY_CUDA_MEMORY));
|
||||||
gst_caps_append (src_templ, gl_caps);
|
|
||||||
}
|
#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
|
#endif
|
||||||
|
|
||||||
|
gst_caps_append (src_templ, cuda_caps);
|
||||||
|
}
|
||||||
|
|
||||||
sink_templ = gst_caps_from_string (codec_map->sink_caps_string);
|
sink_templ = gst_caps_from_string (codec_map->sink_caps_string);
|
||||||
|
|
||||||
*src_template = src_templ;
|
*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);
|
gst_caps_set_value (src_templ, "format", &format_list);
|
||||||
|
|
||||||
/* OpenGL specific */
|
|
||||||
#if HAVE_NVCODEC_GST_GL
|
|
||||||
{
|
{
|
||||||
GstCaps *gl_caps = gst_caps_copy (src_templ);
|
GstCaps *cuda_caps = gst_caps_copy (src_templ);
|
||||||
gst_caps_set_features_simple (gl_caps,
|
gst_caps_set_features_simple (cuda_caps,
|
||||||
gst_caps_features_from_string (GST_CAPS_FEATURE_MEMORY_GL_MEMORY));
|
gst_caps_features_from_string (GST_CAPS_FEATURE_MEMORY_CUDA_MEMORY));
|
||||||
gst_caps_append (src_templ, gl_caps);
|
|
||||||
}
|
/* 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
|
#endif
|
||||||
|
|
||||||
|
gst_caps_append (src_templ, cuda_caps);
|
||||||
|
}
|
||||||
|
|
||||||
sink_templ = gst_caps_from_string (codec_map->sink_caps_string);
|
sink_templ = gst_caps_from_string (codec_map->sink_caps_string);
|
||||||
gst_caps_set_simple (sink_templ,
|
gst_caps_set_simple (sink_templ,
|
||||||
"width", GST_TYPE_INT_RANGE, min_width, max_width,
|
"width", GST_TYPE_INT_RANGE, min_width, max_width,
|
||||||
|
|
Loading…
Reference in a new issue