• Home
  • History
  • Annotate
  • Raw
  • Download
  • only in /netgear-R7000-V1.0.7.12_1.2.5/ap/gpl/iserver/libav-0.8.8/libavfilter/

Lines Matching defs:link

108     AVFilterLink *link;
122 dst-> inputs[dstpad] = link = av_mallocz(sizeof(AVFilterLink));
124 link->src = src;
125 link->dst = dst;
126 link->srcpad = &src->output_pads[srcpad];
127 link->dstpad = &dst->input_pads[dstpad];
128 link->type = src->output_pads[srcpad].type;
130 link->format = -1;
135 int avfilter_insert_filter(AVFilterLink *link, AVFilterContext *filt,
139 unsigned dstpad_idx = link->dstpad - link->dst->input_pads;
141 av_log(link->dst, AV_LOG_INFO, "auto-inserting filter '%s' "
143 filt->name, link->src->name, link->dst->name);
145 link->dst->inputs[dstpad_idx] = NULL;
146 if ((ret = avfilter_link(filt, filt_dstpad_idx, link->dst, dstpad_idx)) < 0) {
147 /* failed to link output filter to new filter */
148 link->dst->inputs[dstpad_idx] = link;
152 /* re-hookup the link to the new destination filter we inserted */
153 link->dst = filt;
154 link->dstpad = &filt->input_pads[filt_srcpad_idx];
155 filt->inputs[filt_srcpad_idx] = link;
158 * link, we need to preserve that */
159 if (link->out_formats)
160 avfilter_formats_changeref(&link->out_formats,
173 AVFilterLink *link = filter->inputs[i];
175 if (!link) continue;
177 switch (link->init_state) {
184 link->init_state = AVLINK_STARTINIT;
186 if ((ret = avfilter_config_links(link->src)) < 0)
189 if (!(config_link = link->srcpad->config_props))
191 if ((ret = config_link(link)) < 0)
194 if (link->time_base.num == 0 && link->time_base.den == 0)
195 link->time_base = link->src && link->src->input_count ?
196 link->src->inputs[0]->time_base : AV_TIME_BASE_Q;
198 if (link->sample_aspect_ratio.num == 0 && link->sample_aspect_ratio.den == 0)
199 link->sample_aspect_ratio = link->src->input_count ?
200 link->src->inputs[0]->sample_aspect_ratio : (AVRational){1,1};
202 if (link->sample_rate == 0 && link->src && link->src->input_count)
203 link->sample_rate = link->src->inputs[0]->sample_rate;
205 if (link->channel_layout == 0 && link->src && link->src->input_count)
206 link->channel_layout = link->src->inputs[0]->channel_layout;
208 if ((config_link = link->dstpad->config_props))
209 if ((ret = config_link(link)) < 0)
212 link->init_state = AVLINK_INIT;
263 static void ff_dlog_link(void *ctx, AVFilterLink *link, int end)
265 if (link->type == AVMEDIA_TYPE_VIDEO) {
267 "link[%p s:%dx%d fmt:%-16s %-16s->%-16s]%s",
268 link, link->w, link->h,
269 av_pix_fmt_descriptors[link->format].name,
270 link->src ? link->src->filter->name : "",
271 link->dst ? link->dst->filter->name : "",
275 av_get_channel_layout_string(buf, sizeof(buf), -1, link->channel_layout);
278 "link[%p r:%"PRId64" cl:%s fmt:%-16s %-16s->%-16s]%s",
279 link, link->sample_rate, buf,
280 av_get_sample_fmt_name(link->format),
281 link->src ? link->src->filter->name : "",
282 link->dst ? link->dst->filter->name : "",
289 AVFilterBufferRef *avfilter_get_video_buffer(AVFilterLink *link, int perms, int w, int h)
294 FF_DPRINTF_START(NULL, get_video_buffer); ff_dlog_link(NULL, link, 0);
297 if (link->dstpad->get_video_buffer)
298 ret = link->dstpad->get_video_buffer(link, perms, w, h);
301 ret = avfilter_default_get_video_buffer(link, perms, w, h);
306 FF_DPRINTF_START(NULL, get_video_buffer); ff_dlog_link(NULL, link, 0); av_dlog(NULL, " returning "); ff_dlog_ref(NULL, ret, 1);
351 AVFilterBufferRef *avfilter_get_audio_buffer(AVFilterLink *link, int perms,
357 if (link->dstpad->get_audio_buffer)
358 ret = link->dstpad->get_audio_buffer(link, perms, sample_fmt, size, channel_layout, planar);
361 ret = avfilter_default_get_audio_buffer(link, perms, sample_fmt, size, channel_layout, planar);
369 int avfilter_request_frame(AVFilterLink *link)
371 FF_DPRINTF_START(NULL, request_frame); ff_dlog_link(NULL, link, 1);
373 if (link->srcpad->request_frame)
374 return link->srcpad->request_frame(link);
375 else if (link->src->inputs[0])
376 return avfilter_request_frame(link->src->inputs[0]);
380 int avfilter_poll_frame(AVFilterLink *link)
384 if (link->srcpad->poll_frame)
385 return link->srcpad->poll_frame(link);
387 for (i = 0; i < link->src->input_count; i++) {
389 if (!link->src->inputs[i])
391 val = avfilter_poll_frame(link->src->inputs[i]);
400 void avfilter_start_frame(AVFilterLink *link, AVFilterBufferRef *picref)
403 AVFilterPad *dst = link->dstpad;
406 FF_DPRINTF_START(NULL, start_frame); ff_dlog_link(NULL, link, 0); av_dlog(NULL, " "); ff_dlog_ref(NULL, picref, 1);
415 av_log(link->dst, AV_LOG_DEBUG,
418 link->dstpad->min_perms, link->dstpad->rej_perms);
420 link->cur_buf = avfilter_get_video_buffer(link, dst->min_perms, link->w, link->h);
421 link->src_buf = picref;
422 avfilter_copy_buffer_ref_props(link->cur_buf, link->src_buf);
425 link->cur_buf = picref;
427 start_frame(link, link->cur_buf);
430 void avfilter_end_frame(AVFilterLink *link)
434 if (!(end_frame = link->dstpad->end_frame))
437 end_frame(link);
441 if (link->src_buf) {
442 avfilter_unref_buffer(link->src_buf);
443 link->src_buf = NULL;
447 void avfilter_draw_slice(AVFilterLink *link, int y, int h, int slice_dir)
453 FF_DPRINTF_START(NULL, draw_slice); ff_dlog_link(NULL, link, 0); av_dlog(NULL, " y:%d h:%d dir:%d\n", y, h, slice_dir);
456 if (link->src_buf) {
457 vsub = av_pix_fmt_descriptors[link->format].log2_chroma_h;
460 if (link->src_buf->data[i]) {
461 src[i] = link->src_buf-> data[i] +
462 (y >> (i==1 || i==2 ? vsub : 0)) * link->src_buf-> linesize[i];
463 dst[i] = link->cur_buf->data[i] +
464 (y >> (i==1 || i==2 ? vsub : 0)) * link->cur_buf->linesize[i];
471 av_image_get_linesize(link->format, link->cur_buf->video->w, i);
477 src[i] += link->src_buf->linesize[i];
478 dst[i] += link->cur_buf->linesize[i];
483 if (!(draw_slice = link->dstpad->draw_slice))
485 draw_slice(link, y, h, slice_dir);
488 void avfilter_filter_samples(AVFilterLink *link, AVFilterBufferRef *samplesref)
491 AVFilterPad *dst = link->dstpad;
493 FF_DPRINTF_START(NULL, filter_samples); ff_dlog_link(NULL, link, 1);
502 av_log(link->dst, AV_LOG_DEBUG,
504 samplesref->perms, link->dstpad->min_perms, link->dstpad->rej_perms);
506 link->cur_buf = avfilter_default_get_audio_buffer(link, dst->min_perms,
511 link->cur_buf->pts = samplesref->pts;
512 link->cur_buf->audio->sample_rate = samplesref->audio->sample_rate;
515 memcpy(link->cur_buf->data[0], samplesref->data[0], samplesref->audio->size);
519 link->cur_buf = samplesref;
521 filter_samples(link, link->cur_buf);
643 AVFilterLink *link;
649 if ((link = filter->inputs[i])) {
650 if (link->src)
651 link->src->outputs[link->srcpad - link->src->output_pads] = NULL;
652 avfilter_formats_unref(&link->in_formats);
653 avfilter_formats_unref(&link->out_formats);
655 av_freep(&link);
658 if ((link = filter->outputs[i])) {
659 if (link->dst)
660 link->dst->inputs[link->dstpad - link->dst->input_pads] = NULL;
661 avfilter_formats_unref(&link->in_formats);
662 avfilter_formats_unref(&link->out_formats);
664 av_freep(&link);