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
1e053810
Commit
1e053810
authored
Mar 05, 2024
by
Rémi Bernon
Committed by
Alexandre Julliard
Mar 21, 2024
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
mfplat/mediatype: Implement MFCreateMediaTypeFromRepresentation.
parent
a4fb357c
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
80 additions
and
1 deletion
+80
-1
mediatype.c
dlls/mfplat/mediatype.c
+26
-0
mfplat.spec
dlls/mfplat/mfplat.spec
+1
-1
mfplat.c
dlls/mfplat/tests/mfplat.c
+51
-0
mfapi.h
include/mfapi.h
+2
-0
No files found.
dlls/mfplat/mediatype.c
View file @
1e053810
...
...
@@ -4334,3 +4334,29 @@ HRESULT WINAPI MFInitMediaTypeFromAMMediaType(IMFMediaType *media_type, const AM
return
hr
;
}
/***********************************************************************
* MFCreateMediaTypeFromRepresentation (mfplat.@)
*/
HRESULT
WINAPI
MFCreateMediaTypeFromRepresentation
(
GUID
guid_representation
,
void
*
representation
,
IMFMediaType
**
media_type
)
{
HRESULT
hr
;
TRACE
(
"%s, %p, %p
\n
"
,
debugstr_guid
(
&
guid_representation
),
representation
,
media_type
);
if
(
!
IsEqualGUID
(
&
guid_representation
,
&
AM_MEDIA_TYPE_REPRESENTATION
))
return
MF_E_UNSUPPORTED_REPRESENTATION
;
if
(
!
representation
||
!
media_type
)
return
E_INVALIDARG
;
if
(
FAILED
(
hr
=
MFCreateMediaType
(
media_type
)))
return
hr
;
if
(
FAILED
(
hr
=
MFInitMediaTypeFromAMMediaType
(
*
media_type
,
representation
)))
{
IMFMediaType_Release
(
*
media_type
);
*
media_type
=
NULL
;
}
return
hr
;
}
dlls/mfplat/mfplat.spec
View file @
1e053810
...
...
@@ -59,7 +59,7 @@
@ stub MFCreateMediaBufferWrapper
@ stdcall MFCreateMediaEvent(long ptr long ptr ptr)
@ stdcall MFCreateMediaType(ptr)
@ st
ub MFCreateMediaTypeFromRepresentation
@ st
dcall MFCreateMediaTypeFromRepresentation(int128 ptr ptr)
@ stdcall MFCreateMemoryBuffer(long ptr)
@ stub MFCreateMemoryStream
@ stdcall MFCreatePathFromURL(wstr ptr)
...
...
dlls/mfplat/tests/mfplat.c
View file @
1e053810
...
...
@@ -8524,6 +8524,56 @@ static void test_IMFMediaType_GetRepresentation(void)
IMFMediaType_Release
(
media_type
);
}
static
void
test_MFCreateMediaTypeFromRepresentation
(
void
)
{
IMFMediaType
*
media_type
;
AM_MEDIA_TYPE
amt
=
{
0
};
WAVEFORMATEX
wfx
=
{
0
};
HRESULT
hr
;
GUID
guid
;
hr
=
MFCreateMediaTypeFromRepresentation
(
GUID_NULL
,
&
amt
,
&
media_type
);
ok
(
hr
==
MF_E_UNSUPPORTED_REPRESENTATION
,
"Unexpected hr %#lx.
\n
"
,
hr
);
hr
=
MFCreateMediaTypeFromRepresentation
(
AM_MEDIA_TYPE_REPRESENTATION
,
NULL
,
&
media_type
);
ok
(
hr
==
E_INVALIDARG
,
"Unexpected hr %#lx.
\n
"
,
hr
);
hr
=
MFCreateMediaTypeFromRepresentation
(
AM_MEDIA_TYPE_REPRESENTATION
,
&
amt
,
NULL
);
ok
(
hr
==
E_INVALIDARG
,
"Unexpected hr %#lx.
\n
"
,
hr
);
hr
=
MFCreateMediaTypeFromRepresentation
(
AM_MEDIA_TYPE_REPRESENTATION
,
&
amt
,
&
media_type
);
todo_wine
ok
(
hr
==
S_OK
,
"Unexpected hr %#lx.
\n
"
,
hr
);
if
(
hr
==
S_OK
)
{
memset
(
&
guid
,
0xcd
,
sizeof
(
guid
));
hr
=
IMFMediaType_GetGUID
(
media_type
,
&
MF_MT_MAJOR_TYPE
,
&
guid
);
ok
(
hr
==
S_OK
,
"Unexpected hr %#lx.
\n
"
,
hr
);
ok
(
IsEqualGUID
(
&
guid
,
&
GUID_NULL
),
"got %s.
\n
"
,
debugstr_guid
(
&
guid
));
memset
(
&
guid
,
0xcd
,
sizeof
(
guid
));
hr
=
IMFMediaType_GetGUID
(
media_type
,
&
MF_MT_SUBTYPE
,
&
guid
);
ok
(
hr
==
S_OK
,
"Unexpected hr %#lx.
\n
"
,
hr
);
ok
(
IsEqualGUID
(
&
guid
,
&
GUID_NULL
),
"got %s.
\n
"
,
debugstr_guid
(
&
guid
));
IMFMediaType_Release
(
media_type
);
}
amt
.
formattype
=
FORMAT_WaveFormatEx
;
amt
.
majortype
=
MFMediaType_Audio
;
amt
.
subtype
=
MFAudioFormat_PCM
;
amt
.
pbFormat
=
(
BYTE
*
)
&
wfx
;
amt
.
cbFormat
=
sizeof
(
wfx
);
hr
=
MFCreateMediaTypeFromRepresentation
(
AM_MEDIA_TYPE_REPRESENTATION
,
&
amt
,
&
media_type
);
ok
(
hr
==
S_OK
,
"Unexpected hr %#lx.
\n
"
,
hr
);
memset
(
&
guid
,
0xcd
,
sizeof
(
guid
));
hr
=
IMFMediaType_GetGUID
(
media_type
,
&
MF_MT_MAJOR_TYPE
,
&
guid
);
ok
(
hr
==
S_OK
,
"Unexpected hr %#lx.
\n
"
,
hr
);
ok
(
IsEqualGUID
(
&
guid
,
&
MFMediaType_Audio
),
"got %s.
\n
"
,
debugstr_guid
(
&
guid
));
memset
(
&
guid
,
0xcd
,
sizeof
(
guid
));
hr
=
IMFMediaType_GetGUID
(
media_type
,
&
MF_MT_SUBTYPE
,
&
guid
);
ok
(
hr
==
S_OK
,
"Unexpected hr %#lx.
\n
"
,
hr
);
todo_wine
ok
(
IsEqualGUID
(
&
guid
,
&
MFAudioFormat_PCM
),
"got %s.
\n
"
,
debugstr_guid
(
&
guid
));
IMFMediaType_Release
(
media_type
);
}
static
void
test_MFCreateDXSurfaceBuffer
(
void
)
{
IDirect3DSurface9
*
backbuffer
=
NULL
,
*
surface
;
...
...
@@ -11798,6 +11848,7 @@ START_TEST(mfplat)
test_MFCreateAMMediaTypeFromMFMediaType
();
test_MFInitMediaTypeFromMFVideoFormat
();
test_IMFMediaType_GetRepresentation
();
test_MFCreateMediaTypeFromRepresentation
();
test_MFCreateDXSurfaceBuffer
();
test_MFCreateTrackedSample
();
test_MFFrameRateToAverageTimePerFrame
();
...
...
include/mfapi.h
View file @
1e053810
...
...
@@ -549,6 +549,8 @@ HRESULT WINAPI MFCreateMediaEvent(MediaEventType type, REFGUID extended_type, HR
HRESULT
WINAPI
MFCreateMediaType
(
IMFMediaType
**
type
);
HRESULT
WINAPI
MFCreateAMMediaTypeFromMFMediaType
(
IMFMediaType
*
media_type
,
GUID
format_type
,
AM_MEDIA_TYPE
**
am_type
);
HRESULT
WINAPI
MFCreateMFVideoFormatFromMFMediaType
(
IMFMediaType
*
media_type
,
MFVIDEOFORMAT
**
video_format
,
UINT32
*
size
);
HRESULT
WINAPI
MFCreateMediaTypeFromRepresentation
(
GUID
guid_representation
,
void
*
representation
,
IMFMediaType
**
media_type
);
HRESULT
WINAPI
MFCreateSample
(
IMFSample
**
sample
);
HRESULT
WINAPI
MFCreateTempFile
(
MF_FILE_ACCESSMODE
accessmode
,
MF_FILE_OPENMODE
openmode
,
MF_FILE_FLAGS
flags
,
IMFByteStream
**
bytestream
);
...
...
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