Lines Matching defs:avctx

30  * 34-byte streaminfo structure through avctx->extradata[_size] followed
55 AVCodecContext *avctx; ///< parent AVCodecContext
75 enum AVSampleFormat req = s->avctx->request_sample_fmt;
82 s->avctx->sample_fmt = AV_SAMPLE_FMT_S32P;
84 s->avctx->sample_fmt = AV_SAMPLE_FMT_S32;
88 s->avctx->sample_fmt = AV_SAMPLE_FMT_S16P;
90 s->avctx->sample_fmt = AV_SAMPLE_FMT_S16;
95 static av_cold int flac_decode_init(AVCodecContext *avctx)
100 FLACContext *s = avctx->priv_data;
101 s->avctx = avctx;
105 if (!avctx->extradata)
108 if (!ff_flac_is_extradata_valid(avctx, &format, &streaminfo))
112 ret = ff_flac_parse_streaminfo(avctx, &s->flac_stream_info, streaminfo);
119 ff_flacdsp_init(&s->dsp, avctx->sample_fmt,
126 static void dump_headers(AVCodecContext *avctx, FLACStreaminfo *s)
128 av_log(avctx, AV_LOG_DEBUG, " Max Blocksize: %d\n", s->max_blocksize);
129 av_log(avctx, AV_LOG_DEBUG, " Max Framesize: %d\n", s->max_framesize);
130 av_log(avctx, AV_LOG_DEBUG, " Samplerate: %d\n", s->samplerate);
131 av_log(avctx, AV_LOG_DEBUG, " Channels: %d\n", s->channels);
132 av_log(avctx, AV_LOG_DEBUG, " Bits: %d\n", s->bps);
180 ret = ff_flac_parse_streaminfo(s->avctx, &s->flac_stream_info, &buf[8]);
187 ff_flacdsp_init(&s->dsp, s->avctx->sample_fmt,
239 av_log(s->avctx, AV_LOG_ERROR, "illegal residual coding method %d\n",
245 av_log(s->avctx, AV_LOG_ERROR, "invalid rice order: %i blocksize %i\n",
251 av_log(s->avctx, AV_LOG_ERROR, "invalid predictor order: %i > %i\n",
267 av_log(s->avctx, AV_LOG_ERROR, "invalid residual\n");
327 av_log(s->avctx, AV_LOG_ERROR, "illegal pred order %d\n", pred_order);
375 av_log(s->avctx, AV_LOG_ERROR, "invalid coeff precision\n");
380 av_log(s->avctx, AV_LOG_ERROR, "qlevel %d not supported, maybe buggy stream\n",
421 av_log(s->avctx, AV_LOG_ERROR, "invalid subframe padding\n");
431 av_log(s->avctx, AV_LOG_ERROR,
440 avpriv_report_missing_feature(s->avctx, "Decorrelated bit depth > 32");
459 av_log(s->avctx, AV_LOG_ERROR, "invalid coding type\n");
478 if ((ret = ff_flac_decode_frame_header(s->avctx, gb, &fi, 0)) < 0) {
479 av_log(s->avctx, AV_LOG_ERROR, "invalid frame header\n");
487 ff_flac_set_channel_layout(s->avctx, fi.channels);
493 ff_flac_set_channel_layout(s->avctx, fi.channels);
497 av_log(s->avctx, AV_LOG_ERROR, "bps not found in STREAMINFO or frame header\n");
503 av_log(s->avctx, AV_LOG_ERROR, "switching bps mid-stream is not "
509 s->flac_stream_info.bps = s->avctx->bits_per_raw_sample = fi.bps;
516 av_log(s->avctx, AV_LOG_ERROR, "blocksize %d > %d\n", fi.blocksize,
523 av_log(s->avctx, AV_LOG_ERROR, "sample rate not found in STREAMINFO"
529 s->flac_stream_info.samplerate = s->avctx->sample_rate = fi.samplerate;
536 dump_headers(s->avctx, &s->flac_stream_info);
538 ff_flacdsp_init(&s->dsp, s->avctx->sample_fmt,
541 // dump_headers(s->avctx, &s->flac_stream_info);
557 static int flac_decode_frame(AVCodecContext *avctx, AVFrame *frame,
562 FLACContext *s = avctx->priv_data;
575 av_log(s->avctx, AV_LOG_DEBUG, "skipping flac header packet 1\n");
580 av_log(s->avctx, AV_LOG_DEBUG, "skipping vorbis comment\n");
593 av_log(s->avctx, AV_LOG_ERROR, "invalid header\n");
603 av_log(s->avctx, AV_LOG_ERROR, "decode_frame() failed\n");
608 if ((s->avctx->err_recognition & (AV_EF_CRCCHECK|AV_EF_COMPLIANT)) &&
611 av_log(s->avctx, AV_LOG_ERROR, "CRC error at PTS %"PRId64"\n", avpkt->pts);
612 if (s->avctx->err_recognition & AV_EF_EXPLODE)
618 if ((ret = ff_thread_get_buffer(avctx, frame, 0)) < 0)
626 av_log(s->avctx, AV_LOG_ERROR, "overread: %d\n", bytes_read - buf_size);
630 av_log(s->avctx, AV_LOG_DEBUG, "underread: %d orig size: %d\n",
639 static av_cold int flac_decode_close(AVCodecContext *avctx)
641 FLACContext *s = avctx->priv_data;