FFmpeg
Data Structures | Macros | Functions | Variables
libshine.c File Reference
#include <shine/layer3.h>
#include "libavutil/channel_layout.h"
#include "libavutil/intreadwrite.h"
#include "audio_frame_queue.h"
#include "avcodec.h"
#include "codec_internal.h"
#include "encode.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 []
 
const FFCodec ff_libshine_encoder
 

Macro Definition Documentation

◆ BUFFER_SIZE

#define BUFFER_SIZE   (4096 * 20)

Definition at line 33 of file libshine.c.

Function Documentation

◆ libshine_encode_init()

static av_cold int libshine_encode_init ( AVCodecContext avctx)
static

Definition at line 43 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 65 of file libshine.c.

◆ libshine_encode_close()

static av_cold int libshine_encode_close ( AVCodecContext avctx)
static

Definition at line 116 of file libshine.c.

Variable Documentation

◆ libshine_sample_rates

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

Definition at line 125 of file libshine.c.

◆ ff_libshine_encoder

const FFCodec ff_libshine_encoder
Initial value:
= {
.p.name = "libshine",
CODEC_LONG_NAME("libshine MP3 (MPEG audio layer 3)"),
.p.type = AVMEDIA_TYPE_AUDIO,
.p.id = AV_CODEC_ID_MP3,
.p.capabilities = AV_CODEC_CAP_DR1 | AV_CODEC_CAP_DELAY,
.priv_data_size = sizeof(SHINEContext),
.p.sample_fmts = (const enum AVSampleFormat[]){ AV_SAMPLE_FMT_S16P,
.p.supported_samplerates = libshine_sample_rates,
.p.ch_layouts = (const AVChannelLayout[]) { AV_CHANNEL_LAYOUT_MONO,
{ 0 },
},
.p.wrapper_name = "libshine",
}

Definition at line 129 of file libshine.c.

libshine_encode_init
static av_cold int libshine_encode_init(AVCodecContext *avctx)
Definition: libshine.c:43
AV_CHANNEL_LAYOUT_STEREO
#define AV_CHANNEL_LAYOUT_STEREO
Definition: channel_layout.h:393
libshine_encode_close
static av_cold int libshine_encode_close(AVCodecContext *avctx)
Definition: libshine.c:116
FF_CODEC_CAP_NOT_INIT_THREADSAFE
#define FF_CODEC_CAP_NOT_INIT_THREADSAFE
The codec is not known to be init-threadsafe (i.e.
Definition: codec_internal.h:35
AV_CODEC_ID_MP3
@ AV_CODEC_ID_MP3
preferred ID for decoding MPEG audio layer 1, 2 or 3
Definition: codec_id.h:447
FF_CODEC_ENCODE_CB
#define FF_CODEC_ENCODE_CB(func)
Definition: codec_internal.h:320
SHINEContext
Definition: libshine.c:35
libshine_sample_rates
static const int libshine_sample_rates[]
Definition: libshine.c:125
AVMEDIA_TYPE_AUDIO
@ AVMEDIA_TYPE_AUDIO
Definition: avutil.h:202
CODEC_LONG_NAME
#define CODEC_LONG_NAME(str)
Definition: codec_internal.h:296
init
int(* init)(AVBSFContext *ctx)
Definition: dts2pts.c:368
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:317
AV_SAMPLE_FMT_NONE
@ AV_SAMPLE_FMT_NONE
Definition: samplefmt.h:56
AV_SAMPLE_FMT_S16P
@ AV_SAMPLE_FMT_S16P
signed 16 bits, planar
Definition: samplefmt.h:64
AVSampleFormat
AVSampleFormat
Audio sample formats.
Definition: samplefmt.h:55
libshine_encode_frame
static int libshine_encode_frame(AVCodecContext *avctx, AVPacket *avpkt, const AVFrame *frame, int *got_packet_ptr)
Definition: libshine.c:65
AV_CODEC_CAP_DELAY
#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: codec.h:76
AV_CHANNEL_LAYOUT_MONO
#define AV_CHANNEL_LAYOUT_MONO
Definition: channel_layout.h:392