[vlc-commits] ActiveX: implement versionInfo() to match NPAPI

Jean-Baptiste Kempf git at videolan.org
Sun Dec 14 17:22:22 CET 2014


npapi-vlc | branch: master | Jean-Baptiste Kempf <jb at videolan.org> | Sun Dec 14 17:22:04 2014 +0100| [23fa26609a1e988c0bac143c60cd165e2e7f96a4] | committer: Jean-Baptiste Kempf

ActiveX: implement versionInfo() to match NPAPI

> http://git.videolan.org/gitweb.cgi/npapi-vlc.git/?a=commit;h=23fa26609a1e988c0bac143c60cd165e2e7f96a4
---

 activex/axvlc.idl       |    3 +++
 activex/axvlc_idl.h     |   16 ++++++++++++++++
 activex/vlccontrol2.cpp |   16 ++++++++++++++++
 activex/vlccontrol2.h   |    1 +
 4 files changed, 36 insertions(+)

diff --git a/activex/axvlc.idl b/activex/axvlc.idl
index 47d0b80..7bc4478 100644
--- a/activex/axvlc.idl
+++ b/activex/axvlc.idl
@@ -657,6 +657,9 @@ library AXVLC
         [propget, helpstring("Returns VLC Version.")]
         HRESULT VersionInfo([out, retval] BSTR* version);
 
+        [helpstring("Returns VLC Version.")]
+        HRESULT versionInfo([out, retval] BSTR* version);
+
         [id(DISPID_Visible), propget, helpstring("Returns/sets a value that determines whether viewing area is visible or hidden.")]
         HRESULT Visible([out, retval] VARIANT_BOOL* visible);
         [id(DISPID_Visible), propput, helpstring("Returns/sets a value that determines whether viewing area is visible or hidden.")]
diff --git a/activex/axvlc_idl.h b/activex/axvlc_idl.h
index a24d853..ba6711f 100644
--- a/activex/axvlc_idl.h
+++ b/activex/axvlc_idl.h
@@ -3634,6 +3634,9 @@ IVLCControl2 : public IDispatch
     virtual HRESULT STDMETHODCALLTYPE get_VersionInfo(
         BSTR *version) = 0;
 
+    virtual HRESULT STDMETHODCALLTYPE versionInfo(
+        BSTR *version) = 0;
+
     virtual HRESULT STDMETHODCALLTYPE get_Visible(
         VARIANT_BOOL *visible) = 0;
 
@@ -3777,6 +3780,10 @@ typedef struct IVLCControl2Vtbl {
         IVLCControl2* This,
         BSTR *version);
 
+    HRESULT (STDMETHODCALLTYPE *versionInfo)(
+        IVLCControl2* This,
+        BSTR *version);
+
     HRESULT (STDMETHODCALLTYPE *get_Visible)(
         IVLCControl2* This,
         VARIANT_BOOL *visible);
@@ -3869,6 +3876,7 @@ interface IVLCControl2 {
 #define IVLCControl2_get_MRL(This,mrl) (This)->lpVtbl->get_MRL(This,mrl)
 #define IVLCControl2_put_MRL(This,mrl) (This)->lpVtbl->put_MRL(This,mrl)
 #define IVLCControl2_get_VersionInfo(This,version) (This)->lpVtbl->get_VersionInfo(This,version)
+#define IVLCControl2_versionInfo(This,version) (This)->lpVtbl->versionInfo(This,version)
 #define IVLCControl2_get_Visible(This,visible) (This)->lpVtbl->get_Visible(This,visible)
 #define IVLCControl2_put_Visible(This,visible) (This)->lpVtbl->put_Visible(This,visible)
 #define IVLCControl2_get_Volume(This,volume) (This)->lpVtbl->get_Volume(This,volume)
@@ -3977,6 +3985,14 @@ void __RPC_STUB IVLCControl2_get_VersionInfo_Stub(
     IRpcChannelBuffer* pRpcChannelBuffer,
     PRPC_MESSAGE pRpcMessage,
     DWORD* pdwStubPhase);
+HRESULT STDMETHODCALLTYPE IVLCControl2_versionInfo_Proxy(
+    IVLCControl2* This,
+    BSTR *version);
+void __RPC_STUB IVLCControl2_versionInfo_Stub(
+    IRpcStubBuffer* This,
+    IRpcChannelBuffer* pRpcChannelBuffer,
+    PRPC_MESSAGE pRpcMessage,
+    DWORD* pdwStubPhase);
 HRESULT STDMETHODCALLTYPE IVLCControl2_get_Visible_Proxy(
     IVLCControl2* This,
     VARIANT_BOOL *visible);
diff --git a/activex/vlccontrol2.cpp b/activex/vlccontrol2.cpp
index 936d03c..74feb90 100644
--- a/activex/vlccontrol2.cpp
+++ b/activex/vlccontrol2.cpp
@@ -1433,6 +1433,22 @@ STDMETHODIMP VLCControl2::get_VersionInfo(BSTR *version)
     return E_FAIL;
 };
 
+STDMETHODIMP VLCControl2::versionInfo(BSTR *version)
+{
+    if( NULL == version )
+        return E_POINTER;
+
+    const char *versionStr = libvlc_get_version();
+    if( NULL != versionStr )
+    {
+        *version = BSTRFromCStr(CP_UTF8, versionStr);
+
+        return (NULL == *version) ? E_OUTOFMEMORY : NOERROR;
+    }
+    *version = NULL;
+    return E_FAIL;
+};
+
 STDMETHODIMP VLCControl2::get_Visible(VARIANT_BOOL *isVisible)
 {
     if( NULL == isVisible )
diff --git a/activex/vlccontrol2.h b/activex/vlccontrol2.h
index a01d344..6ba4584 100644
--- a/activex/vlccontrol2.h
+++ b/activex/vlccontrol2.h
@@ -411,6 +411,7 @@ public:
     STDMETHODIMP get_StartTime(long *seconds);
     STDMETHODIMP put_StartTime(long seconds);
     STDMETHODIMP get_VersionInfo(BSTR *version);
+    STDMETHODIMP versionInfo(BSTR *version);
     STDMETHODIMP get_Visible(VARIANT_BOOL *visible);
     STDMETHODIMP put_Visible(VARIANT_BOOL visible);
     STDMETHODIMP get_Volume(long *volume);



More information about the vlc-commits mailing list