Scene management for importing/encoding of BIFS, XMT, LASeR scenes.  
More...
 | 
| enum   | { GF_SM_AU_RAP = 1
, GF_SM_AU_NOT_AGGREGATED = 1<<1
, GF_SM_AU_MODIFIED = 1<<2
, GF_SM_AU_CAROUSEL = 1<<3
 } | 
|   | 
| enum   | {  
  GF_SM_SWF_STATIC_DICT = 1
, GF_SM_SWF_NO_TEXT = (1<<1)
, GF_SM_SWF_NO_FONT = (1<<2)
, GF_SM_SWF_QUAD_CURVE = (1<<3)
,  
  GF_SM_SWF_NO_LINE = (1<<4)
, GF_SM_SWF_SCALABLE_LINE = (1<<5)
, GF_SM_SWF_NO_GRADIENT = (1<<6)
, GF_SM_SWF_SPLIT_TIMELINE = (1<<7)
,  
  GF_SM_SWF_REUSE_APPEARANCE = (1<<9)
, GF_SM_SWF_USE_IC2D = (1<<10)
, GF_SM_SWF_USE_SVG = (1<<11)
 
 } | 
|   | 
| enum   | {  
  GF_SM_LOAD_MPEG4_STRICT = 1
, GF_SM_LOAD_FOR_PLAYBACK = 1<<1
, GF_SM_LOAD_CONTEXT_READY = 1<<2
, GF_SM_LOAD_CONTEXT_STREAMING = 1<<3
,  
  GF_SM_LOAD_EMBEDS_RES = 1<<4
 
 } | 
|   | 
| enum   | GF_SceneManager_LoadType {  
  GF_SM_LOAD_BT = 1
, GF_SM_LOAD_VRML
, GF_SM_LOAD_X3DV
, GF_SM_LOAD_XMTA
,  
  GF_SM_LOAD_X3D
, GF_SM_LOAD_SVG
, GF_SM_LOAD_XSR
, GF_SM_LOAD_DIMS
,  
  GF_SM_LOAD_SWF
, GF_SM_LOAD_QT
, GF_SM_LOAD_MP4
 
 } | 
|   | 
| enum   | { GF_SM_ENCODE_USE_NAMES = 1
, GF_SM_ENCODE_RAP_INBAND = 2
, GF_SM_ENCODE_RAP_SHADOW = 4
 } | 
|   | 
| enum   | GF_SceneDumpFormat {  
  GF_SM_DUMP_BT = 0
, GF_SM_DUMP_XMTA
, GF_SM_DUMP_VRML
, GF_SM_DUMP_X3D_VRML
,  
  GF_SM_DUMP_X3D_XML
, GF_SM_DUMP_LASER
, GF_SM_DUMP_SVG
, GF_SM_DUMP_XML
,  
  GF_SM_DUMP_AUTO_TXT
, GF_SM_DUMP_AUTO_XML
, GF_SM_DUMP_NONE
 
 } | 
|   | 
 | 
