Git Inbox Mirror of the ffmpeg-devel mailing list - see https://ffmpeg.org/mailman/listinfo/ffmpeg-devel
 help / color / mirror / Atom feed
From: xademax@gmail.com
To: ffmpeg-devel@ffmpeg.org
Cc: Elie ROUDNINSKI <xademax@gmail.com>, Jonas Karlman <jonas@kwiboo.se>
Subject: [FFmpeg-devel] [PATCH v2 1/2] avutil/buffer: add av_buffer_pool_flush()
Date: Tue, 12 Apr 2022 17:53:15 +0200
Message-ID: <20220412155316.22417-2-xademax@gmail.com> (raw)
In-Reply-To: <20220412155316.22417-1-xademax@gmail.com>

From: Jonas Karlman <jonas@kwiboo.se>

Co-authored-by: Elie ROUDNINSKI <xademax@gmail.com>
---
 doc/APIchanges      | 3 +++
 libavutil/buffer.c  | 7 +++++++
 libavutil/buffer.h  | 5 +++++
 libavutil/version.h | 4 ++--
 4 files changed, 17 insertions(+), 2 deletions(-)

diff --git a/doc/APIchanges b/doc/APIchanges
index 1a9f0a303e..049b23a6fa 100644
--- a/doc/APIchanges
+++ b/doc/APIchanges
@@ -14,6 +14,9 @@ libavutil:     2021-04-27
 
 API changes, most recent first:
 
+2022-xx-xx - xxxxxxxxxx - lavu 57.25.100 - buffer.h
+  Add av_buffer_pool_flush().
+
 2022-03-16 - xxxxxxxxxx - all libraries - version_major.h
   Add lib<name>/version_major.h as new installed headers, which only
   contain the major version number (and corresponding API deprecation
diff --git a/libavutil/buffer.c b/libavutil/buffer.c
index 54590be566..4bbe7b2787 100644
--- a/libavutil/buffer.c
+++ b/libavutil/buffer.c
@@ -304,6 +304,13 @@ static void buffer_pool_flush(AVBufferPool *pool)
     }
 }
 
+void av_buffer_pool_flush(AVBufferPool *pool)
+{
+    ff_mutex_lock(&pool->mutex);
+    buffer_pool_flush(pool);
+    ff_mutex_unlock(&pool->mutex);
+}
+
 /*
  * This function gets called when the pool has been uninited and
  * all the buffers returned to it.
diff --git a/libavutil/buffer.h b/libavutil/buffer.h
index e1ef5b7f07..3eb4eef34c 100644
--- a/libavutil/buffer.h
+++ b/libavutil/buffer.h
@@ -284,6 +284,11 @@ AVBufferPool *av_buffer_pool_init2(size_t size, void *opaque,
                                    AVBufferRef* (*alloc)(void *opaque, size_t size),
                                    void (*pool_free)(void *opaque));
 
+/**
+ * Free all available buffers in a buffer pool.
+ */
+void av_buffer_pool_flush(AVBufferPool *pool);
+
 /**
  * Mark the pool as being available for freeing. It will actually be freed only
  * once all the allocated buffers associated with the pool are released. Thus it
diff --git a/libavutil/version.h b/libavutil/version.h
index 6735c20090..dd7d20a9fa 100644
--- a/libavutil/version.h
+++ b/libavutil/version.h
@@ -79,8 +79,8 @@
  */
 
 #define LIBAVUTIL_VERSION_MAJOR  57
-#define LIBAVUTIL_VERSION_MINOR  24
-#define LIBAVUTIL_VERSION_MICRO 101
+#define LIBAVUTIL_VERSION_MINOR  25
+#define LIBAVUTIL_VERSION_MICRO 100
 
 #define LIBAVUTIL_VERSION_INT   AV_VERSION_INT(LIBAVUTIL_VERSION_MAJOR, \
                                                LIBAVUTIL_VERSION_MINOR, \
-- 
2.35.1

_______________________________________________
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
https://ffmpeg.org/mailman/listinfo/ffmpeg-devel

To unsubscribe, visit link above, or email
ffmpeg-devel-request@ffmpeg.org with subject "unsubscribe".

  reply	other threads:[~2022-04-12 15:53 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-04-12 15:53 [FFmpeg-devel] [PATCH v2 0/2] Add common V4L2 request API code xademax
2022-04-12 15:53 ` xademax [this message]
2022-04-12 15:53 ` [FFmpeg-devel] [PATCH v2 2/2] avcodec: add " xademax
2022-04-13 10:12 ` [FFmpeg-devel] [PATCH v2 0/2] Add " Elie Roudninski

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20220412155316.22417-2-xademax@gmail.com \
    --to=xademax@gmail.com \
    --cc=ffmpeg-devel@ffmpeg.org \
    --cc=jonas@kwiboo.se \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link

Git Inbox Mirror of the ffmpeg-devel mailing list - see https://ffmpeg.org/mailman/listinfo/ffmpeg-devel

This inbox may be cloned and mirrored by anyone:

	git clone --mirror https://master.gitmailbox.com/ffmpegdev/0 ffmpegdev/git/0.git

	# If you have public-inbox 1.1+ installed, you may
	# initialize and index your mirror using the following commands:
	public-inbox-init -V2 ffmpegdev ffmpegdev/ https://master.gitmailbox.com/ffmpegdev \
		ffmpegdev@gitmailbox.com
	public-inbox-index ffmpegdev

Example config snippet for mirrors.


AGPL code for this site: git clone https://public-inbox.org/public-inbox.git