本文整理汇总了C++中IVideoWindow::get_Owner方法的典型用法代码示例。如果您正苦于以下问题:C++ IVideoWindow::get_Owner方法的具体用法?C++ IVideoWindow::get_Owner怎么用?C++ IVideoWindow::get_Owner使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类IVideoWindow
的用法示例。
在下文中一共展示了IVideoWindow::get_Owner方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: InitCoopLevel
HRESULT CMpcAudioRenderer::InitCoopLevel()
{
HRESULT hr = S_OK;
IVideoWindow* pVideoWindow = NULL;
HWND hWnd = NULL;
CComBSTR bstrCaption;
hr = m_pGraph->QueryInterface (__uuidof(IVideoWindow), (void**) &pVideoWindow);
if (SUCCEEDED (hr))
{
pVideoWindow->get_Owner((long*)&hWnd);
SAFE_RELEASE (pVideoWindow);
}
if (!hWnd)
{
hWnd = GetTopWindow(NULL);
}
ATLASSERT(hWnd != NULL);
if (!useWASAPI)
hr = m_pDS->SetCooperativeLevel(hWnd, DSSCL_PRIORITY);
else if (hTask == NULL)
{
// Ask MMCSS to temporarily boost the thread priority
// to reduce glitches while the low-latency stream plays.
DWORD taskIndex = 0;
hTask = AvSetMmThreadCharacteristics(TEXT("Pro Audio"), &taskIndex);
hr=GetLastError();
if (hTask == NULL)
return hr;
}
return hr;
}
示例2: InitCoopLevel
HRESULT CMpcAudioRenderer::InitCoopLevel()
{
HRESULT hr = S_OK;
IVideoWindow* pVideoWindow = nullptr;
HWND hWnd = nullptr;
hr = m_pGraph->QueryInterface(IID_PPV_ARGS(&pVideoWindow));
if (SUCCEEDED(hr)) {
pVideoWindow->get_Owner((OAHWND*)&hWnd);
SAFE_RELEASE(pVideoWindow);
}
if (!hWnd) {
hWnd = GetTopWindow(nullptr);
}
ASSERT(hWnd != nullptr);
if (!m_useWASAPI) {
hr = m_pDS->SetCooperativeLevel(hWnd, DSSCL_PRIORITY);
} else if (hTask == nullptr) {
// Ask MMCSS to temporarily boost the thread priority
// to reduce glitches while the low-latency stream plays.
DWORD taskIndex = 0;
if (pfAvSetMmThreadCharacteristicsW) {
hTask = pfAvSetMmThreadCharacteristicsW(_T("Pro Audio"), &taskIndex);
TRACE(_T("CMpcAudioRenderer::InitCoopLevel Putting thread in higher priority for WASAPI mode (lowest latency)\n"));
hr = GetLastError();
if (hTask == nullptr) {
return hr;
}
}
}
return hr;
}
示例3: SetVideoPosition
virtual HRESULT SetVideoPosition(RECT *pSrc, RECT *pDst, BOOL hideMouse)
{
if (!m_pGraph) return E_FAIL;
if (m_pVmrAllocator && pSrc && pDst)
{
// Update our VMR9 window positioning for mouse events to work (this may only
// work on XP, I think it will still fail on 2K)
m_pVmrAllocator->UpdateVideoPosition(pSrc, pDst);
return S_OK;
}
IBasicVideo* pBV = NULL;
HRESULT hr = m_pGraph->QueryInterface(IID_IBasicVideo, (void**)&pBV);
if (SUCCEEDED(hr))
{
/* long nativeWidth;
hr = pBV->get_VideoWidth(&nativeWidth);
if (FAILED(hr))
{
SAFE_RELEASE(pBV);
// no video is present
return;
}
*/
long srcTop, srcLeft, srcWidth, srcHeight;
pBV->GetSourcePosition(&srcLeft, &srcTop, &srcWidth, &srcHeight);
pBV->GetDestinationPosition(&srcLeft, &srcTop, &srcWidth, &srcHeight);
if (pSrc)
{
pBV->SetSourcePosition(pSrc->left, pSrc->top, pSrc->right - pSrc->left, pSrc->bottom - pSrc->top);
}
else
{
pBV->SetDefaultSourcePosition();
}
if (pDst)
{
pBV->SetDestinationPosition(pDst->left, pDst->top, pDst->right - pDst->left, pDst->bottom - pDst->top);
}
else
{
pBV->SetDefaultDestinationPosition();
}
SAFE_RELEASE(pBV);
IVideoWindow* pVW = NULL;
hr = m_pGraph->QueryInterface(IID_IVideoWindow, (void**)&pVW);
if (SUCCEEDED(hr))
{
OAHWND vidWinHWND;
hr = pVW->get_Owner(&vidWinHWND);
if (SUCCEEDED(hr))
{
RECT grc;
GetClientRect((HWND)vidWinHWND, &grc);
pVW->SetWindowPosition(0, 0, grc.right, grc.bottom);
}
pVW->HideCursor(hideMouse == JNI_TRUE ? OATRUE : OAFALSE);
SAFE_RELEASE(pVW);
}
}
return S_OK;
}