]> git.sesse.net Git - vlc/commitdiff
libvlc API: Add Deinterlace Filter to libvlc in video.c
authorCyril Mathé <cmathe@actech-innovation.com>
Fri, 29 May 2009 12:25:45 +0000 (14:25 +0200)
committerLaurent Aimar <fenrir@videolan.org>
Wed, 3 Jun 2009 21:44:15 +0000 (23:44 +0200)
  - libvlc_video_enable_deinterlace(libvlc_media_player_t *p_mi, int b_enable, const char *psz_mode, libvlc_exception_t *p_e)
      - b_enable: boolean to enable or disable deinterlace filter
      - psz_mode: char to define the deinterlace mode (blend, linear...)

Signed-off-by: Laurent Aimar <fenrir@videolan.org>
include/vlc/libvlc_media_player.h
src/control/video.c
src/libvlc.sym

index 4694698088d030f953363baeb4a6465e114e4d26..4b811a09f0ecc302c4552b3ea4314ebc47c200bc 100644 (file)
@@ -714,6 +714,18 @@ VLC_PUBLIC_API void libvlc_video_set_track( libvlc_media_player_t *, int, libvlc
  */
 VLC_PUBLIC_API void libvlc_video_take_snapshot( libvlc_media_player_t *, const char *,unsigned int, unsigned int, libvlc_exception_t * );
 
+/**
+ * Enable or disable deinterlace filter
+ *
+ * \param p_mi libvlc media player
+ * \param b_enable boolean to enable or disable deinterlace filter
+ * \param psz_mode type of deinterlace filter to use
+ * \param p_e an initialized exception pointer
+ */
+VLC_PUBLIC_API void libvlc_video_set_deinterlace( libvlc_media_player_t *,
+                                                  int , const char *,
+                                                  libvlc_exception_t *);
+
 /** @} video */
 
 /** \defgroup libvlc_audio libvlc_audio
index 3b79f555f9a22e112425b05aff680c6335405b82..de7614e45bf74adba1ae890e113949e1a08ea77d 100644 (file)
@@ -589,3 +589,42 @@ end:
     var_FreeList( &val_list, NULL );
     vlc_object_release( p_input_thread );
 }
+
+/******************************************************************************
+ * libvlc_video_set_deinterlace : enable deinterlace
+ *****************************************************************************/
+void libvlc_video_set_deinterlace( libvlc_media_player_t *p_mi, int b_enable,
+                                   const char *psz_mode,
+                                   libvlc_exception_t *p_e )
+{
+    vout_thread_t *p_vout = GetVout( p_mi, p_e );
+
+    if( p_vout )
+    {
+        libvlc_exception_raise( p_e, "Unable to get video output" );
+        return;
+    }
+
+    if( b_enable )
+    {
+        /* be sure that the filter name given is supported */
+        if( !strcmp(psz_mode, "blend")   || !strcmp(psz_mode, "bob")
+         || !strcmp(psz_mode, "discard") || !strcmp(psz_mode, "linear")
+         || !strcmp(psz_mode, "mean")    || !strcmp(psz_mode, "x") )
+        {
+            /* set deinterlace filter chosen */
+            var_SetString( p_vout, "deinterlace", psz_mode );
+        }
+        else
+        {
+            libvlc_exception_raise( p_e, "Unsuported or bad deinterlace filter name" );
+        }
+    }
+    else
+    {
+        /* disable deinterlace filter */
+        var_SetString( p_vout, "deinterlace", "" );
+    }
+
+    vlc_object_release( p_vout );
+}
index e65211622feae31644445b5c274484fe7c644476..b8ae1287fa15f3e04db04e86a8fb121371c27ab6 100644 (file)
@@ -191,6 +191,7 @@ libvlc_video_get_track_description
 libvlc_video_get_width
 libvlc_video_set_aspect_ratio
 libvlc_video_set_crop_geometry
+libvlc_video_set_deinterlace
 libvlc_video_set_scale
 libvlc_video_set_spu
 libvlc_video_set_subtitle_file