FFmpeg
Data Structures | Functions | Variables
cngenc.c File Reference
#include <math.h>
#include "libavutil/avassert.h"
#include "libavutil/common.h"
#include "avcodec.h"
#include "codec_internal.h"
#include "encode.h"
#include "lpc.h"

Go to the source code of this file.

Data Structures

struct  CNGContext
 

Functions

static av_cold int cng_encode_close (AVCodecContext *avctx)
 
static av_cold int cng_encode_init (AVCodecContext *avctx)
 
static int cng_encode_frame (AVCodecContext *avctx, AVPacket *avpkt, const AVFrame *frame, int *got_packet_ptr)
 

Variables

const FFCodec ff_comfortnoise_encoder
 

Function Documentation

◆ cng_encode_close()

static av_cold int cng_encode_close ( AVCodecContext avctx)
static

Definition at line 38 of file cngenc.c.

◆ cng_encode_init()

static av_cold int cng_encode_init ( AVCodecContext avctx)
static

Definition at line 47 of file cngenc.c.

◆ cng_encode_frame()

static int cng_encode_frame ( AVCodecContext avctx,
AVPacket avpkt,
const AVFrame frame,
int got_packet_ptr 
)
static

Definition at line 64 of file cngenc.c.

Variable Documentation

◆ ff_comfortnoise_encoder

const FFCodec ff_comfortnoise_encoder
Initial value:
= {
.p.name = "comfortnoise",
CODEC_LONG_NAME("RFC 3389 comfort noise generator"),
.p.type = AVMEDIA_TYPE_AUDIO,
.priv_data_size = sizeof(CNGContext),
.close = cng_encode_close,
.p.sample_fmts = (const enum AVSampleFormat[]){ AV_SAMPLE_FMT_S16,
.p.ch_layouts = (const AVChannelLayout[]){ AV_CHANNEL_LAYOUT_MONO, { 0 } },
.caps_internal = FF_CODEC_CAP_INIT_CLEANUP,
}

Definition at line 100 of file cngenc.c.

FF_CODEC_CAP_INIT_CLEANUP
#define FF_CODEC_CAP_INIT_CLEANUP
The codec allows calling the close function for deallocation even if the init function returned a fai...
Definition: codec_internal.h:42
cng_encode_frame
static int cng_encode_frame(AVCodecContext *avctx, AVPacket *avpkt, const AVFrame *frame, int *got_packet_ptr)
Definition: cngenc.c:64
FF_CODEC_ENCODE_CB
#define FF_CODEC_ENCODE_CB(func)
Definition: codec_internal.h:296
AVMEDIA_TYPE_AUDIO
@ AVMEDIA_TYPE_AUDIO
Definition: avutil.h:202
AV_CODEC_CAP_ENCODER_REORDERED_OPAQUE
#define AV_CODEC_CAP_ENCODER_REORDERED_OPAQUE
This encoder can reorder user opaque values from input AVFrames and return them with corresponding ou...
Definition: codec.h:159
CODEC_LONG_NAME
#define CODEC_LONG_NAME(str)
Definition: codec_internal.h:272
CNGContext
Definition: cngdec.c:34
init
int(* init)(AVBSFContext *ctx)
Definition: dts2pts.c:365
AV_CODEC_CAP_DR1
#define AV_CODEC_CAP_DR1
Codec uses get_buffer() or get_encode_buffer() for allocating buffers and supports custom allocators.
Definition: codec.h:52
AVChannelLayout
An AVChannelLayout holds information about the channel layout of audio data.
Definition: channel_layout.h:303
AV_SAMPLE_FMT_NONE
@ AV_SAMPLE_FMT_NONE
Definition: samplefmt.h:56
AV_CODEC_ID_COMFORT_NOISE
@ AV_CODEC_ID_COMFORT_NOISE
Definition: codec_id.h:501
cng_encode_init
static av_cold int cng_encode_init(AVCodecContext *avctx)
Definition: cngenc.c:47
AVSampleFormat
AVSampleFormat
Audio sample formats.
Definition: samplefmt.h:55
AV_SAMPLE_FMT_S16
@ AV_SAMPLE_FMT_S16
signed 16 bits
Definition: samplefmt.h:58
cng_encode_close
static av_cold int cng_encode_close(AVCodecContext *avctx)
Definition: cngenc.c:38
AV_CHANNEL_LAYOUT_MONO
#define AV_CHANNEL_LAYOUT_MONO
Definition: channel_layout.h:378