obs-ffmpeg: Show encoder name when logging jim-nvenc

This commit is contained in:
jp9000
2019-03-28 16:37:49 -07:00
parent 81354a9903
commit 5d83e1aec4
3 changed files with 43 additions and 27 deletions

View File

@@ -7,6 +7,21 @@ static pthread_mutex_t init_mutex = PTHREAD_MUTEX_INITIALIZER;
NV_ENCODE_API_FUNCTION_LIST nv = {NV_ENCODE_API_FUNCTION_LIST_VER};
NV_CREATE_INSTANCE_FUNC nv_create_instance = NULL;
#define error(format, ...) \
blog(LOG_ERROR, "[jim-nvenc] " format, ##__VA_ARGS__)
static inline bool nv_failed(NVENCSTATUS err, const char *func, const char *call)
{
if (err == NV_ENC_SUCCESS)
return false;
error("%s: %s failed: %d (%s)", func, call, (int)err,
nv_error_name(err));
return true;
}
#define NV_FAILED(x) nv_failed(x, __FUNCTION__, #x)
bool load_nvenc_lib(void)
{
if (sizeof(void*) == 8) {