| Bool  | gf_node_in_table (GF_Node *node, u32 NDTType) | 
|   | 
| GF_SceneManager *  | gf_sm_new (GF_SceneGraph *scene_graph) | 
|   | 
| void  | gf_sm_del (GF_SceneManager *sman) | 
|   | 
| GF_StreamContext *  | gf_sm_stream_new (GF_SceneManager *sman, u16 ES_ID, u8 streamType, u32 codec_id) | 
|   | 
| GF_StreamContext *  | gf_sm_stream_find (GF_SceneManager *sman, u16 ES_ID) | 
|   | 
| GF_AUContext *  | gf_sm_stream_au_new (GF_StreamContext *stream, u64 timing, Double time_ms, Bool isRap) | 
|   | 
| GF_MuxInfo *  | gf_sm_get_mux_info (GF_ESD *src) | 
|   | 
| GF_Err  | gf_sm_aggregate (GF_SceneManager *sman, u16 ESID) | 
|   | 
| GF_Err  | gf_sm_import_bifs_subtitle (GF_SceneManager *sman, GF_ESD *src, GF_MuxInfo *mux) | 
|   | 
| GF_Err  | gf_sm_load_init (GF_SceneLoader *sload) | 
|   | 
| GF_Err  | gf_sm_load_run (GF_SceneLoader *sload) | 
|   | 
| void  | gf_sm_load_done (GF_SceneLoader *sload) | 
|   | 
| GF_Err  | gf_sm_load_string (GF_SceneLoader *sload, const char *str, Bool clean_at_end) | 
|   | 
| GF_Err  | gf_sm_encode_to_file (GF_SceneManager *sman, GF_ISOFile *mp4, GF_SMEncodeOptions *opt) | 
|   | 
| GF_Err  | gf_sm_dump (GF_SceneManager *sman, char *rad_name, Bool is_final_name, GF_SceneDumpFormat dump_mode) | 
|   | 
| GF_SceneDumper *  | gf_sm_dumper_new (GF_SceneGraph *graph, char *rad_name, Bool is_final_name, char indent_char, GF_SceneDumpFormat dump_mode) | 
|   | 
| void  | gf_sm_dumper_del (GF_SceneDumper *sdump) | 
|   | 
| void  | gf_sm_dumper_set_extra_graph (GF_SceneDumper *sdump, GF_SceneGraph *extra) | 
|   | 
| char *  | gf_sm_dump_get_name (GF_SceneDumper *sdump) | 
|   | 
| GF_Err  | gf_sm_dump_command_list (GF_SceneDumper *sdump, GF_List *comList, u32 indent, Bool skip_first_replace) | 
|   | 
| GF_Err  | gf_sm_dump_graph (GF_SceneDumper *sdump, Bool skip_proto, Bool skip_routes) | 
|   | 
| GF_StatManager *  | gf_sm_stats_new () | 
|   | 
| void  | gf_sm_stats_del (GF_StatManager *sstat) | 
|   | 
| void  | gf_sm_stats_reset (GF_StatManager *sstat) | 
|   | 
| const GF_SceneStatistics *  | gf_sm_stats_get (GF_StatManager *sstat) | 
|   | 
| GF_Err  | gf_sm_stats_for_graph (GF_StatManager *sstat, GF_SceneGraph *sg) | 
|   | 
| GF_Err  | gf_sm_stats_for_scene (GF_StatManager *sstat, GF_SceneManager *sman) | 
|   | 
| GF_Err  | gf_sm_stats_for_command (GF_StatManager *sstat, GF_Command *com) | 
|   | 
Scene management for importing/encoding of BIFS, XMT, LASeR scenes. 
This section documents the Scene manager used for importing/encoding of BIFS, XMT, LASeR scenes. 
◆ GF_AUContext
Generic systems access unit context 
| Data Fields | 
| 
u64 | 
timing | 
 | 
| 
Double | 
timing_sec | 
 | 
| 
GF_List * | 
commands | 
 | 
| 
u32 | 
flags | 
 | 
| 
struct _stream_context * | 
owner | 
 | 
 
 
◆ GF_StreamContext
| Data Fields | 
| 
u16 | 
ESID | 
 | 
| 
char * | 
name | 
 | 
| 
u8 | 
streamType | 
 | 
| 
u32 | 
codec_id | 
 | 
| 
u32 | 
timeScale | 
 | 
| 
GF_List * | 
AUs | 
 | 
| 
u64 | 
last_au_time | 
 | 
| 
Bool | 
in_root_od | 
 | 
| 
u32 | 
current_au_count | 
 | 
| 
u8 * | 
dec_cfg | 
 | 
| 
u32 | 
dec_cfg_len | 
 | 
| 
u64 | 
imp_exp_time | 
 | 
| 
u16 | 
aggregate_on_esid | 
 | 
| 
u32 | 
carousel_period | 
 | 
| 
Bool | 
disable_aggregation | 
 | 
 
 
◆ GF_SceneManager
Generic presentation context 
 
| Data Fields | 
| 
GF_SceneGraph * | 
scene_graph | 
 | 
| 
GF_List * | 
streams | 
 | 
| 
GF_ObjectDescriptor * | 
root_od | 
 | 
| 
u32 | 
scene_width | 
 | 
| 
u32 | 
scene_height | 
 | 
| 
Bool | 
is_pixel_metrics | 
 | 
