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>
release/5.1
Michael Niedermayer 3 years ago
parent a3d790f197
commit d740782701
  1. 8
      libavfilter/video.c
  2. 1
      libavfilter/video.h

@ -38,13 +38,12 @@ AVFrame *ff_null_get_video_buffer(AVFilterLink *link, int w, int h)
return ff_get_video_buffer(link->dst->outputs[0], w, 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; AVFrame *frame = NULL;
int pool_width = 0; int pool_width = 0;
int pool_height = 0; int pool_height = 0;
int pool_align = 0; int pool_align = 0;
int align = av_cpu_max_align();
enum AVPixelFormat pool_format = AV_PIX_FMT_NONE; enum AVPixelFormat pool_format = AV_PIX_FMT_NONE;
if (link->hw_frames_ctx && if (link->hw_frames_ctx &&
@ -94,6 +93,11 @@ AVFrame *ff_default_get_video_buffer(AVFilterLink *link, int w, int h)
return frame; 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 *ff_get_video_buffer(AVFilterLink *link, int w, int h)
{ {
AVFrame *ret = NULL; AVFrame *ret = NULL;

@ -24,6 +24,7 @@
#include "avfilter.h" #include "avfilter.h"
AVFrame *ff_default_get_video_buffer(AVFilterLink *link, int w, int 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); AVFrame *ff_null_get_video_buffer(AVFilterLink *link, int w, int h);
/** /**

Loading…
Cancel
Save