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
096b46cf
Commit
096b46cf
authored
Jul 04, 2023
by
Bernhard Kölbl
Committed by
Alexandre Julliard
Jul 17, 2023
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
mfmediaengine/tests: Add tests for audio effects.
parent
2238658e
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
50 additions
and
8 deletions
+50
-8
Makefile.in
dlls/mfmediaengine/tests/Makefile.in
+1
-1
i420-64x64.avi
dlls/mfmediaengine/tests/i420-64x64.avi
+0
-0
mfmediaengine.c
dlls/mfmediaengine/tests/mfmediaengine.c
+46
-5
resource.rc
dlls/mfmediaengine/tests/resource.rc
+3
-2
No files found.
dlls/mfmediaengine/tests/Makefile.in
View file @
096b46cf
TESTDLL
=
mfmediaengine.dll
IMPORTS
=
ole32 mfplat oleaut32 mfuuid uuid
IMPORTS
=
ole32 mf
mf
plat oleaut32 mfuuid uuid
C_SRCS
=
\
mfmediaengine.c
...
...
dlls/mfmediaengine/tests/i420-64x64.avi
View file @
096b46cf
No preview for this file type
dlls/mfmediaengine/tests/mfmediaengine.c
View file @
096b46cf
...
...
@@ -1307,7 +1307,7 @@ static void test_TransferVideoFrame(void)
res
=
0
;
hr
=
IMFMediaEngineEx_GetNumberOfStreams
(
media_engine
,
&
res
);
ok
(
hr
==
S_OK
,
"Unexpected hr %#lx.
\n
"
,
hr
);
ok
(
res
==
1
,
"Unexpected stream count %lu.
\n
"
,
res
);
ok
(
res
==
2
,
"Unexpected stream count %lu.
\n
"
,
res
);
/* FIXME: Wine first video frame is often full of garbage, wait for another update */
res
=
WaitForSingleObject
(
notify
->
ready_event
,
500
);
...
...
@@ -1483,7 +1483,7 @@ static HRESULT WINAPI passthrough_mft_AddInputStreams(IMFTransform *iface, DWORD
static
HRESULT
WINAPI
passthrough_mft_GetInputAvailableType
(
IMFTransform
*
iface
,
DWORD
id
,
DWORD
index
,
IMFMediaType
**
type
)
{
static
const
GUID
*
types
[]
=
{
&
MFMediaType_Video
};
static
const
GUID
*
types
[]
=
{
&
MFMediaType_Video
,
&
MFMediaType_Audio
};
HRESULT
hr
;
if
(
id
)
...
...
@@ -1772,9 +1772,9 @@ HRESULT passthrough_mft_create(UINT32 index, struct passthrough_mft **out)
return
S_OK
;
}
static
void
test_
video_
effect
(
void
)
static
void
test_effect
(
void
)
{
struct
passthrough_mft
*
video_effect
=
NULL
,
*
video_effect2
=
NULL
;
struct
passthrough_mft
*
video_effect
=
NULL
,
*
video_effect2
=
NULL
,
*
audio_effect
=
NULL
,
*
audio_effect2
=
NULL
;
struct
test_transfer_notify
*
notify
;
IMFMediaEngineEx
*
media_engine_ex
=
NULL
;
ID3D11Texture2D
*
texture
=
NULL
;
...
...
@@ -1782,6 +1782,7 @@ static void test_video_effect(void)
ID3D11Device
*
device
=
NULL
;
D3D11_TEXTURE2D_DESC
desc
;
IMFByteStream
*
stream
;
IMFMediaSink
*
sink
;
RECT
dst_rect
;
UINT
token
;
HRESULT
hr
;
...
...
@@ -1836,6 +1837,20 @@ static void test_video_effect(void)
ok
(
hr
==
S_OK
,
"Unexpected hr %#lx.
\n
"
,
hr
);
EXPECT_REF
(
&
video_effect2
->
IMFTransform_iface
,
2
);
hr
=
passthrough_mft_create
(
0
,
&
audio_effect
);
ok
(
hr
==
S_OK
,
"Unexpected hr %#lx.
\n
"
,
hr
);
hr
=
passthrough_mft_create
(
1
,
&
audio_effect2
);
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
);
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
);
url
=
SysAllocString
(
L"i420-64x64.avi"
);
hr
=
IMFMediaEngineEx_SetSourceFromByteStream
(
media_engine_ex
,
stream
,
url
);
ok
(
hr
==
S_OK
,
"Unexpected hr %#lx.
\n
"
,
hr
);
...
...
@@ -1858,6 +1873,21 @@ static void test_video_effect(void)
ok
(
video_effect
->
processing_count
>
0
,
"Unexpected processing count %lu.
\n
"
,
video_effect
->
processing_count
);
ok
(
video_effect2
->
processing_count
>
0
,
"Unexpected processing count %lu.
\n
"
,
video_effect2
->
processing_count
);
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
);
}
else
if
(
hr
==
MF_E_NO_AUDIO_PLAYBACK_DEVICE
)
{
ok
(
!
audio_effect
->
processing_count
,
"Unexpected processing count %lu.
\n
"
,
audio_effect
->
processing_count
);
ok
(
!
audio_effect2
->
processing_count
,
"Unexpected processing count %lu.
\n
"
,
audio_effect2
->
processing_count
);
}
done:
if
(
media_engine_ex
)
{
...
...
@@ -1872,6 +1902,17 @@ done:
if
(
device
)
ID3D11Device_Release
(
device
);
if
(
audio_effect2
)
{
ref
=
IMFTransform_Release
(
&
audio_effect2
->
IMFTransform_iface
);
ok
(
!
ref
,
"Unexpected ref %lu.
\n
"
,
ref
);
}
if
(
audio_effect
)
{
ref
=
IMFTransform_Release
(
&
audio_effect
->
IMFTransform_iface
);
ok
(
!
ref
,
"Unexpected ref %lu.
\n
"
,
ref
);
}
if
(
video_effect2
)
{
ref
=
IMFTransform_Release
(
&
video_effect2
->
IMFTransform_iface
);
...
...
@@ -1917,7 +1958,7 @@ START_TEST(mfmediaengine)
test_SetSourceFromByteStream
();
test_audio_configuration
();
test_TransferVideoFrame
();
test_
video_
effect
();
test_effect
();
IMFMediaEngineClassFactory_Release
(
factory
);
...
...
dlls/mfmediaengine/tests/resource.rc
View file @
096b46cf
...
...
@@ -21,8 +21,9 @@
/* Generated with:
* gst-launch-1.0 videotestsrc num-buffers=4 pattern=smpte100 ! \
* video/x-raw,format=I420,width=64,height=64,framerate=30000/1001 ! \
* videoflip method=clockwise ! videoconvert ! \
* avimux ! filesink location=dlls/mfmediaengine/tests/i420-64x64.avi
* videoflip method=clockwise ! videoconvert ! queue ! mux. \
* audiotestsrc num-buffers=4 ! audioconvert ! audio/x-raw,rate=44100,channels=2 ! queue ! mux. \
* avimux name=mux ! filesink location=dlls/mfmediaengine/tests/i420-64x64.avi
*/
/* @makedep: i420-64x64.avi */
i420-64x64.avi RCDATA i420-64x64.avi
...
...
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