libgpac
Documentation of the core library of GPAC
reframe_nalu.c File Reference
+ Include dependency graph for reframe_nalu.c:

Data Structures

struct  NALUIdx
 
struct  LHVCLayerInfo
 
struct  GF_NALUDmxCtx
 

Macros

#define CTS_POC_OFFSET_SAFETY   1000
 
#define OFFS(_n)   #_n, offsetof(GF_NALUDmxCtx, _n)
 

Enumerations

enum  {
  DVMODE_NONE =0 , DVMODE_AUTO , DVMODE_FORCE , DVMODE_CLEAN ,
  DVMODE_SINGLE
}
 
enum  { STRICT_POC_OFF = 0 , STRICT_POC_ON , STRICT_POC_ERROR }
 

Functions

GF_Err gf_bs_set_logger (GF_BitStream *bs, void(*on_bs_log)(void *udta, const char *field_name, u32 nb_bits, u64 field_val, s32 idx1, s32 idx2, s32 idx3), void *udta)
 
static void naludmx_enqueue_or_dispatch (GF_NALUDmxCtx *ctx, GF_FilterPacket *n_pck, Bool flush_ref)
 
static void naludmx_finalize_au_flags (GF_NALUDmxCtx *ctx)
 
static void naludmx_reset_param_sets (GF_NALUDmxCtx *ctx, Bool do_free)
 
static void naludmx_set_dolby_vision (GF_NALUDmxCtx *ctx)
 
GF_Err naludmx_configure_pid (GF_Filter *filter, GF_FilterPid *pid, Bool is_remove)
 
static u64 naludmx_next_start_code (GF_BitStream *bs, u64 offset, u64 fsize, u32 *sc_size)
 
void naludmx_probe_recovery_sei (GF_BitStream *bs, AVCState *avc)
 
static void naludmx_check_dur (GF_Filter *filter, GF_NALUDmxCtx *ctx)
 
static void naludmx_add_param_nalu (GF_List *param_list, GF_NALUFFParam *sl, u8 nal_type)
 
static void naludmx_hevc_set_parall_type (GF_NALUDmxCtx *ctx, GF_HEVCConfig *hevc_cfg)
 
GF_Err naludmx_set_hevc_oinf (GF_NALUDmxCtx *ctx, u8 *max_temporal_id)
 
static void naludmx_set_hevc_linf (GF_NALUDmxCtx *ctx)
 
static Bool naludmx_create_hevc_decoder_config (GF_NALUDmxCtx *ctx, u8 **dsi, u32 *dsi_size, u8 **dsi_enh, u32 *dsi_enh_size, u32 *max_width, u32 *max_height, u32 *max_enh_width, u32 *max_enh_height, GF_Fraction *sar, Bool *has_hevc_base)
 
static Bool naludmx_create_vvc_decoder_config (GF_NALUDmxCtx *ctx, u8 **dsi, u32 *dsi_size, u8 **dsi_enh, u32 *dsi_enh_size, u32 *max_width, u32 *max_height, u32 *max_enh_width, u32 *max_enh_height, GF_Fraction *sar, Bool *has_vvc_base)
 
Bool naludmx_create_avc_decoder_config (GF_NALUDmxCtx *ctx, u8 **dsi, u32 *dsi_size, u8 **dsi_enh, u32 *dsi_enh_size, u32 *max_width, u32 *max_height, u32 *max_enh_width, u32 *max_enh_height, GF_Fraction *sar)
 
static void naludmx_end_access_unit (GF_NALUDmxCtx *ctx)
 
static void naludmx_update_clli_mdcv (GF_NALUDmxCtx *ctx, Bool reset_crc)
 
static void naludmx_check_pid (GF_Filter *filter, GF_NALUDmxCtx *ctx, Bool force_au_flush, Bool next_is_idr)
 
static Bool naludmx_process_event (GF_Filter *filter, const GF_FilterEvent *evt)
 
static GFINLINE void naludmx_update_time (GF_NALUDmxCtx *ctx)
 
