static HRESULT WINAPI IMediaSeeking_fnGetTimeFormat(IMediaSeeking* iface,GUID* pidFormat) { CFilterGraph_THIS(iface,mediaseeking); HRESULT hr = E_NOTIMPL; HRESULT hrFilter; DWORD n; TRACE("(%p)->()\n",This); EnterCriticalSection( &This->m_csFilters ); for ( n = 0; n < This->m_cActiveFilters; n++ ) { if ( This->m_pActiveFilters[n].pSeeking != NULL ) { hrFilter = IMediaSeeking_GetTimeFormat( This->m_pActiveFilters[n].pSeeking, pidFormat ); if ( hr == E_NOTIMPL ) { hr = hrFilter; } else if ( hrFilter != E_NOTIMPL ) { if ( SUCCEEDED(hr) ) hr = hrFilter; } } } LeaveCriticalSection( &This->m_csFilters ); return hr; }
/*************************************************************************** * MCIQTZ_mciPlay [internal] */ static DWORD MCIQTZ_mciPlay(UINT wDevID, DWORD dwFlags, LPMCI_PLAY_PARMS lpParms) { WINE_MCIQTZ* wma; HRESULT hr; REFERENCE_TIME time1 = 0, time2 = 0; GUID format; DWORD pos1; 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; ResetEvent(wma->stop_event); if (dwFlags & MCI_NOTIFY) { HANDLE old; old = InterlockedExchangePointer(&wma->callback, HWND_32(LOWORD(lpParms->dwCallback))); if (old) mciDriverNotify(old, wma->notify_devid, MCI_NOTIFY_ABORTED); } IMediaSeeking_GetTimeFormat(wma->seek, &format); if (dwFlags & MCI_FROM) { if (IsEqualGUID(&format, &TIME_FORMAT_MEDIA_TIME)) time1 = lpParms->dwFrom * 10000; else time1 = lpParms->dwFrom; pos1 = AM_SEEKING_AbsolutePositioning; } else pos1 = AM_SEEKING_NoPositioning; if (dwFlags & MCI_TO) { if (IsEqualGUID(&format, &TIME_FORMAT_MEDIA_TIME)) time2 = lpParms->dwTo * 10000; else time2 = lpParms->dwTo; } else IMediaSeeking_GetDuration(wma->seek, &time2); IMediaSeeking_SetPositions(wma->seek, &time1, pos1, &time2, AM_SEEKING_AbsolutePositioning); hr = IMediaControl_Run(wma->pmctrl); if (FAILED(hr)) { TRACE("Cannot run filtergraph (hr = %x)\n", hr); return MCIERR_INTERNAL; } IVideoWindow_put_Visible(wma->vidwin, OATRUE); wma->thread = CreateThread(NULL, 0, MCIQTZ_notifyThread, wma, 0, NULL); if (!wma->thread) { TRACE("Can't create thread\n"); return MCIERR_INTERNAL; } return 0; }
static HRESULT WINAPI MediaSeekingPassThru_GetTimeFormat(IMediaSeeking * iface, GUID * pFormat) { PassThruImpl *This = impl_from_IMediaSeeking(iface); IMediaSeeking *seek; HRESULT hr; TRACE("(%p/%p)->(%p)\n", iface, This, pFormat); hr = get_connected(This, &IID_IMediaSeeking, (LPVOID*)&seek); if (SUCCEEDED(hr)) { hr = IMediaSeeking_GetTimeFormat(seek, pFormat); IMediaSeeking_Release(seek); } else return E_NOTIMPL; return hr; }
/*************************************************************************** * MCIQTZ_mciPlay [internal] */ static DWORD MCIQTZ_mciPlay(UINT wDevID, DWORD dwFlags, LPMCI_PLAY_PARMS lpParms) { WINE_MCIQTZ* wma; HRESULT hr; REFERENCE_TIME time1 = 0, time2 = 0; GUID format; DWORD pos1; 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; IMediaSeeking_GetTimeFormat(wma->seek, &format); if (dwFlags & MCI_FROM) { if (IsEqualGUID(&format, &TIME_FORMAT_MEDIA_TIME)) time1 = lpParms->dwFrom * 10000; else time1 = lpParms->dwFrom; pos1 = AM_SEEKING_AbsolutePositioning; } else pos1 = AM_SEEKING_NoPositioning; if (dwFlags & MCI_TO) { if (IsEqualGUID(&format, &TIME_FORMAT_MEDIA_TIME)) time2 = lpParms->dwTo * 10000; else time2 = lpParms->dwTo; } else IMediaSeeking_GetDuration(wma->seek, &time2); IMediaSeeking_SetPositions(wma->seek, &time1, pos1, &time2, AM_SEEKING_AbsolutePositioning); hr = IMediaControl_Run(wma->pmctrl); if (FAILED(hr)) { TRACE("Cannot run filtergraph (hr = %x)\n", hr); return MCIERR_INTERNAL; } IVideoWindow_put_Visible(wma->vidwin, OATRUE); if (dwFlags & MCI_NOTIFY) mciDriverNotify(HWND_32(LOWORD(lpParms->dwCallback)), wDevID, MCI_NOTIFY_SUCCESSFUL); return 0; }