Lines Matching defs:avctx
196 if (sti->parser && sti->avctx->codec_id != st->codecpar->codec_id) {
214 ret = avcodec_parameters_to_context(sti->avctx, st->codecpar);
663 AVRational codec_framerate = sti->avctx->framerate;
677 av_assert0(sti->avctx->ticks_per_frame);
680 codec_framerate.num * (int64_t)sti->avctx->ticks_per_frame,
692 if (sti->avctx->ticks_per_frame > 1 && !pc)
698 frame_size = av_get_audio_frame_duration(sti->avctx, pkt->size);
699 sample_rate = sti->avctx->sample_rate;
721 if (sti->avctx->has_b_frames &&
722 avpriv_h264_has_num_reorder_frames(sti->avctx) == sti->avctx->has_b_frames)
725 if (sti->avctx->has_b_frames < 3)
727 else if (sti->avctx->has_b_frames < 4)
756 int delay = sti->avctx->has_b_frames;
800 int delay = ffstream(st)->avctx->has_b_frames;
922 if (!sti->avctx->has_b_frames)
979 && !sti->avctx->has_b_frames)
981 sti->avctx->has_b_frames = 1;
984 delay = sti->avctx->has_b_frames;
1152 len = av_parser_parse2(sti->parser, sti->avctx,
1194 if (sti->avctx->sample_rate > 0) {
1197 (AVRational) { 1, sti->avctx->sample_rate },
1280 if (avcodec_is_open(sti->avctx)) {
1282 avcodec_close(sti->avctx);
1287 if (sti->parser && sti->avctx->codec_id != st->codecpar->codec_id) {
1292 ret = avcodec_parameters_to_context(sti->avctx, st->codecpar);
1348 st->codecpar->sample_rate = sti->avctx->sample_rate;
1349 st->codecpar->bit_rate = sti->avctx->bit_rate;
1352 st->codecpar->channels = sti->avctx->ch_layout.nb_channels;
1353 st->codecpar->channel_layout = sti->avctx->ch_layout.order == AV_CHANNEL_ORDER_NATIVE ?
1354 sti->avctx->ch_layout.u.mask : 0;
1357 ret = av_channel_layout_copy(&st->codecpar->ch_layout, &sti->avctx->ch_layout);
1360 st->codecpar->codec_id = sti->avctx->codec_id;
1690 if (st->codecpar->bit_rate <= 0 && sti->avctx->bit_rate > 0)
1691 st->codecpar->bit_rate = sti->avctx->bit_rate;
1936 static int determinable_frame_size(const AVCodecContext *avctx)
1938 switch(avctx->codec_id) {
1952 const AVCodecContext *const avctx = sti->avctx;
1960 if ( avctx->codec_id == AV_CODEC_ID_NONE
1961 && avctx->codec_type != AVMEDIA_TYPE_DATA)
1963 switch (avctx->codec_type) {
1965 if (!avctx->frame_size && determinable_frame_size(avctx))
1968 avctx->sample_fmt == AV_SAMPLE_FMT_NONE)
1970 if (!avctx->sample_rate)
1972 if (!avctx->ch_layout.nb_channels)
1974 if (sti->info->found_decoder >= 0 && !sti->nb_decoded_frames && avctx->codec_id == AV_CODEC_ID_DTS)
1978 if (!avctx->width)
1984 if (sti->info->found_decoder >= 0 && avctx->pix_fmt == AV_PIX_FMT_NONE)
1991 if (avctx->codec_id == AV_CODEC_ID_HDMV_PGS_SUBTITLE && !avctx->width)
1995 if (avctx->codec_id == AV_CODEC_ID_NONE) return 1;
2006 AVCodecContext *const avctx = sti->avctx;
2018 if (!avcodec_is_open(avctx) &&
2040 ret = avcodec_open2(avctx, codec, options ? options : &thread_opt);
2044 sti->info->found_decoder = -avctx->codec_id;
2056 if (avpriv_codec_get_cap_skip_frame_fill_param(avctx->codec)) {
2058 skip_frame = avctx->skip_frame;
2059 avctx->skip_frame = AVDISCARD_ALL;
2066 (avctx->codec->capabilities & AV_CODEC_CAP_CHANNEL_CONF)))) {
2068 if (avctx->codec_type == AVMEDIA_TYPE_VIDEO ||
2069 avctx->codec_type == AVMEDIA_TYPE_AUDIO) {
2070 ret = avcodec_send_packet(avctx, &pkt);
2075 ret = avcodec_receive_frame(avctx, frame);
2080 } else if (avctx->codec_type == AVMEDIA_TYPE_SUBTITLE) {
2081 ret = avcodec_decode_subtitle2(avctx, &subtitle,
2097 avctx->skip_frame = skip_frame;
2262 if (tb_unreliable(sti->avctx) && sti->info->duration_count > 15 && sti->info->duration_gcd > FFMAX(1, st->time_base.den/(500LL*st->time_base.num)) && !st->r_frame_rate.num &&
2266 && tb_unreliable(sti->avctx)) {
2395 while (ret >= 0 && !sti->avctx->extradata) {
2406 sti->avctx->extradata = side_data->data;
2407 sti->avctx->extradata_size = side_data->size;
2419 static int add_coded_side_data(AVStream *st, AVCodecContext *avctx)
2421 for (int i = 0; i < avctx->nb_coded_side_data; i++) {
2422 const AVPacketSideData *const sd_src = &avctx->coded_side_data[i];
2476 AVCodecContext *const avctx = sti->avctx;
2482 if (!avctx->time_base.num)
2483 avctx->time_base = st->time_base;
2503 ret = avcodec_parameters_to_context(avctx, st->codecpar);
2526 if (codec && !avctx->codec)
2527 if (avcodec_open2(avctx, codec, options ? &options[i] : &thread_opt) < 0)
2540 AVCodecContext *avctx;
2563 if (!tb_unreliable(sti->avctx))
2580 if (sti->info->frame_delay_evidence && count < 2 && sti->avctx->has_b_frames == 0)
2582 if (!sti->avctx->extradata &&
2654 avctx = sti->avctx;
2656 ret = avcodec_parameters_to_context(avctx, st->codecpar);
2719 else if (avctx->codec_type == AVMEDIA_TYPE_SUBTITLE) limit = max_subtitle_analyze_duration;
2731 if (avctx->codec_type == AVMEDIA_TYPE_SUBTITLE && pkt->pts != AV_NOPTS_VALUE && st->start_time != AV_NOPTS_VALUE && pkt->pts >= st->start_time
2737 sti->info->codec_info_duration_fields += sti->parser && sti->need_parsing && avctx->ticks_per_frame == 2
2748 if (!sti->avctx->extradata) {
2776 AVCodecContext *const avctx = ffstream(st)->avctx;
2779 if (codec && !avctx->codec) {
2783 if (avcodec_open2(avctx, codec, (options && stream_index < orig_nb_streams) ? &options[stream_index] : &opts) < 0)
2826 AVCodecContext *const avctx = sti->avctx;
2828 if (avctx->codec_type == AVMEDIA_TYPE_VIDEO) {
2829 if (avctx->codec_id == AV_CODEC_ID_RAWVIDEO && !avctx->codec_tag && !avctx->bits_per_coded_sample) {
2830 uint32_t tag= avcodec_pix_fmt_to_codec_tag(avctx->pix_fmt);
2831 if (avpriv_pix_fmt_find(PIX_FMT_LIST_RAW, tag) == avctx->pix_fmt)
2832 avctx->codec_tag= tag;
2841 AVRational codec_frame_rate = avctx->framerate;
2878 if ( avctx->time_base.den * (int64_t) st->time_base.num
2879 <= avctx->time_base.num * (uint64_t)avctx->ticks_per_frame * st->time_base.den) {
2881 avctx->time_base.den, (int64_t)avctx->time_base.num * avctx->ticks_per_frame, INT_MAX);
2888 AVRational hw_ratio = { avctx->height, avctx->width };
2892 } else if (avctx->codec_type == AVMEDIA_TYPE_AUDIO) {
2893 if (!avctx->bits_per_coded_sample)
2894 avctx->bits_per_coded_sample =
2895 av_get_bits_per_sample(avctx->codec_id);
2897 switch (avctx->audio_service_type) {
2934 st->codecpar->format = sti->avctx->sample_fmt;
2935 ret = avcodec_parameters_to_context(sti->avctx, st->codecpar);
2941 avcodec_string(buf, sizeof(buf), sti->avctx, 0);
2961 ret = avcodec_parameters_from_context(st->codecpar, sti->avctx);
2964 ret = add_coded_side_data(st, sti->avctx);
2980 avcodec_close(sti->avctx);
2983 av_channel_layout_copy(&sti->avctx->ch_layout, &st->codecpar->ch_layout);