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
77a71bc4
Commit
77a71bc4
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: Implement MFCreateAMMediaTypeFromMFMediaType.
parent
7f1eef65
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
20 additions
and
8 deletions
+20
-8
mediatype.c
dlls/mfplat/mediatype.c
+16
-2
mfplat.c
dlls/mfplat/tests/mfplat.c
+4
-6
No files found.
dlls/mfplat/mediatype.c
View file @
77a71bc4
...
...
@@ -3178,8 +3178,22 @@ static void media_type_get_ratio(IMFMediaType *media_type, const GUID *attr, DWO
*/
HRESULT
WINAPI
MFCreateAMMediaTypeFromMFMediaType
(
IMFMediaType
*
media_type
,
GUID
format
,
AM_MEDIA_TYPE
**
am_type
)
{
FIXME
(
"%p, %s, %p stub!
\n
"
,
media_type
,
debugstr_mf_guid
(
&
format
),
am_type
);
return
E_NOTIMPL
;
AM_MEDIA_TYPE
*
mt
;
HRESULT
hr
;
TRACE
(
"%p, %s, %p.
\n
"
,
media_type
,
debugstr_mf_guid
(
&
format
),
am_type
);
*
am_type
=
NULL
;
if
(
!
(
mt
=
CoTaskMemAlloc
(
sizeof
(
*
mt
))))
return
E_OUTOFMEMORY
;
if
(
FAILED
(
hr
=
MFInitAMMediaTypeFromMFMediaType
(
media_type
,
format
,
mt
)))
{
CoTaskMemFree
(
mt
);
return
hr
;
}
*
am_type
=
mt
;
return
hr
;
}
/***********************************************************************
...
...
dlls/mfplat/tests/mfplat.c
View file @
77a71bc4
...
...
@@ -7566,23 +7566,22 @@ static void test_MFCreateAMMediaTypeFromMFMediaType(void)
ok
(
hr
==
S_OK
,
"Failed to create media type, hr %#lx.
\n
"
,
hr
);
hr
=
MFCreateAMMediaTypeFromMFMediaType
(
media_type
,
GUID_NULL
,
&
am_type
);
todo_wine
ok
(
hr
==
MF_E_ATTRIBUTENOTFOUND
,
"Unexpected hr %#lx.
\n
"
,
hr
);
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
=
MFCreateAMMediaTypeFromMFMediaType
(
media_type
,
GUID_NULL
,
&
am_type
);
todo_wine
ok
(
hr
==
MF_E_ATTRIBUTENOTFOUND
,
"Unexpected hr %#lx.
\n
"
,
hr
);
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
=
MFCreateAMMediaTypeFromMFMediaType
(
media_type
,
GUID_NULL
,
&
am_type
);
todo_wine
ok
(
hr
==
MF_E_ATTRIBUTENOTFOUND
,
"Unexpected hr %#lx.
\n
"
,
hr
);
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
=
MFCreateAMMediaTypeFromMFMediaType
(
media_type
,
GUID_NULL
,
&
am_type
);
todo_wine
ok
(
hr
==
S_OK
,
"Unexpected hr %#lx.
\n
"
,
hr
);
if
(
hr
!=
S_OK
)
goto
skip_tests
;
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
));
...
...
@@ -7590,7 +7589,6 @@ static void test_MFCreateAMMediaTypeFromMFMediaType(void)
CoTaskMemFree
(
am_type
->
pbFormat
);
CoTaskMemFree
(
am_type
);
skip_tests:
IMFMediaType_Release
(
media_type
);
}
...
...
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