Lines Matching defs:avctx
43 static av_cold int libshine_encode_init(AVCodecContext *avctx)
45 SHINEContext *s = avctx->priv_data;
47 if (avctx->ch_layout.nb_channels <= 0 || avctx->ch_layout.nb_channels > 2){
48 av_log(avctx, AV_LOG_ERROR, "only mono or stereo is supported\n");
53 if (avctx->bit_rate)
54 s->config.mpeg.bitr = avctx->bit_rate / 1000;
55 s->config.mpeg.mode = avctx->ch_layout.nb_channels == 2 ? STEREO : MONO;
56 s->config.wave.samplerate = avctx->sample_rate;
57 s->config.wave.channels = avctx->ch_layout.nb_channels == 2 ? PCM_STEREO : PCM_MONO;
59 av_log(avctx, AV_LOG_ERROR, "invalid configuration\n");
65 avctx->frame_size = shine_samples_per_pass(s->shine);
66 ff_af_queue_init(avctx, &s->afq);
70 static int libshine_encode_frame(AVCodecContext *avctx, AVPacket *avpkt,
73 SHINEContext *s = avctx->priv_data;
87 av_log(avctx, AV_LOG_ERROR, "internal buffer too small\n");
101 av_log(avctx, AV_LOG_ERROR, "free format output not supported\n");
107 if ((ret = ff_get_encode_buffer(avctx, avpkt, len, 0)))
113 ff_af_queue_remove(&s->afq, avctx->frame_size, &avpkt->pts,
121 static av_cold int libshine_encode_close(AVCodecContext *avctx)
123 SHINEContext *s = avctx->priv_data;