vlc | branch: master | Steve Lhomme <[email protected]> | Thu Jun 13 14:42:19 2019 +0200| [18a8c28aa82369dea5b09e5f3341a0b26fca4c6a] | committer: Steve Lhomme
d3d11va: simplify the device logging No need to allocate a string anymore. > http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=18a8c28aa82369dea5b09e5f3341a0b26fca4c6a --- modules/codec/avcodec/d3d11va.c | 40 ++++++++++------------------------------ 1 file changed, 10 insertions(+), 30 deletions(-) diff --git a/modules/codec/avcodec/d3d11va.c b/modules/codec/avcodec/d3d11va.c index c02844f0da..a1beacc6f7 100644 --- a/modules/codec/avcodec/d3d11va.c +++ b/modules/codec/avcodec/d3d11va.c @@ -129,7 +129,6 @@ struct vlc_va_sys_t /* */ static int D3dCreateDevice(vlc_va_t *, const video_format_t *); static void D3dDestroyDevice(vlc_va_t *); -static char *DxDescribe(vlc_va_sys_t *); static int DxCreateVideoService(vlc_va_t *); static void DxDestroyVideoService(vlc_va_t *); @@ -396,11 +395,16 @@ static int Open(vlc_va_t *va, AVCodecContext *ctx, enum PixelFormat pix_fmt, if (err != VLC_SUCCESS) goto error; - /* TODO print the hardware name/vendor for debugging purposes */ - char *desc = DxDescribe(sys); - if (desc != NULL) { - msg_Info(va, "Using %s", desc); - free(desc); + IDXGIAdapter *p_adapter = D3D11DeviceAdapter(sys->d3d_dev.d3ddevice); + if (p_adapter) { + char *description = NULL; + DXGI_ADAPTER_DESC adapterDesc; + if (SUCCEEDED(IDXGIAdapter_GetDesc(p_adapter, &adapterDesc))) { + msg_Info(va, "Using D3D11VA (%ls, vendor %x(%s), device %x, revision %x)", + adapterDesc.Description, + adapterDesc.VendorId, DxgiVendorStr(adapterDesc.VendorId), adapterDesc.DeviceId, adapterDesc.Revision); + } + IDXGIAdapter_Release(p_adapter); } ctx->hwaccel_context = &sys->hw; @@ -475,30 +479,6 @@ static void D3dDestroyDevice(vlc_va_t *va) } /** - * It describes our Direct3D object - */ -static char *DxDescribe(vlc_va_sys_t *sys) -{ - - IDXGIAdapter *p_adapter = D3D11DeviceAdapter(sys->d3d_dev.d3ddevice); - if (!p_adapter) { - return NULL; - } - - char *description = NULL; - DXGI_ADAPTER_DESC adapterDesc; - if (SUCCEEDED(IDXGIAdapter_GetDesc(p_adapter, &adapterDesc))) { - if (asprintf(&description, "D3D11VA (%ls, vendor %x(%s), device %x, revision %x)", - adapterDesc.Description, - adapterDesc.VendorId, DxgiVendorStr(adapterDesc.VendorId), adapterDesc.DeviceId, adapterDesc.Revision) < 0) - description = NULL; - } - - IDXGIAdapter_Release(p_adapter); - return description; -} - -/** * It creates a DirectX video service */ static int DxCreateVideoService(vlc_va_t *va) _______________________________________________ vlc-commits mailing list [email protected] https://mailman.videolan.org/listinfo/vlc-commits
