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
384d3a45
Commit
384d3a45
authored
Jun 06, 2019
by
Zebediah Figura
Committed by
Alexandre Julliard
Jun 10, 2019
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
strmbase: Add a cached implementation of IDispatch and use it in IBasicVideo.
Signed-off-by:
Zebediah Figura
<
z.figura12@gmail.com
>
Signed-off-by:
Alexandre Julliard
<
julliard@winehq.org
>
parent
dba4428b
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
93 additions
and
23 deletions
+93
-23
dispatch.c
dlls/strmbase/dispatch.c
+49
-0
video.c
dlls/strmbase/video.c
+31
-22
strmbase.h
include/wine/strmbase.h
+13
-1
No files found.
dlls/strmbase/dispatch.c
View file @
384d3a45
...
@@ -20,6 +20,55 @@
...
@@ -20,6 +20,55 @@
#include "strmbase_private.h"
#include "strmbase_private.h"
WINE_DEFAULT_DEBUG_CHANNEL
(
strmbase
);
static
ITypeLib
*
control_typelib
;
static
ITypeInfo
*
control_typeinfo
[
last_tid
];
static
REFIID
control_tid_id
[]
=
{
&
IID_IBasicAudio
,
&
IID_IBasicVideo
,
&
IID_IMediaControl
,
&
IID_IMediaEvent
,
&
IID_IMediaPosition
,
&
IID_IVideoWindow
,
};
HRESULT
strmbase_get_typeinfo
(
enum
strmbase_type_id
tid
,
ITypeInfo
**
ret
)
{
HRESULT
hr
;
if
(
!
control_typelib
)
{
ITypeLib
*
typelib
;
hr
=
LoadRegTypeLib
(
&
LIBID_QuartzTypeLib
,
1
,
0
,
LOCALE_SYSTEM_DEFAULT
,
&
typelib
);
if
(
FAILED
(
hr
))
{
ERR
(
"Failed to load typelib, hr %#x.
\n
"
,
hr
);
return
hr
;
}
if
(
InterlockedCompareExchangePointer
((
void
**
)
&
control_typelib
,
typelib
,
NULL
))
ITypeLib_Release
(
typelib
);
}
if
(
!
control_typeinfo
[
tid
])
{
ITypeInfo
*
typeinfo
;
hr
=
ITypeLib_GetTypeInfoOfGuid
(
control_typelib
,
control_tid_id
[
tid
],
&
typeinfo
);
if
(
FAILED
(
hr
))
{
ERR
(
"Failed to get type info for %s, hr %#x.
\n
"
,
debugstr_guid
(
control_tid_id
[
tid
]),
hr
);
return
hr
;
}
if
(
InterlockedCompareExchangePointer
((
void
**
)(
control_typeinfo
+
tid
),
typeinfo
,
NULL
))
ITypeInfo_Release
(
typeinfo
);
}
ITypeInfo_AddRef
(
*
ret
=
control_typeinfo
[
tid
]);
return
S_OK
;
}
HRESULT
WINAPI
BaseDispatch_Init
(
BaseDispatch
*
This
,
REFIID
riid
)
HRESULT
WINAPI
BaseDispatch_Init
(
BaseDispatch
*
This
,
REFIID
riid
)
{
{
ITypeLib
*
pTypeLib
;
ITypeLib
*
pTypeLib
;
...
...
dlls/strmbase/video.c
View file @
384d3a45
...
@@ -35,14 +35,12 @@ HRESULT WINAPI BaseControlVideo_Init(BaseControlVideo *pControlVideo, const IBas
...
@@ -35,14 +35,12 @@ HRESULT WINAPI BaseControlVideo_Init(BaseControlVideo *pControlVideo, const IBas
pControlVideo
->
pPin
=
pPin
;
pControlVideo
->
pPin
=
pPin
;
pControlVideo
->
pFuncsTable
=
pFuncsTable
;
pControlVideo
->
pFuncsTable
=
pFuncsTable
;
BaseDispatch_Init
(
&
pControlVideo
->
baseDispatch
,
&
IID_IBasicVideo
);
return
S_OK
;
return
S_OK
;
}
}
HRESULT
WINAPI
BaseControlVideo_Destroy
(
BaseControlVideo
*
pControlVideo
)
HRESULT
WINAPI
BaseControlVideo_Destroy
(
BaseControlVideo
*
pControlVideo
)
{
{
return
BaseDispatch_Destroy
(
&
pControlVideo
->
baseDispatch
)
;
return
S_OK
;
}
}
static
HRESULT
BaseControlVideoImpl_CheckSourceRect
(
BaseControlVideo
*
This
,
RECT
*
pSourceRect
)
static
HRESULT
BaseControlVideoImpl_CheckSourceRect
(
BaseControlVideo
*
This
,
RECT
*
pSourceRect
)
...
@@ -72,40 +70,51 @@ static HRESULT BaseControlVideoImpl_CheckTargetRect(BaseControlVideo *This, RECT
...
@@ -72,40 +70,51 @@ static HRESULT BaseControlVideoImpl_CheckTargetRect(BaseControlVideo *This, RECT
return
S_OK
;
return
S_OK
;
}
}
HRESULT
WINAPI
BaseControlVideoImpl_GetTypeInfoCount
(
IBasicVideo
*
iface
,
UINT
*
pctinfo
)
HRESULT
WINAPI
BaseControlVideoImpl_GetTypeInfoCount
(
IBasicVideo
*
iface
,
UINT
*
count
)
{
{
BaseControlVideo
*
This
=
impl_from_IBasicVideo
(
iface
);
TRACE
(
"iface %p, count %p.
\n
"
,
iface
,
count
);
*
count
=
1
;
return
BaseDispatchImpl_GetTypeInfoCount
(
&
This
->
baseDispatch
,
pctinfo
)
;
return
S_OK
;
}
}
HRESULT
WINAPI
BaseControlVideoImpl_GetTypeInfo
(
IBasicVideo
*
iface
,
UINT
iTInfo
,
LCID
lcid
,
ITypeInfo
**
ppTInfo
)
HRESULT
WINAPI
BaseControlVideoImpl_GetTypeInfo
(
IBasicVideo
*
iface
,
UINT
index
,
LCID
lcid
,
ITypeInfo
**
typeinfo
)
{
{
BaseControlVideo
*
This
=
impl_from_IBasicVideo
(
iface
);
TRACE
(
"iface %p, index %u, lcid %#x, typeinfo %p.
\n
"
,
iface
,
index
,
lcid
,
typeinfo
);
return
strmbase_get_typeinfo
(
IBasicVideo_tid
,
typeinfo
);
return
BaseDispatchImpl_GetTypeInfo
(
&
This
->
baseDispatch
,
&
IID_NULL
,
iTInfo
,
lcid
,
ppTInfo
);
}
}
HRESULT
WINAPI
BaseControlVideoImpl_GetIDsOfNames
(
IBasicVideo
*
iface
,
REFIID
riid
,
LPOLESTR
*
rgszNames
,
UINT
cNames
,
LCID
lcid
,
DISPID
*
rgDispId
)
HRESULT
WINAPI
BaseControlVideoImpl_GetIDsOfNames
(
IBasicVideo
*
iface
,
REFIID
iid
,
LPOLESTR
*
names
,
UINT
count
,
LCID
lcid
,
DISPID
*
ids
)
{
{
BaseControlVideo
*
This
=
impl_from_IBasicVideo
(
iface
);
ITypeInfo
*
typeinfo
;
HRESULT
hr
;
return
BaseDispatchImpl_GetIDsOfNames
(
&
This
->
baseDispatch
,
riid
,
rgszNames
,
cNames
,
lcid
,
rgDispId
);
TRACE
(
"iface %p, iid %s, names %p, count %u, lcid %#x, ids %p.
\n
"
,
iface
,
debugstr_guid
(
iid
),
names
,
count
,
lcid
,
ids
);
if
(
SUCCEEDED
(
hr
=
strmbase_get_typeinfo
(
IBasicVideo_tid
,
&
typeinfo
)))
{
hr
=
ITypeInfo_GetIDsOfNames
(
typeinfo
,
names
,
count
,
ids
);
ITypeInfo_Release
(
typeinfo
);
}
return
hr
;
}
}
HRESULT
WINAPI
BaseControlVideoImpl_Invoke
(
IBasicVideo
*
iface
,
DISPID
dispIdMember
,
REFIID
riid
,
LCID
lcid
,
WORD
wFlags
,
DISPPARAMS
*
pDispParams
,
VARIANT
*
pVarResult
,
EXCEPINFO
*
pExepInfo
,
UINT
*
puArgErr
)
HRESULT
WINAPI
BaseControlVideoImpl_Invoke
(
IBasicVideo
*
iface
,
DISPID
id
,
REFIID
iid
,
LCID
lcid
,
WORD
flags
,
DISPPARAMS
*
params
,
VARIANT
*
result
,
EXCEPINFO
*
excepinfo
,
UINT
*
error_arg
)
{
{
BaseControlVideo
*
This
=
impl_from_IBasicVideo
(
iface
);
ITypeInfo
*
typeinfo
;
ITypeInfo
*
pTypeInfo
;
HRESULT
hr
;
HRESULT
hr
;
hr
=
BaseDispatchImpl_GetTypeInfo
(
&
This
->
baseDispatch
,
riid
,
1
,
lcid
,
&
pTypeInfo
);
TRACE
(
"iface %p, id %d, iid %s, lcid %#x, flags %#x, params %p, result %p, excepinfo %p, error_arg %p.
\n
"
,
if
(
SUCCEEDED
(
hr
))
iface
,
id
,
debugstr_guid
(
iid
),
lcid
,
flags
,
params
,
result
,
excepinfo
,
error_arg
);
if
(
SUCCEEDED
(
hr
=
strmbase_get_typeinfo
(
IBasicVideo_tid
,
&
typeinfo
)))
{
{
hr
=
ITypeInfo_Invoke
(
pTypeInfo
,
&
This
->
IBasicVideo_iface
,
dispIdMember
,
wFlags
,
pDispParams
,
pVarResult
,
pExepInfo
,
puArgErr
);
hr
=
ITypeInfo_Invoke
(
typeinfo
,
iface
,
id
,
flags
,
params
,
result
,
excepinfo
,
error_arg
);
ITypeInfo_Release
(
pTypeI
nfo
);
ITypeInfo_Release
(
typei
nfo
);
}
}
return
hr
;
return
hr
;
}
}
...
...
include/wine/strmbase.h
View file @
384d3a45
...
@@ -399,6 +399,19 @@ RECT WINAPI BaseWindowImpl_GetDefaultRect(BaseWindow *This);
...
@@ -399,6 +399,19 @@ RECT WINAPI BaseWindowImpl_GetDefaultRect(BaseWindow *This);
LRESULT
WINAPI
BaseWindowImpl_OnReceiveMessage
(
BaseWindow
*
This
,
HWND
hwnd
,
INT
uMsg
,
WPARAM
wParam
,
LPARAM
lParam
);
LRESULT
WINAPI
BaseWindowImpl_OnReceiveMessage
(
BaseWindow
*
This
,
HWND
hwnd
,
INT
uMsg
,
WPARAM
wParam
,
LPARAM
lParam
);
BOOL
WINAPI
BaseWindowImpl_OnSize
(
BaseWindow
*
This
,
LONG
Height
,
LONG
Width
);
BOOL
WINAPI
BaseWindowImpl_OnSize
(
BaseWindow
*
This
,
LONG
Height
,
LONG
Width
);
enum
strmbase_type_id
{
IBasicAudio_tid
,
IBasicVideo_tid
,
IMediaControl_tid
,
IMediaEvent_tid
,
IMediaPosition_tid
,
IVideoWindow_tid
,
last_tid
};
HRESULT
strmbase_get_typeinfo
(
enum
strmbase_type_id
tid
,
ITypeInfo
**
typeinfo
);
typedef
struct
{
typedef
struct
{
ITypeInfo
*
pTypeInfo
;
ITypeInfo
*
pTypeInfo
;
}
BaseDispatch
;
}
BaseDispatch
;
...
@@ -473,7 +486,6 @@ HRESULT WINAPI BaseControlWindowImpl_IsCursorHidden(IVideoWindow *iface, LONG *C
...
@@ -473,7 +486,6 @@ HRESULT WINAPI BaseControlWindowImpl_IsCursorHidden(IVideoWindow *iface, LONG *C
typedef
struct
tagBaseControlVideo
typedef
struct
tagBaseControlVideo
{
{
IBasicVideo
IBasicVideo_iface
;
IBasicVideo
IBasicVideo_iface
;
BaseDispatch
baseDispatch
;
BaseFilter
*
pFilter
;
BaseFilter
*
pFilter
;
CRITICAL_SECTION
*
pInterfaceLock
;
CRITICAL_SECTION
*
pInterfaceLock
;
...
...
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