History

Rename fields:

AVFilterLink.srcpic -> AVFilterLink.src_buf AVFilterLink.cur_pic -> AVFilterLink.cur_buf AVFilterLink.outpic -> AVFilterLink.out_buf The new names are more generic and more consistent, since the struct they contain, which was named AVFilterPicRef, has been renamed to AVFilterBufferRef. Patch by S.N. Hemanth Meenakshisundaram %smeenaks%ucsd%edu%. Originally committed as revision 24732 to svn://svn.ffmpeg.org/ffmpeg/trunk

S.N. Hemanth Meenakshisundaram committed 16 years ago

Commit 5d4890d1 parent 7fce4819 files · +47 −47Browse files

Unified · Split

9 files
  1. ffmpeg.c +2 −2
  2. ffplay.c +2 −2
  3. libavfilter/avfilter.c +17 −17
  4. libavfilter/avfilter.h +4 −4
  5. libavfilter/defaults.c +8 −8
  6. libavfilter/vf_pad.c +4 −4
  7. libavfilter/vf_pixdesctest.c +4 −4
  8. libavfilter/vf_scale.c +4 −4
  9. libavfilter/vf_unsharp.c +2 −2
ffmpeg.c+2−2
@@ -368,10 +368,10 @@ static int get_filtered_video_pic(AVFilterContext *ctx, · 367 unmodified lines
368368
369369 if(avfilter_request_frame(ctx->inputs[0]))
370370 return -1;
371− if(!(pic = ctx->inputs[0]->cur_pic))
371+ if(!(pic = ctx->inputs[0]->cur_buf))
372372 return -1;
373373 *picref = pic;
374− ctx->inputs[0]->cur_pic = NULL;
374+ ctx->inputs[0]->cur_buf = NULL;
375375
376376 *pts = pic->pts;
377377
ffplay.c+2−2
@@ -1745,9 +1745,9 @@ static int get_filtered_video_frame(AVFilterContext *ctx, AVFrame *frame, · 1744 unmodified lines
17451745
17461746 if(avfilter_request_frame(ctx->inputs[0]))
17471747 return -1;
1748− if(!(pic = ctx->inputs[0]->cur_pic))
1748+ if(!(pic = ctx->inputs[0]->cur_buf))
17491749 return -1;
1750− ctx->inputs[0]->cur_pic = NULL;
1750+ ctx->inputs[0]->cur_buf = NULL;
17511751
17521752 frame->opaque = pic;
17531753 *pts = pic->pts;
libavfilter/avfilter.c+17−17
@@ -262,14 +262,14 @@ void avfilter_start_frame(AVFilterLink *link, AVFilterBufferRef *picref) · 261 unmodified lines
262262 link_dpad(link).min_perms, link_dpad(link).rej_perms);
263263 */
264264
265− link->cur_pic = avfilter_default_get_video_buffer(link, dst->min_perms, link->w, link->h);
266− link->srcpic = picref;
267− avfilter_copy_buffer_ref_props(link->cur_pic, link->srcpic);
265+ link->cur_buf = avfilter_default_get_video_buffer(link, dst->min_perms, link->w, link->h);
266+ link->src_buf = picref;
267+ avfilter_copy_buffer_ref_props(link->cur_buf, link->src_buf);
268268 }
269269 else
270− link->cur_pic = picref;
270+ link->cur_buf = picref;
271271
272− start_frame(link, link->cur_pic);
272+ start_frame(link, link->cur_buf);
273273 }
274274
275275 void avfilter_end_frame(AVFilterLink *link)
@@ -283,9 +283,9 @@ void avfilter_end_frame(AVFilterLink *link) · 7 unmodified lines
283283
284284 /* unreference the source picture if we're feeding the destination filter
285285 * a copied version dues to permission issues */
286− if(link->srcpic) {
287− avfilter_unref_buffer(link->srcpic);
288− link->srcpic = NULL;
286+ if(link->src_buf) {
287+ avfilter_unref_buffer(link->src_buf);
288+ link->src_buf = NULL;
289289 }
290290
291291 }
@@ -299,29 +299,29 @@ void avfilter_draw_slice(AVFilterLink *link, int y, int h, int slice_dir) · 7 unmodified lines
299299 FF_DPRINTF_START(NULL, draw_slice); ff_dprintf_link(NULL, link, 0); dprintf(NULL, " y:%d h:%d dir:%d\n", y, h, slice_dir);
300300
301301 /* copy the slice if needed for permission reasons */
302− if(link->srcpic) {
302+ if(link->src_buf) {
303303 vsub = av_pix_fmt_descriptors[link->format].log2_chroma_h;
304304
305305 for(i = 0; i < 4; i ++) {
306− if(link->srcpic->data[i]) {
307− src[i] = link->srcpic-> data[i] +
308− (y >> (i==0 ? 0 : vsub)) * link->srcpic-> linesize[i];
309− dst[i] = link->cur_pic->data[i] +
310− (y >> (i==0 ? 0 : vsub)) * link->cur_pic->linesize[i];
306+ if(link->src_buf->data[i]) {
307+ src[i] = link->src_buf-> data[i] +
308+ (y >> (i==0 ? 0 : vsub)) * link->src_buf-> linesize[i];
309+ dst[i] = link->cur_buf->data[i] +
310+ (y >> (i==0 ? 0 : vsub)) * link->cur_buf->linesize[i];
311311 } else
312312 src[i] = dst[i] = NULL;
313313 }
314314
315315 for(i = 0; i < 4; i ++) {
316316 int planew =
317− ff_get_plane_bytewidth(link->format, link->cur_pic->w, i);
317+ ff_get_plane_bytewidth(link->format, link->cur_buf->w, i);
318318
319319 if(!src[i]) continue;
320320
321321 for(j = 0; j < h >> (i==0 ? 0 : vsub); j ++) {
322322 memcpy(dst[i], src[i], planew);
323− src[i] += link->srcpic ->linesize[i];
324− dst[i] += link->cur_pic->linesize[i];
323+ src[i] += link->src_buf ->linesize[i];
324+ dst[i] += link->cur_buf->linesize[i];
325325 }
326326 }
327327 }
libavfilter/avfilter.h+4−4
@@ -25,7 +25,7 @@ · 24 unmodified lines
2525 #include "libavutil/avutil.h"
2626
2727 #define LIBAVFILTER_VERSION_MAJOR 1
28−#define LIBAVFILTER_VERSION_MINOR 30
28+#define LIBAVFILTER_VERSION_MINOR 31
2929 #define LIBAVFILTER_VERSION_MICRO 0
3030
3131 #define LIBAVFILTER_VERSION_INT AV_VERSION_INT(LIBAVFILTER_VERSION_MAJOR, \
@@ -530,10 +530,10 @@ struct AVFilterLink · 498 unmodified lines
530530 * for the destination. This should not be accessed directly by the
531531 * filters.
532532 */
533− AVFilterBufferRef *srcpic;
533+ AVFilterBufferRef *src_buf;
534534
535− AVFilterBufferRef *cur_pic;
536− AVFilterBufferRef *outpic;
535+ AVFilterBufferRef *cur_buf;
536+ AVFilterBufferRef *out_buf;
537537 };
538538
539539 /**
libavfilter/defaults.c+8−8
@@ -73,9 +73,9 @@ void avfilter_default_start_frame(AVFilterLink *link, AVFilterBufferRef *picref) · 72 unmodified lines
7373 out = link->dst->outputs[0];
7474
7575 if(out) {
76− out->outpic = avfilter_get_video_buffer(out, AV_PERM_WRITE, out->w, out->h);
77− avfilter_copy_buffer_ref_props(out->outpic, picref);
78− avfilter_start_frame(out, avfilter_ref_buffer(out->outpic, ~0));
76+ out->out_buf = avfilter_get_video_buffer(out, AV_PERM_WRITE, out->w, out->h);
77+ avfilter_copy_buffer_ref_props(out->out_buf, picref);
78+ avfilter_start_frame(out, avfilter_ref_buffer(out->out_buf, ~0));
7979 }
8080 }
8181
@@ -97,13 +97,13 @@ void avfilter_default_end_frame(AVFilterLink *link) · 15 unmodified lines
9797 if(link->dst->output_count)
9898 out = link->dst->outputs[0];
9999
100− avfilter_unref_buffer(link->cur_pic);
101− link->cur_pic = NULL;
100+ avfilter_unref_buffer(link->cur_buf);
101+ link->cur_buf = NULL;
102102
103103 if(out) {
104− if(out->outpic) {
105− avfilter_unref_buffer(out->outpic);
106− out->outpic = NULL;
104+ if(out->out_buf) {
105+ avfilter_unref_buffer(out->out_buf);
106+ out->out_buf = NULL;
107107 }
108108 avfilter_end_frame(out);
109109 }
libavfilter/vf_pad.c+4−4
@@ -247,7 +247,7 @@ static void start_frame(AVFilterLink *inlink, AVFilterBufferRef *inpicref) · 246 unmodified lines
247247 AVFilterBufferRef *outpicref = avfilter_ref_buffer(inpicref, ~0);
248248 int plane;
249249
250− inlink->dst->outputs[0]->outpic = outpicref;
250+ inlink->dst->outputs[0]->out_buf = outpicref;
251251
252252 for (plane = 0; plane < 4 && outpicref->data[plane]; plane++) {
253253 int hsub = (plane == 1 || plane == 2) ? pad->hsub : 0;
@@ -263,7 +263,7 @@ static void start_frame(AVFilterLink *inlink, AVFilterBufferRef *inpicref) · 9 unmodified lines
263263 static void end_frame(AVFilterLink *link)
264264 {
265265 avfilter_end_frame(link->dst->outputs[0]);
266− avfilter_unref_buffer(link->cur_pic);
266+ avfilter_unref_buffer(link->cur_buf);
267267 }
268268
269269 static void draw_send_bar_slice(AVFilterLink *link, int y, int h, int slice_dir, int before_slice)
@@ -282,7 +282,7 @@ static void draw_send_bar_slice(AVFilterLink *link, int y, int h, int slice_dir, · 12 unmodified lines
282282 }
283283
284284 if (bar_h) {
285− draw_rectangle(link->dst->outputs[0]->outpic,
285+ draw_rectangle(link->dst->outputs[0]->out_buf,
286286 pad->line, pad->line_step, pad->hsub, pad->vsub,
287287 0, bar_y, pad->w, bar_h);
288288 avfilter_draw_slice(link->dst->outputs[0], bar_y, bar_h, slice_dir);
@@ -292,7 +292,7 @@ static void draw_send_bar_slice(AVFilterLink *link, int y, int h, int slice_dir, · 3 unmodified lines
292292 static void draw_slice(AVFilterLink *link, int y, int h, int slice_dir)
293293 {
294294 PadContext *pad = link->dst->priv;
295− AVFilterBufferRef *outpic = link->dst->outputs[0]->outpic;
295+ AVFilterBufferRef *outpic = link->dst->outputs[0]->out_buf;
296296
297297 y += pad->y;
298298
libavfilter/vf_pixdesctest.c+4−4
@@ -55,9 +55,9 @@ static void start_frame(AVFilterLink *inlink, AVFilterBufferRef *picref) · 54 unmodified lines
5555 AVFilterBufferRef *outpicref;
5656 int i;
5757
58− outlink->outpic = avfilter_get_video_buffer(outlink, AV_PERM_WRITE,
58+ outlink->out_buf = avfilter_get_video_buffer(outlink, AV_PERM_WRITE,
5959 outlink->w, outlink->h);
60− outpicref = outlink->outpic;
60+ outpicref = outlink->out_buf;
6161 avfilter_copy_buffer_ref_props(outpicref, picref);
6262
6363 for (i = 0; i < 4; i++) {
@@ -80,8 +80,8 @@ static void start_frame(AVFilterLink *inlink, AVFilterBufferRef *picref) · 16 unmodified lines
8080 static void draw_slice(AVFilterLink *inlink, int y, int h, int slice_dir)
8181 {
8282 PixdescTestContext *priv = inlink->dst->priv;
83− AVFilterBufferRef *inpic = inlink->cur_pic;
84− AVFilterBufferRef *outpic = inlink->dst->outputs[0]->outpic;
83+ AVFilterBufferRef *inpic = inlink->cur_buf;
84+ AVFilterBufferRef *outpic = inlink->dst->outputs[0]->out_buf;
8585 int i, c, w = inlink->w;
8686
8787 for (c = 0; c < priv->pix_desc->nb_components; c++) {
libavfilter/vf_scale.c+4−4
@@ -154,7 +154,7 @@ static void start_frame(AVFilterLink *link, AVFilterBufferRef *picref) · 153 unmodified lines
154154 outpicref = avfilter_get_video_buffer(outlink, AV_PERM_WRITE, outlink->w, outlink->h);
155155 avfilter_copy_buffer_ref_props(outpicref, picref);
156156
157− outlink->outpic = outpicref;
157+ outlink->out_buf = outpicref;
158158
159159 av_reduce(&outpicref->pixel_aspect.num, &outpicref->pixel_aspect.den,
160160 (int64_t)picref->pixel_aspect.num * outlink->h * link->w,
@@ -169,7 +169,7 @@ static void draw_slice(AVFilterLink *link, int y, int h, int slice_dir) · 8 unmodified lines
169169 {
170170 ScaleContext *scale = link->dst->priv;
171171 int out_h;
172− AVFilterBufferRef *cur_pic = link->cur_pic;
172+ AVFilterBufferRef *cur_pic = link->cur_buf;
173173 const uint8_t *data[4];
174174
175175 if (scale->slice_y == 0 && slice_dir == -1)
@@ -183,8 +183,8 @@ static void draw_slice(AVFilterLink *link, int y, int h, int slice_dir) · 7 unmodified lines
183183 data[3] = cur_pic->data[3] + y * cur_pic->linesize[3];
184184
185185 out_h = sws_scale(scale->sws, data, cur_pic->linesize, y, h,
186− link->dst->outputs[0]->outpic->data,
187− link->dst->outputs[0]->outpic->linesize);
186+ link->dst->outputs[0]->out_buf->data,
187+ link->dst->outputs[0]->out_buf->linesize);
188188
189189 if (slice_dir == -1)
190190 scale->slice_y -= out_h;
libavfilter/vf_unsharp.c+2−2
@@ -195,8 +195,8 @@ static av_cold void uninit(AVFilterContext *ctx) · 194 unmodified lines
195195 static void end_frame(AVFilterLink *link)
196196 {
197197 UnsharpContext *unsharp = link->dst->priv;
198− AVFilterBufferRef *in = link->cur_pic;
199− AVFilterBufferRef *out = link->dst->outputs[0]->outpic;
198+ AVFilterBufferRef *in = link->cur_buf;
199+ AVFilterBufferRef *out = link->dst->outputs[0]->out_buf;
200200
201201 unsharpen(out->data[0], in->data[0], out->linesize[0], in->linesize[0], link->w, link->h, &unsharp->luma);
202202 unsharpen(out->data[1], in->data[1], out->linesize[1], in->linesize[1], CHROMA_WIDTH(link), CHROMA_HEIGHT(link), &unsharp->chroma);

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t