]> git.sesse.net Git - vlc/commitdiff
API vout_DatePicture termin�e.
authorVincent Seguin <seguin@videolan.org>
Wed, 19 Jan 2000 16:45:11 +0000 (16:45 +0000)
committerVincent Seguin <seguin@videolan.org>
Wed, 19 Jan 2000 16:45:11 +0000 (16:45 +0000)
include/video.h
src/video_output/video_output.c

index 23340ab2139364b15e3930d24374a094564ab415..19b7198e11226819651d12209fccedd4d65e45f5 100644 (file)
@@ -74,9 +74,11 @@ typedef struct picture_s
 /* Pictures status */
 #define FREE_PICTURE            0         /* picture is free and not allocated */
 #define RESERVED_PICTURE        1         /* picture is allocated and reserved */
-#define READY_PICTURE           2              /* picture is ready for display */
-#define DISPLAYED_PICTURE       3  /* picture has been displayed but is linked */
-#define DESTROYED_PICTURE       4     /* picture is allocated but no more used */
+#define RESERVED_DATED_PICTURE  2     /* picture is waiting for DisplayPicture */
+#define RESERVED_DISP_PICTURE   3      /* picture is waiting for a DatePixture */
+#define READY_PICTURE           4              /* picture is ready for display */
+#define DISPLAYED_PICTURE       5  /* picture has been displayed but is linked */
+#define DESTROYED_PICTURE       6     /* picture is allocated but no more used */
 
 /* Aspect ratios (ISO/IEC 13818-2 section 6.3.3, table 6-3) */
 #define AR_SQUARE_PICTURE       1                             /* square pixels */
index 4bfc991f2701ec23b2cbcfc7df6271f14fb2fb23..0fb8afab4508d1c460fd051410abeadd03df71e4 100644 (file)
@@ -248,31 +248,30 @@ void vout_DestroySubtitle( vout_thread_t *p_vout, subtitle_t *p_sub )
  * vout_DisplayPicture: display a picture
  *******************************************************************************
  * Remove the reservation flag of a picture, which will cause it to be ready for
- * display. The picture does not need to be locked, since it is ignored by
- * the output thread if is reserved. The picture won't be displayed until 
- * vout_DatePicture has been called.
+ * display. The picture won't be displayed until vout_DatePicture has been 
+ * called.
  *******************************************************************************/
 void  vout_DisplayPicture( vout_thread_t *p_vout, picture_t *p_pic )
 {
-#ifdef DEBUG_VIDEO
-    char        psz_date[MSTRTIME_MAX_SIZE];         /* buffer for date string */
-#endif
-
-#ifdef DEBUG
-    /* Check if picture status is valid */
-    if( p_pic->i_status != RESERVED_PICTURE )
+    vlc_mutex_lock( &p_vout->picture_lock );
+    switch( p_pic->i_status )
     {
-        intf_DbgMsg("error: picture %p has invalid status %d\n", p_pic, p_pic->i_status );       
-    }   
+    case RESERVED_PICTURE:        
+        p_pic->i_status = RESERVED_DISP_PICTURE;
+        break;        
+    case RESERVED_DATED_PICTURE:
+        p_pic->i_status = READY_PICTURE;
+        break;        
+#ifdef DEBUG
+    default:        
+        intf_DbgMsg("error: picture %p has invalid status %d\n", p_pic, p_pic->i_status );    
+        break;        
 #endif
-
-    /* Remove reservation flag */
-    p_pic->i_status = READY_PICTURE;
+    }
+    vlc_mutex_unlock( &p_vout->picture_lock );
 
 #ifdef DEBUG_VIDEO
-    /* Send picture informations */
-    intf_DbgMsg("picture %p: type=%d, %dx%d, date=%s\n", p_pic, p_pic->i_type, 
-                p_pic->i_width,p_pic->i_height, mstrtime( psz_date, p_pic->date ) );    
+    intf_DbgMsg("picture %p\n", p_pic );
 #endif
 }
 
@@ -280,13 +279,32 @@ void  vout_DisplayPicture( vout_thread_t *p_vout, picture_t *p_pic )
  * vout_DatePicture: date a picture
  *******************************************************************************
  * Remove the reservation flag of a picture, which will cause it to be ready for
- * display. The picture does not need to be locked, since it is ignored by
- * the output thread if is reserved. The picture won't be displayed until
- * vout_DisplayPicture has been called.
+ * display. The picture won't be displayed until vout_DisplayPicture has been 
+ * called.
  *******************************************************************************/
 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 )
+    {
+    case RESERVED_PICTURE:        
+        p_pic->i_status = RESERVED_DATED_PICTURE;
+        break;        
+    case RESERVED_DISP_PICTURE:
+        p_pic->i_status = READY_PICTURE;
+        break;        
+#ifdef DEBUG
+    default:        
+        intf_DbgMsg("error: picture %p has invalid status %d\n", p_pic, p_pic->i_status );    
+        break;        
+#endif
+    }
+    vlc_mutex_unlock( &p_vout->picture_lock );
+
+#ifdef DEBUG_VIDEO
+    intf_DbgMsg("picture %p\n", p_pic);
+#endif
 }
 
 /*******************************************************************************
@@ -447,7 +465,9 @@ void vout_DestroyPicture( vout_thread_t *p_vout, picture_t *p_pic )
 {
 #ifdef DEBUG
    /* Check if picture status is valid */
-   if( p_pic->i_status != RESERVED_PICTURE )
+   if( (p_pic->i_status != RESERVED_PICTURE) && 
+       (p_pic->i_status != RESERVED_DATED_PICTURE) &&
+       (p_pic->i_status != RESERVED_DISP_PICTURE) )
    {
        intf_DbgMsg("error: picture %p has invalid status %d\n", p_pic, p_pic->i_status );       
    }   
@@ -1020,6 +1040,8 @@ static int RenderInfo( vout_thread_t *p_vout, boolean_t b_blank )
         switch( p_vout->p_picture[i_picture].i_status )
         {
         case RESERVED_PICTURE:
+        case RESERVED_DATED_PICTURE:
+        case RESERVED_DISP_PICTURE:
             i_reserved_pic++;            
             break;            
         case READY_PICTURE: