Skip to content

Commit

Permalink
[win] fix crop black bar function with dxva renderer - the source rec…
Browse files Browse the repository at this point in the history
…t was not passed
  • Loading branch information
CrystalP authored and CrystalP committed Aug 7, 2011
1 parent 739c323 commit d1d265e
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 12 deletions.
17 changes: 11 additions & 6 deletions xbmc/cores/VideoRenderers/WinRenderer.cpp
Expand Up @@ -901,12 +901,17 @@ void CWinRenderer::Stage2()
void CWinRenderer::RenderProcessor(DWORD flags)
{
CSingleLock lock(g_graphicsContext);
RECT rect;
HRESULT hr;
rect.top = m_destRect.y1;
rect.bottom = m_destRect.y2;
rect.left = m_destRect.x1;
rect.right = m_destRect.x2;
RECT sourceRect;
sourceRect.top = m_sourceRect.y1;
sourceRect.bottom = m_sourceRect.y2;
sourceRect.left = m_sourceRect.x1;
sourceRect.right = m_sourceRect.x2;
RECT destRect;
destRect.top = m_destRect.y1;
destRect.bottom = m_destRect.y2;
destRect.left = m_destRect.x1;
destRect.right = m_destRect.x2;

DXVABuffer *image = (DXVABuffer*)m_VideoBuffers[m_iYV12RenderBuffer];
if(image->proc == NULL)
Expand All @@ -919,7 +924,7 @@ void CWinRenderer::RenderProcessor(DWORD flags)
return;
}

image->proc->Render(rect, target, image->id);
image->proc->Render(sourceRect, destRect, target, image->id);

target->Release();
}
Expand Down
7 changes: 2 additions & 5 deletions xbmc/cores/dvdplayer/DVDCodecs/Video/DXVA.cpp
Expand Up @@ -1113,10 +1113,6 @@ REFERENCE_TIME CProcessor::Add(IDirect3DSurface9* source)
vs.Start = m_time;
vs.End = 0;
vs.SampleFormat = m_desc.SampleFormat;
vs.SrcRect.left = 0;
vs.SrcRect.right = m_desc.SampleWidth;
vs.SrcRect.top = 0;
vs.SrcRect.bottom = m_desc.SampleHeight;
vs.PlanarAlpha = DXVA2_Fixed32OpaqueAlpha();
vs.SampleData = 0;
vs.SrcSurface = source;
Expand Down Expand Up @@ -1224,7 +1220,7 @@ static DXVA2_Fixed32 ConvertRange(const DXVA2_ValueRange& range, int value, int
return range.DefaultValue;
}

bool CProcessor::Render(const RECT &dst, IDirect3DSurface9* target, REFERENCE_TIME time)
bool CProcessor::Render(const RECT &src, const RECT &dst, IDirect3DSurface9* target, REFERENCE_TIME time)
{
CSingleLock lock(m_section);

Expand Down Expand Up @@ -1265,6 +1261,7 @@ bool CProcessor::Render(const RECT &dst, IDirect3DSurface9* target, REFERENCE_TI
{
DXVA2_VideoSample& vs = samp[valid];
vs = *it;
vs.SrcRect = src;
vs.DstRect = dst;
if(vs.End == 0)
vs.End = vs.Start + 2;
Expand Down
2 changes: 1 addition & 1 deletion xbmc/cores/dvdplayer/DVDCodecs/Video/DXVA.h
Expand Up @@ -113,7 +113,7 @@ class CProcessor
void HoldSurface(IDirect3DSurface9* surface);
REFERENCE_TIME Add(IDirect3DSurface9* source);
bool ProcessPicture(DVDVideoPicture* picture);
bool Render(const RECT& dst, IDirect3DSurface9* target, const REFERENCE_TIME time);
bool Render(const RECT& src, const RECT& dst, IDirect3DSurface9* target, const REFERENCE_TIME time);
int Size() { return m_size; }

virtual void OnCreateDevice() {}
Expand Down

0 comments on commit d1d265e

Please sign in to comment.