[vlc-devel] [PATCH 03/11] filter: add a type to handle picture chains

Steve Lhomme robux4 at ycbcr.xyz
Thu Sep 24 16:49:11 CEST 2020


Each implementation uses the same double pointer.

Eventually it may be replaced by a vlc_list but that implies adding an extra
pointer in the picture_t structure.
---
 include/vlc_picture.h | 16 ++++++++++++++++
 1 file changed, 16 insertions(+)

diff --git a/include/vlc_picture.h b/include/vlc_picture.h
index af57f335ed7..608025bcbf8 100644
--- a/include/vlc_picture.h
+++ b/include/vlc_picture.h
@@ -171,6 +171,22 @@ static inline vlc_video_context* picture_GetVideoContext(picture_t *pic)
  * picture chaining helpers
  */
 
+typedef struct vlc_pic_chain {
+    picture_t *front;
+    picture_t *tail;
+} vlc_picture_chain_t;
+
+static inline void vlc_picture_chain_Reset(vlc_picture_chain_t *chain)
+{
+    chain->front = NULL;
+    // chain->tail not needed
+}
+
+static inline bool vlc_picture_chain_IsEmpty(const vlc_picture_chain_t *chain)
+{
+    return chain->front == NULL;
+}
+
 /**
  * Pop the front of a picture chain.
  *
-- 
2.26.2



More information about the vlc-devel mailing list