cudacontext: Remove unnecessary cuInit() call
It's already called at plugin init time Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/1834>
This commit is contained in:
parent
2d624a1d6b
commit
cec7ac2a1b
@ -134,11 +134,9 @@ gst_cuda_context_get_property (GObject * object, guint prop_id,
|
|||||||
static void
|
static void
|
||||||
gst_cuda_context_constructed (GObject * object)
|
gst_cuda_context_constructed (GObject * object)
|
||||||
{
|
{
|
||||||
static gsize once = 0;
|
|
||||||
GstCudaContext *context = GST_CUDA_CONTEXT (object);
|
GstCudaContext *context = GST_CUDA_CONTEXT (object);
|
||||||
GstCudaContextPrivate *priv = context->priv;
|
GstCudaContextPrivate *priv = context->priv;
|
||||||
CUcontext cuda_ctx, old_ctx;
|
CUcontext cuda_ctx, old_ctx;
|
||||||
gboolean ret = TRUE;
|
|
||||||
CUdevice cdev = 0, cuda_dev = -1;
|
CUdevice cdev = 0, cuda_dev = -1;
|
||||||
gint dev_count = 0;
|
gint dev_count = 0;
|
||||||
gchar name[256];
|
gchar name[256];
|
||||||
@ -147,17 +145,6 @@ gst_cuda_context_constructed (GObject * object)
|
|||||||
gint tex_align = 0;
|
gint tex_align = 0;
|
||||||
GList *iter;
|
GList *iter;
|
||||||
|
|
||||||
if (g_once_init_enter (&once)) {
|
|
||||||
if (CuInit (0) != CUDA_SUCCESS) {
|
|
||||||
GST_ERROR_OBJECT (context, "Failed to cuInit");
|
|
||||||
ret = FALSE;
|
|
||||||
}
|
|
||||||
g_once_init_leave (&once, ret);
|
|
||||||
|
|
||||||
if (!ret)
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (!gst_cuda_result (CuDeviceGetCount (&dev_count)) || dev_count == 0) {
|
if (!gst_cuda_result (CuDeviceGetCount (&dev_count)) || dev_count == 0) {
|
||||||
GST_WARNING ("No CUDA devices detected");
|
GST_WARNING ("No CUDA devices detected");
|
||||||
return;
|
return;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user