]> git.sesse.net Git - vlc/commitdiff
Moved some private fields out of vlc_vout.h
authorLaurent Aimar <fenrir@videolan.org>
Sun, 18 Apr 2010 01:44:56 +0000 (03:44 +0200)
committerLaurent Aimar <fenrir@videolan.org>
Sun, 18 Apr 2010 12:58:37 +0000 (14:58 +0200)
include/vlc_vout.h
src/video_output/video_epg.c
src/video_output/video_output.c
src/video_output/video_text.c
src/video_output/video_widgets.c
src/video_output/vout_internal.h
src/video_output/vout_intf.c
src/video_output/vout_pictures.c
src/video_output/vout_wrapper.c

index 190884a3ec6d9725c06bac9b8a16bb7ff2f620de..e51903e277925b1226c1475290ba96836dadb635 100644 (file)
@@ -91,13 +91,11 @@ typedef struct vout_thread_sys_t vout_thread_sys_t;
 struct vout_thread_t
 {
     VLC_COMMON_MEMBERS
-    bool                b_error;
 
     /** \name Thread properties and locks */
     /**@{*/
     vlc_mutex_t         picture_lock;                 /**< picture heap lock */
     vlc_mutex_t         change_lock;                 /**< thread change lock */
-    vout_sys_t *        p_sys;                     /**< system output method */
     /**@}*/
 
     /** \name Current display properties */
@@ -128,12 +126,6 @@ struct vout_thread_t
     /* Picture heap */
     picture_t           p_picture[2*VOUT_MAX_PICTURES+1];      /**< pictures */
 
-    /* Subpicture unit */
-    spu_t          *p_spu;
-
-    /* Video output configuration */
-    config_chain_t *p_cfg;
-
     /* Private vout_thread data */
     vout_thread_sys_t *p;
 };
index 5bb6f0c2af4f596c33fcf3809def619c597ac3ab..b1146871a3f3a0d1515c32f05b0c4bad239dd3fd 100644 (file)
@@ -280,7 +280,7 @@ int vout_OSDEpg( vout_thread_t *p_vout, input_item_t *p_input )
                                         p_vout->fmt_in.i_height );
 
     vlc_epg_Delete( p_epg );
-    spu_DisplaySubpicture( p_vout->p_spu, p_spu );
+    spu_DisplaySubpicture( vout_GetSpu( p_vout ), p_spu );
 
     return VLC_SUCCESS;
 }
index a1059988096efb0d44aa96e0f1d81ce4f9df92b7..a44486242225576f5cacdaa59d8beb9a9f7907b8 100644 (file)
@@ -259,11 +259,11 @@ vout_thread_t *vout_Request( vlc_object_t *p_this, vout_thread_t *p_vout,
         {
             msg_Dbg( p_this, "reusing provided vout" );
 
-            spu_Attach( p_vout->p_spu, VLC_OBJECT(p_vout), false );
+            spu_Attach( p_vout->p->p_spu, VLC_OBJECT(p_vout), false );
             vlc_object_detach( p_vout );
 
             vlc_object_attach( p_vout, p_this );
-            spu_Attach( p_vout->p_spu, VLC_OBJECT(p_vout), true );
+            spu_Attach( p_vout->p->p_spu, VLC_OBJECT(p_vout), true );
         }
     }
 
@@ -409,12 +409,12 @@ vout_thread_t * vout_Create( vlc_object_t *p_parent, video_format_t *p_fmt )
     vlc_object_attach( p_vout, p_parent );
 
     /* Initialize subpicture unit */
-    p_vout->p_spu = spu_Create( p_vout );
+    p_vout->p->p_spu = spu_Create( p_vout );
 
     /* */
-    spu_Init( p_vout->p_spu );
+    spu_Init( p_vout->p->p_spu );
 
-    spu_Attach( p_vout->p_spu, VLC_OBJECT(p_vout), true );
+    spu_Attach( p_vout->p->p_spu, VLC_OBJECT(p_vout), true );
 
     /* Take care of some "interface/control" related initialisations */
     vout_IntfInit( p_vout );
@@ -474,7 +474,7 @@ vout_thread_t * vout_Create( vlc_object_t *p_parent, video_format_t *p_fmt )
     char *psz_tmp = config_ChainCreate( &psz_name, &p_cfg, psz_parser );
     free( psz_parser );
     free( psz_tmp );
-    p_vout->p_cfg = p_cfg;
+    p_vout->p->p_cfg = p_cfg;
 
     /* Create a few object variables for interface interaction */
     var_Create( p_vout, "vout-filter", VLC_VAR_STRING | VLC_VAR_DOINHERIT );
