[vlc-commits] Update to 4.0 APIs

Hugo Beauzée-Luyssen git at videolan.org
Fri Jun 7 09:46:56 CEST 2019


npapi-vlc | branch: master | Hugo Beauzée-Luyssen <hugo at beauzee.fr> | Thu Jun  6 16:40:43 2019 +0200| [ccf11e72ffdd3160817bd0325ea21169f7f582ea] | committer: Hugo Beauzée-Luyssen

Update to 4.0 APIs

> https://code.videolan.org/videolan/npapi-vlc/commit/ccf11e72ffdd3160817bd0325ea21169f7f582ea
---

 activex/axvlc.idl       | 12 ++++++------
 activex/vlccontrol2.cpp | 39 ++++++++++-----------------------------
 activex/vlccontrol2.h   |  6 +++---
 3 files changed, 19 insertions(+), 38 deletions(-)

diff --git a/activex/axvlc.idl b/activex/axvlc.idl
index f8ea855..a732f4d 100644
--- a/activex/axvlc.idl
+++ b/activex/axvlc.idl
@@ -416,8 +416,6 @@ library AXVLC
         [helpstring("disable Marquee Filter.")]
         HRESULT disable();
 
-        [propget, helpstring("Retrieve marquee text.")]
-        HRESULT text([out, retval] BSTR* val);
         [propput, helpstring("Change marquee text.")]
         HRESULT text([in] BSTR val);
 
@@ -554,10 +552,12 @@ library AXVLC
         [propput, helpstring("Sets video subtitle to use.")]
         HRESULT subtitle([in] long spu);
 
-        [propget, helpstring("Returns crop filter geometry.")]
-        HRESULT crop([out, retval] BSTR* geometry);
-        [propput, helpstring("Sets crop filter geometry.")]
-        HRESULT crop([in] BSTR geometry);
+        [propput, helpstring("Sets crop ratio.")]
+        HRESULT crop_ratio([in] ULONG num, [in] ULONG den);
+        [propput, helpstring("Sets crop window.")]
+        HRESULT crop_window([in] ULONG x, [in] ULONG y, [in] ULONG width, [in] ULONG height);
+        [propput, helpstring("Sets crop border.")]
+        HRESULT crop_border([in] ULONG left, [in] ULONG right, [in] ULONG top, [in] ULONG bottom);
 
         [propget, helpstring("Returns teletext page used.")]
         HRESULT teletext([out, retval] long* page);
diff --git a/activex/vlccontrol2.cpp b/activex/vlccontrol2.cpp
index 97530cb..e1d30d1 100644
--- a/activex/vlccontrol2.cpp
+++ b/activex/vlccontrol2.cpp
@@ -867,13 +867,6 @@ STDMETHODIMP VLCMarquee::put_position(BSTR val)
     return hr;
 }
 
-STDMETHODIMP VLCMarquee::get_text(BSTR *val)
-{
-    if( NULL == val )
-        return E_POINTER;
-    return E_INVALIDARG;
-}
-
 STDMETHODIMP VLCMarquee::put_text(BSTR val)
 {
     char *psz_text = CStrFromBSTR(CP_UTF8, val);
@@ -1397,32 +1390,20 @@ STDMETHODIMP VLCVideo::put_subtitle(long spu)
     return S_OK;
 }
 
-STDMETHODIMP VLCVideo::get_crop(BSTR* geometry)
+STDMETHODIMP VLCVideo::put_crop_ratio(ULONG num, ULONG den)
 {
-    if( NULL == geometry )
-        return E_POINTER;
-
-    auto g = _plug->get_player().get_mp().cropGeometry();
-    *geometry = BSTRFromCStr( CP_UTF8, g.c_str() );
-    return *geometry == nullptr ? E_OUTOFMEMORY : S_OK;
+    _plug->get_player().get_mp().setCropRatio(num, den);
+    return S_OK;
 }
 
-STDMETHODIMP VLCVideo::put_crop(BSTR geometry)
+STDMETHODIMP VLCVideo::put_crop_window(ULONG x, ULONG y, ULONG width, ULONG height)
 {
-    if( 0 == SysStringLen(geometry) )
-    {
-        _plug->get_player().get_mp().setCropGeometry( "" );
-        return S_OK;
-    }
-
-    char *psz_geometry = CStrFromBSTR(CP_UTF8, geometry);
-    if( !psz_geometry )
-    {
-        return E_OUTOFMEMORY;
-    }
-    _plug->get_player().get_mp().setCropGeometry( psz_geometry );
-    CoTaskMemFree(psz_geometry);
-
+    _plug->get_player().get_mp().setCropWindow(x, y, width, height);
+    return S_OK;
+}
+STDMETHODIMP VLCVideo::put_crop_border(ULONG left, ULONG right, ULONG top, ULONG bottom)
+{
+    _plug->get_player().get_mp().setCropBorder(left, right, top, bottom);
     return S_OK;
 }
 
diff --git a/activex/vlccontrol2.h b/activex/vlccontrol2.h
index 8b7a4ae..11021f9 100644
--- a/activex/vlccontrol2.h
+++ b/activex/vlccontrol2.h
@@ -206,7 +206,6 @@ public:
     STDMETHODIMP enable()  { return do_put_int(libvlc_marquee_Enable, true); }
     STDMETHODIMP disable() { return do_put_int(libvlc_marquee_Enable, false); }
 
-    STDMETHODIMP get_text(BSTR *);
     STDMETHODIMP put_text(BSTR);
     STDMETHODIMP get_position(BSTR *);
     STDMETHODIMP put_position(BSTR);
@@ -355,8 +354,9 @@ public:
     STDMETHODIMP put_scale(float);
     STDMETHODIMP get_subtitle(long*);
     STDMETHODIMP put_subtitle(long);
-    STDMETHODIMP get_crop(BSTR*);
-    STDMETHODIMP put_crop(BSTR);
+    STDMETHODIMP put_crop_ratio(ULONG, ULONG);
+    STDMETHODIMP put_crop_window(ULONG, ULONG, ULONG, ULONG);
+    STDMETHODIMP put_crop_border(ULONG, ULONG, ULONG, ULONG);
     STDMETHODIMP get_teletext(long*);
     STDMETHODIMP put_teletext(long);
     STDMETHODIMP get_marquee(IVLCMarquee**);



More information about the vlc-commits mailing list