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

Reviewed-by: Paul B Mahol <onemda@gmail.com>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
(cherry picked from commit d740782701)
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
This commit is contained in:
Michael Niedermayer 2022-04-11 22:40:59 +02:00
parent 30ac63c8d2
commit ddc96fdb43
No known key found for this signature in database
GPG Key ID: B18E8928B3948D64
2 changed files with 7 additions and 1 deletions

View File

@ -41,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;
@ -96,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;

View File

@ -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);
/**