@@ -503,9 +503,9 @@ vout_thread_t * vout_Create( vlc_object_t *p_parent, video_format_t *p_fmt )
     if( vlc_clone( &p_vout->p->thread, RunThread, p_vout,
                    VLC_THREAD_PRIORITY_OUTPUT ) )
     {
-        spu_Attach( p_vout->p_spu, VLC_OBJECT(p_vout), false );
-        spu_Destroy( p_vout->p_spu );
-        p_vout->p_spu = NULL;
+        spu_Attach( p_vout->p->p_spu, VLC_OBJECT(p_vout), false );
+        spu_Destroy( p_vout->p->p_spu );
+        p_vout->p->p_spu = NULL;
         vlc_object_release( p_vout );
         return NULL;
     }
@@ -519,7 +519,7 @@ vout_thread_t * vout_Create( vlc_object_t *p_parent, video_format_t *p_fmt )
     }
     vlc_mutex_unlock( &p_vout->change_lock );
 
-    if( p_vout->b_error )
+    if( p_vout->p->b_error )
     {
         msg_Err( p_vout, "video output creation failed" );
         vout_CloseAndRelease( p_vout );
@@ -562,8 +562,8 @@ static void vout_Destructor( vlc_object_t * p_this )
     free( p_vout->p->psz_module_name );
 
     /* */
-    if( p_vout->p_spu )
-        spu_Destroy( p_vout->p_spu );
+    if( p_vout->p->p_spu )
+        spu_Destroy( p_vout->p->p_spu );
 
     /* Destroy the locks */
     vlc_cond_destroy( &p_vout->p->change_wait );
@@ -582,7 +582,7 @@ static void vout_Destructor( vlc_object_t * p_this )
     free( p_vout->p->psz_filter_chain );
     free( p_vout->p->psz_title );
 
-    config_ChainDestroy( p_vout->p_cfg );
+    config_ChainDestroy( p_vout->p->p_cfg );
 
     free( p_vout->p );
 
@@ -613,7 +613,7 @@ void vout_ChangePause( vout_thread_t *p_vout, bool b_paused, mtime_t i_date )
         vlc_cond_signal( &p_vout->p->picture_wait );
         vlc_mutex_unlock( &p_vout->picture_lock );
 
-        spu_OffsetSubtitleDate( p_vout->p_spu, i_duration );
+        spu_OffsetSubtitleDate( p_vout->p->p_spu, i_duration );
     }
     else
     {
@@ -752,7 +752,7 @@ void vout_DisplayTitle( vout_thread_t *p_vout, const char *psz_title )
 
 spu_t *vout_GetSpu( vout_thread_t *p_vout )
 {
-    return p_vout->p_spu;
+    return p_vout->p->p_spu;
 }
 
 /*****************************************************************************
@@ -907,15 +907,15 @@ static void* RunThread( void *p_this )
     vlc_mutex_lock( &p_vout->change_lock );
 
     if( b_has_wrapper )
-        p_vout->b_error = InitThread( p_vout );
+        p_vout->p->b_error = InitThread( p_vout );
     else
-        p_vout->b_error = true;
+        p_vout->p->b_error = true;
 
     /* signal the creation of the vout */
     p_vout->p->b_ready = true;
     vlc_cond_signal( &p_vout->p->change_wait );
 
-    if( p_vout->b_error )
+    if( p_vout->p->b_error )
         goto exit_thread;
 
     /* */
@@ -926,7 +926,7 @@ static void* RunThread( void *p_this )
      * Main loop - it is not executed if an error occurred during
      * initialization
      */
-    while( !p_vout->p->b_done && !p_vout->b_error )
+    while( !p_vout->p->b_done && !p_vout->p->b_error )
     {
         /* Initialize loop variables */
         const mtime_t current_date = mdate();
@@ -1083,7 +1083,7 @@ static void* RunThread( void *p_this )
         else
             spu_render_time = 0;
 
-        subpicture_t *p_subpic = spu_SortSubpictures( p_vout->p_spu,
+        subpicture_t *p_subpic = spu_SortSubpictures( p_vout->p->p_spu,
                                                       spu_render_time,
                                                       b_snapshot );
         /*
@@ -1193,7 +1193,7 @@ static void* RunThread( void *p_this )
              * immediately, without displaying anything - setting b_error to 1
              * causes the immediate end of the main while() loop. */
             // FIXME pf_end
-            p_vout->b_error = 1;
+            p_vout->p->b_error = 1;
             break;
         }
 
@@ -1215,14 +1215,14 @@ static void* RunThread( void *p_this )
 
             I_OUTPUTPICTURES = I_RENDERPICTURES = 0;
 
-            p_vout->b_error = InitThread( p_vout );
-            if( p_vout->b_error )
+            p_vout->p->b_error = InitThread( p_vout );
+            if( p_vout->p->b_error )
                 msg_Err( p_vout, "InitThread after VOUT_PICTURE_BUFFERS_CHANGE failed" );
 
             vlc_cond_signal( &p_vout->p->picture_wait );
             vlc_mutex_unlock( &p_vout->picture_lock );
 
-            if( p_vout->b_error )
+            if( p_vout->p->b_error )
                 break;
         }
 
@@ -1272,7 +1272,7 @@ static void* RunThread( void *p_this )
     /*
      * Error loop - wait until the thread destruction is requested
      */
-    if( p_vout->b_error )
+    if( p_vout->p->b_error )
         ErrorThread( p_vout );
 
     /* Clean thread */
@@ -1324,7 +1324,7 @@ static void CleanThread( vout_thread_t *p_vout )
     }
 
     /* Destroy translation tables */