| 
u32 | 
max_node_id | 
 | 
| 
u32 | 
max_route_id | 
 | 
| 
u32 | 
max_proto_id | 
 | 
 
 
◆ GF_SceneLoader
| Data Fields | 
| 
GF_SceneManager_LoadType | 
type | 
 loader type, one of the above value. If not set, detected based on file extension  
 | 
| 
GF_SceneGraph * | 
scene_graph | 
 scene graph worked on - may be NULL if ctx is present  
 | 
| 
struct _gf_scene * | 
is | 
 inline scene  
 | 
| 
GF_SceneManager * | 
ctx | 
 context manager to load (MUST BE RESETED BEFORE if needed) - may be NULL for loaders not using commands, in which case the graph will be directly updated  
 | 
| 
const char * | 
fileName | 
 file to import except IsoMedia files  
 | 
| 
const char * | 
src_url | 
original URL for the file or NULL if same as fileName  | 
| 
GF_ISOFile * | 
isom | 
 IsoMedia file to import (we need to be able to load from an opened file for scene stats)  
 | 
| 
u32 | 
swf_import_flags | 
 swf import flags  
 | 
| 
Float | 
swf_flatten_limit | 
 swf flatten limit: angle limit below which 2 lines are considered as aligned, in which case the lines are merged as one. If 0, no flattening happens  
 | 
| 
const char * | 
localPath | 
 swf extraction path: if set, swf media (mp3, jpeg) are extracted to this path. If not set media are extracted to original file directory  
 | 
| 
const char * | 
svgOutFile | 
 carrying svgOutFile when the loader is used by a SceneDumper  
 | 
| 
u32 | 
flags | 
 loader flags  
 | 
| 
u16 | 
force_es_id | 
 force stream ID  
 | 
 
 
◆ GF_SMEncodeOptions
      
        
          | struct GF_SMEncodeOptions | 
        
      
 
Scenegraph Encoder options 
| Data Fields | 
| 
u32 | 
flags | 
 | 
| 
u32 | 
rap_freq | 
 | 
| 
char * | 
mediaSource | 
 | 
| 
s32 | 
resolution | 
 | 
| 
u32 | 
coord_bits | 
 | 
| 
u32 | 
scale_bits | 
 | 
| 
u32 | 
auto_quant | 
 | 
| 
const char * | 
src_url | 
 | 
 
 
◆ GF_NodeStats
| Data Fields | 
| 
u32 | 
tag | 
 | 
| 
const char * | 
name | 
 | 
| 
u32 | 
nb_created | 
 | 
| 
u32 | 
nb_used | 
 | 
| 
u32 | 
nb_del | 
 | 
 
 
◆ GF_SceneStatistics
      
        
          | struct GF_SceneStatistics | 
        
      
 
 
