]> git.sesse.net Git - vlc/commitdiff
Merged vout_DatePicture into vout_DisplayPicture.
authorLaurent Aimar <fenrir@videolan.org>
Wed, 15 Oct 2008 18:53:21 +0000 (20:53 +0200)
committerLaurent Aimar <fenrir@videolan.org>
Wed, 15 Oct 2008 19:29:57 +0000 (21:29 +0200)
16 files changed:
include/vlc_vout.h
modules/video_filter/clone.c
modules/video_filter/crop.c
modules/video_filter/deinterlace.c
modules/video_filter/logo.c
modules/video_filter/magnify.c
modules/video_filter/opencv_wrapper.c
modules/video_filter/panoramix.c
modules/video_filter/puzzle.c
modules/video_filter/transform.c
modules/video_filter/wall.c
modules/visualization/goom.c
modules/visualization/visual/visual.c
src/input/decoder.c
src/libvlccore.sym
src/video_output/vout_pictures.c

index 7ef2bdb1059739bdf72629b499dd61639340122a..47206d54f6993298ebc37e9495756f9b0ca3dc67 100644 (file)
@@ -245,34 +245,45 @@ struct picture_heap_t
  * Flags used to describe the status of a picture
  *****************************************************************************/
 
-/* Picture type */
-#define EMPTY_PICTURE           0                            /* empty buffer */
-#define MEMORY_PICTURE          100                 /* heap-allocated buffer */
-#define DIRECT_PICTURE          200                         /* direct buffer */
+/* Picture type
+ * FIXME are the values meaningfull ? */
+enum
+{
+    EMPTY_PICTURE = 0,                             /* empty buffer */
+    MEMORY_PICTURE = 100,                 /* heap-allocated buffer */
+    DIRECT_PICTURE = 200,                         /* direct buffer */
+};
 
 /* Picture status */
-#define FREE_PICTURE            0                  /* free and not allocated */
-#define RESERVED_PICTURE        1                  /* allocated and reserved */
-#define RESERVED_DATED_PICTURE  2              /* waiting for DisplayPicture */
-#define RESERVED_DISP_PICTURE   3               /* waiting for a DatePicture */
-#define READY_PICTURE           4                       /* ready for display */
-#define DISPLAYED_PICTURE       5            /* been displayed but is linked */
-#define DESTROYED_PICTURE       6              /* allocated but no more used */
+enum
+{
+    FREE_PICTURE,                              /* free and not allocated */
+    RESERVED_PICTURE,                          /* allocated and reserved */
+    READY_PICTURE,                                  /* ready for display */
+    DISPLAYED_PICTURE,                   /* been displayed but is linked */
+    DESTROYED_PICTURE,                     /* allocated but no more used */
+};
 
 /* Quantification type */
-#define QTYPE_MPEG1            0
-#define QTYPE_MPEG2            1
-#define QTYPE_H264             2
+enum
+{
+    QTYPE_MPEG1,
+    QTYPE_MPEG2,
+    QTYPE_H264,
+};
 
 /*****************************************************************************
  * Shortcuts to access image components
  *****************************************************************************/
 
 /* Plane indices */
-#define Y_PLANE      0
-#define U_PLANE      1
-#define V_PLANE      2
-#define A_PLANE      3
+enum
+{
+    Y_PLANE = 0,
+    U_PLANE = 1,
+    V_PLANE = 2,
+    A_PLANE = 3,
+};
 
 /* Shortcuts */
 #define Y_PIXELS     p[Y_PLANE].p_pixels
@@ -655,7 +666,6 @@ VLC_EXPORT( picture_t *,     vout_CreatePicture,  ( vout_thread_t *, bool, bool,
 VLC_EXPORT( void,            vout_InitFormat,     ( video_frame_format_t *, uint32_t, int, int, int ) );
 VLC_EXPORT( void,            vout_DestroyPicture, ( vout_thread_t *, picture_t * ) );
 VLC_EXPORT( void,            vout_DisplayPicture, ( vout_thread_t *, picture_t * ) );
-VLC_EXPORT( void,            vout_DatePicture,    ( vout_thread_t *, picture_t *, mtime_t ) );
 VLC_EXPORT( void,            vout_LinkPicture,    ( vout_thread_t *, picture_t * ) );
 VLC_EXPORT( void,            vout_UnlinkPicture,  ( vout_thread_t *, picture_t * ) );
 VLC_EXPORT( void,            vout_PlacePicture,   ( vout_thread_t *, unsigned int, unsigned int, unsigned int *, unsigned int *, unsigned int *, unsigned int * ) );
index 50b92af39435cad82c3d69037f7954a3e0149236..ee97615f5eec0c85bdce47fee35ffaa8d2870404 100644 (file)
@@ -337,8 +337,7 @@ static void Render( vout_thread_t *p_vout, picture_t *p_pic )
             msleep( VOUT_OUTMEM_SLEEP );
         }
 
-        vout_DatePicture( p_vout->p_sys->pp_vout[ i_vout ],
-                          p_outpic, p_pic->date );
+        p_outpic->date = p_pic->date;
         vout_LinkPicture( p_vout->p_sys->pp_vout[ i_vout ], p_outpic );
 
         for( i_plane = 0 ; i_plane < p_pic->i_planes ; i_plane++ )
index 67f0e5c3b8678fb0efcd87721b15418f891cccf1..f8e7c05b8c4d0a2b39e5208a58680db8b94ca3d9 100644 (file)
@@ -513,7 +513,7 @@ static void Render( vout_thread_t *p_vout, picture_t *p_pic )
         msleep( VOUT_OUTMEM_SLEEP );
     }
 
