aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorrcombs <rcombs@rcombs.me>2021-12-18 05:02:18 -0600
committerrcombs <rcombs@rcombs.me>2021-12-22 18:43:17 -0600
commitb7e1ec7bda90f979e29f7e06dcd73b5e38ed3ac0 (patch)
treea1a7808343ebd334287fd935fb21a0557a26134d
parent69bd95dcd8d09ecc04f994a239c1d3da62ec38d6 (diff)
downloadffmpeg-b7e1ec7bda90f979e29f7e06dcd73b5e38ed3ac0.tar.gz
lavu/videotoolbox: expose routine to set CVPixelBufferRef metadata
-rw-r--r--doc/APIchanges3
-rw-r--r--libavutil/hwcontext_videotoolbox.c6
-rw-r--r--libavutil/hwcontext_videotoolbox.h7
-rw-r--r--libavutil/version.h2
4 files changed, 17 insertions, 1 deletions
diff --git a/doc/APIchanges b/doc/APIchanges
index 061883f5a4..670a59329e 100644
--- a/doc/APIchanges
+++ b/doc/APIchanges
@@ -15,6 +15,9 @@ libavutil: 2021-04-27
API changes, most recent first:
2021-12-xx - xxxxxxxxxx - lavu 57.13.100 - hwcontext_videotoolbox.h
+ Add av_vt_pixbuf_set_attachments
+
+2021-12-xx - xxxxxxxxxx - lavu 57.13.100 - hwcontext_videotoolbox.h
Add av_map_videotoolbox_chroma_loc_from_av
Add av_map_videotoolbox_color_matrix_from_av
Add av_map_videotoolbox_color_primaries_from_av
diff --git a/libavutil/hwcontext_videotoolbox.c b/libavutil/hwcontext_videotoolbox.c
index 353e09b57f..eff5fdbef1 100644
--- a/libavutil/hwcontext_videotoolbox.c
+++ b/libavutil/hwcontext_videotoolbox.c
@@ -571,6 +571,12 @@ static int vt_pixbuf_set_attachments(void *log_ctx,
return 0;
}
+int av_vt_pixbuf_set_attachments(void *log_ctx,
+ CVPixelBufferRef pixbuf, const AVFrame *src)
+{
+ return vt_pixbuf_set_attachments(log_ctx, pixbuf, src);
+}
+
static int vt_map_frame(AVHWFramesContext *ctx, AVFrame *dst, const AVFrame *src,
int flags)
{
diff --git a/libavutil/hwcontext_videotoolbox.h b/libavutil/hwcontext_videotoolbox.h
index 916899e97d..b6bdcf243d 100644
--- a/libavutil/hwcontext_videotoolbox.h
+++ b/libavutil/hwcontext_videotoolbox.h
@@ -85,4 +85,11 @@ CFStringRef av_map_videotoolbox_color_primaries_from_av(enum AVColorPrimaries pr
*/
CFStringRef av_map_videotoolbox_color_trc_from_av(enum AVColorTransferCharacteristic trc);
+/**
+ * Update a CVPixelBufferRef's metadata to based on an AVFrame.
+ * Returns 0 if no known equivalent was found.
+ */
+int av_vt_pixbuf_set_attachments(void *log_ctx,
+ CVPixelBufferRef pixbuf, const struct AVFrame *src);
+
#endif /* AVUTIL_HWCONTEXT_VIDEOTOOLBOX_H */
diff --git a/libavutil/version.h b/libavutil/version.h
index 668f9206fe..3cac09cb96 100644
--- a/libavutil/version.h
+++ b/libavutil/version.h
@@ -79,7 +79,7 @@
*/
#define LIBAVUTIL_VERSION_MAJOR 57
-#define LIBAVUTIL_VERSION_MINOR 12
+#define LIBAVUTIL_VERSION_MINOR 13
#define LIBAVUTIL_VERSION_MICRO 100
#define LIBAVUTIL_VERSION_INT AV_VERSION_INT(LIBAVUTIL_VERSION_MAJOR, \