本文整理汇总了C++中IVideoWindow::SetWindowPosition方法的典型用法代码示例。如果您正苦于以下问题:C++ IVideoWindow::SetWindowPosition方法的具体用法?C++ IVideoWindow::SetWindowPosition怎么用?C++ IVideoWindow::SetWindowPosition使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类IVideoWindow
的用法示例。
在下文中一共展示了IVideoWindow::SetWindowPosition方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: video_set_window_region
void video_set_window_region(int id, long x, long y, long w, long h) {
get_video(videoStruct, id);
IVideoWindow *pVidWin = NULL;
videoStruct->pGraph->QueryInterface(IID_IVideoWindow, (void **)&pVidWin);
pVidWin->SetWindowPosition(x, y, w, h);
}
示例2: play_movie
void play_movie( HWND hwnd )
{
IGraphBuilder *pGraph;
IMediaControl *pMediaControl;
IMediaEvent *pEvent;
IBasicVideo *pBasic;
IVideoWindow *pVidWin = NULL;
RECT grc;
long width, height;
CoInitialize(NULL);
// Create the filter graph manager and query for interfaces.
CoCreateInstance(
CLSID_FilterGraph,
NULL,
CLSCTX_INPROC_SERVER,
IID_IGraphBuilder,
(void **)&pGraph);
pGraph->QueryInterface(IID_IVideoWindow, (void **)&pVidWin);
pGraph->QueryInterface(IID_IMediaControl, (void **)&pMediaControl);
pGraph->QueryInterface(IID_IMediaEvent, (void **)&pEvent);
pGraph->QueryInterface(IID_IBasicVideo, (void**)&pBasic );
// Build the graph. IMPORTANT: Change string to a file on your system.
pGraph->RenderFile(L"e:\\alpha\\running.avi", NULL);
pBasic->GetVideoSize( &width, &height );
printf( "video frames are %d x %d\n", width, height );
pVidWin->put_Owner((OAHWND)hwnd);
pVidWin->put_WindowStyle(WS_CHILD | WS_CLIPSIBLINGS);
GetClientRect( hwnd, &grc );
pVidWin->SetWindowPosition(10, 10, width, height);
printf( "window is %d x %d\n", grc.right, grc.bottom );
// Run the graph.
pMediaControl->Run();
// Wait for completion.
long evCode;
pEvent->WaitForCompletion(INFINITE, &evCode);
pVidWin->put_Visible(OAFALSE);
pVidWin->put_Owner(NULL);
// Clean up.
pBasic->Release();
pVidWin->Release();
pMediaControl->Release();
pEvent->Release();
pGraph->Release();
CoUninitialize();
}
示例3: video_set_scale
void video_set_scale(int id, bool scale) {
get_video(videoStruct, id);
IVideoWindow *pVidWin = NULL;
videoStruct->pGraph->QueryInterface(IID_IVideoWindow, (void **)&pVidWin);
RECT rc;
if (scale) {
GetClientRect(enigma::hWnd, &rc);
} else {
//TODO: Finish me
}
pVidWin->SetWindowPosition(0, 0, rc.right, rc.bottom);
}
示例4: ShowVideo
HRESULT CRTCAVSession::ShowVideo(RTC_VIDEO_DEVICE enDevice, BOOL fShow)
{
IVideoWindow * pVid = NULL;
IRTCClient * pClient = NULL;
long lMediaCaps = 0;
HWND hWnd = NULL;
HRESULT hr;
hr = m_pSession->get_Client(&pClient);
if (FAILED(hr))
{
// get_Client failed
return hr;
}
// Get the media capabilities
hr = pClient->get_MediaCapabilities(&lMediaCaps);
if (FAILED(hr))
{
// get_MediaCapabilities failed
SAFE_RELEASE(pClient);
return hr;
}
hr = pClient->get_IVideoWindow(
enDevice, &pVid);
SAFE_RELEASE(pClient);
if (FAILED(hr))
{
// get_IVideoWindow failed
return hr;
}
if (enDevice == RTCVD_PREVIEW)
{
// Determine whether to show the preview video
fShow = fShow && (lMediaCaps & RTCMT_VIDEO_SEND);
m_fShowPrev = fShow;
hWnd = m_hPrevVideoParent;
// Show or hide the preview video preview parent window
ShowWindow(m_hPrevVideoParent, fShow ? SW_SHOW : SW_HIDE);
// Set window region for receive video parent window
HRGN hRegion;
if (fShow)
{
// Set the receive video region to make room for the preview
// video picture-in-picture
POINT rgPoints[6] =
{ 0, 0,
0, m_lRecvHeight,
m_lRecvWidth - m_lPrevWidth, m_lRecvHeight,
m_lRecvWidth - m_lPrevWidth, m_lRecvHeight - m_lPrevHeight,
m_lRecvWidth, m_lRecvHeight - m_lPrevHeight,
m_lRecvWidth, 0
};
hRegion = CreatePolygonRgn(rgPoints, 6, ALTERNATE);
}
else
{
// Set the receive video region to be rectangular
hRegion = CreateRectRgn(0, 0, m_lRecvWidth, m_lRecvHeight);
}
SetWindowRgn(m_hRecvVideoParent, hRegion, TRUE);
}
else
{
// Determine whether to show the receive video
fShow = fShow && (lMediaCaps & RTCMT_VIDEO_RECEIVE);
m_fShowRecv = fShow;
hWnd = m_hRecvVideoParent;
// Always show the video receive parent window
ShowWindow(m_hRecvVideoParent, SW_SHOW);
}
if ( fShow == TRUE )
{
// Set the video window style
pVid->put_WindowStyle( WS_CHILD |
WS_CLIPCHILDREN |
WS_CLIPSIBLINGS );
// Set the parent window for the video window
pVid->put_Owner( (OAHWND)hWnd );
RECT rc;
GetClientRect(hWnd, &rc );
// Position the video window
pVid->SetWindowPosition(
rc.left,
//.........这里部分代码省略.........
示例5: 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;
}