static void naludmx_queue_param_set (GF_NALUDmxCtx *ctx, char *data, u32 size, u32 ps_type, s32 ps_id, u32 tid, u32 lid)
 
static void naludmx_update_nalu_maxsize (GF_NALUDmxCtx *ctx, u32 size)
 
GF_FilterPacket * naludmx_start_nalu (GF_NALUDmxCtx *ctx, u32 nal_size, Bool skip_nal_field, Bool *au_start, u8 **pck_data)
 
void naludmx_add_subsample (GF_NALUDmxCtx *ctx, u32 subs_size, u8 subs_priority, u32 subs_reserved)
 
static void naludmx_push_prefix (GF_NALUDmxCtx *ctx, u8 *data, u32 size, Bool avc_sei_rewrite)
 
static s32 naludmx_parse_nal_hevc (GF_NALUDmxCtx *ctx, char *data, u32 size, Bool *skip_nal, u32 *is_slice, Bool *is_islice)
 
static s32 naludmx_parse_nal_vvc (GF_NALUDmxCtx *ctx, char *data, u32 size, Bool *skip_nal, u32 *is_slice, Bool *is_islice)
 
static s32 naludmx_parse_nal_avc (GF_NALUDmxCtx *ctx, char *data, u32 size, u32 nal_type, Bool *skip_nal, u32 *is_slice, Bool *is_islice)
 
static void naldmx_switch_timestamps (GF_NALUDmxCtx *ctx, GF_FilterPacket *pck)
 
static void naldmx_check_timestamp_switch (GF_NALUDmxCtx *ctx, u32 *nalu_store_before, u32 bytes_drop, Bool *drop_packet, GF_FilterPacket *pck)
 
static void naldmx_bs_log (void *udta, const char *field_name, u32 nb_bits, u64 field_val, s32 idx1, s32 idx2, s32 idx3)
 
GF_Err naludmx_process (GF_Filter *filter)
 
static GF_Err naludmx_initialize (GF_Filter *filter)
 
static void naludmx_del_param_list (GF_List *ps, Bool do_free)
 
static void naludmx_log_stats (GF_NALUDmxCtx *ctx)
 
static void naludmx_finalize (GF_Filter *filter)
 
static const char * naludmx_probe_data (const u8 *data, u32 size, GF_FilterProbeScore *score)
 
const GF_FilterRegister * rfnalu_register (GF_FilterSession *session)
 

Variables

static const GF_FilterCapability NALUDmxCaps []
 
static const GF_FilterArgs NALUDmxArgs []
 
GF_FilterRegister NALUDmxRegister
 

Data Structure Documentation

◆ NALUIdx

struct NALUIdx
Data Fields
u64 pos
Double duration
u32 roll_count

◆ LHVCLayerInfo

struct LHVCLayerInfo
Data Fields
u32 layer_id_plus_one
u32 min_temporal_id
u32 max_temporal_id

◆ GF_NALUDmxCtx