-    vout_DatePicture( p_vout->p_sys->p_vout, p_outpic, p_pic->date );
+    p_outpic->date = p_pic->date;
     vout_LinkPicture( p_vout->p_sys->p_vout, p_outpic );
 
     for( i_plane = 0 ; i_plane < p_pic->i_planes ; i_plane++ )
index 52d693de87050cb3db1c608384448dd1e861df87..523999f8c1a05fdeb2848198d89aad8bb5b6b5a3 100644 (file)
@@ -511,7 +511,7 @@ static void Render ( vout_thread_t *p_vout, picture_t *p_pic )
         msleep( VOUT_OUTMEM_SLEEP );
     }
 
-    vout_DatePicture( p_vout->p_sys->p_vout, pp_outpic[0], p_pic->date );
+    pp_outpic[0]->date = p_pic->date;
 
     /* If we are using double rate, get an additional new picture */
     if( p_vout->p_sys->b_double_rate )
@@ -531,15 +531,9 @@ static void Render ( vout_thread_t *p_vout, picture_t *p_pic )
 
         /* 20ms is a bit arbitrary, but it's only for the first image we get */
         if( !p_vout->p_sys->last_date )
-        {
-            vout_DatePicture( p_vout->p_sys->p_vout, pp_outpic[1],
-                              p_pic->date + 20000 );
-        }
+            pp_outpic[1]->date = p_pic->date + 20000;
         else
-        {
-            vout_DatePicture( p_vout->p_sys->p_vout, pp_outpic[1],
-                      (3 * p_pic->date - p_vout->p_sys->last_date) / 2 );
-        }
+            pp_outpic[1]->date = (3 * p_pic->date - p_vout->p_sys->last_date) / 2;
         p_vout->p_sys->last_date = p_pic->date;
     }
 
index bdaa32b100a7a87defdde48d0f0d37bbe7d4b594..404a0fffaed203a0b03799aaeb99dd618b479a90 100644 (file)
@@ -584,13 +584,12 @@ static void Render( vout_thread_t *p_vout, picture_t *p_inpic )
     }
 
     picture_Copy( p_outpic, p_inpic );
-    vout_DatePicture( p_sys->p_vout, p_outpic, p_inpic->date );
 
     if( p_pic )
-    p_sys->p_blend->pf_video_blend( p_sys->p_blend, p_outpic,
-                                    p_pic, p_sys->posx, p_sys->posy,
-                                    p_logo->i_alpha != -1 ? p_logo->i_alpha
-                                    : p_logo_list->i_alpha );
+        p_sys->p_blend->pf_video_blend( p_sys->p_blend, p_outpic,
+                                        p_pic, p_sys->posx, p_sys->posy,
+                                        p_logo->i_alpha != -1 ? p_logo->i_alpha
+                                        : p_logo_list->i_alpha );
 
     vout_DisplayPicture( p_sys->p_vout, p_outpic );
 }
index a0171ec5c642ff0efeae8c3c28976f5eb624e336..00f59da34f19729d7ce3276c3432047b382226a7 100644 (file)
@@ -256,8 +256,7 @@ static void Render( vout_thread_t *p_vout, picture_t *p_pic )
         msleep( VOUT_OUTMEM_SLEEP );
     }
 
-    vout_DatePicture( p_sys->p_vout, p_outpic, p_pic->date );
-
+    p_outpic->date = p_pic->date;
 
     vlc_mutex_lock( &p_sys->lock );
     const bool b_visible = p_sys->b_visible;
