Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
wine-cw
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-cw
Commits
cfbcd014
Commit
cfbcd014
authored
May 15, 2023
by
Ziqing Hui
Committed by
Alexandre Julliard
May 17, 2023
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
mfreadwrite/tests: Add tests for MP4 sink writer.
parent
fbfc724d
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
80 additions
and
2 deletions
+80
-2
mfplat.c
dlls/mfreadwrite/tests/mfplat.c
+80
-2
No files found.
dlls/mfreadwrite/tests/mfplat.c
View file @
cfbcd014
...
...
@@ -1415,7 +1415,7 @@ done:
DestroyWindow
(
window
);
}
static
void
test_sink_writer
(
void
)
static
void
test_sink_writer
_create
(
void
)
{
IMFSinkWriter
*
writer
;
HRESULT
hr
;
...
...
@@ -1437,6 +1437,83 @@ static void test_sink_writer(void)
ok
(
!
writer
,
"Unexpected pointer %p.
\n
"
,
writer
);
}
static
void
test_sink_writer_mp4
(
void
)
{
WCHAR
tmp_file
[
MAX_PATH
];
IMFSinkWriter
*
writer
;
IMFByteStream
*
stream
;
IMFAttributes
*
attr
;
IMFMediaSink
*
sink
;
HRESULT
hr
;
GetTempPathW
(
ARRAY_SIZE
(
tmp_file
),
tmp_file
);
wcscat
(
tmp_file
,
L"tmp.mp4"
);
hr
=
MFCreateAttributes
(
&
attr
,
1
);
ok
(
hr
==
S_OK
,
"Unexpected hr %#lx.
\n
"
,
hr
);
hr
=
IMFAttributes_SetGUID
(
attr
,
&
MF_TRANSCODE_CONTAINERTYPE
,
&
MFTranscodeContainerType_MPEG4
);
ok
(
hr
==
S_OK
,
"Unexpected hr %#lx.
\n
"
,
hr
);
hr
=
MFCreateTempFile
(
MF_ACCESSMODE_READWRITE
,
MF_OPENMODE_DELETE_IF_EXIST
,
MF_FILEFLAGS_NONE
,
&
stream
);
ok
(
hr
==
S_OK
,
"Unexpected hr %#lx.
\n
"
,
hr
);
/* Test MFCreateSinkWriterFromURL. */
writer
=
(
void
*
)
0xdeadbeef
;
hr
=
MFCreateSinkWriterFromURL
(
NULL
,
NULL
,
attr
,
&
writer
);
ok
(
hr
==
E_INVALIDARG
,
"Unexpected hr %#lx.
\n
"
,
hr
);
ok
(
!
writer
,
"Unexpected pointer %p.
\n
"
,
writer
);
writer
=
(
void
*
)
0xdeadbeef
;
hr
=
MFCreateSinkWriterFromURL
(
NULL
,
stream
,
NULL
,
&
writer
);
ok
(
hr
==
E_INVALIDARG
,
"Unexpected hr %#lx.
\n
"
,
hr
);
ok
(
!
writer
,
"Unexpected pointer %p.
\n
"
,
writer
);
hr
=
MFCreateSinkWriterFromURL
(
NULL
,
stream
,
attr
,
&
writer
);
todo_wine
ok
(
hr
==
S_OK
,
"Unexpected hr %#lx.
\n
"
,
hr
);
if
(
hr
==
S_OK
)
IMFSinkWriter_Release
(
writer
);
hr
=
MFCreateSinkWriterFromURL
(
tmp_file
,
NULL
,
NULL
,
&
writer
);
todo_wine
ok
(
hr
==
S_OK
,
"Unexpected hr %#lx.
\n
"
,
hr
);
if
(
hr
==
S_OK
)
IMFSinkWriter_Release
(
writer
);
hr
=
MFCreateSinkWriterFromURL
(
tmp_file
,
NULL
,
attr
,
&
writer
);
todo_wine
ok
(
hr
==
S_OK
,
"Unexpected hr %#lx.
\n
"
,
hr
);
if
(
hr
==
S_OK
)
IMFSinkWriter_Release
(
writer
);
hr
=
MFCreateSinkWriterFromURL
(
tmp_file
,
stream
,
NULL
,
&
writer
);
todo_wine
ok
(
hr
==
S_OK
,
"Unexpected hr %#lx.
\n
"
,
hr
);
if
(
hr
==
S_OK
)
IMFSinkWriter_Release
(
writer
);
hr
=
MFCreateSinkWriterFromURL
(
tmp_file
,
stream
,
attr
,
&
writer
);
todo_wine
ok
(
hr
==
S_OK
,
"Unexpected hr %#lx.
\n
"
,
hr
);
if
(
hr
!=
S_OK
)
{
IMFByteStream_Release
(
stream
);
IMFAttributes_Release
(
attr
);
return
;
}
/* Test GetServiceForStream. */
sink
=
(
void
*
)
0xdeadbeef
;
hr
=
IMFSinkWriter_GetServiceForStream
(
writer
,
MF_SINK_WRITER_MEDIASINK
,
&
GUID_NULL
,
&
IID_IMFMediaSink
,
(
void
**
)
&
sink
);
ok
(
hr
==
MF_E_UNSUPPORTED_SERVICE
,
"Unexpected hr %#lx.
\n
"
,
hr
);
ok
(
!
sink
,
"Unexpected pointer %p.
\n
"
,
sink
);
DeleteFileW
(
tmp_file
);
IMFSinkWriter_Release
(
writer
);
IMFByteStream_Release
(
stream
);
IMFAttributes_Release
(
attr
);
}
START_TEST
(
mfplat
)
{
HRESULT
hr
;
...
...
@@ -1451,7 +1528,8 @@ START_TEST(mfplat)
test_source_reader
(
"test.mp4"
,
true
);
test_source_reader_from_media_source
();
test_reader_d3d9
();
test_sink_writer
();
test_sink_writer_create
();
test_sink_writer_mp4
();
hr
=
MFShutdown
();
ok
(
hr
==
S_OK
,
"Unexpected hr %#lx.
\n
"
,
hr
);
...
...
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