struct GF_NALUDmxCtx
+ Collaboration diagram for GF_NALUDmxCtx:
Data Fields
GF_Fraction fps
Double index
Bool explicit
Bool force_sync
Bool nosei
Bool importer
Bool subsamples
Bool nosvc
Bool novpsext
Bool deps
Bool seirw
Bool audelim
Bool analyze
Bool notime
Bool refs
u32 nal_length
u32 strict_poc
u32 bsdbg
GF_Fraction dur
u32 dv_mode
u32 dv_profile
u32 dv_compatid
GF_FilterPid * ipid
GF_FilterPid * opid
GF_BitStream * bs_r
GF_BitStream * bs_w
u64 cts
u64 dts
u64 prev_dts
u64 prev_cts
u32 pck_duration
u32 width
u32 height
u32 crc_cfg
u32 crc_cfg_enh
GF_Fraction sar
GF_Fraction cur_fps
GF_Fraction64 duration
Double start_range
Bool in_seek
u32 seek_gdr_count
Bool first_gdr
Bool is_playing
Bool is_file
Bool file_loaded
Bool initial_play_done
NALUIdx * indexes
u32 index_alloc_size
u32 index_size
u32 timescale
Bool input_is_au_start
GF_FilterPacket * src_pck
Bool full_au_source
s32 max_total_delay
u32 max_nalu_size_allowed
u32 resume_from
Bool nal_adjusted
u32 codecid
const char * log_name
GF_List * pck_queue
u64 dts_last_IDR
u32 max_nalu_size
u8 * nal_store
u32 nal_store_size
u32 nal_store_alloc
GF_List * sps
GF_List * pps
GF_List * vps
GF_List * sps_ext
GF_List * pps_svc
GF_List * vvc_aps_pre
GF_List * vvc_dci
GF_List * vvc_opi
GF_List * sei_prefix
Bool ps_modified
Bool ps_changed
u32 nb_idr
u32 nb_i
u32 nb_p
u32 nb_b
u32 nb_sp
u32 nb_si
u32 nb_sei
u32 nb_nalus
u32 nb_aud
u32 nb_cra
Bool has_islice
GF_FilterSAPType au_sap
u32 nb_slices_in_au
Bool au_sap2_poc_reset
u32 field_type
s32 sei_recovery_frame_count
u32 use_opengop_gdr
s32 last_poc
s32 max_last_poc
s32 max_last_b_poc
s32 poc_diff
s32 prev_last_poc
s32 min_poc
s32 poc_shift
Bool poc_probe_done
Bool min_poc_probe_done
GF_FilterPacket * first_pck_in_au
Bool has_ref_slices
Bool has_redundant
Bool last_frame_is_idr
char * sei_buffer
u32 sei_buffer_size
u32 sei_buffer_alloc
u32 subsamp_buffer_alloc
u32 subsamp_buffer_size
u32 subs_mapped_bytes
char * subsamp_buffer
AVCState * avc_state
char * svc_prefix_buffer
u32 svc_prefix_buffer_size
u32 svc_prefix_buffer_alloc
u32 svc_nalu_prefix_reserved
u8 svc_nalu_prefix_priority
HEVCState * hevc_state
u32 nb_e_idr
u32 nb_e_i
u32 nb_e_p
u32 nb_e_b
Bool vvc_no_stats
LHVCLayerInfo linf[64]
u8 max_temporal_id[64]
u8 min_layer_id
VVCState * vvc_state
Bool has_initial_aud
char init_aud[3]
Bool interlaced
Bool is_mvc
u32 bitrate
u32 nb_frames
u8 last_layer_id
u8 last_temporal_id
u32 clli_crc
u32 mdcv_crc
u32 nb_dv_rpu
u32 nb_dv_el
u32 valid_ps_flags
Bool check_prev_sap2
s32 prev_sap2_poc
Bool sap2_as_sap1
GF_FilterPacket * prev_sap

Macro Definition Documentation

◆ CTS_POC_OFFSET_SAFETY

#define CTS_POC_OFFSET_SAFETY   1000

◆ OFFS

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

Enumeration Type Documentation

◆ anonymous enum

anonymous enum
Enumerator
DVMODE_NONE 
DVMODE_AUTO 
DVMODE_FORCE 
DVMODE_CLEAN 
DVMODE_SINGLE 

◆ anonymous enum

anonymous enum
Enumerator
STRICT_POC_OFF 
STRICT_POC_ON 
STRICT_POC_ERROR 

Function Documentation

◆ gf_bs_set_logger()

GF_Err gf_bs_set_logger ( GF_BitStream *  bs,
void(*)(void *udta, const char *field_name, u32 nb_bits, u64 field_val, s32 idx1, s32 idx2, s32 idx3)  on_bs_log,
void *  udta 
)
+ Here is the caller graph for this function:

◆ naludmx_enqueue_or_dispatch()

static void naludmx_enqueue_or_dispatch ( GF_NALUDmxCtx ctx,
GF_FilterPacket *  n_pck,
Bool  flush_ref 
)
static
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ naludmx_finalize_au_flags()

static void naludmx_finalize_au_flags ( GF_NALUDmxCtx ctx)
static
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ naludmx_reset_param_sets()

