[vlc-devel] [PATCH 1/6] picture_pool: move internal functions

Thomas Guillem thomas at gllm.fr
Thu Jan 5 14:37:39 CET 2017


---
 include/vlc_picture_pool.h      | 21 ---------------------
 src/Makefile.am                 |  1 +
 src/misc/picture_pool.c         |  1 +
 src/misc/picture_pool.h         | 42 +++++++++++++++++++++++++++++++++++++++++
 src/video_output/video_output.c |  1 +
 5 files changed, 45 insertions(+), 21 deletions(-)
 create mode 100644 src/misc/picture_pool.h

diff --git a/include/vlc_picture_pool.h b/include/vlc_picture_pool.h
index 69a3d1389b..e5fa107abb 100644
--- a/include/vlc_picture_pool.h
+++ b/include/vlc_picture_pool.h
@@ -146,27 +146,6 @@ VLC_API void picture_pool_Enum( picture_pool_t *,
                                 void (*cb)(void *, picture_t *), void *data );
 
 /**
- * Forcefully return all pictures in the pool to free/unallocated state.
- *
- * @warning If any picture in the pool is not free, this function will leak
- * and may eventually cause invalid memory accesses.
- *
- * @note This function has no effects if all pictures in the pool are free.
- *
- * @return the number of picture references that were freed
- */
-unsigned picture_pool_Reset( picture_pool_t * );
-
-/**
- * Cancel the picture pool.
- *
- * It won't return any pictures via picture_pool_Get or picture_pool_Wait if
- * canceled is true. This function will also unblock picture_pool_Wait.
- * picture_pool_Reset will also reset the cancel state to false.
- */
-void picture_pool_Cancel( picture_pool_t *, bool canceled );
-
-/**
  * Reserves pictures from a pool and creates a new pool with those.
  *
  * When the new pool is released, pictures are returned to the master pool.
diff --git a/src/Makefile.am b/src/Makefile.am
index ee676f932a..7b76efc86b 100644
--- a/src/Makefile.am
+++ b/src/Makefile.am
@@ -323,6 +323,7 @@ libvlccore_la_SOURCES = \
 	misc/picture.h \
 	misc/picture_fifo.c \
 	misc/picture_pool.c \
+	misc/picture_pool.h \
 	misc/interrupt.h \
 	misc/interrupt.c \
 	misc/keystore.c \
diff --git a/src/misc/picture_pool.c b/src/misc/picture_pool.c
index 8a507acb55..527da051e9 100644
--- a/src/misc/picture_pool.c
+++ b/src/misc/picture_pool.c
@@ -33,6 +33,7 @@
 #include <vlc_picture_pool.h>
 #include <vlc_atomic.h>
 #include "picture.h"
+#include "picture_pool.h"
 
 static const uintptr_t pool_max = CHAR_BIT * sizeof (unsigned long long);
 
diff --git a/src/misc/picture_pool.h b/src/misc/picture_pool.h
new file mode 100644
index 0000000000..35a14e7895
--- /dev/null
+++ b/src/misc/picture_pool.h
@@ -0,0 +1,42 @@
+/*****************************************************************************
+ * picture_pool.h: picture_pool internals
+ *****************************************************************************
+ * Copyright (C) VLC authors and VideoLAN
+ *
+ * This program is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as published by
+ * the Free Software Foundation; either version 2.1 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with this program; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA.
+ *****************************************************************************/
+
+#include <vlc_picture_pool.h>
+
+/**
+ * Forcefully return all pictures in the pool to free/unallocated state.
+ *
+ * @warning If any picture in the pool is not free, this function will leak
+ * and may eventually cause invalid memory accesses.
+ *
+ * @note This function has no effects if all pictures in the pool are free.
+ *
+ * @return the number of picture references that were freed
+ */
+unsigned picture_pool_Reset( picture_pool_t * );
+
+/**
+ * Cancel the picture pool.
+ *
+ * It won't return any pictures via picture_pool_Get or picture_pool_Wait if
+ * canceled is true. This function will also unblock picture_pool_Wait.
+ * picture_pool_Reset will also reset the cancel state to false.
+ */
+void picture_pool_Cancel( picture_pool_t *, bool canceled );
diff --git a/src/video_output/video_output.c b/src/video_output/video_output.c
index cde380871b..2ed45045ec 100644
--- a/src/video_output/video_output.c
+++ b/src/video_output/video_output.c
@@ -52,6 +52,7 @@
 #include "interlacing.h"
 #include "display.h"
 #include "window.h"
+#include "../misc/picture_pool.h"
 
 /*****************************************************************************
  * Local prototypes
-- 
2.11.0



More information about the vlc-devel mailing list