MCPcopy Create free account
hub / github.com/FFmpeg/FFmpeg / create_sink

Function create_sink

tools/uncoded_frame.c:18–41  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

16} Stream;
17
18static int create_sink(Stream *st, AVFilterGraph *graph,
19 AVFilterContext *f, int idx)
20{
21 enum AVMediaType type = avfilter_pad_get_type(f->output_pads, idx);
22 const char *sink_name;
23 int ret;
24
25 switch (type) {
26 case AVMEDIA_TYPE_VIDEO: sink_name = "buffersink"; break;
27 case AVMEDIA_TYPE_AUDIO: sink_name = "abuffersink"; break;
28 default:
29 av_log(NULL, AV_LOG_ERROR, "Stream type not supported\n");
30 return AVERROR(EINVAL);
31 }
32 ret = avfilter_graph_create_filter(&st->sink,
33 avfilter_get_by_name(sink_name),
34 NULL, NULL, NULL, graph);
35 if (ret < 0)
36 return ret;
37 ret = avfilter_link(f, idx, st->sink, 0);
38 if (ret < 0)
39 return ret;
40 return 0;
41}
42
43int main(int argc, char **argv)
44{

Callers 1

mainFunction · 0.85

Calls 5

avfilter_pad_get_typeFunction · 0.85
av_logFunction · 0.85
avfilter_get_by_nameFunction · 0.85
avfilter_linkFunction · 0.85

Tested by

no test coverage detected