Lines Matching defs:oc
90 static void add_stream(OutputStream *ost, AVFormatContext *oc,
104 ost->st = avformat_new_stream(oc, *codec);
109 ost->st->id = oc->nb_streams-1;
154 if (oc->oformat->flags & AVFMT_GLOBALHEADER)
165 static void open_audio(AVFormatContext *oc, AVCodec *codec, OutputStream *ost)
280 static int write_audio_frame(AVFormatContext *oc, OutputStream *ost)
326 ret = write_frame(oc, &c->time_base, ost->st, &pkt);
363 static void open_video(AVFormatContext *oc, AVCodec *codec, OutputStream *ost)
466 static int write_video_frame(AVFormatContext *oc, OutputStream *ost)
477 if (oc->oformat->flags & AVFMT_RAWPICTURE) {
493 ret = av_interleaved_write_frame(oc, &pkt);
506 ret = write_frame(oc, &c->time_base, ost->st, &pkt);
520 static void close_stream(AVFormatContext *oc, OutputStream *ost)
536 AVFormatContext *oc;
559 avformat_alloc_output_context2(&oc, NULL, NULL, filename);
560 if (!oc) {
562 avformat_alloc_output_context2(&oc, NULL, "mpeg", filename);
564 if (!oc)
567 fmt = oc->oformat;
572 add_stream(&video_st, oc, &video_codec, fmt->video_codec);
577 add_stream(&audio_st, oc, &audio_codec, fmt->audio_codec);
585 open_video(oc, video_codec, &video_st);
588 open_audio(oc, audio_codec, &audio_st);
590 av_dump_format(oc, 0, filename, 1);
594 ret = avio_open(&oc->pb, filename, AVIO_FLAG_WRITE);
603 ret = avformat_write_header(oc, NULL);
615 encode_video = !write_video_frame(oc, &video_st);
617 encode_audio = !write_audio_frame(oc, &audio_st);
625 av_write_trailer(oc);
629 close_stream(oc, &video_st);
631 close_stream(oc, &audio_st);
635 avio_close(oc->pb);
638 avformat_free_context(oc);