Lines Matching defs:avctx
50 static av_cold int libgsm_decode_init(AVCodecContext *avctx) {
51 LibGSMDecodeContext *s = avctx->priv_data;
53 av_channel_layout_uninit(&avctx->ch_layout);
54 avctx->ch_layout = (AVChannelLayout)AV_CHANNEL_LAYOUT_MONO;
55 if (!avctx->sample_rate)
56 avctx->sample_rate = 8000;
57 avctx->sample_fmt = AV_SAMPLE_FMT_S16;
61 switch(avctx->codec_id) {
63 avctx->frame_size = GSM_FRAME_SIZE;
64 avctx->block_align = GSM_BLOCK_SIZE;
69 avctx->frame_size = 2 * GSM_FRAME_SIZE;
70 avctx->block_align = GSM_MS_BLOCK_SIZE;
77 static av_cold int libgsm_decode_close(AVCodecContext *avctx) {
78 LibGSMDecodeContext *s = avctx->priv_data;
85 static int libgsm_decode_frame(AVCodecContext *avctx, AVFrame *frame,
89 LibGSMDecodeContext *s = avctx->priv_data;
94 if (buf_size < avctx->block_align) {
95 av_log(avctx, AV_LOG_ERROR, "Packet is too small\n");
100 frame->nb_samples = avctx->frame_size;
101 if ((ret = ff_get_buffer(avctx, frame, 0)) < 0)
105 for (i = 0; i < avctx->frame_size / GSM_FRAME_SIZE; i++) {
114 return avctx->block_align;
117 static void libgsm_flush(AVCodecContext *avctx) {
118 LibGSMDecodeContext *s = avctx->priv_data;
123 if (avctx->codec_id == AV_CODEC_ID_GSM_MS)