static void naludmx_reset_param_sets ( GF_NALUDmxCtx ctx,
Bool  do_free 
)
static
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ naludmx_set_dolby_vision()

static void naludmx_set_dolby_vision ( GF_NALUDmxCtx ctx)
static
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ naludmx_configure_pid()

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

◆ naludmx_next_start_code()

static u64 naludmx_next_start_code ( GF_BitStream *  bs,
u64  offset,
u64  fsize,
u32 sc_size 
)
static
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ naludmx_probe_recovery_sei()

void naludmx_probe_recovery_sei ( GF_BitStream *  bs,
AVCState avc 
)
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ naludmx_check_dur()

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

◆ naludmx_add_param_nalu()

static void naludmx_add_param_nalu ( GF_List *  param_list,
GF_NALUFFParam sl,
u8  nal_type 
)
static
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ naludmx_hevc_set_parall_type()

static void naludmx_hevc_set_parall_type ( GF_NALUDmxCtx ctx,
GF_HEVCConfig hevc_cfg 
)
static
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ naludmx_set_hevc_oinf()

GF_Err naludmx_set_hevc_oinf ( GF_NALUDmxCtx ctx,
u8 max_temporal_id 
)
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ naludmx_set_hevc_linf()

static void naludmx_set_hevc_linf ( GF_NALUDmxCtx ctx)
static
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ naludmx_create_hevc_decoder_config()

static Bool naludmx_create_hevc_decoder_config ( GF_NALUDmxCtx ctx,
u8 **  dsi,
u32 dsi_size,
u8 **  dsi_enh,
u32 dsi_enh_size,
u32 max_width,
u32 max_height,
u32 max_enh_width,
u32 max_enh_height,
GF_Fraction sar,
Bool has_hevc_base 
)
static
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ naludmx_create_vvc_decoder_config()

static Bool naludmx_create_vvc_decoder_config ( GF_NALUDmxCtx ctx,
u8 **  dsi,
u32 dsi_size,
u8 **  dsi_enh,
u32 dsi_enh_size,
u32 max_width,
u32 max_height,
u32 max_enh_width,
u32 max_enh_height,
GF_Fraction sar,
Bool has_vvc_base 
)
static
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ naludmx_create_avc_decoder_config()

Bool naludmx_create_avc_decoder_config ( GF_NALUDmxCtx ctx,
u8 **  dsi,
u32 dsi_size,
u8 **  dsi_enh,
u32 dsi_enh_size,
u32 max_width,
u32 max_height,
u32 max_enh_width,
u32 max_enh_height,
GF_Fraction sar 
)
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ naludmx_end_access_unit()

static void naludmx_end_access_unit ( GF_NALUDmxCtx ctx)
static
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ naludmx_update_clli_mdcv()

static void naludmx_update_clli_mdcv ( GF_NALUDmxCtx ctx,
Bool  reset_crc 
)
static
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ naludmx_check_pid()

static void naludmx_check_pid ( GF_Filter *  filter,
GF_NALUDmxCtx ctx,
Bool  force_au_flush,
Bool  next_is_idr 
)
static
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ naludmx_process_event()

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

◆ naludmx_update_time()

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

◆ naludmx_queue_param_set()

static void naludmx_queue_param_set ( GF_NALUDmxCtx ctx,
char *  data,
u32  size,
u32  ps_type,
s32  ps_id,
u32  tid,
u32  lid 
)
static
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ naludmx_update_nalu_maxsize()

static void naludmx_update_nalu_maxsize ( GF_NALUDmxCtx ctx,
u32  size 
)
static
+ Here is the caller graph for this function:

◆ naludmx_start_nalu()

GF_FilterPacket* naludmx_start_nalu ( GF_NALUDmxCtx ctx,
u32  nal_size,
Bool  skip_nal_field,
Bool au_start,
u8 **  pck_data 
)
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ naludmx_add_subsample()

void naludmx_add_subsample ( GF_NALUDmxCtx ctx,
u32  subs_size,
u8  subs_priority,
u32  subs_reserved 
)
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ naludmx_push_prefix()

