Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
V
vlc
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
Commits
7194c2f6
Commit
7194c2f6
authored
Mar 25, 2007
by
Damien Fouilleul
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
- activex: multiple bugfix backports from trunk
parent
2ca06f95
Changes
8
Hide whitespace changes
Inline
Side-by-side
Showing
8 changed files
with
371 additions
and
182 deletions
+371
-182
activex/main.cpp
activex/main.cpp
+69
-87
activex/plugin.cpp
activex/plugin.cpp
+53
-19
activex/plugin.h
activex/plugin.h
+5
-2
activex/utils.cpp
activex/utils.cpp
+0
-22
activex/utils.h
activex/utils.h
+2
-4
activex/vlccontrol.cpp
activex/vlccontrol.cpp
+119
-19
activex/vlccontrol2.cpp
activex/vlccontrol2.cpp
+122
-28
configure.ac
configure.ac
+1
-1
No files found.
activex/main.cpp
View file @
7194c2f6
...
@@ -29,6 +29,7 @@
...
@@ -29,6 +29,7 @@
#include <windows.h>
#include <windows.h>
#include <shlwapi.h>
#include <shlwapi.h>
#include <tchar.h>
#include <guiddef.h>
#include <guiddef.h>
using
namespace
std
;
using
namespace
std
;
...
@@ -80,10 +81,10 @@ STDAPI DllCanUnloadNow(VOID)
...
@@ -80,10 +81,10 @@ STDAPI DllCanUnloadNow(VOID)
return
(
0
==
i_class_ref
)
?
S_OK
:
S_FALSE
;
return
(
0
==
i_class_ref
)
?
S_OK
:
S_FALSE
;
};
};
static
inline
HKEY
keyCreate
(
HKEY
parentKey
,
LPCSTR
keyName
)
static
inline
HKEY
keyCreate
(
HKEY
parentKey
,
LPC
T
STR
keyName
)
{
{
HKEY
childKey
;
HKEY
childKey
;
if
(
ERROR_SUCCESS
==
RegCreateKeyEx
A
(
parentKey
,
keyName
,
0
,
NULL
,
if
(
ERROR_SUCCESS
==
RegCreateKeyEx
(
parentKey
,
keyName
,
0
,
NULL
,
REG_OPTION_NON_VOLATILE
,
KEY_ALL_ACCESS
,
NULL
,
&
childKey
,
NULL
)
)
REG_OPTION_NON_VOLATILE
,
KEY_ALL_ACCESS
,
NULL
,
&
childKey
,
NULL
)
)
{
{
return
childKey
;
return
childKey
;
...
@@ -91,24 +92,24 @@ static inline HKEY keyCreate(HKEY parentKey, LPCSTR keyName)
...
@@ -91,24 +92,24 @@ static inline HKEY keyCreate(HKEY parentKey, LPCSTR keyName)
return
NULL
;
return
NULL
;
};
};
static
inline
HKEY
keySet
(
HKEY
hKey
,
LPC
STR
valueName
,
const
void
*
s
,
size_t
len
)
static
inline
HKEY
keySet
(
HKEY
hKey
,
LPC
TSTR
valueName
,
const
void
*
s
,
size_t
len
,
DWORD
dwType
=
REG_SZ
)
{
{
if
(
NULL
!=
hKey
)
if
(
NULL
!=
hKey
)
{
{
RegSetValueEx
A
(
hKey
,
valueName
,
0
,
REG_SZ
,
RegSetValueEx
(
hKey
,
valueName
,
0
,
dwType
,
(
const
BYTE
*
)
s
,
len
);
(
const
BYTE
*
)
s
,
len
);
}
}
return
hKey
;
return
hKey
;
};
};
static
inline
HKEY
keySetDef
(
HKEY
hKey
,
const
void
*
s
,
size_t
len
)
static
inline
HKEY
keySetDef
(
HKEY
hKey
,
const
void
*
s
,
size_t
len
,
DWORD
dwType
=
REG_SZ
)
{
{
return
keySet
(
hKey
,
NULL
,
s
,
len
);
return
keySet
(
hKey
,
NULL
,
s
,
len
,
dwType
);
};
};
static
inline
HKEY
keySetDef
(
HKEY
hKey
,
LPCSTR
s
)
static
inline
HKEY
keySetDef
(
HKEY
hKey
,
LPC
T
STR
s
)
{
{
return
keySetDef
(
hKey
,
s
,
s
trlen
(
s
)
+
1
);
return
keySetDef
(
hKey
,
s
,
s
izeof
(
TCHAR
)
*
(
_tcslen
(
s
)
+
1
),
REG_SZ
);
};
};
static
inline
HKEY
keyClose
(
HKEY
hKey
)
static
inline
HKEY
keyClose
(
HKEY
hKey
)
...
@@ -120,25 +121,23 @@ static inline HKEY keyClose(HKEY hKey)
...
@@ -120,25 +121,23 @@ static inline HKEY keyClose(HKEY hKey)
return
NULL
;
return
NULL
;
};
};
static
HRESULT
UnregisterProgID
(
REFCLSID
rclsid
,
unsigned
int
version
)
static
void
UnregisterProgID
(
REFCLSID
rclsid
,
unsigned
int
version
)
{
{
LPCSTR
psz_CLSID
=
CStrFromGUID
(
rclsid
)
;
OLECHAR
szCLSID
[
GUID_STRLEN
]
;
if
(
NULL
==
psz_CLSID
)
StringFromGUID2
(
rclsid
,
szCLSID
,
GUID_STRLEN
);
return
E_OUTOFMEMORY
;
char
progId
[
sizeof
(
PROGID_STR
)
+
16
];
TCHAR
progId
[
sizeof
(
PROGID_STR
)
+
16
];
sprintf
(
progId
,
"%s.%u"
,
PROGID_STR
,
version
);
_stprintf
(
progId
,
TEXT
(
"%s.%u"
),
TEXT
(
PROGID_STR
)
,
version
);
SHDeleteKey
A
(
HKEY_CLASSES_ROOT
,
progId
);
SHDeleteKey
(
HKEY_CLASSES_ROOT
,
progId
);
HKEY
hClsIDKey
;
HKEY
hClsIDKey
;
if
(
ERROR_SUCCESS
==
RegOpenKeyEx
A
(
HKEY_CLASSES_ROOT
,
"CLSID"
,
0
,
KEY_WRITE
,
&
hClsIDKey
)
)
if
(
ERROR_SUCCESS
==
RegOpenKeyEx
(
HKEY_CLASSES_ROOT
,
TEXT
(
"CLSID"
)
,
0
,
KEY_WRITE
,
&
hClsIDKey
)
)
{
{
SHDeleteKey
(
hClsIDKey
,
psz_
CLSID
);
SHDeleteKey
(
hClsIDKey
,
sz
CLSID
);
RegCloseKey
(
hClsIDKey
);
RegCloseKey
(
hClsIDKey
);
}
}
CoTaskMemFree
((
void
*
)
psz_CLSID
);
};
};
STDAPI
DllUnregisterServer
(
VOID
)
STDAPI
DllUnregisterServer
(
VOID
)
...
@@ -173,20 +172,19 @@ STDAPI DllUnregisterServer(VOID)
...
@@ -173,20 +172,19 @@ STDAPI DllUnregisterServer(VOID)
return
S_OK
;
return
S_OK
;
};
};
static
HRESULT
RegisterClassID
(
HKEY
hParent
,
REFCLSID
rclsid
,
unsigned
int
version
,
BOOL
isDefault
,
const
char
*
path
,
size_t
pathLen
)
static
HRESULT
RegisterClassID
(
HKEY
hParent
,
REFCLSID
rclsid
,
unsigned
int
version
,
BOOL
isDefault
,
LPCTSTR
path
,
size_t
pathLen
)
{
{
char
progId
[
sizeof
(
PROGID_STR
)
+
16
];
TCHAR
progId
[
sizeof
(
PROGID_STR
)
+
16
];
sprintf
(
progId
,
"%s.%u"
,
PROGID_STR
,
version
);
_stprintf
(
progId
,
TEXT
(
"%s.%u"
),
TEXT
(
PROGID_STR
)
,
version
);
char
description
[
sizeof
(
DESCRIPTION
)
+
16
];
TCHAR
description
[
sizeof
(
DESCRIPTION
)
+
16
];
sprintf
(
description
,
"%s v%u"
,
DESCRIPTION
,
version
);
_stprintf
(
description
,
TEXT
(
"%s v%u"
),
TEXT
(
DESCRIPTION
)
,
version
);
HKEY
hClassKey
;
HKEY
hClassKey
;
{
{
LPCSTR
psz_CLSID
=
CStrFromGUID
(
rclsid
)
;
OLECHAR
szCLSID
[
GUID_STRLEN
]
;
if
(
NULL
==
psz_CLSID
)
StringFromGUID2
(
rclsid
,
szCLSID
,
GUID_STRLEN
);
return
E_OUTOFMEMORY
;
HKEY
hProgKey
=
keyCreate
(
HKEY_CLASSES_ROOT
,
progId
);
HKEY
hProgKey
=
keyCreate
(
HKEY_CLASSES_ROOT
,
progId
);
if
(
NULL
!=
hProgKey
)
if
(
NULL
!=
hProgKey
)
...
@@ -194,9 +192,9 @@ static HRESULT RegisterClassID(HKEY hParent, REFCLSID rclsid, unsigned int versi
...
@@ -194,9 +192,9 @@ static HRESULT RegisterClassID(HKEY hParent, REFCLSID rclsid, unsigned int versi
// default key value
// default key value
keySetDef
(
hProgKey
,
description
);
keySetDef
(
hProgKey
,
description
);
keyClose
(
keySetDef
(
keyCreate
(
hProgKey
,
"CLSID"
),
keyClose
(
keySetDef
(
keyCreate
(
hProgKey
,
TEXT
(
"CLSID"
)
),
psz_
CLSID
,
sz
CLSID
,
GUID_STRLEN
));
sizeof
(
szCLSID
)
));
//hSubKey = keyClose(keyCreate(hBaseKey, "Insertable"));
//hSubKey = keyClose(keyCreate(hBaseKey, "Insertable"));
...
@@ -204,22 +202,21 @@ static HRESULT RegisterClassID(HKEY hParent, REFCLSID rclsid, unsigned int versi
...
@@ -204,22 +202,21 @@ static HRESULT RegisterClassID(HKEY hParent, REFCLSID rclsid, unsigned int versi
}
}
if
(
isDefault
)
if
(
isDefault
)
{
{
hProgKey
=
keyCreate
(
HKEY_CLASSES_ROOT
,
PROGID_STR
);
hProgKey
=
keyCreate
(
HKEY_CLASSES_ROOT
,
TEXT
(
PROGID_STR
)
);
if
(
NULL
!=
hProgKey
)
if
(
NULL
!=
hProgKey
)
{
{
// default key value
// default key value
keySetDef
(
hProgKey
,
description
);
keySetDef
(
hProgKey
,
description
);
keyClose
(
keySetDef
(
keyCreate
(
hProgKey
,
"CLSID"
),
keyClose
(
keySetDef
(
keyCreate
(
hProgKey
,
TEXT
(
"CLSID"
)
),
psz_
CLSID
,
sz
CLSID
,
GUID_STRLEN
));
sizeof
(
szCLSID
)
));
keyClose
(
keySetDef
(
keyCreate
(
hProgKey
,
"CurVer"
),
keyClose
(
keySetDef
(
keyCreate
(
hProgKey
,
TEXT
(
"CurVer"
)
),
progId
));
progId
));
}
}
}
}
hClassKey
=
keyCreate
(
hParent
,
psz_CLSID
);
hClassKey
=
keyCreate
(
hParent
,
szCLSID
);
CoTaskMemFree
((
void
*
)
psz_CLSID
);
}
}
if
(
NULL
!=
hClassKey
)
if
(
NULL
!=
hClassKey
)
{
{
...
@@ -227,45 +224,45 @@ static HRESULT RegisterClassID(HKEY hParent, REFCLSID rclsid, unsigned int versi
...
@@ -227,45 +224,45 @@ static HRESULT RegisterClassID(HKEY hParent, REFCLSID rclsid, unsigned int versi
keySetDef
(
hClassKey
,
description
);
keySetDef
(
hClassKey
,
description
);
// Control key value
// Control key value
keyClose
(
keyCreate
(
hClassKey
,
"Control"
));
keyClose
(
keyCreate
(
hClassKey
,
TEXT
(
"Control"
)
));
// Insertable key value
// Insertable key value
//keyClose(keyCreate(hClassKey,
"Insertable"
));
//keyClose(keyCreate(hClassKey,
TEXT("Insertable")
));
// ToolboxBitmap32 key value
// ToolboxBitmap32 key value
{
{
char
iconPath
[
pathLen
+
3
];
TCHAR
iconPath
[
pathLen
+
3
];
memcpy
(
iconPath
,
path
,
pathLen
);
memcpy
(
iconPath
,
path
,
sizeof
(
TCHAR
)
*
pathLen
);
strcpy
(
iconPath
+
pathLen
,
",1"
);
_tcscpy
(
iconPath
+
pathLen
,
TEXT
(
",1"
)
);
keyClose
(
keySetDef
(
keyCreate
(
hClassKey
,
keyClose
(
keySetDef
(
keyCreate
(
hClassKey
,
"ToolboxBitmap32"
),
TEXT
(
"ToolboxBitmap32"
)
),
iconPath
,
sizeof
(
iconPath
)));
iconPath
,
sizeof
(
iconPath
)));
}
}
#ifdef BUILD_LOCALSERVER
#ifdef BUILD_LOCALSERVER
// LocalServer32 key value
// LocalServer32 key value
keyClose
(
keySetDef
(
keyCreate
(
hClassKey
,
keyClose
(
keySetDef
(
keyCreate
(
hClassKey
,
"LocalServer32"
,
path
,
pathLen
+
1
)));
TEXT
(
"LocalServer32"
),
path
,
sizeof
(
TCHAR
)
*
(
pathLen
+
1
)
)));
#else
#else
// InprocServer32 key value
// InprocServer32 key value
{
{
HKEY
hSubKey
=
keySetDef
(
keyCreate
(
hClassKey
,
HKEY
hSubKey
=
keySetDef
(
keyCreate
(
hClassKey
,
"InprocServer32"
),
TEXT
(
"InprocServer32"
)
),
path
,
pathLen
+
1
);
path
,
sizeof
(
TCHAR
)
*
(
pathLen
+
1
)
);
keySet
(
hSubKey
,
keySet
(
hSubKey
,
"ThreadingModel"
,
TEXT
(
"ThreadingModel"
)
,
T
HREADING_MODEL
,
sizeof
(
THREADING_MODEL
));
T
EXT
(
THREADING_MODEL
),
sizeof
(
TEXT
(
THREADING_MODEL
)
));
keyClose
(
hSubKey
);
keyClose
(
hSubKey
);
}
}
#endif
#endif
// MiscStatus key value
// MiscStatus key value
keyClose
(
keySetDef
(
keyCreate
(
hClassKey
,
keyClose
(
keySetDef
(
keyCreate
(
hClassKey
,
"MiscStatus
\\
1"
),
TEXT
(
"MiscStatus
\\
1"
)
),
MISC_STATUS
,
sizeof
(
MISC_STATUS
)));
TEXT
(
MISC_STATUS
),
sizeof
(
TEXT
(
MISC_STATUS
)
)));
// Programmable key value
// Programmable key value
keyClose
(
keyCreate
(
hClassKey
,
"Programmable"
));
keyClose
(
keyCreate
(
hClassKey
,
TEXT
(
"Programmable"
)
));
// ProgID key value
// ProgID key value
keyClose
(
keySetDef
(
keyCreate
(
hClassKey
,
keyClose
(
keySetDef
(
keyCreate
(
hClassKey
,
...
@@ -274,23 +271,23 @@ static HRESULT RegisterClassID(HKEY hParent, REFCLSID rclsid, unsigned int versi
...
@@ -274,23 +271,23 @@ static HRESULT RegisterClassID(HKEY hParent, REFCLSID rclsid, unsigned int versi
// VersionIndependentProgID key value
// VersionIndependentProgID key value
keyClose
(
keySetDef
(
keyCreate
(
hClassKey
,
keyClose
(
keySetDef
(
keyCreate
(
hClassKey
,
"VersionIndependentProgID"
),
TEXT
(
"VersionIndependentProgID"
)
),
PROGID_STR
,
sizeof
(
PROGID_STR
)));
TEXT
(
PROGID_STR
),
sizeof
(
TEXT
(
PROGID_STR
)
)));
// Version key value
// Version key value
keyClose
(
keySetDef
(
keyCreate
(
hClassKey
,
keyClose
(
keySetDef
(
keyCreate
(
hClassKey
,
"Version"
),
TEXT
(
"Version"
)
),
"1.0"
));
TEXT
(
"1.0"
)
));
// TypeLib key value
// TypeLib key value
LPCSTR
psz_LIBID
=
CStrFromGUID
(
LIBID_AXVLC
)
;
OLECHAR
szLIBID
[
GUID_STRLEN
]
;
if
(
NULL
!=
psz_LIBID
)
{
StringFromGUID2
(
LIBID_AXVLC
,
szLIBID
,
GUID_STRLEN
);
keyClose
(
keySetDef
(
keyCreate
(
hClassKey
,
"TypeLib"
)
,
keyClose
(
keySetDef
(
keyCreate
(
hClassKey
,
psz_LIBID
,
GUID_STRLEN
));
TEXT
(
"TypeLib"
)),
CoTaskMemFree
((
void
*
)
psz_LIBID
);
szLIBID
,
sizeof
(
szLIBID
))
);
}
RegCloseKey
(
hClassKey
);
RegCloseKey
(
hClassKey
);
}
}
return
S_OK
;
return
S_OK
;
...
@@ -300,14 +297,14 @@ STDAPI DllRegisterServer(VOID)
...
@@ -300,14 +297,14 @@ STDAPI DllRegisterServer(VOID)
{
{
DllUnregisterServer
();
DllUnregisterServer
();
char
DllPath
[
MAX_PATH
];
TCHAR
DllPath
[
MAX_PATH
];
DWORD
DllPathLen
=
GetModuleFileName
A
(
h_instance
,
DllPath
,
sizeof
(
DllPath
)
)
;
DWORD
DllPathLen
=
GetModuleFileName
(
h_instance
,
DllPath
,
MAX_PATH
)
;
if
(
0
==
DllPathLen
)
if
(
0
==
DllPathLen
)
return
E_UNEXPECTED
;
return
E_UNEXPECTED
;
HKEY
hBaseKey
;
HKEY
hBaseKey
;
if
(
ERROR_SUCCESS
!=
RegOpenKeyEx
A
(
HKEY_CLASSES_ROOT
,
"CLSID"
,
0
,
KEY_CREATE_SUB_KEY
,
&
hBaseKey
)
)
if
(
ERROR_SUCCESS
!=
RegOpenKeyEx
(
HKEY_CLASSES_ROOT
,
TEXT
(
"CLSID"
)
,
0
,
KEY_CREATE_SUB_KEY
,
&
hBaseKey
)
)
return
SELFREG_E_CLASS
;
return
SELFREG_E_CLASS
;
RegisterClassID
(
hBaseKey
,
CLSID_VLCPlugin
,
1
,
FALSE
,
DllPath
,
DllPathLen
);
RegisterClassID
(
hBaseKey
,
CLSID_VLCPlugin
,
1
,
FALSE
,
DllPath
,
DllPathLen
);
...
@@ -334,34 +331,19 @@ STDAPI DllRegisterServer(VOID)
...
@@ -334,34 +331,19 @@ STDAPI DllRegisterServer(VOID)
pcr
->
Release
();
pcr
->
Release
();
}
}
// register type lib into the registry
ITypeLib
*
typeLib
;
#ifdef BUILD_LOCALSERVER
#ifdef BUILD_LOCALSERVER
// replace .exe by .tlb
// replace .exe by .tlb
strcpy
(
DllPath
+
DllPathLen
-
4
,
".tlb"
);
_tcscpy
(
DllPath
+
DllPathLen
-
4
,
TEXT
(
".tlb"
)
);
#endif
#endif
#ifndef OLE2ANSI
// register type lib into the registry
size_t
typeLibPathLen
=
MultiByteToWideChar
(
CP_ACP
,
0
,
DllPath
,
-
1
,
NULL
,
0
);
ITypeLib
*
typeLib
;
if
(
typeLibPathLen
>
0
)
{
HRESULT
result
=
LoadTypeLibEx
(
DllPath
,
REGKIND_REGISTER
,
&
typeLib
);
LPOLESTR
typeLibPath
=
(
LPOLESTR
)
CoTaskMemAlloc
(
typeLibPathLen
*
sizeof
(
wchar_t
));
if
(
SUCCEEDED
(
result
)
)
MultiByteToWideChar
(
CP_ACP
,
0
,
DllPath
,
DllPathLen
,
typeLibPath
,
typeLibPathLen
);
if
(
FAILED
(
LoadTypeLibEx
(
typeLibPath
,
REGKIND_REGISTER
,
&
typeLib
))
)
#ifndef BUILD_LOCALSERVER
return
SELFREG_E_TYPELIB
;
typeLib
->
Release
();
typeLib
->
Release
();
#endif
CoTaskMemFree
((
void
*
)
typeLibPath
);
}
#else
if
(
FAILED
(
LoadTypeLibEx
((
LPOLESTR
)
DllPath
,
REGKIND_REGISTER
,
&
typeLib
))
)
return
SELFREG_E_TYPELIB
;
typeLib
->
Release
();
#endif
return
S_OK
;
return
result
;
};
};
#ifdef BUILD_LOCALSERVER
#ifdef BUILD_LOCALSERVER
...
...
activex/plugin.cpp
View file @
7194c2f6
...
@@ -565,38 +565,52 @@ HRESULT VLCPlugin::getVLC(libvlc_instance_t** pp_libvlc)
...
@@ -565,38 +565,52 @@ HRESULT VLCPlugin::getVLC(libvlc_instance_t** pp_libvlc)
char
*
ppsz_argv
[
32
]
=
{
"vlc"
};
char
*
ppsz_argv
[
32
]
=
{
"vlc"
};
int
ppsz_argc
=
1
;
int
ppsz_argc
=
1
;
char
p_progpath
[
MAX_PATH
];
{
TCHAR
w_progpath
[
MAX_PATH
];
DWORD
len
=
GetModuleFileName
(
DllGetModule
(),
w_progpath
,
MAX_PATH
);
if
(
len
>
0
)
{
len
=
WideCharToMultiByte
(
CP_UTF8
,
0
,
w_progpath
,
len
,
p_progpath
,
sizeof
(
p_progpath
)
-
1
,
NULL
,
NULL
);
if
(
len
>
0
)
{
p_progpath
[
len
]
=
'\0'
;
ppsz_argv
[
0
]
=
p_progpath
;
}
}
}
ppsz_argv
[
ppsz_argc
++
]
=
"-vv"
;
HKEY
h_key
;
HKEY
h_key
;
DWORD
i_type
,
i_data
=
MAX_PATH
+
1
;
char
p_pluginpath
[
MAX_PATH
];
char
p_data
[
MAX_PATH
+
1
];
if
(
RegOpenKeyEx
(
HKEY_LOCAL_MACHINE
,
TEXT
(
"Software
\\
VideoLAN
\\
VLC"
),
if
(
RegOpenKeyEx
(
HKEY_LOCAL_MACHINE
,
"Software
\\
VideoLAN
\\
VLC"
,
0
,
KEY_READ
,
&
h_key
)
==
ERROR_SUCCESS
)
0
,
KEY_READ
,
&
h_key
)
==
ERROR_SUCCESS
)
{
{
if
(
RegQueryValueEx
(
h_key
,
"InstallDir"
,
0
,
&
i_type
,
DWORD
i_type
,
i_data
=
MAX_PATH
;
(
LPBYTE
)
p_data
,
&
i_data
)
==
ERROR_SUCCESS
)
TCHAR
w_pluginpath
[
MAX_PATH
];
if
(
RegQueryValueEx
(
h_key
,
TEXT
(
"InstallDir"
),
0
,
&
i_type
,
(
LPBYTE
)
w_pluginpath
,
&
i_data
)
==
ERROR_SUCCESS
)
{
{
if
(
i_type
==
REG_SZ
)
if
(
i_type
==
REG_SZ
)
{
{
strcat
(
p_data
,
"
\\
plugins"
);
if
(
WideCharToMultiByte
(
CP_UTF8
,
0
,
w_pluginpath
,
-
1
,
p_pluginpath
,
ppsz_argv
[
ppsz_argc
++
]
=
"--plugin-path"
;
sizeof
(
p_pluginpath
)
-
sizeof
(
"
\\
plugins"
)
+
1
,
NULL
,
NULL
)
)
ppsz_argv
[
ppsz_argc
++
]
=
p_data
;
{
strcat
(
p_pluginpath
,
"
\\
plugins"
);
ppsz_argv
[
ppsz_argc
++
]
=
"--plugin-path"
;
ppsz_argv
[
ppsz_argc
++
]
=
p_pluginpath
;
}
}
}
}
}
RegCloseKey
(
h_key
);
RegCloseKey
(
h_key
);
}
}
char
p_path
[
MAX_PATH
+
1
];
DWORD
len
=
GetModuleFileNameA
(
DllGetModule
(),
p_path
,
sizeof
(
p_path
));
if
(
len
>
0
)
{
p_path
[
len
]
=
'\0'
;
ppsz_argv
[
0
]
=
p_path
;
}
// make sure plugin isn't affected with VLC single instance mode
// make sure plugin isn't affected with VLC single instance mode
ppsz_argv
[
ppsz_argc
++
]
=
"--no-one-instance"
;
ppsz_argv
[
ppsz_argc
++
]
=
"--no-one-instance"
;
/* common settings */
/* common settings */
ppsz_argv
[
ppsz_argc
++
]
=
"-vv"
;
ppsz_argv
[
ppsz_argc
++
]
=
"--no-stats"
;
ppsz_argv
[
ppsz_argc
++
]
=
"--no-stats"
;
ppsz_argv
[
ppsz_argc
++
]
=
"--intf"
;
ppsz_argv
[
ppsz_argc
++
]
=
"--intf"
;
ppsz_argv
[
ppsz_argc
++
]
=
"dummy"
;
ppsz_argv
[
ppsz_argc
++
]
=
"dummy"
;
...
@@ -822,7 +836,7 @@ HRESULT VLCPlugin::onActivateInPlace(LPMSG lpMesg, HWND hwndParent, LPCRECT lprc
...
@@ -822,7 +836,7 @@ HRESULT VLCPlugin::onActivateInPlace(LPMSG lpMesg, HWND hwndParent, LPCRECT lprc
** properly clipped.
** properly clipped.
*/
*/
_inplacewnd
=
CreateWindow
(
_p_class
->
getInPlaceWndClassName
(),
_inplacewnd
=
CreateWindow
(
_p_class
->
getInPlaceWndClassName
(),
"VLC Plugin In-Place Window"
,
TEXT
(
"VLC Plugin In-Place Window"
)
,
WS_CHILD
|
WS_CLIPCHILDREN
|
WS_CLIPSIBLINGS
,
WS_CHILD
|
WS_CLIPCHILDREN
|
WS_CLIPSIBLINGS
,
clipRect
.
left
,
clipRect
.
left
,
clipRect
.
top
,
clipRect
.
top
,
...
@@ -846,7 +860,7 @@ HRESULT VLCPlugin::onActivateInPlace(LPMSG lpMesg, HWND hwndParent, LPCRECT lprc
...
@@ -846,7 +860,7 @@ HRESULT VLCPlugin::onActivateInPlace(LPMSG lpMesg, HWND hwndParent, LPCRECT lprc
** is always correct relative to the viewport bounds
** is always correct relative to the viewport bounds
*/
*/
_videownd
=
CreateWindow
(
_p_class
->
getVideoWndClassName
(),
_videownd
=
CreateWindow
(
_p_class
->
getVideoWndClassName
(),
"VLC Plugin Video Window"
,
TEXT
(
"VLC Plugin Video Window"
)
,
WS_CHILD
|
WS_CLIPCHILDREN
|
WS_VISIBLE
,
WS_CHILD
|
WS_CLIPCHILDREN
|
WS_VISIBLE
,
posRect
.
left
,
posRect
.
left
,
posRect
.
top
,
posRect
.
top
,
...
@@ -947,6 +961,26 @@ void VLCPlugin::setVolume(int volume)
...
@@ -947,6 +961,26 @@ void VLCPlugin::setVolume(int volume)
}
}
};
};
void
VLCPlugin
::
setTime
(
int
seconds
)
{
if
(
seconds
<
0
)
seconds
=
0
;
if
(
seconds
!=
_i_time
)
{
setStartTime
(
_i_time
);
if
(
isRunning
()
)
{
libvlc_input_t
*
p_input
=
libvlc_playlist_get_input
(
_p_libvlc
,
NULL
);
if
(
NULL
!=
p_input
)
{
libvlc_input_set_time
(
p_input
,
_i_time
,
NULL
);
libvlc_input_free
(
p_input
);
}
}
}
};
void
VLCPlugin
::
setFocus
(
BOOL
fFocus
)
void
VLCPlugin
::
setFocus
(
BOOL
fFocus
)
{
{
if
(
fFocus
)
if
(
fFocus
)
...
...
activex/plugin.h
View file @
7194c2f6
...
@@ -51,8 +51,8 @@ public:
...
@@ -51,8 +51,8 @@ public:
REFCLSID
getClassID
(
void
)
{
return
(
REFCLSID
)
_classid
;
};
REFCLSID
getClassID
(
void
)
{
return
(
REFCLSID
)
_classid
;
};
LPCSTR
getInPlaceWndClassName
(
void
)
const
{
return
TEXT
(
"VLC Plugin In-Place"
);
};
LPC
T
STR
getInPlaceWndClassName
(
void
)
const
{
return
TEXT
(
"VLC Plugin In-Place"
);
};
LPCSTR
getVideoWndClassName
(
void
)
const
{
return
TEXT
(
"VLC Plugin Video"
);
};
LPC
T
STR
getVideoWndClassName
(
void
)
const
{
return
TEXT
(
"VLC Plugin Video"
);
};
HINSTANCE
getHInstance
(
void
)
const
{
return
_hinstance
;
};
HINSTANCE
getHInstance
(
void
)
const
{
return
_hinstance
;
};
LPPICTURE
getInPlacePict
(
void
)
const
LPPICTURE
getInPlacePict
(
void
)
const
{
if
(
NULL
!=
_inplace_picture
)
_inplace_picture
->
AddRef
();
return
_inplace_picture
;
};
{
if
(
NULL
!=
_inplace_picture
)
_inplace_picture
->
AddRef
();
return
_inplace_picture
;
};
...
@@ -127,6 +127,9 @@ public:
...
@@ -127,6 +127,9 @@ public:
};
};
inline
int
getStartTime
(
void
)
{
return
_i_time
;
};
inline
int
getStartTime
(
void
)
{
return
_i_time
;
};
void
setTime
(
int
time
);
int
getTime
(
void
)
{
return
_i_time
;
};
void
setBaseURL
(
BSTR
url
)
void
setBaseURL
(
BSTR
url
)
{
{
SysFreeString
(
_bstr_baseurl
);
SysFreeString
(
_bstr_baseurl
);
...
...
activex/utils.cpp
View file @
7194c2f6
...
@@ -77,28 +77,6 @@ BSTR BSTRFromCStr(UINT codePage, LPCSTR s)
...
@@ -77,28 +77,6 @@ BSTR BSTRFromCStr(UINT codePage, LPCSTR s)
return
NULL
;
return
NULL
;
};
};
char
*
CStrFromGUID
(
REFGUID
clsid
)
{
LPOLESTR
oleStr
;
if
(
FAILED
(
StringFromIID
(
clsid
,
&
oleStr
))
)
return
NULL
;
#ifdef OLE2ANSI
return
(
LPCSTR
)
oleStr
;
#else
char
*
pct_CLSID
=
NULL
;
size_t
len
=
WideCharToMultiByte
(
CP_ACP
,
0
,
oleStr
,
-
1
,
NULL
,
0
,
NULL
,
NULL
);
if
(
len
>
0
)
{
pct_CLSID
=
(
char
*
)
CoTaskMemAlloc
(
len
);
WideCharToMultiByte
(
CP_ACP
,
0
,
oleStr
,
-
1
,
pct_CLSID
,
len
,
NULL
,
NULL
);
}
CoTaskMemFree
(
oleStr
);
return
pct_CLSID
;
#endif
};
/*
/*
** properties
** properties
*/
*/
...
...
activex/utils.h
View file @
7194c2f6
...
@@ -32,8 +32,6 @@ extern char *CStrFromWSTR(UINT codePage, LPCWSTR wstr, UINT len);
...
@@ -32,8 +32,6 @@ extern char *CStrFromWSTR(UINT codePage, LPCWSTR wstr, UINT len);
extern
char
*
CStrFromBSTR
(
UINT
codePage
,
BSTR
bstr
);
extern
char
*
CStrFromBSTR
(
UINT
codePage
,
BSTR
bstr
);
extern
BSTR
BSTRFromCStr
(
UINT
codePage
,
LPCSTR
s
);
extern
BSTR
BSTRFromCStr
(
UINT
codePage
,
LPCSTR
s
);
extern
char
*
CStrFromGUID
(
REFGUID
clsid
);
// properties
// properties
extern
HRESULT
GetObjectProperty
(
LPUNKNOWN
object
,
DISPID
dispID
,
VARIANT
&
v
);
extern
HRESULT
GetObjectProperty
(
LPUNKNOWN
object
,
DISPID
dispID
,
VARIANT
&
v
);
...
@@ -48,7 +46,7 @@ extern LPWSTR CombineURL(LPCWSTR baseUrl, LPCWSTR url);
...
@@ -48,7 +46,7 @@ extern LPWSTR CombineURL(LPCWSTR baseUrl, LPCWSTR url);
/**************************************************************************************************/
/**************************************************************************************************/
/* this function object is used to dereference the iterator into a value */
/* this function object is used to dereference the iterator into a value */
template
<
class
T
,
class
Iterator
>
template
<
typename
T
,
class
Iterator
>
struct
VLCDereference
struct
VLCDereference
{
{
T
operator
()(
const
Iterator
&
i
)
const
T
operator
()(
const
Iterator
&
i
)
const
...
@@ -57,7 +55,7 @@ struct VLCDereference
...
@@ -57,7 +55,7 @@ struct VLCDereference
};
};
};
};
template
<
REFIID
EnumeratorIID
,
class
Enumerator
,
class
T
,
class
Iterator
,
typename
Dereference
=
VLCDereference
<
T
,
Iterator
>
>
template
<
REFIID
EnumeratorIID
,
class
Enumerator
,
typename
T
,
class
Iterator
,
typename
Dereference
=
VLCDereference
<
T
,
Iterator
>
>
class
VLCEnumIterator
:
public
Enumerator
class
VLCEnumIterator
:
public
Enumerator
{
{
...
...
activex/vlccontrol.cpp
View file @
7194c2f6
...
@@ -228,31 +228,16 @@ STDMETHODIMP VLCControl::get_Time(int *seconds)
...
@@ -228,31 +228,16 @@ STDMETHODIMP VLCControl::get_Time(int *seconds)
}
}
}
}
else
else
*
seconds
=
_p_instance
->
get
Start
Time
();
*
seconds
=
_p_instance
->
getTime
();
return
result
;
return
result
;
};
};
STDMETHODIMP
VLCControl
::
put_Time
(
int
seconds
)
STDMETHODIMP
VLCControl
::
put_Time
(
int
seconds
)
{
{
if
(
seconds
<
0
)
_p_instance
->
setTime
(
seconds
);
seconds
=
0
;
HRESULT
result
=
NOERROR
;
return
NOERROR
;
if
(
_p_instance
->
isRunning
()
)
{
int
i_vlc
;
result
=
_p_instance
->
getVLCObject
(
&
i_vlc
);
if
(
SUCCEEDED
(
result
)
)
{
VLC_TimeSet
(
i_vlc
,
seconds
,
VLC_FALSE
);
}
}
else
if
(
seconds
!=
_p_instance
->
getStartTime
()
)
{
_p_instance
->
setStartTime
(
seconds
);
}
return
result
;
};
};
STDMETHODIMP
VLCControl
::
shuttle
(
int
seconds
)
STDMETHODIMP
VLCControl
::
shuttle
(
int
seconds
)
...
@@ -561,6 +546,92 @@ void VLCControl::FreeTargetOptions(char **cOptions, int cOptionCount)
...
@@ -561,6 +546,92 @@ void VLCControl::FreeTargetOptions(char **cOptions, int cOptionCount)
}
}
};
};
static
HRESULT
parseStringOptions
(
int
codePage
,
BSTR
bstr
,
char
***
cOptions
,
int
*
cOptionCount
)
{
HRESULT
hr
=
E_INVALIDARG
;
if
(
SysStringLen
(
bstr
)
>
0
)
{
hr
=
E_OUTOFMEMORY
;
char
*
s
=
CStrFromBSTR
(
codePage
,
bstr
);
char
*
val
=
s
;
if
(
val
)
{
long
capacity
=
16
;
char
**
options
=
(
char
**
)
CoTaskMemAlloc
(
capacity
*
sizeof
(
char
*
));
if
(
options
)
{
int
nOptions
=
0
;
char
*
end
=
val
+
strlen
(
val
);
while
(
val
<
end
)
{
// skip leading blanks
while
(
(
val
<
end
)
&&
((
*
val
==
' '
)
||
(
*
val
==
'\t'
))
)
++
val
;
char
*
start
=
val
;
// skip till we get a blank character
while
(
(
val
<
end
)
&&
(
*
val
!=
' '
)
&&
(
*
val
!=
'\t'
)
)
{
char
c
=
*
(
val
++
);
if
(
(
'\''
==
c
)
||
(
'"'
==
c
)
)
{
// skip till end of string
while
(
(
val
<
end
)
&&
(
*
(
val
++
)
!=
c
)
);
}
}
if
(
val
>
start
)
{
if
(
nOptions
==
capacity
)
{
capacity
+=
16
;
char
**
moreOptions
=
(
char
**
)
CoTaskMemRealloc
(
options
,
capacity
*
sizeof
(
char
*
));
if
(
!
moreOptions
)
{
/* failed to allocate more memory */
CoTaskMemFree
(
s
);
/* return what we got so far */
*
cOptionCount
=
nOptions
;
*
cOptions
=
options
;
return
NOERROR
;
}
options
=
moreOptions
;
}
*
(
val
++
)
=
'\0'
;
options
[
nOptions
]
=
(
char
*
)
CoTaskMemAlloc
(
val
-
start
);
if
(
options
[
nOptions
]
)
{
memcpy
(
options
[
nOptions
],
start
,
val
-
start
);
++
nOptions
;
}
else
{
/* failed to allocate memory */
CoTaskMemFree
(
s
);
/* return what we got so far */
*
cOptionCount
=
nOptions
;
*
cOptions
=
options
;
return
NOERROR
;
}
}
else
// must be end of string
break
;
}
*
cOptionCount
=
nOptions
;
*
cOptions
=
options
;
hr
=
NOERROR
;
}
CoTaskMemFree
(
s
);
}
}
return
hr
;
}
HRESULT
VLCControl
::
CreateTargetOptions
(
int
codePage
,
VARIANT
*
options
,
char
***
cOptions
,
int
*
cOptionCount
)
HRESULT
VLCControl
::
CreateTargetOptions
(
int
codePage
,
VARIANT
*
options
,
char
***
cOptions
,
int
*
cOptionCount
)
{
{
HRESULT
hr
=
E_INVALIDARG
;
HRESULT
hr
=
E_INVALIDARG
;
...
@@ -583,7 +654,7 @@ HRESULT VLCControl::CreateTargetOptions(int codePage, VARIANT *options, char ***
...
@@ -583,7 +654,7 @@ HRESULT VLCControl::CreateTargetOptions(int codePage, VARIANT *options, char ***
}
}
else
if
(
VT_DISPATCH
==
V_VT
(
options
)
)
else
if
(
VT_DISPATCH
==
V_VT
(
options
)
)
{
{
//
collection paramete
r
//
if object is a collection, retrieve enumerato
r
VARIANT
colEnum
;
VARIANT
colEnum
;
V_VT
(
&
colEnum
)
=
VT_UNKNOWN
;
V_VT
(
&
colEnum
)
=
VT_UNKNOWN
;
hr
=
GetObjectProperty
(
V_DISPATCH
(
options
),
DISPID_NEWENUM
,
colEnum
);
hr
=
GetObjectProperty
(
V_DISPATCH
(
options
),
DISPID_NEWENUM
,
colEnum
);
...
@@ -645,6 +716,18 @@ HRESULT VLCControl::CreateTargetOptions(int codePage, VARIANT *options, char ***
...
@@ -645,6 +716,18 @@ HRESULT VLCControl::CreateTargetOptions(int codePage, VARIANT *options, char ***
enumVar
->
Release
();
enumVar
->
Release
();
}
}
}
}
else
{
// coerce object into a string and parse it
VARIANT
v_name
;
VariantInit
(
&
v_name
);
hr
=
VariantChangeType
(
&
v_name
,
options
,
0
,
VT_BSTR
);
if
(
SUCCEEDED
(
hr
)
)
{
hr
=
parseStringOptions
(
codePage
,
V_BSTR
(
&
v_name
),
cOptions
,
cOptionCount
);
VariantClear
(
&
v_name
);
}
}
}
}
else
if
(
V_ISARRAY
(
options
)
)
else
if
(
V_ISARRAY
(
options
)
)
{
{
...
@@ -741,6 +824,22 @@ HRESULT VLCControl::CreateTargetOptions(int codePage, VARIANT *options, char ***
...
@@ -741,6 +824,22 @@ HRESULT VLCControl::CreateTargetOptions(int codePage, VARIANT *options, char ***
return
NOERROR
;
return
NOERROR
;
}
}
}
}
else
if
(
VT_UNKNOWN
==
V_VT
(
options
)
)
{
// coerce object into a string and parse it
VARIANT
v_name
;
VariantInit
(
&
v_name
);
hr
=
VariantChangeType
(
&
v_name
,
options
,
0
,
VT_BSTR
);
if
(
SUCCEEDED
(
hr
)
)
{
hr
=
parseStringOptions
(
codePage
,
V_BSTR
(
&
v_name
),
cOptions
,
cOptionCount
);
VariantClear
(
&
v_name
);
}
}
else
if
(
VT_BSTR
==
V_VT
(
options
)
)
{
hr
=
parseStringOptions
(
codePage
,
V_BSTR
(
options
),
cOptions
,
cOptionCount
);
}
return
hr
;
return
hr
;
};
};
...
@@ -861,6 +960,7 @@ STDMETHODIMP VLCControl::get_VersionInfo(BSTR *version)
...
@@ -861,6 +960,7 @@ STDMETHODIMP VLCControl::get_VersionInfo(BSTR *version)
if
(
NULL
!=
versionStr
)
if
(
NULL
!=
versionStr
)
{
{
*
version
=
BSTRFromCStr
(
CP_UTF8
,
versionStr
);
*
version
=
BSTRFromCStr
(
CP_UTF8
,
versionStr
);
return
NULL
==
*
version
?
E_OUTOFMEMORY
:
NOERROR
;
return
NULL
==
*
version
?
E_OUTOFMEMORY
:
NOERROR
;
}
}
*
version
=
NULL
;
*
version
=
NULL
;
...
...
activex/vlccontrol2.cpp
View file @
7194c2f6
...
@@ -87,7 +87,7 @@ STDMETHODIMP VLCAudio::GetTypeInfo(UINT iTInfo, LCID lcid, LPTYPEINFO* ppTInfo)
...
@@ -87,7 +87,7 @@ STDMETHODIMP VLCAudio::GetTypeInfo(UINT iTInfo, LCID lcid, LPTYPEINFO* ppTInfo)
return
E_NOTIMPL
;
return
E_NOTIMPL
;
};
};
STDMETHODIMP
VLCAudio
::
GetIDsOfNames
(
REFIID
riid
,
LPOLESTR
*
rgszNames
,
STDMETHODIMP
VLCAudio
::
GetIDsOfNames
(
REFIID
riid
,
LPOLESTR
*
rgszNames
,
UINT
cNames
,
LCID
lcid
,
DISPID
*
rgDispID
)
UINT
cNames
,
LCID
lcid
,
DISPID
*
rgDispID
)
{
{
if
(
SUCCEEDED
(
loadTypeInfo
())
)
if
(
SUCCEEDED
(
loadTypeInfo
())
)
...
@@ -190,7 +190,8 @@ STDMETHODIMP VLCAudio::put_volume(long volume)
...
@@ -190,7 +190,8 @@ STDMETHODIMP VLCAudio::put_volume(long volume)
libvlc_audio_set_volume
(
p_libvlc
,
volume
,
&
ex
);
libvlc_audio_set_volume
(
p_libvlc
,
volume
,
&
ex
);
if
(
libvlc_exception_raised
(
&
ex
)
)
if
(
libvlc_exception_raised
(
&
ex
)
)
{
{
_p_instance
->
setErrorInfo
(
IID_IVLCAudio
,
libvlc_exception_get_message
(
&
ex
));
_p_instance
->
setErrorInfo
(
IID_IVLCAudio
,
libvlc_exception_get_message
(
&
ex
));
libvlc_exception_clear
(
&
ex
);
libvlc_exception_clear
(
&
ex
);
return
E_FAIL
;
return
E_FAIL
;
}
}
...
@@ -216,7 +217,8 @@ STDMETHODIMP VLCAudio::get_track(long* track)
...
@@ -216,7 +217,8 @@ STDMETHODIMP VLCAudio::get_track(long* track)
libvlc_input_free
(
p_input
);
libvlc_input_free
(
p_input
);
if
(
libvlc_exception_raised
(
&
ex
)
)
if
(
libvlc_exception_raised
(
&
ex
)
)
{
{
_p_instance
->
setErrorInfo
(
IID_IVLCAudio
,
libvlc_exception_get_message
(
&
ex
));
_p_instance
->
setErrorInfo
(
IID_IVLCAudio
,
libvlc_exception_get_message
(
&
ex
));
libvlc_exception_clear
(
&
ex
);
libvlc_exception_clear
(
&
ex
);
return
E_FAIL
;
return
E_FAIL
;
}
}
...
@@ -239,7 +241,8 @@ STDMETHODIMP VLCAudio::put_track(long track)
...
@@ -239,7 +241,8 @@ STDMETHODIMP VLCAudio::put_track(long track)
libvlc_input_free
(
p_input
);
libvlc_input_free
(
p_input
);
if
(
libvlc_exception_raised
(
&
ex
)
)
if
(
libvlc_exception_raised
(
&
ex
)
)
{
{
_p_instance
->
setErrorInfo
(
IID_IVLCAudio
,
libvlc_exception_get_message
(
&
ex
));
_p_instance
->
setErrorInfo
(
IID_IVLCAudio
,
libvlc_exception_get_message
(
&
ex
));
libvlc_exception_clear
(
&
ex
);
libvlc_exception_clear
(
&
ex
);
return
E_FAIL
;
return
E_FAIL
;
}
}
...
@@ -268,7 +271,7 @@ STDMETHODIMP VLCAudio::get_channel(long *channel)
...
@@ -268,7 +271,7 @@ STDMETHODIMP VLCAudio::get_channel(long *channel)
libvlc_exception_clear
(
&
ex
);
libvlc_exception_clear
(
&
ex
);
return
E_FAIL
;
return
E_FAIL
;
}
}
return
NOERROR
;
return
NOERROR
;
}
}
return
hr
;
return
hr
;
};
};
...
@@ -297,7 +300,7 @@ STDMETHODIMP VLCAudio::put_channel(long channel)
...
@@ -297,7 +300,7 @@ STDMETHODIMP VLCAudio::put_channel(long channel)
STDMETHODIMP
VLCAudio
::
toggleMute
()
STDMETHODIMP
VLCAudio
::
toggleMute
()
{
{
libvlc_instance_t
*
p_libvlc
=
NULL
;
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
)
)
{
{
...
@@ -307,8 +310,8 @@ STDMETHODIMP VLCAudio::toggleMute()
...
@@ -307,8 +310,8 @@ STDMETHODIMP VLCAudio::toggleMute()
libvlc_audio_toggle_mute
(
p_libvlc
,
&
ex
);
libvlc_audio_toggle_mute
(
p_libvlc
,
&
ex
);
if
(
libvlc_exception_raised
(
&
ex
)
)
if
(
libvlc_exception_raised
(
&
ex
)
)
{
{
_p_instance
->
setErrorInfo
(
IID_IVLCAudio
,
_p_instance
->
setErrorInfo
(
IID_IVLCAudio
,
libvlc_exception_get_message
(
&
ex
));
libvlc_exception_get_message
(
&
ex
));
libvlc_exception_clear
(
&
ex
);
libvlc_exception_clear
(
&
ex
);
return
E_FAIL
;
return
E_FAIL
;
}
}
...
@@ -374,7 +377,7 @@ STDMETHODIMP VLCInput::GetTypeInfo(UINT iTInfo, LCID lcid, LPTYPEINFO* ppTInfo)
...
@@ -374,7 +377,7 @@ STDMETHODIMP VLCInput::GetTypeInfo(UINT iTInfo, LCID lcid, LPTYPEINFO* ppTInfo)
return
E_NOTIMPL
;
return
E_NOTIMPL
;
};
};
STDMETHODIMP
VLCInput
::
GetIDsOfNames
(
REFIID
riid
,
LPOLESTR
*
rgszNames
,
STDMETHODIMP
VLCInput
::
GetIDsOfNames
(
REFIID
riid
,
LPOLESTR
*
rgszNames
,
UINT
cNames
,
LCID
lcid
,
DISPID
*
rgDispID
)
UINT
cNames
,
LCID
lcid
,
DISPID
*
rgDispID
)
{
{
if
(
SUCCEEDED
(
loadTypeInfo
())
)
if
(
SUCCEEDED
(
loadTypeInfo
())
)
...
@@ -740,7 +743,7 @@ STDMETHODIMP VLCLog::GetTypeInfo(UINT iTInfo, LCID lcid, LPTYPEINFO* ppTInfo)
...
@@ -740,7 +743,7 @@ STDMETHODIMP VLCLog::GetTypeInfo(UINT iTInfo, LCID lcid, LPTYPEINFO* ppTInfo)
return
E_NOTIMPL
;
return
E_NOTIMPL
;
};
};
STDMETHODIMP
VLCLog
::
GetIDsOfNames
(
REFIID
riid
,
LPOLESTR
*
rgszNames
,
STDMETHODIMP
VLCLog
::
GetIDsOfNames
(
REFIID
riid
,
LPOLESTR
*
rgszNames
,
UINT
cNames
,
LCID
lcid
,
DISPID
*
rgDispID
)
UINT
cNames
,
LCID
lcid
,
DISPID
*
rgDispID
)
{
{
if
(
SUCCEEDED
(
loadTypeInfo
())
)
if
(
SUCCEEDED
(
loadTypeInfo
())
)
...
@@ -855,6 +858,89 @@ STDMETHODIMP VLCLog::put_verbosity(long verbosity)
...
@@ -855,6 +858,89 @@ STDMETHODIMP VLCLog::put_verbosity(long verbosity)
/*******************************************************************************/
/*******************************************************************************/
/* STL forward iterator used by VLCEnumIterator class to implement IEnumVARIANT */
class
VLCMessageSTLIterator
{
public:
VLCMessageSTLIterator
(
IVLCMessageIterator
*
iter
)
:
iter
(
iter
),
msg
(
NULL
)
{
// get first message
operator
++
();
};
VLCMessageSTLIterator
(
const
VLCMessageSTLIterator
&
other
)
{
iter
=
other
.
iter
;
if
(
iter
)
iter
->
AddRef
();
msg
=
other
.
msg
;
if
(
msg
)
msg
->
AddRef
();
};
virtual
~
VLCMessageSTLIterator
()
{
if
(
msg
)
msg
->
Release
();
if
(
iter
)
iter
->
Release
();
};
// we only need prefix ++ operator
VLCMessageSTLIterator
&
operator
++
()
{
VARIANT_BOOL
hasNext
=
VARIANT_FALSE
;
if
(
iter
)
{
iter
->
get_hasNext
(
&
hasNext
);
if
(
msg
)
{
msg
->
Release
();
msg
=
NULL
;
}
if
(
VARIANT_TRUE
==
hasNext
)
{
iter
->
next
(
&
msg
);
}
}
return
*
this
;
};
VARIANT
operator
*
()
const
{
VARIANT
v
;
VariantInit
(
&
v
);
if
(
msg
)
{
if
(
SUCCEEDED
(
msg
->
QueryInterface
(
IID_IDispatch
,
(
LPVOID
*
)
&
V_DISPATCH
(
&
v
)))
)
{
V_VT
(
&
v
)
=
VT_DISPATCH
;
}
}
return
v
;
};
bool
operator
==
(
const
VLCMessageSTLIterator
&
other
)
const
{
return
msg
==
other
.
msg
;
};
bool
operator
!=
(
const
VLCMessageSTLIterator
&
other
)
const
{
return
msg
!=
other
.
msg
;
};
private:
IVLCMessageIterator
*
iter
;
IVLCMessage
*
msg
;
};
////////////////////////////////////////////////////////////////////////////////////////////////////////////
VLCMessages
::~
VLCMessages
()
VLCMessages
::~
VLCMessages
()
{
{
if
(
_p_typeinfo
)
if
(
_p_typeinfo
)
...
@@ -910,7 +996,7 @@ STDMETHODIMP VLCMessages::GetTypeInfo(UINT iTInfo, LCID lcid, LPTYPEINFO* ppTInf
...
@@ -910,7 +996,7 @@ STDMETHODIMP VLCMessages::GetTypeInfo(UINT iTInfo, LCID lcid, LPTYPEINFO* ppTInf
return
E_NOTIMPL
;
return
E_NOTIMPL
;
};
};
STDMETHODIMP
VLCMessages
::
GetIDsOfNames
(
REFIID
riid
,
LPOLESTR
*
rgszNames
,
STDMETHODIMP
VLCMessages
::
GetIDsOfNames
(
REFIID
riid
,
LPOLESTR
*
rgszNames
,
UINT
cNames
,
LCID
lcid
,
DISPID
*
rgDispID
)
UINT
cNames
,
LCID
lcid
,
DISPID
*
rgDispID
)
{
{
if
(
SUCCEEDED
(
loadTypeInfo
())
)
if
(
SUCCEEDED
(
loadTypeInfo
())
)
...
@@ -937,9 +1023,16 @@ STDMETHODIMP VLCMessages::get__NewEnum(LPUNKNOWN* _NewEnum)
...
@@ -937,9 +1023,16 @@ STDMETHODIMP VLCMessages::get__NewEnum(LPUNKNOWN* _NewEnum)
if
(
NULL
==
_NewEnum
)
if
(
NULL
==
_NewEnum
)
return
E_POINTER
;
return
E_POINTER
;
// TODO
IVLCMessageIterator
*
iter
=
NULL
;
*
_NewEnum
=
NULL
;
iterator
(
&
iter
);
return
E_NOTIMPL
;
*
_NewEnum
=
new
VLCEnumIterator
<
IID_IEnumVARIANT
,
IEnumVARIANT
,
VARIANT
,
VLCMessageSTLIterator
>
(
VLCMessageSTLIterator
(
iter
),
VLCMessageSTLIterator
(
NULL
));
return
*
_NewEnum
?
S_OK
:
E_OUTOFMEMORY
;
};
};
STDMETHODIMP
VLCMessages
::
clear
()
STDMETHODIMP
VLCMessages
::
clear
()
...
@@ -1069,7 +1162,7 @@ STDMETHODIMP VLCMessageIterator::GetTypeInfo(UINT iTInfo, LCID lcid, LPTYPEINFO*
...
@@ -1069,7 +1162,7 @@ STDMETHODIMP VLCMessageIterator::GetTypeInfo(UINT iTInfo, LCID lcid, LPTYPEINFO*
return
E_NOTIMPL
;
return
E_NOTIMPL
;
};
};
STDMETHODIMP
VLCMessageIterator
::
GetIDsOfNames
(
REFIID
riid
,
LPOLESTR
*
rgszNames
,
STDMETHODIMP
VLCMessageIterator
::
GetIDsOfNames
(
REFIID
riid
,
LPOLESTR
*
rgszNames
,
UINT
cNames
,
LCID
lcid
,
DISPID
*
rgDispID
)
UINT
cNames
,
LCID
lcid
,
DISPID
*
rgDispID
)
{
{
if
(
SUCCEEDED
(
loadTypeInfo
())
)
if
(
SUCCEEDED
(
loadTypeInfo
())
)
...
@@ -1200,7 +1293,7 @@ STDMETHODIMP VLCMessage::GetTypeInfo(UINT iTInfo, LCID lcid, LPTYPEINFO* ppTInfo
...
@@ -1200,7 +1293,7 @@ STDMETHODIMP VLCMessage::GetTypeInfo(UINT iTInfo, LCID lcid, LPTYPEINFO* ppTInfo
return
E_NOTIMPL
;
return
E_NOTIMPL
;
};
};
STDMETHODIMP
VLCMessage
::
GetIDsOfNames
(
REFIID
riid
,
LPOLESTR
*
rgszNames
,
STDMETHODIMP
VLCMessage
::
GetIDsOfNames
(
REFIID
riid
,
LPOLESTR
*
rgszNames
,
UINT
cNames
,
LCID
lcid
,
DISPID
*
rgDispID
)
UINT
cNames
,
LCID
lcid
,
DISPID
*
rgDispID
)
{
{
if
(
SUCCEEDED
(
loadTypeInfo
())
)
if
(
SUCCEEDED
(
loadTypeInfo
())
)
...
@@ -1360,7 +1453,7 @@ STDMETHODIMP VLCPlaylistItems::GetTypeInfo(UINT iTInfo, LCID lcid, LPTYPEINFO* p
...
@@ -1360,7 +1453,7 @@ STDMETHODIMP VLCPlaylistItems::GetTypeInfo(UINT iTInfo, LCID lcid, LPTYPEINFO* p
return
E_NOTIMPL
;
return
E_NOTIMPL
;
};
};
STDMETHODIMP
VLCPlaylistItems
::
GetIDsOfNames
(
REFIID
riid
,
LPOLESTR
*
rgszNames
,
STDMETHODIMP
VLCPlaylistItems
::
GetIDsOfNames
(
REFIID
riid
,
LPOLESTR
*
rgszNames
,
UINT
cNames
,
LCID
lcid
,
DISPID
*
rgDispID
)
UINT
cNames
,
LCID
lcid
,
DISPID
*
rgDispID
)
{
{
if
(
SUCCEEDED
(
loadTypeInfo
())
)
if
(
SUCCEEDED
(
loadTypeInfo
())
)
...
@@ -1509,7 +1602,7 @@ STDMETHODIMP VLCPlaylist::GetTypeInfo(UINT iTInfo, LCID lcid, LPTYPEINFO* ppTInf
...
@@ -1509,7 +1602,7 @@ STDMETHODIMP VLCPlaylist::GetTypeInfo(UINT iTInfo, LCID lcid, LPTYPEINFO* ppTInf
return
E_NOTIMPL
;
return
E_NOTIMPL
;
};
};
STDMETHODIMP
VLCPlaylist
::
GetIDsOfNames
(
REFIID
riid
,
LPOLESTR
*
rgszNames
,
STDMETHODIMP
VLCPlaylist
::
GetIDsOfNames
(
REFIID
riid
,
LPOLESTR
*
rgszNames
,
UINT
cNames
,
LCID
lcid
,
DISPID
*
rgDispID
)
UINT
cNames
,
LCID
lcid
,
DISPID
*
rgDispID
)
{
{
if
(
SUCCEEDED
(
loadTypeInfo
())
)
if
(
SUCCEEDED
(
loadTypeInfo
())
)
...
@@ -1648,11 +1741,11 @@ STDMETHODIMP VLCPlaylist::add(BSTR uri, VARIANT name, VARIANT options, long* ite
...
@@ -1648,11 +1741,11 @@ STDMETHODIMP VLCPlaylist::add(BSTR uri, VARIANT name, VARIANT options, long* ite
}
}
*
item
=
libvlc_playlist_add_extended
(
p_libvlc
,
*
item
=
libvlc_playlist_add_extended
(
p_libvlc
,
psz_uri
,
psz_uri
,
psz_name
,
psz_name
,
i_options
,
i_options
,
const_cast
<
const
char
**>
(
ppsz_options
),
const_cast
<
const
char
**>
(
ppsz_options
),
&
ex
);
&
ex
);
VLCControl
::
FreeTargetOptions
(
ppsz_options
,
i_options
);
VLCControl
::
FreeTargetOptions
(
ppsz_options
,
i_options
);
CoTaskMemFree
(
psz_uri
);
CoTaskMemFree
(
psz_uri
);
...
@@ -1915,7 +2008,7 @@ STDMETHODIMP VLCVideo::GetTypeInfo(UINT iTInfo, LCID lcid, LPTYPEINFO* ppTInfo)
...
@@ -1915,7 +2008,7 @@ STDMETHODIMP VLCVideo::GetTypeInfo(UINT iTInfo, LCID lcid, LPTYPEINFO* ppTInfo)
return
E_NOTIMPL
;
return
E_NOTIMPL
;
};
};
STDMETHODIMP
VLCVideo
::
GetIDsOfNames
(
REFIID
riid
,
LPOLESTR
*
rgszNames
,
STDMETHODIMP
VLCVideo
::
GetIDsOfNames
(
REFIID
riid
,
LPOLESTR
*
rgszNames
,
UINT
cNames
,
LCID
lcid
,
DISPID
*
rgDispID
)
UINT
cNames
,
LCID
lcid
,
DISPID
*
rgDispID
)
{
{
if
(
SUCCEEDED
(
loadTypeInfo
())
)
if
(
SUCCEEDED
(
loadTypeInfo
())
)
...
@@ -2100,16 +2193,17 @@ STDMETHODIMP VLCVideo::put_aspectRatio(BSTR aspect)
...
@@ -2100,16 +2193,17 @@ 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
;
}
libvlc_video_set_aspect_ratio
(
p_input
,
psz_aspect
,
&
ex
);
libvlc_video_set_aspect_ratio
(
p_input
,
psz_aspect
,
&
ex
);
...
@@ -2127,7 +2221,7 @@ STDMETHODIMP VLCVideo::put_aspectRatio(BSTR aspect)
...
@@ -2127,7 +2221,7 @@ STDMETHODIMP VLCVideo::put_aspectRatio(BSTR aspect)
}
}
return
hr
;
return
hr
;
};
};
STDMETHODIMP
VLCVideo
::
get_subtitle
(
long
*
spu
)
STDMETHODIMP
VLCVideo
::
get_subtitle
(
long
*
spu
)
{
{
if
(
NULL
==
spu
)
if
(
NULL
==
spu
)
...
@@ -2283,7 +2377,7 @@ STDMETHODIMP VLCControl2::GetTypeInfo(UINT iTInfo, LCID lcid, LPTYPEINFO* ppTInf
...
@@ -2283,7 +2377,7 @@ STDMETHODIMP VLCControl2::GetTypeInfo(UINT iTInfo, LCID lcid, LPTYPEINFO* ppTInf
return
E_NOTIMPL
;
return
E_NOTIMPL
;
};
};
STDMETHODIMP
VLCControl2
::
GetIDsOfNames
(
REFIID
riid
,
LPOLESTR
*
rgszNames
,
STDMETHODIMP
VLCControl2
::
GetIDsOfNames
(
REFIID
riid
,
LPOLESTR
*
rgszNames
,
UINT
cNames
,
LCID
lcid
,
DISPID
*
rgDispID
)
UINT
cNames
,
LCID
lcid
,
DISPID
*
rgDispID
)
{
{
if
(
SUCCEEDED
(
loadTypeInfo
())
)
if
(
SUCCEEDED
(
loadTypeInfo
())
)
...
...
configure.ac
View file @
7194c2f6
...
@@ -5080,7 +5080,7 @@ then
...
@@ -5080,7 +5080,7 @@ then
fi
fi
AC_LANG_PUSH(C++)
AC_LANG_PUSH(C++)
AC_CHECK_HEADERS(ole2.h olectl.h,
AC_CHECK_HEADERS(ole2.h olectl.h,
[ VLC_ADD_CPPFLAGS([activex],[-D_MIDL_USE_GUIDDEF_])
[ VLC_ADD_CPPFLAGS([activex],[-D
UNICODE -D_UNICODE -D
_MIDL_USE_GUIDDEF_])
VLC_ADD_CXXFLAGS([activex],[-fno-exceptions])
VLC_ADD_CXXFLAGS([activex],[-fno-exceptions])
VLC_ADD_LDFLAGS([activex],[-lole32 -loleaut32 -luuid -lshlwapi])
VLC_ADD_LDFLAGS([activex],[-lole32 -loleaut32 -luuid -lshlwapi])
AC_CHECK_HEADERS(objsafe.h,
AC_CHECK_HEADERS(objsafe.h,
...
...
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