Lines Matching refs:avf
40 AVFormatContext *avf;
120 AVFormatContext *avf;
125 avf = tee_slave->avf;
126 if (!avf)
130 ret = av_write_trailer(avf);
133 for (i = 0; i < avf->nb_streams; ++i)
139 ff_format_io_close(avf, &avf->pb);
140 avformat_free_context(avf);
141 tee_slave->avf = NULL;
145 static void close_slaves(AVFormatContext *avf)
147 TeeContext *tee = avf->priv_data;
156 static int open_slave(AVFormatContext *avf, char *slave, TeeSlave *tee_slave)
170 if ((ret = ff_tee_parse_slave_options(avf, slave, &options, &filename)) < 0)
190 av_log(avf, AV_LOG_ERROR, "Invalid onfail option value, "
194 av_log(avf, AV_LOG_ERROR, "Error parsing fifo options: %s\n",
235 tee_slave->avf = avf2;
236 av_dict_copy(&avf2->metadata, avf->metadata, 0);
237 avf2->opaque = avf->opaque;
238 avf2->io_open = avf->io_open;
239 avf2->io_close = avf->io_close;
240 avf2->io_close2 = avf->io_close2;
241 avf2->interrupt_callback = avf->interrupt_callback;
242 avf2->flags = avf->flags;
243 avf2->strict_std_compliance = avf->strict_std_compliance;
245 tee_slave->stream_map = av_calloc(avf->nb_streams, sizeof(*tee_slave->stream_map));
252 for (i = 0; i < avf->nb_streams; i++) {
253 st = avf->streams[i];
266 ret = avformat_match_stream_specifier(avf, avf->streams[i], subselect);
268 av_log(avf, AV_LOG_ERROR,
299 av_log(avf, AV_LOG_ERROR, "Slave '%s': error opening: %s\n", slave,
305 av_log(avf, AV_LOG_ERROR, "Slave '%s': error writing header: %s\n",
322 av_log(avf, AV_LOG_ERROR,
334 av_log(avf, AV_LOG_ERROR,
341 av_log(avf, AV_LOG_DEBUG, "spec:%s bsfs:%s matches stream %d of slave "
344 av_log(avf, AV_LOG_WARNING,
351 av_log(avf, AV_LOG_ERROR,
362 for (i = 0; i < avf->nb_streams; i++){
371 av_log(avf, AV_LOG_ERROR,
378 tee_slave->bsfs[target_stream]->time_base_in = avf->streams[i]->time_base;
380 avf->streams[i]->codecpar);
386 av_log(avf, AV_LOG_ERROR,
414 slave->avf->url, slave->avf->oformat->name);
415 for (i = 0; i < slave->avf->nb_streams; i++) {
416 AVStream *st = slave->avf->streams[i];
430 static int tee_process_slave_failure(AVFormatContext *avf, unsigned slave_idx, int err_n)
432 TeeContext *tee = avf->priv_data;
440 av_log(avf, AV_LOG_ERROR, "All tee outputs failed.\n");
443 av_log(avf, AV_LOG_ERROR, "Slave muxer #%u failed, aborting.\n", slave_idx);
446 av_log(avf, AV_LOG_ERROR, "Slave muxer #%u failed: %s, continuing with %u/%u slaves.\n",
452 static int tee_write_header(AVFormatContext *avf)
454 TeeContext *tee = avf->priv_data;
456 const char *filename = avf->url;
488 if ((ret = open_slave(avf, slaves[i], &tee->slaves[i])) < 0) {
489 ret = tee_process_slave_failure(avf, i, ret);
493 log_slave(&tee->slaves[i], avf, AV_LOG_VERBOSE);
498 for (i = 0; i < avf->nb_streams; i++) {
501 if (tee->slaves[j].avf)
504 av_log(avf, AV_LOG_WARNING, "Input stream #%d is not mapped "
513 close_slaves(avf);
518 static int tee_write_trailer(AVFormatContext *avf)
520 TeeContext *tee = avf->priv_data;
526 ret = tee_process_slave_failure(avf, i, ret);
535 static int tee_write_packet(AVFormatContext *avf, AVPacket *pkt)
537 TeeContext *tee = avf->priv_data;
540 AVPacket *const pkt2 = ffformatcontext(avf)->pkt;
546 if (!(avf2 = tee->slaves[i].avf))
553 ret = tee_process_slave_failure(avf, i, ret);
576 av_log(avf, AV_LOG_ERROR, "Error while sending packet to bitstream filter: %s\n",
578 ret = tee_process_slave_failure(avf, i, ret);
600 ret = tee_process_slave_failure(avf, i, ret);