◆ anonymous enum
Scene manager AU flags 
| Enumerator | 
|---|
| GF_SM_AU_RAP  |  | 
| GF_SM_AU_NOT_AGGREGATED  |  | 
| GF_SM_AU_MODIFIED  |  | 
| GF_SM_AU_CAROUSEL  |  | 
 
 
◆ anonymous enum
SWF to MPEG-4 flags 
| Enumerator | 
|---|
| GF_SM_SWF_STATIC_DICT  |  | 
| GF_SM_SWF_NO_TEXT  |  | 
| GF_SM_SWF_NO_FONT  |  | 
| GF_SM_SWF_QUAD_CURVE  |  | 
| GF_SM_SWF_NO_LINE  |  | 
| GF_SM_SWF_SCALABLE_LINE  |  | 
| GF_SM_SWF_NO_GRADIENT  |  | 
| GF_SM_SWF_SPLIT_TIMELINE  |  | 
| GF_SM_SWF_REUSE_APPEARANCE  |  | 
| GF_SM_SWF_USE_IC2D  |  | 
| GF_SM_SWF_USE_SVG  |  | 
 
 
◆ anonymous enum
general loader flags 
| Enumerator | 
|---|
| GF_SM_LOAD_MPEG4_STRICT  |  | 
| GF_SM_LOAD_FOR_PLAYBACK  |  | 
| GF_SM_LOAD_CONTEXT_READY  |  | 
| GF_SM_LOAD_CONTEXT_STREAMING  |  | 
| GF_SM_LOAD_EMBEDS_RES  |  | 
 
 
◆ GF_SceneManager_LoadType
loader type, usually detected based on file ext 
| Enumerator | 
|---|
| GF_SM_LOAD_BT  |  | 
| GF_SM_LOAD_VRML  |  | 
| GF_SM_LOAD_X3DV  |  | 
| GF_SM_LOAD_XMTA  |  | 
| GF_SM_LOAD_X3D  |  | 
| GF_SM_LOAD_SVG  |  | 
| GF_SM_LOAD_XSR  |  | 
| GF_SM_LOAD_DIMS  |  | 
| GF_SM_LOAD_SWF  |  | 
| GF_SM_LOAD_QT  |  | 
| GF_SM_LOAD_MP4  |  | 
 
 
◆ anonymous enum
encoding flags 
| Enumerator | 
|---|
| GF_SM_ENCODE_USE_NAMES  |  | 
| GF_SM_ENCODE_RAP_INBAND  |  | 
| GF_SM_ENCODE_RAP_SHADOW  |  | 
 
 
◆ GF_SceneDumpFormat
Scenegraph dump mode 
| Enumerator | 
|---|
| GF_SM_DUMP_BT  |  | 
| GF_SM_DUMP_XMTA  |  | 
| GF_SM_DUMP_VRML  |  | 
| GF_SM_DUMP_X3D_VRML  |  | 
| GF_SM_DUMP_X3D_XML  |  | 
| GF_SM_DUMP_LASER  |  | 
| GF_SM_DUMP_SVG  |  | 
| GF_SM_DUMP_XML  |  | 
| GF_SM_DUMP_AUTO_TXT  |  | 
| GF_SM_DUMP_AUTO_XML  |  | 
| GF_SM_DUMP_NONE  |  | 
 
 
◆ gf_node_in_table()
Node data type check. This handles prototype nodes, and assumes undefined nodes always belong to the desired NDT 
- Parameters
 - 
  
    | node | the node to check  | 
    | NDTType | the parent NDT type  | 
  
   
- Returns
 - GF_TRUE if node belongs to given NDT. 
 
 
 
◆ gf_sm_new()
scene manager constructor 
- Parameters
 - 
  
    | scene_graph | scene graph used by the manager  | 
  
   
- Returns
 - a new scene manager object 
 
 
 
◆ gf_sm_del()
scene manager destructor - does not destroy the attached scene graph 
- Parameters
 - 
  
    | sman | the target scene manager  | 
  
   
 
 
◆ gf_sm_stream_new()
retrive or create a stream context in the presentation context 
- Warning
 - if a stream with the same streamType and no ESID already exists in the context, it is assigned the requested ES_ID - this is needed to solve base layer 
 
- Parameters
 - 
  
    | sman | the target scene manager  | 
    | ES_ID | ID of the new stream  | 
    | streamType | stream type of the new stream  | 
    | codec_id | codec ID of the new stream  | 
  
   
- Returns
 - a new scene manager stream context 
 
 
 
◆ gf_sm_stream_find()
locates a stream based on its id 
- Parameters
 - 
  
    | sman | the target scene manager  | 
    | ES_ID | ID of the new stream  | 
  
   
- Returns
 - the stream context or NULL if not found 
 
 
 
◆ gf_sm_stream_au_new()
create a new AU context in the given stream context 
- Parameters
 - 
  
    | stream | the traget stream context  | 
    | timing | the timing in stream timescale  | 
    | time_ms | the timing in ms  | 
    | isRap | indicates of the AU is a RAP or not  | 
  
   
- Returns
 - a new scene manager AU context 
 
 
 
◆ gf_sm_get_mux_info()
locates a MuxInfo descriptor in an EDD 
- Parameters
 - 
  
  
 
- Returns
 - a mux info descriptor or NULL if none found 
 
 
 
◆ gf_sm_aggregate()
applies all commands in all streams (only BIFS for now): the context manager will only have maximum one AU per stream, this AU being a random access for the stream
- Parameters
 - 
  
    | sman | the target scene manager  | 
    | ESID | if set, aggregation is only performed on the given stream, otherwise on all streams  | 
  
   
