cudaVideoChromaFormat format;
} GstNvdecChromaMap;
-static gboolean
+static void
gst_nvdec_register (GstPlugin * plugin, GType type, cudaVideoCodec codec_type,
const gchar * codec, const gchar * sink_caps_string, guint rank,
gint device_count)
gst_clear_caps (&sink_templ);
gst_clear_caps (&src_templ);
}
-
- return TRUE;
}
typedef struct
{cudaVideoCodec_VP9, "vp9", "video/x-vp9"}
};
-gboolean
+void
gst_nvdec_plugin_init (GstPlugin * plugin)
{
gint i;
CUresult cuda_ret;
gint dev_count = 0;
- gboolean ret = TRUE;
GST_DEBUG_CATEGORY_INIT (gst_nvdec_debug_category, "nvdec", 0,
"Debug category for the nvdec element");
codec_map[i].codec_name, 0, GST_RANK_PRIMARY, sink_templ, src_templ);
}
- return TRUE;
+ return;
}
cuda_ret = CuInit (0);
if (cuda_ret != CUDA_SUCCESS) {
GST_ERROR ("Failed to initialize CUDA API");
- return TRUE;
+ return;
}
cuda_ret = CuDeviceGetCount (&dev_count);
if (cuda_ret != CUDA_SUCCESS || dev_count == 0) {
GST_ERROR ("No CUDA devices detected");
- return TRUE;
+ return;
}
for (i = 0; i < G_N_ELEMENTS (codec_map); i++) {
- ret &= gst_nvdec_register (plugin, GST_TYPE_NVDEC, codec_map[i].codec,
+ gst_nvdec_register (plugin, GST_TYPE_NVDEC, codec_map[i].codec,
codec_map[i].codec_name, codec_map[i].sink_caps_string,
GST_RANK_PRIMARY, dev_count);
}
-
- return ret;
}
GType gst_nvdec_get_type (void);
-gboolean gst_nvdec_plugin_init (GstPlugin * plugin);
+void gst_nvdec_plugin_init (GstPlugin * plugin);
G_END_DECLS
return ret;
}
-static gboolean
+static void
gst_nv_enc_register (GstPlugin * plugin, GType type, GUID codec_id,
const gchar * codec, guint rank, gint device_count)
{
gst_clear_caps (&sink_templ);
gst_clear_caps (&src_templ);
}
-
- return TRUE;
}
-gboolean
+void
gst_nvenc_plugin_init (GstPlugin * plugin)
{
- gboolean ret = TRUE;
-
GST_DEBUG_CATEGORY_INIT (gst_nvenc_debug, "nvenc", 0, "Nvidia NVENC encoder");
nvenc_api.version = NV_ENCODE_API_FUNCTION_LIST_VER;
if (!load_nvenc_library ()) {
GST_INFO ("Failed to load nvenc library");
- return TRUE;
+ return;
}
if (nvEncodeAPICreateInstance (&nvenc_api) != NV_ENC_SUCCESS) {
cuda_ret = CuInit (0);
if (cuda_ret != CUDA_SUCCESS) {
GST_ERROR ("Failed to initialize CUDA API");
- return TRUE;
+ return;
}
cuda_ret = CuDeviceGetCount (&dev_count);
if (cuda_ret != CUDA_SUCCESS || dev_count == 0) {
GST_ERROR ("No CUDA devices detected");
- return TRUE;
+ return;
}
- ret &=
- gst_nv_enc_register (plugin, GST_TYPE_NV_H264_ENC,
+ gst_nv_enc_register (plugin, GST_TYPE_NV_H264_ENC,
NV_ENC_CODEC_H264_GUID, "h264", GST_RANK_PRIMARY * 2, dev_count);
- ret &=
- gst_nv_enc_register (plugin, GST_TYPE_NV_H265_ENC,
+ gst_nv_enc_register (plugin, GST_TYPE_NV_H265_ENC,
NV_ENC_CODEC_HEVC_GUID, "h265", GST_RANK_PRIMARY * 2, dev_count);
}
-
- return ret;
}
GUID codec_id);
-gboolean gst_nvenc_plugin_init (GstPlugin * plugin);
+void gst_nvenc_plugin_init (GstPlugin * plugin);
#endif /* __GST_NVENC_H_INCLUDED__ */
static gboolean
plugin_init (GstPlugin * plugin)
{
- gboolean ret = TRUE;
-
if (!gst_cuda_load_library ())
return TRUE;
#if HAVE_NVCODEC_GST_GL
/* FIXME: make nvdec usable without OpenGL dependency */
if (gst_cuvid_load_library ()) {
- ret &= gst_nvdec_plugin_init (plugin);
+ gst_nvdec_plugin_init (plugin);
}
#endif
- ret &= gst_nvenc_plugin_init (plugin);
+ gst_nvenc_plugin_init (plugin);
return TRUE;
}