831{
845
846 static const struct
847 {
850 }
851 format_tests[] =
852 {
853 {&TIME_FORMAT_MEDIA_TIME,
S_OK},
854 {&TIME_FORMAT_SAMPLE,
S_OK},
855
861 };
862
863 IBaseFilter_FindPin(
filter,
L"output", &pin);
864 IPin_QueryInterface(pin, &IID_IMediaSeeking, (void **)&seeking);
865
866 hr = IMediaSeeking_GetCapabilities(seeking, &caps);
871
873 hr = IMediaSeeking_CheckCapabilities(seeking, &caps);
876
878 hr = IMediaSeeking_CheckCapabilities(seeking, &caps);
881
883 hr = IMediaSeeking_CheckCapabilities(seeking, &caps);
885 ok(!caps,
"Got caps %#lx.\n", caps);
886
887 caps = 0;
888 hr = IMediaSeeking_CheckCapabilities(seeking, &caps);
890 ok(!caps,
"Got caps %#lx.\n", caps);
891
893 {
894 hr = IMediaSeeking_IsFormatSupported(seeking, format_tests[
i].
guid);
896 hr, wine_dbgstr_guid(format_tests[i].guid));
897 }
898
899 hr = IMediaSeeking_QueryPreferredFormat(seeking, &format);
900 ok(hr == S_OK, "Got hr %#lx.\n", hr);
901 ok(IsEqualGUID(&format, &TIME_FORMAT_MEDIA_TIME), "Got format %s.\n", wine_dbgstr_guid(&format));
902
903 hr = IMediaSeeking_GetTimeFormat(seeking, &format);
904 ok(hr == S_OK, "Got hr %#lx.\n", hr);
905 ok(IsEqualGUID(&format, &TIME_FORMAT_MEDIA_TIME), "Got format %s.\n", wine_dbgstr_guid(&format));
906
907 hr = IMediaSeeking_IsUsingTimeFormat(seeking, &TIME_FORMAT_MEDIA_TIME);
908 ok(hr == S_OK, "Got hr %#lx.\n", hr);
909 hr = IMediaSeeking_IsUsingTimeFormat(seeking, &TIME_FORMAT_SAMPLE);
910 ok(hr == S_FALSE, "Got hr %#lx.\n", hr);
911
912 hr = IMediaSeeking_SetTimeFormat(seeking, &TIME_FORMAT_FRAME);
913 ok(hr == E_INVALIDARG, "Got hr %#lx.\n", hr);
914 hr = IMediaSeeking_SetTimeFormat(seeking, &TIME_FORMAT_SAMPLE);
915 todo_wine ok(hr == S_OK, "Got hr %#lx.\n", hr);
916
917 hr = IMediaSeeking_GetTimeFormat(seeking, &format);
918 ok(hr == S_OK, "Got hr %#lx.\n", hr);
919 todo_wine ok(IsEqualGUID(&format, &TIME_FORMAT_SAMPLE), "Got format %s.\n", wine_dbgstr_guid(&format));
920
921 hr = IMediaSeeking_IsUsingTimeFormat(seeking, &TIME_FORMAT_MEDIA_TIME);
922 todo_wine ok(hr == S_FALSE, "Got hr %#lx.\n", hr);
923 hr = IMediaSeeking_IsUsingTimeFormat(seeking, &TIME_FORMAT_SAMPLE);
924 todo_wine ok(hr == S_OK, "Got hr %#lx.\n", hr);
925
926 hr = IMediaSeeking_SetTimeFormat(seeking, &TIME_FORMAT_MEDIA_TIME);
927 ok(hr == S_OK, "Got hr %#lx.\n", hr);
928
929 duration = 0xdeadbeef;
930 hr = IMediaSeeking_GetDuration(seeking, &duration);
931 ok(hr == S_OK, "Got hr %#lx.\n", hr);
932 ok(duration == 1000000, "Got duration %I64d.\n", duration);
933
934 stop = current = 0xdeadbeef;
935 hr = IMediaSeeking_GetStopPosition(seeking, &stop);
936 ok(hr == S_OK, "Got hr %#lx.\n", hr);
937 ok(stop == duration, "Expected time %s, got %s.\n",
938 wine_dbgstr_longlong(duration), wine_dbgstr_longlong(stop));
939 hr = IMediaSeeking_GetCurrentPosition(seeking, ¤t);
940 ok(hr == S_OK, "Got hr %#lx.\n", hr);
941 ok(!current, "Got time %s.\n", wine_dbgstr_longlong(current));
942 stop = current = 0xdeadbeef;
943 hr = IMediaSeeking_GetPositions(seeking, ¤t, &stop);
944 ok(hr == S_OK, "Got hr %#lx.\n", hr);
945 ok(!current, "Got time %s.\n", wine_dbgstr_longlong(current));
946 ok(stop == duration, "Expected time %s, got %s.\n",
947 wine_dbgstr_longlong(duration), wine_dbgstr_longlong(stop));
948
949 time = 0xdeadbeef;
950 hr = IMediaSeeking_ConvertTimeFormat(seeking, &time, &TIME_FORMAT_MEDIA_TIME, 0x123456789a, NULL);
951 ok(hr == S_OK, "Got hr %#lx.\n", hr);
952 ok(time == 0x123456789a, "Got time %s.\n", wine_dbgstr_longlong(time));
953 time = 0xdeadbeef;
954 hr = IMediaSeeking_ConvertTimeFormat(seeking, &time, NULL, 0x123456789a, &TIME_FORMAT_MEDIA_TIME);
955 ok(hr == S_OK, "Got hr %#lx.\n", hr);
956 ok(time == 0x123456789a, "Got time %s.\n", wine_dbgstr_longlong(time));
957 time = 0xdeadbeef;
958 hr = IMediaSeeking_ConvertTimeFormat(seeking, &time, NULL, 441, &TIME_FORMAT_SAMPLE);
959 todo_wine ok(hr == S_OK, "Got hr %#lx.\n", hr);
960 todo_wine ok(time == 100000, "Got time %s.\n", wine_dbgstr_longlong(time));
961
962 earliest = latest = 0xdeadbeef;
963 hr = IMediaSeeking_GetAvailable(seeking, &earliest, &latest);
964 ok(hr == S_OK, "Got hr %#lx.\n", hr);
965 ok(!earliest, "Got time %s.\n", wine_dbgstr_longlong(earliest));
966 ok(latest == duration, "Expected time %s, got %s.\n",
967 wine_dbgstr_longlong(duration), wine_dbgstr_longlong(latest));
968
969 rate = 0;
970 hr = IMediaSeeking_GetRate(seeking, &rate);
971 ok(hr == S_OK, "Got hr %#lx.\n", hr);
972 ok(rate == 1.0, "Got rate %.16e.\n", rate);
973
974 hr = IMediaSeeking_SetRate(seeking, 200.0);
975 todo_wine ok(hr == S_OK, "Got hr %#lx.\n", hr);
976 rate = 0;
977 hr = IMediaSeeking_GetRate(seeking, &rate);
978 ok(hr == S_OK, "Got hr %#lx.\n", hr);
979 todo_wine ok(rate == 200.0, "Got rate %.16e.\n", rate);
980
981 hr = IMediaSeeking_SetRate(seeking, -1.0);
982 todo_wine ok(hr == E_INVALIDARG, "Got hr %#lx.\n", hr);
983
984 hr = IMediaSeeking_GetPreroll(seeking, &time);
985 todo_wine ok(hr == E_NOTIMPL, "Got hr %#lx.\n", hr);
986
987 current = 200 * 10000;
988 stop = 400 * 10000;
989 hr = IMediaSeeking_SetPositions(seeking, ¤t, AM_SEEKING_AbsolutePositioning,
990 &stop, AM_SEEKING_AbsolutePositioning);
991 ok(hr == S_OK, "Got hr %#lx.\n", hr);
992 ok(current == 200 * 10000, "Got time %s.\n", wine_dbgstr_longlong(current));
993 ok(stop == 400 * 10000, "Got time %s.\n", wine_dbgstr_longlong(stop));
994
995 stop = current = 0xdeadbeef;
996 hr = IMediaSeeking_GetPositions(seeking, ¤t, &stop);
997 ok(hr == S_OK, "Got hr %#lx.\n", hr);
998 ok(current == 200 * 10000, "Got time %s.\n", wine_dbgstr_longlong(current));
999 ok(stop == 400 * 10000, "Got time %s.\n", wine_dbgstr_longlong(stop));
1000
1001 current = 200 * 10000;
1002 stop = 400 * 10000;
1003 hr = IMediaSeeking_SetPositions(seeking, ¤t, AM_SEEKING_AbsolutePositioning | AM_SEEKING_ReturnTime,
1004 &stop, AM_SEEKING_AbsolutePositioning | AM_SEEKING_ReturnTime);
1005 ok(hr == S_OK, "Got hr %#lx.\n", hr);
1006 ok(current == 200 * 10000, "Got time %s.\n", wine_dbgstr_longlong(current));
1007 ok(stop == 400 * 10000, "Got time %s.\n", wine_dbgstr_longlong(stop));
1008
1009 current = 100 * 10000;
1010 stop = 200 * 10000;
1011 hr = IMediaSeeking_SetPositions(seeking, ¤t, AM_SEEKING_AbsolutePositioning | AM_SEEKING_ReturnTime,
1012 &stop, AM_SEEKING_AbsolutePositioning | AM_SEEKING_ReturnTime);
1013 ok(hr == S_OK, "Got hr %#lx.\n", hr);
1014 ok(current == 100 * 10000, "Got time %s.\n", wine_dbgstr_longlong(current));
1015 ok(stop == 200 * 10000, "Got time %s.\n", wine_dbgstr_longlong(stop));
1016
1017 current = 50 * 10000;
1018 hr = IMediaSeeking_SetPositions(seeking, ¤t, AM_SEEKING_AbsolutePositioning,
1019 NULL, AM_SEEKING_NoPositioning);
1020 ok(hr == S_OK, "Got hr %#lx.\n", hr);
1021
1022 stop = current = 0xdeadbeef;
1023 hr = IMediaSeeking_GetPositions(seeking, ¤t, &stop);
1024 ok(hr == S_OK, "Got hr %#lx.\n", hr);
1025 ok(current == 50 * 10000, "Got time %s.\n", wine_dbgstr_longlong(current));
1026 ok(stop == 200 * 10000, "Got time %s.\n", wine_dbgstr_longlong(stop));
1027
1028 IMediaSeeking_Release(seeking);
1029 IPin_Release(pin);
1030 IFilterGraph2_Release(graph);
1031 ref = IBaseFilter_Release(filter);
1032 ok(!ref, "Got outstanding refcount %ld.\n", ref);
1033 ret = DeleteFileW(filename);
1034 ok(ret, "Failed to delete file, error %lu.\n", GetLastError());
1035}
@ AM_SEEKING_CanGetDuration
@ AM_SEEKING_CanGetCurrentPos
@ AM_SEEKING_CanSeekBackwards
@ AM_SEEKING_CanDoSegments
@ AM_SEEKING_CanSeekForwards
@ AM_SEEKING_CanSeekAbsolute
@ AM_SEEKING_CanGetStopPos
GLsizei GLenum const GLvoid GLsizei GLenum GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLint GLint GLint GLshort GLshort GLshort GLubyte GLubyte GLubyte GLuint GLuint GLuint GLushort GLushort GLushort GLbyte GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLfloat GLint GLint GLint GLint GLshort GLshort GLshort GLshort GLubyte GLubyte GLubyte GLubyte GLuint GLuint GLuint GLuint GLushort GLushort GLushort GLushort GLboolean const GLdouble const GLfloat const GLint const GLshort const GLbyte const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLdouble const GLfloat const GLfloat const GLint const GLint const GLshort const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort GLenum GLenum GLenum GLfloat GLenum GLint GLenum GLenum GLenum GLfloat GLenum GLenum GLint GLenum GLfloat GLenum GLint GLint GLushort GLenum GLenum GLfloat GLenum GLenum GLint GLfloat const GLubyte GLenum GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLint GLint GLsizei GLsizei GLint GLenum GLenum const GLvoid GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLenum const GLdouble GLenum GLenum const GLfloat GLenum GLenum const GLint GLsizei GLuint GLfloat GLuint GLbitfield GLfloat GLint GLuint GLboolean GLenum GLfloat GLenum GLbitfield GLenum GLfloat GLfloat GLint GLint const GLfloat GLenum GLfloat GLfloat GLint GLint GLfloat GLfloat GLint GLint const GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat const GLdouble const GLfloat const GLdouble const GLfloat GLint i
#define todo_wine_if(is_todo)
struct task_struct * current
static const GUID testguid