Lines Matching refs:avctx
40 static av_cold int roq_dpcm_encode_init(AVCodecContext *avctx)
42 ROQDPCMContext *context = avctx->priv_data;
44 if (avctx->channels > 2) {
45 av_log(avctx, AV_LOG_ERROR, "Audio must be mono or stereo\n");
48 if (avctx->sample_rate != 22050) {
49 av_log(avctx, AV_LOG_ERROR, "Audio must be 22050 Hz\n");
52 if (avctx->sample_fmt != AV_SAMPLE_FMT_S16) {
53 av_log(avctx, AV_LOG_ERROR, "Audio must be signed 16-bit\n");
57 avctx->frame_size = ROQ_FIRST_FRAME_SIZE;
61 avctx->coded_frame= avcodec_alloc_frame();
62 avctx->coded_frame->key_frame= 1;
107 static int roq_dpcm_encode_frame(AVCodecContext *avctx,
114 ROQDPCMContext *context = avctx->priv_data;
116 stereo = (avctx->channels == 2);
128 bytestream_put_le32(&out, avctx->frame_size*avctx->channels);
137 samples = avctx->frame_size;
139 for (ch=0; ch<avctx->channels; ch++)
143 avctx->frame_size = ROQ_FRAME_SIZE;
149 static av_cold int roq_dpcm_encode_close(AVCodecContext *avctx)
151 av_freep(&avctx->coded_frame);