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
91a84cff
Commit
91a84cff
authored
Dec 04, 2022
by
Bernhard Kölbl
Committed by
Alexandre Julliard
Jul 17, 2023
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
mfmediaengine: Add support for inserting audio effects.
parent
096b46cf
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
21 additions
and
11 deletions
+21
-11
main.c
dlls/mfmediaengine/main.c
+15
-3
mfmediaengine.c
dlls/mfmediaengine/tests/mfmediaengine.c
+6
-8
No files found.
dlls/mfmediaengine/main.c
View file @
91a84cff
...
...
@@ -159,6 +159,7 @@ struct media_engine
IMFPresentationDescriptor
*
pd
;
}
presentation
;
struct
effects
video_effects
;
struct
effects
audio_effects
;
struct
{
LONGLONG
pts
;
...
...
@@ -1274,7 +1275,10 @@ static HRESULT media_engine_create_topology(struct media_engine *engine, IMFMedi
{
IMFTopology_AddNode
(
topology
,
audio_src
);
IMFTopology_AddNode
(
topology
,
sar_node
);
IMFTopologyNode_ConnectOutput
(
audio_src
,
0
,
sar_node
,
0
);
if
(
FAILED
(
hr
=
media_engine_create_effects
(
engine
->
audio_effects
.
effects
,
engine
->
audio_effects
.
count
,
audio_src
,
sar_node
,
topology
)))
WARN
(
"Failed to create audio effect nodes, hr %#lx.
\n
"
,
hr
);
}
if
(
sar_node
)
...
...
@@ -1453,6 +1457,7 @@ static void free_media_engine(struct media_engine *engine)
IMFAttributes_Release
(
engine
->
attributes
);
if
(
engine
->
resolver
)
IMFSourceResolver_Release
(
engine
->
resolver
);
media_engine_clear_effects
(
&
engine
->
audio_effects
);
media_engine_clear_effects
(
&
engine
->
video_effects
);
media_engine_release_video_frame_resources
(
engine
);
media_engine_clear_presentation
(
engine
);
...
...
@@ -2700,9 +2705,16 @@ static HRESULT WINAPI media_engine_InsertVideoEffect(IMFMediaEngineEx *iface, IU
static
HRESULT
WINAPI
media_engine_InsertAudioEffect
(
IMFMediaEngineEx
*
iface
,
IUnknown
*
effect
,
BOOL
is_optional
)
{
FIXME
(
"%p, %p, %d stub.
\n
"
,
iface
,
effect
,
is_optional
);
struct
media_engine
*
engine
=
impl_from_IMFMediaEngineEx
(
iface
);
HRESULT
hr
=
S_OK
;
return
E_NOTIMPL
;
TRACE
(
"%p, %p, %d.
\n
"
,
iface
,
effect
,
is_optional
);
EnterCriticalSection
(
&
engine
->
cs
);
hr
=
media_engine_insert_effect
(
engine
,
&
engine
->
audio_effects
,
effect
,
is_optional
);
LeaveCriticalSection
(
&
engine
->
cs
);
return
hr
;
}
static
HRESULT
WINAPI
media_engine_RemoveAllEffects
(
IMFMediaEngineEx
*
iface
)
...
...
dlls/mfmediaengine/tests/mfmediaengine.c
View file @
91a84cff
...
...
@@ -1844,12 +1844,12 @@ static void test_effect(void)
ok
(
hr
==
S_OK
,
"Unexpected hr %#lx.
\n
"
,
hr
);
hr
=
IMFMediaEngineEx_InsertAudioEffect
(
media_engine_ex
,
(
IUnknown
*
)
&
audio_effect
->
IMFTransform_iface
,
FALSE
);
todo_wine
ok
(
hr
==
S_OK
,
"Unexpected hr %#lx.
\n
"
,
hr
);
todo_wine
EXPECT_REF
(
&
audio_effect
->
IMFTransform_iface
,
2
);
ok
(
hr
==
S_OK
,
"Unexpected hr %#lx.
\n
"
,
hr
);
EXPECT_REF
(
&
audio_effect
->
IMFTransform_iface
,
2
);
hr
=
IMFMediaEngineEx_InsertAudioEffect
(
media_engine_ex
,
(
IUnknown
*
)
&
audio_effect2
->
IMFTransform_iface
,
FALSE
);
todo_wine
ok
(
hr
==
S_OK
,
"Unexpected hr %#lx.
\n
"
,
hr
);
todo_wine
EXPECT_REF
(
&
audio_effect2
->
IMFTransform_iface
,
2
);
ok
(
hr
==
S_OK
,
"Unexpected hr %#lx.
\n
"
,
hr
);
EXPECT_REF
(
&
audio_effect2
->
IMFTransform_iface
,
2
);
url
=
SysAllocString
(
L"i420-64x64.avi"
);
hr
=
IMFMediaEngineEx_SetSourceFromByteStream
(
media_engine_ex
,
stream
,
url
);
...
...
@@ -1875,9 +1875,7 @@ static void test_effect(void)
if
(
SUCCEEDED
(
hr
=
MFCreateAudioRenderer
(
NULL
,
&
sink
)))
{
todo_wine
ok
(
audio_effect
->
processing_count
>
0
,
"Unexpected processing count %lu.
\n
"
,
audio_effect
->
processing_count
);
todo_wine
ok
(
audio_effect2
->
processing_count
>
0
,
"Unexpected processing count %lu.
\n
"
,
audio_effect2
->
processing_count
);
IMFMediaSink_Release
(
sink
);
...
...
@@ -1905,12 +1903,12 @@ done:
if
(
audio_effect2
)
{
ref
=
IMFTransform_Release
(
&
audio_effect2
->
IMFTransform_iface
);
ok
(
!
ref
,
"Unexpected ref %lu.
\n
"
,
ref
);
todo_wine
ok
(
!
ref
,
"Unexpected ref %lu.
\n
"
,
ref
);
}
if
(
audio_effect
)
{
ref
=
IMFTransform_Release
(
&
audio_effect
->
IMFTransform_iface
);
ok
(
!
ref
,
"Unexpected ref %lu.
\n
"
,
ref
);
todo_wine
ok
(
!
ref
,
"Unexpected ref %lu.
\n
"
,
ref
);
}
if
(
video_effect2
)
...
...
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