index 2b7562e4da6d99afa919dfbf04634b5284401f20..ec572882199ecb4c863faa4d25975a25575bbc4a 100644 (file)
@@ -589,7 +589,7 @@ static void Render( vout_thread_t *p_vout, picture_t *p_pic )
         msg_Dbg( p_vout, "Render took %2.4f seconds\n", duration );
 
     ReleaseImages(p_vout);
-    vout_DatePicture( p_vout->p_sys->p_vout, p_outpic, p_pic->date );
+    p_outpic->date  = p_pic->date;
     
     vout_UnlinkPicture( p_vout->p_sys->p_vout, p_outpic );
     vout_DisplayPicture( p_vout->p_sys->p_vout, p_outpic );
index 4e92a79d63497bcd15d63836dd4c6798792c7a8a..b5e9090614d9e220c5a182775e753ed98adeaf6e 100644 (file)
@@ -960,7 +960,7 @@ static void RenderPlanarYUV( vout_thread_t *p_vout, picture_t *p_pic )
                 msleep( VOUT_OUTMEM_SLEEP );
             }
 
-            vout_DatePicture( p_entry->p_vout, p_outpic, p_pic->date );
+            p_outpic->date = p_pic->date;
             vout_LinkPicture( p_entry->p_vout, p_outpic );
 
             for( i_plane = 0 ; i_plane < p_pic->i_planes ; i_plane++ )
@@ -1262,8 +1262,7 @@ static void RenderPackedRGB( vout_thread_t *p_vout, picture_t *p_pic )
                 msleep( VOUT_OUTMEM_SLEEP );
             }
 
-            vout_DatePicture( p_vout->p_sys->pp_vout[ i_vout ].p_vout,
-                              p_outpic, p_pic->date );
+            p_outpic->date = p_pic->date;
             vout_LinkPicture( p_vout->p_sys->pp_vout[ i_vout ].p_vout,
                               p_outpic );
 
@@ -1598,8 +1597,7 @@ static void RenderPackedYUV( vout_thread_t *p_vout, picture_t *p_pic )
                 msleep( VOUT_OUTMEM_SLEEP );
             }
 
-            vout_DatePicture( p_vout->p_sys->pp_vout[ i_vout ].p_vout,
-                              p_outpic, p_pic->date );
+            p_outpic->date = p_pic->date;
             vout_LinkPicture( p_vout->p_sys->pp_vout[ i_vout ].p_vout,
                               p_outpic );
 
index 9d0455c55767913590ca6462fbe6794aa8860acf..863dccf9dc9471e9034ef3a5098e0171fd31c3c3 100644 (file)
@@ -366,7 +366,7 @@ static void Render( vout_thread_t *p_vout, picture_t *p_pic )
         msleep( VOUT_OUTMEM_SLEEP );
     }
 
-    vout_DatePicture( p_vout->p_sys->p_vout, p_outpic, p_pic->date );
+    p_outpic->date = p_pic->date;
 
     for( i_plane = 0; i_plane < p_outpic->i_planes; i_plane++ )
     {
index 0df5e2d8ac34b05e15c2e14b6157c5ea9de8260a..541f08b142946aa10125c1dc2f99d91ea2ac1e6c 100644 (file)
@@ -324,7 +324,7 @@ static void Render( vout_thread_t *p_vout, picture_t *p_pic )
         msleep( VOUT_OUTMEM_SLEEP );
     }
 
-    vout_DatePicture( p_vout->p_sys->p_vout, p_outpic, p_pic->date );
+    p_outpic->date = p_pic->date;
     vout_LinkPicture( p_vout->p_sys->p_vout, p_outpic );
 
     p_vout->p_sys->pf_filter( p_vout, p_pic, p_outpic );
index 39ddd82a10aca98efb5c12473c8fe9daff3001de..b5bd62665c26046bfaeaf61a1a7e561c0e02f052 100644 (file)
@@ -522,9 +522,8 @@ static void Render( vout_thread_t *p_vout, picture_t *p_pic )
 
                 msleep( VOUT_OUTMEM_SLEEP );
             }
+            p_outpic->date = p_pic->date;
 
-            vout_DatePicture( p_vout->p_sys->pp_vout[ i_vout ].p_vout,
-                              p_outpic, p_pic->date );
             vout_LinkPicture( p_vout->p_sys->pp_vout[ i_vout ].p_vout,
                               p_outpic );
 
index 044dea7a9c2f6a1218a49aa4e3bc7129f49207a0..5c0c82f4356b51c667d1df6cc6c50ed3a2d37877 100644 (file)
@@ -370,8 +370,8 @@ static void* Thread( vlc_object_t *p_this )
         if( p_pic == NULL ) break;
 
         memcpy( p_pic->p[0].p_pixels, plane, width.i_int * height.i_int * 4 );
