FFmpeg  4.0
Data Structures | Macros | Functions | Variables
libshine.c File Reference
#include <shine/layer3.h>
#include "libavutil/intreadwrite.h"
#include "audio_frame_queue.h"
#include "avcodec.h"
#include "internal.h"
#include "mpegaudio.h"
#include "mpegaudiodecheader.h"

Go to the source code of this file.

Data Structures

struct  SHINEContext
 

Macros

#define BUFFER_SIZE   (4096 * 20)
 

Functions

static av_cold int libshine_encode_init (AVCodecContext *avctx)
 
static int libshine_encode_frame (AVCodecContext *avctx, AVPacket *avpkt, const AVFrame *frame, int *got_packet_ptr)
 
static av_cold int libshine_encode_close (AVCodecContext *avctx)
 

Variables

static const int libshine_sample_rates []
 
AVCodec ff_libshine_encoder
 

Macro Definition Documentation

◆ BUFFER_SIZE

#define BUFFER_SIZE   (4096 * 20)

Definition at line 31 of file libshine.c.

Referenced by libshine_encode_frame().

Function Documentation

◆ libshine_encode_init()

static av_cold int libshine_encode_init ( AVCodecContext avctx)
static

Definition at line 41 of file libshine.c.

◆ libshine_encode_frame()

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

Definition at line 68 of file libshine.c.

◆ libshine_encode_close()

static av_cold int libshine_encode_close ( AVCodecContext avctx)
static

Definition at line 120 of file libshine.c.

Variable Documentation

◆ libshine_sample_rates

const int libshine_sample_rates[]
static
Initial value:
= {
44100, 48000, 32000, 0
}

Definition at line 129 of file libshine.c.

◆ ff_libshine_encoder

AVCodec ff_libshine_encoder
Initial value:
= {
.name = "libshine",
.long_name = NULL_IF_CONFIG_SMALL("libshine MP3 (MPEG audio layer 3)"),
.priv_data_size = sizeof(SHINEContext),
.capabilities = AV_CODEC_CAP_DELAY,
.supported_samplerates = libshine_sample_rates,
.channel_layouts = (const uint64_t[]) { AV_CH_LAYOUT_MONO,
0 },
.wrapper_name = "libshine",
}
static av_cold int init(AVCodecContext *avctx)
Definition: avrndec.c:35
#define AV_CH_LAYOUT_STEREO
#define AV_CODEC_CAP_DELAY
Encoder or decoder requires flushing with NULL input at the end in order to give the complete and cor...
Definition: avcodec.h:984
static av_cold int libshine_encode_close(AVCodecContext *avctx)
Definition: libshine.c:120
#define NULL_IF_CONFIG_SMALL(x)
Return NULL if CONFIG_SMALL is true, otherwise the argument without modification. ...
Definition: internal.h:186
preferred ID for decoding MPEG audio layer 1, 2 or 3
Definition: avcodec.h:552
static av_cold int libshine_encode_init(AVCodecContext *avctx)
Definition: libshine.c:41
AVSampleFormat
Audio sample formats.
Definition: samplefmt.h:58
static const int libshine_sample_rates[]
Definition: libshine.c:129
static enum AVSampleFormat sample_fmts[]
Definition: adpcmenc.c:701
static int libshine_encode_frame(AVCodecContext *avctx, AVPacket *avpkt, const AVFrame *frame, int *got_packet_ptr)
Definition: libshine.c:68
signed 16 bits, planar
Definition: samplefmt.h:67
#define AV_CH_LAYOUT_MONO

Definition at line 133 of file libshine.c.