/****************************************************************************** * MCIAVI_mciUpdate [internal] */ static DWORD MCIQTZ_mciUpdate(UINT wDevID, DWORD dwFlags, LPMCI_DGV_UPDATE_PARMS lpParms) { WINE_MCIQTZ *wma; DWORD res = 0; TRACE("%04x, %08x, %p\n", wDevID, dwFlags, lpParms); if (!lpParms) return MCIERR_NULL_PARAMETER_BLOCK; wma = MCIQTZ_mciGetOpenDev(wDevID); if (!wma) return MCIERR_INVALID_DEVICE_ID; if (dwFlags & MCI_DGV_UPDATE_HDC) { LONG state, size; BYTE *data; BITMAPINFO *info; HRESULT hr; RECT src, dest; LONG visible = OATRUE; res = MCIERR_INTERNAL; IMediaControl_GetState(wma->pmctrl, -1, &state); if (state == State_Running) return MCIERR_UNSUPPORTED_FUNCTION; /* If in stopped state, nothing has been drawn to screen * moving to pause, which is needed for the old dib renderer, will result * in a single frame drawn, so hide the window here */ IVideoWindow_get_Visible(wma->vidwin, &visible); if (wma->parent) IVideoWindow_put_Visible(wma->vidwin, OAFALSE); /* FIXME: Should we check the original state and restore it? */ IMediaControl_Pause(wma->pmctrl); IMediaControl_GetState(wma->pmctrl, -1, &state); if (FAILED(hr = IBasicVideo_GetCurrentImage(wma->vidbasic, &size, NULL))) { WARN("Could not get image size (hr = %x)\n", hr); goto out; } data = HeapAlloc(GetProcessHeap(), 0, size); info = (BITMAPINFO*)data; IBasicVideo_GetCurrentImage(wma->vidbasic, &size, (LONG*)data); data += info->bmiHeader.biSize; IBasicVideo_GetSourcePosition(wma->vidbasic, &src.left, &src.top, &src.right, &src.bottom); IBasicVideo_GetDestinationPosition(wma->vidbasic, &dest.left, &dest.top, &dest.right, &dest.bottom); StretchDIBits(lpParms->hDC, dest.left, dest.top, dest.right + dest.left, dest.bottom + dest.top, src.left, src.top, src.right + src.left, src.bottom + src.top, data, info, DIB_RGB_COLORS, SRCCOPY); HeapFree(GetProcessHeap(), 0, data); res = 0; out: if (wma->parent) IVideoWindow_put_Visible(wma->vidwin, visible); } else if (dwFlags) FIXME("Unhandled flags %x\n", dwFlags); return res; }
static HRESULT WINAPI IBasicVideo_fnGetSourcePosition(IBasicVideo* iface,long* plLeft,long* plTop,long* plWidth,long* plHeight) { CFilterGraph_THIS(iface,basvid); QUERYBASICVIDEO TRACE("(%p)->()\n",This); hr = IBasicVideo_GetSourcePosition(pVideo,plLeft,plTop,plWidth,plHeight); IBasicVideo_Release(pVideo); return hr; }
/*************************************************************************** * MCIQTZ_mciWhere [internal] */ static DWORD MCIQTZ_mciWhere(UINT wDevID, DWORD dwFlags, LPMCI_DGV_RECT_PARMS lpParms) { WINE_MCIQTZ* wma; HRESULT hr; HWND hWnd; RECT rc; DWORD ret = MCIERR_UNRECOGNIZED_COMMAND; TRACE("(%04x, %08X, %p)\n", wDevID, dwFlags, lpParms); if (!lpParms) return MCIERR_NULL_PARAMETER_BLOCK; wma = MCIQTZ_mciGetOpenDev(wDevID); if (!wma) return MCIERR_INVALID_DEVICE_ID; hr = IVideoWindow_get_Owner(wma->vidwin, (OAHWND*)&hWnd); if (FAILED(hr)) { TRACE("No video stream, returning no window error\n"); return MCIERR_NO_WINDOW; } if (dwFlags & MCI_DGV_WHERE_SOURCE) { if (dwFlags & MCI_DGV_WHERE_MAX) FIXME("MCI_DGV_WHERE_SOURCE_MAX stub\n"); IBasicVideo_GetSourcePosition(wma->vidbasic, &rc.left, &rc.top, &rc.right, &rc.bottom); TRACE("MCI_DGV_WHERE_SOURCE %s\n", wine_dbgstr_rect(&rc)); } if (dwFlags & MCI_DGV_WHERE_DESTINATION) { if (dwFlags & MCI_DGV_WHERE_MAX) FIXME("MCI_DGV_WHERE_DESTINATION_MAX stub\n"); IBasicVideo_GetDestinationPosition(wma->vidbasic, &rc.left, &rc.top, &rc.right, &rc.bottom); TRACE("MCI_DGV_WHERE_DESTINATION %s\n", wine_dbgstr_rect(&rc)); } if (dwFlags & MCI_DGV_WHERE_FRAME) { if (dwFlags & MCI_DGV_WHERE_MAX) FIXME("MCI_DGV_WHERE_FRAME_MAX not supported yet\n"); else FIXME("MCI_DGV_WHERE_FRAME not supported yet\n"); goto out; } if (dwFlags & MCI_DGV_WHERE_VIDEO) { if (dwFlags & MCI_DGV_WHERE_MAX) FIXME("MCI_DGV_WHERE_VIDEO_MAX not supported yet\n"); else FIXME("MCI_DGV_WHERE_VIDEO not supported yet\n"); goto out; } if (dwFlags & MCI_DGV_WHERE_WINDOW) { if (dwFlags & MCI_DGV_WHERE_MAX) { GetWindowRect(GetDesktopWindow(), &rc); rc.right -= rc.left; rc.bottom -= rc.top; TRACE("MCI_DGV_WHERE_WINDOW_MAX %s\n", wine_dbgstr_rect(&rc)); } else { IVideoWindow_GetWindowPosition(wma->vidwin, &rc.left, &rc.top, &rc.right, &rc.bottom); TRACE("MCI_DGV_WHERE_WINDOW %s\n", wine_dbgstr_rect(&rc)); } } ret = 0; out: lpParms->rc = rc; return ret; }