-        vout_DatePicture( p_thread->p_vout, p_pic,
-                          aout_DateGet( &i_pts ) + GOOM_DELAY );
+
+        p_pic->date = aout_DateGet( &i_pts ) + GOOM_DELAY;
         vout_DisplayPicture( p_thread->p_vout, p_pic );
     }
 
index 73a71a67217e56fcee4d674c003569e2c05f309e..70c9d63a97322f430f641da2d414009a5d5132f6 100644 (file)
@@ -370,8 +370,7 @@ static void DoWork( aout_instance_t *p_aout, aout_filter_t *p_filter,
 #undef p_effect
     }
 
-    vout_DatePicture( p_sys->p_vout, p_outpic,
-                      ( p_in_buf->start_date + p_in_buf->end_date ) / 2 );
+    p_outpic->date = ( p_in_buf->start_date + p_in_buf->end_date ) / 2;
 
     vout_DisplayPicture( p_sys->p_vout, p_outpic );
 }
index 03cfa9682f87fba14981206fa3c4340741c2c520..be20a8497ace1366319a6727c913642dd026609f 100644 (file)
@@ -1260,8 +1260,6 @@ static void DecoderPlayVideo( decoder_t *p_dec, picture_t *p_picture,
                 p_owner->i_last_rate = i_rate;
             }
 
-            vout_DatePicture( p_vout, p_picture, p_picture->date );
-
             vout_DisplayPicture( p_vout, p_picture );
         }
         else
index 99e532827fee0c6a5a1ff45726599139dcc5b793..508c4a8ab98362e0dec167cfde4703319f201195 100644 (file)
@@ -519,7 +519,6 @@ vout_Close
 vout_ControlWindow
 __vout_Create
 vout_CreatePicture
-vout_DatePicture
 vout_DestroyPicture
 vout_DisplayPicture
 vout_EnableFilter
index 17d4dbc29562755f75648372a2e84acff056ae30..a93931369dd0f0232fd80b8496ed3e484be35ee5 100644 (file)
  * Display a picture
  *
  * Remove the reservation flag of a picture, which will cause it to be ready
- * for display. The picture won't be displayed until vout_DatePicture has been
- * called.
+ * for display.
  */
 void vout_DisplayPicture( vout_thread_t *p_vout, picture_t *p_pic )
 {
     vlc_mutex_lock( &p_vout->picture_lock );
-    switch( p_pic->i_status )
+
+    if( p_pic->i_status == RESERVED_PICTURE )
     {
-    case RESERVED_PICTURE:
-        p_pic->i_status = RESERVED_DISP_PICTURE;
-        break;
-    case RESERVED_DATED_PICTURE:
         p_pic->i_status = READY_PICTURE;
-        break;
-    default:
-        msg_Err( p_vout, "picture to display %p has invalid status %d",
-                         p_pic, p_pic->i_status );
-        break;
     }
-
-    vlc_mutex_unlock( &p_vout->picture_lock );
-}
-
-/**
- * Date a picture
- *
- * Remove the reservation flag of a picture, which will cause it to be ready
- * for display. The picture won't be displayed until vout_DisplayPicture has
- * been called.
- * \param p_vout The vout in question
- * \param p_pic The picture to date
- * \param date The date to display the picture
- */
-void vout_DatePicture( vout_thread_t *p_vout,
-                       picture_t *p_pic, mtime_t date )
-{
-    vlc_mutex_lock( &p_vout->picture_lock );
-    p_pic->date = date;
-    switch( p_pic->i_status )
+    else
     {
-    case RESERVED_PICTURE:
-        p_pic->i_status = RESERVED_DATED_PICTURE;
-        break;
-    case RESERVED_DISP_PICTURE:
-        p_pic->i_status = READY_PICTURE;
-        break;
-    default:
-        msg_Err( p_vout, "picture to date %p has invalid status %d",
+        msg_Err( p_vout, "picture to display %p has invalid status %d",
                          p_pic, p_pic->i_status );
-        break;
     }
 
     vlc_mutex_unlock( &p_vout->picture_lock );
@@ -252,9 +216,7 @@ void vout_DestroyPicture( vout_thread_t *p_vout, picture_t *p_pic )
 
 #ifndef NDEBUG
     /* Check if picture status is valid */
-    if( (p_pic->i_status != RESERVED_PICTURE) &&
-        (p_pic->i_status != RESERVED_DATED_PICTURE) &&
-        (p_pic->i_status != RESERVED_DISP_PICTURE) )
+    if( p_pic->i_status != RESERVED_PICTURE )
     {
         msg_Err( p_vout, "picture to destroy %p has invalid status %d",
                          p_pic, p_pic->i_status );