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
2ca469f8
Commit
2ca469f8
authored
Apr 19, 2019
by
Nikolay Sivov
Committed by
Alexandre Julliard
Apr 19, 2019
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
mfreadwrite/tests: Add some tests for ReadSample().
Signed-off-by:
Nikolay Sivov
<
nsivov@codeweavers.com
>
Signed-off-by:
Alexandre Julliard
<
julliard@winehq.org
>
parent
fcf8cbfb
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
72 additions
and
8 deletions
+72
-8
mfplat.c
dlls/mfreadwrite/tests/mfplat.c
+59
-0
mfreadwrite.idl
include/mfreadwrite.idl
+13
-8
No files found.
dlls/mfreadwrite/tests/mfplat.c
View file @
2ca469f8
...
...
@@ -187,11 +187,14 @@ static struct async_callback *create_async_callback(void)
static
void
test_source_reader
(
void
)
{
IMFMediaType
*
mediatype
,
*
mediatype2
;
DWORD
stream_flags
,
actual_index
;
struct
async_callback
*
callback
;
IMFAttributes
*
attributes
;
IMFSourceReader
*
reader
;
IMFMediaSource
*
source
;
IMFByteStream
*
stream
;
LONGLONG
timestamp
;
IMFSample
*
sample
;
BOOL
selected
;
HRESULT
hr
;
...
...
@@ -298,6 +301,62 @@ todo_wine
ok
(
hr
==
S_OK
,
"Failed to get current media type, hr %#x.
\n
"
,
hr
);
IMFMediaType_Release
(
mediatype
);
hr
=
IMFSourceReader_ReadSample
(
reader
,
MF_SOURCE_READER_FIRST_AUDIO_STREAM
,
0
,
&
actual_index
,
&
stream_flags
,
&
timestamp
,
&
sample
);
ok
(
hr
==
S_OK
,
"Failed to get a sample, hr %#x.
\n
"
,
hr
);
ok
(
actual_index
==
0
,
"Unexpected stream index %u
\n
"
,
actual_index
);
ok
(
!
stream_flags
,
"Unexpected stream flags %#x.
\n
"
,
stream_flags
);
IMFSample_Release
(
sample
);
/* There is no video stream. */
hr
=
IMFSourceReader_ReadSample
(
reader
,
MF_SOURCE_READER_FIRST_VIDEO_STREAM
,
0
,
&
actual_index
,
&
stream_flags
,
&
timestamp
,
&
sample
);
ok
(
hr
==
MF_E_INVALIDSTREAMNUMBER
,
"Unexpected hr %#x.
\n
"
,
hr
);
ok
(
actual_index
==
MF_SOURCE_READER_FIRST_VIDEO_STREAM
,
"Unexpected stream index %u
\n
"
,
actual_index
);
ok
(
stream_flags
==
MF_SOURCE_READERF_ERROR
,
"Unexpected stream flags %#x.
\n
"
,
stream_flags
);
hr
=
IMFSourceReader_ReadSample
(
reader
,
MF_SOURCE_READER_FIRST_AUDIO_STREAM
,
0
,
&
actual_index
,
&
stream_flags
,
&
timestamp
,
&
sample
);
ok
(
hr
==
S_OK
,
"Failed to get a sample, hr %#x.
\n
"
,
hr
);
ok
(
actual_index
==
0
,
"Unexpected stream index %u
\n
"
,
actual_index
);
ok
(
stream_flags
==
MF_SOURCE_READERF_ENDOFSTREAM
,
"Unexpected stream flags %#x.
\n
"
,
stream_flags
);
ok
(
!
sample
,
"Unexpected sample object.
\n
"
);
hr
=
IMFSourceReader_ReadSample
(
reader
,
MF_SOURCE_READER_FIRST_AUDIO_STREAM
,
MF_SOURCE_READER_CONTROLF_DRAIN
,
&
actual_index
,
&
stream_flags
,
&
timestamp
,
&
sample
);
ok
(
hr
==
S_OK
,
"Failed to get a sample, hr %#x.
\n
"
,
hr
);
ok
(
actual_index
==
0
,
"Unexpected stream index %u
\n
"
,
actual_index
);
ok
(
stream_flags
==
MF_SOURCE_READERF_ENDOFSTREAM
,
"Unexpected stream flags %#x.
\n
"
,
stream_flags
);
ok
(
!
sample
,
"Unexpected sample object.
\n
"
);
hr
=
IMFSourceReader_ReadSample
(
reader
,
MF_SOURCE_READER_FIRST_AUDIO_STREAM
,
MF_SOURCE_READER_CONTROLF_DRAIN
,
&
actual_index
,
&
stream_flags
,
&
timestamp
,
NULL
);
ok
(
hr
==
E_POINTER
,
"Unexpected hr %#x.
\n
"
,
hr
);
hr
=
IMFSourceReader_ReadSample
(
reader
,
MF_SOURCE_READER_FIRST_AUDIO_STREAM
,
MF_SOURCE_READER_CONTROLF_DRAIN
,
&
actual_index
,
NULL
,
&
timestamp
,
&
sample
);
ok
(
hr
==
E_POINTER
,
"Unexpected hr %#x.
\n
"
,
hr
);
hr
=
IMFSourceReader_ReadSample
(
reader
,
MF_SOURCE_READER_FIRST_AUDIO_STREAM
,
MF_SOURCE_READER_CONTROLF_DRAIN
,
NULL
,
&
stream_flags
,
&
timestamp
,
&
sample
);
ok
(
hr
==
S_OK
,
"Failed to get a sample, hr %#x.
\n
"
,
hr
);
ok
(
stream_flags
==
MF_SOURCE_READERF_ENDOFSTREAM
,
"Unexpected stream flags %#x.
\n
"
,
stream_flags
);
ok
(
!
sample
,
"Unexpected sample object.
\n
"
);
hr
=
IMFSourceReader_ReadSample
(
reader
,
MF_SOURCE_READER_FIRST_AUDIO_STREAM
,
MF_SOURCE_READER_CONTROLF_DRAIN
,
&
actual_index
,
&
stream_flags
,
NULL
,
&
sample
);
ok
(
hr
==
S_OK
,
"Failed to get a sample, hr %#x.
\n
"
,
hr
);
ok
(
actual_index
==
0
,
"Unexpected stream index %u
\n
"
,
actual_index
);
ok
(
stream_flags
==
MF_SOURCE_READERF_ENDOFSTREAM
,
"Unexpected stream flags %#x.
\n
"
,
stream_flags
);
ok
(
!
sample
,
"Unexpected sample object.
\n
"
);
hr
=
IMFSourceReader_ReadSample
(
reader
,
MF_SOURCE_READER_ANY_STREAM
,
MF_SOURCE_READER_CONTROLF_DRAIN
,
&
actual_index
,
&
stream_flags
,
NULL
,
&
sample
);
ok
(
hr
==
S_OK
,
"Failed to get a sample, hr %#x.
\n
"
,
hr
);
ok
(
actual_index
==
0
,
"Unexpected stream index %u
\n
"
,
actual_index
);
ok
(
stream_flags
==
MF_SOURCE_READERF_ENDOFSTREAM
,
"Unexpected stream flags %#x.
\n
"
,
stream_flags
);
ok
(
!
sample
,
"Unexpected sample object.
\n
"
);
/* Flush. */
hr
=
IMFSourceReader_Flush
(
reader
,
MF_SOURCE_READER_FIRST_VIDEO_STREAM
);
ok
(
hr
==
MF_E_INVALIDSTREAMNUMBER
,
"Unexpected hr %#x.
\n
"
,
hr
);
...
...
include/mfreadwrite.idl
View file @
2ca469f8
...
...
@@ -19,6 +19,11 @@
import
"mfobjects.idl"
;
import
"mftransform.idl"
;
typedef
[
v1_enum
]
enum
MF_SOURCE_READER_CONTROL_FLAG
{
MF_SOURCE_READER_CONTROLF_DRAIN
=
0
x00000001
,
}
MF_SOURCE_READER_CONTROL_FLAG
;
enum
{
MF_SOURCE_READER_INVALID_STREAM_INDEX
=
0
xffffffff
,
...
...
@@ -30,15 +35,15 @@ enum
MF_SOURCE_READER_CURRENT_TYPE_INDEX
=
0
xffffffff
}
;
typedef
enum
MF_SOURCE_READER_FLAG
typedef
[
v1_enum
]
enum
MF_SOURCE_READER_FLAG
{
MF_SOURCE_READERF_ERROR
=
0
x001
,
MF_SOURCE_READERF_ENDOFSTREAM
=
0
x002
,
MF_SOURCE_READERF_NEWSTREAM
=
0
x004
,
MF_SOURCE_READERF_NATIVEMEDIATYPECHANGED
=
0
x010
,
MF_SOURCE_READERF_CURRENTMEDIATYPECHANGED
=
0
x020
,
MF_SOURCE_READERF_STREAMTICK
=
0
x100
,
MF_SOURCE_READERF_ALLEFFECTSREMOVED
=
0
x
200
MF_SOURCE_READERF_ERROR
=
0
x00
00000
1
,
MF_SOURCE_READERF_ENDOFSTREAM
=
0
x00
00000
2
,
MF_SOURCE_READERF_NEWSTREAM
=
0
x00
00000
4
,
MF_SOURCE_READERF_NATIVEMEDIATYPECHANGED
=
0
x0
00000
10
,
MF_SOURCE_READERF_CURRENTMEDIATYPECHANGED
=
0
x0
00000
20
,
MF_SOURCE_READERF_STREAMTICK
=
0
x
00000
100
,
MF_SOURCE_READERF_ALLEFFECTSREMOVED
=
0
x
00000200
,
}
MF_SOURCE_READER_FLAG
;
typedef
struct
_MF_SINK_WRITER_STATISTICS
...
...
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