[vlc-devel] commit: Added a picture_Reset helper. (Laurent Aimar )

git version control git at videolan.org
Sun May 31 01:49:14 CEST 2009


vlc | branch: master | Laurent Aimar <fenrir at videolan.org> | Sat May 30 23:23:38 2009 +0200| [a1cd0034ec523e53a534c6b25766327659ae3361] | committer: Laurent Aimar 

Added a picture_Reset helper.

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

 include/vlc_picture.h            |    6 ++++++
 src/libvlccore.sym               |    1 +
 src/video_output/vout_pictures.c |   14 ++++++++++++++
 3 files changed, 21 insertions(+), 0 deletions(-)

diff --git a/include/vlc_picture.h b/include/vlc_picture.h
index a1f4b9f..ef79f50 100644
--- a/include/vlc_picture.h
+++ b/include/vlc_picture.h
@@ -199,6 +199,12 @@ static inline void picture_CopyProperties( picture_t *p_dst, const picture_t *p_
 }
 
 /**
+ * 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,
  * only the compatible(smaller) part will be copied.
diff --git a/src/libvlccore.sym b/src/libvlccore.sym
index f9b8c08..a13bc38 100644
--- a/src/libvlccore.sym
+++ b/src/libvlccore.sym
@@ -277,6 +277,7 @@ picture_CopyPixels
 picture_Delete
 picture_Export
 picture_New
+picture_Reset
 picture_Setup
 plane_CopyPixels
 playlist_Add
diff --git a/src/video_output/vout_pictures.c b/src/video_output/vout_pictures.c
index c61fe74..5c98c58 100644
--- a/src/video_output/vout_pictures.c
+++ b/src/video_output/vout_pictures.c
@@ -652,6 +652,20 @@ static void PictureReleaseCallback( picture_t *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 );
+}
+
+/*****************************************************************************
+ *
+ *****************************************************************************/
 int picture_Setup( picture_t *p_picture, vlc_fourcc_t i_chroma, int i_width, int i_height, int i_aspect )
 {
     int i_index, i_width_aligned, i_height_aligned;




More information about the vlc-devel mailing list