[FFmpeg-cvslog] r23287 - trunk/ffplay.c
jai_menon
subversion
Mon May 24 16:19:45 CEST 2010
Author: jai_menon
Date: Mon May 24 16:19:44 2010
New Revision: 23287
Log:
FFplay : Implement custom reget_buffer for the input filter.
Modified:
trunk/ffplay.c
Modified: trunk/ffplay.c
==============================================================================
--- trunk/ffplay.c Mon May 24 14:32:13 2010 (r23286)
+++ trunk/ffplay.c Mon May 24 16:19:44 2010 (r23287)
@@ -1609,6 +1609,25 @@ static void input_release_buffer(AVCodec
avfilter_unref_pic(pic->opaque);
}
+static int input_reget_buffer(AVCodecContext *codec, AVFrame *pic)
+{
+ AVFilterPicRef *ref = pic->opaque;
+
+ if (pic->data[0] == NULL) {
+ pic->buffer_hints |= FF_BUFFER_HINTS_READABLE;
+ return codec->get_buffer(codec, pic);
+ }
+
+ if ((codec->width != ref->w) || (codec->height != ref->h) ||
+ (codec->pix_fmt != ref->pic->format)) {
+ av_log(codec, AV_LOG_ERROR, "Picture properties changed.\n");
+ return -1;
+ }
+
+ pic->reordered_opaque = codec->reordered_opaque;
+ return 0;
+}
+
static int input_init(AVFilterContext *ctx, const char *args, void *opaque)
{
FilterPriv *priv = ctx->priv;
@@ -1622,6 +1641,7 @@ static int input_init(AVFilterContext *c
priv->use_dr1 = 1;
codec->get_buffer = input_get_buffer;
codec->release_buffer = input_release_buffer;
+ codec->reget_buffer = input_reget_buffer;
}
priv->frame = avcodec_alloc_frame();
More information about the ffmpeg-cvslog
mailing list