Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
wine-winehq
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
wine
wine-winehq
Commits
ba8023e9
Commit
ba8023e9
authored
May 18, 2019
by
Zebediah Figura
Committed by
Alexandre Julliard
May 20, 2019
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
qcap/tests: Add some tests for IMediaSeeking on the AVI mux filter.
Signed-off-by:
Zebediah Figura
<
z.figura12@gmail.com
>
Signed-off-by:
Alexandre Julliard
<
julliard@winehq.org
>
parent
9c2dbb55
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
137 additions
and
0 deletions
+137
-0
avimux.c
dlls/qcap/tests/avimux.c
+137
-0
No files found.
dlls/qcap/tests/avimux.c
View file @
ba8023e9
...
@@ -23,6 +23,8 @@
...
@@ -23,6 +23,8 @@
#include "vfw.h"
#include "vfw.h"
#include "wine/test.h"
#include "wine/test.h"
static
const
GUID
testguid
=
{
0xfacade
};
static
IBaseFilter
*
create_avi_mux
(
void
)
static
IBaseFilter
*
create_avi_mux
(
void
)
{
{
IBaseFilter
*
filter
=
NULL
;
IBaseFilter
*
filter
=
NULL
;
...
@@ -76,11 +78,146 @@ static void test_interfaces(void)
...
@@ -76,11 +78,146 @@ static void test_interfaces(void)
IBaseFilter_Release
(
filter
);
IBaseFilter_Release
(
filter
);
}
}
static
void
test_seeking
(
void
)
{
IBaseFilter
*
filter
=
create_avi_mux
();
LONGLONG
time
,
current
,
stop
;
IMediaSeeking
*
seeking
;
unsigned
int
i
;
GUID
format
;
HRESULT
hr
;
DWORD
caps
;
ULONG
ref
;
static
const
struct
{
const
GUID
*
guid
;
HRESULT
hr
;
}
format_tests
[]
=
{
{
&
TIME_FORMAT_MEDIA_TIME
,
S_OK
},
{
&
TIME_FORMAT_BYTE
,
S_OK
},
{
&
TIME_FORMAT_NONE
,
S_FALSE
},
{
&
TIME_FORMAT_FRAME
,
S_FALSE
},
{
&
TIME_FORMAT_SAMPLE
,
S_FALSE
},
{
&
TIME_FORMAT_FIELD
,
S_FALSE
},
{
&
testguid
,
S_FALSE
},
};
IBaseFilter_QueryInterface
(
filter
,
&
IID_IMediaSeeking
,
(
void
**
)
&
seeking
);
hr
=
IMediaSeeking_GetCapabilities
(
seeking
,
&
caps
);
todo_wine
ok
(
hr
==
S_OK
,
"Got hr %#x.
\n
"
,
hr
);
todo_wine
ok
(
caps
==
(
AM_SEEKING_CanGetCurrentPos
|
AM_SEEKING_CanGetDuration
),
"Got caps %#x.
\n
"
,
caps
);
caps
=
AM_SEEKING_CanGetCurrentPos
;
hr
=
IMediaSeeking_CheckCapabilities
(
seeking
,
&
caps
);
todo_wine
ok
(
hr
==
S_OK
,
"Got hr %#x.
\n
"
,
hr
);
ok
(
caps
==
AM_SEEKING_CanGetCurrentPos
,
"Got caps %#x.
\n
"
,
caps
);
caps
=
AM_SEEKING_CanDoSegments
|
AM_SEEKING_CanGetCurrentPos
;
hr
=
IMediaSeeking_CheckCapabilities
(
seeking
,
&
caps
);
todo_wine
ok
(
hr
==
S_OK
,
"Got hr %#x.
\n
"
,
hr
);
todo_wine
ok
(
caps
==
AM_SEEKING_CanGetCurrentPos
,
"Got caps %#x.
\n
"
,
caps
);
caps
=
AM_SEEKING_CanDoSegments
;
hr
=
IMediaSeeking_CheckCapabilities
(
seeking
,
&
caps
);
todo_wine
ok
(
hr
==
S_OK
,
"Got hr %#x.
\n
"
,
hr
);
todo_wine
ok
(
!
caps
,
"Got caps %#x.
\n
"
,
caps
);
for
(
i
=
0
;
i
<
ARRAY_SIZE
(
format_tests
);
++
i
)
{
hr
=
IMediaSeeking_IsFormatSupported
(
seeking
,
format_tests
[
i
].
guid
);
todo_wine
ok
(
hr
==
format_tests
[
i
].
hr
,
"Got hr %#x for format %s.
\n
"
,
hr
,
wine_dbgstr_guid
(
format_tests
[
i
].
guid
));
}
hr
=
IMediaSeeking_QueryPreferredFormat
(
seeking
,
&
format
);
todo_wine
ok
(
hr
==
S_OK
,
"Got hr %#x.
\n
"
,
hr
);
todo_wine
ok
(
IsEqualGUID
(
&
format
,
&
TIME_FORMAT_MEDIA_TIME
),
"Got format %s.
\n
"
,
wine_dbgstr_guid
(
&
format
));
hr
=
IMediaSeeking_GetTimeFormat
(
seeking
,
&
format
);
todo_wine
ok
(
hr
==
S_OK
,
"Got hr %#x.
\n
"
,
hr
);
todo_wine
ok
(
IsEqualGUID
(
&
format
,
&
TIME_FORMAT_MEDIA_TIME
),
"Got format %s.
\n
"
,
wine_dbgstr_guid
(
&
format
));
hr
=
IMediaSeeking_IsUsingTimeFormat
(
seeking
,
&
TIME_FORMAT_MEDIA_TIME
);
todo_wine
ok
(
hr
==
S_OK
,
"Got hr %#x.
\n
"
,
hr
);
hr
=
IMediaSeeking_IsUsingTimeFormat
(
seeking
,
&
TIME_FORMAT_BYTE
);
todo_wine
ok
(
hr
==
S_OK
,
"Got hr %#x.
\n
"
,
hr
);
hr
=
IMediaSeeking_SetTimeFormat
(
seeking
,
&
TIME_FORMAT_SAMPLE
);
todo_wine
ok
(
hr
==
E_INVALIDARG
,
"Got hr %#x.
\n
"
,
hr
);
hr
=
IMediaSeeking_SetTimeFormat
(
seeking
,
&
TIME_FORMAT_BYTE
);
todo_wine
ok
(
hr
==
S_OK
,
"Got hr %#x.
\n
"
,
hr
);
hr
=
IMediaSeeking_QueryPreferredFormat
(
seeking
,
&
format
);
todo_wine
ok
(
hr
==
S_OK
,
"Got hr %#x.
\n
"
,
hr
);
todo_wine
ok
(
IsEqualGUID
(
&
format
,
&
TIME_FORMAT_MEDIA_TIME
),
"Got format %s.
\n
"
,
wine_dbgstr_guid
(
&
format
));
hr
=
IMediaSeeking_GetTimeFormat
(
seeking
,
&
format
);
todo_wine
ok
(
hr
==
S_OK
,
"Got hr %#x.
\n
"
,
hr
);
todo_wine
ok
(
IsEqualGUID
(
&
format
,
&
TIME_FORMAT_BYTE
),
"Got format %s.
\n
"
,
wine_dbgstr_guid
(
&
format
));
hr
=
IMediaSeeking_IsUsingTimeFormat
(
seeking
,
&
TIME_FORMAT_MEDIA_TIME
);
todo_wine
ok
(
hr
==
S_FALSE
,
"Got hr %#x.
\n
"
,
hr
);
hr
=
IMediaSeeking_IsUsingTimeFormat
(
seeking
,
&
TIME_FORMAT_BYTE
);
todo_wine
ok
(
hr
==
S_OK
,
"Got hr %#x.
\n
"
,
hr
);
hr
=
IMediaSeeking_SetTimeFormat
(
seeking
,
&
TIME_FORMAT_MEDIA_TIME
);
todo_wine
ok
(
hr
==
S_OK
,
"Got hr %#x.
\n
"
,
hr
);
hr
=
IMediaSeeking_IsUsingTimeFormat
(
seeking
,
&
TIME_FORMAT_MEDIA_TIME
);
todo_wine
ok
(
hr
==
S_OK
,
"Got hr %#x.
\n
"
,
hr
);
hr
=
IMediaSeeking_IsUsingTimeFormat
(
seeking
,
&
TIME_FORMAT_BYTE
);
todo_wine
ok
(
hr
==
S_OK
,
"Got hr %#x.
\n
"
,
hr
);
hr
=
IMediaSeeking_ConvertTimeFormat
(
seeking
,
&
time
,
NULL
,
0x123456789a
,
NULL
);
ok
(
hr
==
E_NOTIMPL
,
"Got hr %#x.
\n
"
,
hr
);
hr
=
IMediaSeeking_ConvertTimeFormat
(
seeking
,
&
time
,
&
TIME_FORMAT_MEDIA_TIME
,
0x123456789a
,
&
TIME_FORMAT_BYTE
);
ok
(
hr
==
E_NOTIMPL
,
"Got hr %#x.
\n
"
,
hr
);
current
=
0x123
;
stop
=
0x321
;
hr
=
IMediaSeeking_SetPositions
(
seeking
,
&
current
,
AM_SEEKING_AbsolutePositioning
,
&
stop
,
AM_SEEKING_AbsolutePositioning
);
ok
(
hr
==
E_NOTIMPL
,
"Got hr %#x.
\n
"
,
hr
);
hr
=
IMediaSeeking_SetPositions
(
seeking
,
&
current
,
AM_SEEKING_NoPositioning
,
&
stop
,
AM_SEEKING_NoPositioning
);
ok
(
hr
==
E_NOTIMPL
,
"Got hr %#x.
\n
"
,
hr
);
hr
=
IMediaSeeking_GetPositions
(
seeking
,
NULL
,
NULL
);
ok
(
hr
==
E_NOTIMPL
,
"Got hr %#x.
\n
"
,
hr
);
hr
=
IMediaSeeking_GetPositions
(
seeking
,
NULL
,
&
stop
);
ok
(
hr
==
E_NOTIMPL
,
"Got hr %#x.
\n
"
,
hr
);
hr
=
IMediaSeeking_GetPositions
(
seeking
,
&
current
,
&
stop
);
ok
(
hr
==
E_NOTIMPL
,
"Got hr %#x.
\n
"
,
hr
);
hr
=
IMediaSeeking_GetPositions
(
seeking
,
&
current
,
NULL
);
ok
(
hr
==
E_NOTIMPL
,
"Got hr %#x.
\n
"
,
hr
);
hr
=
IMediaSeeking_GetDuration
(
seeking
,
&
time
);
todo_wine
ok
(
hr
==
S_OK
,
"Got hr %#x.
\n
"
,
hr
);
todo_wine
ok
(
!
time
,
"Got duration %s.
\n
"
,
wine_dbgstr_longlong
(
time
));
hr
=
IMediaSeeking_GetCurrentPosition
(
seeking
,
&
time
);
todo_wine
ok
(
hr
==
S_OK
,
"Got hr %#x.
\n
"
,
hr
);
todo_wine
ok
(
!
time
,
"Got duration %s.
\n
"
,
wine_dbgstr_longlong
(
time
));
hr
=
IMediaSeeking_GetStopPosition
(
seeking
,
&
time
);
ok
(
hr
==
E_NOTIMPL
,
"Got hr %#x.
\n
"
,
hr
);
IMediaSeeking_Release
(
seeking
);
ref
=
IBaseFilter_Release
(
filter
);
ok
(
!
ref
,
"Got unexpected refcount %d.
\n
"
,
ref
);
}
START_TEST
(
avimux
)
START_TEST
(
avimux
)
{
{
CoInitialize
(
NULL
);
CoInitialize
(
NULL
);
test_interfaces
();
test_interfaces
();
test_seeking
();
CoUninitialize
();
CoUninitialize
();
}
}
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment