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

Data Structures

struct  MHASIdx
 
struct  GF_MHASDmxCtx
 

Macros

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

Functions

GF_Err mhas_dmx_configure_pid (GF_Filter *filter, GF_FilterPid *pid, Bool is_remove)
 
static void mhas_dmx_check_dur (GF_Filter *filter, GF_MHASDmxCtx *ctx)
 
static void mhas_dmx_check_pid (GF_Filter *filter, GF_MHASDmxCtx *ctx, u32 PL, u32 sample_rate, u32 frame_len, s32 CICPspeakerLayoutIdx, s32 numSpeakers, u8 *dsi, u32 dsi_size)
 
static Bool mhas_dmx_process_event (GF_Filter *filter, const GF_FilterEvent *evt)
 
static GFINLINE void mhas_dmx_update_cts (GF_MHASDmxCtx *ctx)
 
static const char * mhas_pck_name (u32 pck_type)
 
GF_Err mhas_dmx_process (GF_Filter *filter)
 
static void mhas_buffer_too_small (void *udta)
 
static GF_Err mhas_dmx_initialize (GF_Filter *filter)
 
static void mhas_dmx_finalize (GF_Filter *filter)
 
static const char * mhas_dmx_probe_data (const u8 *data, u32 size, GF_FilterProbeScore *score)
 
const GF_FilterRegister * rfmhas_register (GF_FilterSession *session)
 

Variables

static u32 USACSampleRates []
 
static u32 nb_usac_sr = GF_ARRAY_LENGTH(USACSampleRates)
 
static const GF_FilterCapability MHASDmxCaps []
 
static const GF_FilterArgs MHASDmxArgs []
 
GF_FilterRegister MHASDmxRegister
 

Data Structure Documentation

◆ MHASIdx

struct MHASIdx
Data Fields
u64 pos
Double duration

◆ GF_MHASDmxCtx

struct GF_MHASDmxCtx
+ Collaboration diagram for GF_MHASDmxCtx:
Data Fields
Double index
Bool mpha
u32 pcksync
Bool nosync
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 initialized
u8 * mhas_buffer
u32 mhas_buffer_size
u32 mhas_buffer_alloc
u32 resume_from
u64 byte_offset
Bool buffer_too_small
GF_FilterPacket * src_pck
Bool recompute_cts
MHASIdx * indexes
u32 index_alloc_size
u32 index_size
u32 sample_rate
u32 frame_len
u32 PL
s32 cicp_layout_idx
s32 num_speakers
u32 nb_frames
u32 nb_unknown_pck
u32 bitrate
Bool copy_props
Bool is_sync

Macro Definition Documentation

◆ OFFS

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

Function Documentation

◆ mhas_dmx_configure_pid()

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

◆ mhas_dmx_check_dur()

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

◆ mhas_dmx_check_pid()

static void mhas_dmx_check_pid ( GF_Filter *  filter,
GF_MHASDmxCtx ctx,
u32  PL,
u32  sample_rate,
u32  frame_len,
s32  CICPspeakerLayoutIdx,
s32  numSpeakers,
u8 dsi,
u32  dsi_size 
)
static
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ mhas_dmx_process_event()

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

◆ mhas_dmx_update_cts()

static GFINLINE void mhas_dmx_update_cts ( GF_MHASDmxCtx ctx)
static
+ Here is the caller graph for this function:

◆ mhas_pck_name()

static const char* mhas_pck_name ( u32  pck_type)
static
+ Here is the caller graph for this function:

◆ mhas_dmx_process()

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

◆ mhas_buffer_too_small()

static void mhas_buffer_too_small ( void *  udta)
static
+ Here is the caller graph for this function:

◆ mhas_dmx_initialize()

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

◆ mhas_dmx_finalize()

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

◆ mhas_dmx_probe_data()

static const char* mhas_dmx_probe_data ( const u8 data,
u32  size,
GF_FilterProbeScore score 
)
static
+ Here is the call graph for this function:

◆ rfmhas_register()

const GF_FilterRegister* rfmhas_register ( GF_FilterSession *  session)

Variable Documentation

◆ USACSampleRates

u32 USACSampleRates[]
static
Initial value:
= {96000, 88200, 64000, 48000, 44100, 32000, 24000, 22050, 16000, 12000, 11025, 8000, 7350, 0, 0,
57600, 51200, 40000, 38400, 34150, 28800, 25600, 20000, 19200, 17075, 14400, 12800, 9600}

◆ nb_usac_sr

u32 nb_usac_sr = GF_ARRAY_LENGTH(USACSampleRates)
static

◆ MHASDmxCaps

const GF_FilterCapability MHASDmxCaps[]
static
Initial value:
=
{
{0},
}
@ GF_CODECID_MHAS
Definition: constants.h:613
@ 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

◆ MHASDmxArgs

const GF_FilterArgs MHASDmxArgs[]
static
Initial value:
=
{
{ OFFS(index), "indexing window length", GF_PROP_DOUBLE, "1.0", NULL, 0},
{ OFFS(mpha), "demultiplex MHAS and only forward audio frames", GF_PROP_BOOL, "false", NULL, 0},
{ OFFS(pcksync), "number of unknown packets to tolerate before considering sync is lost", GF_PROP_UINT, "4", NULL, 0},
{ OFFS(nosync), "initial sync state", GF_PROP_BOOL, "true", NULL, 0},
{0}
}
@ GF_PROP_BOOL
Definition: filters.h:858
@ GF_PROP_DOUBLE
Definition: filters.h:866
@ GF_PROP_UINT
Definition: filters.h:852
#define OFFS(_n)
Definition: reframe_mhas.c:897

◆ MHASDmxRegister

GF_FilterRegister MHASDmxRegister
Initial value:
= {
.name = "rfmhas",
GF_FS_SET_HELP("This filter parses MHAS files/data and outputs corresponding audio PID and frames.\n"
"By default, the filter expects a MHAS stream with SYNC packets set, otherwise tune-in will fail. Using [-nosync]()=false can help parsing bitstreams with no SYNC packets.\n"
"The default behavior is to dispatch a framed MHAS bitstream. To demultiplex into a raw MPEG-H Audio, use [-mpha]().\n"
)
.private_size = sizeof(GF_MHASDmxCtx),
.finalize = mhas_dmx_finalize,
.initialize = mhas_dmx_initialize,
.configure_pid = mhas_dmx_configure_pid,
.process = mhas_dmx_process,
.probe_data = mhas_dmx_probe_data,
.process_event = mhas_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 void mhas_dmx_finalize(GF_Filter *filter)
Definition: reframe_mhas.c:826
static const GF_FilterCapability MHASDmxCaps[]
Definition: reframe_mhas.c:880
static const GF_FilterArgs MHASDmxArgs[]
Definition: reframe_mhas.c:898
static Bool mhas_dmx_process_event(GF_Filter *filter, const GF_FilterEvent *evt)
Definition: reframe_mhas.c:341
GF_Err mhas_dmx_process(GF_Filter *filter)
Definition: reframe_mhas.c:452
GF_Err mhas_dmx_configure_pid(GF_Filter *filter, GF_FilterPid *pid, Bool is_remove)
Definition: reframe_mhas.c:95
static const char * mhas_dmx_probe_data(const u8 *data, u32 size, GF_FilterProbeScore *score)
Definition: reframe_mhas.c:836
static GF_Err mhas_dmx_initialize(GF_Filter *filter)
Definition: reframe_mhas.c:819
Definition: reframe_mhas.c:46