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
b1b62947
Commit
b1b62947
authored
Apr 10, 2007
by
Damien Fouilleul
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
- activex: support for taking a snapshot into a Picture object
parent
9fa8b43c
Changes
7
Show whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
89 additions
and
22 deletions
+89
-22
activex/axvlc.idl
activex/axvlc.idl
+3
-3
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
+5
-5
activex/plugin.cpp
activex/plugin.cpp
+0
-2
activex/vlccontrol2.cpp
activex/vlccontrol2.cpp
+79
-10
activex/vlccontrol2.h
activex/vlccontrol2.h
+1
-1
No files found.
activex/axvlc.idl
View file @
b1b62947
...
@@ -24,7 +24,7 @@
...
@@ -24,7 +24,7 @@
//
comments
terminated
by
[
t
]
are
by
tonsofpcs
,
regarding
the
string
review
.
April
02
,
2006.
[
t
]
//
comments
terminated
by
[
t
]
are
by
tonsofpcs
,
regarding
the
string
review
.
April
02
,
2006.
[
t
]
//
Possibly
change
all
instances
of
"the current playlist"
to
"the playlist"
and
"current playlist"
to
"the playlist"
[
t
]
//
Possibly
change
all
instances
of
"the current playlist"
to
"the playlist"
and
"current playlist"
to
"the playlist"
[
t
]
import
"o
a
idl.idl"
;
import
"o
c
idl.idl"
;
[
[
uuid
(
DF2BBE39
-
40
A8
-
433b
-
A279
-
073
F48DA94B6
),
uuid
(
DF2BBE39
-
40
A8
-
433b
-
A279
-
073
F48DA94B6
),
...
@@ -435,8 +435,8 @@ library AXVLC
...
@@ -435,8 +435,8 @@ library AXVLC
[
helpstring
(
"toggle fullscreen/windowed state."
)
]
[
helpstring
(
"toggle fullscreen/windowed state."
)
]
HRESULT
toggleFullscreen
()
;
HRESULT
toggleFullscreen
()
;
[
helpstring
(
"take video snapshot and save i
nto into filePath
."
)
]
[
helpstring
(
"take video snapshot and save i
t into picture object
."
)
]
HRESULT
takeSnapshot
(
BSTR
filePath
)
;
HRESULT
takeSnapshot
(
[
out
,
retval
]
IPictureDisp
**
picture
)
;
}
;
}
;
[
[
...
...
activex/axvlc.tlb
View file @
b1b62947
No preview for this file type
activex/axvlc_idl.c
View file @
b1b62947
/*** Autogenerated by WIDL 0.9.
30
from axvlc.idl - Do not edit ***/
/*** Autogenerated by WIDL 0.9.
27
from axvlc.idl - Do not edit ***/
#include <rpc.h>
#include <rpc.h>
#include <rpcndr.h>
#include <rpcndr.h>
...
...
activex/axvlc_idl.h
View file @
b1b62947
/*** Autogenerated by WIDL 0.9.
30
from axvlc.idl - Do not edit ***/
/*** Autogenerated by WIDL 0.9.
27
from axvlc.idl - Do not edit ***/
#include <rpc.h>
#include <rpc.h>
#include <rpcndr.h>
#include <rpcndr.h>
...
@@ -7,7 +7,7 @@
...
@@ -7,7 +7,7 @@
#ifdef __cplusplus
#ifdef __cplusplus
extern
"C"
{
extern
"C"
{
#endif
#endif
#include <o
a
idl.h>
#include <o
c
idl.h>
DEFINE_GUID
(
LIBID_AXVLC
,
0xdf2bbe39
,
0x40a8
,
0x433b
,
0xa2
,
0x79
,
0x07
,
0x3f
,
0x48
,
0xda
,
0x94
,
0xb6
);
DEFINE_GUID
(
LIBID_AXVLC
,
0xdf2bbe39
,
0x40a8
,
0x433b
,
0xa2
,
0x79
,
0x07
,
0x3f
,
0x48
,
0xda
,
0x94
,
0xb6
);
...
@@ -2269,7 +2269,7 @@ interface IVLCVideo : public IDispatch
...
@@ -2269,7 +2269,7 @@ interface IVLCVideo : public IDispatch
)
=
0
;
)
=
0
;
virtual
HRESULT
STDMETHODCALLTYPE
takeSnapshot
(
virtual
HRESULT
STDMETHODCALLTYPE
takeSnapshot
(
BSTR
filePath
)
=
0
;
IPictureDisp
**
picture
)
=
0
;
};
};
#else
#else
...
@@ -2364,7 +2364,7 @@ typedef struct IVLCVideoVtbl {
...
@@ -2364,7 +2364,7 @@ typedef struct IVLCVideoVtbl {
HRESULT
(
STDMETHODCALLTYPE
*
takeSnapshot
)(
HRESULT
(
STDMETHODCALLTYPE
*
takeSnapshot
)(
IVLCVideo
*
This
,
IVLCVideo
*
This
,
BSTR
filePath
);
IPictureDisp
**
picture
);
END_INTERFACE
END_INTERFACE
}
IVLCVideoVtbl
;
}
IVLCVideoVtbl
;
...
@@ -2488,7 +2488,7 @@ void __RPC_STUB IVLCVideo_toggleFullscreen_Stub(
...
@@ -2488,7 +2488,7 @@ void __RPC_STUB IVLCVideo_toggleFullscreen_Stub(
DWORD
*
pdwStubPhase
);
DWORD
*
pdwStubPhase
);
HRESULT
CALLBACK
IVLCVideo_takeSnapshot_Proxy
(
HRESULT
CALLBACK
IVLCVideo_takeSnapshot_Proxy
(
IVLCVideo
*
This
,
IVLCVideo
*
This
,
BSTR
filePath
);
IPictureDisp
**
picture
);
void
__RPC_STUB
IVLCVideo_takeSnapshot_Stub
(
void
__RPC_STUB
IVLCVideo_takeSnapshot_Stub
(
IRpcStubBuffer
*
This
,
IRpcStubBuffer
*
This
,
IRpcChannelBuffer
*
pRpcChannelBuffer
,
IRpcChannelBuffer
*
pRpcChannelBuffer
,
...
...
activex/plugin.cpp
View file @
b1b62947
...
@@ -497,8 +497,6 @@ HRESULT VLCPlugin::getVLC(libvlc_instance_t** pp_libvlc)
...
@@ -497,8 +497,6 @@ HRESULT VLCPlugin::getVLC(libvlc_instance_t** pp_libvlc)
ppsz_argv
[
ppsz_argc
++
]
=
"--win9x-cv-method=1"
;
ppsz_argv
[
ppsz_argc
++
]
=
"--win9x-cv-method=1"
;
}
}
DebugBreak
();
_p_libvlc
=
libvlc_new
(
ppsz_argc
,
ppsz_argv
,
NULL
);
_p_libvlc
=
libvlc_new
(
ppsz_argc
,
ppsz_argv
,
NULL
);
if
(
NULL
==
_p_libvlc
)
if
(
NULL
==
_p_libvlc
)
{
{
...
...
activex/vlccontrol2.cpp
View file @
b1b62947
...
@@ -29,6 +29,7 @@
...
@@ -29,6 +29,7 @@
#include <shlwapi.h>
#include <shlwapi.h>
#include <wininet.h>
#include <wininet.h>
#include <tchar.h>
using
namespace
std
;
using
namespace
std
;
...
@@ -2353,14 +2354,11 @@ STDMETHODIMP VLCVideo::put_crop(BSTR geometry)
...
@@ -2353,14 +2354,11 @@ STDMETHODIMP VLCVideo::put_crop(BSTR geometry)
return
hr
;
return
hr
;
};
};
STDMETHODIMP
VLCVideo
::
takeSnapshot
(
BSTR
filePath
)
STDMETHODIMP
VLCVideo
::
takeSnapshot
(
LPPICTUREDISP
*
picture
)
{
{
if
(
NULL
==
filePath
)
if
(
NULL
==
picture
)
return
E_POINTER
;
return
E_POINTER
;
if
(
0
==
SysStringLen
(
filePath
)
)
return
E_INVALIDARG
;
libvlc_instance_t
*
p_libvlc
;
libvlc_instance_t
*
p_libvlc
;
HRESULT
hr
=
_p_instance
->
getVLC
(
&
p_libvlc
);
HRESULT
hr
=
_p_instance
->
getVLC
(
&
p_libvlc
);
if
(
SUCCEEDED
(
hr
)
)
if
(
SUCCEEDED
(
hr
)
)
...
@@ -2371,18 +2369,89 @@ STDMETHODIMP VLCVideo::takeSnapshot(BSTR filePath)
...
@@ -2371,18 +2369,89 @@ STDMETHODIMP VLCVideo::takeSnapshot(BSTR filePath)
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
)
)
{
{
char
*
psz_filepath
=
CStrFromBSTR
(
CP_UTF8
,
filePath
);
static
int
uniqueId
=
0
;
if
(
NULL
==
psz_filepath
)
TCHAR
path
[
MAX_PATH
+
1
];
int
pathlen
=
GetTempPath
(
MAX_PATH
-
24
,
path
);
if
(
(
0
==
pathlen
)
||
(
pathlen
>
(
MAX_PATH
-
24
))
)
return
E_FAIL
;
/* check temp directory path by openning it */
{
HANDLE
dirHandle
=
CreateFile
(
path
,
GENERIC_READ
,
FILE_SHARE_READ
|
FILE_SHARE_WRITE
|
FILE_SHARE_DELETE
,
NULL
,
OPEN_EXISTING
,
FILE_FLAG_BACKUP_SEMANTICS
,
NULL
);
if
(
INVALID_HANDLE_VALUE
==
dirHandle
)
{
{
return
E_OUTOFMEMORY
;
_p_instance
->
setErrorInfo
(
IID_IVLCVideo
,
"Invalid temporary directory for snapshot images, check values of TMP, TEMP envars."
);
return
E_FAIL
;
}
else
{
BY_HANDLE_FILE_INFORMATION
bhfi
;
BOOL
res
=
GetFileInformationByHandle
(
dirHandle
,
&
bhfi
);
CloseHandle
(
dirHandle
);
if
(
!
res
||
!
(
bhfi
.
dwFileAttributes
&
FILE_ATTRIBUTE_DIRECTORY
)
)
{
_p_instance
->
setErrorInfo
(
IID_IVLCVideo
,
"Invalid temporary directory for snapshot images, check values of TMP, TEMP envars."
);
return
E_FAIL
;
}
}
}
/* TODO: check file security */
}
TCHAR
filepath
[
MAX_PATH
+
1
];
_stprintf
(
filepath
,
TEXT
(
"%sAXVLC%lXS%lX.bmp"
),
path
,
GetCurrentProcessId
(),
++
uniqueId
);
#ifdef _UNICODE
/* reuse path storage for UTF8 string */
char
*
psz_filepath
=
(
char
*
)
path
;
WCHAR
*
wpath
=
filepath
;
#else
char
*
psz_filepath
=
path
;
/* first convert to unicode using current code page */
WCHAR
wpath
[
MAX_PATH
+
1
];
if
(
0
==
MultiByteToWideChar
(
CP_ACP
,
0
,
filepath
,
-
1
,
wpath
,
sizeof
(
wpath
)
/
sizeof
(
WCHAR
))
)
return
E_FAIL
;
#endif
/* convert to UTF8 */
pathlen
=
WideCharToMultiByte
(
CP_UTF8
,
0
,
wpath
,
-
1
,
psz_filepath
,
sizeof
(
path
),
NULL
,
NULL
);
// fail if path is 0 or too short (i.e pathlen is the same as storage size)
if
(
(
0
==
pathlen
)
||
(
sizeof
(
path
)
==
pathlen
)
)
return
E_FAIL
;
/* take snapshot into file */
libvlc_video_take_snapshot
(
p_input
,
psz_filepath
,
&
ex
);
libvlc_video_take_snapshot
(
p_input
,
psz_filepath
,
&
ex
);
libvlc_input_free
(
p_input
);
libvlc_input_free
(
p_input
);
if
(
!
libvlc_exception_raised
(
&
ex
)
)
if
(
!
libvlc_exception_raised
(
&
ex
)
)
{
{
return
NOERROR
;
hr
=
E_FAIL
;
/* open snapshot file */
HANDLE
snapPic
=
LoadImage
(
NULL
,
filepath
,
IMAGE_BITMAP
,
0
,
0
,
LR_CREATEDIBSECTION
|
LR_LOADFROMFILE
);
if
(
snapPic
)
{
PICTDESC
snapDesc
;
snapDesc
.
cbSizeofstruct
=
sizeof
(
PICTDESC
);
snapDesc
.
picType
=
PICTYPE_BITMAP
;
snapDesc
.
bmp
.
hbitmap
=
(
HBITMAP
)
snapPic
;
snapDesc
.
bmp
.
hpal
=
NULL
;
hr
=
OleCreatePictureIndirect
(
&
snapDesc
,
IID_IPictureDisp
,
TRUE
,
(
LPVOID
*
)
picture
);
if
(
FAILED
(
hr
)
)
{
*
picture
=
NULL
;
DeleteObject
(
snapPic
);
}
}
DeleteFile
(
filepath
);
return
hr
;
}
}
}
}
_p_instance
->
setErrorInfo
(
IID_IVLCVideo
,
libvlc_exception_get_message
(
&
ex
));
_p_instance
->
setErrorInfo
(
IID_IVLCVideo
,
libvlc_exception_get_message
(
&
ex
));
...
...
activex/vlccontrol2.h
View file @
b1b62947
...
@@ -526,7 +526,7 @@ public:
...
@@ -526,7 +526,7 @@ public:
STDMETHODIMP
put_subtitle
(
long
);
STDMETHODIMP
put_subtitle
(
long
);
STDMETHODIMP
get_crop
(
BSTR
*
);
STDMETHODIMP
get_crop
(
BSTR
*
);
STDMETHODIMP
put_crop
(
BSTR
);
STDMETHODIMP
put_crop
(
BSTR
);
STDMETHODIMP
takeSnapshot
(
BSTR
);
STDMETHODIMP
takeSnapshot
(
LPPICTUREDISP
*
);
STDMETHODIMP
toggleFullscreen
();
STDMETHODIMP
toggleFullscreen
();
protected:
protected:
...
...
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