History

lavfi: make avfilter_get_video_buffer() private on next bump.

They are only useful inside filters and we don't allow user filters for now.

Anton Khirnov committed 14 years ago

Commit 6d583581 parent 877299718 files · +53 −44Browse files

Showing the changes to libavfilter (18 of 18 files). Show all

Unified · Split

18 files
  1. libavfilter/avfilter.h +3 −11
  2. libavfilter/buffersrc.c +2 −2
  3. libavfilter/vf_delogo.c +2 −2
  4. libavfilter/vf_fieldorder.c +1 −1
  5. libavfilter/vf_frei0r.c +1 −1
  6. libavfilter/vf_gradfun.c +1 −1
  7. libavfilter/vf_overlay.c +1 −1
  8. libavfilter/vf_pad.c +6 −6
  9. libavfilter/vf_pixdesctest.c +2 −2
  10. libavfilter/vf_scale.c +1 −1
  11. libavfilter/vf_transpose.c +2 −2
  12. libavfilter/vf_vflip.c +1 −1
  13. libavfilter/vf_yadif.c +4 −4
  14. libavfilter/video.c +8 −4
  15. libavfilter/video.h +14 −0
  16. libavfilter/vsrc_color.c +1 −1
  17. libavfilter/vsrc_movie.c +2 −2
  18. libavfilter/vsrc_testsrc.c +1 −2
