[vlc-commits] commit: Moved "video output" -> "vout display" wrapper to the core. ( Laurent Aimar )

git at videolan.org git at videolan.org
Sat Apr 17 23:23:59 CEST 2010


vlc | branch: master | Laurent Aimar <fenrir at videolan.org> | Thu Apr 15 22:47:11 2010 +0200| [95cee7fc59fa06c7494c60cc4dad1038ffb27a1c] | committer: Laurent Aimar 

Moved "video output" -> "vout display" wrapper to the core.

This removes support for non converted "video output" and "video filter"
modules.

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

 modules/video_output/Modules.am                    |    4 +--
 src/Makefile.am                                    |    1 +
 src/video_output/video_output.c                    |   27 ++++++++++---------
 src/video_output/vout_internal.h                   |    5 +++-
 .../wrapper.c => src/video_output/vout_wrapper.c   |   27 +++-----------------
 5 files changed, 24 insertions(+), 40 deletions(-)

diff --git a/modules/video_output/Modules.am b/modules/video_output/Modules.am
index e2ccfdb..3a8222e 100644
--- a/modules/video_output/Modules.am
+++ b/modules/video_output/Modules.am
@@ -17,7 +17,6 @@ SOURCES_opengl = opengl.c opengl.h
 SOURCES_directfb = directfb.c
 SOURCES_vmem = vmem.c
 SOURCES_yuv = yuv.c
-SOURCES_vout_wrapper = wrapper.c
 SOURCES_vout_macosx = macosx.m
 
 libxcb_x11_plugin_la_SOURCES = \
@@ -85,5 +84,4 @@ endif
 
 libvlc_LTLIBRARIES += \
 	libvmem_plugin.la \
-	libyuv_plugin.la \
-	libvout_wrapper_plugin.la
+	libyuv_plugin.la
diff --git a/src/Makefile.am b/src/Makefile.am
index b8d8b41..2c6fad7 100644
--- a/src/Makefile.am
+++ b/src/Makefile.am
@@ -374,6 +374,7 @@ SOURCES_libvlc_common = \
 	video_output/vout_intf.c \
 	video_output/vout_internal.h \
 	video_output/vout_control.h \
+	video_output/vout_wrapper.c \
 	audio_output/aout_internal.h \
 	audio_output/common.c \
 	audio_output/dec.c \
diff --git a/src/video_output/video_output.c b/src/video_output/video_output.c
index 7ed3dc5..a3f7300 100644
--- a/src/video_output/video_output.c
+++ b/src/video_output/video_output.c
@@ -472,7 +472,7 @@ vout_thread_t * vout_Create( vlc_object_t *p_parent, video_format_t *p_fmt )
     }
 
     /* Create the vout thread */
-    char* psz_tmp = config_ChainCreate( &psz_name, &p_cfg, psz_parser );
+    char *psz_tmp = config_ChainCreate( &psz_name, &p_cfg, psz_parser );
     free( psz_parser );
     free( psz_tmp );
     p_vout->p_cfg = p_cfg;
@@ -487,9 +487,13 @@ vout_thread_t * vout_Create( vlc_object_t *p_parent, video_format_t *p_fmt )
     DeinterlaceEnable( p_vout );
 
     if( p_vout->p->psz_filter_chain && *p_vout->p->psz_filter_chain )
-        p_vout->p->psz_module_type = "video filter";
-    else
-        p_vout->p->psz_module_type = "video output";
+    {
+        char *psz_tmp;
+        if( asprintf( &psz_tmp, "%s,none", psz_name ) < 0 )
+            psz_tmp = strdup( "" );
+        free( psz_name );
+        psz_name = psz_tmp;
+    }
     p_vout->p->psz_module_name = psz_name;
     p_vout->p_module = NULL;
 
@@ -555,7 +559,7 @@ static void vout_Destructor( vlc_object_t * p_this )
     vout_thread_t *p_vout = (vout_thread_t *)p_this;
 
     /* Make sure the vout was stopped first */
-    assert( !p_vout->p_module );
+    //assert( !p_vout->p_module );
 
     free( p_vout->p->psz_module_name );
 
