From: Giovanni Mascellani gmascellani@codeweavers.com
Signed-off-by: Nikolay Sivov nsivov@codeweavers.com --- dlls/mfmediaengine/main.c | 496 ++++++++++++++++++++++++++++++-------- 1 file changed, 398 insertions(+), 98 deletions(-)
diff --git a/dlls/mfmediaengine/main.c b/dlls/mfmediaengine/main.c index b098844a7fa..3fb8e2b9433 100644 --- a/dlls/mfmediaengine/main.c +++ b/dlls/mfmediaengine/main.c @@ -113,7 +113,7 @@ struct rect
struct media_engine { - IMFMediaEngine IMFMediaEngine_iface; + IMFMediaEngineEx IMFMediaEngineEx_iface; IMFGetService IMFGetService_iface; IMFAsyncCallback session_events; IMFAsyncCallback load_handler; @@ -718,9 +718,9 @@ static void media_engine_set_flag(struct media_engine *engine, unsigned int mask engine->flags &= ~mask; }
-static inline struct media_engine *impl_from_IMFMediaEngine(IMFMediaEngine *iface) +static inline struct media_engine *impl_from_IMFMediaEngineEx(IMFMediaEngineEx *iface) { - return CONTAINING_RECORD(iface, struct media_engine, IMFMediaEngine_iface); + return CONTAINING_RECORD(iface, struct media_engine, IMFMediaEngineEx_iface); }
static inline struct media_engine *impl_from_IMFGetService(IMFGetService *iface) @@ -826,13 +826,13 @@ static HRESULT WINAPI media_engine_callback_QueryInterface(IMFAsyncCallback *ifa static ULONG WINAPI media_engine_session_events_AddRef(IMFAsyncCallback *iface) { struct media_engine *engine = impl_from_session_events_IMFAsyncCallback(iface); - return IMFMediaEngine_AddRef(&engine->IMFMediaEngine_iface); + return IMFMediaEngineEx_AddRef(&engine->IMFMediaEngineEx_iface); }
static ULONG WINAPI media_engine_session_events_Release(IMFAsyncCallback *iface) { struct media_engine *engine = impl_from_session_events_IMFAsyncCallback(iface); - return IMFMediaEngine_Release(&engine->IMFMediaEngine_iface); + return IMFMediaEngineEx_Release(&engine->IMFMediaEngineEx_iface); }
static HRESULT WINAPI media_engine_callback_GetParameters(IMFAsyncCallback *iface, DWORD *flags, DWORD *queue) @@ -948,13 +948,13 @@ static const IMFAsyncCallbackVtbl media_engine_session_events_vtbl = static ULONG WINAPI media_engine_load_handler_AddRef(IMFAsyncCallback *iface) { struct media_engine *engine = impl_from_load_handler_IMFAsyncCallback(iface); - return IMFMediaEngine_AddRef(&engine->IMFMediaEngine_iface); + return IMFMediaEngineEx_AddRef(&engine->IMFMediaEngineEx_iface); }
static ULONG WINAPI media_engine_load_handler_Release(IMFAsyncCallback *iface) { struct media_engine *engine = impl_from_load_handler_IMFAsyncCallback(iface); - return IMFMediaEngine_Release(&engine->IMFMediaEngine_iface); + return IMFMediaEngineEx_Release(&engine->IMFMediaEngineEx_iface); }
static HRESULT media_engine_create_source_node(IMFMediaSource *source, IMFPresentationDescriptor *pd, IMFStreamDescriptor *sd, @@ -1258,13 +1258,14 @@ static const IMFAsyncCallbackVtbl media_engine_load_handler_vtbl = media_engine_load_handler_Invoke, };
-static HRESULT WINAPI media_engine_QueryInterface(IMFMediaEngine *iface, REFIID riid, void **obj) +static HRESULT WINAPI media_engine_QueryInterface(IMFMediaEngineEx *iface, REFIID riid, void **obj) { - struct media_engine *engine = impl_from_IMFMediaEngine(iface); + struct media_engine *engine = impl_from_IMFMediaEngineEx(iface);
TRACE("%p, %s, %p.\n", iface, debugstr_guid(riid), obj);
- if (IsEqualIID(riid, &IID_IMFMediaEngine) || + if (IsEqualIID(riid, &IID_IMFMediaEngineEx) || + IsEqualIID(riid, &IID_IMFMediaEngine) || IsEqualIID(riid, &IID_IUnknown)) { *obj = iface; @@ -1284,9 +1285,9 @@ static HRESULT WINAPI media_engine_QueryInterface(IMFMediaEngine *iface, REFIID return S_OK; }
-static ULONG WINAPI media_engine_AddRef(IMFMediaEngine *iface) +static ULONG WINAPI media_engine_AddRef(IMFMediaEngineEx *iface) { - struct media_engine *engine = impl_from_IMFMediaEngine(iface); + struct media_engine *engine = impl_from_IMFMediaEngineEx(iface); ULONG refcount = InterlockedIncrement(&engine->refcount);
TRACE("%p, refcount %u.\n", iface, refcount); @@ -1318,9 +1319,9 @@ static void free_media_engine(struct media_engine *engine) free(engine); }
-static ULONG WINAPI media_engine_Release(IMFMediaEngine *iface) +static ULONG WINAPI media_engine_Release(IMFMediaEngineEx *iface) { - struct media_engine *engine = impl_from_IMFMediaEngine(iface); + struct media_engine *engine = impl_from_IMFMediaEngineEx(iface); ULONG refcount = InterlockedDecrement(&engine->refcount);
TRACE("%p, refcount %u.\n", iface, refcount); @@ -1331,9 +1332,9 @@ static ULONG WINAPI media_engine_Release(IMFMediaEngine *iface) return refcount; }
-static HRESULT WINAPI media_engine_GetError(IMFMediaEngine *iface, IMFMediaError **error) +static HRESULT WINAPI media_engine_GetError(IMFMediaEngineEx *iface, IMFMediaError **error) { - struct media_engine *engine = impl_from_IMFMediaEngine(iface); + struct media_engine *engine = impl_from_IMFMediaEngineEx(iface); HRESULT hr = S_OK;
TRACE("%p, %p.\n", iface, error); @@ -1356,9 +1357,9 @@ static HRESULT WINAPI media_engine_GetError(IMFMediaEngine *iface, IMFMediaError return hr; }
-static HRESULT WINAPI media_engine_SetErrorCode(IMFMediaEngine *iface, MF_MEDIA_ENGINE_ERR code) +static HRESULT WINAPI media_engine_SetErrorCode(IMFMediaEngineEx *iface, MF_MEDIA_ENGINE_ERR code) { - struct media_engine *engine = impl_from_IMFMediaEngine(iface); + struct media_engine *engine = impl_from_IMFMediaEngineEx(iface); HRESULT hr = S_OK;
TRACE("%p, %u.\n", iface, code); @@ -1376,16 +1377,16 @@ static HRESULT WINAPI media_engine_SetErrorCode(IMFMediaEngine *iface, MF_MEDIA_ return hr; }
-static HRESULT WINAPI media_engine_SetSourceElements(IMFMediaEngine *iface, IMFMediaEngineSrcElements *elements) +static HRESULT WINAPI media_engine_SetSourceElements(IMFMediaEngineEx *iface, IMFMediaEngineSrcElements *elements) { FIXME("(%p, %p): stub.\n", iface, elements);
return E_NOTIMPL; }
-static HRESULT WINAPI media_engine_SetSource(IMFMediaEngine *iface, BSTR url) +static HRESULT WINAPI media_engine_SetSource(IMFMediaEngineEx *iface, BSTR url) { - struct media_engine *engine = impl_from_IMFMediaEngine(iface); + struct media_engine *engine = impl_from_IMFMediaEngineEx(iface); HRESULT hr = S_OK;
TRACE("%p, %s.\n", iface, debugstr_w(url)); @@ -1433,9 +1434,9 @@ static HRESULT WINAPI media_engine_SetSource(IMFMediaEngine *iface, BSTR url) return hr; }
-static HRESULT WINAPI media_engine_GetCurrentSource(IMFMediaEngine *iface, BSTR *url) +static HRESULT WINAPI media_engine_GetCurrentSource(IMFMediaEngineEx *iface, BSTR *url) { - struct media_engine *engine = impl_from_IMFMediaEngine(iface); + struct media_engine *engine = impl_from_IMFMediaEngineEx(iface); HRESULT hr = S_OK;
TRACE("%p, %p.\n", iface, url); @@ -1453,18 +1454,18 @@ static HRESULT WINAPI media_engine_GetCurrentSource(IMFMediaEngine *iface, BSTR return hr; }
-static USHORT WINAPI media_engine_GetNetworkState(IMFMediaEngine *iface) +static USHORT WINAPI media_engine_GetNetworkState(IMFMediaEngineEx *iface) { - struct media_engine *engine = impl_from_IMFMediaEngine(iface); + struct media_engine *engine = impl_from_IMFMediaEngineEx(iface);
TRACE("%p.\n", iface);
return engine->network_state; }
-static MF_MEDIA_ENGINE_PRELOAD WINAPI media_engine_GetPreload(IMFMediaEngine *iface) +static MF_MEDIA_ENGINE_PRELOAD WINAPI media_engine_GetPreload(IMFMediaEngineEx *iface) { - struct media_engine *engine = impl_from_IMFMediaEngine(iface); + struct media_engine *engine = impl_from_IMFMediaEngineEx(iface); MF_MEDIA_ENGINE_PRELOAD preload;
TRACE("%p.\n", iface); @@ -1476,9 +1477,9 @@ static MF_MEDIA_ENGINE_PRELOAD WINAPI media_engine_GetPreload(IMFMediaEngine *if return preload; }
-static HRESULT WINAPI media_engine_SetPreload(IMFMediaEngine *iface, MF_MEDIA_ENGINE_PRELOAD preload) +static HRESULT WINAPI media_engine_SetPreload(IMFMediaEngineEx *iface, MF_MEDIA_ENGINE_PRELOAD preload) { - struct media_engine *engine = impl_from_IMFMediaEngine(iface); + struct media_engine *engine = impl_from_IMFMediaEngineEx(iface);
TRACE("%p, %d.\n", iface, preload);
@@ -1489,9 +1490,9 @@ static HRESULT WINAPI media_engine_SetPreload(IMFMediaEngine *iface, MF_MEDIA_EN return S_OK; }
-static HRESULT WINAPI media_engine_GetBuffered(IMFMediaEngine *iface, IMFMediaTimeRange **range) +static HRESULT WINAPI media_engine_GetBuffered(IMFMediaEngineEx *iface, IMFMediaTimeRange **range) { - struct media_engine *engine = impl_from_IMFMediaEngine(iface); + struct media_engine *engine = impl_from_IMFMediaEngineEx(iface); HRESULT hr;
TRACE("%p, %p.\n", iface, range); @@ -1507,23 +1508,23 @@ static HRESULT WINAPI media_engine_GetBuffered(IMFMediaEngine *iface, IMFMediaTi return hr; }
-static HRESULT WINAPI media_engine_Load(IMFMediaEngine *iface) +static HRESULT WINAPI media_engine_Load(IMFMediaEngineEx *iface) { FIXME("(%p): stub.\n", iface);
return E_NOTIMPL; }
-static HRESULT WINAPI media_engine_CanPlayType(IMFMediaEngine *iface, BSTR type, MF_MEDIA_ENGINE_CANPLAY *answer) +static HRESULT WINAPI media_engine_CanPlayType(IMFMediaEngineEx *iface, BSTR type, MF_MEDIA_ENGINE_CANPLAY *answer) { FIXME("(%p, %s, %p): stub.\n", iface, debugstr_w(type), answer);
return E_NOTIMPL; }
-static USHORT WINAPI media_engine_GetReadyState(IMFMediaEngine *iface) +static USHORT WINAPI media_engine_GetReadyState(IMFMediaEngineEx *iface) { - struct media_engine *engine = impl_from_IMFMediaEngine(iface); + struct media_engine *engine = impl_from_IMFMediaEngineEx(iface); unsigned short state;
TRACE("%p.\n", iface); @@ -1535,16 +1536,16 @@ static USHORT WINAPI media_engine_GetReadyState(IMFMediaEngine *iface) return state; }
-static BOOL WINAPI media_engine_IsSeeking(IMFMediaEngine *iface) +static BOOL WINAPI media_engine_IsSeeking(IMFMediaEngineEx *iface) { FIXME("(%p): stub.\n", iface);
return FALSE; }
-static double WINAPI media_engine_GetCurrentTime(IMFMediaEngine *iface) +static double WINAPI media_engine_GetCurrentTime(IMFMediaEngineEx *iface) { - struct media_engine *engine = impl_from_IMFMediaEngine(iface); + struct media_engine *engine = impl_from_IMFMediaEngineEx(iface); double ret = 0.0; MFTIME clocktime;
@@ -1564,23 +1565,23 @@ static double WINAPI media_engine_GetCurrentTime(IMFMediaEngine *iface) return ret; }
-static HRESULT WINAPI media_engine_SetCurrentTime(IMFMediaEngine *iface, double time) +static HRESULT WINAPI media_engine_SetCurrentTime(IMFMediaEngineEx *iface, double time) { FIXME("(%p, %f): stub.\n", iface, time);
return E_NOTIMPL; }
-static double WINAPI media_engine_GetStartTime(IMFMediaEngine *iface) +static double WINAPI media_engine_GetStartTime(IMFMediaEngineEx *iface) { FIXME("(%p): stub.\n", iface);
return 0.0; }
-static double WINAPI media_engine_GetDuration(IMFMediaEngine *iface) +static double WINAPI media_engine_GetDuration(IMFMediaEngineEx *iface) { - struct media_engine *engine = impl_from_IMFMediaEngine(iface); + struct media_engine *engine = impl_from_IMFMediaEngineEx(iface); double value;
TRACE("%p.\n", iface); @@ -1592,9 +1593,9 @@ static double WINAPI media_engine_GetDuration(IMFMediaEngine *iface) return value; }
-static BOOL WINAPI media_engine_IsPaused(IMFMediaEngine *iface) +static BOOL WINAPI media_engine_IsPaused(IMFMediaEngineEx *iface) { - struct media_engine *engine = impl_from_IMFMediaEngine(iface); + struct media_engine *engine = impl_from_IMFMediaEngineEx(iface); BOOL value;
TRACE("%p.\n", iface); @@ -1606,9 +1607,9 @@ static BOOL WINAPI media_engine_IsPaused(IMFMediaEngine *iface) return value; }
-static double WINAPI media_engine_GetDefaultPlaybackRate(IMFMediaEngine *iface) +static double WINAPI media_engine_GetDefaultPlaybackRate(IMFMediaEngineEx *iface) { - struct media_engine *engine = impl_from_IMFMediaEngine(iface); + struct media_engine *engine = impl_from_IMFMediaEngineEx(iface); double rate;
TRACE("%p.\n", iface); @@ -1620,9 +1621,9 @@ static double WINAPI media_engine_GetDefaultPlaybackRate(IMFMediaEngine *iface) return rate; }
-static HRESULT WINAPI media_engine_SetDefaultPlaybackRate(IMFMediaEngine *iface, double rate) +static HRESULT WINAPI media_engine_SetDefaultPlaybackRate(IMFMediaEngineEx *iface, double rate) { - struct media_engine *engine = impl_from_IMFMediaEngine(iface); + struct media_engine *engine = impl_from_IMFMediaEngineEx(iface); HRESULT hr = S_OK;
TRACE("%p, %f.\n", iface, rate); @@ -1640,9 +1641,9 @@ static HRESULT WINAPI media_engine_SetDefaultPlaybackRate(IMFMediaEngine *iface, return hr; }
-static double WINAPI media_engine_GetPlaybackRate(IMFMediaEngine *iface) +static double WINAPI media_engine_GetPlaybackRate(IMFMediaEngineEx *iface) { - struct media_engine *engine = impl_from_IMFMediaEngine(iface); + struct media_engine *engine = impl_from_IMFMediaEngineEx(iface); double rate;
TRACE("%p.\n", iface); @@ -1654,9 +1655,9 @@ static double WINAPI media_engine_GetPlaybackRate(IMFMediaEngine *iface) return rate; }
-static HRESULT WINAPI media_engine_SetPlaybackRate(IMFMediaEngine *iface, double rate) +static HRESULT WINAPI media_engine_SetPlaybackRate(IMFMediaEngineEx *iface, double rate) { - struct media_engine *engine = impl_from_IMFMediaEngine(iface); + struct media_engine *engine = impl_from_IMFMediaEngineEx(iface); HRESULT hr = S_OK;
TRACE("%p, %f.\n", iface, rate); @@ -1674,23 +1675,23 @@ static HRESULT WINAPI media_engine_SetPlaybackRate(IMFMediaEngine *iface, double return hr; }
-static HRESULT WINAPI media_engine_GetPlayed(IMFMediaEngine *iface, IMFMediaTimeRange **played) +static HRESULT WINAPI media_engine_GetPlayed(IMFMediaEngineEx *iface, IMFMediaTimeRange **played) { FIXME("(%p, %p): stub.\n", iface, played);
return E_NOTIMPL; }
-static HRESULT WINAPI media_engine_GetSeekable(IMFMediaEngine *iface, IMFMediaTimeRange **seekable) +static HRESULT WINAPI media_engine_GetSeekable(IMFMediaEngineEx *iface, IMFMediaTimeRange **seekable) { FIXME("(%p, %p): stub.\n", iface, seekable);
return E_NOTIMPL; }
-static BOOL WINAPI media_engine_IsEnded(IMFMediaEngine *iface) +static BOOL WINAPI media_engine_IsEnded(IMFMediaEngineEx *iface) { - struct media_engine *engine = impl_from_IMFMediaEngine(iface); + struct media_engine *engine = impl_from_IMFMediaEngineEx(iface); BOOL value;
TRACE("%p.\n", iface); @@ -1702,9 +1703,9 @@ static BOOL WINAPI media_engine_IsEnded(IMFMediaEngine *iface) return value; }
-static BOOL WINAPI media_engine_GetAutoPlay(IMFMediaEngine *iface) +static BOOL WINAPI media_engine_GetAutoPlay(IMFMediaEngineEx *iface) { - struct media_engine *engine = impl_from_IMFMediaEngine(iface); + struct media_engine *engine = impl_from_IMFMediaEngineEx(iface); BOOL value;
TRACE("%p.\n", iface); @@ -1716,9 +1717,9 @@ static BOOL WINAPI media_engine_GetAutoPlay(IMFMediaEngine *iface) return value; }
-static HRESULT WINAPI media_engine_SetAutoPlay(IMFMediaEngine *iface, BOOL autoplay) +static HRESULT WINAPI media_engine_SetAutoPlay(IMFMediaEngineEx *iface, BOOL autoplay) { - struct media_engine *engine = impl_from_IMFMediaEngine(iface); + struct media_engine *engine = impl_from_IMFMediaEngineEx(iface);
FIXME("(%p, %d): stub.\n", iface, autoplay);
@@ -1729,9 +1730,9 @@ static HRESULT WINAPI media_engine_SetAutoPlay(IMFMediaEngine *iface, BOOL autop return S_OK; }
-static BOOL WINAPI media_engine_GetLoop(IMFMediaEngine *iface) +static BOOL WINAPI media_engine_GetLoop(IMFMediaEngineEx *iface) { - struct media_engine *engine = impl_from_IMFMediaEngine(iface); + struct media_engine *engine = impl_from_IMFMediaEngineEx(iface); BOOL value;
TRACE("%p.\n", iface); @@ -1743,9 +1744,9 @@ static BOOL WINAPI media_engine_GetLoop(IMFMediaEngine *iface) return value; }
-static HRESULT WINAPI media_engine_SetLoop(IMFMediaEngine *iface, BOOL loop) +static HRESULT WINAPI media_engine_SetLoop(IMFMediaEngineEx *iface, BOOL loop) { - struct media_engine *engine = impl_from_IMFMediaEngine(iface); + struct media_engine *engine = impl_from_IMFMediaEngineEx(iface);
FIXME("(%p, %d): stub.\n", iface, loop);
@@ -1756,9 +1757,9 @@ static HRESULT WINAPI media_engine_SetLoop(IMFMediaEngine *iface, BOOL loop) return S_OK; }
-static HRESULT WINAPI media_engine_Play(IMFMediaEngine *iface) +static HRESULT WINAPI media_engine_Play(IMFMediaEngineEx *iface) { - struct media_engine *engine = impl_from_IMFMediaEngine(iface); + struct media_engine *engine = impl_from_IMFMediaEngineEx(iface);
TRACE("%p.\n", iface);
@@ -1786,9 +1787,9 @@ static HRESULT WINAPI media_engine_Play(IMFMediaEngine *iface) return S_OK; }
-static HRESULT WINAPI media_engine_Pause(IMFMediaEngine *iface) +static HRESULT WINAPI media_engine_Pause(IMFMediaEngineEx *iface) { - struct media_engine *engine = impl_from_IMFMediaEngine(iface); + struct media_engine *engine = impl_from_IMFMediaEngineEx(iface);
TRACE("%p.\n", iface);
@@ -1810,9 +1811,9 @@ static HRESULT WINAPI media_engine_Pause(IMFMediaEngine *iface) return S_OK; }
-static BOOL WINAPI media_engine_GetMuted(IMFMediaEngine *iface) +static BOOL WINAPI media_engine_GetMuted(IMFMediaEngineEx *iface) { - struct media_engine *engine = impl_from_IMFMediaEngine(iface); + struct media_engine *engine = impl_from_IMFMediaEngineEx(iface); BOOL ret;
TRACE("%p.\n", iface); @@ -1824,9 +1825,9 @@ static BOOL WINAPI media_engine_GetMuted(IMFMediaEngine *iface) return ret; }
-static HRESULT WINAPI media_engine_SetMuted(IMFMediaEngine *iface, BOOL muted) +static HRESULT WINAPI media_engine_SetMuted(IMFMediaEngineEx *iface, BOOL muted) { - struct media_engine *engine = impl_from_IMFMediaEngine(iface); + struct media_engine *engine = impl_from_IMFMediaEngineEx(iface); HRESULT hr = S_OK;
TRACE("%p, %d.\n", iface, muted); @@ -1844,9 +1845,9 @@ static HRESULT WINAPI media_engine_SetMuted(IMFMediaEngine *iface, BOOL muted) return hr; }
-static double WINAPI media_engine_GetVolume(IMFMediaEngine *iface) +static double WINAPI media_engine_GetVolume(IMFMediaEngineEx *iface) { - struct media_engine *engine = impl_from_IMFMediaEngine(iface); + struct media_engine *engine = impl_from_IMFMediaEngineEx(iface); double volume;
TRACE("%p.\n", iface); @@ -1858,9 +1859,9 @@ static double WINAPI media_engine_GetVolume(IMFMediaEngine *iface) return volume; }
-static HRESULT WINAPI media_engine_SetVolume(IMFMediaEngine *iface, double volume) +static HRESULT WINAPI media_engine_SetVolume(IMFMediaEngineEx *iface, double volume) { - struct media_engine *engine = impl_from_IMFMediaEngine(iface); + struct media_engine *engine = impl_from_IMFMediaEngineEx(iface); HRESULT hr = S_OK;
TRACE("%p, %f.\n", iface, volume); @@ -1878,9 +1879,9 @@ static HRESULT WINAPI media_engine_SetVolume(IMFMediaEngine *iface, double volum return hr; }
-static BOOL WINAPI media_engine_HasVideo(IMFMediaEngine *iface) +static BOOL WINAPI media_engine_HasVideo(IMFMediaEngineEx *iface) { - struct media_engine *engine = impl_from_IMFMediaEngine(iface); + struct media_engine *engine = impl_from_IMFMediaEngineEx(iface); BOOL value;
TRACE("%p.\n", iface); @@ -1892,9 +1893,9 @@ static BOOL WINAPI media_engine_HasVideo(IMFMediaEngine *iface) return value; }
-static BOOL WINAPI media_engine_HasAudio(IMFMediaEngine *iface) +static BOOL WINAPI media_engine_HasAudio(IMFMediaEngineEx *iface) { - struct media_engine *engine = impl_from_IMFMediaEngine(iface); + struct media_engine *engine = impl_from_IMFMediaEngineEx(iface); BOOL value;
TRACE("%p.\n", iface); @@ -1906,9 +1907,9 @@ static BOOL WINAPI media_engine_HasAudio(IMFMediaEngine *iface) return value; }
-static HRESULT WINAPI media_engine_GetNativeVideoSize(IMFMediaEngine *iface, DWORD *cx, DWORD *cy) +static HRESULT WINAPI media_engine_GetNativeVideoSize(IMFMediaEngineEx *iface, DWORD *cx, DWORD *cy) { - struct media_engine *engine = impl_from_IMFMediaEngine(iface); + struct media_engine *engine = impl_from_IMFMediaEngineEx(iface); HRESULT hr = S_OK;
TRACE("%p, %p, %p.\n", iface, cx, cy); @@ -1933,9 +1934,9 @@ static HRESULT WINAPI media_engine_GetNativeVideoSize(IMFMediaEngine *iface, DWO return hr; }
-static HRESULT WINAPI media_engine_GetVideoAspectRatio(IMFMediaEngine *iface, DWORD *cx, DWORD *cy) +static HRESULT WINAPI media_engine_GetVideoAspectRatio(IMFMediaEngineEx *iface, DWORD *cx, DWORD *cy) { - struct media_engine *engine = impl_from_IMFMediaEngine(iface); + struct media_engine *engine = impl_from_IMFMediaEngineEx(iface); HRESULT hr = S_OK;
TRACE("%p, %p, %p.\n", iface, cx, cy); @@ -1960,9 +1961,9 @@ static HRESULT WINAPI media_engine_GetVideoAspectRatio(IMFMediaEngine *iface, DW return hr; }
-static HRESULT WINAPI media_engine_Shutdown(IMFMediaEngine *iface) +static HRESULT WINAPI media_engine_Shutdown(IMFMediaEngineEx *iface) { - struct media_engine *engine = impl_from_IMFMediaEngine(iface); + struct media_engine *engine = impl_from_IMFMediaEngineEx(iface); HRESULT hr = S_OK;
FIXME("(%p): stub.\n", iface); @@ -2202,10 +2203,10 @@ done: return hr; }
-static HRESULT WINAPI media_engine_TransferVideoFrame(IMFMediaEngine *iface, IUnknown *surface, +static HRESULT WINAPI media_engine_TransferVideoFrame(IMFMediaEngineEx *iface, IUnknown *surface, const MFVideoNormalizedRect *src_rect, const RECT *dst_rect, const MFARGB *color) { - struct media_engine *engine = impl_from_IMFMediaEngine(iface); + struct media_engine *engine = impl_from_IMFMediaEngineEx(iface); ID3D11Texture2D *texture; HRESULT hr = E_NOINTERFACE;
@@ -2230,9 +2231,9 @@ static HRESULT WINAPI media_engine_TransferVideoFrame(IMFMediaEngine *iface, IUn return hr; }
-static HRESULT WINAPI media_engine_OnVideoStreamTick(IMFMediaEngine *iface, LONGLONG *pts) +static HRESULT WINAPI media_engine_OnVideoStreamTick(IMFMediaEngineEx *iface, LONGLONG *pts) { - struct media_engine *engine = impl_from_IMFMediaEngine(iface); + struct media_engine *engine = impl_from_IMFMediaEngineEx(iface); HRESULT hr;
TRACE("%p, %p.\n", iface, pts); @@ -2254,7 +2255,269 @@ static HRESULT WINAPI media_engine_OnVideoStreamTick(IMFMediaEngine *iface, LONG return hr; }
-static const IMFMediaEngineVtbl media_engine_vtbl = +static HRESULT WINAPI media_engine_SetSourceFromByteStream(IMFMediaEngineEx *iface, IMFByteStream *bytestream, BSTR url) +{ + FIXME("%p, %p, %s stub.\n", iface, bytestream, debugstr_w(url)); + + return E_NOTIMPL; +} + +static HRESULT WINAPI media_engine_GetStatistics(IMFMediaEngineEx *iface, MF_MEDIA_ENGINE_STATISTIC stat_id, PROPVARIANT *stat) +{ + FIXME("%p, %x, %p stub.\n", iface, stat_id, stat); + + return E_NOTIMPL; +} + +static HRESULT WINAPI media_engine_UpdateVideoStream(IMFMediaEngineEx *iface, const MFVideoNormalizedRect *src, + const RECT *dst, const MFARGB *border_color) +{ + FIXME("%p, %p, %p, %p stub.\n", iface, src, dst, border_color); + + return E_NOTIMPL; +} + +static double WINAPI media_engine_GetBalance(IMFMediaEngineEx *iface) +{ + FIXME("%p stub.\n", iface); + + return 0.0; +} + +static HRESULT WINAPI media_engine_SetBalance(IMFMediaEngineEx *iface, double balance) +{ + FIXME("%p, %f stub.\n", iface, balance); + + return E_NOTIMPL; +} + +static BOOL WINAPI media_engine_IsPlaybackRateSupported(IMFMediaEngineEx *iface, double rate) +{ + FIXME("%p, %f stub.\n", iface, rate); + + return FALSE; +} + +static HRESULT WINAPI media_engine_FrameStep(IMFMediaEngineEx *iface, BOOL forward) +{ + FIXME("%p, %d stub.\n", iface, forward); + + return E_NOTIMPL; +} + +static HRESULT WINAPI media_engine_GetResourceCharacteristics(IMFMediaEngineEx *iface, DWORD *flags) +{ + FIXME("%p, %p stub.\n", iface, flags); + + return E_NOTIMPL; +} + +static HRESULT WINAPI media_engine_GetPresentationAttribute(IMFMediaEngineEx *iface, REFGUID attribute, + PROPVARIANT *value) +{ + FIXME("%p, %s, %p stub.\n", iface, debugstr_guid(attribute), value); + + return E_NOTIMPL; +} + +static HRESULT WINAPI media_engine_GetNumberOfStreams(IMFMediaEngineEx *iface, DWORD *stream_count) +{ + FIXME("%p, %p stub.\n", iface, stream_count); + + return E_NOTIMPL; +} + +static HRESULT WINAPI media_engine_GetStreamAttribute(IMFMediaEngineEx *iface, DWORD stream_index, REFGUID attribute, + PROPVARIANT *value) +{ + FIXME("%p, %d, %s, %p stub.\n", iface, stream_index, debugstr_guid(attribute), value); + + return E_NOTIMPL; +} + +static HRESULT WINAPI media_engine_GetStreamSelection(IMFMediaEngineEx *iface, DWORD stream_index, BOOL *enabled) +{ + FIXME("%p, %d, %p stub.\n", iface, stream_index, enabled); + + return E_NOTIMPL; +} + +static HRESULT WINAPI media_engine_SetStreamSelection(IMFMediaEngineEx *iface, DWORD stream_index, BOOL enabled) +{ + FIXME("%p, %d, %d stub.\n", iface, stream_index, enabled); + + return E_NOTIMPL; +} + +static HRESULT WINAPI media_engine_ApplyStreamSelections(IMFMediaEngineEx *iface) +{ + FIXME("%p stub.\n", iface); + + return E_NOTIMPL; +} + +static HRESULT WINAPI media_engine_IsProtected(IMFMediaEngineEx *iface, BOOL *protected) +{ + FIXME("%p, %p stub.\n", iface, protected); + + return E_NOTIMPL; +} + +static HRESULT WINAPI media_engine_InsertVideoEffect(IMFMediaEngineEx *iface, IUnknown *effect, BOOL is_optional) +{ + FIXME("%p, %p, %d stub.\n", iface, effect, is_optional); + + return E_NOTIMPL; +} + +static HRESULT WINAPI media_engine_InsertAudioEffect(IMFMediaEngineEx *iface, IUnknown *effect, BOOL is_optional) +{ + FIXME("%p, %p, %d stub.\n", iface, effect, is_optional); + + return E_NOTIMPL; +} + +static HRESULT WINAPI media_engine_RemoveAllEffects(IMFMediaEngineEx *iface) +{ + FIXME("%p stub.\n", iface); + + return E_NOTIMPL; +} + +static HRESULT WINAPI media_engine_SetTimelineMarkerTimer(IMFMediaEngineEx *iface, double timeout) +{ + FIXME("%p, %f stub.\n", iface, timeout); + + return E_NOTIMPL; +} + +static HRESULT WINAPI media_engine_GetTimelineMarkerTimer(IMFMediaEngineEx *iface, double *timeout) +{ + FIXME("%p, %p stub.\n", iface, timeout); + + return E_NOTIMPL; +} + +static HRESULT WINAPI media_engine_CancelTimelineMarkerTimer(IMFMediaEngineEx *iface) +{ + FIXME("%p stub.\n", iface); + + return E_NOTIMPL; +} + +static BOOL WINAPI media_engine_IsStereo3D(IMFMediaEngineEx *iface) +{ + FIXME("%p stub.\n", iface); + + return FALSE; +} + +static HRESULT WINAPI media_engine_GetStereo3DFramePackingMode(IMFMediaEngineEx *iface, MF_MEDIA_ENGINE_S3D_PACKING_MODE *mode) +{ + FIXME("%p, %p stub.\n", iface, mode); + + return E_NOTIMPL; +} + +static HRESULT WINAPI media_engine_SetStereo3DFramePackingMode(IMFMediaEngineEx *iface, MF_MEDIA_ENGINE_S3D_PACKING_MODE mode) +{ + FIXME("%p, %#x stub.\n", iface, mode); + + return E_NOTIMPL; +} + +static HRESULT WINAPI media_engine_GetStereo3DRenderMode(IMFMediaEngineEx *iface, MF3DVideoOutputType *output_type) +{ + FIXME("%p, %p stub.\n", iface, output_type); + + return E_NOTIMPL; +} + +static HRESULT WINAPI media_engine_SetStereo3DRenderMode(IMFMediaEngineEx *iface, MF3DVideoOutputType output_type) +{ + FIXME("%p, %#x stub.\n", iface, output_type); + + return E_NOTIMPL; +} + +static HRESULT WINAPI media_engine_EnableWindowlessSwapchainMode(IMFMediaEngineEx *iface, BOOL enable) +{ + FIXME("%p, %d stub.\n", iface, enable); + + return E_NOTIMPL; +} + +static HRESULT WINAPI media_engine_GetVideoSwapchainHandle(IMFMediaEngineEx *iface, HANDLE *swapchain) +{ + FIXME("%p, %p stub.\n", iface, swapchain); + + return E_NOTIMPL; +} + +static HRESULT WINAPI media_engine_EnableHorizontalMirrorMode(IMFMediaEngineEx *iface, BOOL enable) +{ + FIXME("%p, %d stub.\n", iface, enable); + + return E_NOTIMPL; +} + +static HRESULT WINAPI media_engine_GetAudioStreamCategory(IMFMediaEngineEx *iface, UINT32 *category) +{ + FIXME("%p, %p stub.\n", iface, category); + + return E_NOTIMPL; +} + +static HRESULT WINAPI media_engine_SetAudioStreamCategory(IMFMediaEngineEx *iface, UINT32 category) +{ + FIXME("%p, %u stub.\n", iface, category); + + return E_NOTIMPL; +} + +static HRESULT WINAPI media_engine_GetAudioEndpointRole(IMFMediaEngineEx *iface, UINT32 *role) +{ + FIXME("%p, %p stub.\n", iface, role); + + return E_NOTIMPL; +} + +static HRESULT WINAPI media_engine_SetAudioEndpointRole(IMFMediaEngineEx *iface, UINT32 role) +{ + FIXME("%p, %u stub.\n", iface, role); + + return E_NOTIMPL; +} + +static HRESULT WINAPI media_engine_GetRealTimeMode(IMFMediaEngineEx *iface, BOOL *enabled) +{ + FIXME("%p, %p stub.\n", iface, enabled); + + return E_NOTIMPL; +} + +static HRESULT WINAPI media_engine_SetRealTimeMode(IMFMediaEngineEx *iface, BOOL enable) +{ + FIXME("%p, %d stub.\n", iface, enable); + + return E_NOTIMPL; +} + +static HRESULT WINAPI media_engine_SetCurrentTimeEx(IMFMediaEngineEx *iface, double seektime, MF_MEDIA_ENGINE_SEEK_MODE mode) +{ + FIXME("%p, %f, %#x stub.\n", iface, seektime, mode); + + return E_NOTIMPL; +} + +static HRESULT WINAPI media_engine_EnableTimeUpdateTimer(IMFMediaEngineEx *iface, BOOL enable) +{ + FIXME("%p, %d stub.\n", iface, enable); + + return E_NOTIMPL; +} + +static const IMFMediaEngineExVtbl media_engine_vtbl = { media_engine_QueryInterface, media_engine_AddRef, @@ -2301,24 +2564,61 @@ static const IMFMediaEngineVtbl media_engine_vtbl = media_engine_Shutdown, media_engine_TransferVideoFrame, media_engine_OnVideoStreamTick, + media_engine_SetSourceFromByteStream, + media_engine_GetStatistics, + media_engine_UpdateVideoStream, + media_engine_GetBalance, + media_engine_SetBalance, + media_engine_IsPlaybackRateSupported, + media_engine_FrameStep, + media_engine_GetResourceCharacteristics, + media_engine_GetPresentationAttribute, + media_engine_GetNumberOfStreams, + media_engine_GetStreamAttribute, + media_engine_GetStreamSelection, + media_engine_SetStreamSelection, + media_engine_ApplyStreamSelections, + media_engine_IsProtected, + media_engine_InsertVideoEffect, + media_engine_InsertAudioEffect, + media_engine_RemoveAllEffects, + media_engine_SetTimelineMarkerTimer, + media_engine_GetTimelineMarkerTimer, + media_engine_CancelTimelineMarkerTimer, + media_engine_IsStereo3D, + media_engine_GetStereo3DFramePackingMode, + media_engine_SetStereo3DFramePackingMode, + media_engine_GetStereo3DRenderMode, + media_engine_SetStereo3DRenderMode, + media_engine_EnableWindowlessSwapchainMode, + media_engine_GetVideoSwapchainHandle, + media_engine_EnableHorizontalMirrorMode, + media_engine_GetAudioStreamCategory, + media_engine_SetAudioStreamCategory, + media_engine_GetAudioEndpointRole, + media_engine_SetAudioEndpointRole, + media_engine_GetRealTimeMode, + media_engine_SetRealTimeMode, + media_engine_SetCurrentTimeEx, + media_engine_EnableTimeUpdateTimer, };
static HRESULT WINAPI media_engine_gs_QueryInterface(IMFGetService *iface, REFIID riid, void **obj) { struct media_engine *engine = impl_from_IMFGetService(iface); - return IMFMediaEngine_QueryInterface(&engine->IMFMediaEngine_iface, riid, obj); + return IMFMediaEngineEx_QueryInterface(&engine->IMFMediaEngineEx_iface, riid, obj); }
static ULONG WINAPI media_engine_gs_AddRef(IMFGetService *iface) { struct media_engine *engine = impl_from_IMFGetService(iface); - return IMFMediaEngine_AddRef(&engine->IMFMediaEngine_iface); + return IMFMediaEngineEx_AddRef(&engine->IMFMediaEngineEx_iface); }
static ULONG WINAPI media_engine_gs_Release(IMFGetService *iface) { struct media_engine *engine = impl_from_IMFGetService(iface); - return IMFMediaEngine_Release(&engine->IMFMediaEngine_iface); + return IMFMediaEngineEx_Release(&engine->IMFMediaEngineEx_iface); }
static HRESULT WINAPI media_engine_gs_GetService(IMFGetService *iface, REFGUID service, @@ -2355,13 +2655,13 @@ static HRESULT WINAPI media_engine_grabber_callback_QueryInterface(IMFSampleGrab static ULONG WINAPI media_engine_grabber_callback_AddRef(IMFSampleGrabberSinkCallback *iface) { struct media_engine *engine = impl_from_IMFSampleGrabberSinkCallback(iface); - return IMFMediaEngine_AddRef(&engine->IMFMediaEngine_iface); + return IMFMediaEngineEx_AddRef(&engine->IMFMediaEngineEx_iface); }
static ULONG WINAPI media_engine_grabber_callback_Release(IMFSampleGrabberSinkCallback *iface) { struct media_engine *engine = impl_from_IMFSampleGrabberSinkCallback(iface); - return IMFMediaEngine_Release(&engine->IMFMediaEngine_iface); + return IMFMediaEngineEx_Release(&engine->IMFMediaEngineEx_iface); }
static HRESULT WINAPI media_engine_grabber_callback_OnClockStart(IMFSampleGrabberSinkCallback *iface, @@ -2490,7 +2790,7 @@ static HRESULT init_media_engine(DWORD flags, IMFAttributes *attributes, struct IMFClock *clock; HRESULT hr;
- engine->IMFMediaEngine_iface.lpVtbl = &media_engine_vtbl; + engine->IMFMediaEngineEx_iface.lpVtbl = &media_engine_vtbl; engine->IMFGetService_iface.lpVtbl = &media_engine_get_service_vtbl; engine->session_events.lpVtbl = &media_engine_session_events_vtbl; engine->load_handler.lpVtbl = &media_engine_load_handler_vtbl; @@ -2572,7 +2872,7 @@ static HRESULT WINAPI media_engine_factory_CreateInstance(IMFMediaEngineClassFac return hr; }
- *engine = &object->IMFMediaEngine_iface; + *engine = (IMFMediaEngine *)&object->IMFMediaEngineEx_iface;
return S_OK; }