libgpac
Documentation of the core library of GPAC
fileimport.c File Reference
#include "mp4box.h"
#include <gpac/media_tools.h>
#include <gpac/constants.h>
#include <gpac/scene_manager.h>
#include <gpac/network.h>
#include <gpac/base_coding.h>
#include <gpac/scenegraph.h>
#include <gpac/bifs.h>
#include <gpac/nodes_mpeg4.h>
#include <gpac/xml.h>
#include <gpac/isomedia.h>
#include <gpac/internal/media_dev.h>
+ Include dependency graph for fileimport.c:

Data Structures

struct  WGTEnum
 
struct  SplitInfo
 
struct  CATEnum
 

Macros

#define GOTO_EXIT(_msg)   if (e) { fail_msg = _msg; goto exit; }
 
#define CHECK_FAKEIMPORT(_opt)   if (fake_import) { M4_LOG(GF_LOG_ERROR, ("Option %s not available for cat or self-reference import\n", _opt)); e = GF_BAD_PARAM; goto exit; }
 
#define CHECK_FAKEIMPORT_2(_opt)   if (fake_import==1) { M4_LOG(GF_LOG_ERROR, ("Option %s not available for cat or self-reference import\n", _opt)); e = GF_BAD_PARAM; goto exit; }
 

Functions

GF_Err set_file_udta (GF_ISOFile *dest, u32 tracknum, u32 udta_type, char *src, Bool is_box_array, Bool is_string)
 
void scene_coding_log (void *cbk, GF_LOG_Level log_level, GF_LOG_Tool log_tool, const char *fmt, va_list vlist)
 
GF_Err convert_file_info (char *inName, TrackIdentifier *track_id)
 
static GF_Err set_chapter_track (GF_ISOFile *file, u32 track, u32 chapter_ref_trak)
 
GF_Err parse_fracs (char *str, GF_Fraction64 *f, GF_Fraction64 *dur)
 
Bool scan_color (char *val, u32 *clr_prim, u32 *clr_tranf, u32 *clr_mx, Bool *clr_full_range)
 
static GF_Err set_dv_profile (GF_ISOFile *dest, u32 track, char *dv_profile_str)
 
GF_Err apply_edits (GF_ISOFile *dest, u32 track, char *edits)
 
GF_Err import_file (GF_ISOFile *dest, char *inName, u32 import_flags, GF_Fraction force_fps, u32 frames_per_sample, GF_FilterSession *fsess, char **mux_args_if_first_pass, char **mux_sid_if_first_pass, u32 tk_idx)
 
static Bool on_split_event (void *_udta, GF_Event *evt)
 
GF_Err split_isomedia_file (GF_ISOFile *mp4, Double split_dur, u64 split_size_kb, char *inName, Double InterleavingTime, Double chunk_start_time, u32 adjust_split_end, char *outName, Bool force_rap_split, const char *split_range_str, u32 fs_dump_flags)
 
GF_Err cat_multiple_files (GF_ISOFile *dest, char *fileName, u32 import_flags, GF_Fraction force_fps, u32 frames_per_sample, Bool force_cat, Bool align_timelines, Bool allow_add_in_command)
 
static Bool merge_parameter_set (GF_List *src, GF_List *dst, const char *name)
 
static u32 merge_avc_config (GF_ISOFile *dest, u32 tk_id, GF_ISOFile **o_orig, u32 src_track, Bool force_cat, u32 *orig_nal_len, u32 *dst_nal_len)
 
static u32 merge_hevc_config (GF_ISOFile *dest, u32 tk_id, GF_ISOFile **o_orig, u32 src_track, Bool force_cat, u32 *orig_nal_len, u32 *dst_nal_len)
 
static GF_Err rewrite_nal_size_field (GF_ISOSample *samp, u32 orig_nal_len, u32 dst_nal_len)
 
GF_Err cat_playlist (GF_ISOFile *dest, char *playlistName, u32 import_flags, GF_Fraction force_fps, u32 frames_per_sample, Bool force_cat, Bool align_timelines, Bool allow_add_in_command)
 
GF_Err cat_isomedia_file (GF_ISOFile *dest, char *fileName, u32 import_flags, GF_Fraction force_fps, u32 frames_per_sample, Bool force_cat, Bool align_timelines, Bool allow_add_in_command, Bool is_pl)
 
Bool cat_enumerate (void *cbk, char *szName, char *szPath, GF_FileEnumInfo *file_info)
 
GF_Err EncodeFile (char *in, GF_ISOFile *mp4, GF_SMEncodeOptions *opts, FILE *logs)
 
static u32 GetNbBits (u32 MaxVal)
 
GF_Err EncodeBIFSChunk (GF_SceneManager *ctx, char *bifsOutputFile, GF_Err(*AUCallback)(GF_ISOSample *))
 
GF_Err EncodeFileChunk (char *chunkFile, char *bifs, char *inputContext, char *outputContext)
 
void sax_node_start (void *sax_cbck, const char *node_name, const char *name_space, const GF_XMLAttribute *attributes, u32 nb_attributes)
 
static Bool wgt_enum_files (void *cbck, char *file_name, char *file_path, GF_FileEnumInfo *file_info)
 
static Bool wgt_enum_dir (void *cbck, char *file_name, char *file_path, GF_FileEnumInfo *file_info)
 
GF_ISOFile * package_file (char *file_name, char *fcc, Bool make_wgt)
 
GF_Err apply_high_dynamc_range_xml_desc (GF_ISOFile *movie, u32 track, char *file_name)
 

Variables

u32 swf_flags
 
Double swf_flatten_angle
 
Bool keep_sys_tracks
 
u32 fs_dump_flags
 
static const char * videofmt_names [] = { "component", "pal", "ntsc", "secam", "mac", "undef"}
 
u32 do_flat
 
Bool do_frag
 
Bool use_mfra
 
Double interleaving_time
 

Data Structure Documentation

◆ WGTEnum

struct WGTEnum
Data Fields
const char * root_file
const char * dir
GF_List * imports

◆ SplitInfo

struct SplitInfo
Data Fields
Double progress
u32 file_idx

◆ CATEnum

struct CATEnum
+ Collaboration diagram for CATEnum:
Data Fields
char szPath[GF_MAX_PATH]
char szRad1[1024]
char szRad2[1024]
char szOpt[200]
GF_ISOFile * dest
u32 import_flags
GF_Fraction force_fps
u32 frames_per_sample
Bool force_cat
Bool align_timelines
Bool allow_add_in_command

Macro Definition Documentation

◆ GOTO_EXIT

#define GOTO_EXIT (   _msg)    if (e) { fail_msg = _msg; goto exit; }

◆ CHECK_FAKEIMPORT

#define CHECK_FAKEIMPORT (   _opt)    if (fake_import) { M4_LOG(GF_LOG_ERROR, ("Option %s not available for cat or self-reference import\n", _opt)); e = GF_BAD_PARAM; goto exit; }

◆ CHECK_FAKEIMPORT_2

#define CHECK_FAKEIMPORT_2 (   _opt)    if (fake_import==1) { M4_LOG(GF_LOG_ERROR, ("Option %s not available for cat or self-reference import\n", _opt)); e = GF_BAD_PARAM; goto exit; }

Function Documentation

◆ set_file_udta()

GF_Err set_file_udta ( GF_ISOFile *  dest,
u32  tracknum,
u32  udta_type,
char *  src,
Bool  is_box_array,
Bool  is_string 
)
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ scene_coding_log()

void scene_coding_log ( void *  cbk,
GF_LOG_Level  log_level,
GF_LOG_Tool  log_tool,
const char *  fmt,
va_list  vlist 
)
+ Here is the caller graph for this function:

◆ convert_file_info()

GF_Err convert_file_info ( char *  inName,
TrackIdentifier track_id 
)
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ set_chapter_track()

static GF_Err set_chapter_track ( GF_ISOFile *  file,
u32  track,
u32  chapter_ref_trak 
)
static
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ parse_fracs()

GF_Err parse_fracs ( char *  str,
GF_Fraction64 f,
GF_Fraction64 dur 
)
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ scan_color()

Bool scan_color ( char *  val,
u32 clr_prim,
u32 clr_tranf,
u32 clr_mx,
Bool clr_full_range 
)
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ set_dv_profile()

static GF_Err set_dv_profile ( GF_ISOFile *  dest,
u32  track,
char *  dv_profile_str 
)
static
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ apply_edits()

GF_Err apply_edits ( GF_ISOFile *  dest,
u32  track,
char *  edits 
)
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ import_file()

GF_Err import_file ( GF_ISOFile *  dest,
char *  inName,
u32  import_flags,
GF_Fraction  force_fps,
u32  frames_per_sample,
GF_FilterSession *  fsess,
char **  mux_args_if_first_pass,
char **  mux_sid_if_first_pass,
u32  tk_idx 
)
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ on_split_event()

static Bool on_split_event ( void *  _udta,
GF_Event evt 
)
static
+ Here is the caller graph for this function:

◆ split_isomedia_file()

