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
a66690d2
Commit
a66690d2
authored
Sep 08, 2022
by
Rémi Bernon
Committed by
Alexandre Julliard
Sep 13, 2022
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
mf/tests: Factor IMFTransform required attributes checks together.
parent
9ee48de4
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
47 additions
and
35 deletions
+47
-35
mf.c
dlls/mf/tests/mf.c
+46
-35
mf_test.h
dlls/mf/tests/mf_test.h
+1
-0
transform.c
dlls/mf/tests/transform.c
+0
-0
No files found.
dlls/mf/tests/mf.c
View file @
a66690d2
...
...
@@ -102,6 +102,37 @@ static HWND create_window(void)
0
,
0
,
r
.
right
-
r
.
left
,
r
.
bottom
-
r
.
top
,
NULL
,
NULL
,
NULL
,
NULL
);
}
#define check_handler_required_attributes(a, b) check_handler_required_attributes_(__LINE__, a, b)
static
void
check_handler_required_attributes_
(
int
line
,
IMFMediaTypeHandler
*
handler
,
const
struct
attribute_desc
*
attributes
)
{
const
struct
attribute_desc
*
attr
;
IMFMediaType
*
media_type
;
HRESULT
hr
;
ULONG
ref
;
hr
=
MFCreateMediaType
(
&
media_type
);
ok_
(
__FILE__
,
line
)(
hr
==
S_OK
,
"MFCreateMediaType returned hr %#lx.
\n
"
,
hr
);
init_media_type
(
media_type
,
attributes
,
-
1
);
for
(
attr
=
attributes
;
attr
&&
attr
->
key
;
attr
++
)
{
winetest_push_context
(
"%s"
,
debugstr_a
(
attr
->
name
));
hr
=
IMFMediaType_DeleteItem
(
media_type
,
attr
->
key
);
ok_
(
__FILE__
,
line
)(
hr
==
S_OK
,
"DeleteItem returned %#lx
\n
"
,
hr
);
hr
=
IMFMediaTypeHandler_IsMediaTypeSupported
(
handler
,
media_type
,
NULL
);
todo_wine_if
(
attr
->
todo
)
ok_
(
__FILE__
,
line
)(
FAILED
(
hr
)
==
attr
->
required
,
"IsMediaTypeSupported returned %#lx.
\n
"
,
hr
);
hr
=
IMFMediaType_SetItem
(
media_type
,
attr
->
key
,
&
attr
->
value
);
ok_
(
__FILE__
,
line
)(
hr
==
S_OK
,
"SetItem returned %#lx
\n
"
,
hr
);
winetest_pop_context
();
}
hr
=
IMFMediaTypeHandler_IsMediaTypeSupported
(
handler
,
media_type
,
NULL
);
ok_
(
__FILE__
,
line
)(
hr
==
S_OK
,
"IsMediaTypeSupported returned %#lx.
\n
"
,
hr
);
ref
=
IMFMediaType_Release
(
media_type
);
ok_
(
__FILE__
,
line
)(
!
ref
,
"Release returned %lu
\n
"
,
ref
);
}
static
void
create_descriptors
(
UINT
enum_types_count
,
IMFMediaType
**
enum_types
,
const
media_type_desc
*
current_desc
,
IMFPresentationDescriptor
**
pd
,
IMFStreamDescriptor
**
sd
)
{
...
...
@@ -4777,24 +4808,24 @@ static void test_sar(void)
{
static
const
struct
attribute_desc
input_type_desc_48000
[]
=
{
ATTR_GUID
(
MF_MT_MAJOR_TYPE
,
MFMediaType_Audio
),
ATTR_GUID
(
MF_MT_SUBTYPE
,
MFAudioFormat_Float
),
ATTR_UINT32
(
MF_MT_AUDIO_
SAMPLES_PER_SECOND
,
48000
),
ATTR_UINT32
(
MF_MT_AUDIO_
NUM_CHANNELS
,
2
),
ATTR_UINT32
(
MF_MT_AUDIO_
BITS_PER_SAMPLE
,
32
),
ATTR_UINT32
(
MF_MT_AUDIO_BLOCK_ALIGNMENT
,
8
),
ATTR_UINT32
(
MF_MT_AUDIO_AVG_BYTES_PER_SECOND
,
8
*
48000
),
ATTR_GUID
(
MF_MT_MAJOR_TYPE
,
MFMediaType_Audio
,
.
required
=
TRUE
),
ATTR_GUID
(
MF_MT_SUBTYPE
,
MFAudioFormat_Float
,
.
required
=
TRUE
,
.
todo
=
TRUE
),
ATTR_UINT32
(
MF_MT_AUDIO_
NUM_CHANNELS
,
2
,
.
required
=
TRUE
),
ATTR_UINT32
(
MF_MT_AUDIO_
BITS_PER_SAMPLE
,
32
,
.
required
=
TRUE
),
ATTR_UINT32
(
MF_MT_AUDIO_
SAMPLES_PER_SECOND
,
48000
,
.
required
=
TRUE
),
ATTR_UINT32
(
MF_MT_AUDIO_BLOCK_ALIGNMENT
,
2
*
(
32
/
8
),
.
required
=
TRUE
),
ATTR_UINT32
(
MF_MT_AUDIO_AVG_BYTES_PER_SECOND
,
2
*
(
32
/
8
)
*
48000
,
.
required
=
TRUE
),
{
0
},
};
static
const
struct
attribute_desc
input_type_desc_44100
[]
=
{
ATTR_GUID
(
MF_MT_MAJOR_TYPE
,
MFMediaType_Audio
),
ATTR_GUID
(
MF_MT_SUBTYPE
,
MFAudioFormat_Float
),
ATTR_UINT32
(
MF_MT_AUDIO_
SAMPLES_PER_SECOND
,
44100
),
ATTR_UINT32
(
MF_MT_AUDIO_
NUM_CHANNELS
,
2
),
ATTR_UINT32
(
MF_MT_AUDIO_
BITS_PER_SAMPLE
,
32
),
ATTR_UINT32
(
MF_MT_AUDIO_BLOCK_ALIGNMENT
,
8
),
ATTR_UINT32
(
MF_MT_AUDIO_AVG_BYTES_PER_SECOND
,
8
*
44100
),
ATTR_GUID
(
MF_MT_MAJOR_TYPE
,
MFMediaType_Audio
,
.
required
=
TRUE
),
ATTR_GUID
(
MF_MT_SUBTYPE
,
MFAudioFormat_Float
,
.
required
=
TRUE
,
.
todo
=
TRUE
),
ATTR_UINT32
(
MF_MT_AUDIO_
NUM_CHANNELS
,
2
,
.
required
=
TRUE
),
ATTR_UINT32
(
MF_MT_AUDIO_
BITS_PER_SAMPLE
,
32
,
.
required
=
TRUE
),
ATTR_UINT32
(
MF_MT_AUDIO_
SAMPLES_PER_SECOND
,
44100
,
.
required
=
TRUE
),
ATTR_UINT32
(
MF_MT_AUDIO_BLOCK_ALIGNMENT
,
2
*
(
32
/
8
),
.
required
=
TRUE
),
ATTR_UINT32
(
MF_MT_AUDIO_AVG_BYTES_PER_SECOND
,
2
*
(
32
/
8
)
*
44100
,
.
required
=
TRUE
),
{
0
},
};
...
...
@@ -4989,27 +5020,7 @@ if (SUCCEEDED(hr))
ok
(
rate
==
48000
||
rate
==
44100
,
"got rate %u.
\n
"
,
rate
);
IMFMediaType_Release
(
mediatype
);
/* check required output media type attributes */
hr
=
MFCreateMediaType
(
&
mediatype
);
ok
(
hr
==
S_OK
,
"MFCreateMediaType returned %#lx
\n
"
,
hr
);
hr
=
IMFMediaTypeHandler_IsMediaTypeSupported
(
handler
,
mediatype
,
NULL
);
ok
(
hr
==
MF_E_ATTRIBUTENOTFOUND
,
"Unexpected hr %#lx.
\n
"
,
hr
);
init_media_type
(
mediatype
,
rate
==
44100
?
input_type_desc_44100
:
input_type_desc_48000
,
2
);
for
(
int
i
=
1
;
i
<
(
rate
==
44100
?
ARRAY_SIZE
(
input_type_desc_44100
)
:
ARRAY_SIZE
(
input_type_desc_48000
))
-
1
;
++
i
)
{
hr
=
IMFMediaTypeHandler_IsMediaTypeSupported
(
handler
,
mediatype
,
NULL
);
ok
(
hr
==
MF_E_INVALIDMEDIATYPE
,
"Unexpected hr %#lx.
\n
"
,
hr
);
init_media_type
(
mediatype
,
rate
==
44100
?
input_type_desc_44100
:
input_type_desc_48000
,
i
+
1
);
}
hr
=
IMFMediaTypeHandler_IsMediaTypeSupported
(
handler
,
mediatype
,
NULL
);
ok
(
hr
==
S_OK
,
"Unexpected hr %#lx.
\n
"
,
hr
);
init_media_type
(
mediatype
,
rate
==
44100
?
input_type_desc_44100
:
input_type_desc_48000
,
-
1
);
hr
=
IMFMediaTypeHandler_IsMediaTypeSupported
(
handler
,
mediatype
,
NULL
);
ok
(
hr
==
S_OK
,
"Unexpected hr %#lx.
\n
"
,
hr
);
IMFMediaType_Release
(
mediatype
);
check_handler_required_attributes
(
handler
,
rate
==
44100
?
input_type_desc_44100
:
input_type_desc_48000
);
hr
=
IMFMediaTypeHandler_GetCurrentMediaType
(
handler
,
&
mediatype
);
ok
(
hr
==
MF_E_NOT_INITIALIZED
,
"Unexpected hr %#lx.
\n
"
,
hr
);
...
...
dlls/mf/tests/mf_test.h
View file @
a66690d2
...
...
@@ -41,6 +41,7 @@ struct attribute_desc
const
char
*
name
;
PROPVARIANT
value
;
BOOL
ratio
;
BOOL
required
;
BOOL
todo
;
BOOL
todo_value
;
};
...
...
dlls/mf/tests/transform.c
View file @
a66690d2
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