Lines Matching defs:avccontext
206 static void create_vorbis_context(vorbis_enc_context * venc, AVCodecContext * avccontext) {
212 venc->channels = avccontext->channels;
213 venc->sample_rate = avccontext->sample_rate;
894 static av_cold int vorbis_encode_init(AVCodecContext * avccontext)
896 vorbis_enc_context * venc = avccontext->priv_data;
898 if (avccontext->channels != 2) {
899 av_log(avccontext, AV_LOG_ERROR, "Current FFmpeg Vorbis encoder only supports 2 channels.\n");
903 create_vorbis_context(venc, avccontext);
905 if (avccontext->flags & CODEC_FLAG_QSCALE)
906 venc->quality = avccontext->global_quality / (float)FF_QP2LAMBDA / 10.;
911 avccontext->extradata_size = put_main_header(venc, (uint8_t**)&avccontext->extradata);
913 avccontext->frame_size = 1 << (venc->log2_blocksize[0] - 1);
915 avccontext->coded_frame = avcodec_alloc_frame();
916 avccontext->coded_frame->key_frame = 1;
921 static int vorbis_encode_frame(AVCodecContext * avccontext, unsigned char * packets, int buf_size, void *data)
923 vorbis_enc_context * venc = avccontext->priv_data;
925 int samples = data ? avccontext->frame_size : 0;
972 avccontext->coded_frame->pts = venc->sample_count;
973 venc->sample_count += avccontext->frame_size;
979 static av_cold int vorbis_encode_close(AVCodecContext * avccontext)
981 vorbis_enc_context * venc = avccontext->priv_data;
1033 av_freep(&avccontext->coded_frame);
1034 av_freep(&avccontext->extradata);