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
50eb5eba
Commit
50eb5eba
authored
Jun 30, 2020
by
Nikolay Sivov
Committed by
Alexandre Julliard
Jun 30, 2020
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
evr: Add IMFVideoDeviceID for the presenter.
Signed-off-by:
Nikolay Sivov
<
nsivov@codeweavers.com
>
Signed-off-by:
Alexandre Julliard
<
julliard@winehq.org
>
parent
f0aefcfc
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
67 additions
and
2 deletions
+67
-2
presenter.c
dlls/evr/presenter.c
+49
-0
evr.c
dlls/evr/tests/evr.c
+18
-2
No files found.
dlls/evr/presenter.c
View file @
50eb5eba
...
...
@@ -34,6 +34,7 @@ WINE_DEFAULT_DEBUG_CHANNEL(evr);
struct
video_presenter
{
IMFVideoPresenter
IMFVideoPresenter_iface
;
IMFVideoDeviceID
IMFVideoDeviceID_iface
;
IUnknown
IUnknown_inner
;
IUnknown
*
outer_unk
;
LONG
refcount
;
...
...
@@ -49,6 +50,11 @@ static struct video_presenter *impl_from_IMFVideoPresenter(IMFVideoPresenter *if
return
CONTAINING_RECORD
(
iface
,
struct
video_presenter
,
IMFVideoPresenter_iface
);
}
static
struct
video_presenter
*
impl_from_IMFVideoDeviceID
(
IMFVideoDeviceID
*
iface
)
{
return
CONTAINING_RECORD
(
iface
,
struct
video_presenter
,
IMFVideoDeviceID_iface
);
}
static
HRESULT
WINAPI
video_presenter_inner_QueryInterface
(
IUnknown
*
iface
,
REFIID
riid
,
void
**
obj
)
{
struct
video_presenter
*
presenter
=
impl_from_IUnknown
(
iface
);
...
...
@@ -64,6 +70,10 @@ static HRESULT WINAPI video_presenter_inner_QueryInterface(IUnknown *iface, REFI
{
*
obj
=
&
presenter
->
IMFVideoPresenter_iface
;
}
else
if
(
IsEqualIID
(
riid
,
&
IID_IMFVideoDeviceID
))
{
*
obj
=
&
presenter
->
IMFVideoDeviceID_iface
;
}
else
{
WARN
(
"Unimplemented interface %s.
\n
"
,
debugstr_guid
(
riid
));
...
...
@@ -188,6 +198,44 @@ static const IMFVideoPresenterVtbl video_presenter_vtbl =
video_presenter_GetCurrentMediaType
,
};
static
HRESULT
WINAPI
video_presenter_device_id_QueryInterface
(
IMFVideoDeviceID
*
iface
,
REFIID
riid
,
void
**
obj
)
{
struct
video_presenter
*
presenter
=
impl_from_IMFVideoDeviceID
(
iface
);
return
IMFVideoPresenter_QueryInterface
(
&
presenter
->
IMFVideoPresenter_iface
,
riid
,
obj
);
}
static
ULONG
WINAPI
video_presenter_device_id_AddRef
(
IMFVideoDeviceID
*
iface
)
{
struct
video_presenter
*
presenter
=
impl_from_IMFVideoDeviceID
(
iface
);
return
IMFVideoPresenter_AddRef
(
&
presenter
->
IMFVideoPresenter_iface
);
}
static
ULONG
WINAPI
video_presenter_device_id_Release
(
IMFVideoDeviceID
*
iface
)
{
struct
video_presenter
*
presenter
=
impl_from_IMFVideoDeviceID
(
iface
);
return
IMFVideoPresenter_Release
(
&
presenter
->
IMFVideoPresenter_iface
);
}
static
HRESULT
WINAPI
video_presenter_device_id_GetDeviceID
(
IMFVideoDeviceID
*
iface
,
IID
*
device_id
)
{
TRACE
(
"%p, %p.
\n
"
,
iface
,
device_id
);
if
(
!
device_id
)
return
E_POINTER
;
memcpy
(
device_id
,
&
IID_IDirect3DDevice9
,
sizeof
(
*
device_id
));
return
S_OK
;
}
static
const
IMFVideoDeviceIDVtbl
video_presenter_device_id_vtbl
=
{
video_presenter_device_id_QueryInterface
,
video_presenter_device_id_AddRef
,
video_presenter_device_id_Release
,
video_presenter_device_id_GetDeviceID
,
};
HRESULT
WINAPI
MFCreateVideoPresenter
(
IUnknown
*
owner
,
REFIID
riid_device
,
REFIID
riid
,
void
**
obj
)
{
TRACE
(
"%p, %s, %s, %p.
\n
"
,
owner
,
debugstr_guid
(
riid_device
),
debugstr_guid
(
riid
),
obj
);
...
...
@@ -208,6 +256,7 @@ HRESULT evr_presenter_create(IUnknown *outer, void **out)
return
E_OUTOFMEMORY
;
object
->
IMFVideoPresenter_iface
.
lpVtbl
=
&
video_presenter_vtbl
;
object
->
IMFVideoDeviceID_iface
.
lpVtbl
=
&
video_presenter_device_id_vtbl
;
object
->
IUnknown_inner
.
lpVtbl
=
&
video_presenter_inner_vtbl
;
object
->
outer_unk
=
outer
?
outer
:
&
object
->
IUnknown_inner
;
object
->
refcount
=
1
;
...
...
dlls/evr/tests/evr.c
View file @
50eb5eba
...
...
@@ -869,15 +869,31 @@ done:
static
void
test_default_presenter
(
void
)
{
IMFVideoPresenter
*
presenter
;
IMFVideoDeviceID
*
deviceid
;
HRESULT
hr
;
GUID
iid
;
hr
=
MFCreateVideoPresenter
(
NULL
,
&
IID_IMFVideoPresenter
,
&
IID_IMFVideoPresenter
,
(
void
**
)
&
presenter
);
ok
(
hr
==
E_INVALIDARG
,
"Unexpected hr %#x.
\n
"
,
hr
);
hr
=
MFCreateVideoPresenter
(
NULL
,
&
IID_IDirect3DDevice9
,
&
IID_IMFVideoPresenter
,
(
void
**
)
&
presenter
);
ok
(
hr
==
S_OK
||
broken
(
hr
==
E_FAIL
)
/* WinXP */
,
"Failed to create default presenter, hr %#x.
\n
"
,
hr
);
if
(
SUCCEEDED
(
hr
))
IMFVideoPresenter_Release
(
presenter
);
if
(
FAILED
(
hr
))
return
;
hr
=
IMFVideoPresenter_QueryInterface
(
presenter
,
&
IID_IMFVideoDeviceID
,
(
void
**
)
&
deviceid
);
ok
(
hr
==
S_OK
,
"Unexpected hr %#x.
\n
"
,
hr
);
hr
=
IMFVideoDeviceID_GetDeviceID
(
deviceid
,
NULL
);
ok
(
hr
==
E_POINTER
,
"Unexpected hr %#x.
\n
"
,
hr
);
hr
=
IMFVideoDeviceID_GetDeviceID
(
deviceid
,
&
iid
);
ok
(
hr
==
S_OK
,
"Unexpected hr %#x.
\n
"
,
hr
);
ok
(
IsEqualIID
(
&
iid
,
&
IID_IDirect3DDevice9
),
"Unexpected id %s.
\n
"
,
wine_dbgstr_guid
(
&
iid
));
IMFVideoDeviceID_Release
(
deviceid
);
IMFVideoPresenter_Release
(
presenter
);
}
START_TEST
(
evr
)
...
...
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