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

direct3d11: log the current display format

Signed-off-by: Jean-Baptiste Kempf's avatarJean-Baptiste Kempf <jb@videolan.org>
parent 81b00519
......@@ -2486,7 +2486,7 @@ AM_CONDITIONAL([HAVE_AVCODEC_D3D11VA], [test "${have_avcodec_d3d11va}" = "yes"])
dnl
dnl DXGI debug
dnl
AC_CHECK_HEADERS(dxgidebug.h)
AC_CHECK_HEADERS(dxgidebug.h dxgi1_6.h)
dnl
dnl avformat demuxer/muxer plugin
......
......@@ -40,7 +40,11 @@
#define COBJMACROS
#include <initguid.h>
#include <d3d11.h>
#include <dxgi1_5.h>
#ifdef HAVE_DXGI1_6_H
# include <dxgi1_6.h>
#else
# include <dxgi1_5.h>
#endif
#include <d3dcompiler.h>
/* avoided until we can pass ISwapchainPanel without c++/cx mode
......@@ -1504,6 +1508,7 @@ static void D3D11SetColorSpace(vout_display_t *vd)
int best = -1;
int score, best_score = 0;
UINT support;
IDXGIOutput *dxgiOutput = NULL;
IDXGISwapChain3 *dxgiswapChain3 = NULL;
sys->display.colorspace = &color_spaces[0];
......@@ -1580,6 +1585,34 @@ done:
if (dxgiswapChain3)
IDXGISwapChain3_Release(dxgiswapChain3);
#ifdef HAVE_DXGI1_6_H
if (SUCCEEDED(IDXGISwapChain_GetContainingOutput( sys->dxgiswapChain, &dxgiOutput )))
{
IDXGIOutput6 *dxgiOutput6 = NULL;
if (SUCCEEDED(IDXGIOutput_QueryInterface( dxgiOutput, &IID_IDXGIOutput6, (void **)&dxgiOutput6 )))
{
DXGI_OUTPUT_DESC1 desc1;
if (SUCCEEDED(IDXGIOutput6_GetDesc1( dxgiOutput6, &desc1 )))
{
const dxgi_color_space *csp = NULL;
for (int i=0; color_spaces[i].name; ++i)
{
if (color_spaces[i].dxgi == desc1.ColorSpace)
{
csp = &color_spaces[i];
break;
}
}
msg_Dbg(vd, "Output max luminance: %.1f, colorspace %s, bits per pixel %d", desc1.MaxFullFrameLuminance, csp?csp->name:"unknown", desc1.BitsPerColor);
sys->display.luminance_peak = desc1.MaxFullFrameLuminance;
}
IDXGIOutput6_Release( dxgiOutput6 );
}
IDXGIOutput_Release( dxgiOutput );
}
#endif
}
static const d3d_format_t *GetDirectRenderingFormat(vout_display_t *vd, vlc_fourcc_t i_src_chroma)
......
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