libgpac
Documentation of the core library of GPAC
|
#include <gpac/filters.h>
#include <gpac/constants.h>
#include <gpac/internal/isomedia_dev.h>
#include <gpac/internal/media_dev.h>
#include <gpac/internal/id3.h>
#include <gpac/revision.h>
Data Structures | |
struct | TrackWriter |
struct | GF_MP4MuxCtx |
struct | _service_info |
Macros | |
#define | TEXT_DEFAULT_WIDTH 400 |
#define | TEXT_DEFAULT_HEIGHT 60 |
#define | TEXT_DEFAULT_FONT_SIZE 18 |
#define | GF_VENDOR_GPAC GF_4CC('G','P','A','C') |
#define | GF_IMPORT_AUDIO_SAMPLE_ENTRY_v2_QTFF (GF_IMPORT_AUDIO_SAMPLE_ENTRY_v1_QTFF+1) |
#define | ISOM_FILE_EXT "mp4|mpg4|m4a|m4i|3gp|3gpp|3g2|3gp2|iso|ismv|m4s|heif|heic|iff|avci|avif|mj2|mov|qt" |
#define | ISOM_FILE_MIME "video/mp4|audio/mp4|application/mp4|video/3gpp|audio/3gpp|video/3gp2|audio/3gp2|video/iso.segment|audio/iso.segment|image/heif|image/heic|image/avci|video/jp2|video/quicktime" |
#define | GPAC_SRD_SIZE 21 |
#define | OFFS(_n) #_n, offsetof(GF_MP4MuxCtx, _n) |
Enumerations | |
enum | { NALU_NONE , NALU_AVC , NALU_HEVC , NALU_VVC } |
enum | { CENC_NONE =0 , CENC_NEED_SETUP , CENC_SETUP_DONE , CENC_SETUP_ERROR } |
enum | { TAG_NONE , TAG_STRICT , TAG_ALL } |
enum | { XPS_IB_NO = 0 , XPS_IB_PPS , XPS_IB_ALL , XPS_IB_BOTH , XPS_IB_MIX , XPS_IB_AUTO } |
enum | { MP4MX_MODE_INTER =0 , MP4MX_MODE_FLAT , MP4MX_MODE_FASTSTART , MP4MX_MODE_TIGHT , MP4MX_MODE_FRAG , MP4MX_MODE_SFRAG } |
enum | { MP4MX_DASH_OFF =0 , MP4MX_DASH_ON , MP4MX_DASH_VOD } |
enum | { MP4MX_PSSH_MOOV =0 , MP4MX_PSSH_MOOF , MP4MX_PSSH_BOTH , MP4MX_PSSH_SKIP } |
enum | { MP4MX_CT_AUTO , MP4MX_CT_EDIT =0 , MP4MX_CT_NOEDIT , MP4MX_CT_NEGCTTS } |
enum | { MP4MX_VODCACHE_ON =0 , MP4MX_VODCACHE_INSERT , MP4MX_VODCACHE_REPLACE } |
enum | { MP4MX_CMAF_NO =0 , MP4MX_CMAF_CMFC , MP4MX_CMAF_CMF2 } |
enum | { MP4MX_CHAPM_OFF =0 , MP4MX_CHAPM_TRACK , MP4MX_CHAPM_UDTA , MP4MX_CHAPM_BOTH } |
enum | { MP4MX_UNCV_OFF =0 , MP4MX_UNCV_NOPROF , MP4MX_UNCV_PROF , MP4MX_UNCV_PROF_ONLY } |
enum | { CENC_CONFIG =0 , CENC_ADD_NORMAL , CENC_ADD_FRAG } |
Functions | |
static void | mp4_mux_update_init_edit (GF_MP4MuxCtx *ctx, TrackWriter *tkw, u64 min_ts_service, Bool skip_adjust) |
static void | mp4_mux_set_hevc_groups (GF_MP4MuxCtx *ctx, TrackWriter *tkw) |
static GF_Err | mp4mx_setup_dash_vod (GF_MP4MuxCtx *ctx, TrackWriter *tkw) |
static u32 | gf_isom_stream_type_to_media_type (u32 stream_type, u32 codecid) |
static void | mp4_mux_write_ps_list (GF_BitStream *bs, GF_List *list, u32 nalu_size_length) |
static GF_List * | mp4_mux_get_nalus_ps (GF_List *list, u8 type) |
static void | mp4_mux_make_inband_header (GF_MP4MuxCtx *ctx, TrackWriter *tkw, Bool for_non_rap) |
void | mp4_mux_get_video_size (GF_MP4MuxCtx *ctx, u32 *width, u32 *height) |
static void | mp4_mux_track_writer_del (TrackWriter *tkw) |
static void | mp4_mux_write_track_refs (GF_MP4MuxCtx *ctx, TrackWriter *tkw, const char *rname, u32 rtype, Bool remove_from_pres) |
static void | mp4mux_track_reorder (void *udta, u32 old_track_num, u32 new_track_num) |
static void | mp4mux_reorder_tracks (GF_MP4MuxCtx *ctx) |
static void | mp4mx_set_track_group (GF_MP4MuxCtx *ctx, TrackWriter *tkw, char *name, const GF_PropertyValue *p) |
static void | mp4_mux_set_tags (GF_MP4MuxCtx *ctx, TrackWriter *tkw) |
static void | mp4_mux_set_udta (GF_MP4MuxCtx *ctx, TrackWriter *tkw) |
static void | update_chap_refs (GF_MP4MuxCtx *ctx) |
static GF_Err | mp4_mux_setup_pid (GF_Filter *filter, GF_FilterPid *pid, Bool is_true_pid) |
static GF_Err | mp4_mux_flush_fragmented (GF_MP4MuxCtx *ctx) |
static GF_Err | mp4_mux_done (GF_MP4MuxCtx *ctx, Bool is_final) |
static void | mp4_mux_done_track (GF_MP4MuxCtx *ctx, TrackWriter *tkw) |
static GF_Err | mp4_mux_configure_pid (GF_Filter *filter, GF_FilterPid *pid, Bool is_remove) |
static Bool | mp4_mux_process_event (GF_Filter *filter, const GF_FilterEvent *evt) |
static void | mp4_mux_cenc_insert_pssh (GF_MP4MuxCtx *ctx, TrackWriter *tkw, const GF_PropertyValue *pssh, u32 dyn_pssh_mode) |
static GF_Err | mp4_mux_cenc_update (GF_MP4MuxCtx *ctx, TrackWriter *tkw, GF_FilterPacket *pck, u32 act_type, u32 pck_size, u32 injected_hdr_size) |
GF_FilterSAPType | mp4_mux_get_sap (GF_MP4MuxCtx *ctx, GF_FilterPacket *pck) |
GF_Err | gf_isom_fragment_add_sample_ex (GF_ISOFile *movie, GF_ISOTrackID TrackID, const GF_ISOSample *sample, u32 DescIndex, u32 Duration, u8 PaddingBits, u16 DegradationPriority, Bool redundant_coding, void **ref, u32 ref_offset) |
GF_Err | gf_isom_fragment_append_data_ex (GF_ISOFile *movie, GF_ISOTrackID TrackID, u8 *data, u32 data_size, u8 PaddingBits, void **ref, u32 ref_offset) |
static GF_Err | mp4_mux_process_sample (GF_MP4MuxCtx *ctx, TrackWriter *tkw, GF_FilterPacket *pck, Bool for_fragment) |
static GF_Err | mp4_mux_process_item (GF_MP4MuxCtx *ctx, TrackWriter *tkw, GF_FilterPacket *pck) |
static void | mp4mux_send_output (GF_MP4MuxCtx *ctx) |
static void | mp4_mux_flush_frag_llhas (GF_MP4MuxCtx *ctx) |
static GF_Err | mp4_mux_on_data (void *cbk, u8 *data, u32 block_size, void *cbk_data, u32 cbk_magic) |
static void | mp4_mux_flush_seg (GF_MP4MuxCtx *ctx, Bool is_init, u64 idx_start_range, u64 idx_end_range, Bool signal_flush) |
static void | mp4mux_check_mpd_start_time (GF_MP4MuxCtx *ctx, GF_FilterPacket *pck) |
static GF_Err | mp4_mux_initialize_movie (GF_MP4MuxCtx *ctx) |
static GF_Err | mp4_mux_start_fragment (GF_MP4MuxCtx *ctx, GF_FilterPacket *pck) |
static void | mp4mx_frag_box_patch (GF_MP4MuxCtx *ctx) |
static GF_Err | mp4_mux_initialize (GF_Filter *filter) |
GF_Err | mp4mx_reload_output (GF_MP4MuxCtx *ctx) |
static void | mp4_process_id3 (GF_MovieFragmentBox *moof, const GF_PropertyValue *emsg_prop, u32 id_sequence) |
static GF_Err | mp4_mux_process_fragmented (GF_MP4MuxCtx *ctx) |
static struct _service_info * | get_service_info (GF_List *services, TrackWriter *tkw) |
static void | del_service_info (GF_List *services) |
static void | mp4_mux_config_timing (GF_MP4MuxCtx *ctx) |
void | mp4_mux_format_report (GF_MP4MuxCtx *ctx, u64 done, u64 total) |
static void | mp4_mux_flush_seg_events (GF_MP4MuxCtx *ctx) |
GF_Err | mp4_mux_process (GF_Filter *filter) |
static GF_Err | mp4_mux_on_data_patch (void *cbk, u8 *data, u32 block_size, u64 file_offset, Bool is_insert) |
static void | mp4_mux_on_packet_destruct (GF_Filter *filter, GF_FilterPid *PID, GF_FilterPacket *pck) |
static void | mp4_mux_on_last_block_start (void *cbk) |
void | mp4_mux_progress_cbk (void *udta, u64 done, u64 total) |
static void | mp4_mux_update_edit_list_for_bframes (GF_MP4MuxCtx *ctx, TrackWriter *tkw, u32 ctts_mode) |
void | gf_media_update_bitrate (GF_ISOFile *file, u32 track) |
static void | mp4_mux_finalize (GF_Filter *filter) |
const GF_FilterRegister * | mp4mx_register (GF_FilterSession *session) |
Variables | |
static const GF_FilterCapability | MP4MuxCaps [] |
static const GF_FilterArgs | MP4MuxArgs [] |
GF_FilterRegister | MP4MuxRegister |
struct TrackWriter |
Data Fields | ||
---|---|---|
GF_FilterPid * | ipid | |
u32 | track_num | |
u32 | track_id | |
GF_ISOSample | sample | |
u32 | prev_duration | |
u32 | src_timescale | |
u32 | tk_timescale | |
u32 | stream_type | |
u32 | codecid | |
Bool | is_encrypted | |
u32 | cfg_crc | |
u32 | enh_cfg_crc | |
u32 | dep_id | |
u32 | stsd_idx | |
u32 | clear_stsd_idx | |
Bool | reused_stsd | |
Bool | use_dref | |
Bool | aborted | |
Bool | suspended | |
Bool | has_append | |
Bool | has_ctts | |
s64 | min_neg_ctts | |
u32 | nb_samples | |
u32 | samples_in_stsd | |
u32 | nb_frames_per_sample | |
u64 | ts_shift | |
u64 | si_min_ts_plus_one | |
Bool | has_subs | |
Bool | skip_bitrate_update | |
Bool | has_open_gop | |
GF_FilterSAPType | gdr_type | |
u32 | media_profile_level | |
Bool | import_msg_header_done | |
u32 | nal_unit_size | |
GF_AVCConfig * | avcc | |
GF_AVCConfig * | svcc | |
GF_HEVCConfig * | hvcc | |
GF_HEVCConfig * | lvcc | |
GF_VVCConfig * | vvcc | |
u8 * | inband_hdr | |
u8 * | inband_hdr_non_rap | |
u32 | inband_hdr_size | |
u32 | inband_hdr_non_rap_size | |
u32 | is_nalu | |
Bool | is_av1 | |
Bool | is_vpx | |
Bool | fragment_done | |
s32 | ts_delay | |
s32 | negctts_shift | |
Bool | insert_tfdt | |
Bool | probe_min_ctts | |
u64 | first_dts_in_seg_plus_one | |
u64 | next_seg_cts | |
u64 | cts_next | |
s64 | tfdt_offset | |
u32 | samples_in_frag | |
Bool | patch_tfdt | |
u32 | cenc_state | |
Bool | cenc_subsamples | |
u32 | scheme_type | |
u32 | def_skip_byte_block | |
u32 | def_crypt_byte_block | |
u32 | def_cenc_key_info_crc | |
const GF_PropertyValue * | cenc_ki | |
u32 | cenc_key_info_crc | |
u32 | constant_IV_size | |
Bool | cenc_multikey | |
Bool | cenc_frag_protected | |
u32 | skip_byte_block | |
u32 | crypt_byte_block | |
Bool | fake_track | |
Bool | has_brands | |
Bool | force_inband_inject | |
u64 | dur_in_frag | |
u32 | amr_mode_set | |
Bool | has_seig | |
u64 | empty_init_dur | |
u32 | raw_audio_bytes_per_sample | |
u32 | raw_samplerate | |
u64 | dts_patch | |
Bool | is_item | |
u32 | item_id | |
char | status_type | |
u32 | last_import_pc | |
u32 | nb_frames | |
u32 | frame_offset | |
u64 | down_bytes | |
u64 | down_size | |
GF_Fraction64 | pid_dur | |
u64 | prog_done | |
u64 | prog_total | |
u32 | prev_tid_group | |
Bool | box_patched | |
u64 | imported_edit_sdur | |
u64 | imported_edit_offset | |
Bool | force_ctts | |
Bool | is_hevc_tile_base | |
Bool | insert_pssh | |
Bool | wait_sap | |
u64 | min_ts_seek_plus_one | |
u64 | clamp_ts_plus_one | |
Bool | check_seek_ts | |
u64 | max_cts | |
u64 | min_cts | |
u32 | max_cts_samp_dur | |
u32 | w_or_sr | |
u32 | h_or_ch | |
u32 | pf_or_af | |
u32 | xps_inband | |
u8 * | dyn_pssh | |
u32 | dyn_pssh_len | |
Bool | sparse_inject | |
Bool | is_chap | |
GF_FilterPacket * | dgl_copy | |
u32 | all_stsd_crc | |
Bool | has_deps | |
u32 | sampleNumber | |
u32 | timeScale | |
u64 | chunkDur | |
u32 | chunkSize | |
u32 | constant_size | |
u32 | constant_dur | |
u64 | DTSprev | |
u8 | isDone | |
u64 | prev_offset | |
GF_MediaBox * | mdia | |
GF_SampleTableBox * | stbl | |
u32 | all_dref_mode | |
GF_SampleToChunkBox * | stsc | |
GF_Box * | stco | |
Bool | prevent_dispatch |
struct GF_MP4MuxCtx |
Data Fields | ||
---|---|---|
GF_ISOFile * | file | |
Bool | m4sys | |
Bool | dref | |
GF_Fraction | dur | |
u32 | pack3gp | |
u32 | ctmode | |
Bool | importer | |
Bool | pack_nal | |
Bool | moof_first | |
Bool | abs_offset | |
Bool | fsap | |
Bool | tfdt_traf | |
Bool | keep_utc | |
Bool | pps_inband | |
Bool | rsot | |
u32 | xps_inband | |
u32 | moovpad | |
u32 | block_size | |
u32 | store | |
u32 | tktpl | |
u32 | mudta | |
s32 | subs_sidx | |
GF_Fraction | cdur | |
s32 | moovts | |
char * | m4cc | |
Bool | chain_sidx | |
u32 | msn | |
u32 | msninc | |
GF_Fraction64 | tfdt | |
Bool | nofragdef | |
Bool | straf | |
Bool | strun | |
Bool | sgpd_traf | |
Bool | noinit | |
Bool | prft | |
u32 | vodcache | |
u32 | psshs | |
u32 | trackid | |
Bool | fragdur | |
Bool | btrt | |
Bool | ssix | |
Bool | ccst | |
s32 | mediats | |
u32 | ase | |
char * | styp | |
Bool | sseg | |
Bool | noroll | |
Bool | norap | |
Bool | saio32 | |
Bool | tfdt64 | |
u32 | compress | |
Bool | trun_inter | |
Bool | truns_first | |
char * | boxpatch | |
Bool | fcomp | |
Bool | otyp | |
Bool | deps | |
Bool | mvex | |
Bool | trunv1 | |
u32 | sdtp_traf | |
u32 | cmaf | |
Bool | mfra | |
u32 | uncv | |
Bool | forcesync | |
Bool | refrag | |
Bool | pad_sparse | |
Bool | force_dv | |
Bool | tsalign | |
Bool | dvsingle | |
Bool | patch_dts | |
u32 | itags | |
Double | start | |
u32 | chapm | |
GF_Filter * | filter | |
Bool | owns_mov | |
GF_FilterPid * | opid | |
Bool | first_pck_sent | |
Bool | track_removed | |
Bool | cdur_overwrite | |
GF_List * | tracks | |
GF_BitStream * | bs_r | |
Bool | init_movie_done | |
Bool | fragment_started | |
Bool | segment_started | |
Bool | insert_tfdt | |
Bool | insert_pssh | |
Bool | cdur_set | |
u64 | next_frag_start | |
u64 | adjusted_next_frag_start | |
u64 | current_offset | |
u64 | current_size | |
u32 | nb_segs | |
u32 | nb_frags | |
u32 | nb_frags_in_seg | |
GF_FilterPacket * | dst_pck | |
char * | seg_name | |
char * | llhas_template | |
u32 | dash_seg_num_plus_one | |
GF_Fraction64 | dash_seg_start | |
Bool | flush_seg | |
u32 | eos_marker | |
TrackWriter * | ref_tkw | |
Bool | single_file | |
Bool | store_output | |
FILE * | tmp_store | |
u64 | flush_size | |
u64 | flush_done | |
u32 | dash_mode | |
u32 | llhas_mode | |
GF_Fraction | dash_dur | |
Double | media_dur | |
u32 | sidx_max_size | |
u32 | sidx_chunk_offset | |
Bool | final_sidx_flush | |
Bool | sidx_size_exact | |
u32 * | seg_sizes | |
u32 | nb_seg_sizes | |
u32 | alloc_seg_sizes | |
u32 | config_retry_start | |
Bool | config_timing | |
u32 | major_brand_set | |
Bool | def_brand_patched | |
Bool | force_play | |
Bool | moov_inserted | |
Bool | update_report | |
u64 | total_bytes_in | |
u64 | total_bytes_out | |
u32 | total_samples | |
u32 | last_mux_pc | |
u32 | maxchunk | |
u32 | make_qt | |
TrackWriter * | prores_track | |
GF_SegmentIndexBox * | cloned_sidx | |
u32 | cloned_sidx_index | |
GF_Fraction | faststart_ts_regulate | |
Bool | is_rewind | |
Bool | box_patched | |
u32 | cur_file_idx_plus_one | |
char * | cur_file_suffix | |
Bool | notify_filename | |
u32 | next_file_idx | |
const char * | next_file_suffix | |
u64 | min_cts_plus_one | |
u64 | next_seg_start | |
u64 | min_cts_next_frag | |
u64 | frag_size | |
u64 | frag_offset | |
u32 | frag_num | |
u64 | frag_duration | |
u32 | frag_timescale | |
Bool | frag_has_intra | |
u64 | wait_dts_plus_one | |
u32 | wait_dts_timescale | |
Bool | force_seg_sync | |
u32 | seg_flush_state | |
u32 | last_block_in_segment | |
u64 | flush_idx_start_range | |
u64 | flush_idx_end_range | |
Bool | flush_llhas | |
Bool | has_def_vid | |
Bool | has_def_aud | |
Bool | has_def_txt | |
u32 | chap_track_num | |
Bool | has_chap_tracks | |
GF_List * | ref_pcks | |
u32 | id3_id_sequence | |
const GF_PropertyValue * | last_id3_processed |
struct _service_info |
#define TEXT_DEFAULT_WIDTH 400 |
#define TEXT_DEFAULT_HEIGHT 60 |
#define TEXT_DEFAULT_FONT_SIZE 18 |
#define GF_IMPORT_AUDIO_SAMPLE_ENTRY_v2_QTFF (GF_IMPORT_AUDIO_SAMPLE_ENTRY_v1_QTFF+1) |
#define ISOM_FILE_EXT "mp4|mpg4|m4a|m4i|3gp|3gpp|3g2|3gp2|iso|ismv|m4s|heif|heic|iff|avci|avif|mj2|mov|qt" |
#define ISOM_FILE_MIME "video/mp4|audio/mp4|application/mp4|video/3gpp|audio/3gpp|video/3gp2|audio/3gp2|video/iso.segment|audio/iso.segment|image/heif|image/heic|image/avci|video/jp2|video/quicktime" |
#define GPAC_SRD_SIZE 21 |
#define OFFS | ( | _n | ) | #_n, offsetof(GF_MP4MuxCtx, _n) |
anonymous enum |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
void mp4_mux_get_video_size | ( | GF_MP4MuxCtx * | ctx, |
u32 * | width, | ||
u32 * | height | ||
) |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
! tkw->nb_samples / tkw->samples_in_frag not yet incremented !!
GF_FilterSAPType mp4_mux_get_sap | ( | GF_MP4MuxCtx * | ctx, |
GF_FilterPacket * | pck | ||
) |
GF_Err gf_isom_fragment_add_sample_ex | ( | GF_ISOFile * | movie, |
GF_ISOTrackID | TrackID, | ||
const GF_ISOSample * | sample, | ||
u32 | DescIndex, | ||
u32 | Duration, | ||
u8 | PaddingBits, | ||
u16 | DegradationPriority, | ||
Bool | redundant_coding, | ||
void ** | ref, | ||
u32 | ref_offset | ||
) |
GF_Err gf_isom_fragment_append_data_ex | ( | GF_ISOFile * | movie, |
GF_ISOTrackID | TrackID, | ||
u8 * | data, | ||
u32 | data_size, | ||
u8 | PaddingBits, | ||
void ** | ref, | ||
u32 | ref_offset | ||
) |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
GF_Err mp4mx_reload_output | ( | GF_MP4MuxCtx * | ctx | ) |
|
static |
|
static |
|
static |
|
static |
|
static |
void mp4_mux_format_report | ( | GF_MP4MuxCtx * | ctx, |
u64 | done, | ||
u64 | total | ||
) |
|
static |
GF_Err mp4_mux_process | ( | GF_Filter * | filter | ) |
|
static |
|
static |
|
static |
|
static |
|
static |
const GF_FilterRegister* mp4mx_register | ( | GF_FilterSession * | session | ) |
|
static |
|
static |
GF_FilterRegister MP4MuxRegister |