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
e2bcf440
Commit
e2bcf440
authored
Oct 09, 2020
by
Nikolay Sivov
Committed by
Alexandre Julliard
Oct 09, 2020
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
mf/evr: Implement IsMediaTypeSupported().
Signed-off-by:
Nikolay Sivov
<
nsivov@codeweavers.com
>
Signed-off-by:
Alexandre Julliard
<
julliard@winehq.org
>
parent
24c9d77c
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
61 additions
and
11 deletions
+61
-11
evr.c
dlls/mf/evr.c
+49
-11
mf.c
dlls/mf/tests/mf.c
+12
-0
No files found.
dlls/mf/evr.c
View file @
e2bcf440
...
@@ -362,12 +362,57 @@ static ULONG WINAPI video_stream_typehandler_Release(IMFMediaTypeHandler *iface)
...
@@ -362,12 +362,57 @@ static ULONG WINAPI video_stream_typehandler_Release(IMFMediaTypeHandler *iface)
return
IMFStreamSink_Release
(
&
stream
->
IMFStreamSink_iface
);
return
IMFStreamSink_Release
(
&
stream
->
IMFStreamSink_iface
);
}
}
/* Mixer expects special video media type instance. */
static
HRESULT
video_renderer_create_video_type
(
IMFMediaType
*
media_type
,
IMFVideoMediaType
**
video_type
)
{
GUID
subtype
;
HRESULT
hr
;
*
video_type
=
NULL
;
if
(
FAILED
(
hr
=
IMFMediaType_GetGUID
(
media_type
,
&
MF_MT_SUBTYPE
,
&
subtype
)))
return
hr
;
if
(
FAILED
(
hr
=
MFCreateVideoMediaTypeFromSubtype
(
&
subtype
,
video_type
)))
return
hr
;
hr
=
IMFMediaType_CopyAllItems
(
media_type
,
(
IMFAttributes
*
)
*
video_type
);
if
(
FAILED
(
hr
))
{
IMFVideoMediaType_Release
(
*
video_type
);
*
video_type
=
NULL
;
}
return
hr
;
}
static
HRESULT
WINAPI
video_stream_typehandler_IsMediaTypeSupported
(
IMFMediaTypeHandler
*
iface
,
static
HRESULT
WINAPI
video_stream_typehandler_IsMediaTypeSupported
(
IMFMediaTypeHandler
*
iface
,
IMFMediaType
*
in_type
,
IMFMediaType
**
out_type
)
IMFMediaType
*
in_type
,
IMFMediaType
**
out_type
)
{
{
FIXME
(
"%p, %p, %p.
\n
"
,
iface
,
in_type
,
out_type
);
struct
video_stream
*
stream
=
impl_from_IMFMediaTypeHandler
(
iface
);
IMFVideoMediaType
*
video_type
;
HRESULT
hr
;
return
E_NOTIMPL
;
TRACE
(
"%p, %p, %p.
\n
"
,
iface
,
in_type
,
out_type
);
if
(
!
in_type
)
return
E_POINTER
;
if
(
!
stream
->
parent
)
return
MF_E_INVALIDMEDIATYPE
;
if
(
FAILED
(
hr
=
video_renderer_create_video_type
(
in_type
,
&
video_type
)))
return
hr
;
if
(
SUCCEEDED
(
hr
=
IMFTransform_SetInputType
(
stream
->
parent
->
mixer
,
stream
->
id
,
(
IMFMediaType
*
)
video_type
,
MFT_SET_TYPE_TEST_ONLY
)))
{
if
(
out_type
)
*
out_type
=
NULL
;
}
IMFVideoMediaType_Release
(
video_type
);
return
hr
;
}
}
static
HRESULT
WINAPI
video_stream_typehandler_GetMediaTypeCount
(
IMFMediaTypeHandler
*
iface
,
DWORD
*
count
)
static
HRESULT
WINAPI
video_stream_typehandler_GetMediaTypeCount
(
IMFMediaTypeHandler
*
iface
,
DWORD
*
count
)
...
@@ -394,7 +439,6 @@ static HRESULT WINAPI video_stream_typehandler_SetCurrentMediaType(IMFMediaTypeH
...
@@ -394,7 +439,6 @@ static HRESULT WINAPI video_stream_typehandler_SetCurrentMediaType(IMFMediaTypeH
{
{
struct
video_stream
*
stream
=
impl_from_IMFMediaTypeHandler
(
iface
);
struct
video_stream
*
stream
=
impl_from_IMFMediaTypeHandler
(
iface
);
IMFVideoMediaType
*
video_type
;
IMFVideoMediaType
*
video_type
;
GUID
subtype
;
HRESULT
hr
;
HRESULT
hr
;
TRACE
(
"%p, %p.
\n
"
,
iface
,
type
);
TRACE
(
"%p, %p.
\n
"
,
iface
,
type
);
...
@@ -405,16 +449,10 @@ static HRESULT WINAPI video_stream_typehandler_SetCurrentMediaType(IMFMediaTypeH
...
@@ -405,16 +449,10 @@ static HRESULT WINAPI video_stream_typehandler_SetCurrentMediaType(IMFMediaTypeH
if
(
!
stream
->
parent
)
if
(
!
stream
->
parent
)
return
MF_E_STREAMSINK_REMOVED
;
return
MF_E_STREAMSINK_REMOVED
;
if
(
FAILED
(
hr
=
IMFMediaType_GetGUID
(
type
,
&
MF_MT_SUBTYPE
,
&
subtype
)))
if
(
FAILED
(
hr
=
video_renderer_create_video_type
(
type
,
&
video_type
)))
return
hr
;
/* Mixer expects special video media type instance. */
if
(
FAILED
(
hr
=
MFCreateVideoMediaTypeFromSubtype
(
&
subtype
,
&
video_type
)))
return
hr
;
return
hr
;
if
(
SUCCEEDED
(
hr
=
IMFMediaType_CopyAllItems
(
type
,
(
IMFAttributes
*
)
video_type
)))
hr
=
IMFTransform_SetInputType
(
stream
->
parent
->
mixer
,
stream
->
id
,
(
IMFMediaType
*
)
video_type
,
0
);
hr
=
IMFTransform_SetInputType
(
stream
->
parent
->
mixer
,
stream
->
id
,
(
IMFMediaType
*
)
video_type
,
0
);
IMFVideoMediaType_Release
(
video_type
);
IMFVideoMediaType_Release
(
video_type
);
return
hr
;
return
hr
;
...
...
dlls/mf/tests/mf.c
View file @
e2bcf440
...
@@ -3332,9 +3332,21 @@ static void test_evr(void)
...
@@ -3332,9 +3332,21 @@ static void test_evr(void)
hr
=
IMFMediaType_SetUINT64
(
media_type
,
&
MF_MT_FRAME_SIZE
,
(
UINT64
)
640
<<
32
|
480
);
hr
=
IMFMediaType_SetUINT64
(
media_type
,
&
MF_MT_FRAME_SIZE
,
(
UINT64
)
640
<<
32
|
480
);
ok
(
hr
==
S_OK
,
"Unexpected hr %#x.
\n
"
,
hr
);
ok
(
hr
==
S_OK
,
"Unexpected hr %#x.
\n
"
,
hr
);
hr
=
IMFMediaTypeHandler_IsMediaTypeSupported
(
type_handler
,
NULL
,
NULL
);
ok
(
hr
==
E_POINTER
,
"Unexpected hr %#x.
\n
"
,
hr
);
hr
=
IMFMediaTypeHandler_IsMediaTypeSupported
(
type_handler
,
media_type
,
&
media_type2
);
ok
(
hr
==
MF_E_INVALIDMEDIATYPE
,
"Unexpected hr %#x.
\n
"
,
hr
);
hr
=
IMFMediaType_SetUINT32
(
media_type
,
&
MF_MT_ALL_SAMPLES_INDEPENDENT
,
TRUE
);
hr
=
IMFMediaType_SetUINT32
(
media_type
,
&
MF_MT_ALL_SAMPLES_INDEPENDENT
,
TRUE
);
ok
(
hr
==
S_OK
,
"Unexpected hr %#x.
\n
"
,
hr
);
ok
(
hr
==
S_OK
,
"Unexpected hr %#x.
\n
"
,
hr
);
media_type2
=
(
void
*
)
0x1
;
hr
=
IMFMediaTypeHandler_IsMediaTypeSupported
(
type_handler
,
media_type
,
&
media_type2
);
ok
(
hr
==
S_OK
,
"Unexpected hr %#x.
\n
"
,
hr
);
ok
(
!
media_type2
,
"Unexpected media type %p.
\n
"
,
media_type2
);
hr
=
IMFMediaTypeHandler_SetCurrentMediaType
(
type_handler
,
media_type
);
hr
=
IMFMediaTypeHandler_SetCurrentMediaType
(
type_handler
,
media_type
);
ok
(
hr
==
S_OK
,
"Unexpected hr %#x.
\n
"
,
hr
);
ok
(
hr
==
S_OK
,
"Unexpected hr %#x.
\n
"
,
hr
);
...
...
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