Lines Matching defs:codec
106 /* rescale output packet timestamp values from codec to stream timebase */
127 const AVCodec **codec,
134 *codec = avcodec_find_encoder(codec_id);
135 if (!(*codec)) {
153 c = avcodec_alloc_context3(*codec);
160 switch ((*codec)->type) {
162 c->sample_fmt = (*codec)->sample_fmts ?
163 (*codec)->sample_fmts[0] : AV_SAMPLE_FMT_FLTP;
166 if ((*codec)->supported_samplerates) {
167 c->sample_rate = (*codec)->supported_samplerates[0];
168 for (i = 0; (*codec)->supported_samplerates[i]; i++) {
169 if ((*codec)->supported_samplerates[i] == 44100)
245 static void open_audio(AVFormatContext *oc, const AVCodec *codec,
257 ret = avcodec_open2(c, codec, &opt);
260 fprintf(stderr, "Could not open audio codec: %s\n", av_err2str(ret));
270 if (c->codec->capabilities & AV_CODEC_CAP_VARIABLE_FRAME_SIZE)
352 /* convert samples from native format to destination codec format, using the resampler */
409 static void open_video(AVFormatContext *oc, const AVCodec *codec,
418 /* open the codec */
419 ret = avcodec_open2(c, codec, &opt);
422 fprintf(stderr, "Could not open video codec: %s\n", av_err2str(ret));
491 * to the codec pixel format if needed */
634 /* Close each codec. */