diff --git a/plugins/GSdx/GSCapture.cpp b/plugins/GSdx/GSCapture.cpp index 7e358e9a8c..54f1791dc6 100644 --- a/plugins/GSdx/GSCapture.cpp +++ b/plugins/GSdx/GSCapture.cpp @@ -391,8 +391,9 @@ GSCapture::~GSCapture() EndCapture(); } -bool GSCapture::BeginCapture(float fps) +bool GSCapture::BeginCapture(float fps, GSVector2i recomendedResolution, float aspect) { + printf("Recomended resolution: %d x %d, DAR for muxing: %.4f\n", recomendedResolution.x, recomendedResolution.y, aspect); std::lock_guard lock(m_lock); ASSERT(fps != 0); diff --git a/plugins/GSdx/GSCapture.h b/plugins/GSdx/GSCapture.h index f98ee25cbe..e522da5555 100644 --- a/plugins/GSdx/GSCapture.h +++ b/plugins/GSdx/GSCapture.h @@ -52,7 +52,7 @@ public: GSCapture(); virtual ~GSCapture(); - bool BeginCapture(float fps); + bool BeginCapture(float fps, GSVector2i recomendedResolution, float aspect); bool DeliverFrame(const void* bits, int pitch, bool rgba); bool EndCapture(); diff --git a/plugins/GSdx/GSRenderer.cpp b/plugins/GSdx/GSRenderer.cpp index 961575a589..a0f8e36e25 100644 --- a/plugins/GSdx/GSRenderer.cpp +++ b/plugins/GSdx/GSRenderer.cpp @@ -533,7 +533,10 @@ bool GSRenderer::MakeSnapshot(const string& path) bool GSRenderer::BeginCapture() { - return m_capture.BeginCapture(GetTvRefreshRate()); + GSVector4i disp = m_wnd->GetClientRect().fit(m_aspectratio); + float aspect = (float)disp.width() / max(1, disp.height()); + + return m_capture.BeginCapture(GetTvRefreshRate(), GetInternalResolution(), aspect); } void GSRenderer::EndCapture() diff --git a/plugins/GSdx/GSRenderer.h b/plugins/GSdx/GSRenderer.h index 6e8a513df6..4459c5ead5 100644 --- a/plugins/GSdx/GSRenderer.h +++ b/plugins/GSdx/GSRenderer.h @@ -69,6 +69,9 @@ public: virtual void KeyEvent(GSKeyEventData* e); virtual bool CanUpscale() {return false;} virtual int GetUpscaleMultiplier() {return 1;} + virtual GSVector2i GetInternalResolution() { + return GSVector2i(GetDisplayRect().width(), GetDisplayRect().height()); + } void SetAspectRatio(int aspect) {m_aspectratio = aspect;} void SetVSync(bool enabled); void SetFrameLimit(bool limit); diff --git a/plugins/GSdx/GSRendererHW.cpp b/plugins/GSdx/GSRendererHW.cpp index 4fcbfab781..6e8b4483f2 100644 --- a/plugins/GSdx/GSRendererHW.cpp +++ b/plugins/GSdx/GSRendererHW.cpp @@ -100,6 +100,15 @@ int GSRendererHW::GetUpscaleMultiplier() return m_upscale_multiplier ? m_upscale_multiplier : 1; } +GSVector2i GSRendererHW::GetInternalResolution() { + GSVector2i dr(GetDisplayRect().width(), GetDisplayRect().height()); + + if (m_upscale_multiplier) + return GSVector2i(dr.x * m_upscale_multiplier, dr.y * m_upscale_multiplier); + else + return GSVector2i(m_width, m_height); +} + void GSRendererHW::Reset() { // TODO: GSreset can come from the main thread too => crash diff --git a/plugins/GSdx/GSRendererHW.h b/plugins/GSdx/GSRendererHW.h index 190dbe038f..2f2c5f8237 100644 --- a/plugins/GSdx/GSRendererHW.h +++ b/plugins/GSdx/GSRendererHW.h @@ -155,6 +155,7 @@ public: void SetGameCRC(uint32 crc, int options); bool CanUpscale(); int GetUpscaleMultiplier(); + virtual GSVector2i GetInternalResolution(); void SetScaling(); void Reset();