Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
V
vlc-2-2
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-2-2
Commits
542d62dd
Commit
542d62dd
authored
Jan 08, 2007
by
Damien Fouilleul
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
- added 'vlc.video.crop' property for ActiveX/Mozilla
parent
a2d6f90b
Changes
7
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
231 additions
and
8 deletions
+231
-8
activex/axvlc.idl
activex/axvlc.idl
+8
-0
activex/axvlc.tlb
activex/axvlc.tlb
+0
-0
activex/axvlc_idl.c
activex/axvlc_idl.c
+1
-1
activex/axvlc_idl.h
activex/axvlc_idl.h
+49
-1
activex/vlccontrol2.cpp
activex/vlccontrol2.cpp
+119
-2
activex/vlccontrol2.h
activex/vlccontrol2.h
+3
-0
mozilla/control/npolibvlc.cpp
mozilla/control/npolibvlc.cpp
+51
-4
No files found.
activex/axvlc.idl
View file @
542d62dd
...
@@ -422,8 +422,16 @@ library AXVLC
...
@@ -422,8 +422,16 @@ library AXVLC
[
propput
,
helpstring
(
"Sets video aspect ratio."
)
]
[
propput
,
helpstring
(
"Sets video aspect ratio."
)
]
HRESULT
aspectRatio
(
[
in
]
BSTR
aspect
)
;
HRESULT
aspectRatio
(
[
in
]
BSTR
aspect
)
;
[
propget
,
helpstring
(
"Returns crop filter geometry."
)
]
HRESULT
crop
(
[
out
,
retval
]
BSTR
*
geometry
)
;
[
propput
,
helpstring
(
"Sets crop filter geometry."
)
]
HRESULT
crop
(
[
in
]
BSTR
geometry
)
;
[
helpstring
(
"toggle fullscreen/windowed state."
)
]
[
helpstring
(
"toggle fullscreen/windowed state."
)
]
HRESULT
toggleFullscreen
()
;
HRESULT
toggleFullscreen
()
;
[
helpstring
(
"take video snapshot and save into into filePath."
)
]
HRESULT
takeSnapshot
(
BSTR
filePath
)
;
}
;
}
;
[
[
...
...
activex/axvlc.tlb
View file @
542d62dd
No preview for this file type
activex/axvlc_idl.c
View file @
542d62dd
/*** Autogenerated by WIDL 0.9.2
8
from axvlc.idl - Do not edit ***/
/*** Autogenerated by WIDL 0.9.2
7
from axvlc.idl - Do not edit ***/
#include <rpc.h>
#include <rpc.h>
#include <rpcndr.h>
#include <rpcndr.h>
...
...
activex/axvlc_idl.h
View file @
542d62dd
/*** Autogenerated by WIDL 0.9.2
8
from axvlc.idl - Do not edit ***/
/*** Autogenerated by WIDL 0.9.2
7
from axvlc.idl - Do not edit ***/
#include <rpc.h>
#include <rpc.h>
#include <rpcndr.h>
#include <rpcndr.h>
...
@@ -2253,9 +2253,18 @@ interface IVLCVideo : public IDispatch
...
@@ -2253,9 +2253,18 @@ interface IVLCVideo : public IDispatch
virtual
HRESULT
STDMETHODCALLTYPE
put_aspectRatio
(
virtual
HRESULT
STDMETHODCALLTYPE
put_aspectRatio
(
BSTR
aspect
)
=
0
;
BSTR
aspect
)
=
0
;
virtual
HRESULT
STDMETHODCALLTYPE
get_crop
(
BSTR
*
geometry
)
=
0
;
virtual
HRESULT
STDMETHODCALLTYPE
put_crop
(
BSTR
geometry
)
=
0
;
virtual
HRESULT
STDMETHODCALLTYPE
toggleFullscreen
(
virtual
HRESULT
STDMETHODCALLTYPE
toggleFullscreen
(
)
=
0
;
)
=
0
;
virtual
HRESULT
STDMETHODCALLTYPE
takeSnapshot
(
BSTR
filePath
)
=
0
;
};
};
#else
#else
typedef
struct
IVLCVideoVtbl
{
typedef
struct
IVLCVideoVtbl
{
...
@@ -2328,9 +2337,21 @@ typedef struct IVLCVideoVtbl {
...
@@ -2328,9 +2337,21 @@ typedef struct IVLCVideoVtbl {
IVLCVideo
*
This
,
IVLCVideo
*
This
,
BSTR
aspect
);
BSTR
aspect
);
HRESULT
(
STDMETHODCALLTYPE
*
get_crop
)(
IVLCVideo
*
This
,
BSTR
*
geometry
);
HRESULT
(
STDMETHODCALLTYPE
*
put_crop
)(
IVLCVideo
*
This
,
BSTR
geometry
);
HRESULT
(
STDMETHODCALLTYPE
*
toggleFullscreen
)(
HRESULT
(
STDMETHODCALLTYPE
*
toggleFullscreen
)(
IVLCVideo
*
This
);
IVLCVideo
*
This
);
HRESULT
(
STDMETHODCALLTYPE
*
takeSnapshot
)(
IVLCVideo
*
This
,
BSTR
filePath
);
END_INTERFACE
END_INTERFACE
}
IVLCVideoVtbl
;
}
IVLCVideoVtbl
;
interface
IVLCVideo
{
interface
IVLCVideo
{
...
@@ -2354,7 +2375,10 @@ interface IVLCVideo {
...
@@ -2354,7 +2375,10 @@ interface IVLCVideo {
#define IVLCVideo_get_height(p,a) (p)->lpVtbl->get_height(p,a)
#define IVLCVideo_get_height(p,a) (p)->lpVtbl->get_height(p,a)
#define IVLCVideo_get_aspectRatio(p,a) (p)->lpVtbl->get_aspectRatio(p,a)
#define IVLCVideo_get_aspectRatio(p,a) (p)->lpVtbl->get_aspectRatio(p,a)
#define IVLCVideo_put_aspectRatio(p,a) (p)->lpVtbl->put_aspectRatio(p,a)
#define IVLCVideo_put_aspectRatio(p,a) (p)->lpVtbl->put_aspectRatio(p,a)
#define IVLCVideo_get_crop(p,a) (p)->lpVtbl->get_crop(p,a)
#define IVLCVideo_put_crop(p,a) (p)->lpVtbl->put_crop(p,a)
#define IVLCVideo_toggleFullscreen(p) (p)->lpVtbl->toggleFullscreen(p)
#define IVLCVideo_toggleFullscreen(p) (p)->lpVtbl->toggleFullscreen(p)
#define IVLCVideo_takeSnapshot(p,a) (p)->lpVtbl->takeSnapshot(p,a)
#endif
#endif
#endif
#endif
...
@@ -2407,6 +2431,22 @@ void __RPC_STUB IVLCVideo_put_aspectRatio_Stub(
...
@@ -2407,6 +2431,22 @@ void __RPC_STUB IVLCVideo_put_aspectRatio_Stub(
IRpcChannelBuffer
*
pRpcChannelBuffer
,
IRpcChannelBuffer
*
pRpcChannelBuffer
,
PRPC_MESSAGE
pRpcMessage
,
PRPC_MESSAGE
pRpcMessage
,
DWORD
*
pdwStubPhase
);
DWORD
*
pdwStubPhase
);
HRESULT
CALLBACK
IVLCVideo_get_crop_Proxy
(
IVLCVideo
*
This
,
BSTR
*
geometry
);
void
__RPC_STUB
IVLCVideo_get_crop_Stub
(
IRpcStubBuffer
*
This
,
IRpcChannelBuffer
*
pRpcChannelBuffer
,
PRPC_MESSAGE
pRpcMessage
,
DWORD
*
pdwStubPhase
);
HRESULT
CALLBACK
IVLCVideo_put_crop_Proxy
(
IVLCVideo
*
This
,
BSTR
geometry
);
void
__RPC_STUB
IVLCVideo_put_crop_Stub
(
IRpcStubBuffer
*
This
,
IRpcChannelBuffer
*
pRpcChannelBuffer
,
PRPC_MESSAGE
pRpcMessage
,
DWORD
*
pdwStubPhase
);
HRESULT
CALLBACK
IVLCVideo_toggleFullscreen_Proxy
(
HRESULT
CALLBACK
IVLCVideo_toggleFullscreen_Proxy
(
IVLCVideo
*
This
);
IVLCVideo
*
This
);
void
__RPC_STUB
IVLCVideo_toggleFullscreen_Stub
(
void
__RPC_STUB
IVLCVideo_toggleFullscreen_Stub
(
...
@@ -2414,6 +2454,14 @@ void __RPC_STUB IVLCVideo_toggleFullscreen_Stub(
...
@@ -2414,6 +2454,14 @@ void __RPC_STUB IVLCVideo_toggleFullscreen_Stub(
IRpcChannelBuffer
*
pRpcChannelBuffer
,
IRpcChannelBuffer
*
pRpcChannelBuffer
,
PRPC_MESSAGE
pRpcMessage
,
PRPC_MESSAGE
pRpcMessage
,
DWORD
*
pdwStubPhase
);
DWORD
*
pdwStubPhase
);
HRESULT
CALLBACK
IVLCVideo_takeSnapshot_Proxy
(
IVLCVideo
*
This
,
BSTR
filePath
);
void
__RPC_STUB
IVLCVideo_takeSnapshot_Stub
(
IRpcStubBuffer
*
This
,
IRpcChannelBuffer
*
pRpcChannelBuffer
,
PRPC_MESSAGE
pRpcMessage
,
DWORD
*
pdwStubPhase
);
#endif
/* __IVLCVideo_INTERFACE_DEFINED__ */
#endif
/* __IVLCVideo_INTERFACE_DEFINED__ */
...
...
activex/vlccontrol2.cpp
View file @
542d62dd
...
@@ -2098,14 +2098,13 @@ STDMETHODIMP VLCVideo::put_aspectRatio(BSTR aspect)
...
@@ -2098,14 +2098,13 @@ STDMETHODIMP VLCVideo::put_aspectRatio(BSTR aspect)
HRESULT
hr
=
_p_instance
->
getVLC
(
&
p_libvlc
);
HRESULT
hr
=
_p_instance
->
getVLC
(
&
p_libvlc
);
if
(
SUCCEEDED
(
hr
)
)
if
(
SUCCEEDED
(
hr
)
)
{
{
char
*
psz_aspect
=
NULL
;
libvlc_exception_t
ex
;
libvlc_exception_t
ex
;
libvlc_exception_init
(
&
ex
);
libvlc_exception_init
(
&
ex
);
libvlc_input_t
*
p_input
=
libvlc_playlist_get_input
(
p_libvlc
,
&
ex
);
libvlc_input_t
*
p_input
=
libvlc_playlist_get_input
(
p_libvlc
,
&
ex
);
if
(
!
libvlc_exception_raised
(
&
ex
)
)
if
(
!
libvlc_exception_raised
(
&
ex
)
)
{
{
psz_aspect
=
CStrFromBSTR
(
CP_UTF8
,
aspect
);
char
*
psz_aspect
=
CStrFromBSTR
(
CP_UTF8
,
aspect
);
if
(
NULL
==
psz_aspect
)
if
(
NULL
==
psz_aspect
)
{
{
return
E_OUTOFMEMORY
;
return
E_OUTOFMEMORY
;
...
@@ -2128,6 +2127,124 @@ STDMETHODIMP VLCVideo::put_aspectRatio(BSTR aspect)
...
@@ -2128,6 +2127,124 @@ STDMETHODIMP VLCVideo::put_aspectRatio(BSTR aspect)
return
hr
;
return
hr
;
};
};
STDMETHODIMP
VLCVideo
::
get_crop
(
BSTR
*
geometry
)
{
if
(
NULL
==
geometry
)
return
E_POINTER
;
libvlc_instance_t
*
p_libvlc
;
HRESULT
hr
=
_p_instance
->
getVLC
(
&
p_libvlc
);
if
(
SUCCEEDED
(
hr
)
)
{
libvlc_exception_t
ex
;
libvlc_exception_init
(
&
ex
);
libvlc_input_t
*
p_input
=
libvlc_playlist_get_input
(
p_libvlc
,
&
ex
);
if
(
!
libvlc_exception_raised
(
&
ex
)
)
{
char
*
psz_geometry
=
libvlc_video_get_crop_geometry
(
p_input
,
&
ex
);
libvlc_input_free
(
p_input
);
if
(
!
libvlc_exception_raised
(
&
ex
)
)
{
if
(
NULL
==
psz_geometry
)
return
E_OUTOFMEMORY
;
*
geometry
=
BSTRFromCStr
(
CP_UTF8
,
psz_geometry
);
free
(
psz_geometry
);
psz_geometry
=
NULL
;
return
(
NULL
==
geometry
)
?
E_OUTOFMEMORY
:
NOERROR
;
}
if
(
psz_geometry
)
free
(
psz_geometry
);
psz_geometry
=
NULL
;
}
_p_instance
->
setErrorInfo
(
IID_IVLCVideo
,
libvlc_exception_get_message
(
&
ex
));
libvlc_exception_clear
(
&
ex
);
return
E_FAIL
;
}
return
hr
;
};
STDMETHODIMP
VLCVideo
::
put_crop
(
BSTR
geometry
)
{
if
(
NULL
==
geometry
)
return
E_POINTER
;
if
(
0
==
SysStringLen
(
geometry
)
)
return
E_INVALIDARG
;
libvlc_instance_t
*
p_libvlc
;
HRESULT
hr
=
_p_instance
->
getVLC
(
&
p_libvlc
);
if
(
SUCCEEDED
(
hr
)
)
{
libvlc_exception_t
ex
;
libvlc_exception_init
(
&
ex
);
libvlc_input_t
*
p_input
=
libvlc_playlist_get_input
(
p_libvlc
,
&
ex
);
if
(
!
libvlc_exception_raised
(
&
ex
)
)
{
char
*
psz_geometry
=
CStrFromBSTR
(
CP_UTF8
,
geometry
);
if
(
NULL
==
psz_geometry
)
{
return
E_OUTOFMEMORY
;
}
libvlc_video_set_crop_geometry
(
p_input
,
psz_geometry
,
&
ex
);
CoTaskMemFree
(
psz_geometry
);
libvlc_input_free
(
p_input
);
if
(
libvlc_exception_raised
(
&
ex
)
)
{
_p_instance
->
setErrorInfo
(
IID_IVLCVideo
,
libvlc_exception_get_message
(
&
ex
));
libvlc_exception_clear
(
&
ex
);
return
E_FAIL
;
}
}
return
NOERROR
;
}
return
hr
;
};
STDMETHODIMP
VLCVideo
::
takeSnapshot
(
BSTR
filePath
)
{
if
(
NULL
==
filePath
)
return
E_POINTER
;
if
(
0
==
SysStringLen
(
filePath
)
)
return
E_INVALIDARG
;
libvlc_instance_t
*
p_libvlc
;
HRESULT
hr
=
_p_instance
->
getVLC
(
&
p_libvlc
);
if
(
SUCCEEDED
(
hr
)
)
{
libvlc_exception_t
ex
;
libvlc_exception_init
(
&
ex
);
libvlc_input_t
*
p_input
=
libvlc_playlist_get_input
(
p_libvlc
,
&
ex
);
if
(
!
libvlc_exception_raised
(
&
ex
)
)
{
char
*
psz_filepath
=
CStrFromBSTR
(
CP_UTF8
,
filePath
);
if
(
NULL
==
psz_filepath
)
{
return
E_OUTOFMEMORY
;
}
/* TODO: check file security */
libvlc_video_take_snapshot
(
p_input
,
psz_filepath
,
&
ex
);
libvlc_input_free
(
p_input
);
if
(
!
libvlc_exception_raised
(
&
ex
)
)
{
return
NOERROR
;
}
}
_p_instance
->
setErrorInfo
(
IID_IVLCVideo
,
libvlc_exception_get_message
(
&
ex
));
libvlc_exception_clear
(
&
ex
);
return
E_FAIL
;
}
return
hr
;
};
STDMETHODIMP
VLCVideo
::
toggleFullscreen
()
STDMETHODIMP
VLCVideo
::
toggleFullscreen
()
{
{
libvlc_instance_t
*
p_libvlc
;
libvlc_instance_t
*
p_libvlc
;
...
...
activex/vlccontrol2.h
View file @
542d62dd
...
@@ -522,6 +522,9 @@ public:
...
@@ -522,6 +522,9 @@ public:
STDMETHODIMP
get_height
(
long
*
);
STDMETHODIMP
get_height
(
long
*
);
STDMETHODIMP
get_aspectRatio
(
BSTR
*
);
STDMETHODIMP
get_aspectRatio
(
BSTR
*
);
STDMETHODIMP
put_aspectRatio
(
BSTR
);
STDMETHODIMP
put_aspectRatio
(
BSTR
);
STDMETHODIMP
get_crop
(
BSTR
*
);
STDMETHODIMP
put_crop
(
BSTR
);
STDMETHODIMP
takeSnapshot
(
BSTR
);
STDMETHODIMP
toggleFullscreen
();
STDMETHODIMP
toggleFullscreen
();
protected:
protected:
...
...
mozilla/control/npolibvlc.cpp
View file @
542d62dd
...
@@ -1761,7 +1761,8 @@ const NPUTF8 * const LibvlcVideoNPObject::propertyNames[] =
...
@@ -1761,7 +1761,8 @@ const NPUTF8 * const LibvlcVideoNPObject::propertyNames[] =
"fullscreen"
,
"fullscreen"
,
"height"
,
"height"
,
"width"
,
"width"
,
"aspectRatio"
"aspectRatio"
,
"crop"
};
};
enum
LibvlcVideoNPObjectPropertyIds
enum
LibvlcVideoNPObjectPropertyIds
...
@@ -1769,7 +1770,8 @@ enum LibvlcVideoNPObjectPropertyIds
...
@@ -1769,7 +1770,8 @@ enum LibvlcVideoNPObjectPropertyIds
ID_video_fullscreen
,
ID_video_fullscreen
,
ID_video_height
,
ID_video_height
,
ID_video_width
,
ID_video_width
,
ID_video_aspectratio
ID_video_aspectratio
,
ID_video_crop
};
};
const
int
LibvlcVideoNPObject
::
propertyCount
=
sizeof
(
LibvlcVideoNPObject
::
propertyNames
)
/
sizeof
(
NPUTF8
*
);
const
int
LibvlcVideoNPObject
::
propertyCount
=
sizeof
(
LibvlcVideoNPObject
::
propertyNames
)
/
sizeof
(
NPUTF8
*
);
...
@@ -1847,6 +1849,22 @@ RuntimeNPObject::InvokeResult LibvlcVideoNPObject::getProperty(int index, NPVari
...
@@ -1847,6 +1849,22 @@ RuntimeNPObject::InvokeResult LibvlcVideoNPObject::getProperty(int index, NPVari
STRINGZ_TO_NPVARIANT
(
psz_aspect
,
result
);
STRINGZ_TO_NPVARIANT
(
psz_aspect
,
result
);
return
INVOKERESULT_NO_ERROR
;
return
INVOKERESULT_NO_ERROR
;
}
}
case
ID_video_crop
:
{
NPUTF8
*
psz_geometry
=
libvlc_video_get_crop_geometry
(
p_input
,
&
ex
);
libvlc_input_free
(
p_input
);
if
(
libvlc_exception_raised
(
&
ex
)
)
{
NPN_SetException
(
this
,
libvlc_exception_get_message
(
&
ex
));
libvlc_exception_clear
(
&
ex
);
return
INVOKERESULT_GENERIC_ERROR
;
}
if
(
!
psz_geometry
)
return
INVOKERESULT_GENERIC_ERROR
;
STRINGZ_TO_NPVARIANT
(
psz_geometry
,
result
);
return
INVOKERESULT_NO_ERROR
;
}
}
}
libvlc_input_free
(
p_input
);
libvlc_input_free
(
p_input
);
}
}
...
@@ -1882,6 +1900,7 @@ RuntimeNPObject::InvokeResult LibvlcVideoNPObject::setProperty(int index, const
...
@@ -1882,6 +1900,7 @@ RuntimeNPObject::InvokeResult LibvlcVideoNPObject::setProperty(int index, const
int
val
=
NPVARIANT_TO_BOOLEAN
(
value
);
int
val
=
NPVARIANT_TO_BOOLEAN
(
value
);
libvlc_set_fullscreen
(
p_input
,
val
,
&
ex
);
libvlc_set_fullscreen
(
p_input
,
val
,
&
ex
);
libvlc_input_free
(
p_input
);
libvlc_input_free
(
p_input
);
if
(
libvlc_exception_raised
(
&
ex
)
)
if
(
libvlc_exception_raised
(
&
ex
)
)
{
{
NPN_SetException
(
this
,
libvlc_exception_get_message
(
&
ex
));
NPN_SetException
(
this
,
libvlc_exception_get_message
(
&
ex
));
...
@@ -1908,10 +1927,38 @@ RuntimeNPObject::InvokeResult LibvlcVideoNPObject::setProperty(int index, const
...
@@ -1908,10 +1927,38 @@ RuntimeNPObject::InvokeResult LibvlcVideoNPObject::setProperty(int index, const
}
}
libvlc_video_set_aspect_ratio
(
p_input
,
psz_aspect
,
&
ex
);
libvlc_video_set_aspect_ratio
(
p_input
,
psz_aspect
,
&
ex
);
if
(
psz_aspect
)
free
(
psz_aspect
);
free
(
psz_aspect
);
libvlc_input_free
(
p_input
);
if
(
libvlc_exception_raised
(
&
ex
)
)
{
NPN_SetException
(
this
,
libvlc_exception_get_message
(
&
ex
));
libvlc_exception_clear
(
&
ex
);
return
INVOKERESULT_GENERIC_ERROR
;
}
return
INVOKERESULT_NO_ERROR
;
}
case
ID_video_crop
:
{
char
*
psz_geometry
=
NULL
;
if
(
!
NPVARIANT_IS_STRING
(
value
)
)
{
libvlc_input_free
(
p_input
);
return
INVOKERESULT_INVALID_VALUE
;
}
psz_geometry
=
stringValue
(
NPVARIANT_TO_STRING
(
value
));
if
(
!
psz_geometry
)
{
libvlc_input_free
(
p_input
);
return
INVOKERESULT_GENERIC_ERROR
;
}
libvlc_video_set_crop_geometry
(
p_input
,
psz_geometry
,
&
ex
);
free
(
psz_geometry
);
libvlc_input_free
(
p_input
);
libvlc_input_free
(
p_input
);
if
(
libvlc_exception_raised
(
&
ex
)
)
if
(
libvlc_exception_raised
(
&
ex
)
)
{
{
NPN_SetException
(
this
,
libvlc_exception_get_message
(
&
ex
));
NPN_SetException
(
this
,
libvlc_exception_get_message
(
&
ex
));
...
...
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