]> git.sesse.net Git - vlc/commitdiff
Added a picture_Reset helper.
authorLaurent Aimar <fenrir@videolan.org>
Sat, 30 May 2009 21:23:38 +0000 (23:23 +0200)
committerLaurent Aimar <fenrir@videolan.org>
Sat, 30 May 2009 23:48:48 +0000 (01:48 +0200)
include/vlc_picture.h
src/libvlccore.sym
src/video_output/vout_pictures.c

index a1f4b9fa2a94c185f4f65992dac212605ca28612..ef79f5045680cef96446c8717bc4759809d95e2e 100644 (file)
@@ -198,6 +198,12 @@ static inline void picture_CopyProperties( picture_t *p_dst, const picture_t *p_
     /* FIXME: copy ->p_q and ->p_qstride */
 }
 
+/**
+ * This function will reset a picture informations (properties and quantizers).
+ * It is sometimes usefull for reusing pictures (like from a pool).
+ */
+VLC_EXPORT( void, picture_Reset, ( picture_t * ) );
+
 /**
  * This function will copy the picture pixels.
  * You can safely copy between pictures that do not have the same size,
index f9b8c087fcd661189927e764620217491fd6e9b6..a13bc386e3934b77423d67013f5046841cda06b3 100644 (file)
@@ -277,6 +277,7 @@ picture_CopyPixels
 picture_Delete
 picture_Export
 picture_New
+picture_Reset
 picture_Setup
 plane_CopyPixels
 playlist_Add
index c61fe74691cd553d8cb60a5e52c9f6aa435226b0..5c98c5872ae7a8ad14892767103cd3330c0657b0 100644 (file)
@@ -649,6 +649,20 @@ static void PictureReleaseCallback( picture_t *p_picture )
     picture_Delete( p_picture );
 }
 
+/*****************************************************************************
+ *
+ *****************************************************************************/
+void picture_Reset( picture_t *p_picture )
+{
+    /* */
+    p_picture->date = VLC_TS_INVALID;
+    p_picture->b_force = false;
+    p_picture->b_progressive = false;
+    p_picture->i_nb_fields = 0;
+    p_picture->b_top_field_first = false;
+    picture_CleanupQuant( p_picture );
+}
+
 /*****************************************************************************
  *
  *****************************************************************************/