static void naludmx_push_prefix ( GF_NALUDmxCtx ctx,
u8 data,
u32  size,
Bool  avc_sei_rewrite 
)
static
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ naludmx_parse_nal_hevc()

static s32 naludmx_parse_nal_hevc ( GF_NALUDmxCtx ctx,
char *  data,
u32  size,
Bool skip_nal,
u32 is_slice,
Bool is_islice 
)
static
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ naludmx_parse_nal_vvc()

static s32 naludmx_parse_nal_vvc ( GF_NALUDmxCtx ctx,
char *  data,
u32  size,
Bool skip_nal,
u32 is_slice,
Bool is_islice 
)
static
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ naludmx_parse_nal_avc()

static s32 naludmx_parse_nal_avc ( GF_NALUDmxCtx ctx,
char *  data,
u32  size,
u32  nal_type,
Bool skip_nal,
u32 is_slice,
Bool is_islice 
)
static
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ naldmx_switch_timestamps()

static void naldmx_switch_timestamps ( GF_NALUDmxCtx ctx,
GF_FilterPacket *  pck 
)
static
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ naldmx_check_timestamp_switch()

static void naldmx_check_timestamp_switch ( GF_NALUDmxCtx ctx,
u32 nalu_store_before,
u32  bytes_drop,
Bool drop_packet,
GF_FilterPacket *  pck 
)
static
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ naldmx_bs_log()

static void naldmx_bs_log ( void *  udta,
const char *  field_name,
u32  nb_bits,
u64  field_val,
s32  idx1,
s32  idx2,
s32  idx3 
)
static
+ Here is the caller graph for this function:

◆ naludmx_process()

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

◆ naludmx_initialize()

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

◆ naludmx_del_param_list()

static void naludmx_del_param_list ( GF_List *  ps,
Bool  do_free 
)
static
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ naludmx_log_stats()

static void naludmx_log_stats ( GF_NALUDmxCtx ctx)
static
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ naludmx_finalize()

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

◆ naludmx_probe_data()

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

◆ rfnalu_register()

const GF_FilterRegister* rfnalu_register ( GF_FilterSession *  session)

Variable Documentation

◆ NALUDmxCaps

const GF_FilterCapability NALUDmxCaps[]
static

◆ NALUDmxArgs

const GF_FilterArgs NALUDmxArgs[]
static

◆ NALUDmxRegister

GF_FilterRegister NALUDmxRegister
Initial value:
= {
.name = "rfnalu",
GF_FS_SET_HELP("This filter parses AVC|H264 and HEVC files/data and outputs corresponding video PID and frames.\n"
"This filter produces ISOBMFF-compatible output: start codes are removed, NALU length field added and avcC/hvcC config created.\n"
"Note: The filter uses negative CTS offsets: CTS is correct, but some frames may have DTS greater than CTS.")
.private_size = sizeof(GF_NALUDmxCtx),
.initialize = naludmx_initialize,
.finalize = naludmx_finalize,
.configure_pid = naludmx_configure_pid,
.process = naludmx_process,
.process_event = naludmx_process_event,
.probe_data = naludmx_probe_data,
.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 naludmx_process_event(GF_Filter *filter, const GF_FilterEvent *evt)
Definition: reframe_nalu.c:1985
static const char * naludmx_probe_data(const u8 *data, u32 size, GF_FilterProbeScore *score)
Definition: reframe_nalu.c:4223
GF_Err naludmx_process(GF_Filter *filter)
Definition: reframe_nalu.c:3173
static void naludmx_finalize(GF_Filter *filter)
Definition: reframe_nalu.c:4191
static const GF_FilterCapability NALUDmxCaps[]
Definition: reframe_nalu.c:4357
static GF_Err naludmx_initialize(GF_Filter *filter)
Definition: reframe_nalu.c:4076
static const GF_FilterArgs NALUDmxArgs[]
Definition: reframe_nalu.c:4396
GF_Err naludmx_configure_pid(GF_Filter *filter, GF_FilterPid *pid, Bool is_remove)
Definition: reframe_nalu.c:259
Definition: reframe_nalu.c:70