Commit c358dd00 authored by Steve Lhomme's avatar Steve Lhomme Committed by Jean-Baptiste Kempf

d3d11va: better logging of decoder configuration

Signed-off-by: default avatarJean-Baptiste Kempf <jb@videolan.org>
parent fabb0362
...@@ -638,16 +638,18 @@ static int DxSetupOutput(vlc_va_t *va, const GUID *input) ...@@ -638,16 +638,18 @@ static int DxSetupOutput(vlc_va_t *va, const GUID *input)
processorInput[idx++] = DXGI_FORMAT_NV12; processorInput[idx++] = DXGI_FORMAT_NV12;
processorInput[idx++] = DXGI_FORMAT_UNKNOWN; processorInput[idx++] = DXGI_FORMAT_UNKNOWN;
char *psz_decoder_name = directx_va_GetDecoderName(input);
/* */ /* */
for (idx = 0; processorInput[idx] != DXGI_FORMAT_UNKNOWN; ++idx) for (idx = 0; processorInput[idx] != DXGI_FORMAT_UNKNOWN; ++idx)
{ {
BOOL is_supported = false; BOOL is_supported = false;
hr = ID3D11VideoDevice_CheckVideoDecoderFormat((ID3D11VideoDevice*) dx_sys->d3ddec, input, processorInput[idx], &is_supported); hr = ID3D11VideoDevice_CheckVideoDecoderFormat((ID3D11VideoDevice*) dx_sys->d3ddec, input, processorInput[idx], &is_supported);
if (SUCCEEDED(hr) && is_supported) if (SUCCEEDED(hr) && is_supported)
msg_Dbg(va, "%s is supported for output", DxgiFormatToStr(processorInput[idx])); msg_Dbg(va, "%s output is supported for decoder %s.", DxgiFormatToStr(processorInput[idx]), psz_decoder_name);
else else
{ {
msg_Dbg(va, "Can't get a decoder for output format %s.", DxgiFormatToStr(processorInput[idx])); msg_Dbg(va, "Can't get a decoder output format %s for decoder %s.", DxgiFormatToStr(processorInput[idx]), psz_decoder_name);
continue; continue;
} }
...@@ -664,10 +666,13 @@ static int DxSetupOutput(vlc_va_t *va, const GUID *input) ...@@ -664,10 +666,13 @@ static int DxSetupOutput(vlc_va_t *va, const GUID *input)
if ( !b_needsProcessor ) if ( !b_needsProcessor )
{ {
msg_Dbg(va, "Using output format %s for decoder %s", DxgiFormatToStr(processorInput[idx]), psz_decoder_name);
va->sys->render = processorInput[idx]; va->sys->render = processorInput[idx];
free(psz_decoder_name);
return VLC_SUCCESS; return VLC_SUCCESS;
} }
} }
free(psz_decoder_name);
msg_Dbg(va, "Output format from picture source not supported."); msg_Dbg(va, "Output format from picture source not supported.");
return VLC_EGENERIC; return VLC_EGENERIC;
......
...@@ -242,13 +242,17 @@ static void DestroyVideoService(vlc_va_t *, directx_sys_t *); ...@@ -242,13 +242,17 @@ static void DestroyVideoService(vlc_va_t *, directx_sys_t *);
static void DestroyDeviceManager(vlc_va_t *, directx_sys_t *); static void DestroyDeviceManager(vlc_va_t *, directx_sys_t *);
static void DestroyDevice(vlc_va_t *, directx_sys_t *); static void DestroyDevice(vlc_va_t *, directx_sys_t *);
static const directx_va_mode_t *FindDxvaMode(const GUID *guid) char *directx_va_GetDecoderName(const GUID *guid)
{ {
for (unsigned i = 0; DXVA_MODES[i].name; i++) { for (unsigned i = 0; DXVA_MODES[i].name; i++) {
if (IsEqualGUID(DXVA_MODES[i].guid, guid)) if (IsEqualGUID(DXVA_MODES[i].guid, guid))
return &DXVA_MODES[i]; return strdup(DXVA_MODES[i].name);
} }
return NULL;
char *psz_name = malloc(36);
if (likely(psz_name))
asprintf(&psz_name, "Unknown decoder " GUID_FMT, GUID_PRINT(*guid));
return psz_name;
} }
/* */ /* */
...@@ -517,12 +521,9 @@ static int FindVideoServiceConversion(vlc_va_t *va, directx_sys_t *dx_sys, const ...@@ -517,12 +521,9 @@ static int FindVideoServiceConversion(vlc_va_t *va, directx_sys_t *dx_sys, const
/* Retreive supported modes from the decoder service */ /* Retreive supported modes from the decoder service */
for (unsigned i = 0; i < p_list.count; i++) { for (unsigned i = 0; i < p_list.count; i++) {
const GUID *g = &p_list.list[i]; const GUID *g = &p_list.list[i];
const directx_va_mode_t *mode = FindDxvaMode(g); char *psz_decoder_name = directx_va_GetDecoderName(g);
if (mode) { msg_Dbg(va, "- '%s' is supported by hardware", psz_decoder_name);
msg_Dbg(va, "- '%s' is supported by hardware", mode->name); free(psz_decoder_name);
} else {
msg_Warn(va, "- Unknown GUID = " GUID_FMT, GUID_PRINT( *g ) );
}
} }
/* Try all supported mode by our priority */ /* Try all supported mode by our priority */
......
...@@ -139,5 +139,6 @@ void directx_va_Close(vlc_va_t *, directx_sys_t *); ...@@ -139,5 +139,6 @@ void directx_va_Close(vlc_va_t *, directx_sys_t *);
int directx_va_Setup(vlc_va_t *, directx_sys_t *, AVCodecContext *avctx); int directx_va_Setup(vlc_va_t *, directx_sys_t *, AVCodecContext *avctx);
int directx_va_Get(vlc_va_t *, directx_sys_t *, picture_t *pic, uint8_t **data); int directx_va_Get(vlc_va_t *, directx_sys_t *, picture_t *pic, uint8_t **data);
void directx_va_Release(void *opaque, uint8_t *data); void directx_va_Release(void *opaque, uint8_t *data);
char *directx_va_GetDecoderName(const GUID *guid);
#endif /* AVCODEC_DIRECTX_VA_H */ #endif /* AVCODEC_DIRECTX_VA_H */
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment