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
32524883
Commit
32524883
authored
Nov 26, 2020
by
Zebediah Figura
Committed by
Alexandre Julliard
Nov 26, 2020
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
mp3dmod/tests: Add more tests for GetInputSizeInfo() and GetOutputSizeInfo().
Signed-off-by:
Zebediah Figura
<
z.figura12@gmail.com
>
Signed-off-by:
Alexandre Julliard
<
julliard@winehq.org
>
parent
33af64c5
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
25 additions
and
9 deletions
+25
-9
mp3dmod.c
dlls/mp3dmod/tests/mp3dmod.c
+25
-9
No files found.
dlls/mp3dmod/tests/mp3dmod.c
View file @
32524883
...
...
@@ -377,9 +377,8 @@ static void test_aggregation(void)
static
void
test_stream_info
(
void
)
{
static
const
MPEGLAYER3WAVEFORMAT
input_format
=
MPEGLAYER3WAVEFORMAT
input_format
=
{
.
wfx
.
nChannels
=
2
,
.
wfx
.
nSamplesPerSec
=
48000
,
};
DMO_MEDIA_TYPE
input_mt
=
...
...
@@ -391,13 +390,9 @@ static void test_stream_info(void)
.
pbFormat
=
(
BYTE
*
)
&
input_format
,
};
static
const
WAVEFORMATEX
output_format
=
WAVEFORMATEX
output_format
=
{
.
nChannels
=
1
,
.
nSamplesPerSec
=
48000
,
.
nAvgBytesPerSec
=
2
*
48000
,
.
nBlockAlign
=
2
,
.
wBitsPerSample
=
16
,
};
DMO_MEDIA_TYPE
output_mt
=
{
...
...
@@ -407,6 +402,7 @@ static void test_stream_info(void)
};
DWORD
input_count
,
output_count
,
flags
,
size
,
lookahead
,
alignment
;
WORD
channels
,
depth
;
IMediaObject
*
dmo
;
HRESULT
hr
;
...
...
@@ -434,6 +430,11 @@ static void test_stream_info(void)
hr
=
IMediaObject_GetOutputSizeInfo
(
dmo
,
0
,
&
size
,
&
alignment
);
ok
(
hr
==
DMO_E_TYPE_NOT_SET
,
"Got hr %#x.
\n
"
,
hr
);
for
(
channels
=
1
;
channels
<=
2
;
++
channels
)
{
input_format
.
wfx
.
nChannels
=
channels
;
output_format
.
nChannels
=
channels
;
hr
=
IMediaObject_SetInputType
(
dmo
,
0
,
&
input_mt
,
0
);
ok
(
hr
==
S_OK
,
"Got hr %#x.
\n
"
,
hr
);
...
...
@@ -442,21 +443,36 @@ static void test_stream_info(void)
hr
=
IMediaObject_GetOutputSizeInfo
(
dmo
,
0
,
&
size
,
&
alignment
);
ok
(
hr
==
DMO_E_TYPE_NOT_SET
,
"Got hr %#x.
\n
"
,
hr
);
for
(
depth
=
8
;
depth
<=
16
;
depth
+=
8
)
{
output_format
.
wBitsPerSample
=
depth
;
output_format
.
nBlockAlign
=
channels
*
depth
/
8
;
output_format
.
nAvgBytesPerSec
=
48000
*
output_format
.
nBlockAlign
;
hr
=
IMediaObject_SetOutputType
(
dmo
,
0
,
&
output_mt
,
0
);
ok
(
hr
==
S_OK
,
"Got hr %#x.
\n
"
,
hr
);
size
=
lookahead
=
alignment
=
0xdeadbeef
;
hr
=
IMediaObject_GetInputSizeInfo
(
dmo
,
0
,
&
size
,
&
lookahead
,
&
alignment
);
ok
(
hr
==
S_OK
,
"Got hr %#x.
\n
"
,
hr
);
ok
(
!
size
,
"Got size %u.
\n
"
,
size
);
ok
(
!
size
||
broken
(
size
==
output_format
.
nBlockAlign
)
/* Vista */
,
"Got size %u for %u channels, depth %u.
\n
"
,
size
,
channels
,
depth
);
ok
(
lookahead
==
0xdeadbeef
,
"Got lookahead %u.
\n
"
,
lookahead
);
ok
(
alignment
==
1
,
"Got alignment %u.
\n
"
,
alignment
);
size
=
alignment
=
0xdeadbeef
;
hr
=
IMediaObject_GetOutputSizeInfo
(
dmo
,
0
,
&
size
,
&
alignment
);
ok
(
hr
==
S_OK
,
"Got hr %#x.
\n
"
,
hr
);
ok
(
size
==
1152
*
4
,
"Got size %u.
\n
"
,
size
);
/* Vista returns the expected size; all later versions act as if
* channels == 2 for some reason. */
ok
(
size
>=
channels
*
1152
*
depth
/
8
,
"Got size %u for %u channels, depth %u.
\n
"
,
size
,
channels
,
depth
);
ok
(
alignment
==
1
,
"Got alignment %u.
\n
"
,
alignment
);
}
hr
=
IMediaObject_SetOutputType
(
dmo
,
0
,
&
output_mt
,
DMO_SET_TYPEF_CLEAR
);
ok
(
hr
==
S_OK
,
"Got hr %#x.
\n
"
,
hr
);
}
IMediaObject_Release
(
dmo
);
}
...
...
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