• Home
  • Raw
  • Download

Lines Matching refs:cat

112     ConcatContext *cat = avf->priv_data;  in add_file()  local
120 if (cat->safe > 0 && !safe_filename(filename)) { in add_file()
138 if (cat->nb_files >= *nb_files_alloc) { in add_file()
141 if (n <= cat->nb_files || n > SIZE_MAX / sizeof(*cat->files) || in add_file()
142 !(new_files = av_realloc(cat->files, n * sizeof(*cat->files)))) in add_file()
144 cat->files = new_files; in add_file()
148 file = &cat->files[cat->nb_files++]; in add_file()
196 ConcatContext *cat = avf->priv_data; in detect_stream_specific() local
197 AVStream *st = cat->avf->streams[idx]; in detect_stream_specific()
198 ConcatStream *cs = &cat->cur_file->streams[idx]; in detect_stream_specific()
203 if (cat->auto_convert && st->codecpar->codec_id == AV_CODEC_ID_H264) { in detect_stream_specific()
208 av_log(cat->avf, AV_LOG_INFO, in detect_stream_specific()
238 ConcatContext *cat = avf->priv_data; in match_streams_one_to_one() local
242 for (i = cat->cur_file->nb_streams; i < cat->avf->nb_streams; i++) { in match_streams_one_to_one()
249 if ((ret = copy_stream_props(st, cat->avf->streams[i])) < 0) in match_streams_one_to_one()
251 cat->cur_file->streams[i].out_stream_index = i; in match_streams_one_to_one()
258 ConcatContext *cat = avf->priv_data; in match_streams_exact_id() local
262 for (i = cat->cur_file->nb_streams; i < cat->avf->nb_streams; i++) { in match_streams_exact_id()
263 st = cat->avf->streams[i]; in match_streams_exact_id()
271 cat->cur_file->streams[i].out_stream_index = j; in match_streams_exact_id()
280 ConcatContext *cat = avf->priv_data; in match_streams() local
284 if (cat->cur_file->nb_streams >= cat->avf->nb_streams) in match_streams()
286 map = av_realloc(cat->cur_file->streams, in match_streams()
287 cat->avf->nb_streams * sizeof(*map)); in match_streams()
290 cat->cur_file->streams = map; in match_streams()
291 memset(map + cat->cur_file->nb_streams, 0, in match_streams()
292 (cat->avf->nb_streams - cat->cur_file->nb_streams) * sizeof(*map)); in match_streams()
294 for (i = cat->cur_file->nb_streams; i < cat->avf->nb_streams; i++) { in match_streams()
299 switch (cat->stream_match_mode) { in match_streams()
311 cat->cur_file->nb_streams = cat->avf->nb_streams; in match_streams()
330 ConcatContext *cat = avf->priv_data; in open_file() local
331 ConcatFile *file = &cat->files[fileno]; in open_file()
334 if (cat->avf) in open_file()
335 avformat_close_input(&cat->avf); in open_file()
337 cat->avf = avformat_alloc_context(); in open_file()
338 if (!cat->avf) in open_file()
341 cat->avf->flags |= avf->flags & ~AVFMT_FLAG_CUSTOM_IO; in open_file()
342 cat->avf->interrupt_callback = avf->interrupt_callback; in open_file()
344 if ((ret = ff_copy_whiteblacklists(cat->avf, avf)) < 0) in open_file()
347 if ((ret = avformat_open_input(&cat->avf, file->url, NULL, NULL)) < 0 || in open_file()
348 (ret = avformat_find_stream_info(cat->avf, NULL)) < 0) { in open_file()
350 avformat_close_input(&cat->avf); in open_file()
353 cat->cur_file = file; in open_file()
355 cat->files[fileno - 1].start_time + in open_file()
356 cat->files[fileno - 1].duration; in open_file()
357 file->file_start_time = (cat->avf->start_time == AV_NOPTS_VALUE) ? 0 : cat->avf->start_time; in open_file()
359 file->duration = get_best_effort_duration(file, cat->avf); in open_file()
361 if (cat->segment_time_metadata) { in open_file()
370 if ((ret = avformat_seek_file(cat->avf, -1, INT64_MIN, file->inpoint, file->inpoint, 0)) < 0) in open_file()
378 ConcatContext *cat = avf->priv_data; in concat_read_close() local
381 for (i = 0; i < cat->nb_files; i++) { in concat_read_close()
382 av_freep(&cat->files[i].url); in concat_read_close()
383 for (j = 0; j < cat->files[i].nb_streams; j++) { in concat_read_close()
384 if (cat->files[i].streams[j].bsf) in concat_read_close()
385 av_bsf_free(&cat->files[i].streams[j].bsf); in concat_read_close()
387 av_freep(&cat->files[i].streams); in concat_read_close()
388 av_dict_free(&cat->files[i].metadata); in concat_read_close()
390 if (cat->avf) in concat_read_close()
391 avformat_close_input(&cat->avf); in concat_read_close()
392 av_freep(&cat->files); in concat_read_close()
398 ConcatContext *cat = avf->priv_data; in concat_read_header() local
478 if (cat->safe < 0) in concat_read_header()
479 cat->safe = 1; in concat_read_header()
488 if (!cat->nb_files) in concat_read_header()
491 for (i = 0; i < cat->nb_files; i++) { in concat_read_header()
492 if (cat->files[i].start_time == AV_NOPTS_VALUE) in concat_read_header()
493 cat->files[i].start_time = time; in concat_read_header()
495 time = cat->files[i].start_time; in concat_read_header()
496 if (cat->files[i].user_duration == AV_NOPTS_VALUE) { in concat_read_header()
497 if (cat->files[i].inpoint == AV_NOPTS_VALUE || cat->files[i].outpoint == AV_NOPTS_VALUE) in concat_read_header()
499 cat->files[i].user_duration = cat->files[i].outpoint - cat->files[i].inpoint; in concat_read_header()
501 cat->files[i].duration = cat->files[i].user_duration; in concat_read_header()
502 time += cat->files[i].user_duration; in concat_read_header()
504 if (i == cat->nb_files) { in concat_read_header()
506 cat->seekable = 1; in concat_read_header()
509 cat->stream_match_mode = avf->nb_streams ? MATCH_EXACT_ID : in concat_read_header()
524 ConcatContext *cat = avf->priv_data; in open_next_file() local
525 unsigned fileno = cat->cur_file - cat->files; in open_next_file()
527 cat->cur_file->duration = get_best_effort_duration(cat->cur_file, cat->avf); in open_next_file()
529 if (++fileno >= cat->nb_files) { in open_next_file()
530 cat->eof = 1; in open_next_file()
561 static int packet_after_outpoint(ConcatContext *cat, AVPacket *pkt) in packet_after_outpoint() argument
563 if (cat->cur_file->outpoint != AV_NOPTS_VALUE && pkt->dts != AV_NOPTS_VALUE) { in packet_after_outpoint()
564 return av_compare_ts(pkt->dts, cat->avf->streams[pkt->stream_index]->time_base, in packet_after_outpoint()
565 cat->cur_file->outpoint, AV_TIME_BASE_Q) >= 0; in packet_after_outpoint()
572 ConcatContext *cat = avf->priv_data; in concat_read_packet() local
578 if (cat->eof) in concat_read_packet()
581 if (!cat->avf) in concat_read_packet()
585 ret = av_read_frame(cat->avf, pkt); in concat_read_packet()
596 if (packet_after_outpoint(cat, pkt)) { in concat_read_packet()
602 cs = &cat->cur_file->streams[pkt->stream_index]; in concat_read_packet()
612 st = cat->avf->streams[pkt->stream_index]; in concat_read_packet()
614 (unsigned)(cat->cur_file - cat->files), pkt->stream_index, in concat_read_packet()
618 delta = av_rescale_q(cat->cur_file->start_time - cat->cur_file->file_inpoint, in concat_read_packet()
620 cat->avf->streams[pkt->stream_index]->time_base); in concat_read_packet()
628 if (cat->cur_file->metadata) { in concat_read_packet()
630 char* packed_metadata = av_packet_pack_dictionary(cat->cur_file->metadata, &metadata_len); in concat_read_packet()
641 if (cat->cur_file->duration == AV_NOPTS_VALUE && st->cur_dts != AV_NOPTS_VALUE) { in concat_read_packet()
643 if (cat->cur_file->next_dts == AV_NOPTS_VALUE || next_dts > cat->cur_file->next_dts) { in concat_read_packet()
644 cat->cur_file->next_dts = next_dts; in concat_read_packet()
665 ConcatContext *cat = avf->priv_data; in try_seek() local
666 int64_t t0 = cat->cur_file->start_time - cat->cur_file->file_inpoint; in try_seek()
672 if (stream >= cat->avf->nb_streams) in try_seek()
674 rescale_interval(AV_TIME_BASE_Q, cat->avf->streams[stream]->time_base, in try_seek()
677 return avformat_seek_file(cat->avf, stream, min_ts, ts, max_ts, flags); in try_seek()
683 ConcatContext *cat = avf->priv_data; in real_seek() local
694 right = cat->nb_files; in real_seek()
699 else if (!cat->seekable) in real_seek()
704 if (ts < cat->files[mid].start_time) in real_seek()
710 if (cat->cur_file != &cat->files[left]) { in real_seek()
714 cat->avf = cur_avf; in real_seek()
719 left < cat->nb_files - 1 && in real_seek()
720 cat->files[left + 1].start_time < max_ts) { in real_seek()
721 if (cat->cur_file == &cat->files[left]) in real_seek()
722 cat->avf = NULL; in real_seek()
733 ConcatContext *cat = avf->priv_data; in concat_seek() local
734 ConcatFile *cur_file_saved = cat->cur_file; in concat_seek()
735 AVFormatContext *cur_avf_saved = cat->avf; in concat_seek()
740 cat->avf = NULL; in concat_seek()
742 if (cat->cur_file != cur_file_saved) { in concat_seek()
743 if (cat->avf) in concat_seek()
744 avformat_close_input(&cat->avf); in concat_seek()
746 cat->avf = cur_avf_saved; in concat_seek()
747 cat->cur_file = cur_file_saved; in concat_seek()
749 if (cat->cur_file != cur_file_saved) { in concat_seek()
752 cat->eof = 0; in concat_seek()