libgpac
Documentation of the core library of GPAC
reframe_flac.c File Reference
#include <gpac/avparse.h>
#include <gpac/constants.h>
#include <gpac/filters.h>
+ Include dependency graph for reframe_flac.c:

Data Structures

struct  FLACIdx
 
struct  FLACHeader
 
struct  GF_FLACDmxCtx
 

Macros

#define FLAC_CHANNELS   8
 
#define FLAC_MID_SIDE   3
 
#define OFFS(_n)   #_n, offsetof(GF_FLACDmxCtx, _n)
 

Functions

GF_Err flac_dmx_configure_pid (GF_Filter *filter, GF_FilterPid *pid, Bool is_remove)
 
static void flac_dmx_check_dur (GF_Filter *filter, GF_FLACDmxCtx *ctx)
 
static u64 flac_channel_layout (u32 in_lay)
 
static void flac_dmx_check_pid (GF_Filter *filter, GF_FLACDmxCtx *ctx, u8 *dsi, u32 dsi_size)
 
static Bool flac_dmx_process_event (GF_Filter *filter, const GF_FilterEvent *evt)
 
static GFINLINE void flac_dmx_update_cts (GF_FLACDmxCtx *ctx, u32 nb_samp)
 
u8 flac_dmx_crc8 (u8 *data, u32 len)
 
static u32 flac_dmx_crc16 (const u8 *data, u32 len)
 
static Bool flac_parse_header (GF_FLACDmxCtx *ctx, char *data, u32 size, FLACHeader *hdr)
 
GF_Err flac_dmx_process (GF_Filter *filter)
 
static GF_Err flac_dmx_initialize (GF_Filter *filter)
 
static void flac_dmx_finalize (GF_Filter *filter)
 
static const char * flac_dmx_probe_data (const u8 *data, u32 size, GF_FilterProbeScore *score)
 
const GF_FilterRegister * rfflac_register (GF_FilterSession *session)
 

Variables

u8 const flac_dmx_crc8_table [256]
 
static const u32 flac_dmx_crc16_table [256]
 
static u32 flac_dmx_block_sizes []
 
static u32 flac_dmx_samplerates []
 
static const GF_FilterCapability FLACDmxCaps []
 
static const GF_FilterArgs FLACDmxArgs []
 
GF_FilterRegister FLACDmxRegister
 

Data Structure Documentation

◆ FLACIdx

struct FLACIdx
Data Fields
u64 pos
Double duration

◆ FLACHeader

struct FLACHeader
Data Fields
u32 block_size
u32 sample_rate
u32 channels

◆ GF_FLACDmxCtx

struct GF_FLACDmxCtx
+ Collaboration diagram for GF_FLACDmxCtx:
Data Fields
Double index
Bool docrc
GF_FilterPid * ipid
GF_FilterPid * opid
GF_BitStream * bs
u64 file_pos
u64 cts
u64 prev_cts
GF_Fraction64 duration
Double start_range
Bool in_seek
u32 timescale
Bool is_playing
Bool is_file
Bool initial_play_done
Bool file_loaded
Bool in_error
Bool initialized
u32 sample_rate
u32 nb_channels
u32 bits_per_sample
u32 block_size
u32 ch_layout
u8 * flac_buffer
u32 flac_buffer_size
u32 flac_buffer_alloc
u32 resume_from
u64 byte_offset
GF_FilterPacket * src_pck
Bool recompute_cts
FLACIdx * indexes
u32 index_alloc_size
u32 index_size
u32 bitrate
Bool copy_props
u32 dsi_crc
Bool is_sync

Macro Definition Documentation

◆ FLAC_CHANNELS

#define FLAC_CHANNELS   8

◆ FLAC_MID_SIDE

#define FLAC_MID_SIDE   3

◆ OFFS

#define OFFS (   _n)    #_n, offsetof(GF_FLACDmxCtx, _n)

Function Documentation

◆ flac_dmx_configure_pid()

GF_Err flac_dmx_configure_pid ( GF_Filter *  filter,
GF_FilterPid *  pid,
Bool  is_remove 
)
+ Here is the call graph for this function:

◆ flac_dmx_check_dur()

static void flac_dmx_check_dur ( GF_Filter *  filter,
GF_FLACDmxCtx ctx 
)
static
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ flac_channel_layout()

static u64 flac_channel_layout ( u32  in_lay)
static
+ Here is the caller graph for this function:

◆ flac_dmx_check_pid()

static void flac_dmx_check_pid ( GF_Filter *  filter,
GF_FLACDmxCtx ctx,
u8 dsi,
u32  dsi_size 
)
static
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ flac_dmx_process_event()

static Bool flac_dmx_process_event ( GF_Filter *  filter,
const GF_FilterEvent *  evt 
)
static
+ Here is the call graph for this function:

◆ flac_dmx_update_cts()

static GFINLINE void flac_dmx_update_cts ( GF_FLACDmxCtx ctx,
u32  nb_samp 
)
static
+ Here is the caller graph for this function:

◆ flac_dmx_crc8()

u8 flac_dmx_crc8 ( u8 data,
u32  len 
)
+ Here is the caller graph for this function:

◆ flac_dmx_crc16()

static u32 flac_dmx_crc16 ( const u8 data,
u32  len 
)
static
+ Here is the caller graph for this function:

◆ flac_parse_header()

static Bool flac_parse_header ( GF_FLACDmxCtx ctx,
char *  data,
u32  size,
FLACHeader hdr 
)
static
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ flac_dmx_process()

