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
947d7af0
Commit
947d7af0
authored
Nov 20, 2023
by
Rémi Bernon
Committed by
Alexandre Julliard
Nov 22, 2023
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
mfplat/tests: Add IMFMediaType_GetRepresentation tests.
parent
486e6967
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
76 additions
and
0 deletions
+76
-0
mfplat.c
dlls/mfplat/tests/mfplat.c
+76
-0
No files found.
dlls/mfplat/tests/mfplat.c
View file @
947d7af0
...
...
@@ -7572,6 +7572,81 @@ skip_tests:
IMFMediaType_Release
(
media_type
);
}
static
void
test_IMFMediaType_GetRepresentation
(
void
)
{
WAVEFORMATEX
wfx
=
{.
wFormatTag
=
WAVE_FORMAT_PCM
};
IMFMediaType
*
media_type
;
AM_MEDIA_TYPE
*
am_type
;
HRESULT
hr
;
hr
=
MFCreateMediaType
(
&
media_type
);
ok
(
hr
==
S_OK
,
"Failed to create media type, hr %#lx.
\n
"
,
hr
);
hr
=
IMFMediaType_GetRepresentation
(
media_type
,
GUID_NULL
,
(
void
**
)
&
am_type
);
todo_wine
ok
(
hr
==
MF_E_UNSUPPORTED_REPRESENTATION
,
"Unexpected hr %#lx.
\n
"
,
hr
);
hr
=
IMFMediaType_GetRepresentation
(
media_type
,
AM_MEDIA_TYPE_REPRESENTATION
,
(
void
**
)
&
am_type
);
todo_wine
ok
(
hr
==
MF_E_ATTRIBUTENOTFOUND
,
"Unexpected hr %#lx.
\n
"
,
hr
);
hr
=
IMFMediaType_SetGUID
(
media_type
,
&
MF_MT_MAJOR_TYPE
,
&
MFMediaType_Audio
);
ok
(
hr
==
S_OK
,
"Unexpected hr %#lx.
\n
"
,
hr
);
hr
=
IMFMediaType_GetRepresentation
(
media_type
,
AM_MEDIA_TYPE_REPRESENTATION
,
(
void
**
)
&
am_type
);
todo_wine
ok
(
hr
==
MF_E_ATTRIBUTENOTFOUND
,
"Unexpected hr %#lx.
\n
"
,
hr
);
hr
=
IMFMediaType_SetGUID
(
media_type
,
&
MF_MT_MAJOR_TYPE
,
&
MFMediaType_Video
);
ok
(
hr
==
S_OK
,
"Unexpected hr %#lx.
\n
"
,
hr
);
hr
=
IMFMediaType_GetRepresentation
(
media_type
,
AM_MEDIA_TYPE_REPRESENTATION
,
(
void
**
)
&
am_type
);
todo_wine
ok
(
hr
==
MF_E_ATTRIBUTENOTFOUND
,
"Unexpected hr %#lx.
\n
"
,
hr
);
hr
=
IMFMediaType_SetGUID
(
media_type
,
&
MF_MT_MAJOR_TYPE
,
&
MFMediaType_Audio
);
ok
(
hr
==
S_OK
,
"Unexpected hr %#lx.
\n
"
,
hr
);
hr
=
IMFMediaType_SetGUID
(
media_type
,
&
MF_MT_SUBTYPE
,
&
MFAudioFormat_PCM
);
ok
(
hr
==
S_OK
,
"Unexpected hr %#lx.
\n
"
,
hr
);
hr
=
IMFMediaType_GetRepresentation
(
media_type
,
FORMAT_VideoInfo
,
(
void
**
)
&
am_type
);
todo_wine
ok
(
hr
==
E_INVALIDARG
,
"Unexpected hr %#lx.
\n
"
,
hr
);
hr
=
IMFMediaType_GetRepresentation
(
media_type
,
AM_MEDIA_TYPE_REPRESENTATION
,
(
void
**
)
&
am_type
);
todo_wine
ok
(
hr
==
S_OK
,
"Unexpected hr %#lx.
\n
"
,
hr
);
if
(
hr
!=
S_OK
)
goto
skip_tests
;
ok
(
IsEqualGUID
(
&
am_type
->
majortype
,
&
MFMediaType_Audio
),
"got %s.
\n
"
,
debugstr_guid
(
&
am_type
->
majortype
));
ok
(
IsEqualGUID
(
&
am_type
->
subtype
,
&
MFAudioFormat_PCM
),
"got %s.
\n
"
,
debugstr_guid
(
&
am_type
->
subtype
));
ok
(
IsEqualGUID
(
&
am_type
->
formattype
,
&
FORMAT_WaveFormatEx
),
"got %s.
\n
"
,
debugstr_guid
(
&
am_type
->
formattype
));
ok
(
am_type
->
cbFormat
==
sizeof
(
WAVEFORMATEX
),
"got %lu
\n
"
,
am_type
->
cbFormat
);
hr
=
IMFMediaType_FreeRepresentation
(
media_type
,
IID_IUnknown
/* invalid format */
,
am_type
);
ok
(
hr
==
S_OK
,
"Unexpected hr %#lx.
\n
"
,
hr
);
IMFMediaType_Release
(
media_type
);
hr
=
MFCreateAudioMediaType
(
&
wfx
,
(
IMFAudioMediaType
**
)
&
media_type
);
ok
(
hr
==
S_OK
,
"Unexpected hr %#lx.
\n
"
,
hr
);
hr
=
IMFMediaType_GetRepresentation
(
media_type
,
GUID_NULL
,
(
void
**
)
&
am_type
);
ok
(
hr
==
MF_E_UNSUPPORTED_REPRESENTATION
,
"Unexpected hr %#lx.
\n
"
,
hr
);
hr
=
IMFMediaType_GetRepresentation
(
media_type
,
FORMAT_VideoInfo
,
(
void
**
)
&
am_type
);
ok
(
hr
==
E_INVALIDARG
,
"Unexpected hr %#lx.
\n
"
,
hr
);
hr
=
IMFMediaType_GetRepresentation
(
media_type
,
AM_MEDIA_TYPE_REPRESENTATION
,
(
void
**
)
&
am_type
);
ok
(
hr
==
S_OK
,
"Unexpected hr %#lx.
\n
"
,
hr
);
ok
(
IsEqualGUID
(
&
am_type
->
majortype
,
&
MFMediaType_Audio
),
"got %s.
\n
"
,
debugstr_guid
(
&
am_type
->
majortype
));
ok
(
IsEqualGUID
(
&
am_type
->
subtype
,
&
MFAudioFormat_PCM
),
"got %s.
\n
"
,
debugstr_guid
(
&
am_type
->
subtype
));
ok
(
IsEqualGUID
(
&
am_type
->
formattype
,
&
FORMAT_WaveFormatEx
),
"got %s.
\n
"
,
debugstr_guid
(
&
am_type
->
formattype
));
ok
(
am_type
->
cbFormat
==
sizeof
(
WAVEFORMATEX
),
"got %lu
\n
"
,
am_type
->
cbFormat
);
hr
=
IMFMediaType_FreeRepresentation
(
media_type
,
AM_MEDIA_TYPE_REPRESENTATION
,
am_type
);
ok
(
hr
==
S_OK
,
"Unexpected hr %#lx.
\n
"
,
hr
);
IMFMediaType_Release
(
media_type
);
hr
=
MFCreateVideoMediaTypeFromSubtype
(
&
MFVideoFormat_RGB32
,
(
IMFVideoMediaType
**
)
&
media_type
);
ok
(
hr
==
S_OK
,
"Unexpected hr %#lx.
\n
"
,
hr
);
hr
=
IMFMediaType_GetRepresentation
(
media_type
,
GUID_NULL
,
(
void
**
)
&
am_type
);
ok
(
hr
==
MF_E_UNSUPPORTED_REPRESENTATION
,
"Unexpected hr %#lx.
\n
"
,
hr
);
hr
=
IMFMediaType_GetRepresentation
(
media_type
,
FORMAT_WaveFormatEx
,
(
void
**
)
&
am_type
);
ok
(
hr
==
MF_E_UNSUPPORTED_REPRESENTATION
,
"Unexpected hr %#lx.
\n
"
,
hr
);
hr
=
IMFMediaType_GetRepresentation
(
media_type
,
AM_MEDIA_TYPE_REPRESENTATION
,
(
void
**
)
&
am_type
);
ok
(
hr
==
S_OK
,
"Unexpected hr %#lx.
\n
"
,
hr
);
ok
(
IsEqualGUID
(
&
am_type
->
majortype
,
&
MFMediaType_Video
),
"got %s.
\n
"
,
debugstr_guid
(
&
am_type
->
majortype
));
ok
(
IsEqualGUID
(
&
am_type
->
subtype
,
&
MEDIASUBTYPE_RGB32
),
"got %s.
\n
"
,
debugstr_guid
(
&
am_type
->
subtype
));
ok
(
IsEqualGUID
(
&
am_type
->
formattype
,
&
FORMAT_VideoInfo
),
"got %s.
\n
"
,
debugstr_guid
(
&
am_type
->
formattype
));
ok
(
am_type
->
cbFormat
==
sizeof
(
VIDEOINFOHEADER
),
"got %lu
\n
"
,
am_type
->
cbFormat
);
hr
=
IMFMediaType_FreeRepresentation
(
media_type
,
AM_MEDIA_TYPE_REPRESENTATION
,
am_type
);
ok
(
hr
==
S_OK
,
"Unexpected hr %#lx.
\n
"
,
hr
);
skip_tests:
IMFMediaType_Release
(
media_type
);
}
static
void
test_MFCreateDXSurfaceBuffer
(
void
)
{
IDirect3DSurface9
*
backbuffer
=
NULL
,
*
surface
;
...
...
@@ -10318,6 +10393,7 @@ START_TEST(mfplat)
test_MFCreateMFVideoFormatFromMFMediaType
();
test_MFInitAMMediaTypeFromMFMediaType
();
test_MFCreateAMMediaTypeFromMFMediaType
();
test_IMFMediaType_GetRepresentation
();
test_MFCreateDXSurfaceBuffer
();
test_MFCreateTrackedSample
();
test_MFFrameRateToAverageTimePerFrame
();
...
...
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