Lines Matching defs:ost
35 static void close_all_output_streams(OutputStream *ost, OSTFinished this_stream, OSTFinished others)
40 ost2->finished |= ost == ost2 ? this_stream : others;
44 void of_write_packet(OutputFile *of, AVPacket *pkt, OutputStream *ost,
48 AVStream *st = ost->st;
59 if (!(st->codecpar->codec_type == AVMEDIA_TYPE_VIDEO && ost->encoding_needed) && !unqueue) {
60 if (ost->frame_number >= ost->max_frames) {
64 ost->frame_number++;
70 if (!av_fifo_can_write(ost->muxing_queue)) {
71 size_t cur_size = av_fifo_can_read(ost->muxing_queue);
73 (ost->muxing_queue_data_size + pkt->size) > ost->muxing_queue_data_threshold;
74 size_t limit = are_we_over_size ? ost->max_muxing_queue_size : SIZE_MAX;
80 ost->file_index, ost->st->index);
83 ret = av_fifo_grow2(ost->muxing_queue, new_size - cur_size);
94 ost->muxing_queue_data_size += tmp_pkt->size;
95 av_fifo_write(ost->muxing_queue, &tmp_pkt, 1);
99 if ((st->codecpar->codec_type == AVMEDIA_TYPE_VIDEO && ost->vsync_method == VSYNC_DROP) ||
104 if (ost->frame_rate.num && ost->is_cfr) {
107 pkt->duration = av_rescale_q(1, av_inv_q(ost->frame_rate),
108 ost->mux_timebase);
112 av_packet_rescale_ts(pkt, ost->mux_timebase, ost->st->time_base);
120 ost->file_index, ost->st->index);
122 pkt->dts = pkt->pts + pkt->dts + ost->last_mux_dts + 1
123 - FFMIN3(pkt->pts, pkt->dts, ost->last_mux_dts + 1)
124 - FFMAX3(pkt->pts, pkt->dts, ost->last_mux_dts + 1);
128 ost->last_mux_dts != AV_NOPTS_VALUE) {
129 int64_t max = ost->last_mux_dts + !(s->oformat->flags & AVFMT_TS_NONSTRICT);
136 ost->file_index, ost->st->index, ost->last_mux_dts, pkt->dts);
150 ost->last_mux_dts = pkt->dts;
152 ost->data_size += pkt->size;
153 ost->packets_written++;
155 pkt->stream_index = ost->index;
160 av_get_media_type_string(ost->enc_ctx->codec_type),
161 av_ts2str(pkt->pts), av_ts2timestr(pkt->pts, &ost->st->time_base),
162 av_ts2str(pkt->dts), av_ts2timestr(pkt->dts, &ost->st->time_base),
163 av_ts2str(pkt->duration), av_ts2timestr(pkt->duration, &ost->st->time_base),
172 close_all_output_streams(ost, MUXER_FINISHED | ENCODER_FINISHED, ENCODER_FINISHED);
235 OutputStream *ost = output_streams[of->ost_index + i];
236 if (!ost->initialized)
264 OutputStream *ost = output_streams[of->ost_index + i];
268 if (!av_fifo_can_read(ost->muxing_queue))
269 ost->mux_timebase = ost->st->time_base;
271 while (av_fifo_read(ost->muxing_queue, &pkt, 1) >= 0) {
272 ost->muxing_queue_data_size -= pkt->size;
273 of_write_packet(of, pkt, ost, 1);