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

Function write_frame

ffmpeg.c:587–617  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

585}
586
587static void write_frame(AVFormatContext *s, AVPacket *pkt, AVCodecContext *avctx, AVBitStreamFilterContext *bsfc){
588 int ret;
589
590 while(bsfc){
591 AVPacket new_pkt= *pkt;
592 int a= av_bitstream_filter_filter(bsfc, avctx, NULL,
593 &new_pkt.data, &new_pkt.size,
594 pkt->data, pkt->size,
595 pkt->flags & AV_PKT_FLAG_KEY);
596 if(a>0){
597 av_free_packet(pkt);
598 new_pkt.destruct= av_destruct_packet;
599 } else if(a<0){
600 fprintf(stderr, "%s failed for stream %d, codec %s",
601 bsfc->filter->name, pkt->stream_index,
602 avctx->codec ? avctx->codec->name : "copy");
603 print_error("", a);
604 if (exit_on_error)
605 av_exit(1);
606 }
607 *pkt= new_pkt;
608
609 bsfc= bsfc->next;
610 }
611
612 ret= av_interleaved_write_frame(s, pkt);
613 if(ret < 0){
614 print_error("av_interleaved_write_frame()", ret);
615 av_exit(1);
616 }
617}
618
619#define MAX_AUDIO_PACKET_SIZE (128 * 1024)
620

Callers 4

do_audio_outFunction · 0.85
do_subtitle_outFunction · 0.85
do_video_outFunction · 0.85
output_packetFunction · 0.85

Calls 5

av_free_packetFunction · 0.85
print_errorFunction · 0.85
av_exitFunction · 0.85

Tested by

no test coverage detected