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
368 368
369 if(avfilter_request_frame(ctx->inputs[0]))369 if(avfilter_request_frame(ctx->inputs[0]))
370 return -1;370 return -1;
371 if(!(pic = ctx->inputs[0]->cur_pic))371 if(!(pic = ctx->inputs[0]->cur_buf))
372 return -1;372 return -1;
373 *picref = pic;373 *picref = pic;
374 ctx->inputs[0]->cur_pic = NULL;374 ctx->inputs[0]->cur_buf = NULL;
375 375
376 *pts = pic->pts;376 *pts = pic->pts;
377 377
ffplay.c+2−2
@@ -1745,9 +1745,9 @@ static int get_filtered_video_frame(AVFilterContext *ctx, AVFrame *frame, · 1744 unmodified lines
1745 1745
1746 if(avfilter_request_frame(ctx->inputs[0]))1746 if(avfilter_request_frame(ctx->inputs[0]))
1747 return -1;1747 return -1;
1748 if(!(pic = ctx->inputs[0]->cur_pic))1748 if(!(pic = ctx->inputs[0]->cur_buf))
1749 return -1;1749 return -1;
1750 ctx->inputs[0]->cur_pic = NULL;1750 ctx->inputs[0]->cur_buf = NULL;
1751 1751
1752 frame->opaque = pic;1752 frame->opaque = pic;
1753 *pts = pic->pts;1753 *pts = pic->pts;
libavfilter/avfilter.c+17−17
@@ -262,14 +262,14 @@ void avfilter_start_frame(AVFilterLink *link, AVFilterBufferRef *picref) · 261 unmodified lines
262 link_dpad(link).min_perms, link_dpad(link).rej_perms);262 link_dpad(link).min_perms, link_dpad(link).rej_perms);
263 */263 */
264 264
265 link->cur_pic = avfilter_default_get_video_buffer(link, dst->min_perms, link->w, link->h);265 link->cur_buf = avfilter_default_get_video_buffer(link, dst->min_perms, link->w, link->h);
266 link->srcpic = picref;266 link->src_buf = picref;
267 avfilter_copy_buffer_ref_props(link->cur_pic, link->srcpic);267 avfilter_copy_buffer_ref_props(link->cur_buf, link->src_buf);
268 }268 }
269 else269 else
270 link->cur_pic = picref;270 link->cur_buf = picref;
271 271
272 start_frame(link, link->cur_pic);272 start_frame(link, link->cur_buf);
273}273}
274 274
275void avfilter_end_frame(AVFilterLink *link)275void avfilter_end_frame(AVFilterLink *link)
@@ -283,9 +283,9 @@ void avfilter_end_frame(AVFilterLink *link) · 7 unmodified lines
283 283
284 /* unreference the source picture if we're feeding the destination filter284 /* unreference the source picture if we're feeding the destination filter
285 * a copied version dues to permission issues */285 * a copied version dues to permission issues */
286 if(link->srcpic) {286 if(link->src_buf) {
287 avfilter_unref_buffer(link->srcpic);287 avfilter_unref_buffer(link->src_buf);
288 link->srcpic = NULL;288 link->src_buf = NULL;
289 }289 }
290 290
291}291}
@@ -299,29 +299,29 @@ void avfilter_draw_slice(AVFilterLink *link, int y, int h, int slice_dir) · 7 unmodified lines
299 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);299 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);
300 300
301 /* copy the slice if needed for permission reasons */301 /* copy the slice if needed for permission reasons */
302 if(link->srcpic) {302 if(link->src_buf) {
303 vsub = av_pix_fmt_descriptors[link->format].log2_chroma_h;303 vsub = av_pix_fmt_descriptors[link->format].log2_chroma_h;
304 304
305 for(i = 0; i < 4; i ++) {305 for(i = 0; i < 4; i ++) {
306 if(link->srcpic->data[i]) {306 if(link->src_buf->data[i]) {
307 src[i] = link->srcpic-> data[i] +307 src[i] = link->src_buf-> data[i] +
308 (y >> (i==0 ? 0 : vsub)) * link->srcpic-> linesize[i];308 (y >> (i==0 ? 0 : vsub)) * link->src_buf-> linesize[i];
309 dst[i] = link->cur_pic->data[i] +309 dst[i] = link->cur_buf->data[i] +
310 (y >> (i==0 ? 0 : vsub)) * link->cur_pic->linesize[i];310 (y >> (i==0 ? 0 : vsub)) * link->cur_buf->linesize[i];
311 } else311 } else
312 src[i] = dst[i] = NULL;312 src[i] = dst[i] = NULL;
313 }313 }
314 314
315 for(i = 0; i < 4; i ++) {315 for(i = 0; i < 4; i ++) {
316 int planew =316 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);
318 318
319 if(!src[i]) continue;319 if(!src[i]) continue;
320 320
321 for(j = 0; j < h >> (i==0 ? 0 : vsub); j ++) {321 for(j = 0; j < h >> (i==0 ? 0 : vsub); j ++) {
322 memcpy(dst[i], src[i], planew);322 memcpy(dst[i], src[i], planew);
323 src[i] += link->srcpic ->linesize[i];323 src[i] += link->src_buf ->linesize[i];
324 dst[i] += link->cur_pic->linesize[i];324 dst[i] += link->cur_buf->linesize[i];
325 }325 }
326 }326 }
327 }327 }
libavfilter/avfilter.h+4−4
@@ -25,7 +25,7 @@ · 24 unmodified lines
25#include "libavutil/avutil.h"25#include "libavutil/avutil.h"
26 26
27#define LIBAVFILTER_VERSION_MAJOR 127#define LIBAVFILTER_VERSION_MAJOR 1
28#define LIBAVFILTER_VERSION_MINOR 3028#define LIBAVFILTER_VERSION_MINOR 31
29#define LIBAVFILTER_VERSION_MICRO 029#define LIBAVFILTER_VERSION_MICRO 0
30 30
31#define LIBAVFILTER_VERSION_INT AV_VERSION_INT(LIBAVFILTER_VERSION_MAJOR, \31#define LIBAVFILTER_VERSION_INT AV_VERSION_INT(LIBAVFILTER_VERSION_MAJOR, \
@@ -530,10 +530,10 @@ struct AVFilterLink · 498 unmodified lines
530 * for the destination. This should not be accessed directly by the530 * for the destination. This should not be accessed directly by the
531 * filters.531 * filters.
532 */532 */
533 AVFilterBufferRef *srcpic;533 AVFilterBufferRef *src_buf;
534 534
535 AVFilterBufferRef *cur_pic;535 AVFilterBufferRef *cur_buf;
536 AVFilterBufferRef *outpic;536 AVFilterBufferRef *out_buf;
537};537};
538 538
539/**539/**
libavfilter/defaults.c+8−8
@@ -73,9 +73,9 @@ void avfilter_default_start_frame(AVFilterLink *link, AVFilterBufferRef *picref) · 72 unmodified lines
73 out = link->dst->outputs[0];73 out = link->dst->outputs[0];
74 74
75 if(out) {75 if(out) {
76 out->outpic = avfilter_get_video_buffer(out, AV_PERM_WRITE, out->w, out->h);76 out->out_buf = avfilter_get_video_buffer(out, AV_PERM_WRITE, out->w, out->h);
77 avfilter_copy_buffer_ref_props(out->outpic, picref);77 avfilter_copy_buffer_ref_props(out->out_buf, picref);
78 avfilter_start_frame(out, avfilter_ref_buffer(out->outpic, ~0));78 avfilter_start_frame(out, avfilter_ref_buffer(out->out_buf, ~0));
79 }79 }
80}80}
81 81
@@ -97,13 +97,13 @@ void avfilter_default_end_frame(AVFilterLink *link) · 15 unmodified lines
97 if(link->dst->output_count)97 if(link->dst->output_count)
98 out = link->dst->outputs[0];98 out = link->dst->outputs[0];
99 99
100 avfilter_unref_buffer(link->cur_pic);100 avfilter_unref_buffer(link->cur_buf);
101 link->cur_pic = NULL;101 link->cur_buf = NULL;
102 102
103 if(out) {103 if(out) {
104 if(out->outpic) {104 if(out->out_buf) {
105 avfilter_unref_buffer(out->outpic);105 avfilter_unref_buffer(out->out_buf);
106 out->outpic = NULL;106 out->out_buf = NULL;
107 }107 }
108 avfilter_end_frame(out);108 avfilter_end_frame(out);
109 }109 }
libavfilter/vf_pad.c+4−4
@@ -247,7 +247,7 @@ static void start_frame(AVFilterLink *inlink, AVFilterBufferRef *inpicref) · 246 unmodified lines
247 AVFilterBufferRef *outpicref = avfilter_ref_buffer(inpicref, ~0);247 AVFilterBufferRef *outpicref = avfilter_ref_buffer(inpicref, ~0);
248 int plane;248 int plane;
249 249
250 inlink->dst->outputs[0]->outpic = outpicref;250 inlink->dst->outputs[0]->out_buf = outpicref;
251 251
252 for (plane = 0; plane < 4 && outpicref->data[plane]; plane++) {252 for (plane = 0; plane < 4 && outpicref->data[plane]; plane++) {
253 int hsub = (plane == 1 || plane == 2) ? pad->hsub : 0;253 int hsub = (plane == 1 || plane == 2) ? pad->hsub : 0;
@@ -263,7 +263,7 @@ static void start_frame(AVFilterLink *inlink, AVFilterBufferRef *inpicref) · 9 unmodified lines
263static void end_frame(AVFilterLink *link)263static void end_frame(AVFilterLink *link)
264{264{
265 avfilter_end_frame(link->dst->outputs[0]);265 avfilter_end_frame(link->dst->outputs[0]);
266 avfilter_unref_buffer(link->cur_pic);266 avfilter_unref_buffer(link->cur_buf);
267}267}
268 268
269static void draw_send_bar_slice(AVFilterLink *link, int y, int h, int slice_dir, int before_slice)269static 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
282 }282 }
283 283
284 if (bar_h) {284 if (bar_h) {
285 draw_rectangle(link->dst->outputs[0]->outpic,285 draw_rectangle(link->dst->outputs[0]->out_buf,
286 pad->line, pad->line_step, pad->hsub, pad->vsub,286 pad->line, pad->line_step, pad->hsub, pad->vsub,
287 0, bar_y, pad->w, bar_h);287 0, bar_y, pad->w, bar_h);
288 avfilter_draw_slice(link->dst->outputs[0], bar_y, bar_h, slice_dir);288 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
292static void draw_slice(AVFilterLink *link, int y, int h, int slice_dir)292static void draw_slice(AVFilterLink *link, int y, int h, int slice_dir)
293{293{
294 PadContext *pad = link->dst->priv;294 PadContext *pad = link->dst->priv;
295 AVFilterBufferRef *outpic = link->dst->outputs[0]->outpic;295 AVFilterBufferRef *outpic = link->dst->outputs[0]->out_buf;
296 296
297 y += pad->y;297 y += pad->y;
298 298
libavfilter/vf_pixdesctest.c+4−4
@@ -55,9 +55,9 @@ static void start_frame(AVFilterLink *inlink, AVFilterBufferRef *picref) · 54 unmodified lines
55 AVFilterBufferRef *outpicref;55 AVFilterBufferRef *outpicref;
56 int i;56 int i;
57 57
58 outlink->outpic = avfilter_get_video_buffer(outlink, AV_PERM_WRITE,58 outlink->out_buf = avfilter_get_video_buffer(outlink, AV_PERM_WRITE,
59 outlink->w, outlink->h);59 outlink->w, outlink->h);
60 outpicref = outlink->outpic;60 outpicref = outlink->out_buf;
61 avfilter_copy_buffer_ref_props(outpicref, picref);61 avfilter_copy_buffer_ref_props(outpicref, picref);
62 62
63 for (i = 0; i < 4; i++) {63 for (i = 0; i < 4; i++) {
@@ -80,8 +80,8 @@ static void start_frame(AVFilterLink *inlink, AVFilterBufferRef *picref) · 16 unmodified lines
80static void draw_slice(AVFilterLink *inlink, int y, int h, int slice_dir)80static void draw_slice(AVFilterLink *inlink, int y, int h, int slice_dir)
81{81{
82 PixdescTestContext *priv = inlink->dst->priv;82 PixdescTestContext *priv = inlink->dst->priv;
83 AVFilterBufferRef *inpic = inlink->cur_pic;83 AVFilterBufferRef *inpic = inlink->cur_buf;
84 AVFilterBufferRef *outpic = inlink->dst->outputs[0]->outpic;84 AVFilterBufferRef *outpic = inlink->dst->outputs[0]->out_buf;
85 int i, c, w = inlink->w;85 int i, c, w = inlink->w;
86 86
87 for (c = 0; c < priv->pix_desc->nb_components; c++) {87 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
154 outpicref = avfilter_get_video_buffer(outlink, AV_PERM_WRITE, outlink->w, outlink->h);154 outpicref = avfilter_get_video_buffer(outlink, AV_PERM_WRITE, outlink->w, outlink->h);
155 avfilter_copy_buffer_ref_props(outpicref, picref);155 avfilter_copy_buffer_ref_props(outpicref, picref);
156 156
157 outlink->outpic = outpicref;157 outlink->out_buf = outpicref;
158 158
159 av_reduce(&outpicref->pixel_aspect.num, &outpicref->pixel_aspect.den,159 av_reduce(&outpicref->pixel_aspect.num, &outpicref->pixel_aspect.den,
160 (int64_t)picref->pixel_aspect.num * outlink->h * link->w,160 (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
169{169{
170 ScaleContext *scale = link->dst->priv;170 ScaleContext *scale = link->dst->priv;
171 int out_h;171 int out_h;
172 AVFilterBufferRef *cur_pic = link->cur_pic;172 AVFilterBufferRef *cur_pic = link->cur_buf;
173 const uint8_t *data[4];173 const uint8_t *data[4];
174 174
175 if (scale->slice_y == 0 && slice_dir == -1)175 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
183 data[3] = cur_pic->data[3] + y * cur_pic->linesize[3];183 data[3] = cur_pic->data[3] + y * cur_pic->linesize[3];
184 184
185 out_h = sws_scale(scale->sws, data, cur_pic->linesize, y, h,185 out_h = sws_scale(scale->sws, data, cur_pic->linesize, y, h,
186 link->dst->outputs[0]->outpic->data,186 link->dst->outputs[0]->out_buf->data,
187 link->dst->outputs[0]->outpic->linesize);187 link->dst->outputs[0]->out_buf->linesize);
188 188
189 if (slice_dir == -1)189 if (slice_dir == -1)
190 scale->slice_y -= out_h;190 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
195static void end_frame(AVFilterLink *link)195static void end_frame(AVFilterLink *link)
196{196{
197 UnsharpContext *unsharp = link->dst->priv;197 UnsharpContext *unsharp = link->dst->priv;
198 AVFilterBufferRef *in = link->cur_pic;198 AVFilterBufferRef *in = link->cur_buf;
199 AVFilterBufferRef *out = link->dst->outputs[0]->outpic;199 AVFilterBufferRef *out = link->dst->outputs[0]->out_buf;
200 200
201 unsharpen(out->data[0], in->data[0], out->linesize[0], in->linesize[0], link->w, link->h, &unsharp->luma);201 unsharpen(out->data[0], in->data[0], out->linesize[0], in->linesize[0], link->w, link->h, &unsharp->luma);
202 unsharpen(out->data[1], in->data[1], out->linesize[1], in->linesize[1], CHROMA_WIDTH(link), CHROMA_HEIGHT(link), &unsharp->chroma);202 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