diff options
author | Anton Fedchin <afedchin@users.noreply.github.com> | 2016-03-04 22:21:05 +0300 |
---|---|---|
committer | Anton Fedchin <afedchin@users.noreply.github.com> | 2016-03-04 22:21:05 +0300 |
commit | ae1f6bf4ab4252386e01d84d57994301b8100abe (patch) | |
tree | ff3486b0217970e34d6d429e40a250a634c286d4 | |
parent | bb5cce247f3c2518f38da4b12cfb543bac02a616 (diff) | |
parent | fb289dc48abdf2263e398bb5660d14e463975d28 (diff) |
Merge pull request #9263 from afedchin/win32_fixes
[Win32] Several small fixes.
-rw-r--r-- | xbmc/cores/VideoPlayer/VideoRenderers/HwDecRender/DXVAHD.cpp | 10 | ||||
-rw-r--r-- | xbmc/rendering/dx/RenderSystemDX.cpp | 43 | ||||
-rw-r--r-- | xbmc/utils/win32/memcpy_sse2.h | 2 |
3 files changed, 28 insertions, 27 deletions
diff --git a/xbmc/cores/VideoPlayer/VideoRenderers/HwDecRender/DXVAHD.cpp b/xbmc/cores/VideoPlayer/VideoRenderers/HwDecRender/DXVAHD.cpp index d91ea23aea..55a9674905 100644 --- a/xbmc/cores/VideoPlayer/VideoRenderers/HwDecRender/DXVAHD.cpp +++ b/xbmc/cores/VideoPlayer/VideoRenderers/HwDecRender/DXVAHD.cpp @@ -683,10 +683,12 @@ bool CProcessorHD::Render(CRect src, CRect dst, ID3D11Resource* target, ID3D11Vi m_pVideoContext->VideoProcessorSetOutputColorSpace(m_pVideoProcessor, &colorSpace); - ApplyFilter(D3D11_VIDEO_PROCESSOR_FILTER_BRIGHTNESS, CMediaSettings::GetInstance().GetCurrentVideoSettings().m_Brightness - , 0, 100, 50); - ApplyFilter(D3D11_VIDEO_PROCESSOR_FILTER_CONTRAST, CMediaSettings::GetInstance().GetCurrentVideoSettings().m_Contrast - , 0, 100, 50); + ApplyFilter(D3D11_VIDEO_PROCESSOR_FILTER_BRIGHTNESS, + CMediaSettings::GetInstance().GetCurrentVideoSettings().m_Brightness, 0, 100, 50); + ApplyFilter(D3D11_VIDEO_PROCESSOR_FILTER_CONTRAST, + CMediaSettings::GetInstance().GetCurrentVideoSettings().m_Contrast, 0, 100, 50); + ApplyFilter(D3D11_VIDEO_PROCESSOR_FILTER_HUE, 50, 0, 100, 50); + ApplyFilter(D3D11_VIDEO_PROCESSOR_FILTER_SATURATION, 50, 0, 100, 50); // Rotation m_pVideoContext->VideoProcessorSetStreamRotation(m_pVideoProcessor, DEFAULT_STREAM_INDEX, (rotation != 0), (D3D11_VIDEO_PROCESSOR_ROTATION)(rotation / 90)); diff --git a/xbmc/rendering/dx/RenderSystemDX.cpp b/xbmc/rendering/dx/RenderSystemDX.cpp index aabcf00f9e..453c43a37b 100644 --- a/xbmc/rendering/dx/RenderSystemDX.cpp +++ b/xbmc/rendering/dx/RenderSystemDX.cpp @@ -818,31 +818,23 @@ bool CRenderSystemDX::CreateWindowSizeDependentResources() if (SUCCEEDED(hr)) { m_pSwapChain1->QueryInterface(__uuidof(IDXGISwapChain), reinterpret_cast<void**>(&m_pSwapChain)); + // this hackish way to disable stereo in windowed mode: + // - restart presenting, 0 in sync interval discards current frame also + // - wait until new frame will be drawn + // sleep value possible depends on hardware m.b. need a setting in as.xml + if (m_useWindowedDX && !bHWStereoEnabled && m_bHWStereoEnabled) + { + DXGI_PRESENT_PARAMETERS presentParams = {}; + presentParams.DirtyRectsCount = 0; + presentParams.pDirtyRects = NULL; + presentParams.pScrollRect = NULL; + m_pSwapChain1->Present1(0, DXGI_PRESENT_RESTART, &presentParams); + + Sleep(100); + } m_bHWStereoEnabled = bHWStereoEnabled; } dxgiFactory2->Release(); - - // this hackish way to disable stereo in windowed mode: - // - restart presenting, 0 in sync interval discards current frame also - // - wait until new frame will be drawn - // sleep value possible depends on hardware m.b. need a setting in as.xml - if (!bHWStereoEnabled && m_useWindowedDX && bNeedRecreate) - { - DXGI_PRESENT_PARAMETERS presentParams = {}; - presentParams.DirtyRectsCount = 0; - presentParams.pDirtyRects = NULL; - presentParams.pScrollRect = NULL; - m_pSwapChain1->Present1(0, DXGI_PRESENT_RESTART, &presentParams); - - Sleep(100); - } - - // when transition from/to stereo mode trigger display reset event - if (bNeedRecreate) - { - OnDisplayLost(); - OnDeviceReset(); - } } else { @@ -964,6 +956,13 @@ bool CRenderSystemDX::CreateWindowSizeDependentResources() if (bRestoreRTView) m_pContext->OMSetRenderTargets(1, &m_pRenderTargetView, m_depthStencilView); + // trigger display reset event when transition from/to stereo mode occured + if (bNeedRecreate) + { + OnDisplayLost(); + OnDeviceReset(); + } + m_resizeInProgress = false; m_bResizeRequred = false; diff --git a/xbmc/utils/win32/memcpy_sse2.h b/xbmc/utils/win32/memcpy_sse2.h index 9465b5732c..afc604c73a 100644 --- a/xbmc/utils/win32/memcpy_sse2.h +++ b/xbmc/utils/win32/memcpy_sse2.h @@ -141,7 +141,7 @@ inline void convert_yuv420_nv12(uint8_t *const src[], const int srcStride[], int *d++ = *v++; } } - else + else if (i < chromaWidth) { xmm0 = _mm_load_si128((__m128i*)(v + i)); xmm1 = _mm_load_si128((__m128i*)(u + i)); |