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
68204a86
Commit
68204a86
authored
Jul 07, 2020
by
Nikolay Sivov
Committed by
Alexandre Julliard
Jul 07, 2020
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
mf/evr: Add events queue support for the sink.
Signed-off-by:
Nikolay Sivov
<
nsivov@codeweavers.com
>
Signed-off-by:
Alexandre Julliard
<
julliard@winehq.org
>
parent
8ce49878
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
95 additions
and
8 deletions
+95
-8
evr.c
dlls/mf/evr.c
+89
-3
main.c
dlls/mf/main.c
+0
-2
mf_private.h
dlls/mf/mf_private.h
+1
-0
samplegrabber.c
dlls/mf/samplegrabber.c
+0
-1
session.c
dlls/mf/session.c
+0
-1
mf.c
dlls/mf/tests/mf.c
+5
-0
topology.c
dlls/mf/topology.c
+0
-1
No files found.
dlls/mf/evr.c
View file @
68204a86
...
...
@@ -34,8 +34,10 @@ struct video_renderer
IMFMediaSink
IMFMediaSink_iface
;
IMFMediaSinkPreroll
IMFMediaSinkPreroll_iface
;
IMFVideoRenderer
IMFVideoRenderer_iface
;
IMFMediaEventGenerator
IMFMediaEventGenerator_iface
;
LONG
refcount
;
IMFMediaEventQueue
*
event_queue
;
IMFTransform
*
mixer
;
IMFVideoPresenter
*
presenter
;
unsigned
int
flags
;
...
...
@@ -57,6 +59,11 @@ static struct video_renderer *impl_from_IMFVideoRenderer(IMFVideoRenderer *iface
return
CONTAINING_RECORD
(
iface
,
struct
video_renderer
,
IMFVideoRenderer_iface
);
}
static
struct
video_renderer
*
impl_from_IMFMediaEventGenerator
(
IMFMediaEventGenerator
*
iface
)
{
return
CONTAINING_RECORD
(
iface
,
struct
video_renderer
,
IMFMediaEventGenerator_iface
);
}
static
HRESULT
WINAPI
video_renderer_sink_QueryInterface
(
IMFMediaSink
*
iface
,
REFIID
riid
,
void
**
obj
)
{
struct
video_renderer
*
renderer
=
impl_from_IMFMediaSink
(
iface
);
...
...
@@ -76,6 +83,10 @@ static HRESULT WINAPI video_renderer_sink_QueryInterface(IMFMediaSink *iface, RE
{
*
obj
=
&
renderer
->
IMFVideoRenderer_iface
;
}
else
if
(
IsEqualIID
(
riid
,
&
IID_IMFMediaEventGenerator
))
{
*
obj
=
&
renderer
->
IMFMediaEventGenerator_iface
;
}
else
{
WARN
(
"Unsupported interface %s.
\n
"
,
debugstr_guid
(
riid
));
...
...
@@ -105,6 +116,8 @@ static ULONG WINAPI video_renderer_sink_Release(IMFMediaSink *iface)
if
(
!
refcount
)
{
if
(
renderer
->
event_queue
)
IMFMediaEventQueue_Release
(
renderer
->
event_queue
);
if
(
renderer
->
mixer
)
IMFTransform_Release
(
renderer
->
mixer
);
if
(
renderer
->
presenter
)
...
...
@@ -193,6 +206,7 @@ static HRESULT WINAPI video_renderer_sink_Shutdown(IMFMediaSink *iface)
EnterCriticalSection
(
&
renderer
->
cs
);
renderer
->
flags
|=
EVR_SHUT_DOWN
;
IMFMediaEventQueue_Shutdown
(
renderer
->
event_queue
);
LeaveCriticalSection
(
&
renderer
->
cs
);
return
S_OK
;
...
...
@@ -281,6 +295,74 @@ static const IMFVideoRendererVtbl video_renderer_vtbl =
video_renderer_InitializeRenderer
,
};
static
HRESULT
WINAPI
video_renderer_events_QueryInterface
(
IMFMediaEventGenerator
*
iface
,
REFIID
riid
,
void
**
obj
)
{
struct
video_renderer
*
renderer
=
impl_from_IMFMediaEventGenerator
(
iface
);
return
IMFMediaSink_QueryInterface
(
&
renderer
->
IMFMediaSink_iface
,
riid
,
obj
);
}
static
ULONG
WINAPI
video_renderer_events_AddRef
(
IMFMediaEventGenerator
*
iface
)
{
struct
video_renderer
*
renderer
=
impl_from_IMFMediaEventGenerator
(
iface
);
return
IMFMediaSink_AddRef
(
&
renderer
->
IMFMediaSink_iface
);
}
static
ULONG
WINAPI
video_renderer_events_Release
(
IMFMediaEventGenerator
*
iface
)
{
struct
video_renderer
*
renderer
=
impl_from_IMFMediaEventGenerator
(
iface
);
return
IMFMediaSink_Release
(
&
renderer
->
IMFMediaSink_iface
);
}
static
HRESULT
WINAPI
video_renderer_events_GetEvent
(
IMFMediaEventGenerator
*
iface
,
DWORD
flags
,
IMFMediaEvent
**
event
)
{
struct
video_renderer
*
renderer
=
impl_from_IMFMediaEventGenerator
(
iface
);
TRACE
(
"%p, %#x, %p.
\n
"
,
iface
,
flags
,
event
);
return
IMFMediaEventQueue_GetEvent
(
renderer
->
event_queue
,
flags
,
event
);
}
static
HRESULT
WINAPI
video_renderer_events_BeginGetEvent
(
IMFMediaEventGenerator
*
iface
,
IMFAsyncCallback
*
callback
,
IUnknown
*
state
)
{
struct
video_renderer
*
renderer
=
impl_from_IMFMediaEventGenerator
(
iface
);
TRACE
(
"%p, %p, %p.
\n
"
,
iface
,
callback
,
state
);
return
IMFMediaEventQueue_BeginGetEvent
(
renderer
->
event_queue
,
callback
,
state
);
}
static
HRESULT
WINAPI
video_renderer_events_EndGetEvent
(
IMFMediaEventGenerator
*
iface
,
IMFAsyncResult
*
result
,
IMFMediaEvent
**
event
)
{
struct
video_renderer
*
renderer
=
impl_from_IMFMediaEventGenerator
(
iface
);
TRACE
(
"%p, %p, %p.
\n
"
,
iface
,
result
,
event
);
return
IMFMediaEventQueue_EndGetEvent
(
renderer
->
event_queue
,
result
,
event
);
}
static
HRESULT
WINAPI
video_renderer_events_QueueEvent
(
IMFMediaEventGenerator
*
iface
,
MediaEventType
event_type
,
REFGUID
ext_type
,
HRESULT
hr
,
const
PROPVARIANT
*
value
)
{
struct
video_renderer
*
renderer
=
impl_from_IMFMediaEventGenerator
(
iface
);
TRACE
(
"%p, %u, %s, %#x, %p.
\n
"
,
iface
,
event_type
,
debugstr_guid
(
ext_type
),
hr
,
value
);
return
IMFMediaEventQueue_QueueEventParamVar
(
renderer
->
event_queue
,
event_type
,
ext_type
,
hr
,
value
);
}
static
const
IMFMediaEventGeneratorVtbl
video_renderer_events_vtbl
=
{
video_renderer_events_QueryInterface
,
video_renderer_events_AddRef
,
video_renderer_events_Release
,
video_renderer_events_GetEvent
,
video_renderer_events_BeginGetEvent
,
video_renderer_events_EndGetEvent
,
video_renderer_events_QueueEvent
,
};
static
HRESULT
video_renderer_create_mixer
(
IMFAttributes
*
attributes
,
IMFTransform
**
out
)
{
unsigned
int
flags
=
0
;
...
...
@@ -340,21 +422,25 @@ static HRESULT evr_create_object(IMFAttributes *attributes, void *user_context,
object
->
IMFMediaSink_iface
.
lpVtbl
=
&
video_renderer_sink_vtbl
;
object
->
IMFMediaSinkPreroll_iface
.
lpVtbl
=
&
video_renderer_preroll_vtbl
;
object
->
IMFVideoRenderer_iface
.
lpVtbl
=
&
video_renderer_vtbl
;
object
->
IMFMediaEventGenerator_iface
.
lpVtbl
=
&
video_renderer_events_vtbl
;
object
->
refcount
=
1
;
InitializeCriticalSection
(
&
object
->
cs
);
if
(
FAILED
(
hr
=
MFCreateEventQueue
(
&
object
->
event_queue
)))
goto
failed
;
/* Create mixer and presenter. */
if
(
FAILED
(
hr
=
video_renderer_create_mixer
(
attributes
,
&
object
->
mixer
)))
goto
done
;
goto
failed
;
if
(
FAILED
(
hr
=
video_renderer_create_presenter
(
attributes
,
&
object
->
presenter
)))
goto
done
;
goto
failed
;
*
obj
=
(
IUnknown
*
)
&
object
->
IMFMediaSink_iface
;
return
S_OK
;
done
:
failed
:
IMFMediaSink_Release
(
&
object
->
IMFMediaSink_iface
);
...
...
dlls/mf/main.c
View file @
68204a86
...
...
@@ -26,8 +26,6 @@
#include "mfidl.h"
#include "rpcproxy.h"
#include "mfapi.h"
#include "mf_private.h"
#include "wine/debug.h"
...
...
dlls/mf/mf_private.h
View file @
68204a86
...
...
@@ -18,6 +18,7 @@
#include "mferror.h"
#include "mfidl.h"
#include "mfapi.h"
#include "wine/heap.h"
#include "wine/debug.h"
...
...
dlls/mf/samplegrabber.c
View file @
68204a86
...
...
@@ -18,7 +18,6 @@
#define COBJMACROS
#include "mfapi.h"
#include "mfidl.h"
#include "mf_private.h"
...
...
dlls/mf/session.c
View file @
68204a86
...
...
@@ -24,7 +24,6 @@
#include "windef.h"
#include "winbase.h"
#include "mfidl.h"
#include "mfapi.h"
#include "wine/debug.h"
#include "wine/heap.h"
...
...
dlls/mf/tests/mf.c
View file @
68204a86
...
...
@@ -3227,6 +3227,7 @@ todo_wine
static
void
test_evr
(
void
)
{
IMFMediaEventGenerator
*
ev_generator
;
IMFVideoRenderer
*
video_renderer
;
IMFMediaSinkPreroll
*
preroll
;
IMFMediaSink
*
sink
,
*
sink2
;
...
...
@@ -3267,6 +3268,10 @@ static void test_evr(void)
ok
(
hr
==
S_OK
,
"Unexpected hr %#x.
\n
"
,
hr
);
IMFVideoRenderer_Release
(
video_renderer
);
hr
=
IMFMediaSink_QueryInterface
(
sink
,
&
IID_IMFMediaEventGenerator
,
(
void
**
)
&
ev_generator
);
ok
(
hr
==
S_OK
,
"Unexpected hr %#x.
\n
"
,
hr
);
IMFMediaEventGenerator_Release
(
ev_generator
);
hr
=
IMFActivate_ShutdownObject
(
activate
);
ok
(
hr
==
S_OK
,
"Failed to shut down, hr %#x.
\n
"
,
hr
);
...
...
dlls/mf/topology.c
View file @
68204a86
...
...
@@ -26,7 +26,6 @@
#undef INITGUID
#include <guiddef.h>
#include "mfapi.h"
#include "mfidl.h"
#include "wine/debug.h"
...
...
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