summaryrefslogtreecommitdiff
path: root/libavfilter/avfilter.c
diff options
context:
space:
mode:
authorMichael Niedermayer <michaelni@gmx.at>2010-12-27 15:10:21 +0000
committerMichael Niedermayer <michaelni@gmx.at>2010-12-27 15:10:21 +0000
commit0ccabeeaef77e240f2a44f78271a8914a23e239b (patch)
treefd6d6543d0d2cd6413ef2f62a92013140d0a9b3d /libavfilter/avfilter.c
parent9e99f84f7d4fabbbf224da152eacd8f4a50b7bd3 (diff)
Support filters and decoders that dont support negative linesizes.
This patch is based on work by stefano. Originally committed as revision 26108 to svn://svn.ffmpeg.org/ffmpeg/trunk
Diffstat (limited to 'libavfilter/avfilter.c')
-rw-r--r--libavfilter/avfilter.c11
1 files changed, 7 insertions, 4 deletions
diff --git a/libavfilter/avfilter.c b/libavfilter/avfilter.c
index 362d53701f..104a3b4956 100644
--- a/libavfilter/avfilter.c
+++ b/libavfilter/avfilter.c
@@ -197,12 +197,13 @@ int avfilter_config_links(AVFilterContext *filter)
char *ff_get_ref_perms_string(char *buf, size_t buf_size, int perms)
{
- snprintf(buf, buf_size, "%s%s%s%s%s",
+ snprintf(buf, buf_size, "%s%s%s%s%s%s",
perms & AV_PERM_READ ? "r" : "",
perms & AV_PERM_WRITE ? "w" : "",
perms & AV_PERM_PRESERVE ? "p" : "",
perms & AV_PERM_REUSE ? "u" : "",
- perms & AV_PERM_REUSE2 ? "U" : "");
+ perms & AV_PERM_REUSE2 ? "U" : "",
+ perms & AV_PERM_NEG_LINESIZES ? "n" : "");
return buf;
}
@@ -360,15 +361,17 @@ void avfilter_start_frame(AVFilterLink *link, AVFilterBufferRef *picref)
{
void (*start_frame)(AVFilterLink *, AVFilterBufferRef *);
AVFilterPad *dst = link->dstpad;
+ int perms = picref->perms;
FF_DPRINTF_START(NULL, start_frame); ff_dprintf_link(NULL, link, 0); dprintf(NULL, " "); ff_dprintf_ref(NULL, picref, 1);
if (!(start_frame = dst->start_frame))
start_frame = avfilter_default_start_frame;
+ if (picref->linesize[0] < 0)
+ perms |= AV_PERM_NEG_LINESIZES;
/* prepare to copy the picture if it has insufficient permissions */
- if ((dst->min_perms & picref->perms) != dst->min_perms ||
- dst->rej_perms & picref->perms) {
+ if ((dst->min_perms & perms) != dst->min_perms || dst->rej_perms & perms) {
av_log(link->dst, AV_LOG_DEBUG,
"frame copy needed (have perms %x, need %x, reject %x)\n",
picref->perms,