FFmpeg
Data Structures | Macros | Functions | Variables
audio_fifo.c File Reference
#include "config.h"
#include <stdlib.h>
#include <stdio.h>
#include <inttypes.h>
#include "libavutil/mem.h"
#include "libavutil/audio_fifo.c"

Go to the source code of this file.

Data Structures

struct  TestStruct
 

Macros

#define MAX_CHANNELS   32
 

Functions

static void free_data_planes (AVAudioFifo *afifo, void **output_data)
 
static void ERROR (const char *str)
 
static void print_audio_bytes (const TestStruct *test_sample, void **data_planes, int nb_samples)
 
static int read_samples_from_audio_fifo (AVAudioFifo *afifo, void ***output, int nb_samples)
 
static int write_samples_to_audio_fifo (AVAudioFifo *afifo, const TestStruct *test_sample, int nb_samples, int offset)
 
static void test_function (const TestStruct *test_sample)
 
int main (void)
 

Variables

static const uint8_t data_U8 [] = {0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11 }
 
static const int16_t data_S16 [] = {0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11 }
 
static const float data_FLT [] = {0.0, 1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0, 9.0, 10.0, 11.0}
 
static const TestStruct test_struct []
 

Macro Definition Documentation

◆ MAX_CHANNELS

#define MAX_CHANNELS   32

Definition at line 26 of file audio_fifo.c.

Function Documentation

◆ free_data_planes()

static void free_data_planes ( AVAudioFifo afifo,
void **  output_data 
)
static

Definition at line 49 of file audio_fifo.c.

Referenced by read_samples_from_audio_fifo(), and test_function().

◆ ERROR()

static void ERROR ( const char *  str)
static

Definition at line 58 of file audio_fifo.c.

Referenced by main(), read_samples_from_audio_fifo(), and test_function().

◆ print_audio_bytes()

static void print_audio_bytes ( const TestStruct test_sample,
void **  data_planes,
int  nb_samples 
)
static

Definition at line 64 of file audio_fifo.c.

Referenced by test_function().

◆ read_samples_from_audio_fifo()

static int read_samples_from_audio_fifo ( AVAudioFifo afifo,
void ***  output,
int  nb_samples 
)
static

Definition at line 84 of file audio_fifo.c.

Referenced by test_function().

◆ write_samples_to_audio_fifo()

static int write_samples_to_audio_fifo ( AVAudioFifo afifo,
const TestStruct test_sample,
int  nb_samples,
int  offset 
)
static

Definition at line 106 of file audio_fifo.c.

Referenced by test_function().

◆ test_function()

static void test_function ( const TestStruct test_sample)
static

Definition at line 127 of file audio_fifo.c.

Referenced by main().

◆ main()

int main ( void  )

Definition at line 192 of file audio_fifo.c.

Variable Documentation

◆ data_U8

const uint8_t data_U8[] = {0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11 }
static

Definition at line 36 of file audio_fifo.c.

◆ data_S16

const int16_t data_S16[] = {0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11 }
static

Definition at line 37 of file audio_fifo.c.

◆ data_FLT

const float data_FLT[] = {0.0, 1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0, 9.0, 10.0, 11.0}
static

Definition at line 38 of file audio_fifo.c.

◆ test_struct

const TestStruct test_struct[]
static
Initial value:
= {
{.format = AV_SAMPLE_FMT_U8 , .nb_ch = 1, .data_planes = {data_U8 , }, .nb_samples_pch = 12},
{.format = AV_SAMPLE_FMT_U8P , .nb_ch = 2, .data_planes = {data_U8 , data_U8 +6, }, .nb_samples_pch = 6 },
{.format = AV_SAMPLE_FMT_S16 , .nb_ch = 1, .data_planes = {data_S16, }, .nb_samples_pch = 12},
{.format = AV_SAMPLE_FMT_S16P , .nb_ch = 2, .data_planes = {data_S16, data_S16+6, }, .nb_samples_pch = 6 },
{.format = AV_SAMPLE_FMT_FLT , .nb_ch = 1, .data_planes = {data_FLT, }, .nb_samples_pch = 12},
{.format = AV_SAMPLE_FMT_FLTP , .nb_ch = 2, .data_planes = {data_FLT, data_FLT+6, }, .nb_samples_pch = 6 }
}

Definition at line 40 of file audio_fifo.c.

Referenced by main().

AV_SAMPLE_FMT_FLTP
@ AV_SAMPLE_FMT_FLTP
float, planar
Definition: samplefmt.h:69
AV_SAMPLE_FMT_U8P
@ AV_SAMPLE_FMT_U8P
unsigned 8 bits, planar
Definition: samplefmt.h:66
AV_SAMPLE_FMT_S16P
@ AV_SAMPLE_FMT_S16P
signed 16 bits, planar
Definition: samplefmt.h:67
data_U8
static const uint8_t data_U8[]
Definition: audio_fifo.c:36
AV_SAMPLE_FMT_U8
@ AV_SAMPLE_FMT_U8
unsigned 8 bits
Definition: samplefmt.h:60
AV_SAMPLE_FMT_S16
@ AV_SAMPLE_FMT_S16
signed 16 bits
Definition: samplefmt.h:61
data_FLT
static const float data_FLT[]
Definition: audio_fifo.c:38
data_S16
static const int16_t data_S16[]
Definition: audio_fifo.c:37
AV_SAMPLE_FMT_FLT
@ AV_SAMPLE_FMT_FLT
float
Definition: samplefmt.h:63