Skip to content

Commit b461201

Browse files
committed
Для MPC VR добавлена поддержка IExFilterConfig::Flt_GetBin() с именем "originalVideoSize" для получения оригинального размера видео.
1 parent 3037c76 commit b461201

1 file changed

Lines changed: 20 additions & 3 deletions

File tree

src/filters/renderer/VideoRenderers/MPCVRAllocatorPresenter.cpp

Lines changed: 20 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -310,13 +310,30 @@ STDMETHODIMP_(bool) CMPCVRAllocatorPresenter::GetFlip()
310310

311311
STDMETHODIMP_(SIZE) CMPCVRAllocatorPresenter::GetVideoSize()
312312
{
313-
SIZE size = {0, 0};
313+
SIZE Size = {};
314+
if (CComQIPtr<IExFilterConfig> pIExFilterConfig = m_pMPCVR.p) {
315+
unsigned size = 0;
316+
LPVOID pSize = nullptr;
317+
if (SUCCEEDED(pIExFilterConfig->Flt_GetBin("originalVideoSize", &pSize, &size))) {
318+
bool bOk = false;
319+
if (size == sizeof(long) * 2) {
320+
bOk = true;
321+
memcpy(&Size.cx, pSize, sizeof(Size.cx));
322+
memcpy(&Size.cy, reinterpret_cast<BYTE*>(pSize) + sizeof(Size.cx), sizeof(Size.cy));
323+
}
324+
LocalFree(pSize);
325+
326+
if (bOk) {
327+
return Size;
328+
}
329+
}
330+
}
314331
if (CComQIPtr<IBasicVideo> pBV = m_pMPCVR.p) {
315332
// Final size of the video, after all scaling and cropping operations
316333
// This is also aspect ratio adjusted
317-
pBV->GetVideoSize(&size.cx, &size.cy);
334+
pBV->GetVideoSize(&Size.cx, &Size.cy);
318335
}
319-
return size;
336+
return Size;
320337
}
321338

322339
STDMETHODIMP_(SIZE) CMPCVRAllocatorPresenter::GetVideoSizeAR()

0 commit comments

Comments
 (0)