- Returns
 - error if any 
 
 
 
◆ gf_sm_import_bifs_subtitle()
translates SRT/SUB (TTXT not supported) source into BIFS command stream source
- Parameters
 - 
  
    | sman | the target scene manager  | 
    | src | GF_ESD of new stream (MUST be created before to store TS resolution)  | 
    | mux | GF_MuxInfo of src stream - shall contain a valid file, and at least the textNode member set  | 
  
   
- Returns
 - error if any 
 
 
 
◆ gf_sm_load_init()
initializes the context loader - this will load any IOD and the first frame of the main scene 
- Parameters
 - 
  
    | sload | a preallocated, uninitialized loader  | 
  
   
- Returns
 - error if any 
 
 
 
◆ gf_sm_load_run()
completely loads context 
- Parameters
 - 
  
    | sload | the target scene loader  | 
  
   
- Returns
 - error if any 
 
 
 
◆ gf_sm_load_done()
terminates the context loader 
- Parameters
 - 
  
    | sload | the target scene loader  | 
  
   
 
 
◆ gf_sm_load_string()
parses memory scene (any textural format) into the context 
- Warning
 - LOADER TYPE MUST BE ASSIGNED (BT/WRL/XMT/X3D/SVG only)
 
- Parameters
 - 
  
    | sload | the target scene loader  | 
    | str | the string to load; MUST be at least 4 bytes long in order to detect BOM (unicode encoding); can be either UTF-8 or UTF-16 data  | 
    | clean_at_end | if GF_TRUE, associated parser is terminated. Otherwise, a call to gf_sm_load_done must be done to clean resources (needed for SAX progressive loading)  | 
  
   
- Returns
 - error if any 
 
 
 
◆ gf_sm_encode_to_file()
encodes scene context into a destination MP4 file 
- Parameters
 - 
  
    | sman | the target scene manager  | 
    | mp4 | the destination ISOBMFF file  | 
    | opt | the encoding options  | 
  
   
- Returns
 - error if any 
 
 
 
◆ gf_sm_dump()
dumps scene context to a given format 
- Parameters
 - 
  
    | sman | the target scene manager  | 
    | rad_name | file name & loc without extension - if NULL dump will happen in stdout  | 
    | is_final_name | if set, no extension is added to the filename  | 
    | dump_mode | scene dum mode  | 
  
   
- Returns
 - error if any 
 
 
 
◆ gf_sm_dumper_new()
      
        
          | GF_SceneDumper * gf_sm_dumper_new  | 
          ( | 
          GF_SceneGraph *  | 
          graph,  | 
        
        
           | 
           | 
          char *  | 
          rad_name,  | 
        
        
           | 
           | 
          Bool  | 
          is_final_name,  | 
        
        
           | 
           | 
          char  | 
          indent_char,  | 
        
        
           | 
           | 
          GF_SceneDumpFormat  | 
          dump_mode  | 
        
        
           | 
          ) | 
           |  | 
        
      
 
creates a scene dumper 
- Parameters
 - 
  
    | graph | scene graph being dumped  | 
    | rad_name | file radical (NULL for stdout) - if not NULL MUST BE GF_MAX_PATH length  | 
    | is_final_name | if set, rad_name is the final name (no extension added)  | 
    | indent_char | indent format  | 
    | dump_mode | if set, dumps in XML format otherwise regular text  | 
  
   
- Returns
 - a new scene dumper object, or NULL if error 
 
 
 
◆ gf_sm_dumper_del()
      
        
          | void gf_sm_dumper_del  | 
          ( | 
          GF_SceneDumper *  | 
          sdump | ) | 
           | 
        
      
 
destroys a scene dumper 
- Parameters
 - 
  
    | sdump | the target scene dumper  | 
  
   
 
 
◆ gf_sm_dumper_set_extra_graph()
      
        
          | void gf_sm_dumper_set_extra_graph  | 
          ( | 
          GF_SceneDumper *  | 
          sdump,  | 
        
        
           | 
           | 
          GF_SceneGraph *  | 
          extra  | 
        
        
           | 
          ) | 
           |  | 
        
      
 