-    if( !p_vout->b_error )
+    if( !p_vout->p->b_error )
         vout_EndWrapper( p_vout );
 }
 
@@ -1340,8 +1340,8 @@ static void EndThread( vout_thread_t *p_vout )
     /* FIXME does that function *really* need to be called inside the thread ? */
 
     /* Detach subpicture unit from both input and vout */
-    spu_Attach( p_vout->p_spu, VLC_OBJECT(p_vout), false );
-    vlc_object_detach( p_vout->p_spu );
+    spu_Attach( p_vout->p->p_spu, VLC_OBJECT(p_vout), false );
+    vlc_object_detach( p_vout->p->p_spu );
 
     /* Destroy the video filters2 */
     filter_chain_Delete( p_vout->p->p_vf2_chain );
index d9383c602e24931a7dde657280df9f3b9c1ec474..fe28b33fb074b6e994eed81c14518b9f92dfbd31 100644 (file)
@@ -110,7 +110,7 @@ int vout_ShowTextAbsolute( vout_thread_t *p_vout, int i_channel,
     if( p_style )
         p_spu->p_region->p_style = text_style_Duplicate( p_style );
 
-    spu_DisplaySubpicture( p_vout->p_spu, p_spu );
+    spu_DisplaySubpicture( vout_GetSpu( p_vout ), p_spu );
 
     return VLC_SUCCESS;
 }
