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
6938f9b9
Commit
6938f9b9
authored
Jan 27, 2022
by
Nikolay Sivov
Committed by
Alexandre Julliard
Jan 27, 2022
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
mfmediaengine: Implement audio renderer configuration methods.
Signed-off-by:
Nikolay Sivov
<
nsivov@codeweavers.com
>
Signed-off-by:
Alexandre Julliard
<
julliard@winehq.org
>
parent
9bf8fdaa
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
108 additions
and
8 deletions
+108
-8
main.c
dlls/mfmediaengine/main.c
+64
-8
mfmediaengine.c
dlls/mfmediaengine/tests/mfmediaengine.c
+44
-0
No files found.
dlls/mfmediaengine/main.c
View file @
6938f9b9
...
...
@@ -29,6 +29,8 @@
#include "mferror.h"
#include "dxgi.h"
#include "d3d11.h"
#include "mmdeviceapi.h"
#include "audiosessiontypes.h"
#include "wine/debug.h"
...
...
@@ -2495,30 +2497,78 @@ static HRESULT WINAPI media_engine_EnableHorizontalMirrorMode(IMFMediaEngineEx *
static
HRESULT
WINAPI
media_engine_GetAudioStreamCategory
(
IMFMediaEngineEx
*
iface
,
UINT32
*
category
)
{
FIXME
(
"%p, %p stub.
\n
"
,
iface
,
category
);
struct
media_engine
*
engine
=
impl_from_IMFMediaEngineEx
(
iface
);
HRESULT
hr
;
return
E_NOTIMPL
;
TRACE
(
"%p, %p.
\n
"
,
iface
,
category
);
EnterCriticalSection
(
&
engine
->
cs
);
if
(
engine
->
flags
&
FLAGS_ENGINE_SHUT_DOWN
)
hr
=
MF_E_SHUTDOWN
;
else
hr
=
IMFAttributes_GetUINT32
(
engine
->
attributes
,
&
MF_MEDIA_ENGINE_AUDIO_CATEGORY
,
category
);
LeaveCriticalSection
(
&
engine
->
cs
);
return
hr
;
}
static
HRESULT
WINAPI
media_engine_SetAudioStreamCategory
(
IMFMediaEngineEx
*
iface
,
UINT32
category
)
{
FIXME
(
"%p, %u stub.
\n
"
,
iface
,
category
);
struct
media_engine
*
engine
=
impl_from_IMFMediaEngineEx
(
iface
);
HRESULT
hr
;
return
E_NOTIMPL
;
TRACE
(
"%p, %u.
\n
"
,
iface
,
category
);
EnterCriticalSection
(
&
engine
->
cs
);
if
(
engine
->
flags
&
FLAGS_ENGINE_SHUT_DOWN
)
hr
=
MF_E_SHUTDOWN
;
else
hr
=
IMFAttributes_SetUINT32
(
engine
->
attributes
,
&
MF_MEDIA_ENGINE_AUDIO_CATEGORY
,
category
);
LeaveCriticalSection
(
&
engine
->
cs
);
return
hr
;
}
static
HRESULT
WINAPI
media_engine_GetAudioEndpointRole
(
IMFMediaEngineEx
*
iface
,
UINT32
*
role
)
{
FIXME
(
"%p, %p stub.
\n
"
,
iface
,
role
);
struct
media_engine
*
engine
=
impl_from_IMFMediaEngineEx
(
iface
);
HRESULT
hr
;
return
E_NOTIMPL
;
TRACE
(
"%p, %p.
\n
"
,
iface
,
role
);
EnterCriticalSection
(
&
engine
->
cs
);
if
(
engine
->
flags
&
FLAGS_ENGINE_SHUT_DOWN
)
hr
=
MF_E_SHUTDOWN
;
else
hr
=
IMFAttributes_GetUINT32
(
engine
->
attributes
,
&
MF_MEDIA_ENGINE_AUDIO_ENDPOINT_ROLE
,
role
);
LeaveCriticalSection
(
&
engine
->
cs
);
return
hr
;
}
static
HRESULT
WINAPI
media_engine_SetAudioEndpointRole
(
IMFMediaEngineEx
*
iface
,
UINT32
role
)
{
FIXME
(
"%p, %u stub.
\n
"
,
iface
,
role
);
struct
media_engine
*
engine
=
impl_from_IMFMediaEngineEx
(
iface
);
HRESULT
hr
;
return
E_NOTIMPL
;
TRACE
(
"%p, %u.
\n
"
,
iface
,
role
);
EnterCriticalSection
(
&
engine
->
cs
);
if
(
engine
->
flags
&
FLAGS_ENGINE_SHUT_DOWN
)
hr
=
MF_E_SHUTDOWN
;
else
hr
=
IMFAttributes_SetUINT32
(
engine
->
attributes
,
&
MF_MEDIA_ENGINE_AUDIO_ENDPOINT_ROLE
,
role
);
LeaveCriticalSection
(
&
engine
->
cs
);
return
hr
;
}
static
HRESULT
WINAPI
media_engine_GetRealTimeMode
(
IMFMediaEngineEx
*
iface
,
BOOL
*
enabled
)
...
...
@@ -2867,6 +2917,12 @@ static HRESULT init_media_engine(DWORD flags, IMFAttributes *attributes, struct
if
(
FAILED
(
hr
=
IMFAttributes_CopyAllItems
(
attributes
,
engine
->
attributes
)))
return
hr
;
/* Set default audio configuration */
if
(
FAILED
(
IMFAttributes_GetItem
(
engine
->
attributes
,
&
MF_MEDIA_ENGINE_AUDIO_CATEGORY
,
NULL
)))
IMFAttributes_SetUINT32
(
engine
->
attributes
,
&
MF_MEDIA_ENGINE_AUDIO_CATEGORY
,
AudioCategory_Other
);
if
(
FAILED
(
IMFAttributes_GetItem
(
engine
->
attributes
,
&
MF_MEDIA_ENGINE_AUDIO_ENDPOINT_ROLE
,
NULL
)))
IMFAttributes_SetUINT32
(
engine
->
attributes
,
&
MF_MEDIA_ENGINE_AUDIO_ENDPOINT_ROLE
,
eMultimedia
);
IMFAttributes_GetUINT64
(
attributes
,
&
MF_MEDIA_ENGINE_PLAYBACK_HWND
,
&
playback_hwnd
);
hr
=
IMFAttributes_GetUINT32
(
attributes
,
&
MF_MEDIA_ENGINE_VIDEO_OUTPUT_FORMAT
,
&
output_format
);
if
(
playback_hwnd
)
/* FIXME: handle MF_MEDIA_ENGINE_PLAYBACK_VISUAL */
...
...
dlls/mfmediaengine/tests/mfmediaengine.c
View file @
6938f9b9
...
...
@@ -29,6 +29,8 @@
#include "mferror.h"
#include "dxgi.h"
#include "initguid.h"
#include "mmdeviceapi.h"
#include "audiosessiontypes.h"
#include "wine/heap.h"
#include "wine/test.h"
...
...
@@ -297,6 +299,7 @@ static void test_Shutdown(void)
IMFMediaTimeRange
*
time_range
;
IMFMediaEngine
*
media_engine
;
unsigned
int
state
;
UINT32
value
;
DWORD
cx
,
cy
;
double
val
;
HRESULT
hr
;
...
...
@@ -448,6 +451,18 @@ todo_wine
hr
=
IMFMediaEngineEx_SetSourceFromByteStream
(
media_engine_ex
,
NULL
,
NULL
);
ok
(
hr
==
MF_E_SHUTDOWN
,
"Unexpected hr %#x.
\n
"
,
hr
);
hr
=
IMFMediaEngineEx_GetAudioStreamCategory
(
media_engine_ex
,
&
value
);
ok
(
hr
==
MF_E_SHUTDOWN
,
"Unexpected hr %#x.
\n
"
,
hr
);
hr
=
IMFMediaEngineEx_GetAudioEndpointRole
(
media_engine_ex
,
&
value
);
ok
(
hr
==
MF_E_SHUTDOWN
,
"Unexpected hr %#x.
\n
"
,
hr
);
hr
=
IMFMediaEngineEx_SetAudioStreamCategory
(
media_engine_ex
,
AudioCategory_ForegroundOnlyMedia
);
ok
(
hr
==
MF_E_SHUTDOWN
,
"Unexpected hr %#x.
\n
"
,
hr
);
hr
=
IMFMediaEngineEx_SetAudioEndpointRole
(
media_engine_ex
,
eConsole
);
ok
(
hr
==
MF_E_SHUTDOWN
,
"Unexpected hr %#x.
\n
"
,
hr
);
IMFMediaEngineEx_Release
(
media_engine_ex
);
}
...
...
@@ -800,6 +815,34 @@ static void test_SetSourceFromByteStream(void)
IMFMediaEngineNotify_Release
(
&
notify
->
IMFMediaEngineNotify_iface
);
}
static
void
test_audio_configuration
(
void
)
{
struct
media_engine_notify
*
notify
;
IMFMediaEngineEx
*
media_engine
;
UINT32
value
;
HRESULT
hr
;
notify
=
create_callback
();
media_engine
=
create_media_engine_ex
(
&
notify
->
IMFMediaEngineNotify_iface
);
if
(
!
media_engine
)
{
IMFMediaEngineNotify_Release
(
&
notify
->
IMFMediaEngineNotify_iface
);
return
;
}
hr
=
IMFMediaEngineEx_GetAudioStreamCategory
(
media_engine
,
&
value
);
ok
(
hr
==
S_OK
,
"Unexpected hr %#x.
\n
"
,
hr
);
ok
(
value
==
AudioCategory_Other
,
"Unexpected value %u.
\n
"
,
value
);
hr
=
IMFMediaEngineEx_GetAudioEndpointRole
(
media_engine
,
&
value
);
ok
(
hr
==
S_OK
,
"Unexpected hr %#x.
\n
"
,
hr
);
ok
(
value
==
eMultimedia
,
"Unexpected value %u.
\n
"
,
value
);
IMFMediaEngineEx_Release
(
media_engine
);
IMFMediaEngineNotify_Release
(
&
notify
->
IMFMediaEngineNotify_iface
);
}
START_TEST
(
mfmediaengine
)
{
HRESULT
hr
;
...
...
@@ -829,6 +872,7 @@ START_TEST(mfmediaengine)
test_error
();
test_time_range
();
test_SetSourceFromByteStream
();
test_audio_configuration
();
IMFMediaEngineClassFactory_Release
(
factory
);
...
...
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