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

Function av_bsf_init

libavcodec/bsf.c:149–188  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

147}
148
149int av_bsf_init(AVBSFContext *ctx)
150{
151 int ret, i;
152
153 /* check that the codec is supported */
154 if (ctx->filter->codec_ids) {
155 for (i = 0; ctx->filter->codec_ids[i] != AV_CODEC_ID_NONE; i++)
156 if (ctx->par_in->codec_id == ctx->filter->codec_ids[i])
157 break;
158 if (ctx->filter->codec_ids[i] == AV_CODEC_ID_NONE) {
159 const AVCodecDescriptor *desc = avcodec_descriptor_get(ctx->par_in->codec_id);
160 av_log(ctx, AV_LOG_ERROR, "Codec '%s' (%d) is not supported by the "
161 "bitstream filter '%s'. Supported codecs are: ",
162 desc ? desc->name : "unknown", ctx->par_in->codec_id, ctx->filter->name);
163 for (i = 0; ctx->filter->codec_ids[i] != AV_CODEC_ID_NONE; i++) {
164 enum AVCodecID codec_id = ctx->filter->codec_ids[i];
165 av_log(ctx, AV_LOG_ERROR, "%s (%d) ",
166 avcodec_get_name(codec_id), codec_id);
167 }
168 av_log(ctx, AV_LOG_ERROR, "\n");
169 return AVERROR(EINVAL);
170 }
171 }
172
173 /* initialize output parameters to be the same as input
174 * init below might overwrite that */
175 ret = avcodec_parameters_copy(ctx->par_out, ctx->par_in);
176 if (ret < 0)
177 return ret;
178
179 ctx->time_base_out = ctx->time_base_in;
180
181 if (ff_bsf(ctx->filter)->init) {
182 ret = ff_bsf(ctx->filter)->init(ctx);
183 if (ret < 0)
184 return ret;
185 }
186
187 return 0;
188}
189
190void av_bsf_flush(AVBSFContext *ctx)
191{

Callers 14

LLVMFuzzerTestOneInputFunction · 0.85
extract_extradata_initFunction · 0.85
open_slaveFunction · 0.85
av1_read_headerFunction · 0.85
evc_read_headerFunction · 0.85
detect_stream_specificFunction · 0.85
bsf_initFunction · 0.85
ist_addFunction · 0.85
bsf_list_initFunction · 0.85
qsv_enc_initFunction · 0.85
mediacodec_init_bsfFunction · 0.85

Calls 5

avcodec_descriptor_getFunction · 0.85
av_logFunction · 0.85
avcodec_get_nameFunction · 0.85
avcodec_parameters_copyFunction · 0.85
ff_bsfFunction · 0.85

Tested by

no test coverage detected