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
2e1fe519
Commit
2e1fe519
authored
Nov 18, 2023
by
Rémi Bernon
Committed by
Alexandre Julliard
Nov 22, 2023
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
mfplat: Implement IMFMediaType_(Get|Free)Representation.
parent
77a71bc4
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
40 additions
and
22 deletions
+40
-22
mediatype.c
dlls/mfplat/mediatype.c
+34
-14
mfplat.c
dlls/mfplat/tests/mfplat.c
+6
-8
No files found.
dlls/mfplat/mediatype.c
View file @
2e1fe519
...
...
@@ -634,16 +634,30 @@ static HRESULT WINAPI mediatype_IsEqual(IMFMediaType *iface, IMFMediaType *type,
static
HRESULT
WINAPI
mediatype_GetRepresentation
(
IMFMediaType
*
iface
,
GUID
guid
,
void
**
representation
)
{
FIXM
E
(
"%p, %s, %p.
\n
"
,
iface
,
debugstr_guid
(
&
guid
),
representation
);
TRAC
E
(
"%p, %s, %p.
\n
"
,
iface
,
debugstr_guid
(
&
guid
),
representation
);
return
E_NOTIMPL
;
if
(
IsEqualGUID
(
&
guid
,
&
AM_MEDIA_TYPE_REPRESENTATION
))
return
MFCreateAMMediaTypeFromMFMediaType
(
iface
,
GUID_NULL
,
(
AM_MEDIA_TYPE
**
)
representation
);
if
(
IsEqualGUID
(
&
guid
,
&
FORMAT_WaveFormatEx
)
||
IsEqualGUID
(
&
guid
,
&
FORMAT_VideoInfo
)
||
IsEqualGUID
(
&
guid
,
&
FORMAT_VideoInfo2
)
||
IsEqualGUID
(
&
guid
,
&
FORMAT_MFVideoFormat
))
return
MFCreateAMMediaTypeFromMFMediaType
(
iface
,
guid
,
(
AM_MEDIA_TYPE
**
)
representation
);
FIXME
(
"Format %s not implemented!
\n
"
,
debugstr_guid
(
&
guid
));
return
MF_E_UNSUPPORTED_REPRESENTATION
;
}
static
HRESULT
WINAPI
mediatype_FreeRepresentation
(
IMFMediaType
*
iface
,
GUID
guid
,
void
*
representation
)
{
FIXME
(
"%p, %s, %p.
\n
"
,
iface
,
debugstr_guid
(
&
guid
),
representation
)
;
AM_MEDIA_TYPE
*
am_type
=
representation
;
return
E_NOTIMPL
;
TRACE
(
"%p, %s, %p.
\n
"
,
iface
,
debugstr_guid
(
&
guid
),
representation
);
CoTaskMemFree
(
am_type
->
pbFormat
);
CoTaskMemFree
(
am_type
);
return
S_OK
;
}
static
const
IMFMediaTypeVtbl
mediatypevtbl
=
...
...
@@ -1009,16 +1023,18 @@ static HRESULT WINAPI video_mediatype_IsEqual(IMFVideoMediaType *iface, IMFMedia
static
HRESULT
WINAPI
video_mediatype_GetRepresentation
(
IMFVideoMediaType
*
iface
,
GUID
guid
,
void
**
representation
)
{
FIXM
E
(
"%p, %s, %p.
\n
"
,
iface
,
debugstr_guid
(
&
guid
),
representation
);
TRAC
E
(
"%p, %s, %p.
\n
"
,
iface
,
debugstr_guid
(
&
guid
),
representation
);
return
E_NOTIMPL
;
if
(
IsEqualGUID
(
&
guid
,
&
FORMAT_WaveFormatEx
))
return
MF_E_UNSUPPORTED_REPRESENTATION
;
return
mediatype_GetRepresentation
((
IMFMediaType
*
)
iface
,
guid
,
representation
);
}
static
HRESULT
WINAPI
video_mediatype_FreeRepresentation
(
IMFVideoMediaType
*
iface
,
GUID
guid
,
void
*
representation
)
{
FIXME
(
"%p, %s, %p.
\n
"
,
iface
,
debugstr_guid
(
&
guid
),
representation
);
return
E_NOTIMPL
;
TRACE
(
"%p, %s, %p.
\n
"
,
iface
,
debugstr_guid
(
&
guid
),
representation
);
return
mediatype_FreeRepresentation
((
IMFMediaType
*
)
iface
,
guid
,
representation
);
}
static
const
MFVIDEOFORMAT
*
WINAPI
video_mediatype_GetVideoFormat
(
IMFVideoMediaType
*
iface
)
...
...
@@ -1410,16 +1426,20 @@ static HRESULT WINAPI audio_mediatype_IsEqual(IMFAudioMediaType *iface, IMFMedia
static
HRESULT
WINAPI
audio_mediatype_GetRepresentation
(
IMFAudioMediaType
*
iface
,
GUID
guid
,
void
**
representation
)
{
FIXM
E
(
"%p, %s, %p.
\n
"
,
iface
,
debugstr_guid
(
&
guid
),
representation
);
TRAC
E
(
"%p, %s, %p.
\n
"
,
iface
,
debugstr_guid
(
&
guid
),
representation
);
return
E_NOTIMPL
;
if
(
IsEqualGUID
(
&
guid
,
&
FORMAT_VideoInfo
)
||
IsEqualGUID
(
&
guid
,
&
FORMAT_VideoInfo2
)
||
IsEqualGUID
(
&
guid
,
&
FORMAT_MFVideoFormat
))
return
E_INVALIDARG
;
return
mediatype_GetRepresentation
((
IMFMediaType
*
)
iface
,
guid
,
representation
);
}
static
HRESULT
WINAPI
audio_mediatype_FreeRepresentation
(
IMFAudioMediaType
*
iface
,
GUID
guid
,
void
*
representation
)
{
FIXME
(
"%p, %s, %p.
\n
"
,
iface
,
debugstr_guid
(
&
guid
),
representation
);
return
E_NOTIMPL
;
TRACE
(
"%p, %s, %p.
\n
"
,
iface
,
debugstr_guid
(
&
guid
),
representation
);
return
mediatype_FreeRepresentation
((
IMFMediaType
*
)
iface
,
guid
,
representation
);
}
static
const
WAVEFORMATEX
*
WINAPI
audio_mediatype_GetAudioFormat
(
IMFAudioMediaType
*
iface
)
...
...
dlls/mfplat/tests/mfplat.c
View file @
2e1fe519
...
...
@@ -7603,27 +7603,26 @@ static void test_IMFMediaType_GetRepresentation(void)
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
);
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
);
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
);
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
);
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
);
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
(
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
));
...
...
@@ -7663,7 +7662,6 @@ static void test_IMFMediaType_GetRepresentation(void)
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
);
}
...
...
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