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
a2c8658b
Commit
a2c8658b
authored
May 20, 2019
by
Nikolay Sivov
Committed by
Alexandre Julliard
May 20, 2019
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
mf: Add IMFMediaTypeHandler stub for grabber stream.
Signed-off-by:
Nikolay Sivov
<
nsivov@codeweavers.com
>
Signed-off-by:
Alexandre Julliard
<
julliard@winehq.org
>
parent
dfd8457f
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
112 additions
and
23 deletions
+112
-23
samplegrabber.c
dlls/mf/samplegrabber.c
+96
-2
mf.c
dlls/mf/tests/mf.c
+16
-21
No files found.
dlls/mf/samplegrabber.c
View file @
a2c8658b
...
...
@@ -30,6 +30,7 @@ WINE_DEFAULT_DEBUG_CHANNEL(mfplat);
struct
sample_grabber_stream
{
IMFStreamSink
IMFStreamSink_iface
;
IMFMediaTypeHandler
IMFMediaTypeHandler_iface
;
LONG
refcount
;
IMFMediaSink
*
sink
;
};
...
...
@@ -69,6 +70,11 @@ static struct sample_grabber_stream *impl_from_IMFStreamSink(IMFStreamSink *ifac
return
CONTAINING_RECORD
(
iface
,
struct
sample_grabber_stream
,
IMFStreamSink_iface
);
}
static
struct
sample_grabber_stream
*
impl_from_IMFMediaTypeHandler
(
IMFMediaTypeHandler
*
iface
)
{
return
CONTAINING_RECORD
(
iface
,
struct
sample_grabber_stream
,
IMFMediaTypeHandler_iface
);
}
static
HRESULT
WINAPI
sample_grabber_stream_QueryInterface
(
IMFStreamSink
*
iface
,
REFIID
riid
,
void
**
obj
)
{
struct
sample_grabber_stream
*
stream
=
impl_from_IMFStreamSink
(
iface
);
...
...
@@ -80,6 +86,10 @@ static HRESULT WINAPI sample_grabber_stream_QueryInterface(IMFStreamSink *iface,
{
*
obj
=
&
stream
->
IMFStreamSink_iface
;
}
else
if
(
IsEqualIID
(
riid
,
&
IID_IMFMediaTypeHandler
))
{
*
obj
=
&
stream
->
IMFMediaTypeHandler_iface
;
}
else
{
WARN
(
"Unsupported %s.
\n
"
,
debugstr_guid
(
riid
));
...
...
@@ -172,9 +182,14 @@ static HRESULT WINAPI sample_grabber_stream_GetIdentifier(IMFStreamSink *iface,
static
HRESULT
WINAPI
sample_grabber_stream_GetMediaTypeHandler
(
IMFStreamSink
*
iface
,
IMFMediaTypeHandler
**
handler
)
{
FIXME
(
"%p, %p.
\n
"
,
iface
,
handler
);
struct
sample_grabber_stream
*
stream
=
impl_from_IMFStreamSink
(
iface
);
return
E_NOTIMPL
;
TRACE
(
"%p, %p.
\n
"
,
iface
,
handler
);
*
handler
=
&
stream
->
IMFMediaTypeHandler_iface
;
IMFMediaTypeHandler_AddRef
(
*
handler
);
return
S_OK
;
}
static
HRESULT
WINAPI
sample_grabber_stream_ProcessSample
(
IMFStreamSink
*
iface
,
IMFSample
*
sample
)
...
...
@@ -216,6 +231,84 @@ static const IMFStreamSinkVtbl sample_grabber_stream_vtbl =
sample_grabber_stream_Flush
,
};
static
HRESULT
WINAPI
sample_grabber_stream_type_handler_QueryInterface
(
IMFMediaTypeHandler
*
iface
,
REFIID
riid
,
void
**
obj
)
{
struct
sample_grabber_stream
*
stream
=
impl_from_IMFMediaTypeHandler
(
iface
);
return
IMFStreamSink_QueryInterface
(
&
stream
->
IMFStreamSink_iface
,
riid
,
obj
);
}
static
ULONG
WINAPI
sample_grabber_stream_type_handler_AddRef
(
IMFMediaTypeHandler
*
iface
)
{
struct
sample_grabber_stream
*
stream
=
impl_from_IMFMediaTypeHandler
(
iface
);
return
IMFStreamSink_AddRef
(
&
stream
->
IMFStreamSink_iface
);
}
static
ULONG
WINAPI
sample_grabber_stream_type_handler_Release
(
IMFMediaTypeHandler
*
iface
)
{
struct
sample_grabber_stream
*
stream
=
impl_from_IMFMediaTypeHandler
(
iface
);
return
IMFStreamSink_Release
(
&
stream
->
IMFStreamSink_iface
);
}
static
HRESULT
WINAPI
sample_grabber_stream_type_handler_IsMediaTypeSupported
(
IMFMediaTypeHandler
*
iface
,
IMFMediaType
*
in_type
,
IMFMediaType
**
out_type
)
{
FIXME
(
"%p, %p, %p.
\n
"
,
iface
,
in_type
,
out_type
);
return
E_NOTIMPL
;
}
static
HRESULT
WINAPI
sample_grabber_stream_type_handler_GetMediaTypeCount
(
IMFMediaTypeHandler
*
iface
,
DWORD
*
count
)
{
FIXME
(
"%p, %p.
\n
"
,
iface
,
count
);
return
E_NOTIMPL
;
}
static
HRESULT
WINAPI
sample_grabber_stream_type_handler_GetMediaTypeByIndex
(
IMFMediaTypeHandler
*
iface
,
DWORD
index
,
IMFMediaType
**
type
)
{
FIXME
(
"%p, %u, %p.
\n
"
,
iface
,
index
,
type
);
return
E_NOTIMPL
;
}
static
HRESULT
WINAPI
sample_grabber_stream_type_handler_SetCurrentMediaType
(
IMFMediaTypeHandler
*
iface
,
IMFMediaType
*
type
)
{
FIXME
(
"%p, %p.
\n
"
,
iface
,
type
);
return
E_NOTIMPL
;
}
static
HRESULT
WINAPI
sample_grabber_stream_type_handler_GetCurrentMediaType
(
IMFMediaTypeHandler
*
iface
,
IMFMediaType
**
type
)
{
FIXME
(
"%p, %p.
\n
"
,
iface
,
type
);
return
E_NOTIMPL
;
}
static
HRESULT
WINAPI
sample_grabber_stream_type_handler_GetMajorType
(
IMFMediaTypeHandler
*
iface
,
GUID
*
type
)
{
FIXME
(
"%p, %p.
\n
"
,
iface
,
type
);
return
E_NOTIMPL
;
}
static
const
IMFMediaTypeHandlerVtbl
sample_grabber_stream_type_handler_vtbl
=
{
sample_grabber_stream_type_handler_QueryInterface
,
sample_grabber_stream_type_handler_AddRef
,
sample_grabber_stream_type_handler_Release
,
sample_grabber_stream_type_handler_IsMediaTypeSupported
,
sample_grabber_stream_type_handler_GetMediaTypeCount
,
sample_grabber_stream_type_handler_GetMediaTypeByIndex
,
sample_grabber_stream_type_handler_SetCurrentMediaType
,
sample_grabber_stream_type_handler_GetCurrentMediaType
,
sample_grabber_stream_type_handler_GetMajorType
,
};
static
HRESULT
WINAPI
sample_grabber_sink_QueryInterface
(
IMFMediaSink
*
iface
,
REFIID
riid
,
void
**
obj
)
{
struct
sample_grabber
*
grabber
=
impl_from_IMFMediaSink
(
iface
);
...
...
@@ -424,6 +517,7 @@ static HRESULT sample_grabber_create_stream(IMFMediaSink *sink, IMFStreamSink **
return
E_OUTOFMEMORY
;
object
->
IMFStreamSink_iface
.
lpVtbl
=
&
sample_grabber_stream_vtbl
;
object
->
IMFMediaTypeHandler_iface
.
lpVtbl
=
&
sample_grabber_stream_type_handler_vtbl
;
object
->
refcount
=
1
;
object
->
sink
=
sink
;
IMFMediaSink_AddRef
(
object
->
sink
);
...
...
dlls/mf/tests/mf.c
View file @
a2c8658b
...
...
@@ -1724,22 +1724,19 @@ todo_wine
ok
(
hr
==
E_NOINTERFACE
,
"Unexpected hr %#x.
\n
"
,
hr
);
hr
=
IMFStreamSink_QueryInterface
(
stream
,
&
IID_IMFMediaTypeHandler
,
(
void
**
)
&
handler2
);
todo_wine
ok
(
hr
==
S_OK
,
"Failed to get handler interface, hr %#x.
\n
"
,
hr
);
if
(
SUCCEEDED
(
hr
))
{
hr
=
IMFStreamSink_GetMediaTypeHandler
(
stream
,
&
handler
);
ok
(
hr
==
S_OK
,
"Failed to get type handler, hr %#x.
\n
"
,
hr
);
hr
=
IMFMediaTypeHandler_GetMediaTypeCount
(
handler
,
&
count
);
ok
(
hr
==
S_OK
,
"Failed to get media type count, hr %#x.
\n
"
,
hr
);
ok
(
count
==
0
,
"Unexpected count %u.
\n
"
,
count
);
hr
=
IMFStreamSink_GetMediaTypeHandler
(
stream
,
&
handler
);
ok
(
hr
==
S_OK
,
"Failed to get type handler, hr %#x.
\n
"
,
hr
);
hr
=
IMFMediaTypeHandler_GetMediaTypeCount
(
handler
,
&
count
);
todo_wine
{
ok
(
hr
==
S_OK
,
"Failed to get media type count, hr %#x.
\n
"
,
hr
);
ok
(
count
==
0
,
"Unexpected count %u.
\n
"
,
count
);
}
ok
(
handler
==
handler2
,
"Unexpected handler.
\n
"
);
ok
(
handler
==
handler2
,
"Unexpected handler.
\n
"
);
IMFMediaTypeHandler_Release
(
handler
);
IMFMediaTypeHandler_Release
(
handler2
);
}
IMFMediaTypeHandler_Release
(
handler
);
IMFMediaTypeHandler_Release
(
handler2
);
hr
=
IMFActivate_ShutdownObject
(
activate
);
todo_wine
...
...
@@ -1773,16 +1770,14 @@ todo_wine
ok
(
id
==
0
,
"Unexpected id %#x.
\n
"
,
id
);
hr
=
IMFStreamSink_GetMediaTypeHandler
(
stream
,
&
handler
);
todo_wine
ok
(
hr
==
S_OK
,
"Failed to get type handler, hr %#x.
\n
"
,
hr
);
if
(
SUCCEEDED
(
hr
))
{
hr
=
IMFMediaTypeHandler_GetMediaTypeCount
(
handler
,
&
count
);
ok
(
hr
==
S_OK
,
"Failed to get media type count, hr %#x.
\n
"
,
hr
);
ok
(
count
==
0
,
"Unexpected count %u.
\n
"
,
count
);
IMFMediaTypeHandler_Release
(
handler
);
}
hr
=
IMFMediaTypeHandler_GetMediaTypeCount
(
handler
,
&
count
);
todo_wine
{
ok
(
hr
==
S_OK
,
"Failed to get media type count, hr %#x.
\n
"
,
hr
);
ok
(
count
==
0
,
"Unexpected count %u.
\n
"
,
count
);
}
IMFMediaTypeHandler_Release
(
handler
);
IMFMediaSink_Release
(
sink
);
IMFStreamSink_Release
(
stream
);
...
...
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