~ubuntu-branches/ubuntu/utopic/libav/utopic

« back to all changes in this revision

Viewing changes to libavfilter/vsrc_color.c

  • Committer: Package Import Robot
  • Author(s): Reinhard Tartler
  • Date: 2012-12-21 15:32:13 UTC
  • mto: (1.2.18)
  • mto: This revision was merged to the branch mainline in revision 34.
  • Revision ID: package-import@ubuntu.com-20121221153213-fudzrugjzivtv0wp
Tags: upstream-9~beta3
ImportĀ upstreamĀ versionĀ 9~beta3

Show diffs side-by-side

added added

removed removed

Lines of Context:
147
147
{
148
148
    ColorContext *color = link->src->priv;
149
149
    AVFilterBufferRef *picref = ff_get_video_buffer(link, AV_PERM_WRITE, color->w, color->h);
150
 
    AVFilterBufferRef *buf_out;
151
 
    int ret;
152
150
 
153
151
    if (!picref)
154
152
        return AVERROR(ENOMEM);
157
155
    picref->pts                 = color->pts++;
158
156
    picref->pos                 = -1;
159
157
 
160
 
    buf_out = avfilter_ref_buffer(picref, ~0);
161
 
    if (!buf_out) {
162
 
        ret = AVERROR(ENOMEM);
163
 
        goto fail;
164
 
    }
165
 
 
166
 
    ret = ff_start_frame(link, buf_out);
167
 
    if (ret < 0)
168
 
        goto fail;
169
 
 
170
158
    ff_draw_rectangle(picref->data, picref->linesize,
171
159
                      color->line, color->line_step, color->hsub, color->vsub,
172
160
                      0, 0, color->w, color->h);
173
 
    ret = ff_draw_slice(link, 0, color->h, 1);
174
 
    if (ret < 0)
175
 
        goto fail;
176
 
 
177
 
    ret = ff_end_frame(link);
178
 
 
179
 
fail:
180
 
    avfilter_unref_buffer(picref);
181
 
 
182
 
    return ret;
 
161
    return ff_filter_frame(link, picref);
183
162
}
184
163
 
185
164
static const AVFilterPad avfilter_vsrc_color_outputs[] = {