libgpac
Documentation of the core library of GPAC
Scene Engine

Live scene encoding engine with RAP generation support. More...

+ Collaboration diagram for Scene Engine:

Typedefs

typedef struct __tag_scene_engine GF_SceneEngine
 
typedef void(* gf_seng_callback) (void *udta, u16 ESID, u8 *data, u32 size, u64 ts)
 

Functions

GF_SceneEnginegf_seng_init (void *calling_object, char *inputContext, u32 load_type, char *dump_path, Bool embed_resources)
 
u32 gf_seng_get_stream_count (GF_SceneEngine *seng)
 
GF_Err gf_seng_get_stream_carousel_info (GF_SceneEngine *seng, u16 ESID, u32 *carousel_period, u16 *aggregate_on_es_id)
 
GF_Err gf_seng_get_stream_config (GF_SceneEngine *seng, u32 idx, u16 *ESID, const u8 **config, u32 *config_len, u32 *streamType, u32 *objectType, u32 *timeScale)
 
GF_Err gf_seng_encode_context (GF_SceneEngine *seng, gf_seng_callback callback)
 
GF_Err gf_seng_encode_from_file (GF_SceneEngine *seng, u16 ESID, Bool disable_aggregation, char *auFile, gf_seng_callback callback)
 
GF_Err gf_seng_encode_from_string (GF_SceneEngine *seng, u16 ESID, Bool disable_aggregation, char *auString, gf_seng_callback callback)
 
GF_Err gf_seng_save_context (GF_SceneEngine *seng, char *ctxFileName)
 
GF_Err gf_seng_enable_aggregation (GF_SceneEngine *seng, u16 ESID, u16 onESID)
 
GF_Err gf_seng_aggregate_context (GF_SceneEngine *seng, u16 ESID)
 
void gf_seng_terminate (GF_SceneEngine *seng)
 
char * gf_seng_get_base64_iod (GF_SceneEngine *seng)
 
GF_Descriptorgf_seng_get_iod (GF_SceneEngine *seng)
 

Detailed Description

This section documents the live scene encoding tools of GPAC.

Typedef Documentation

◆ GF_SceneEngine

typedef struct __tag_scene_engine GF_SceneEngine

scene encoding engine object

◆ gf_seng_callback

typedef void(* gf_seng_callback) (void *udta, u16 ESID, u8 *data, u32 size, u64 ts)

callback function prototype for scene engine

Function Documentation

◆ gf_seng_init()

GF_SceneEngine* gf_seng_init ( void *  calling_object,
char *  inputContext,
u32  load_type,
char *  dump_path,
Bool  embed_resources 
)

creates a scene engine

Parameters
calling_objectis the calling object on which call back will be called
inputContextis the name of a scene file (bt, xmt or mp4) to initialize the coding context
load_typeis the preferred loader type for the content (e.g. SVG vs DIMS)
dump_pathis the path where scenes are dumped
embed_resourcesindicates if images and scripts should be encoded inline with the content
Returns
e scene engine object

◆ gf_seng_get_stream_count()

u32 gf_seng_get_stream_count ( GF_SceneEngine seng)

get the number of streams in the scene

Parameters
sengthe target scene engine
Returns
the number of streams

◆ gf_seng_get_stream_carousel_info()

GF_Err gf_seng_get_stream_carousel_info ( GF_SceneEngine seng,
u16  ESID,
u32 carousel_period,
u16 aggregate_on_es_id 
)

gets carousel nformation for a stream

Parameters
sengthe target scene engine
ESIDID of the stream to query
carousel_periodset to the carousel_period in millisenconds
aggregate_on_es_idset to the target carousel stream ID
Returns
error if any

◆ gf_seng_get_stream_config()

GF_Err gf_seng_get_stream_config ( GF_SceneEngine seng,
u32  idx,
u16 ESID,
const u8 **  config,
u32 config_len,
u32 streamType,
u32 objectType,
u32 timeScale 
)

gets the stream decoder configuration

Parameters
sengthe target scene engine
idxstream index
ESIDset to the stream ID
configset to the encoded BIFS config (memory is not allocated)
config_lenlength of the buffer
streamTypepointer to get stream type
objectTypepointer to get object type
timeScalepointer to get time scale
Returns
error if any

◆ gf_seng_encode_context()

GF_Err gf_seng_encode_context ( GF_SceneEngine seng,
gf_seng_callback  callback 
)

Encodes the AU context which is not encoded when calling BENC_EncodeAUFromString/File. This should be called after Aggregate.

Parameters
sengthe target scene engine
callbackpointer on a callback function to get the result of the coding the AU using the current context
Returns
error if any

◆ gf_seng_encode_from_file()

GF_Err gf_seng_encode_from_file ( GF_SceneEngine seng,
u16  ESID,
Bool  disable_aggregation,
char *  auFile,
gf_seng_callback  callback 
)

Encodes an AU from file

Parameters
sengthe target scene engine
ESIDtarget streams when no indication is present in the file (eg, no atES_ID )
disable_aggregationdo not aggregate the access unit on its target stream
auFilename of a file containing a description for an access unit (BT or XMT)
callbackpointer on a callback function to get the result of the coding the AU using the current context
Returns
error if any

◆ gf_seng_encode_from_string()

GF_Err gf_seng_encode_from_string ( GF_SceneEngine seng,
u16  ESID,
Bool  disable_aggregation,
char *  auString,
gf_seng_callback  callback 
)

Encodes an AU from string

Parameters
sengthe target scene engine
ESIDtarget streams when no indication is present in the file (eg, no atES_ID )
disable_aggregationdo not aggregate the access unit on its target stream
auStringa char string to encode (must one or several complete nodes in BT
callbackpointer on a callback function to get the result of the coding the AU using the current context
Returns
error if any

◆ gf_seng_save_context()

GF_Err gf_seng_save_context ( GF_SceneEngine seng,
char *  ctxFileName 
)

saves the live context to a file. Use BENC_AggregateCurrentContext before to save an aggregated context.

Parameters
sengthe target scene engine
ctxFileNamename of the file to save the current state of the BIFS scene to
Returns
error if any

◆ gf_seng_enable_aggregation()

GF_Err gf_seng_enable_aggregation ( GF_SceneEngine seng,
u16  ESID,
u16  onESID 
)

marks the stream as carrying its own "rap" in the first AU of the stream

Parameters
sengthe target scene engine
ESIDstream ID
onESIDset stream aggragation on to the specified stream, or off if onESID is 0
Returns
error if any

◆ gf_seng_aggregate_context()

GF_Err gf_seng_aggregate_context ( GF_SceneEngine seng,
u16  ESID 
)

aggregates the current context of the seng, creates a scene replace

Parameters
sengthe target scene engine
ESIDstream ID. If not 0, only aggregate commands for this stream; otherwise aggregates for the all streams
Returns
error if any

◆ gf_seng_terminate()

void gf_seng_terminate ( GF_SceneEngine seng)

destroys the scene engine

Parameters
sengthe target scene engine

◆ gf_seng_get_base64_iod()

char* gf_seng_get_base64_iod ( GF_SceneEngine seng)

encodes the IOD for this scene engine into Base64

Parameters
sengthe target scene engine
Returns
the base64 encoded IOD, shall be freed by the caller

◆ gf_seng_get_iod()

GF_Descriptor* gf_seng_get_iod ( GF_SceneEngine seng)

returns the IOD for a scene engine

Parameters
sengthe target scene engine
Returns
the IOD object - shall be destroyed by caller