Lines Matching refs:avf

39     AVFormatContext *avf;
89 AVFormatContext *avf;
125 AVFormatContext *avf = ctx->avf;
126 FifoContext *fifo = avf->priv_data;
127 AVFormatContext *avf2 = fifo->avf;
135 ret = ff_format_output_open(avf2, avf->url, &format_options);
137 av_log(avf, AV_LOG_ERROR, "Error opening %s: %s\n", avf->url,
164 AVFormatContext *avf = ctx->avf;
165 FifoContext *fifo = avf->priv_data;
166 AVFormatContext *avf2 = fifo->avf;
171 static int64_t next_duration(AVFormatContext *avf, AVPacket *pkt, int64_t *last_dts)
173 AVStream *st = avf->streams[pkt->stream_index];
182 AVFormatContext *avf = ctx->avf;
183 FifoContext *fifo = avf->priv_data;
184 AVFormatContext *avf2 = fifo->avf;
190 atomic_fetch_sub_explicit(&fifo->queue_duration, next_duration(avf, pkt, &ctx->last_received_dts), memory_order_relaxed);
195 av_log(avf, AV_LOG_VERBOSE, "Keyframe received, recovering...\n");
197 av_log(avf, AV_LOG_VERBOSE, "Dropping non-keyframe packet\n");
207 src_tb = avf->streams[s_idx]->time_base;
225 AVFormatContext *avf = ctx->avf;
226 FifoContext *fifo = avf->priv_data;
227 AVFormatContext *avf2 = fifo->avf;
296 AVFormatContext *avf = ctx->avf;
297 FifoContext *fifo = avf->priv_data;
300 av_log(avf, AV_LOG_INFO, "Recovery failed: %s\n",
305 av_log(avf, AV_LOG_WARNING, "Packet does not contain presentation"
314 av_log(avf, AV_LOG_ERROR,
327 AVFormatContext *avf = ctx->avf;
328 FifoContext *fifo = avf->priv_data;
349 AVRational tb = avf->streams[pkt->stream_index]->time_base;
367 av_log(avf, AV_LOG_VERBOSE, "Recovery attempt #%d/%d\n",
370 av_log(avf, AV_LOG_VERBOSE, "Recovery attempt #%d\n",
385 av_log(avf, AV_LOG_INFO, "Recovery successful\n");
398 AVFormatContext *avf = ctx->avf;
399 FifoContext *fifo = avf->priv_data;
424 AVFormatContext *avf = data;
425 FifoContext *fifo = avf->priv_data;
432 fifo_thread_ctx.avf = avf;
465 av_log(avf, AV_LOG_INFO, "FIFO queue flushed\n");
483 static int fifo_mux_init(AVFormatContext *avf, const AVOutputFormat *oformat,
486 FifoContext *fifo = avf->priv_data;
494 fifo->avf = avf2;
496 avf2->interrupt_callback = avf->interrupt_callback;
497 avf2->max_delay = avf->max_delay;
498 ret = av_dict_copy(&avf2->metadata, avf->metadata, 0);
501 avf2->opaque = avf->opaque;
502 avf2->io_close = avf->io_close;
503 avf2->io_close2 = avf->io_close2;
504 avf2->io_open = avf->io_open;
505 avf2->flags = avf->flags;
507 for (i = 0; i < avf->nb_streams; ++i) {
512 ret = ff_stream_encode_params_copy(st, avf->streams[i]);
520 static int fifo_init(AVFormatContext *avf)
522 FifoContext *fifo = avf->priv_data;
527 av_log(avf, AV_LOG_ERROR, "recovery_wait_streamtime can be turned on"
534 oformat = av_guess_format(fifo->format, avf->url, NULL);
540 ret = fifo_mux_init(avf, oformat, avf->url);
559 static int fifo_write_header(AVFormatContext *avf)
561 FifoContext * fifo = avf->priv_data;
564 ret = pthread_create(&fifo->writer_thread, NULL, fifo_consumer_thread, avf);
566 av_log(avf, AV_LOG_ERROR, "Failed to start thread: %s\n",
574 static int fifo_write_packet(AVFormatContext *avf, AVPacket *pkt)
576 FifoContext *fifo = avf->priv_data;
601 av_log(avf, AV_LOG_WARNING, "FIFO queue full\n");
609 atomic_fetch_add_explicit(&fifo->queue_duration, next_duration(avf, pkt, &fifo->last_sent_dts), memory_order_relaxed);
618 static int fifo_write_trailer(AVFormatContext *avf)
620 FifoContext *fifo= avf->priv_data;
648 av_log(avf, AV_LOG_ERROR, "pthread join error: %s\n",
657 static void fifo_deinit(AVFormatContext *avf)
659 FifoContext *fifo = avf->priv_data;
661 avformat_free_context(fifo->avf);