[vlc-commits] Update deinterlace functions to recent API changes

Hugo Beauzée-Luyssen git at videolan.org
Thu May 10 05:48:43 CEST 2018


npapi-vlc | branch: master | Hugo Beauzée-Luyssen <hugo at beauzee.fr> | Wed May  9 20:47:33 2018 -0700| [d64081f678a467a95fc0641f6967281a7098da36] | committer: Hugo Beauzée-Luyssen

Update deinterlace functions to recent API changes

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

 activex/vlccontrol2.cpp       | 10 ++++++++++
 npapi/npruntime/npolibvlc.cpp |  9 +++++++++
 2 files changed, 19 insertions(+)

diff --git a/activex/vlccontrol2.cpp b/activex/vlccontrol2.cpp
index 2cd9530..9e7cfb1 100644
--- a/activex/vlccontrol2.cpp
+++ b/activex/vlccontrol2.cpp
@@ -562,7 +562,12 @@ STDMETHODIMP VLCAudio::toggleMute()
 
 STDMETHODIMP VLCDeinterlace::disable()
 {
+#if LIBVLC_VERSION_INT >= LIBVLC_VERSION(4, 0, 0, 0)
+    _plug->get_player().get_mp().setDeinterlace( VLC::MediaPlayer::DeinterlaceState::Disabled,
+                                                 std::string() );
+#else
     _plug->get_player().get_mp().setDeinterlace( "" );
+#endif
     return S_OK;
 }
 
@@ -571,7 +576,12 @@ STDMETHODIMP VLCDeinterlace::enable(BSTR mode)
     char *psz_mode = CStrFromBSTR(CP_UTF8, mode);
     if ( psz_mode == nullptr )
         return E_OUTOFMEMORY;
+#if LIBVLC_VERSION_INT >= LIBVLC_VERSION(4, 0, 0, 0)
+    _plug->get_player().get_mp().setDeinterlace( VLC::MediaPlayer::DeinterlaceState::Enabled,
+                                                 psz_mode );
+#else
     _plug->get_player().get_mp().setDeinterlace( psz_mode );
+#endif
     CoTaskMemFree(psz_mode);
     return S_OK;
 }
diff --git a/npapi/npruntime/npolibvlc.cpp b/npapi/npruntime/npolibvlc.cpp
index f096b4c..87230d5 100644
--- a/npapi/npruntime/npolibvlc.cpp
+++ b/npapi/npruntime/npolibvlc.cpp
@@ -1981,7 +1981,12 @@ LibvlcDeinterlaceNPObject::invoke(int index, const NPVariant *args,
     switch( index )
     {
     case ID_deint_disable:
+#if LIBVLC_VERSION_INT >= LIBVLC_VERSION(4, 0, 0, 0)
+        mp.setDeinterlace( VLC::MediaPlayer::DeinterlaceState::Disabled,
+                           std::string() );
+#else
         mp.setDeinterlace( std::string() );
+#endif
         break;
 
     case ID_deint_enable:
@@ -1992,7 +1997,11 @@ LibvlcDeinterlaceNPObject::invoke(int index, const NPVariant *args,
         if ( !v.is<const char*>() )
             return INVOKERESULT_INVALID_VALUE;
 
+#if LIBVLC_VERSION_INT >= LIBVLC_VERSION(4, 0, 0, 0)
+        mp.setDeinterlace( VLC::MediaPlayer::DeinterlaceState::Enabled, v );
+#else
         mp.setDeinterlace( v );
+#endif
         break;
     }
     default:



More information about the vlc-commits mailing list