#include "gstnvcodecutils.h"
#include "gstnvjpegenc.h"
+#include <glib/gi18n-lib.h>
+
GST_DEBUG_CATEGORY (gst_nvcodec_debug);
GST_DEBUG_CATEGORY (gst_nvdec_debug);
GST_DEBUG_CATEGORY (gst_nvenc_debug);
#define GST_CAT_DEFAULT gst_nvcodec_debug
+#ifdef G_OS_WIN32
+#define CUDA_LIBNAME "nvcuda.dll"
+#define NVCUVID_LIBNAME "nvcuvid.dll"
+#ifdef _WIN64
+#define NVENC_LIBNAME "nvEncodeAPI64.dll"
+#else
+#define NVENC_LIBNAME "nvEncodeAPI.dll"
+#endif
+#define NVRTC_LIBNAME "nvrtc64_*_0.dll"
+#else /* G_OS_WIN32 */
+#define CUDA_LIBNAME "libcuda.so.1"
+#define NVCUVID_LIBNAME "libnvcuvid.so.1"
+#define NVENC_LIBNAME "libnvidia-encode.so.1"
+#define NVRTC_LIBNAME "libnvrtc.so"
+#endif /* G_OS_WIN32 */
+
static void
plugin_deinit (gpointer data)
{
#endif
if (!gst_cuda_load_library ()) {
- GST_WARNING ("Failed to load cuda library");
+ gst_plugin_add_status_warning (plugin,
+ "CUDA library \"" CUDA_LIBNAME "\" was not found.");
return TRUE;
}
/* get available API version from nvenc and it will be passed to
* nvdec */
if (!gst_nvenc_load_library (&api_major_ver, &api_minor_ver)) {
- GST_WARNING ("Failed to load nvenc library");
+ gst_plugin_add_status_warning (plugin,
+ "NVENC library \"" NVENC_LIBNAME "\" was not found.");
nvenc_available = FALSE;
}
if (!gst_cuvid_load_library (api_major_ver, api_minor_ver)) {
GST_WARNING ("Failed to load nvdec library version %u.%u", api_major_ver,
api_minor_ver);
+ gst_plugin_add_status_warning (plugin,
+ "NVDEC library \"" NVCUVID_LIBNAME "\" was not found.");
nvdec_available = FALSE;
}
/* to abort if GST_CUDA_CRITICAL_ERRORS is configured */
gst_cuda_result (CUDA_ERROR_NO_DEVICE);
+
+ gst_plugin_add_status_error (plugin,
+ N_("Unable to initialize CUDA library."));
+
return TRUE;
}
CuGetErrorString (cuda_ret, &err_desc);
GST_ERROR ("No available device, cuDeviceGetCount ret: 0x%x: %s %s",
(int) cuda_ret, err_name, err_desc);
+
+ gst_plugin_add_status_warning (plugin,
+ N_("No NVIDIA graphics cards detected!"));
+
return TRUE;
}
have_nvrtc = check_runtime_compiler ();
+ if (!have_nvrtc) {
+ gst_plugin_add_status_info (plugin,
+ "CUDA runtime compilation library \"" NVRTC_LIBNAME "\" was not found, "
+ "check CUDA toolkit package installation");
+ }
for (i = 0; i < dev_count; i++) {
GstCudaContext *context = gst_cuda_context_new (i);