STDMETHODIMP CSubPicAllocatorPresenterImpl::GetSize(LPCSTR field, SIZE* value) { CheckPointer(value, E_POINTER); if (!strcmp(field, "originalVideoSize")) { *value = GetVideoSize(false); return S_OK; } else if (!strcmp(field, "arAdjustedVideoSize")) { *value = GetVideoSize(true); return S_OK; } return E_INVALIDARG; }
HRESULT FMPlayerDShow::SetVideoRect(const RECT &rcPos) { HRESULT hr = S_FALSE; WTL::CRect wr = rcPos; m_VideoRect = rcPos; if (m_VideoWnd) { WTL::CSize arxy = GetVideoSize(); WTL::CRect vr = WTL::CRect(0,0,0,0); WTL::CSize ws = wr.Size(); int w = ws.cx; int h = ws.cy; double m_ZoomX = 1; double m_ZoomY = 1; double m_PosX = 0.5; double m_PosY = 0.5; BOOL bFromInside = TRUE; if(bFromInside) { h = ws.cy; w = MulDiv(h, arxy.cx, arxy.cy); if(bFromInside && w > ws.cx) { w = ws.cx; h = MulDiv(w, arxy.cy, arxy.cx); } } WTL::CSize size((int)(m_ZoomX*w), (int)(m_ZoomY*h)); WTL::CPoint pos( (int)(m_PosX*(wr.Width()*3 - m_ZoomX*w) - wr.Width()), (int)(m_PosY*(wr.Height()*3 - m_ZoomY*h) - wr.Height())); vr = WTL::CRect(pos, size); wr |= WTL::CRect(0,0,0,0); vr |= WTL::CRect(0,0,0,0); { hr = m_pBV->SetDefaultSourcePosition(); hr = m_pBV->SetDestinationPosition(vr.left, vr.top, vr.Width(), vr.Height()); hr = m_VideoWnd->SetWindowPosition(wr.left, wr.top, wr.Width(), wr.Height()); } } return hr; }
static int GetVideoSize (lua_State * L) { Uint32 width, height; GetVideoSize(&width, &height); lua_pushnumber(L, width); lua_pushnumber(L, height); return 2; }
IVACloud::IVACloud(XElement *data) { this->data = data; GetVideoSize(); UpdateSettings(); m_nSourceID = g_pCloudData->NewSourceID(); SendMessage(g_pCloudData->m_hwdIVACloud, WM_NEWIVACLOUD, m_nIndex, m_nSourceID); //AppWarning(TEXT("Enable IVA image %d"), API->GetTotalStreamTime()); }
STDMETHODIMP_(void) CSubPicAllocatorPresenterImpl::SetVideoSize(CSize szVideo, CSize szAspectRatio /* = CSize(0, 0) */) { if (szAspectRatio == CSize(0, 0)) { szAspectRatio = szVideo; } bool bVideoSizeChanged = !!(m_nativeVideoSize != szVideo); bool bAspectRatioChanged = !!(m_aspectRatio != szAspectRatio); m_nativeVideoSize = szVideo; m_aspectRatio = szAspectRatio; if (bVideoSizeChanged || bAspectRatioChanged) { if (m_SubtitleTextureLimit == VIDEO) { m_maxSubtitleTextureSize = GetVideoSize(); m_pAllocator->SetMaxTextureSize(m_maxSubtitleTextureSize); } } }