[FFmpeg-cvslog] r26108 - in trunk: ffplay.c libavfilter/avfilter.c libavfilter/avfilter.h libavfilter/vf_vflip.c
michael
subversion
Mon Dec 27 16:10:22 CET 2010
Author: michael
Date: Mon Dec 27 16:10:21 2010
New Revision: 26108
Log:
Support filters and decoders that dont support negative linesizes.
This patch is based on work by stefano.
Modified:
trunk/ffplay.c
trunk/libavfilter/avfilter.c
trunk/libavfilter/avfilter.h
trunk/libavfilter/vf_vflip.c
Modified: trunk/ffplay.c
==============================================================================
--- trunk/ffplay.c Mon Dec 27 10:56:19 2010 (r26107)
+++ trunk/ffplay.c Mon Dec 27 16:10:21 2010 (r26108)
@@ -1616,6 +1616,9 @@ static int input_get_buffer(AVCodecConte
int i, w, h, stride[4];
unsigned edge;
+ if (codec->codec->capabilities & CODEC_CAP_NEG_LINESIZES)
+ perms |= AV_PERM_NEG_LINESIZES;
+
if(pic->buffer_hints & FF_BUFFER_HINTS_VALID) {
if(pic->buffer_hints & FF_BUFFER_HINTS_READABLE) perms |= AV_PERM_READ;
if(pic->buffer_hints & FF_BUFFER_HINTS_PRESERVE) perms |= AV_PERM_PRESERVE;
Modified: trunk/libavfilter/avfilter.c
==============================================================================
--- trunk/libavfilter/avfilter.c Mon Dec 27 10:56:19 2010 (r26107)
+++ trunk/libavfilter/avfilter.c Mon Dec 27 16:10:21 2010 (r26108)
@@ -197,12 +197,13 @@ int avfilter_config_links(AVFilterContex
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 *
{
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,
Modified: trunk/libavfilter/avfilter.h
==============================================================================
--- trunk/libavfilter/avfilter.h Mon Dec 27 10:56:19 2010 (r26107)
+++ trunk/libavfilter/avfilter.h Mon Dec 27 16:10:21 2010 (r26108)
@@ -87,6 +87,7 @@ typedef struct AVFilterBuffer {
#define AV_PERM_PRESERVE 0x04 ///< nobody else can overwrite the buffer
#define AV_PERM_REUSE 0x08 ///< can output the buffer multiple times, with the same contents each time
#define AV_PERM_REUSE2 0x10 ///< can output the buffer multiple times, modified each time
+#define AV_PERM_NEG_LINESIZES 0x20 ///< the buffer requested can have negative linesizes
/**
* Audio specific properties in a reference to an AVFilterBuffer. Since
Modified: trunk/libavfilter/vf_vflip.c
==============================================================================
--- trunk/libavfilter/vf_vflip.c Mon Dec 27 10:56:19 2010 (r26107)
+++ trunk/libavfilter/vf_vflip.c Mon Dec 27 16:10:21 2010 (r26108)
@@ -43,11 +43,13 @@ static AVFilterBufferRef *get_video_buff
int w, int h)
{
FlipContext *flip = link->dst->priv;
+ AVFilterBufferRef *picref;
int i;
- AVFilterBufferRef *picref = avfilter_get_video_buffer(link->dst->outputs[0],
- perms, w, h);
+ if (!(perms & AV_PERM_NEG_LINESIZES))
+ return avfilter_default_get_video_buffer(link, perms, w, h);
+ picref = avfilter_get_video_buffer(link->dst->outputs[0], perms, w, h);
for (i = 0; i < 4; i ++) {
int vsub = i == 1 || i == 2 ? flip->vsub : 0;
More information about the ffmpeg-cvslog
mailing list