nvenc: Give more details about errors

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/1472>
This commit is contained in:
Thibault Saunier 2021-12-03 13:12:42 +00:00 committed by GStreamer Marge Bot
parent b7ded51382
commit 3549d59725
2 changed files with 9 additions and 1 deletions

View file

@ -1847,7 +1847,8 @@ gst_nv_base_enc_set_format (GstVideoEncoder * enc, GstVideoCodecState * state)
if (nv_ret != NV_ENC_SUCCESS) {
GST_ELEMENT_ERROR (nvenc, LIBRARY, SETTINGS, (NULL),
("Failed to %sinit encoder: %d", reconfigure ? "re" : "", nv_ret));
("Failed to %sinit encoder: %d- %s", reconfigure ? "re" : "", nv_ret,
NvEncGetLastErrorString (nvenc->encoder)));
NvEncDestroyEncoder (nvenc->encoder);
nvenc->encoder = NULL;
return FALSE;

View file

@ -79,6 +79,13 @@ NvEncDestroyEncoder (void *encoder)
return nvenc_api.nvEncDestroyEncoder (encoder);
}
const char *NVENCAPI
NvEncGetLastErrorString (void *encoder)
{
g_assert (nvenc_api.nvEncGetLastErrorString != NULL);
return nvenc_api.nvEncGetLastErrorString (encoder);
}
NVENCSTATUS NVENCAPI
NvEncGetEncodeGUIDs (void *encoder, GUID * array, uint32_t array_size,
uint32_t * count)