Signed-off-by: Gijs Vermeulen gijsvrm@gmail.com --- dlls/qdvd/navigator.c | 453 ++++++++++++++++++++++++++++++++++++ dlls/qdvd/tests/navigator.c | 2 +- 2 files changed, 454 insertions(+), 1 deletion(-)
diff --git a/dlls/qdvd/navigator.c b/dlls/qdvd/navigator.c index 1e121dde60..f5697e0804 100644 --- a/dlls/qdvd/navigator.c +++ b/dlls/qdvd/navigator.c @@ -26,6 +26,7 @@ WINE_DEFAULT_DEBUG_CHANNEL(qdvd); struct navigator { struct strmbase_filter filter; + IDvdControl2 IDvdControl2_iface; };
static inline struct navigator *impl_from_strmbase_filter(struct strmbase_filter *filter) @@ -33,6 +34,19 @@ static inline struct navigator *impl_from_strmbase_filter(struct strmbase_filter return CONTAINING_RECORD(filter, struct navigator, filter); }
+static HRESULT navigator_query_interface(struct strmbase_filter *iface, REFIID iid, void **out) +{ + struct navigator *filter = impl_from_strmbase_filter(iface); + + if (IsEqualGUID(iid, &IID_IDvdControl2)) + *out = &filter->IDvdControl2_iface; + else + return E_NOINTERFACE; + + IUnknown_AddRef((IUnknown *)*out); + return S_OK; +} + static struct strmbase_pin *navigator_get_pin(struct strmbase_filter *iface, unsigned int index) { return NULL; @@ -48,10 +62,448 @@ static void navigator_destroy(struct strmbase_filter *iface)
static const struct strmbase_filter_ops filter_ops = { + .filter_query_interface = navigator_query_interface, .filter_get_pin = navigator_get_pin, .filter_destroy = navigator_destroy, };
+static struct navigator *impl_from_IDvdControl2(IDvdControl2 *iface) +{ + return CONTAINING_RECORD(iface, struct navigator, IDvdControl2_iface); +} + +static HRESULT WINAPI dvd_control_QueryInterface(IDvdControl2 *iface, REFIID iid, void **out) +{ + struct navigator *filter = impl_from_IDvdControl2(iface); + return IUnknown_QueryInterface(filter->filter.outer_unk, iid, out); +} + +static ULONG WINAPI dvd_control_AddRef(IDvdControl2 *iface) +{ + struct navigator *filter = impl_from_IDvdControl2(iface); + return IUnknown_AddRef(filter->filter.outer_unk); +} + +static ULONG WINAPI dvd_control_Release(IDvdControl2 *iface) +{ + struct navigator *filter = impl_from_IDvdControl2(iface); + return IUnknown_Release(filter->filter.outer_unk); +} + +static HRESULT WINAPI dvd_control_PlayTitle(IDvdControl2 *iface, ULONG title, DWORD flags, IDvdCmd **cmd) +{ + struct navigator *filter = impl_from_IDvdControl2(iface); + + FIXME("filter %p, title %u, flags %#x, cmd %p.\n", filter, title, flags, cmd); + + return E_NOTIMPL; +} + +static HRESULT WINAPI dvd_control_PlayChapterInTitle(IDvdControl2 *iface, ULONG title, ULONG chapter, + DWORD flags, IDvdCmd **cmd) +{ + struct navigator *filter = impl_from_IDvdControl2(iface); + + FIXME("filter %p, title %u, chapter %u, flags %#x, cmd %p.\n", filter, title, chapter, flags, cmd); + + return E_NOTIMPL; +} + +static HRESULT WINAPI dvd_control_PlayTimeInTitle(IDvdControl2 *iface, ULONG title, DVD_HMSF_TIMECODE *time, + DWORD flags, IDvdCmd **cmd) +{ + struct navigator *filter = impl_from_IDvdControl2(iface); + + FIXME("filter %p, title %u, time %p, flags %#x, cmd %p.\n", filter, title, time, flags, cmd); + + return E_NOTIMPL; +} + +static HRESULT WINAPI dvd_control_Stop(IDvdControl2 *iface) +{ + struct navigator *filter = impl_from_IDvdControl2(iface); + + FIXME("filter %p.\n", filter); + + return E_NOTIMPL; +} + +static HRESULT WINAPI dvd_control_ReturnFromSubmenu(IDvdControl2 *iface, DWORD flags, IDvdCmd **cmd) +{ + struct navigator *filter = impl_from_IDvdControl2(iface); + + FIXME("filter %p, flags %#x, cmd %p.\n", filter, flags, cmd); + + return E_NOTIMPL; +} + +static HRESULT WINAPI dvd_control_PlayAtTime(IDvdControl2 *iface, DVD_HMSF_TIMECODE *time, DWORD flags, IDvdCmd **cmd) +{ + struct navigator *filter = impl_from_IDvdControl2(iface); + + FIXME("filter %p, time %p, flags %#x, cmd %p.\n", filter, time, flags, cmd); + + return E_NOTIMPL; +} + +static HRESULT WINAPI dvd_control_PlayChapter(IDvdControl2 *iface, ULONG chapter, DWORD flags, IDvdCmd **cmd) +{ + struct navigator *filter = impl_from_IDvdControl2(iface); + + FIXME("filter %p, chapter %u, flags %#x, cmd %p.\n", filter, chapter, flags, cmd); + + return E_NOTIMPL; +} + +static HRESULT WINAPI dvd_control_PlayPrevChapter(IDvdControl2 *iface, DWORD flags, IDvdCmd **cmd) +{ + struct navigator *filter = impl_from_IDvdControl2(iface); + + FIXME("filter %p, flags %#x, cmd %p.\n", filter, flags, cmd); + + return E_NOTIMPL; +} + +static HRESULT WINAPI dvd_control_ReplayChapter(IDvdControl2 *iface, DWORD flags, IDvdCmd **cmd) +{ + struct navigator *filter = impl_from_IDvdControl2(iface); + + FIXME("filter %p, flags %#x, cmd %p.\n", filter, flags, cmd); + + return E_NOTIMPL; +} + +static HRESULT WINAPI dvd_control_PlayNextChapter(IDvdControl2 *iface, DWORD flags, IDvdCmd **cmd) +{ + struct navigator *filter = impl_from_IDvdControl2(iface); + + FIXME("filter %p, flags %#x, cmd %p.\n", filter, flags, cmd); + + return E_NOTIMPL; +} + +static HRESULT WINAPI dvd_control_PlayForwards(IDvdControl2 *iface, double speed, DWORD flags, IDvdCmd **cmd) +{ + struct navigator *filter = impl_from_IDvdControl2(iface); + + FIXME("filter %p, speed %f, flags %#x, cmd %p.\n", filter, speed, flags, cmd); + + return E_NOTIMPL; +} + +static HRESULT WINAPI dvd_control_PlayBackwards(IDvdControl2 *iface, double speed, DWORD flags, IDvdCmd **cmd) +{ + struct navigator *filter = impl_from_IDvdControl2(iface); + + FIXME("filter %p, speed %f, flags %#x, cmd %p.\n", filter, speed, flags, cmd); + + return E_NOTIMPL; +} + +static HRESULT WINAPI dvd_control_ShowMenu(IDvdControl2 *iface, DVD_MENU_ID id, DWORD flags, IDvdCmd **cmd) +{ + struct navigator *filter = impl_from_IDvdControl2(iface); + + FIXME("filter %p, id %d, flags %#x, cmd %p.\n", filter, id, flags, cmd); + + return E_NOTIMPL; +} + +static HRESULT WINAPI dvd_control_Resume(IDvdControl2 *iface, DWORD flags, IDvdCmd **cmd) +{ + struct navigator *filter = impl_from_IDvdControl2(iface); + + FIXME("filter %p, flags %#x, cmd %p.\n", filter, flags, cmd); + + return E_NOTIMPL; +} + +static HRESULT WINAPI dvd_control_SelectRelativeButton(IDvdControl2 *iface, DVD_RELATIVE_BUTTON button) +{ + struct navigator *filter = impl_from_IDvdControl2(iface); + + FIXME("filter %p, button %d.\n", filter, button); + + return E_NOTIMPL; +} + +static HRESULT WINAPI dvd_control_ActivateButton(IDvdControl2 *iface) +{ + struct navigator *filter = impl_from_IDvdControl2(iface); + + FIXME("filter %p.\n", filter); + + return E_NOTIMPL; +} + +static HRESULT WINAPI dvd_control_SelectButton(IDvdControl2 *iface, ULONG button) +{ + struct navigator *filter = impl_from_IDvdControl2(iface); + + FIXME("filter %p, button %u.\n", filter, button); + + return E_NOTIMPL; +} + +static HRESULT WINAPI dvd_control_SelectAndActivateButton(IDvdControl2 *iface, ULONG button) +{ + struct navigator *filter = impl_from_IDvdControl2(iface); + + FIXME("filter %p, button %u.\n", filter, button); + + return E_NOTIMPL; +} + +static HRESULT WINAPI dvd_control_StillOff(IDvdControl2 *iface) +{ + struct navigator *filter = impl_from_IDvdControl2(iface); + + FIXME("filter %p.\n", filter); + + return E_NOTIMPL; +} + +static HRESULT WINAPI dvd_control_Pause(IDvdControl2 *iface, BOOL enable) +{ + struct navigator *filter = impl_from_IDvdControl2(iface); + + FIXME("filter %p, enable %d.\n", filter, enable); + + return E_NOTIMPL; +} + +static HRESULT WINAPI dvd_control_SelectAudioStream(IDvdControl2 *iface, ULONG stream, DWORD flags, IDvdCmd **cmd) +{ + struct navigator *filter = impl_from_IDvdControl2(iface); + + FIXME("filter %p, stream %u, flags %#x, cmd %p.\n", filter, stream, flags, cmd); + + return E_NOTIMPL; +} + +static HRESULT WINAPI dvd_control_SelectSubpictureStream(IDvdControl2 *iface, ULONG stream, DWORD flags, IDvdCmd **cmd) +{ + struct navigator *filter = impl_from_IDvdControl2(iface); + + FIXME("filter %p, stream %u, flags %#x, cmd %p.\n", filter, stream, flags, cmd); + + return E_NOTIMPL; +} + +static HRESULT WINAPI dvd_control_SetSubpictureState(IDvdControl2 *iface, BOOL enable, DWORD flags, IDvdCmd **cmd) +{ + struct navigator *filter = impl_from_IDvdControl2(iface); + + FIXME("filter %p, enable %d, flags %#x, cmd %p.\n", filter, enable, flags, cmd); + + return E_NOTIMPL; +} + +static HRESULT WINAPI dvd_control_SelectAngle(IDvdControl2 *iface, ULONG angle, DWORD flags, IDvdCmd **cmd) +{ + struct navigator *filter = impl_from_IDvdControl2(iface); + + FIXME("filter %p, angle %u, flags %#x, cmd %p.\n", filter, angle, flags, cmd); + + return E_NOTIMPL; +} + +static HRESULT WINAPI dvd_control_SelectParentalLevel(IDvdControl2 *iface, ULONG level) +{ + struct navigator *filter = impl_from_IDvdControl2(iface); + + FIXME("filter %p, level %u.\n", filter, level); + + return E_NOTIMPL; +} + +static HRESULT WINAPI dvd_control_SelectParentalCountry(IDvdControl2 *iface, BYTE country[2]) +{ + struct navigator *filter = impl_from_IDvdControl2(iface); + + FIXME("filter %p, country %p.\n", filter, country); + + return E_NOTIMPL; +} + +static HRESULT WINAPI dvd_control_SelectKaraokeAudioPresentationMode(IDvdControl2 *iface, ULONG mode) +{ + struct navigator *filter = impl_from_IDvdControl2(iface); + + FIXME("filter %p, mode %u.\n", filter, mode); + + return E_NOTIMPL; +} + +static HRESULT WINAPI dvd_control_SelectVideoModePreference(IDvdControl2 *iface, ULONG mode) +{ + struct navigator *filter = impl_from_IDvdControl2(iface); + + FIXME("filter %p, mode %u.\n", filter, mode); + + return E_NOTIMPL; +} + +static HRESULT WINAPI dvd_control_SetDVDDirectory(IDvdControl2 *iface, const WCHAR *path) +{ + struct navigator *filter = impl_from_IDvdControl2(iface); + + FIXME("filter %p, path %s.\n", filter, debugstr_w(path)); + + return E_NOTIMPL; +} + +static HRESULT WINAPI dvd_control_ActivateAtPosition(IDvdControl2 *iface, POINT point) +{ + struct navigator *filter = impl_from_IDvdControl2(iface); + + FIXME("filter %p, point %s.\n", filter, wine_dbgstr_point(&point)); + + return E_NOTIMPL; +} + +static HRESULT WINAPI dvd_control_SelectAtPosition(IDvdControl2 *iface, POINT point) +{ + struct navigator *filter = impl_from_IDvdControl2(iface); + + FIXME("filter %p, point %s.\n", filter, wine_dbgstr_point(&point)); + + return E_NOTIMPL; +} + +static HRESULT WINAPI dvd_control_PlayChaptersAutoStop(IDvdControl2 *iface, ULONG title, ULONG chapter, ULONG count, + DWORD flags, IDvdCmd **cmd) +{ + struct navigator *filter = impl_from_IDvdControl2(iface); + + FIXME("filter %p, title %u, chapter %u, count %u, flags %#x, cmd %p.\n", filter, title, chapter, count, flags, cmd); + + return E_NOTIMPL; +} + +static HRESULT WINAPI dvd_control_AcceptParentalLevelChange(IDvdControl2 *iface, BOOL accept) +{ + struct navigator *filter = impl_from_IDvdControl2(iface); + + FIXME("filter %p, accept %d.\n", filter, accept); + + return E_NOTIMPL; +} + +static HRESULT WINAPI dvd_control_SetOption(IDvdControl2 *iface, DVD_OPTION_FLAG flag, BOOL option) +{ + struct navigator *filter = impl_from_IDvdControl2(iface); + + FIXME("filter %p, flag %d, option %d.\n", filter, flag, option); + + return E_NOTIMPL; +} + +static HRESULT WINAPI dvd_control_SetState(IDvdControl2 *iface, IDvdState *state, DWORD flags, IDvdCmd **cmd) +{ + struct navigator *filter = impl_from_IDvdControl2(iface); + + FIXME("filter %p, state %p, flags %#x, cmd %p.\n", filter, state, flags, cmd); + + return E_NOTIMPL; +} + +static HRESULT WINAPI dvd_control_PlayPeriodInTitleAutoStop(IDvdControl2 *iface, ULONG title, + DVD_HMSF_TIMECODE *start_time, DVD_HMSF_TIMECODE *end_time, DWORD flags, IDvdCmd **cmd) +{ + struct navigator *filter = impl_from_IDvdControl2(iface); + + FIXME("filter %p, title %u, start_time %p, end_time %p, flags %#x, cmd %p.\n", + filter, title, start_time, end_time, flags, cmd); + + return E_NOTIMPL; +} + +static HRESULT WINAPI dvd_control_SetGRPM(IDvdControl2 *iface, ULONG index, WORD value, DWORD flags, IDvdCmd **cmd) +{ + struct navigator *filter = impl_from_IDvdControl2(iface); + + FIXME("filter %p, index %u, value %i, flags %#x, cmd %p.\n", filter, index, value, flags, cmd); + + return E_NOTIMPL; +} + +static HRESULT WINAPI dvd_control_SelectDefaultMenuLanguage(IDvdControl2 *iface, LCID language) +{ + struct navigator *filter = impl_from_IDvdControl2(iface); + + FIXME("filter %p, language %#x.\n", filter, language); + + return E_NOTIMPL; +} + +static HRESULT WINAPI dvd_control_SelectDefaultAudioLanguage(IDvdControl2 *iface, LCID language, + DVD_AUDIO_LANG_EXT extension) +{ + struct navigator *filter = impl_from_IDvdControl2(iface); + + FIXME("filter %p, language %#x, extension %d.\n", filter, language, extension); + + return E_NOTIMPL; +} + +static HRESULT WINAPI dvd_control_SelectDefaultSubpictureLanguage(IDvdControl2 *iface, LCID language, + DVD_SUBPICTURE_LANG_EXT extension) +{ + struct navigator *filter = impl_from_IDvdControl2(iface); + + FIXME("filter %p, language %#x, extension %d.\n", filter, language, extension); + + return E_NOTIMPL; +} + +static const struct IDvdControl2Vtbl dvd_control_vtbl = +{ + dvd_control_QueryInterface, + dvd_control_AddRef, + dvd_control_Release, + dvd_control_PlayTitle, + dvd_control_PlayChapterInTitle, + dvd_control_PlayTimeInTitle, + dvd_control_Stop, + dvd_control_ReturnFromSubmenu, + dvd_control_PlayAtTime, + dvd_control_PlayChapter, + dvd_control_PlayPrevChapter, + dvd_control_ReplayChapter, + dvd_control_PlayNextChapter, + dvd_control_PlayForwards, + dvd_control_PlayBackwards, + dvd_control_ShowMenu, + dvd_control_Resume, + dvd_control_SelectRelativeButton, + dvd_control_ActivateButton, + dvd_control_SelectButton, + dvd_control_SelectAndActivateButton, + dvd_control_StillOff, + dvd_control_Pause, + dvd_control_SelectAudioStream, + dvd_control_SelectSubpictureStream, + dvd_control_SetSubpictureState, + dvd_control_SelectAngle, + dvd_control_SelectParentalLevel, + dvd_control_SelectParentalCountry, + dvd_control_SelectKaraokeAudioPresentationMode, + dvd_control_SelectVideoModePreference, + dvd_control_SetDVDDirectory, + dvd_control_ActivateAtPosition, + dvd_control_SelectAtPosition, + dvd_control_PlayChaptersAutoStop, + dvd_control_AcceptParentalLevelChange, + dvd_control_SetOption, + dvd_control_SetState, + dvd_control_PlayPeriodInTitleAutoStop, + dvd_control_SetGRPM, + dvd_control_SelectDefaultMenuLanguage, + dvd_control_SelectDefaultAudioLanguage, + dvd_control_SelectDefaultSubpictureLanguage, +}; + HRESULT navigator_create(IUnknown *outer, IUnknown **out) { struct navigator *object; @@ -60,6 +512,7 @@ HRESULT navigator_create(IUnknown *outer, IUnknown **out) return E_OUTOFMEMORY;
strmbase_filter_init(&object->filter, outer, &CLSID_DVDNavigator, &filter_ops); + object->IDvdControl2_iface.lpVtbl = &dvd_control_vtbl;
TRACE("Created DVD Navigator filter %p.\n", object); *out = &object->filter.IUnknown_inner; diff --git a/dlls/qdvd/tests/navigator.c b/dlls/qdvd/tests/navigator.c index f01e428b4e..db2ba392dc 100644 --- a/dlls/qdvd/tests/navigator.c +++ b/dlls/qdvd/tests/navigator.c @@ -60,7 +60,7 @@ static void test_interfaces(void)
check_interface(filter, &IID_IBaseFilter, TRUE); todo_wine check_interface(filter, &IID_IDvdControl, TRUE); - todo_wine check_interface(filter, &IID_IDvdControl2, TRUE); + check_interface(filter, &IID_IDvdControl2, TRUE); todo_wine check_interface(filter, &IID_IDvdInfo, TRUE); todo_wine check_interface(filter, &IID_IDvdInfo2, TRUE); check_interface(filter, &IID_IMediaFilter, TRUE);