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

Function bsf_init

fftools/ffmpeg_mux.c:577–609  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

575}
576
577static int bsf_init(MuxStream *ms)
578{
579 OutputStream *ost = &ms->ost;
580 AVBSFContext *ctx = ms->bsf_ctx;
581 int ret;
582
583 if (!ctx)
584 return avcodec_parameters_copy(ost->st->codecpar, ms->par_in);
585
586 ret = avcodec_parameters_copy(ctx->par_in, ms->par_in);
587 if (ret < 0)
588 return ret;
589
590 ctx->time_base_in = ost->st->time_base;
591
592 ret = av_bsf_init(ctx);
593 if (ret < 0) {
594 av_log(ms, AV_LOG_ERROR, "Error initializing bitstream filter: %s\n",
595 ctx->filter->name);
596 return ret;
597 }
598
599 ret = avcodec_parameters_copy(ost->st->codecpar, ctx->par_out);
600 if (ret < 0)
601 return ret;
602 ost->st->time_base = ctx->time_base_out;
603
604 ms->bsf_pkt = av_packet_alloc();
605 if (!ms->bsf_pkt)
606 return AVERROR(ENOMEM);
607
608 return 0;
609}
610
611int of_stream_init(OutputFile *of, OutputStream *ost,
612 const AVCodecContext *enc_ctx)

Callers 1

of_stream_initFunction · 0.85

Calls 4

avcodec_parameters_copyFunction · 0.85
av_bsf_initFunction · 0.85
av_logFunction · 0.85
av_packet_allocFunction · 0.85

Tested by

no test coverage detected