GF_Err split_isomedia_file ( GF_ISOFile *  mp4,
Double  split_dur,
u64  split_size_kb,
char *  inName,
Double  InterleavingTime,
Double  chunk_start_time,
u32  adjust_split_end,
char *  outName,
Bool  force_rap_split,
const char *  split_range_str,
u32  fs_dump_flags 
)
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ cat_multiple_files()

GF_Err cat_multiple_files ( GF_ISOFile *  dest,
char *  fileName,
u32  import_flags,
GF_Fraction  force_fps,
u32  frames_per_sample,
Bool  force_cat,
Bool  align_timelines,
Bool  allow_add_in_command 
)
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ merge_parameter_set()

static Bool merge_parameter_set ( GF_List *  src,
GF_List *  dst,
const char *  name 
)
static
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ merge_avc_config()

static u32 merge_avc_config ( GF_ISOFile *  dest,
u32  tk_id,
GF_ISOFile **  o_orig,
u32  src_track,
Bool  force_cat,
u32 orig_nal_len,
u32 dst_nal_len 
)
static
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ merge_hevc_config()

static u32 merge_hevc_config ( GF_ISOFile *  dest,
u32  tk_id,
GF_ISOFile **  o_orig,
u32  src_track,
Bool  force_cat,
u32 orig_nal_len,
u32 dst_nal_len 
)
static
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ rewrite_nal_size_field()

static GF_Err rewrite_nal_size_field ( GF_ISOSample samp,
u32  orig_nal_len,
u32  dst_nal_len 
)
static
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ cat_playlist()

GF_Err cat_playlist ( GF_ISOFile *  dest,
char *  playlistName,
u32  import_flags,
GF_Fraction  force_fps,
u32  frames_per_sample,
Bool  force_cat,
Bool  align_timelines,
Bool  allow_add_in_command 
)
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ cat_isomedia_file()

GF_Err cat_isomedia_file ( GF_ISOFile *  dest,
char *  fileName,
u32  import_flags,
GF_Fraction  force_fps,
u32  frames_per_sample,
Bool  force_cat,
Bool  align_timelines,
Bool  allow_add_in_command,
Bool  is_pl 
)
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ cat_enumerate()

Bool cat_enumerate ( void *  cbk,
char *  szName,
char *  szPath,
GF_FileEnumInfo file_info 
)
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ EncodeFile()

GF_Err EncodeFile ( char *  in,
GF_ISOFile *  mp4,
GF_SMEncodeOptions opts,
FILE *  logs 
)
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ GetNbBits()

static u32 GetNbBits ( u32  MaxVal)
static
+ Here is the caller graph for this function:

◆ EncodeBIFSChunk()

GF_Err EncodeBIFSChunk ( GF_SceneManager ctx,
char *  bifsOutputFile,
GF_Err(*)(GF_ISOSample *)  AUCallback 
)
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ EncodeFileChunk()

GF_Err EncodeFileChunk ( char *  chunkFile,
char *  bifs,
char *  inputContext,
char *  outputContext 
)
Parameters
chunkFileBT chunk to be encoded
bifsoutput file name for the BIFS data
inputContextinitial BT upon which the chunk is based (shall not be NULL)
outputContextfile name to dump the context after applying the new chunk to the input context can be NULL, without .bt
tmpdircan be NULL
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ sax_node_start()

void sax_node_start ( void *  sax_cbck,
const char *  node_name,
const char *  name_space,
const GF_XMLAttribute attributes,
u32  nb_attributes 
)
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ wgt_enum_files()

static Bool wgt_enum_files ( void *  cbck,
char *  file_name,
char *  file_path,
GF_FileEnumInfo file_info 
)
static
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ wgt_enum_dir()

static Bool wgt_enum_dir ( void *  cbck,
char *  file_name,
char *  file_path,
GF_FileEnumInfo file_info 
)
static
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ package_file()

GF_ISOFile* package_file ( char *  file_name,
char *  fcc,
Bool  make_wgt 
)
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ apply_high_dynamc_range_xml_desc()

GF_Err apply_high_dynamc_range_xml_desc ( GF_ISOFile *  movie,
u32  track,
char *  file_name 
)
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

Variable Documentation

◆ swf_flags

u32 swf_flags
extern

◆ swf_flatten_angle

Double swf_flatten_angle
extern

◆ keep_sys_tracks

Bool keep_sys_tracks
extern

◆ fs_dump_flags

u32 fs_dump_flags
extern

◆ videofmt_names

const char* videofmt_names[] = { "component", "pal", "ntsc", "secam", "mac", "undef"}
static

◆ do_flat

u32 do_flat
extern

◆ do_frag

Bool do_frag
extern

◆ use_mfra

Bool use_mfra

◆ interleaving_time

Double interleaving_time
extern