[vlc-commits] activex: add option to set video scale factor

Pierre Lamot git at videolan.org
Fri Oct 13 00:04:10 CEST 2017


npapi-vlc | branch: master | Pierre Lamot <pierre at videolabs.io> | Thu Oct  5 19:24:18 2017 +0200| [6ee39ead04f52ffe83b24457cd4f429122a81911] | committer: Jean-Baptiste Kempf

activex: add option to set video scale factor

Similar to libvlc_video_set_scale

Signed-off-by: Jean-Baptiste Kempf <jb at videolan.org>

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

 activex/axvlc.idl       |  5 +++++
 activex/vlccontrol2.cpp | 15 +++++++++++++++
 activex/vlccontrol2.h   |  2 ++
 3 files changed, 22 insertions(+)

diff --git a/activex/axvlc.idl b/activex/axvlc.idl
index 9202ab2..5eb3822 100644
--- a/activex/axvlc.idl
+++ b/activex/axvlc.idl
@@ -513,6 +513,11 @@ library AXVLC
         [propput, helpstring("Sets video aspect ratio.")]
         HRESULT aspectRatio([in] BSTR aspect);
 
+        [propget, helpstring("Returns video scale.")]
+        HRESULT scale([out, retval] float* aspect);
+        [propput, helpstring("Sets video scale.")]
+        HRESULT scale([in] float aspect);
+
         [propget, helpstring("Returns video subtitle used.")]
         HRESULT subtitle([out, retval] long* spu);
         [propput, helpstring("Sets video subtitle to use.")]
diff --git a/activex/vlccontrol2.cpp b/activex/vlccontrol2.cpp
index b8c3bb3..ec20618 100644
--- a/activex/vlccontrol2.cpp
+++ b/activex/vlccontrol2.cpp
@@ -1109,6 +1109,21 @@ STDMETHODIMP VLCVideo::put_aspectRatio(BSTR aspect)
     return S_OK;
 }
 
+STDMETHODIMP VLCVideo::get_scale(float* scale)
+{
+    if( NULL == scale )
+        return E_POINTER;
+
+    *scale = _plug->get_player().get_mp().scale();
+    return S_OK;
+}
+
+STDMETHODIMP VLCVideo::put_scale(float scale)
+{
+    _plug->get_player().get_mp().setScale( scale );
+    return S_OK;
+}
+
 STDMETHODIMP VLCVideo::get_subtitle(long* spu)
 {
     if( NULL == spu )
diff --git a/activex/vlccontrol2.h b/activex/vlccontrol2.h
index 2a9bfc5..db6c52e 100644
--- a/activex/vlccontrol2.h
+++ b/activex/vlccontrol2.h
@@ -345,6 +345,8 @@ public:
     STDMETHODIMP get_height(long*);
     STDMETHODIMP get_aspectRatio(BSTR*);
     STDMETHODIMP put_aspectRatio(BSTR);
+    STDMETHODIMP get_scale(float*);
+    STDMETHODIMP put_scale(float);
     STDMETHODIMP get_subtitle(long*);
     STDMETHODIMP put_subtitle(long);
     STDMETHODIMP get_crop(BSTR*);



More information about the vlc-commits mailing list