adds extra graph to scene dumper (all graphs will be dumped) 
- Parameters
 - 
  
    | sdump | the target scene dumper  | 
    | extra | scene graph to be added  | 
  
   
 
 
◆ gf_sm_dump_get_name()
      
        
          | char * gf_sm_dump_get_name  | 
          ( | 
          GF_SceneDumper *  | 
          sdump | ) | 
           | 
        
      
 
gets a pointer to the filename (rad+ext) of the dumped file 
- Parameters
 - 
  
    | sdump | the target scene dumper  | 
  
   
- Returns
 - null if no file has been dumped 
 
 
 
◆ gf_sm_dump_command_list()
      
        
          | GF_Err gf_sm_dump_command_list  | 
          ( | 
          GF_SceneDumper *  | 
          sdump,  | 
        
        
           | 
           | 
          GF_List *  | 
          comList,  | 
        
        
           | 
           | 
          u32  | 
          indent,  | 
        
        
           | 
           | 
          Bool  | 
          skip_first_replace  | 
        
        
           | 
          ) | 
           |  | 
        
      
 
dumps commands list 
- Parameters
 - 
  
    | sdump | the target scene dumper  | 
    | comList | list of commands to dump  | 
    | indent | indent to use  | 
    | skip_first_replace | if GF_TRUE and dumping in BT mode, the initial REPLACE SCENE header is skipped  | 
  
   
- Returns
 - error if any 
 
 
 
◆ gf_sm_dump_graph()
      
        
          | GF_Err gf_sm_dump_graph  | 
          ( | 
          GF_SceneDumper *  | 
          sdump,  | 
        
        
           | 
           | 
          Bool  | 
          skip_proto,  | 
        
        
           | 
           | 
          Bool  | 
          skip_routes  | 
        
        
           | 
          ) | 
           |  | 
        
      
 
dumps complete graph 
- Parameters
 - 
  
    | sdump | the target scene dumper  | 
    | skip_proto | proto declarations are skipped  | 
    | skip_routes | routes are not dumped  | 
  
   
- Returns
 - error if any 
 
 
 
◆ gf_sm_stats_new()
      
        
          | GF_StatManager * gf_sm_stats_new  | 
          ( | 
           | ) | 
           | 
        
      
 
creates new statitistics manager 
- Returns
 - a new statitistics manager 
 
 
 
◆ gf_sm_stats_del()
      
        
          | void gf_sm_stats_del  | 
          ( | 
          GF_StatManager *  | 
          sstat | ) | 
           | 
        
      
 
destroys a statitistics manager 
- Parameters
 - 
  
    | sstat | the target statitistics manager  | 
  
   
 
 
◆ gf_sm_stats_reset()
      
        
          | void gf_sm_stats_reset  | 
          ( | 
          GF_StatManager *  | 
          sstat | ) | 
           | 
        
      
 
resets statistics 
- Parameters
 - 
  
    | sstat | the target statitistics manager  | 
  
   
 
 
◆ gf_sm_stats_get()
gets statistics report 
- Parameters
 - 
  
    | sstat | the target statitistics manager  | 
  
   
- Returns
 - a scene statistic report or NULL if error 
 
 
 
◆ gf_sm_stats_for_graph()
      
        
          | GF_Err gf_sm_stats_for_graph  | 
          ( | 
          GF_StatManager *  | 
          sstat,  | 
        
        
           | 
           | 
          GF_SceneGraph *  | 
          sg  | 
        
        
           | 
          ) | 
           |  | 
        
      
 
computes statistitics for a complete graph 
- Parameters
 - 
  
    | sstat | the target statitistics manager  | 
    | sg | the scene graph to analyze  | 
  
   
- Returns
 - error if any 
 
 
 
◆ gf_sm_stats_for_scene()
computes statistitics for the full scene 
- Parameters
 - 
  
    | sstat | the target statitistics manager  | 
    | sman | the scene manager to analyze  | 
  
   
- Returns
 - error if any 
 
 
 
◆ gf_sm_stats_for_command()
computes statistitics for the given command 
- Parameters
 - 
  
    | sstat | the target statitistics manager  | 
    | com | the scene command to analyze  | 
  
   
- Returns
 - error if any