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
ed7762c1
Commit
ed7762c1
authored
Aug 12, 2022
by
Nikolay Sivov
Committed by
Alexandre Julliard
Aug 15, 2022
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
mfsrcsnk/wave: Add a sink stub.
Signed-off-by:
Nikolay Sivov
<
nsivov@codeweavers.com
>
parent
73d6ca6e
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
171 additions
and
0 deletions
+171
-0
configure
configure
+1
-0
configure.ac
configure.ac
+1
-0
Makefile.in
dlls/mfsrcsnk/Makefile.in
+1
-0
Makefile.in
dlls/mfsrcsnk/tests/Makefile.in
+5
-0
mfsrcsnk.c
dlls/mfsrcsnk/tests/mfsrcsnk.c
+163
-0
wave.c
dlls/mfsrcsnk/wave.c
+0
-0
No files found.
configure
View file @
ed7762c1
...
...
@@ -21602,6 +21602,7 @@ wine_fn_config_makefile dlls/mfplay/tests enable_tests
wine_fn_config_makefile dlls/mfreadwrite enable_mfreadwrite
wine_fn_config_makefile dlls/mfreadwrite/tests enable_tests
wine_fn_config_makefile dlls/mfsrcsnk enable_mfsrcsnk
wine_fn_config_makefile dlls/mfsrcsnk/tests enable_tests
wine_fn_config_makefile dlls/mgmtapi enable_mgmtapi
wine_fn_config_makefile dlls/midimap enable_midimap
wine_fn_config_makefile dlls/mlang enable_mlang
...
...
configure.ac
View file @
ed7762c1
...
...
@@ -2741,6 +2741,7 @@ WINE_CONFIG_MAKEFILE(dlls/mfplay/tests)
WINE_CONFIG_MAKEFILE(dlls/mfreadwrite)
WINE_CONFIG_MAKEFILE(dlls/mfreadwrite/tests)
WINE_CONFIG_MAKEFILE(dlls/mfsrcsnk)
WINE_CONFIG_MAKEFILE(dlls/mfsrcsnk/tests)
WINE_CONFIG_MAKEFILE(dlls/mgmtapi)
WINE_CONFIG_MAKEFILE(dlls/midimap)
WINE_CONFIG_MAKEFILE(dlls/mlang)
...
...
dlls/mfsrcsnk/Makefile.in
View file @
ed7762c1
MODULE
=
mfsrcsnk.dll
IMPORTLIB
=
mfsrcsnk
IMPORTS
=
mfplat mfuuid uuid
EXTRADLLFLAGS
=
-Wb
,--prefer-native
...
...
dlls/mfsrcsnk/tests/Makefile.in
0 → 100644
View file @
ed7762c1
TESTDLL
=
mfsrcsnk.dll
IMPORTS
=
ole32 mfsrcsnk mfplat uuid mfuuid
C_SRCS
=
\
mfsrcsnk.c
dlls/mfsrcsnk/tests/mfsrcsnk.c
0 → 100644
View file @
ed7762c1
/*
* Copyright 2022 Nikolay Sivov for CodeWeavers
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2.1 of the License, or (at your option) any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the Free Software
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
*/
#include <stdarg.h>
#include <string.h>
#define COBJMACROS
#include "windef.h"
#include "mfapi.h"
#include "mfidl.h"
#include "mferror.h"
#include "wine/test.h"
#define check_interface(a, b, c) check_interface_(__LINE__, a, b, c)
static
void
check_interface_
(
unsigned
int
line
,
void
*
iface_ptr
,
REFIID
iid
,
BOOL
supported
)
{
IUnknown
*
iface
=
iface_ptr
;
HRESULT
hr
,
expected_hr
;
IUnknown
*
unk
;
expected_hr
=
supported
?
S_OK
:
E_NOINTERFACE
;
hr
=
IUnknown_QueryInterface
(
iface
,
iid
,
(
void
**
)
&
unk
);
ok_
(
__FILE__
,
line
)(
hr
==
expected_hr
,
"Got hr %#lx, expected %#lx.
\n
"
,
hr
,
expected_hr
);
if
(
SUCCEEDED
(
hr
))
IUnknown_Release
(
unk
);
}
static
void
test_wave_sink
(
void
)
{
IMFStreamSink
*
stream_sink
;
IMFMediaSink
*
sink
,
*
sink2
;
IMFByteStream
*
bytestream
;
IMFMediaType
*
media_type
;
DWORD
id
,
count
,
flags
;
HRESULT
hr
;
hr
=
MFCreateWAVEMediaSink
(
NULL
,
NULL
,
NULL
);
ok
(
hr
==
E_POINTER
,
"Unexpected hr %#lx.
\n
"
,
hr
);
hr
=
MFCreateWAVEMediaSink
(
NULL
,
NULL
,
&
sink
);
ok
(
hr
==
E_POINTER
,
"Unexpected hr %#lx.
\n
"
,
hr
);
hr
=
MFCreateMediaType
(
&
media_type
);
ok
(
hr
==
S_OK
,
"Unexpected hr %#lx.
\n
"
,
hr
);
hr
=
IMFMediaType_SetUINT32
(
media_type
,
&
MF_MT_AUDIO_BLOCK_ALIGNMENT
,
2
);
ok
(
hr
==
S_OK
,
"Unexpected hr %#lx.
\n
"
,
hr
);
hr
=
IMFMediaType_SetUINT32
(
media_type
,
&
MF_MT_AUDIO_NUM_CHANNELS
,
2
);
ok
(
hr
==
S_OK
,
"Unexpected hr %#lx.
\n
"
,
hr
);
hr
=
IMFMediaType_SetGUID
(
media_type
,
&
MF_MT_MAJOR_TYPE
,
&
MFMediaType_Audio
);
ok
(
hr
==
S_OK
,
"Unexpected hr %#lx.
\n
"
,
hr
);
hr
=
IMFMediaType_SetGUID
(
media_type
,
&
MF_MT_SUBTYPE
,
&
MFAudioFormat_PCM
);
ok
(
hr
==
S_OK
,
"Unexpected hr %#lx.
\n
"
,
hr
);
hr
=
IMFMediaType_SetUINT32
(
media_type
,
&
MF_MT_AUDIO_SAMPLES_PER_SECOND
,
44100
);
ok
(
hr
==
S_OK
,
"Unexpected hr %#lx.
\n
"
,
hr
);
hr
=
IMFMediaType_SetUINT32
(
media_type
,
&
MF_MT_AUDIO_BITS_PER_SAMPLE
,
8
);
ok
(
hr
==
S_OK
,
"Unexpected hr %#lx.
\n
"
,
hr
);
hr
=
MFCreateTempFile
(
MF_ACCESSMODE_WRITE
,
MF_OPENMODE_DELETE_IF_EXIST
,
0
,
&
bytestream
);
ok
(
hr
==
S_OK
,
"Unexpected hr %#lx.
\n
"
,
hr
);
hr
=
MFCreateWAVEMediaSink
(
bytestream
,
NULL
,
&
sink
);
ok
(
hr
==
E_POINTER
,
"Unexpected hr %#lx.
\n
"
,
hr
);
hr
=
MFCreateWAVEMediaSink
(
bytestream
,
media_type
,
&
sink
);
ok
(
hr
==
S_OK
,
"Unexpected hr %#lx.
\n
"
,
hr
);
/* Sink tests */
hr
=
IMFMediaSink_GetCharacteristics
(
sink
,
&
flags
);
ok
(
hr
==
S_OK
,
"Unexpected hr %#lx.
\n
"
,
hr
);
ok
(
flags
==
(
MEDIASINK_FIXED_STREAMS
|
MEDIASINK_RATELESS
),
"Unexpected flags %#lx.
\n
"
,
flags
);
hr
=
IMFMediaSink_GetStreamSinkCount
(
sink
,
NULL
);
ok
(
hr
==
E_POINTER
,
"Unexpected hr %#lx.
\n
"
,
hr
);
hr
=
IMFMediaSink_GetStreamSinkCount
(
sink
,
&
count
);
ok
(
hr
==
S_OK
,
"Unexpected hr %#lx.
\n
"
,
hr
);
ok
(
count
==
1
,
"Unexpected count %lu.
\n
"
,
count
);
hr
=
IMFMediaSink_AddStreamSink
(
sink
,
123
,
media_type
,
&
stream_sink
);
ok
(
hr
==
MF_E_STREAMSINKS_FIXED
,
"Unexpected hr %#lx.
\n
"
,
hr
);
check_interface
(
sink
,
&
IID_IMFMediaEventGenerator
,
TRUE
);
check_interface
(
sink
,
&
IID_IMFFinalizableMediaSink
,
TRUE
);
/* Stream tests */
hr
=
IMFMediaSink_GetStreamSinkByIndex
(
sink
,
0
,
&
stream_sink
);
ok
(
hr
==
S_OK
,
"Unexpected hr %#lx.
\n
"
,
hr
);
hr
=
IMFStreamSink_GetIdentifier
(
stream_sink
,
&
id
);
ok
(
hr
==
S_OK
,
"Unexpected hr %#lx.
\n
"
,
hr
);
ok
(
id
==
1
,
"Unexpected id %#lx.
\n
"
,
id
);
IMFStreamSink_Release
(
stream_sink
);
hr
=
IMFMediaSink_GetStreamSinkById
(
sink
,
0
,
&
stream_sink
);
ok
(
hr
==
MF_E_INVALIDSTREAMNUMBER
,
"Unexpected hr %#lx.
\n
"
,
hr
);
hr
=
IMFMediaSink_GetStreamSinkById
(
sink
,
id
,
&
stream_sink
);
ok
(
hr
==
S_OK
,
"Unexpected hr %#lx.
\n
"
,
hr
);
hr
=
IMFStreamSink_GetMediaSink
(
stream_sink
,
&
sink2
);
ok
(
hr
==
S_OK
,
"Unexpected hr %#lx.
\n
"
,
hr
);
IMFMediaSink_Release
(
sink2
);
/* Shutdown state */
hr
=
IMFMediaSink_Shutdown
(
sink
);
ok
(
hr
==
S_OK
,
"Unexpected hr %#lx.
\n
"
,
hr
);
hr
=
IMFMediaSink_Shutdown
(
sink
);
ok
(
hr
==
MF_E_SHUTDOWN
,
"Unexpected hr %#lx.
\n
"
,
hr
);
hr
=
IMFStreamSink_GetMediaSink
(
stream_sink
,
&
sink2
);
ok
(
hr
==
MF_E_STREAMSINK_REMOVED
,
"Unexpected hr %#lx.
\n
"
,
hr
);
hr
=
IMFStreamSink_GetIdentifier
(
stream_sink
,
&
id
);
ok
(
hr
==
MF_E_STREAMSINK_REMOVED
,
"Unexpected hr %#lx.
\n
"
,
hr
);
IMFStreamSink_Release
(
stream_sink
);
hr
=
IMFMediaSink_AddStreamSink
(
sink
,
123
,
media_type
,
&
stream_sink
);
ok
(
hr
==
MF_E_SHUTDOWN
,
"Unexpected hr %#lx.
\n
"
,
hr
);
hr
=
IMFMediaSink_GetStreamSinkByIndex
(
sink
,
0
,
&
stream_sink
);
ok
(
hr
==
MF_E_SHUTDOWN
,
"Unexpected hr %#lx.
\n
"
,
hr
);
hr
=
IMFMediaSink_GetStreamSinkById
(
sink
,
0
,
&
stream_sink
);
ok
(
hr
==
MF_E_SHUTDOWN
,
"Unexpected hr %#lx.
\n
"
,
hr
);
hr
=
IMFMediaSink_GetCharacteristics
(
sink
,
&
flags
);
ok
(
hr
==
MF_E_SHUTDOWN
,
"Unexpected hr %#lx.
\n
"
,
hr
);
IMFMediaSink_Release
(
sink
);
IMFMediaType_Release
(
media_type
);
IMFByteStream_Release
(
bytestream
);
}
START_TEST
(
mfsrcsnk
)
{
HRESULT
hr
;
hr
=
MFStartup
(
MF_VERSION
,
MFSTARTUP_FULL
);
ok
(
hr
==
S_OK
,
"Unexpected hr %#lx.
\n
"
,
hr
);
test_wave_sink
();
hr
=
MFShutdown
();
ok
(
hr
==
S_OK
,
"Unexpected hr %#lx.
\n
"
,
hr
);
}
dlls/mfsrcsnk/wave.c
View file @
ed7762c1
This diff is collapsed.
Click to expand it.
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