ffmpeg | branch: release/5.0 | Michael Niedermayer <mich...@niedermayer.cc> | 
Mon Apr 11 22:40:59 2022 +0200| [5e821d91436ee47daa674fe58130a4b73c77a719] | 
committer: Michael Niedermayer

avfilter/video: Add ff_default_get_video_buffer2() to set specific alignment

Reviewed-by: Paul B Mahol <one...@gmail.com>
Signed-off-by: Michael Niedermayer <mich...@niedermayer.cc>
(cherry picked from commit d74078270198b97fdda258840f0d501a3ffcc693)
Signed-off-by: Michael Niedermayer <mich...@niedermayer.cc>

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=5e821d91436ee47daa674fe58130a4b73c77a719
---

 libavfilter/video.c | 8 +++++++-
 libavfilter/video.h | 1 +
 2 files changed, 8 insertions(+), 1 deletion(-)

diff --git a/libavfilter/video.c b/libavfilter/video.c
index 7ef04144e4..6e5b7fcb14 100644
--- a/libavfilter/video.c
+++ b/libavfilter/video.c
@@ -24,6 +24,7 @@
 #include <stdio.h>
 
 #include "libavutil/buffer.h"
+#include "libavutil/cpu.h"
 #include "libavutil/hwcontext.h"
 #include "libavutil/imgutils.h"
 
@@ -40,7 +41,7 @@ AVFrame *ff_null_get_video_buffer(AVFilterLink *link, int w, 
int h)
     return ff_get_video_buffer(link->dst->outputs[0], w, h);
 }
 
-AVFrame *ff_default_get_video_buffer(AVFilterLink *link, int w, int h)
+AVFrame *ff_default_get_video_buffer2(AVFilterLink *link, int w, int h, int 
align)
 {
     AVFrame *frame = NULL;
     int pool_width = 0;
@@ -95,6 +96,11 @@ AVFrame *ff_default_get_video_buffer(AVFilterLink *link, int 
w, int h)
     return frame;
 }
 
+AVFrame *ff_default_get_video_buffer(AVFilterLink *link, int w, int h)
+{
+    return ff_default_get_video_buffer2(link, w, h, av_cpu_max_align());
+}
+
 AVFrame *ff_get_video_buffer(AVFilterLink *link, int w, int h)
 {
     AVFrame *ret = NULL;
diff --git a/libavfilter/video.h b/libavfilter/video.h
index f448e4ada4..f37bab9d03 100644
--- a/libavfilter/video.h
+++ b/libavfilter/video.h
@@ -24,6 +24,7 @@
 #include "avfilter.h"
 
 AVFrame *ff_default_get_video_buffer(AVFilterLink *link, int w, int h);
+AVFrame *ff_default_get_video_buffer2(AVFilterLink *link, int w, int h, int 
align);
 AVFrame *ff_null_get_video_buffer(AVFilterLink *link, int w, int h);
 
 /**

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

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

Reply via email to