libavfilter/avfilter.h+3−11
@@ -573,19 +573,11 @@ int avfilter_link(AVFilterContext *src, unsigned srcpad, · 572 unmodified lines
573573 */
574574 int avfilter_config_links(AVFilterContext *filter);
575575
576−/**
577− * Request a picture buffer with a specific set of permissions.
578− *
579− * @param link the output link to the filter from which the buffer will
580− * be requested
581− * @param perms the required access permissions
582− * @param w the minimum width of the buffer to allocate
583− * @param h the minimum height of the buffer to allocate
584− * @return A reference to the buffer. This must be unreferenced with
585− * avfilter_unref_buffer when you are finished with it.
586− */
576+#if FF_API_FILTERS_PUBLIC
577+attribute_deprecated
587578 AVFilterBufferRef *avfilter_get_video_buffer(AVFilterLink *link, int perms,
588579 int w, int h);
580+#endif
589581
590582 /**
591583 * Create a buffer reference wrapped around an already allocated image
libavfilter/buffersrc.c+2−2
@@ -109,8 +109,8 @@ int av_buffersrc_write_frame(AVFilterContext *buffer_filter, AVFrame *frame) · 108 unmodified lines
109109 case AVMEDIA_TYPE_VIDEO:
110110 CHECK_VIDEO_PARAM_CHANGE(buffer_filter, c, frame->width, frame->height,
111111 frame->format);
112− buf = avfilter_get_video_buffer(buffer_filter->outputs[0], AV_PERM_WRITE,
113− c->w, c->h);
112+ buf = ff_get_video_buffer(buffer_filter->outputs[0], AV_PERM_WRITE,
113+ c->w, c->h);
114114 av_image_copy(buf->data, buf->linesize, frame->data, frame->linesize,
115115 c->pix_fmt, c->w, c->h);
116116 break;
libavfilter/vf_delogo.c+2−2
@@ -219,8 +219,8 @@ static void start_frame(AVFilterLink *inlink, AVFilterBufferRef *inpicref) · 218 unmodified lines
219219 AVFilterBufferRef *outpicref;
220220
221221 if (inpicref->perms & AV_PERM_PRESERVE) {
222− outpicref = avfilter_get_video_buffer(outlink, AV_PERM_WRITE,
223− outlink->w, outlink->h);
222+ outpicref = ff_get_video_buffer(outlink, AV_PERM_WRITE,
223+ outlink->w, outlink->h);
224224 avfilter_copy_buffer_ref_props(outpicref, inpicref);
225225 outpicref->video->w = outlink->w;
226226 outpicref->video->h = outlink->h;
libavfilter/vf_fieldorder.c+1−1
@@ -112,7 +112,7 @@ static AVFilterBufferRef *get_video_buffer(AVFilterLink *inlink, int perms, int · 111 unmodified lines
112112 AVFilterContext *ctx = inlink->dst;
113113 AVFilterLink *outlink = ctx->outputs[0];
114114
115− return avfilter_get_video_buffer(outlink, perms, w, h);
115+ return ff_get_video_buffer(outlink, perms, w, h);
116116 }
117117
118118 static void start_frame(AVFilterLink *inlink, AVFilterBufferRef *inpicref)
libavfilter/vf_frei0r.c+1−1
@@ -432,7 +432,7 @@ static int source_config_props(AVFilterLink *outlink) · 431 unmodified lines
432432 static int source_request_frame(AVFilterLink *outlink)
433433 {
434434 Frei0rContext *frei0r = outlink->src->priv;
435− AVFilterBufferRef *picref = avfilter_get_video_buffer(outlink, AV_PERM_WRITE, outlink->w, outlink->h);
435+ AVFilterBufferRef *picref = ff_get_video_buffer(outlink, AV_PERM_WRITE, outlink->w, outlink->h);
436436 picref->video->pixel_aspect = (AVRational) {1, 1};
437437 picref->pts = frei0r->pts++;
438438 picref->pos = -1;
libavfilter/vf_gradfun.c+1−1
@@ -190,7 +190,7 @@ static void start_frame(AVFilterLink *inlink, AVFilterBufferRef *inpicref) · 189 unmodified lines
190190 AVFilterBufferRef *outpicref;
191191
192192 if (inpicref->perms & AV_PERM_PRESERVE) {
193− outpicref = avfilter_get_video_buffer(outlink, AV_PERM_WRITE, outlink->w, outlink->h);
193+ outpicref = ff_get_video_buffer(outlink, AV_PERM_WRITE, outlink->w, outlink->h);
194194 avfilter_copy_buffer_ref_props(outpicref, inpicref);
195195 outpicref->video->w = outlink->w;
196196 outpicref->video->h = outlink->h;
libavfilter/vf_overlay.c+1−1
@@ -205,7 +205,7 @@ static int config_output(AVFilterLink *outlink) · 204 unmodified lines
205205
206206 static AVFilterBufferRef *get_video_buffer(AVFilterLink *link, int perms, int w, int h)
207207 {
208− return avfilter_get_video_buffer(link->dst->outputs[0], perms, w, h);
208+ return ff_get_video_buffer(link->dst->outputs[0], perms, w, h);
209209 }
210210
211211 static void start_frame(AVFilterLink *inlink, AVFilterBufferRef *inpicref)
libavfilter/vf_pad.c+6−6
@@ -256,9 +256,9 @@ static AVFilterBufferRef *get_video_buffer(AVFilterLink *inlink, int perms, int · 255 unmodified lines
256256 {
257257 PadContext *pad = inlink->dst->priv;
258258
259− AVFilterBufferRef *picref = avfilter_get_video_buffer(inlink->dst->outputs[0], perms,
260− w + (pad->w - pad->in_w),
261− h + (pad->h - pad->in_h));
259+ AVFilterBufferRef *picref = ff_get_video_buffer(inlink->dst->outputs[0], perms,
260+ w + (pad->w - pad->in_w),
261+ h + (pad->h - pad->in_h));
262262 int plane;
263263
264264 picref->video->w = w;
@@ -327,9 +327,9 @@ static void start_frame(AVFilterLink *inlink, AVFilterBufferRef *inpicref) · 62 unmodified lines
327327 if(pad->needs_copy){
328328 av_log(inlink->dst, AV_LOG_DEBUG, "Direct padding impossible allocating new frame\n");
329329 avfilter_unref_buffer(outpicref);
330− outpicref = avfilter_get_video_buffer(inlink->dst->outputs[0], AV_PERM_WRITE | AV_PERM_NEG_LINESIZES,
331− FFMAX(inlink->w, pad->w),
332− FFMAX(inlink->h, pad->h));
330+ outpicref = ff_get_video_buffer(inlink->dst->outputs[0], AV_PERM_WRITE | AV_PERM_NEG_LINESIZES,
331+ FFMAX(inlink->w, pad->w),
332+ FFMAX(inlink->h, pad->h));
333333 avfilter_copy_buffer_ref_props(outpicref, inpicref);
334334 }
335335
libavfilter/vf_pixdesctest.c+2−2
@@ -57,8 +57,8 @@ static void start_frame(AVFilterLink *inlink, AVFilterBufferRef *picref) · 56 unmodified lines
5757 AVFilterBufferRef *outpicref;
5858 int i;
5959
60− outlink->out_buf = avfilter_get_video_buffer(outlink, AV_PERM_WRITE,
61− outlink->w, outlink->h);
60+ outlink->out_buf = ff_get_video_buffer(outlink, AV_PERM_WRITE,
61+ outlink->w, outlink->h);
6262 outpicref = outlink->out_buf;
6363 avfilter_copy_buffer_ref_props(outpicref, picref);
6464
libavfilter/vf_scale.c+1−1
@@ -265,7 +265,7 @@ static void start_frame(AVFilterLink *link, AVFilterBufferRef *picref) · 264 unmodified lines
265265 scale->hsub = av_pix_fmt_descriptors[link->format].log2_chroma_w;
266266 scale->vsub = av_pix_fmt_descriptors[link->format].log2_chroma_h;
267267
268− outpicref = avfilter_get_video_buffer(outlink, AV_PERM_WRITE, outlink->w, outlink->h);
268+ outpicref = ff_get_video_buffer(outlink, AV_PERM_WRITE, outlink->w, outlink->h);
269269 avfilter_copy_buffer_ref_props(outpicref, picref);
270270 outpicref->video->w = outlink->w;
271271 outpicref->video->h = outlink->h;
libavfilter/vf_transpose.c+2−2
@@ -120,8 +120,8 @@ static void start_frame(AVFilterLink *inlink, AVFilterBufferRef *picref) · 119 unmodified lines
120120 {
121121 AVFilterLink *outlink = inlink->dst->outputs[0];
122122
123− outlink->out_buf = avfilter_get_video_buffer(outlink, AV_PERM_WRITE,
124− outlink->w, outlink->h);
123+ outlink->out_buf = ff_get_video_buffer(outlink, AV_PERM_WRITE,
124+ outlink->w, outlink->h);
125125 outlink->out_buf->pts = picref->pts;
126126
127127 if (picref->video->pixel_aspect.num == 0) {
libavfilter/vf_vflip.c+1−1
@@ -50,7 +50,7 @@ static AVFilterBufferRef *get_video_buffer(AVFilterLink *link, int perms, · 49 unmodified lines
5050 if (!(perms & AV_PERM_NEG_LINESIZES))
5151 return ff_default_get_video_buffer(link, perms, w, h);
5252
53− picref = avfilter_get_video_buffer(link->dst->outputs[0], perms, w, h);
53+ picref = ff_get_video_buffer(link->dst->outputs[0], perms, w, h);
5454 for (i = 0; i < 4; i ++) {
5555 int vsub = i == 1 || i == 2 ? flip->vsub : 0;
5656
libavfilter/vf_yadif.c+4−4
@@ -208,8 +208,8 @@ static void return_frame(AVFilterContext *ctx, int is_second) · 207 unmodified lines
208208 }
209209
210210 if (is_second) {
211− yadif->out = avfilter_get_video_buffer(link, AV_PERM_WRITE | AV_PERM_PRESERVE |
212− AV_PERM_REUSE, link->w, link->h);
211+ yadif->out = ff_get_video_buffer(link, AV_PERM_WRITE | AV_PERM_PRESERVE |
212+ AV_PERM_REUSE, link->w, link->h);
213213 avfilter_copy_buffer_ref_props(yadif->out, yadif->cur);
214214 yadif->out->video->interlaced = 0;
215215 }
@@ -268,8 +268,8 @@ static void start_frame(AVFilterLink *link, AVFilterBufferRef *picref) · 52 unmodified lines
268268 if (!yadif->prev)
269269 yadif->prev = avfilter_ref_buffer(yadif->cur, AV_PERM_READ);
270270
271− yadif->out = avfilter_get_video_buffer(ctx->outputs[0], AV_PERM_WRITE | AV_PERM_PRESERVE |
272− AV_PERM_REUSE, link->w, link->h);
271+ yadif->out = ff_get_video_buffer(ctx->outputs[0], AV_PERM_WRITE | AV_PERM_PRESERVE |
272+ AV_PERM_REUSE, link->w, link->h);
273273
274274 avfilter_copy_buffer_ref_props(yadif->out, yadif->cur);
275275 yadif->out->video->interlaced = 0;
libavfilter/video.c+8−4
@@ -67,7 +67,7 @@ static void ff_dlog_ref(void *ctx, AVFilterBufferRef *ref, int end) · 66 unmodified lines
6767
6868 AVFilterBufferRef *ff_null_get_video_buffer(AVFilterLink *link, int perms, int w, int h)
6969 {
70− return avfilter_get_video_buffer(link->dst->outputs[0], perms, w, h);
70+ return ff_get_video_buffer(link->dst->outputs[0], perms, w, h);
7171 }
7272
7373 /* TODO: set the buffer's priv member to a context structure for the whole
@@ -138,7 +138,7 @@ fail: · 64 unmodified lines
138138 return NULL;
139139 }
140140
141−AVFilterBufferRef *avfilter_get_video_buffer(AVFilterLink *link, int perms, int w, int h)
141+AVFilterBufferRef *ff_get_video_buffer(AVFilterLink *link, int perms, int w, int h)
142142 {
143143 AVFilterBufferRef *ret = NULL;
144144
@@ -173,7 +173,7 @@ static void default_start_frame(AVFilterLink *inlink, AVFilterBufferRef *picref) · 28 unmodified lines
173173 outlink = inlink->dst->outputs[0];
174174
175175 if (outlink) {
176− outlink->out_buf = avfilter_get_video_buffer(outlink, AV_PERM_WRITE, outlink->w, outlink->h);
176+ outlink->out_buf = ff_get_video_buffer(outlink, AV_PERM_WRITE, outlink->w, outlink->h);
177177 avfilter_copy_buffer_ref_props(outlink->out_buf, picref);
178178 ff_start_frame(outlink, avfilter_ref_buffer(outlink->out_buf, ~0));
179179 }
@@ -201,7 +201,7 @@ void ff_start_frame(AVFilterLink *link, AVFilterBufferRef *picref) · 21 unmodified lines
201201 picref->perms,
202202 link->dstpad->min_perms, link->dstpad->rej_perms);
203203
204− link->cur_buf = avfilter_get_video_buffer(link, dst->min_perms, link->w, link->h);
204+ link->cur_buf = ff_get_video_buffer(link, dst->min_perms, link->w, link->h);
205205 link->src_buf = picref;
206206 avfilter_copy_buffer_ref_props(link->cur_buf, link->src_buf);
207207 }
@@ -354,4 +354,8 @@ void avfilter_draw_slice(AVFilterLink *link, int y, int h, int slice_dir) · 146 unmodified lines
354354 {
355355 ff_draw_slice(link, y, h, slice_dir);
356356 }
357+AVFilterBufferRef *avfilter_get_video_buffer(AVFilterLink *link, int perms, int w, int h)
358+{
359+ return ff_get_video_buffer(link, perms, w, h);
360+}
357361 #endif
libavfilter/video.h+14−0
@@ -25,6 +25,20 @@ AVFilterBufferRef *ff_default_get_video_buffer(AVFilterLink *link, · 24 unmodified lines
2525 int perms, int w, int h);
2626 AVFilterBufferRef *ff_null_get_video_buffer(AVFilterLink *link, int perms, int w, int h);
2727
28+/**
29+ * Request a picture buffer with a specific set of permissions.
30+ *
31+ * @param link the output link to the filter from which the buffer will
32+ * be requested
33+ * @param perms the required access permissions
34+ * @param w the minimum width of the buffer to allocate
35+ * @param h the minimum height of the buffer to allocate
36+ * @return A reference to the buffer. This must be unreferenced with
37+ * avfilter_unref_buffer when you are finished with it.
38+ */
39+AVFilterBufferRef *ff_get_video_buffer(AVFilterLink *link, int perms,
40+ int w, int h);
41+
2842 void ff_null_start_frame(AVFilterLink *link, AVFilterBufferRef *picref);
2943 void ff_null_draw_slice(AVFilterLink *link, int y, int h, int slice_dir);
3044 void ff_null_end_frame(AVFilterLink *link);
libavfilter/vsrc_color.c+1−1
@@ -140,7 +140,7 @@ static int color_config_props(AVFilterLink *inlink) · 139 unmodified lines
140140 static int color_request_frame(AVFilterLink *link)
141141 {
142142 ColorContext *color = link->src->priv;
143− AVFilterBufferRef *picref = avfilter_get_video_buffer(link, AV_PERM_WRITE, color->w, color->h);
143+ AVFilterBufferRef *picref = ff_get_video_buffer(link, AV_PERM_WRITE, color->w, color->h);
144144 picref->video->pixel_aspect = (AVRational) {1, 1};
145145 picref->pts = color->pts++;
146146 picref->pos = -1;
libavfilter/vsrc_movie.c+2−2
@@ -237,8 +237,8 @@ static int movie_get_frame(AVFilterLink *outlink) · 236 unmodified lines
237237
238238 if (frame_decoded) {
239239 /* FIXME: avoid the memcpy */
240− movie->picref = avfilter_get_video_buffer(outlink, AV_PERM_WRITE | AV_PERM_PRESERVE |
241− AV_PERM_REUSE2, outlink->w, outlink->h);
240+ movie->picref = ff_get_video_buffer(outlink, AV_PERM_WRITE | AV_PERM_PRESERVE |
241+ AV_PERM_REUSE2, outlink->w, outlink->h);
242242 av_image_copy(movie->picref->data, movie->picref->linesize,
243243 movie->frame->data, movie->frame->linesize,
244244 movie->picref->format, outlink->w, outlink->h);
libavfilter/vsrc_testsrc.c+1−2
@@ -132,8 +132,7 @@ static int request_frame(AVFilterLink *outlink) · 131 unmodified lines
132132
133133 if (test->max_pts >= 0 && test->pts > test->max_pts)
134134 return AVERROR_EOF;
135− picref = avfilter_get_video_buffer(outlink, AV_PERM_WRITE,
136− test->w, test->h);
135+ picref = ff_get_video_buffer(outlink, AV_PERM_WRITE, test->w, test->h);
137136 picref->pts = test->pts++;
138137 picref->pos = -1;
139138 picref->video->key_frame = 1;

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