|
|
@ -20,6 +20,7 @@ |
|
|
|
|
|
|
|
|
|
|
|
#include "avfilter.h" |
|
|
|
#include "avfilter.h" |
|
|
|
#include "internal.h" |
|
|
|
#include "internal.h" |
|
|
|
|
|
|
|
#include "video.h" |
|
|
|
|
|
|
|
|
|
|
|
#ifdef DEBUG |
|
|
|
#ifdef DEBUG |
|
|
|
static char *ff_get_ref_perms_string(char *buf, size_t buf_size, int perms) |
|
|
|
static char *ff_get_ref_perms_string(char *buf, size_t buf_size, int perms) |
|
|
@ -72,7 +73,7 @@ AVFilterBufferRef *avfilter_null_get_video_buffer(AVFilterLink *link, int perms, |
|
|
|
/* TODO: set the buffer's priv member to a context structure for the whole
|
|
|
|
/* TODO: set the buffer's priv member to a context structure for the whole
|
|
|
|
* filter chain. This will allow for a buffer pool instead of the constant |
|
|
|
* filter chain. This will allow for a buffer pool instead of the constant |
|
|
|
* alloc & free cycle currently implemented. */ |
|
|
|
* alloc & free cycle currently implemented. */ |
|
|
|
AVFilterBufferRef *avfilter_default_get_video_buffer(AVFilterLink *link, int perms, int w, int h) |
|
|
|
AVFilterBufferRef *ff_default_get_video_buffer(AVFilterLink *link, int perms, int w, int h) |
|
|
|
{ |
|
|
|
{ |
|
|
|
int linesize[4]; |
|
|
|
int linesize[4]; |
|
|
|
uint8_t *data[4]; |
|
|
|
uint8_t *data[4]; |
|
|
@ -149,7 +150,7 @@ AVFilterBufferRef *avfilter_get_video_buffer(AVFilterLink *link, int perms, int |
|
|
|
ret = link->dstpad->get_video_buffer(link, perms, w, h); |
|
|
|
ret = link->dstpad->get_video_buffer(link, perms, w, h); |
|
|
|
|
|
|
|
|
|
|
|
if (!ret) |
|
|
|
if (!ret) |
|
|
|
ret = avfilter_default_get_video_buffer(link, perms, w, h); |
|
|
|
ret = ff_default_get_video_buffer(link, perms, w, h); |
|
|
|
|
|
|
|
|
|
|
|
if (ret) |
|
|
|
if (ret) |
|
|
|
ret->type = AVMEDIA_TYPE_VIDEO; |
|
|
|
ret->type = AVMEDIA_TYPE_VIDEO; |
|
|
@ -164,7 +165,7 @@ void avfilter_null_start_frame(AVFilterLink *link, AVFilterBufferRef *picref) |
|
|
|
avfilter_start_frame(link->dst->outputs[0], picref); |
|
|
|
avfilter_start_frame(link->dst->outputs[0], picref); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
void avfilter_default_start_frame(AVFilterLink *inlink, AVFilterBufferRef *picref) |
|
|
|
static void default_start_frame(AVFilterLink *inlink, AVFilterBufferRef *picref) |
|
|
|
{ |
|
|
|
{ |
|
|
|
AVFilterLink *outlink = NULL; |
|
|
|
AVFilterLink *outlink = NULL; |
|
|
|
|
|
|
|
|
|
|
@ -189,7 +190,7 @@ void avfilter_start_frame(AVFilterLink *link, AVFilterBufferRef *picref) |
|
|
|
FF_DPRINTF_START(NULL, start_frame); ff_dlog_link(NULL, link, 0); av_dlog(NULL, " "); ff_dlog_ref(NULL, picref, 1); |
|
|
|
FF_DPRINTF_START(NULL, start_frame); ff_dlog_link(NULL, link, 0); av_dlog(NULL, " "); ff_dlog_ref(NULL, picref, 1); |
|
|
|
|
|
|
|
|
|
|
|
if (!(start_frame = dst->start_frame)) |
|
|
|
if (!(start_frame = dst->start_frame)) |
|
|
|
start_frame = avfilter_default_start_frame; |
|
|
|
start_frame = default_start_frame; |
|
|
|
|
|
|
|
|
|
|
|
if (picref->linesize[0] < 0) |
|
|
|
if (picref->linesize[0] < 0) |
|
|
|
perms |= AV_PERM_NEG_LINESIZES; |
|
|
|
perms |= AV_PERM_NEG_LINESIZES; |
|
|
@ -215,7 +216,7 @@ void avfilter_null_end_frame(AVFilterLink *link) |
|
|
|
avfilter_end_frame(link->dst->outputs[0]); |
|
|
|
avfilter_end_frame(link->dst->outputs[0]); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
void avfilter_default_end_frame(AVFilterLink *inlink) |
|
|
|
static void default_end_frame(AVFilterLink *inlink) |
|
|
|
{ |
|
|
|
{ |
|
|
|
AVFilterLink *outlink = NULL; |
|
|
|
AVFilterLink *outlink = NULL; |
|
|
|
|
|
|
|
|
|
|
@ -239,7 +240,7 @@ void avfilter_end_frame(AVFilterLink *link) |
|
|
|
void (*end_frame)(AVFilterLink *); |
|
|
|
void (*end_frame)(AVFilterLink *); |
|
|
|
|
|
|
|
|
|
|
|
if (!(end_frame = link->dstpad->end_frame)) |
|
|
|
if (!(end_frame = link->dstpad->end_frame)) |
|
|
|
end_frame = avfilter_default_end_frame; |
|
|
|
end_frame = default_end_frame; |
|
|
|
|
|
|
|
|
|
|
|
end_frame(link); |
|
|
|
end_frame(link); |
|
|
|
|
|
|
|
|
|
|
@ -256,7 +257,7 @@ void avfilter_null_draw_slice(AVFilterLink *link, int y, int h, int slice_dir) |
|
|
|
avfilter_draw_slice(link->dst->outputs[0], y, h, slice_dir); |
|
|
|
avfilter_draw_slice(link->dst->outputs[0], y, h, slice_dir); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
void avfilter_default_draw_slice(AVFilterLink *inlink, int y, int h, int slice_dir) |
|
|
|
static void default_draw_slice(AVFilterLink *inlink, int y, int h, int slice_dir) |
|
|
|
{ |
|
|
|
{ |
|
|
|
AVFilterLink *outlink = NULL; |
|
|
|
AVFilterLink *outlink = NULL; |
|
|
|
|
|
|
|
|
|
|
@ -304,7 +305,25 @@ void avfilter_draw_slice(AVFilterLink *link, int y, int h, int slice_dir) |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
if (!(draw_slice = link->dstpad->draw_slice)) |
|
|
|
if (!(draw_slice = link->dstpad->draw_slice)) |
|
|
|
draw_slice = avfilter_default_draw_slice; |
|
|
|
draw_slice = default_draw_slice; |
|
|
|
draw_slice(link, y, h, slice_dir); |
|
|
|
draw_slice(link, y, h, slice_dir); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
#if FF_API_FILTERS_PUBLIC |
|
|
|
|
|
|
|
AVFilterBufferRef *avfilter_default_get_video_buffer(AVFilterLink *link, int perms, int w, int h) |
|
|
|
|
|
|
|
{ |
|
|
|
|
|
|
|
return ff_default_get_video_buffer(link, perms, w, h); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
void avfilter_default_start_frame(AVFilterLink *inlink, AVFilterBufferRef *picref) |
|
|
|
|
|
|
|
{ |
|
|
|
|
|
|
|
default_start_frame(inlink, picref); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
void avfilter_default_end_frame(AVFilterLink *inlink) |
|
|
|
|
|
|
|
{ |
|
|
|
|
|
|
|
default_end_frame(inlink); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
void avfilter_default_draw_slice(AVFilterLink *inlink, int y, int h, int slice_dir) |
|
|
|
|
|
|
|
{ |
|
|
|
|
|
|
|
default_draw_slice(inlink, y, h, slice_dir); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
#endif |
|
|
|