Lines Matching defs:ifile

2474 static void show_packet(WriterContext *w, InputFile *ifile, AVPacket *pkt, int packet_idx)
2477 AVStream *st = ifile->streams[pkt->stream_index].st;
2705 InputFile *ifile,
2709 AVFormatContext *fmt_ctx = ifile->fmt_ctx;
2710 AVCodecContext *dec_ctx = ifile->streams[pkt->stream_index].dec_ctx;
2711 AVCodecParameters *par = ifile->streams[pkt->stream_index].st->codecpar;
2758 show_subtitle(w, &sub, ifile->streams[pkt->stream_index].st, fmt_ctx);
2760 show_frame(w, frame, ifile->streams[pkt->stream_index].st, fmt_ctx);
2791 static int read_interval_packets(WriterContext *w, InputFile *ifile,
2794 AVFormatContext *fmt_ctx = ifile->fmt_ctx;
2846 AVRational tb = ifile->streams[pkt->stream_index].st->time_base;
2871 show_packet(w, ifile, pkt, i++);
2876 while (process_frame(w, ifile, frame, pkt, &packet_new) > 0);
2886 while (process_frame(w, ifile, frame, pkt, &(int){1}) > 0);
2887 if (ifile->streams[i].dec_ctx)
2888 avcodec_flush_buffers(ifile->streams[i].dec_ctx);
2902 static int read_packets(WriterContext *w, InputFile *ifile)
2904 AVFormatContext *fmt_ctx = ifile->fmt_ctx;
2910 ret = read_interval_packets(w, ifile, &interval, &cur_ts);
2913 ret = read_interval_packets(w, ifile, &read_intervals[i], &cur_ts);
3143 static int show_streams(WriterContext *w, InputFile *ifile)
3145 AVFormatContext *fmt_ctx = ifile->fmt_ctx;
3149 for (i = 0; i < ifile->nb_streams; i++)
3151 ret = show_stream(w, fmt_ctx, i, &ifile->streams[i], 0);
3160 static int show_program(WriterContext *w, InputFile *ifile, AVProgram *program)
3162 AVFormatContext *fmt_ctx = ifile->fmt_ctx;
3179 ret = show_stream(w, fmt_ctx, program->stream_index[i], &ifile->streams[program->stream_index[i]], 1);
3191 static int show_programs(WriterContext *w, InputFile *ifile)
3193 AVFormatContext *fmt_ctx = ifile->fmt_ctx;
3201 ret = show_program(w, ifile, program);
3209 static int show_chapters(WriterContext *w, InputFile *ifile)
3211 AVFormatContext *fmt_ctx = ifile->fmt_ctx;
3234 static int show_format(WriterContext *w, InputFile *ifile)
3236 AVFormatContext *fmt_ctx = ifile->fmt_ctx;
3279 static int open_input_file(InputFile *ifile, const char *filename,
3306 ifile->fmt_ctx = fmt_ctx;
3330 ifile->streams = av_calloc(fmt_ctx->nb_streams, sizeof(*ifile->streams));
3331 if (!ifile->streams)
3333 ifile->nb_streams = fmt_ctx->nb_streams;
3337 InputStream *ist = &ifile->streams[i];
3392 ifile->fmt_ctx = fmt_ctx;
3396 static void close_input_file(InputFile *ifile)
3401 for (i = 0; i < ifile->nb_streams; i++)
3402 avcodec_free_context(&ifile->streams[i].dec_ctx);
3404 av_freep(&ifile->streams);
3405 ifile->nb_streams = 0;
3407 avformat_close_input(&ifile->fmt_ctx);
3413 InputFile ifile = { 0 };
3420 ret = open_input_file(&ifile, filename, print_filename);
3426 nb_streams = ifile.fmt_ctx->nb_streams;
3427 REALLOCZ_ARRAY_STREAM(nb_streams_frames,0,ifile.fmt_ctx->nb_streams);
3428 REALLOCZ_ARRAY_STREAM(nb_streams_packets,0,ifile.fmt_ctx->nb_streams);
3429 REALLOCZ_ARRAY_STREAM(selected_streams,0,ifile.fmt_ctx->nb_streams);
3431 for (i = 0; i < ifile.fmt_ctx->nb_streams; i++) {
3433 ret = avformat_match_stream_specifier(ifile.fmt_ctx,
3434 ifile.fmt_ctx->streams[i],
3444 ifile.fmt_ctx->streams[i]->discard = AVDISCARD_ALL;
3457 ret = read_packets(wctx, &ifile);
3464 ret = show_programs(wctx, &ifile);
3469 ret = show_streams(wctx, &ifile);
3473 ret = show_chapters(wctx, &ifile);
3477 ret = show_format(wctx, &ifile);
3482 if (ifile.fmt_ctx)
3483 close_input_file(&ifile);