return inputView;
}
-bool CProcessorHD::Render(CRect src, CRect dst, ID3D11Resource* target, ID3D11View** views, DWORD flags, UINT frameIdx)
+bool CProcessorHD::Render(CRect src, CRect dst, ID3D11Resource* target, ID3D11View** views, DWORD flags, UINT frameIdx, UINT rotation)
{
HRESULT hr;
CSingleLock lock(m_section);
, 0, 100, 50);
ApplyFilter(D3D11_VIDEO_PROCESSOR_FILTER_CONTRAST, CMediaSettings::GetInstance().GetCurrentVideoSettings().m_Contrast
, 0, 100, 50);
+ // Rotation
+ m_pVideoContext->VideoProcessorSetStreamRotation(m_pVideoProcessor, DEFAULT_STREAM_INDEX, (rotation != 0), (D3D11_VIDEO_PROCESSOR_ROTATION)(rotation / 90));
//
// Create Output View of Output Surfaces.
virtual bool Open(UINT width, UINT height, unsigned int flags, unsigned int format, unsigned int extended_format);
virtual void Close();
virtual CRenderPicture *Convert(DVDVideoPicture* picture);
- virtual bool Render(CRect src, CRect dst, ID3D11Resource* target, ID3D11View **views, DWORD flags, UINT frameIdx);
+ virtual bool Render(CRect src, CRect dst, ID3D11Resource* target, ID3D11View **views, DWORD flags, UINT frameIdx, UINT rotation);
virtual unsigned Size() { if (m_pVideoProcessor) return m_size; return 0; }
virtual unsigned PastRefs() { return m_max_back_refs; }
virtual void ApplySupportedFormats(std::vector<ERenderFormat> * formats);
m_iFlags = flags;
m_format = format;
m_extended_format = extended_format;
+ m_renderOrientation = orientation;
// calculate the input frame aspect ratio
CalculateFrameAspectRatio(d_width, d_height);
unsigned int contrast = (unsigned int)(CMediaSettings::GetInstance().GetCurrentVideoSettings().m_Contrast *.01f * 255.0f); // we have to divide by two here/multiply by two later
unsigned int brightness = (unsigned int)(CMediaSettings::GetInstance().GetCurrentVideoSettings().m_Brightness * .01f * 255.0f);
- CRect tu = { m_sourceRect.x1 / srcWidth, m_sourceRect.y1 / srcHeight, m_sourceRect.x2 / srcWidth, m_sourceRect.y2 / srcHeight };
-
g_Windowing.GetGUIShader()->SetSampler(m_TextureFilter);
+ CRect tu = { m_sourceRect.x1 / srcWidth, m_sourceRect.y1 / srcHeight, m_sourceRect.x2 / srcWidth, m_sourceRect.y2 / srcHeight };
+ CRect destRect = CRect(m_rotatedDestCoords[0], m_rotatedDestCoords[2]);
// pass contrast and brightness as diffuse color elements (see shader code)
- CD3DTexture::DrawQuad(m_destRect, D3DCOLOR_ARGB(255, contrast, brightness, 255), &m_SWTarget, &tu,
+ CD3DTexture::DrawQuad(destRect, D3DCOLOR_ARGB(255, contrast, brightness, 255), &m_SWTarget, &tu,
!cbcontrol ? SHADER_METHOD_RENDER_VIDEO : SHADER_METHOD_RENDER_VIDEO_CONTROL);
}
ID3D11RenderTargetView *oldRTView = nullptr; ID3D11DepthStencilView* oldDSView = nullptr;
pContext->OMGetRenderTargets(1, &oldRTView, &oldDSView);
// select destination rectangle
- CRect destRect = m_bUseHQScaler ? m_sourceRect : g_graphicsContext.StereoCorrection(m_destRect);
+ CRect destRect;
+ if (m_bUseHQScaler)
+ {
+ if (m_renderOrientation > 0)
+ {
+ // we need to rotate source coordinates for HQ scaller
+ // so we using ReorderDrawPoints with source coords.
+
+ // save coords
+ CRect oldDest = m_destRect;
+ saveRotatedCoords();
+
+ m_destRect = m_sourceRect;
+ ReorderDrawPoints();
+ // get rotated coords
+ destRect = CRect(m_rotatedDestCoords[0], m_rotatedDestCoords[2]);
+
+ // restore coords
+ restoreRotatedCoords();
+ m_destRect = oldDest;
+ }
+ else
+ destRect = m_sourceRect;
+ }
+ else
+ destRect = g_graphicsContext.StereoCorrection(CRect(m_rotatedDestCoords[0], m_rotatedDestCoords[2]));
// select target view
ID3D11RenderTargetView* pRTView = m_bUseHQScaler ? m_IntermediateTarget.GetRenderTarget() : oldRTView;
// change destination for HQ scallers
break;
}
- m_processor->Render(m_sourceRect, destRect, m_IntermediateTarget.Get(), views, flags, image->frameIdx);
+ m_processor->Render(m_sourceRect, destRect, m_IntermediateTarget.Get(), views, flags, image->frameIdx, m_renderOrientation);
if (m_bUseHQScaler)
{
feature == RENDERFEATURE_ZOOM ||
feature == RENDERFEATURE_VERTICAL_SHIFT ||
feature == RENDERFEATURE_PIXEL_RATIO ||
+ feature == RENDERFEATURE_ROTATION ||
feature == RENDERFEATURE_POSTPROCESS)
return true;