index b6bf61d4da16abbfa2f4a06bf7c33f39bcb2208b..49ceff3bbb309629c5eb0f0b417d05a73317d63e 100644 (file)
@@ -46,7 +46,7 @@ void vout_OSDSlider( vlc_object_t *p_caller, int i_channel, int i_position,
 
     if( p_vout && ( var_InheritBool( p_caller, "osd" ) && ( i_position >= 0 ) ) )
     {
-        osd_Slider( p_caller, p_vout->p_spu, p_vout->render.i_width,
+        osd_Slider( p_caller, vout_GetSpu( p_vout ), p_vout->render.i_width,
             p_vout->render.i_height, p_vout->fmt_in.i_x_offset,
             p_vout->fmt_in.i_height - p_vout->fmt_in.i_visible_height
                                     - p_vout->fmt_in.i_y_offset,
@@ -69,7 +69,7 @@ void vout_OSDIcon( vlc_object_t *p_caller, int i_channel, short i_type )
     if( var_InheritBool( p_caller, "osd" ) )
     {
         osd_Icon( p_caller,
-                  p_vout->p_spu,
+                  vout_GetSpu( p_vout ),
                   p_vout->render.i_width,
                   p_vout->render.i_height,
                   p_vout->fmt_in.i_width - p_vout->fmt_in.i_visible_width
index 5e123515a0c5256a2aa74069b14781b2ad63ce1a..1aab60aed0d6f0b11593b301392682ca73354a04 100644 (file)
@@ -43,11 +43,18 @@ struct vout_thread_sys_t
     /* module */
     char       *psz_module_name;
 
+    /* Video output configuration */
+    config_chain_t *p_cfg;
+
+    /* Place holder for the vout_wrapper code */
+    vout_sys_t      *p_sys;
+
     /* Thread & synchronization */
     vlc_thread_t    thread;
     vlc_cond_t      change_wait;
     bool            b_ready;
     bool            b_done;
+    bool            b_error;
 
     /* */
     bool            b_picture_displayed;
@@ -98,6 +105,9 @@ struct vout_thread_sys_t
 
     char            *psz_title;
 
+    /* Subpicture unit */
+    spu_t          *p_spu;
+
     /* */
     vlc_mouse_t     mouse;
 };
index 7a72ef401f4ce0a11683f2b501419106c77e72ea..285fef2cad0ee2d955f00ca2926025f1ecebcd76 100644 (file)
@@ -400,7 +400,7 @@ static int VoutSnapshotPip( vout_thread_t *p_vout, picture_t *p_pic )
     p_subpic->i_original_picture_width  *= 4;
     p_subpic->i_original_picture_height *= 4;
 
-    spu_DisplaySubpicture( p_vout->p_spu, p_subpic );
+    spu_DisplaySubpicture( vout_GetSpu( p_vout ), p_subpic );
     return VLC_SUCCESS;
 }
 
index 2b0f9c8a49e0d2b225082a188082ac59af6b71bc..65fd7b7cd99f46ba5e0f2da54e7bad7561d3c9a5 100644 (file)
@@ -374,7 +374,7 @@ picture_t *vout_RenderPicture( vout_thread_t *p_vout, picture_t *p_pic,
 
     /* Render the subtitles if present */
     if( p_subpic )
-        spu_RenderSubpictures( p_vout->p_spu,
+        spu_RenderSubpictures( p_vout->p->p_spu,
                                p_render, &p_vout->fmt_out,
                                p_subpic, &p_vout->fmt_in, render_date );
     /* Copy in case we used a temporary fast buffer */
index e9f42cf2b11503a4bdaa4226a16130cf7f01b891..9ea1486e281520d3689f59e8e5db820f0bb9a88f 100644 (file)
@@ -114,7 +114,7 @@ int vout_OpenWrapper(vout_thread_t *vout, const char *name)
 #endif
 
     /* */
-    vout->p_sys      = sys;
+    vout->p->p_sys = sys;
 
     return VLC_SUCCESS;
 }
@@ -124,7 +124,7 @@ int vout_OpenWrapper(vout_thread_t *vout, const char *name)
  *****************************************************************************/
 void vout_CloseWrapper(vout_thread_t *vout)
 {
-    vout_sys_t *sys = vout->p_sys;
+    vout_sys_t *sys = vout->p->p_sys;
 
 #ifdef WIN32
     var_DelCallback(vout, "direct3d-desktop", Forward, NULL);
@@ -140,7 +140,7 @@ void vout_CloseWrapper(vout_thread_t *vout)
  *****************************************************************************/
 int vout_InitWrapper(vout_thread_t *vout)
 {
-    vout_sys_t *sys = vout->p_sys;
+    vout_sys_t *sys = vout->p->p_sys;
     vout_display_t *vd = sys->vd;
 
     /* */
@@ -234,7 +234,7 @@ int vout_InitWrapper(vout_thread_t *vout)
  *****************************************************************************/
 void vout_EndWrapper(vout_thread_t *vout)
 {
-    vout_sys_t *sys = vout->p_sys;
+    vout_sys_t *sys = vout->p->p_sys;
 
     for (int i = 0; i < VOUT_MAX_PICTURES; i++) {
         picture_t *picture = &vout->p_picture[i];
@@ -259,7 +259,7 @@ void vout_EndWrapper(vout_thread_t *vout)
  *****************************************************************************/
 int vout_ManageWrapper(vout_thread_t *vout)
 {
-    vout_sys_t *sys = vout->p_sys;
+    vout_sys_t *sys = vout->p->p_sys;
     vout_display_t *vd = sys->vd;
 
     while (vout->i_changes & (VOUT_FULLSCREEN_CHANGE |
@@ -353,7 +353,7 @@ int vout_ManageWrapper(vout_thread_t *vout)
  *****************************************************************************/
 void vout_RenderWrapper(vout_thread_t *vout, picture_t *picture)
 {
-    vout_sys_t *sys = vout->p_sys;
+    vout_sys_t *sys = vout->p->p_sys;
     vout_display_t *vd = sys->vd;
 
     assert(sys->use_dr || !picture->p_sys->direct);
@@ -375,7 +375,7 @@ void vout_RenderWrapper(vout_thread_t *vout, picture_t *picture)
  *****************************************************************************/
 void vout_DisplayWrapper(vout_thread_t *vout, picture_t *picture)
 {
-    vout_sys_t *sys = vout->p_sys;
+    vout_sys_t *sys = vout->p->p_sys;
     vout_display_t *vd = sys->vd;
 
     picture_t *direct = picture->p_sys->direct;