Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
V
vlc-gpu
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Redmine
Redmine
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Operations
Operations
Metrics
Environments
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
videolan
vlc-gpu
Commits
1b75d79e
Commit
1b75d79e
authored
Apr 18, 2005
by
Damien Fouilleul
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
- source cleanup
- few bugs fixed - added suport to Ole Extent measurments to improve compatibilty
parent
ad67acad
Changes
11
Show whitespace changes
Inline
Side-by-side
Showing
11 changed files
with
261 additions
and
92 deletions
+261
-92
AUTHORS
AUTHORS
+6
-0
activex/README.TXT
activex/README.TXT
+1
-1
activex/oleobject.cpp
activex/oleobject.cpp
+52
-0
activex/persistpropbag.cpp
activex/persistpropbag.cpp
+1
-1
activex/plugin.cpp
activex/plugin.cpp
+98
-52
activex/plugin.h
activex/plugin.h
+12
-4
activex/utils.cpp
activex/utils.cpp
+32
-0
activex/utils.h
activex/utils.h
+3
-0
activex/viewobject.cpp
activex/viewobject.cpp
+37
-22
activex/viewobject.h
activex/viewobject.h
+6
-2
activex/vlccontrol.cpp
activex/vlccontrol.cpp
+13
-10
No files found.
AUTHORS
View file @
1b75d79e
...
...
@@ -344,3 +344,9 @@ D: SSL/TLS support (core, HTTP server, HTTP input)
D: VOC files demultiplexer
S: France
N: Damien Fouilleul
E: Damien.Fouilleul@laposte.net
C: Quovodis
D: ActiveX control
S: Germany
activex/README.TXT
View file @
1b75d79e
...
...
@@ -67,7 +67,7 @@ make sure that the plugin path is set in the registry as per following example:
[HKEY_LOCAL_MACHINE\Software\VideoLAN\VLC]
InstallDir="C:\Program Files\VideoLAN\VLC"
The InstallDir must
contain
the 'plugins' directory.
The InstallDir must
be the parent directory of
the 'plugins' directory.
WARNING: Both control and plugins must come from the same build source tree.
Otherwise, at best, the control will not play any content, at worse
...
...
activex/oleobject.cpp
View file @
1b75d79e
...
...
@@ -225,6 +225,16 @@ STDMETHODIMP VLCOleObject::GetClipboardData(DWORD dwReserved, LPDATAOBJECT *ppDa
STDMETHODIMP
VLCOleObject
::
GetExtent
(
DWORD
dwDrawAspect
,
SIZEL
*
pSizel
)
{
if
(
NULL
==
pSizel
)
return
E_POINTER
;
if
(
dwDrawAspect
&
DVASPECT_CONTENT
)
{
*
pSizel
=
_p_instance
->
getExtent
();
return
S_OK
;
}
pSizel
->
cx
=
0L
;
pSizel
->
cy
=
0L
;
return
E_NOTIMPL
;
};
...
...
@@ -314,6 +324,48 @@ STDMETHODIMP VLCOleObject::SetColorScheme(LOGPALETTE *pLogpal)
STDMETHODIMP
VLCOleObject
::
SetExtent
(
DWORD
dwDrawAspect
,
SIZEL
*
pSizel
)
{
if
(
NULL
==
pSizel
)
return
E_POINTER
;
if
(
dwDrawAspect
&
DVASPECT_CONTENT
)
{
_p_instance
->
setExtent
(
*
pSizel
);
if
(
_p_instance
->
isInPlaceActive
()
)
{
LPOLEINPLACESITE
p_inPlaceSite
;
if
(
SUCCEEDED
(
_p_clientsite
->
QueryInterface
(
IID_IOleInPlaceSite
,
(
void
**
)
&
p_inPlaceSite
))
)
{
LPOLECONTROLSITE
p_controlSite
;
RECT
posRect
=
_p_instance
->
getPosRect
();
if
(
SUCCEEDED
(
_p_clientsite
->
QueryInterface
(
IID_IOleControlSite
,
(
void
**
)
&
p_controlSite
))
)
{
// use HIMETRIC to container transform
POINTL
extent
=
{
pSizel
->
cx
,
pSizel
->
cy
};
POINTF
container
;
if
(
SUCCEEDED
(
p_controlSite
->
TransformCoords
(
&
extent
,
&
container
,
XFORMCOORDS_SIZE
|
XFORMCOORDS_HIMETRICTOCONTAINER
))
)
{
posRect
.
right
=
((
LONG
)
container
.
x
)
+
posRect
.
left
;
posRect
.
bottom
=
((
LONG
)
container
.
y
)
+
posRect
.
top
;
}
p_controlSite
->
Release
();
}
else
{
// use HIMETRIC to display transform
HDC
hDC
=
CreateDevDC
(
NULL
);
posRect
.
right
=
(
pSizel
->
cx
*
GetDeviceCaps
(
hDC
,
LOGPIXELSX
)
/
2540L
)
+
posRect
.
left
;
posRect
.
bottom
=
(
pSizel
->
cy
*
GetDeviceCaps
(
hDC
,
LOGPIXELSY
)
/
2540L
)
+
posRect
.
top
;
DeleteDC
(
hDC
);
}
p_inPlaceSite
->
OnPosRectChange
(
&
posRect
);
p_inPlaceSite
->
Release
();
}
}
return
S_OK
;
}
return
E_NOTIMPL
;
};
...
...
activex/persistpropbag.cpp
View file @
1b75d79e
...
...
@@ -116,7 +116,7 @@ STDMETHODIMP VLCPersistPropertyBag::Load(LPPROPERTYBAG pPropBag, LPERRORLOG pErr
return
_p_instance
->
onLoad
();
};
STDMETHODIMP
VLCPersistPropertyBag
::
Save
(
LPPROPERTYBAG
pPropBag
,
BOOL
fClearDiry
,
BOOL
fSaveAllProperties
)
STDMETHODIMP
VLCPersistPropertyBag
::
Save
(
LPPROPERTYBAG
pPropBag
,
BOOL
fClearDir
t
y
,
BOOL
fSaveAllProperties
)
{
if
(
NULL
==
pPropBag
)
return
E_POINTER
;
...
...
activex/plugin.cpp
View file @
1b75d79e
...
...
@@ -250,6 +250,12 @@ VLCPlugin::VLCPlugin(VLCPluginClass *p_class) :
vlcObjectSafety
=
new
VLCObjectSafety
(
this
);
vlcControl
=
new
VLCControl
(
this
);
vlcViewObject
=
new
VLCViewObject
(
this
);
// set default/preferred size (320x240) pixels in HIMETRIC
HDC
hDC
=
CreateDevDC
(
NULL
);
_extent
.
cx
=
(
320
*
2540L
)
/
GetDeviceCaps
(
hDC
,
LOGPIXELSX
);
_extent
.
cy
=
(
240
*
2540L
)
/
GetDeviceCaps
(
hDC
,
LOGPIXELSY
);
DeleteDC
(
hDC
);
};
VLCPlugin
::~
VLCPlugin
()
...
...
@@ -383,6 +389,12 @@ STDMETHODIMP VLCPlugin::QueryInterface(REFIID riid, void **ppv)
*
ppv
=
reinterpret_cast
<
LPVOID
>
(
vlcViewObject
);
return
NOERROR
;
}
else
if
(
IID_IViewObject2
==
riid
)
{
AddRef
();
*
ppv
=
reinterpret_cast
<
LPVOID
>
(
vlcViewObject
);
return
NOERROR
;
}
*
ppv
=
NULL
;
...
...
@@ -407,29 +419,30 @@ STDMETHODIMP_(ULONG) VLCPlugin::Release(void)
//////////////////////////////////////
/*
** we use a
n in-place child
window to represent plugin viewport,
** whose
size
is limited by the clipping rectangle
** all drawing within this window must follow
**
cartesian coordinate system represented by _bounds.
** we use a window to represent plugin viewport,
** whose
geometry
is limited by the clipping rectangle
** all drawing within this window must follow
must
**
follow coordinates system described in lprPosRect
*/
void
VLCPlugin
::
calcPositionChange
(
LPRECT
lprPosRect
,
LPCRECT
lprc
ClipRect
)
static
void
getViewportCoords
(
LPRECT
lprPosRect
,
LPRECT
lpr
ClipRect
)
{
_bounds
.
right
=
lprPosRect
->
right
-
lprPosRect
->
left
;
RECT
bounds
;
bounds
.
right
=
lprPosRect
->
right
-
lprPosRect
->
left
;
if
(
lpr
c
ClipRect
->
left
<=
lprPosRect
->
left
)
if
(
lprClipRect
->
left
<=
lprPosRect
->
left
)
{
// left side is not clipped out
_
bounds
.
left
=
0
;
bounds
.
left
=
0
;
if
(
lpr
c
ClipRect
->
right
>=
lprPosRect
->
right
)
if
(
lprClipRect
->
right
>=
lprPosRect
->
right
)
{
// right side is not clipped out, no change
}
else
if
(
lpr
c
ClipRect
->
right
>=
lprPosRect
->
left
)
else
if
(
lprClipRect
->
right
>=
lprPosRect
->
left
)
{
// right side is clipped out
lprPosRect
->
right
=
lpr
c
ClipRect
->
right
;
lprPosRect
->
right
=
lprClipRect
->
right
;
}
else
{
...
...
@@ -440,36 +453,36 @@ void VLCPlugin::calcPositionChange(LPRECT lprPosRect, LPCRECT lprcClipRect)
else
{
// left side is clipped out
_bounds
.
left
=
lprPosRect
->
left
-
lprc
ClipRect
->
left
;
_bounds
.
right
+=
_
bounds
.
left
;
bounds
.
left
=
lprPosRect
->
left
-
lpr
ClipRect
->
left
;
bounds
.
right
+=
bounds
.
left
;
lprPosRect
->
left
=
lpr
c
ClipRect
->
left
;
if
(
lpr
c
ClipRect
->
right
>=
lprPosRect
->
right
)
lprPosRect
->
left
=
lprClipRect
->
left
;
if
(
lprClipRect
->
right
>=
lprPosRect
->
right
)
{
// right side is not clipped out
}
else
{
// right side is clipped out
lprPosRect
->
right
=
lpr
c
ClipRect
->
right
;
lprPosRect
->
right
=
lprClipRect
->
right
;
}
}
_
bounds
.
bottom
=
lprPosRect
->
bottom
-
lprPosRect
->
top
;
bounds
.
bottom
=
lprPosRect
->
bottom
-
lprPosRect
->
top
;
if
(
lpr
c
ClipRect
->
top
<=
lprPosRect
->
top
)
if
(
lprClipRect
->
top
<=
lprPosRect
->
top
)
{
// top side is not clipped out
_
bounds
.
top
=
0
;
bounds
.
top
=
0
;
if
(
lpr
c
ClipRect
->
bottom
>=
lprPosRect
->
bottom
)
if
(
lprClipRect
->
bottom
>=
lprPosRect
->
bottom
)
{
// bottom side is not clipped out, no change
}
else
if
(
lpr
c
ClipRect
->
bottom
>=
lprPosRect
->
top
)
else
if
(
lprClipRect
->
bottom
>=
lprPosRect
->
top
)
{
// bottom side is clipped out
lprPosRect
->
bottom
=
lpr
c
ClipRect
->
bottom
;
lprPosRect
->
bottom
=
lprClipRect
->
bottom
;
}
else
{
...
...
@@ -479,20 +492,22 @@ void VLCPlugin::calcPositionChange(LPRECT lprPosRect, LPCRECT lprcClipRect)
}
else
{
_bounds
.
top
=
lprPosRect
->
top
-
lprc
ClipRect
->
top
;
_bounds
.
bottom
+=
_
bounds
.
top
;
bounds
.
top
=
lprPosRect
->
top
-
lpr
ClipRect
->
top
;
bounds
.
bottom
+=
bounds
.
top
;
lprPosRect
->
top
=
lpr
c
ClipRect
->
top
;
if
(
lpr
c
ClipRect
->
bottom
>=
lprPosRect
->
bottom
)
lprPosRect
->
top
=
lprClipRect
->
top
;
if
(
lprClipRect
->
bottom
>=
lprPosRect
->
bottom
)
{
// bottom side is not clipped out
}
else
{
// bottom side is clipped out
lprPosRect
->
bottom
=
lpr
c
ClipRect
->
bottom
;
lprPosRect
->
bottom
=
lprClipRect
->
bottom
;
}
}
*
lprClipRect
=
*
lprPosRect
;
*
lprPosRect
=
bounds
;
};
HRESULT
VLCPlugin
::
onInit
(
BOOL
isNew
)
...
...
@@ -522,7 +537,7 @@ HRESULT VLCPlugin::onInit(BOOL isNew)
RegCloseKey
(
h_key
);
}
#if
0
#if
1
ppsz_argv
[
0
]
=
"C:
\\
cygwin
\\
home
\\
Damien_Fouilleul
\\
dev
\\
videolan
\\
vlc-trunk
\\
vlc"
;
#endif
...
...
@@ -610,16 +625,30 @@ BOOL VLCPlugin::isInPlaceActive(void)
HRESULT
VLCPlugin
::
onActivateInPlace
(
LPMSG
lpMesg
,
HWND
hwndParent
,
LPCRECT
lprcPosRect
,
LPCRECT
lprcClipRect
)
{
RECT
posRect
=
*
lprcPosRect
;
RECT
clipRect
=
*
lprcClipRect
;
calcPositionChange
(
&
posRect
,
lprcClipRect
);
/*
** record keeping of control geometry within container
*/
_posRect
=
posRect
;
/*
** convert posRect & clipRect to match control viewport coordinates
*/
getViewportCoords
(
&
posRect
,
&
clipRect
);
/*
** Create a window for in place activated control.
** the window geometry represents the control viewport
** so that embedded video is always properly clipped.
*/
_inplacewnd
=
CreateWindow
(
_p_class
->
getInPlaceWndClassName
(),
"VLC Plugin In-Place Window"
,
WS_CHILD
|
WS_CLIPCHILDREN
|
WS_TABSTOP
,
pos
Rect
.
left
,
pos
Rect
.
top
,
posRect
.
right
-
pos
Rect
.
left
,
posRect
.
bottom
-
pos
Rect
.
top
,
clip
Rect
.
left
,
clip
Rect
.
top
,
clipRect
.
right
-
clip
Rect
.
left
,
clipRect
.
bottom
-
clip
Rect
.
top
,
hwndParent
,
0
,
_p_class
->
getHInstance
(),
...
...
@@ -631,13 +660,18 @@ HRESULT VLCPlugin::onActivateInPlace(LPMSG lpMesg, HWND hwndParent, LPCRECT lprc
SetWindowLongPtr
(
_inplacewnd
,
GWLP_USERDATA
,
reinterpret_cast
<
LONG_PTR
>
(
this
));
/*
** VLC embedded video geometry automatically matches parent window.
** hence create a child window so that video position and size
** is always correct relative to the viewport bounds
*/
_videownd
=
CreateWindow
(
_p_class
->
getVideoWndClassName
(),
"VLC Plugin Video Window"
,
WS_CHILD
|
WS_CLIPCHILDREN
|
WS_VISIBLE
,
_bounds
.
left
,
_bounds
.
top
,
_bounds
.
right
-
_bounds
.
left
,
_bounds
.
bottom
-
_bounds
.
top
,
posRect
.
left
,
posRect
.
top
,
posRect
.
right
-
posRect
.
left
,
posRect
.
bottom
-
posRect
.
top
,
_inplacewnd
,
0
,
_p_class
->
getHInstance
(),
...
...
@@ -763,36 +797,48 @@ void VLCPlugin::onPaint(HDC hdc, const RECT &bounds, const RECT &pr)
void
VLCPlugin
::
onPositionChange
(
LPCRECT
lprcPosRect
,
LPCRECT
lprcClipRect
)
{
RECT
clipRect
=
*
lprcClipRect
;
RECT
posRect
=
*
lprcPosRect
;
calcPositionChange
(
&
posRect
,
lprcClipRect
);
/*
** record keeping of control geometry within container
*/
_posRect
=
posRect
;
/*
** convert posRect & clipRect to match control viewport coordinates
*/
getViewportCoords
(
&
posRect
,
&
clipRect
);
/*
** change in-place window geometry to match clipping region
*/
MoveWindow
(
_inplacewnd
,
pos
Rect
.
left
,
pos
Rect
.
top
,
posRect
.
right
-
pos
Rect
.
left
,
posRect
.
bottom
-
pos
Rect
.
top
,
clip
Rect
.
left
,
clip
Rect
.
top
,
clipRect
.
right
-
clip
Rect
.
left
,
clipRect
.
bottom
-
clip
Rect
.
top
,
FALSE
);
/*
** change video window geometry to match object bounds within clipping region
*/
MoveWindow
(
_videownd
,
_bounds
.
left
,
_bounds
.
top
,
_bounds
.
right
-
_bounds
.
left
,
_bounds
.
bottom
-
_bounds
.
top
,
posRect
.
left
,
posRect
.
top
,
posRect
.
right
-
posRect
.
left
,
posRect
.
bottom
-
posRect
.
top
,
FALSE
);
RECT
updateRect
;
updateRect
.
left
=
-
_bounds
.
left
;
updateRect
.
top
=
-
_bounds
.
top
;
updateRect
.
right
=
_bounds
.
right
-
_bounds
.
left
;
updateRect
.
bottom
=
_bounds
.
bottom
-
_bounds
.
top
;
/*
** force a full refresh of control content
*/
RECT
updateRect
;
updateRect
.
left
=
-
posRect
.
left
;
updateRect
.
top
=
-
posRect
.
top
;
updateRect
.
right
=
posRect
.
right
-
posRect
.
left
;
updateRect
.
bottom
=
posRect
.
bottom
-
posRect
.
top
;
ValidateRect
(
_videownd
,
NULL
);
InvalidateRect
(
_videownd
,
&
updateRect
,
FALSE
);
...
...
activex/plugin.h
View file @
1b75d79e
...
...
@@ -116,6 +116,7 @@ public:
void
setVisible
(
BOOL
fVisible
);
BOOL
getVisible
(
void
)
{
return
_b_visible
;
};
// container events
void
onPositionChange
(
LPCRECT
lprcPosRect
,
LPCRECT
lprcClipRect
);
void
onPaint
(
HDC
hdc
,
const
RECT
&
bounds
,
const
RECT
&
pr
);
...
...
@@ -126,14 +127,19 @@ public:
void
fireOnPauseEvent
(
void
);
void
fireOnStopEvent
(
void
);
// control size in HIMETRIC
const
SIZEL
&
getExtent
(
void
)
{
return
_extent
;
};
void
setExtent
(
const
SIZEL
&
extent
)
{
_extent
=
extent
;
};
// control geometry within container
RECT
getPosRect
(
void
)
{
return
_posRect
;
};
protected:
virtual
~
VLCPlugin
();
private:
void
calcPositionChange
(
LPRECT
lprPosRect
,
LPCRECT
lprcClipRect
);
//implemented interfaces
class
VLCOleObject
*
vlcOleObject
;
class
VLCOleControl
*
vlcOleControl
;
...
...
@@ -152,7 +158,6 @@ private:
HWND
_inplacewnd
;
// video window (Drawing window)
HWND
_videownd
;
RECT
_bounds
;
VLCPluginClass
*
_p_class
;
ULONG
_i_ref
;
...
...
@@ -164,6 +169,9 @@ private:
BOOL
_b_visible
;
BOOL
_b_sendevents
;
int
_i_vlc
;
SIZEL
_extent
;
RECT
_posRect
;
};
#endif
...
...
activex/utils.cpp
View file @
1b75d79e
...
...
@@ -98,4 +98,36 @@ HRESULT GetObjectProperty(LPUNKNOWN object, DISPID dispID, VARIANT& v)
return
hr
;
};
HDC
CreateDevDC
(
DVTARGETDEVICE
*
ptd
)
{
HDC
hdc
=
NULL
;
LPDEVNAMES
lpDevNames
;
LPDEVMODE
lpDevMode
;
LPTSTR
lpszDriverName
;
LPTSTR
lpszDeviceName
;
LPTSTR
lpszPortName
;
if
(
ptd
==
NULL
)
{
hdc
=
CreateDC
(
TEXT
(
"DISPLAY"
),
NULL
,
NULL
,
NULL
);
goto
errReturn
;
}
lpDevNames
=
(
LPDEVNAMES
)
ptd
;
// offset for size field
if
(
ptd
->
tdExtDevmodeOffset
==
0
)
{
lpDevMode
=
NULL
;
}
else
{
lpDevMode
=
(
LPDEVMODE
)
((
LPTSTR
)
ptd
+
ptd
->
tdExtDevmodeOffset
);
}
lpszDriverName
=
(
LPTSTR
)
lpDevNames
+
ptd
->
tdDriverNameOffset
;
lpszDeviceName
=
(
LPTSTR
)
lpDevNames
+
ptd
->
tdDeviceNameOffset
;
lpszPortName
=
(
LPTSTR
)
lpDevNames
+
ptd
->
tdPortNameOffset
;
hdc
=
CreateDC
(
lpszDriverName
,
lpszDeviceName
,
lpszPortName
,
lpDevMode
);
errReturn:
return
hdc
;
};
activex/utils.h
View file @
1b75d79e
...
...
@@ -34,6 +34,9 @@ extern BSTR BSTRFromCStr(int codePage, const char *s);
// properties
extern
HRESULT
GetObjectProperty
(
LPUNKNOWN
object
,
DISPID
dispID
,
VARIANT
&
v
);
// properties
extern
HDC
CreateDevDC
(
DVTARGETDEVICE
*
ptd
);
// enumeration
template
<
class
T
>
class
VLCEnum
:
IUnknown
{
...
...
activex/viewobject.cpp
View file @
1b75d79e
...
...
@@ -23,7 +23,7 @@
#include "plugin.h"
#include "viewobject.h"
#include
<iostream>
#include
"utils.h"
using
namespace
std
;
...
...
@@ -31,9 +31,8 @@ STDMETHODIMP VLCViewObject::Draw(DWORD dwAspect, LONG lindex, PVOID pvAspect,
DVTARGETDEVICE
*
ptd
,
HDC
hicTargetDev
,
HDC
hdcDraw
,
LPCRECTL
lprcBounds
,
LPCRECTL
lprcWBounds
,
BOOL
(
CALLBACK
*
pfnContinue
)(
DWORD
),
DWORD
dwContinue
)
{
switch
(
dwAspect
)
if
(
dwAspect
&
DVASPECT_CONTENT
)
{
case
DVASPECT_CONTENT
:
if
(
_p_instance
->
getVisible
()
)
{
RECT
bounds
;
...
...
@@ -44,12 +43,6 @@ STDMETHODIMP VLCViewObject::Draw(DWORD dwAspect, LONG lindex, PVOID pvAspect,
_p_instance
->
onPaint
(
hdcDraw
,
bounds
,
bounds
);
}
return
S_OK
;
case
DVASPECT_THUMBNAIL
:
break
;
case
DVASPECT_ICON
:
break
;
case
DVASPECT_DOCPRINT
:
break
;
}
return
E_NOTIMPL
;
};
...
...
@@ -60,19 +53,28 @@ STDMETHODIMP VLCViewObject::Freeze(DWORD dwAspect, LONG lindex,
if
(
NULL
!=
pvAspect
)
return
E_INVALIDARG
;
return
OLE_E_BLANK
;
return
E_NOTIMPL
;
};
STDMETHODIMP
VLCViewObject
::
GetAdvise
(
LPDWORD
pdwAspect
,
LPDWORD
padvf
,
LPADVISESINK
*
ppAdviseSink
)
{
return
E_NOTIMPL
;
if
(
NULL
!=
pdwAspect
)
*
pdwAspect
=
0
;
if
(
NULL
!=
padvf
)
*
padvf
=
0
;
if
(
NULL
!=
ppAdviseSink
)
*
ppAdviseSink
=
NULL
;
return
S_OK
;
};
STDMETHODIMP
VLCViewObject
::
GetColorSet
(
DWORD
dwAspect
,
LONG
lindex
,
PVOID
pvAspect
,
DVTARGETDEVICE
*
ptd
,
HDC
hicTargetDev
,
LPLOGPALETTE
*
ppColorSet
)
{
return
E_NOTIMPL
;
return
S_FALSE
;
};
STDMETHODIMP
VLCViewObject
::
SetAdvise
(
DWORD
dwAspect
,
DWORD
advf
,
...
...
@@ -86,3 +88,16 @@ STDMETHODIMP VLCViewObject::Unfreeze(DWORD dwFreeze)
return
E_NOTIMPL
;
};
STDMETHODIMP
VLCViewObject
::
GetExtent
(
DWORD
dwAspect
,
LONG
lindex
,
DVTARGETDEVICE
*
ptd
,
LPSIZEL
lpSizel
)
{
if
(
dwAspect
&
DVASPECT_CONTENT
)
{
*
lpSizel
=
_p_instance
->
getExtent
();
return
S_OK
;
}
lpSizel
->
cx
=
0L
;
lpSizel
->
cy
=
0L
;
return
E_NOTIMPL
;
};
activex/viewobject.h
View file @
1b75d79e
...
...
@@ -25,7 +25,7 @@
#include <oleidl.h>
class
VLCViewObject
:
public
IViewObject
class
VLCViewObject
:
public
IViewObject
2
{
public:
...
...
@@ -39,7 +39,8 @@ public:
if
(
(
NULL
!=
ppv
)
&&
(
IID_IUnknown
==
riid
)
&&
(
IID_IPersist
==
riid
)
&&
(
IID_IViewObject
==
riid
)
)
{
&&
(
IID_IViewObject
==
riid
)
&&
(
IID_IViewObject2
==
riid
)
)
{
AddRef
();
*
ppv
=
reinterpret_cast
<
LPVOID
>
(
this
);
return
NOERROR
;
...
...
@@ -58,6 +59,9 @@ public:
STDMETHODIMP
SetAdvise
(
DWORD
,
DWORD
,
LPADVISESINK
);
STDMETHODIMP
Unfreeze
(
DWORD
);
// IViewObject2 methods
STDMETHODIMP
GetExtent
(
DWORD
,
LONG
,
DVTARGETDEVICE
*
,
LPSIZEL
);
private:
VLCPlugin
*
_p_instance
;
...
...
activex/vlccontrol.cpp
View file @
1b75d79e
...
...
@@ -54,6 +54,9 @@ HRESULT VLCControl::getTypeInfo(void)
STDMETHODIMP
VLCControl
::
GetTypeInfoCount
(
UINT
*
pctInfo
)
{
if
(
NULL
==
pctInfo
)
return
E_INVALIDARG
;
if
(
SUCCEEDED
(
getTypeInfo
())
)
*
pctInfo
=
1
;
else
...
...
@@ -102,7 +105,7 @@ STDMETHODIMP VLCControl::Invoke(DISPID dispIdMember, REFIID riid,
STDMETHODIMP
VLCControl
::
get_Value
(
VARIANT
*
pvarValue
)
{
if
(
NULL
==
pvarValue
)
return
E_
INVALIDARG
;
return
E_
POINTER
;
V_VT
(
pvarValue
)
=
VT_BOOL
;
return
get_Playing
(
&
V_BOOL
(
pvarValue
));
...
...
@@ -127,7 +130,7 @@ STDMETHODIMP VLCControl::put_Value(VARIANT pvarValue)
STDMETHODIMP
VLCControl
::
get_Visible
(
VARIANT_BOOL
*
isVisible
)
{
if
(
NULL
==
isVisible
)
return
E_
INVALIDARG
;
return
E_
POINTER
;
*
isVisible
=
_p_instance
->
getVisible
();
...
...
@@ -180,7 +183,7 @@ STDMETHODIMP VLCControl::stop(void)
STDMETHODIMP
VLCControl
::
get_Playing
(
VARIANT_BOOL
*
isPlaying
)
{
if
(
NULL
==
isPlaying
)
return
E_
INVALIDARG
;
return
E_
POINTER
;
int
i_vlc
=
_p_instance
->
getVLCObject
();
if
(
i_vlc
)
...
...
@@ -215,7 +218,7 @@ STDMETHODIMP VLCControl::put_Playing(VARIANT_BOOL isPlaying)
STDMETHODIMP
VLCControl
::
get_Position
(
float
*
position
)
{
if
(
NULL
==
position
)
return
E_
INVALIDARG
;
return
E_
POINTER
;
int
i_vlc
=
_p_instance
->
getVLCObject
();
if
(
i_vlc
)
...
...
@@ -241,7 +244,7 @@ STDMETHODIMP VLCControl::put_Position(float position)
STDMETHODIMP
VLCControl
::
get_Time
(
int
*
seconds
)
{
if
(
NULL
==
seconds
)
return
E_
INVALIDARG
;
return
E_
POINTER
;
int
i_vlc
=
_p_instance
->
getVLCObject
();
if
(
i_vlc
)
...
...
@@ -289,7 +292,7 @@ STDMETHODIMP VLCControl::fullscreen(void)
STDMETHODIMP
VLCControl
::
get_Length
(
int
*
seconds
)
{
if
(
NULL
==
seconds
)
return
E_
INVALIDARG
;
return
E_
POINTER
;
int
i_vlc
=
_p_instance
->
getVLCObject
();
if
(
i_vlc
)
...
...
@@ -326,7 +329,7 @@ STDMETHODIMP VLCControl::playSlower(void)
STDMETHODIMP
VLCControl
::
get_Volume
(
int
*
volume
)
{
if
(
NULL
==
volume
)
return
E_
INVALIDARG
;
return
E_
POINTER
;
int
i_vlc
=
_p_instance
->
getVLCObject
();
if
(
i_vlc
)
...
...
@@ -557,7 +560,7 @@ static HRESULT createTargetOptions(int codePage, VARIANT *options, char ***cOpti
STDMETHODIMP
VLCControl
::
addTarget
(
BSTR
uri
,
VARIANT
options
,
enum
VLCPlaylistMode
mode
,
int
position
)
{
if
(
NULL
==
uri
)
if
(
0
==
SysStringLen
(
uri
)
)
return
E_INVALIDARG
;
HRESULT
hr
=
E_UNEXPECTED
;
...
...
@@ -588,7 +591,7 @@ STDMETHODIMP VLCControl::addTarget( BSTR uri, VARIANT options, enum VLCPlaylistM
STDMETHODIMP
VLCControl
::
get_PlaylistIndex
(
int
*
index
)
{
if
(
NULL
==
index
)
return
E_
INVALIDARG
;
return
E_
POINTER
;
int
i_vlc
=
_p_instance
->
getVLCObject
();
if
(
i_vlc
)
...
...
@@ -647,7 +650,7 @@ STDMETHODIMP VLCControl::playlistClear(void)
STDMETHODIMP
VLCControl
::
get_VersionInfo
(
BSTR
*
version
)
{
if
(
NULL
==
version
)
return
E_
INVALIDARG
;
return
E_
POINTER
;
const
char
*
versionStr
=
VLC_Version
();
if
(
NULL
!=
versionStr
)
...
...
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