Revision ff0652e5 cmdutils.c

View differences:

cmdutils.c
787 787
    .outputs   = (AVFilterPad[]) {{ .name = NULL }},
788 788
};
789 789

  
790
int get_filtered_video_frame(AVFilterContext *ctx, AVFrame *frame,
791
                             AVFilterBufferRef **picref_ptr, AVRational *tb)
792
{
793
    int ret;
794
    AVFilterBufferRef *picref;
795

  
796
    if ((ret = avfilter_request_frame(ctx->inputs[0])) < 0)
797
        return ret;
798
    if (!(picref = ctx->inputs[0]->cur_buf))
799
        return AVERROR(ENOENT);
800
    *picref_ptr = picref;
801
    ctx->inputs[0]->cur_buf = NULL;
802
    *tb = ctx->inputs[0]->time_base;
803

  
804
    memcpy(frame->data,     picref->data,     sizeof(frame->data));
805
    memcpy(frame->linesize, picref->linesize, sizeof(frame->linesize));
806
    frame->interlaced_frame = picref->video->interlaced;
807
    frame->top_field_first  = picref->video->top_field_first;
808

  
809
    return 1;
810
}
811

  
790 812
#endif /* CONFIG_AVFILTER */

Also available in: Unified diff