@@ -939,6 +943,7 @@ static int InitThread( vout_thread_t *p_vout )
 static void* RunThread( void *p_this )
 {
     vout_thread_t *p_vout = p_this;
+    bool            b_has_wrapper;
     int             i_idle_loops = 0;  /* loops without displaying a picture */
     int             i_picture_qtype_last = QTYPE_NONE;
     bool            b_picture_interlaced_last = false;
@@ -947,14 +952,11 @@ static void* RunThread( void *p_this )
     /*
      * Initialize thread
      */
-    p_vout->p_module = module_need( p_vout,
-                                    p_vout->p->psz_module_type,
-                                    p_vout->p->psz_module_name,
-                                    !strcmp(p_vout->p->psz_module_type, "video filter") );
+    b_has_wrapper = !vout_OpenWrapper( p_vout, p_vout->p->psz_module_name );
 
     vlc_mutex_lock( &p_vout->change_lock );
 
-    if( p_vout->p_module )
+    if( b_has_wrapper )
         p_vout->b_error = InitThread( p_vout );
     else
         p_vout->b_error = true;
@@ -1387,9 +1389,8 @@ exit_thread:
     EndThread( p_vout );
     vlc_mutex_unlock( &p_vout->change_lock );
 
-    if( p_vout->p_module )
-        module_unneed( p_vout, p_vout->p_module );
-    p_vout->p_module = NULL;
+    if( b_has_wrapper )
+        vout_CloseWrapper( p_vout );
 
     return NULL;
 }
diff --git a/src/video_output/vout_internal.h b/src/video_output/vout_internal.h
index 2fc6200..edbf45d 100644
--- a/src/video_output/vout_internal.h
+++ b/src/video_output/vout_internal.h
@@ -41,7 +41,6 @@
 struct vout_thread_sys_t
 {
     /* module */
-    const char *psz_module_type;
     char       *psz_module_name;
 
     /* Thread & synchronization */
@@ -118,5 +117,9 @@ picture_t *vout_RenderPicture( vout_thread_t *, picture_t *,
  */
 void vout_UsePictureLocked( vout_thread_t *p_vout, picture_t *p_pic  );
 
+/* */
+int  vout_OpenWrapper (vout_thread_t *, const char *);
+void vout_CloseWrapper(vout_thread_t *);
+
 #endif
 
diff --git a/modules/video_output/wrapper.c b/src/video_output/vout_wrapper.c
similarity index 95%
rename from modules/video_output/wrapper.c
rename to src/video_output/vout_wrapper.c
index 558db23..2097070 100644
--- a/modules/video_output/wrapper.c
+++ b/src/video_output/vout_wrapper.c
@@ -33,25 +33,8 @@
 #include <vlc_vout_display.h>
 #include <vlc_vout_wrapper.h>
 #include <vlc_vout.h>
-#include "../video_filter/filter_common.h"
 #include <assert.h>
-
-/*****************************************************************************
- * Module descriptor
- *****************************************************************************/
-static int  Open (vlc_object_t *);
-static void Close(vlc_object_t *);
-
-vlc_module_begin()
-    set_category( CAT_VIDEO )
-    set_subcategory( SUBCAT_VIDEO_VOUT )
-
-    set_description( "Transitional video display wrapper" )
-    set_shortname( "Video display wrapper" )
-    set_capability( "video output", 210 )
-    set_callbacks( Open, Close )
-
-vlc_module_end()
+#include "vout_internal.h"
 
 /*****************************************************************************
  *
@@ -85,9 +68,8 @@ static int  Forward(vlc_object_t *, char const *,
 /*****************************************************************************
  *
  *****************************************************************************/
-static int Open(vlc_object_t *object)
+int vout_OpenWrapper(vout_thread_t *vout, const char *name)
 {
-    vout_thread_t *vout = (vout_thread_t *)object;
     vout_sys_t *sys;
 
     msg_Dbg(vout, "Opening vout display wrapper");
@@ -115,7 +97,7 @@ static int Open(vlc_object_t *object)
     const mtime_t double_click_timeout = 300000;
     const mtime_t hide_timeout = var_CreateGetInteger(vout, "mouse-hide-timeout") * 1000;
 
-    sys->vd = vout_NewDisplay(vout, &source, &state, "$vout",
+    sys->vd = vout_NewDisplay(vout, &source, &state, name ? name : "$vout",
                               double_click_timeout, hide_timeout);
     if (!sys->vd) {
         free(sys->title);
@@ -146,9 +128,8 @@ static int Open(vlc_object_t *object)
 /*****************************************************************************
  *
  *****************************************************************************/
-static void Close(vlc_object_t *object)
+void vout_CloseWrapper(vout_thread_t *vout)
 {
-    vout_thread_t *vout = (vout_thread_t *)object;
     vout_sys_t *sys = vout->p_sys;
 
 #ifdef WIN32



More information about the vlc-commits mailing list