[vlc-devel] commit: ActiveX: Deinterlace JS Binding ( Cyril Mathé )

git version control git at videolan.org
Thu Jun 4 00:37:04 CEST 2009


vlc | branch: master | Cyril Mathé <cmathe at actech-innovation.com> | Wed May 20 10:52:03 2009 +0200| [86df0bee9930097010899ccdcf9fc8fcb32c0014] | committer: Jean-Baptiste Kempf 

ActiveX: Deinterlace JS Binding

- video.deinterlaceEnable(char *mode) : enable deinterlace filter which type is defined by mode
     - video.deinterlaceDisable()          : disable deinterlace filter

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

> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=86df0bee9930097010899ccdcf9fc8fcb32c0014
---

 projects/activex/axvlc.idl       |    5 +++++
 projects/activex/vlccontrol2.cpp |   33 +++++++++++++++++++++++++++++++++
 projects/activex/vlccontrol2.h   |    2 ++
 3 files changed, 40 insertions(+), 0 deletions(-)

diff --git a/projects/activex/axvlc.idl b/projects/activex/axvlc.idl
index 8944074..071fcfd 100644
--- a/projects/activex/axvlc.idl
+++ b/projects/activex/axvlc.idl
@@ -467,6 +467,11 @@ library AXVLC
         [propput, helpstring("Sets teletext page to use.")]
         HRESULT teletext([in] long page);
 
+        [helpstring("Enable deinterlace filter.")]
+        HRESULT deinterlaceEnable([in] BSTR mode);
+        [helpstring("Disable deinterlace filter.")]
+        HRESULT deinterlaceDisable();
+
         [helpstring("toggle fullscreen/windowed state.")]
         HRESULT toggleFullscreen();
 
diff --git a/projects/activex/vlccontrol2.cpp b/projects/activex/vlccontrol2.cpp
index ff1a55b..c0de083 100644
--- a/projects/activex/vlccontrol2.cpp
+++ b/projects/activex/vlccontrol2.cpp
@@ -2220,6 +2220,39 @@ STDMETHODIMP VLCVideo::put_teletext(long page)
     return hr;
 };
 
+STDMETHODIMP VLCVideo::deinterlaceDisable()
+{
+    libvlc_media_player_t *p_md;
+    HRESULT hr = _p_instance->getMD(&p_md);
+    if( SUCCEEDED(hr) )
+    {
+        libvlc_exception_t ex;
+        libvlc_exception_init(&ex);
+
+        libvlc_video_set_deinterlace(p_md, 0, "", &ex);
+        hr = exception_bridge(&ex);
+    }
+    return hr;
+};
+
+STDMETHODIMP VLCVideo::deinterlaceEnable(BSTR mode)
+{
+    libvlc_media_player_t *p_md;
+    HRESULT hr = _p_instance->getMD(&p_md);
+    if( SUCCEEDED(hr) )
+    {
+        libvlc_exception_t ex;
+        libvlc_exception_init(&ex);
+        /* get deinterlace mode from the user */
+        char *psz_mode = CStrFromBSTR(CP_UTF8, mode);
+        /* enable deinterlace filter if possible */
+        libvlc_video_set_deinterlace(p_md, 1, psz_mode, &ex);
+        hr = exception_bridge(&ex);
+        CoTaskMemFree(psz_mode);
+    }
+    return hr;
+};
+
 STDMETHODIMP VLCVideo::takeSnapshot(LPPICTUREDISP* picture)
 {
     if( NULL == picture )
diff --git a/projects/activex/vlccontrol2.h b/projects/activex/vlccontrol2.h
index 1134643..354ed5c 100644
--- a/projects/activex/vlccontrol2.h
+++ b/projects/activex/vlccontrol2.h
@@ -586,6 +586,8 @@ public:
     STDMETHODIMP put_crop(BSTR);
     STDMETHODIMP get_teletext(long*);
     STDMETHODIMP put_teletext(long);
+    STDMETHODIMP deinterlaceDisable();
+    STDMETHODIMP deinterlaceEnable(BSTR);
     STDMETHODIMP takeSnapshot(LPPICTUREDISP*);
     STDMETHODIMP toggleFullscreen();
     STDMETHODIMP toggleTeletext();




More information about the vlc-devel mailing list