GF_Err flac_dmx_process ( GF_Filter *  filter)
+ Here is the call graph for this function:

◆ flac_dmx_initialize()

static GF_Err flac_dmx_initialize ( GF_Filter *  filter)
static
+ Here is the call graph for this function:

◆ flac_dmx_finalize()

static void flac_dmx_finalize ( GF_Filter *  filter)
static
+ Here is the call graph for this function:

◆ flac_dmx_probe_data()

static const char* flac_dmx_probe_data ( const u8 data,
u32  size,
GF_FilterProbeScore score 
)
static

◆ rfflac_register()

const GF_FilterRegister* rfflac_register ( GF_FilterSession *  session)
+ Here is the call graph for this function:

Variable Documentation

◆ flac_dmx_crc8_table

u8 const flac_dmx_crc8_table[256]

◆ flac_dmx_crc16_table

const u32 flac_dmx_crc16_table[256]
static

◆ flac_dmx_block_sizes

u32 flac_dmx_block_sizes[]
static
Initial value:
=
{
0, 192, 576, 1152, 2304, 4608, 0, 0, 256, 512, 1024, 2048, 4096, 8192, 16384, 32768
}

◆ flac_dmx_samplerates

u32 flac_dmx_samplerates[]
static
Initial value:
=
{
0, 88200, 176400, 192000, 8000, 16000, 22050, 24000, 32000, 44100, 48000, 96000
}

◆ FLACDmxCaps

const GF_FilterCapability FLACDmxCaps[]
static
Initial value:
=
{
{0},
}
@ GF_CODECID_FLAC
Definition: constants.h:564
@ GF_STREAM_AUDIO
Definition: constants.h:66
@ GF_STREAM_FILE
Definition: constants.h:104
#define GF_CAPS_OUTPUT
Definition: filters.h:2232
#define CAP_UINT(_f, _a, _b)
Definition: filters.h:2172
#define CAP_STRING(_f, _a, _b)
Definition: filters.h:2194
#define GF_CAPS_INPUT_OUTPUT
Definition: filters.h:2242
#define GF_CAPS_OUTPUT_EXCLUDED
Definition: filters.h:2236
#define CAP_BOOL(_f, _a, _b)
Definition: filters.h:2180
#define GF_CAPS_INPUT
Definition: filters.h:2220
@ GF_PROP_PID_CODECID
Definition: filters.h:1116
@ GF_PROP_PID_STREAM_TYPE
Definition: filters.h:1112
@ GF_PROP_PID_UNFRAMED
Definition: filters.h:1118
@ GF_PROP_PID_FILE_EXT
Definition: filters.h:1190
@ GF_PROP_PID_MIME
Definition: filters.h:1189
@ GF_TRUE
Definition: setup.h:474

◆ FLACDmxArgs

const GF_FilterArgs FLACDmxArgs[]
static
Initial value:
=
{
{ OFFS(index), "indexing window length", GF_PROP_DOUBLE, "1.0", NULL, 0},
{ OFFS(docrc), "perform CRC check after each frame", GF_PROP_BOOL, "false", NULL, 0},
{0}
}
@ GF_PROP_BOOL
Definition: filters.h:858
@ GF_PROP_DOUBLE
Definition: filters.h:866
#define OFFS(_n)
Definition: reframe_flac.c:837

◆ FLACDmxRegister

GF_FilterRegister FLACDmxRegister
Initial value:
= {
.name = "rfflac",
GF_FS_SET_HELP("This filter parses FLAC files/data and outputs corresponding audio PID and frames.\n"
"\n"
"By default the reframer will only check CRC footer of frames if a change in sample rate or channel mapping is detected.\n"
"This should accommodate for most configurations, but CRC check can be enforced using [-docrc]().\n"
"")
.private_size = sizeof(GF_FLACDmxCtx),
.finalize = flac_dmx_finalize,
.initialize = flac_dmx_initialize,
.configure_pid = flac_dmx_configure_pid,
.process = flac_dmx_process,
.probe_data = flac_dmx_probe_data,
.process_event = flac_dmx_process_event,
.hint_class_type = GF_FS_CLASS_FRAMING
}
#define GF_FS_SET_HELP(_help)
Definition: filters.h:2372
#define SETCAPS(__struct)
Definition: filters.h:2364
@ GF_FS_CLASS_FRAMING
Definition: filters.h:2459
attribute Array args
Definition: jsf.idl:24
static Bool flac_dmx_process_event(GF_Filter *filter, const GF_FilterEvent *evt)
Definition: reframe_flac.c:225
static const char * flac_dmx_probe_data(const u8 *data, u32 size, GF_FilterProbeScore *score)
Definition: reframe_flac.c:811
static const GF_FilterArgs FLACDmxArgs[]
Definition: reframe_flac.c:838
GF_Err flac_dmx_configure_pid(GF_Filter *filter, GF_FilterPid *pid, Bool is_remove)
Definition: reframe_flac.c:88
static const GF_FilterCapability FLACDmxCaps[]
Definition: reframe_flac.c:820
static void flac_dmx_finalize(GF_Filter *filter)
Definition: reframe_flac.c:801
static GF_Err flac_dmx_initialize(GF_Filter *filter)
Definition: reframe_flac.c:795
GF_Err flac_dmx_process(GF_Filter *filter)
Definition: reframe_flac.c:513
Definition: reframe_flac.c:45