libgpac
Documentation of the core library of GPAC
Compositor

GPAC A/V/2D/3D compositor/rendering. More...

+ Collaboration diagram for Compositor:

Enumerations

enum  GF_CompositorGrabMode { GF_SC_GRAB_DEPTH_NONE = 0 , GF_SC_GRAB_DEPTH_ONLY = 1 , GF_SC_GRAB_DEPTH_RGBD = 2 , GF_SC_GRAB_DEPTH_RGBDS = 3 }
 
enum  { GF_ASPECT_RATIO_KEEP = 0 , GF_ASPECT_RATIO_16_9 , GF_ASPECT_RATIO_4_3 , GF_ASPECT_RATIO_FILL_SCREEN }
 
enum  { GF_ANTIALIAS_NONE = 0 , GF_ANTIALIAS_TEXT , GF_ANTIALIAS_FULL }
 
enum  { GF_STATE_PLAYING = 0 , GF_STATE_PAUSED , GF_STATE_STEP_PAUSE , GF_STATE_PLAY_LIVE = 10 }
 
enum  { GF_INTERACT_NORMAL = 1 , GF_INTERACT_INPUT_SENSOR = 2 , GF_INTERACT_NAVIGATION = 4 }
 
enum  { GF_BOUNDS_NONE = 0 , GF_BOUNDS_BOX , GF_BOUNDS_AABB }
 
enum  { GF_WIREFRAME_NONE = 0 , GF_WIREFRAME_ONLY , GF_WIREFRAME_SOLID }
 
enum  { GF_NAVIGATE_TYPE_NONE , GF_NAVIGATE_TYPE_2D , GF_NAVIGATE_TYPE_3D }
 
enum  {
  GF_NAVIGATE_NONE = 0 , GF_NAVIGATE_WALK , GF_NAVIGATE_FLY , GF_NAVIGATE_PAN ,
  GF_NAVIGATE_GAME , GF_NAVIGATE_SLIDE , GF_NAVIGATE_EXAMINE , GF_NAVIGATE_ORBIT ,
  GF_NAVIGATE_VR
}
 
enum  { GF_COLLISION_NONE , GF_COLLISION_NORMAL , GF_COLLISION_DISPLACEMENT }
 
enum  { GF_TEXTURE_TEXT_DEFAULT = 0 , GF_TEXTURE_TEXT_NEVER , GF_TEXTURE_TEXT_ALWAYS }
 
enum  { GF_NORMALS_NONE = 0 , GF_NORMALS_FACE , GF_NORMALS_VERTEX }
 
enum  { GF_BACK_CULL_OFF = 0 , GF_BACK_CULL_ON , GF_BACK_CULL_ALPHA }
 
enum  { GF_DRAW_MODE_DEFER =0 , GF_DRAW_MODE_IMMEDIATE , GF_DRAW_MODE_DEFER_DEBUG }
 
enum  GF_CompositorOption {
  GF_OPT_ANTIALIAS =0 , GF_OPT_HIGHSPEED , GF_OPT_FULLSCREEN , GF_OPT_ORIGINAL_VIEW ,
  GF_OPT_OVERRIDE_SIZE , GF_OPT_AUDIO_VOLUME , GF_OPT_AUDIO_PAN , GF_OPT_AUDIO_MUTE ,
  GF_OPT_HAS_JAVASCRIPT , GF_OPT_CAN_SELECT_STREAMS , GF_OPT_INTERACTION_LEVEL , GF_OPT_VISIBLE ,
  GF_OPT_FREEZE_DISPLAY , GF_OPT_IS_FINISHED , GF_OPT_IS_OVER , GF_OPT_ASPECT_RATIO ,
  GF_OPT_REFRESH , GF_OPT_STRESS_MODE , GF_OPT_DRAW_BOUNDS , GF_OPT_TEXTURE_TEXT ,
  GF_OPT_RELOAD_CONFIG , GF_OPT_NAVIGATION_TYPE , GF_OPT_NAVIGATION , GF_OPT_PLAY_STATE ,
  GF_OPT_MAIN_ADDON , GF_OPT_VIDEO_BENCH , GF_OPT_USE_OPENGL , GF_OPT_DRAW_MODE ,
  GF_OPT_SCALABLE_ZOOM , GF_OPT_YUV_HARDWARE , GF_OPT_YUV_FORMAT , GF_OPT_VIDEO_CACHE_SIZE ,
  GF_OPT_HTTP_MAX_RATE , GF_OPT_FORCE_AUDIO_CONFIG , GF_OPT_RASTER_OUTLINES , GF_OPT_EMULATE_POW2 ,
  GF_OPT_POLYGON_ANTIALIAS , GF_OPT_WIREFRAME , GF_OPT_NORMALS , GF_OPT_BACK_CULL ,
  GF_OPT_NO_RECT_TEXTURE , GF_OPT_HEADLIGHT , GF_OPT_COLLISION , GF_OPT_GRAVITY ,
  GF_OPT_NUM_STEREO_VIEWS , GF_OPT_MULTIVIEW_MODE , GF_OPT_ORIENTATION_SENSORS_ACTIVE
}
 

Functions

GF_Err gf_sc_load (GF_Compositor *compositor)
 
void gf_sc_unload (GF_Compositor *compositor)
 
void gf_sc_set_fps (GF_Compositor *compositor, GF_Fraction fps)
 
GF_Err gf_sc_set_scene (GF_Compositor *compositor, GF_SceneGraph *scene_graph)
 
Bool gf_sc_draw_frame (GF_Compositor *compositor, Bool no_video_flush, s32 *ms_till_next)
 
void gf_sc_invalidate (GF_Compositor *compositor, GF_Node *node)
 
void gf_sc_invalidate_next_frame (GF_Compositor *compositor)
 
Bool gf_sc_frame_was_produced (GF_Compositor *compositor)
 
u32 gf_sc_get_clock (GF_Compositor *compositor)
 
void gf_sc_node_destroy (GF_Compositor *compositor, GF_Node *node, GF_SceneGraph *sg)
 
void gf_sc_lock (GF_Compositor *compositor, Bool do_lock)
 
Bool gf_sc_user_event (GF_Compositor *compositor, GF_Event *event)
 
void gf_sc_disconnect (GF_Compositor *compositor)
 
void gf_sc_connect_from_time (GF_Compositor *compositor, const char *URL, u64 startTime, u32 pause_at_first_frame, Bool secondary_scene, const char *parent_path)
 
void gf_sc_map_point (GF_Compositor *compositor, s32 X, s32 Y, Fixed *bifsX, Fixed *bifsY)
 
Double gf_sc_get_fps (GF_Compositor *compositor, Bool absoluteFPS)
 
Bool gf_sc_has_text_selection (GF_Compositor *compositor)
 
const char * gf_sc_get_selected_text (GF_Compositor *compositor)
 
GF_Err gf_sc_paste_text (GF_Compositor *compositor, const char *text)
 
GF_Err gf_sc_add_object (GF_Compositor *compositor, const char *url, Bool auto_play)
 
GF_Err gf_sc_get_screen_buffer (GF_Compositor *compositor, GF_VideoSurface *framebuffer, GF_CompositorGrabMode depth_grab_mode)
 
GF_Err gf_sc_get_offscreen_buffer (GF_Compositor *compositor, GF_VideoSurface *framebuffer, u32 view_idx, GF_CompositorGrabMode depth_grab_mode)
 
GF_Err gf_sc_release_screen_buffer (GF_Compositor *compositor, GF_VideoSurface *framebuffer)
 
void gf_sc_reset_graphics (GF_Compositor *compositor)
 
GF_Err gf_sc_get_viewpoint (GF_Compositor *compositor, u32 viewpoint_idx, const char **out_name, Bool *is_bound)
 
GF_Err gf_sc_set_viewpoint (GF_Compositor *compositor, u32 viewpoint_idx, const char *viewpoint_name)
 
void gf_sc_traverse_subscene (GF_Compositor *compositor, GF_Node *inline_parent, GF_SceneGraph *subscene, void *rs)
 
GF_Err gf_sc_set_size (GF_Compositor *compositor, u32 new_width, u32 new_height)
 
void gf_sc_register_extra_graph (GF_Compositor *compositor, GF_SceneGraph *extra_scene, Bool do_remove)
 
GF_Compositor * gf_sc_get_compositor (GF_Node *node)
 
Bool gf_sc_script_action (GF_Compositor *compositor, GF_JSAPIActionType type, GF_Node *node, GF_JSAPIParam *param)
 
Bool gf_sc_uri_is_hardcoded_proto (GF_Compositor *compositor, const char *uri)
 
void gf_sc_reload_config (GF_Compositor *compositor)
 
u32 gf_sc_get_time_in_ms (GF_Compositor *compositor)
 
void gf_sc_switch_quality (GF_Compositor *compositor, Bool up)
 
void gf_sc_toggle_addons (GF_Compositor *compositor, Bool show_addons)
 
GF_Err gf_sc_set_speed (GF_Compositor *compositor, Fixed speed)
 
Bool gf_sc_is_supported_url (GF_Compositor *compositor, const char *URL, Bool use_parent_url)
 
void gf_sc_navigate_to (GF_Compositor *compositor, const char *toURL)
 
u32 gf_sc_play_from_time (GF_Compositor *compositor, u64 from_time, u32 pause_at_first_frame)
 
GF_Err gf_sc_dump_scene (GF_Compositor *compositor, char *rad_name, char **filename, Bool xml_dump, Bool skip_proto)
 
GF_Err gf_sc_scene_update (GF_Compositor *compositor, char *type, char *com)
 
void gf_sc_select_service (GF_Compositor *compositor, u32 service_id)
 
const char * gf_sc_get_url (GF_Compositor *compositor)
 
const void * gf_sc_get_main_pid (GF_Compositor *compositor)
 
const char * gf_sc_get_world_info (GF_Compositor *compositor, GF_List *descriptions)
 
u32 gf_sc_get_current_service_id (GF_Compositor *compositor)
 
Double gf_sc_get_simulation_frame_rate (GF_Compositor *compositor, u32 *nb_frames_drawn)
 
GF_Err gf_sc_set_option (GF_Compositor *compositor, GF_CompositorOption type, u32 value)
 
u32 gf_sc_get_option (GF_Compositor *compositor, GF_CompositorOption type)
 

Detailed Description

This section documents the compositor of GPAC in charge of assembling audio, images, video, text, 2D and 3D graphics in a timed fashion. The compositor can only be run as a filter starting from GPAC 0.9.0, as it requires the filters API to fetch media data. The compositor can work in real-time mode (player) or as a regular filter. See gpac -h compositorfor more information.

The compositor object is the private data of the compositor filter and can be retrieved using gf_filter_get_udta

The compositor object will look for the following variables in the temp section of the GPAC config:

Enumeration Type Documentation

◆ GF_CompositorGrabMode

compositor screen buffer grab mode

Enumerator
GF_SC_GRAB_DEPTH_NONE 

grab color only

GF_SC_GRAB_DEPTH_ONLY 

grab depth only

GF_SC_GRAB_DEPTH_RGBD 

grab RGB+depth

GF_SC_GRAB_DEPTH_RGBDS 

grab RGB+depth (7 bits) + 1 bit shape from alpha

◆ anonymous enum

anonymous enum

AspectRatio Type

Enumerator
GF_ASPECT_RATIO_KEEP 

keep AR

GF_ASPECT_RATIO_16_9 

keep 16/9

GF_ASPECT_RATIO_4_3 

keep 4/3

GF_ASPECT_RATIO_FILL_SCREEN 

none (all rendering area used)

◆ anonymous enum

anonymous enum

AntiAlias settings

Enumerator
GF_ANTIALIAS_NONE 

no antialiasing

GF_ANTIALIAS_TEXT 

only text has antialiasing

GF_ANTIALIAS_FULL 

full antialiasing

◆ anonymous enum

anonymous enum

PlayState settings

Enumerator
GF_STATE_PLAYING 

compositor is playing (get only)

GF_STATE_PAUSED 

compositor is paused (get only)

GF_STATE_STEP_PAUSE 

On set, compositor will pause after next frame (simulation tick). On get, indicates that rendering step hasn't performed yet

GF_STATE_PLAY_LIVE 

indicates resume shall restart from live point if any rather than pause point (set only)

◆ anonymous enum

anonymous enum

interaction level settings

Note
GF_INTERACT_NORMAL and GF_INTERACT_NAVIGATION filter events. If set, any event processed by these 2 modules won't be forwarded to the user
Enumerator
GF_INTERACT_NORMAL 

regular interactions enabled (touch sensors)

GF_INTERACT_INPUT_SENSOR 

InputSensor interactions enabled (mouse and keyboard)

GF_INTERACT_NAVIGATION 

all navigation interactions enabled (mouse and keyboard)

◆ anonymous enum

anonymous enum

BoundingVolume settings

Enumerator
GF_BOUNDS_NONE 

doesn't draw bounding volume

GF_BOUNDS_BOX 

draw object bounding box / rect

GF_BOUNDS_AABB 

draw object AABB tree (3D only)

◆ anonymous enum

anonymous enum

Wireframe settings

Enumerator
GF_WIREFRAME_NONE 

draw solid volumes

GF_WIREFRAME_ONLY 

draw only wireframe

GF_WIREFRAME_SOLID 

draw wireframe on solid object

◆ anonymous enum

anonymous enum

navigation type

Enumerator
GF_NAVIGATE_TYPE_NONE 

navigation is disabled by content and cannot be forced by user

GF_NAVIGATE_TYPE_2D 

2D navigation modes only can be used

GF_NAVIGATE_TYPE_3D 

3D navigation modes only can be used

◆ anonymous enum

anonymous enum

navigation modes - non-VRML ones are simply blaxxun contact ones

Enumerator
GF_NAVIGATE_NONE 

no navigation

GF_NAVIGATE_WALK 

3D navigation modes

walk navigation

GF_NAVIGATE_FLY 

fly navigation

GF_NAVIGATE_PAN 

pan navigation

GF_NAVIGATE_GAME 

game navigation

GF_NAVIGATE_SLIDE 

slide navigation, for 2D and 3D

GF_NAVIGATE_EXAMINE 

all modes below disable collision detection & gravity in 3D

GF_NAVIGATE_ORBIT 

orbit navigation - 3D only

GF_NAVIGATE_VR 

QT-VR like navigation - 3D only

◆ anonymous enum

anonymous enum

collision flags

Enumerator
GF_COLLISION_NONE 

no collision

GF_COLLISION_NORMAL 

regular collision

GF_COLLISION_DISPLACEMENT 

collision with camera displacement

◆ anonymous enum

anonymous enum

TextTexturing settings

Enumerator
GF_TEXTURE_TEXT_DEFAULT 

text drawn as texture in 3D mode, regular in 2D mode

GF_TEXTURE_TEXT_NEVER 

text never drawn as texture

GF_TEXTURE_TEXT_ALWAYS 

text always drawn

◆ anonymous enum

anonymous enum

Normal drawing settings

Enumerator
GF_NORMALS_NONE 

normals never drawn

GF_NORMALS_FACE 

normals drawn per face (at barycenter)

GF_NORMALS_VERTEX 

normals drawn per vertex

◆ anonymous enum

anonymous enum

Back-face culling mode

Enumerator
GF_BACK_CULL_OFF 

backface culling disabled

GF_BACK_CULL_ON 

backface culliong enabled

GF_BACK_CULL_ALPHA 

backface culling enabled also for transparent meshes

◆ anonymous enum

anonymous enum

2D drawing mode

Enumerator
GF_DRAW_MODE_DEFER 

defer draw mode (only modified parts of the canvas are drawn)

GF_DRAW_MODE_IMMEDIATE 

immediate draw mode (canvas always redrawn)

GF_DRAW_MODE_DEFER_DEBUG 

defer debug draw mode (only modified parts of the canvas are drawn, the rest of the canvas is erased)

◆ GF_CompositorOption

compositor options

Enumerator
GF_OPT_ANTIALIAS 

set/get antialias flag (value: one of the AntiAlias enum) - may be ignored in OpenGL mode depending on graphic cards

GF_OPT_HIGHSPEED 

set/get fast mode (value: boolean)

GF_OPT_FULLSCREEN 

set/get fullscreen flag (value: boolean)

GF_OPT_ORIGINAL_VIEW 

reset top-level transform to original (value: boolean)

GF_OPT_OVERRIDE_SIZE 

overrides BIFS size info for simple AV - this is not recommended since it will resize the window to the size of the biggest texture (thus some elements may be lost)

GF_OPT_AUDIO_VOLUME 

set / get audio volume (value is intensity between 0 and 100)

GF_OPT_AUDIO_PAN 

set / get audio pan (value is pan between 0 (all left) and 100(all right) )

GF_OPT_AUDIO_MUTE 

set / get audio mute

GF_OPT_HAS_JAVASCRIPT 

get javascript flag (no set, depends on compil) - value: boolean, true if JS enabled in build

GF_OPT_CAN_SELECT_STREAMS 

get selectable stream flag (no set) - value: boolean, true if audio/video/subtitle stream selection is possible with content (if an MPEG-4 scene description is not present). Use regular OD browsing to get streams

GF_OPT_INTERACTION_LEVEL 

set/get control interaction, OR'ed combination of interaction flags

GF_OPT_VISIBLE 

set display window visible / get show/hide state

GF_OPT_FREEZE_DISPLAY 

set freeze display on/off / get freeze state freeze_display prevents any screen updates needed when output driver uses direct video memory access

GF_OPT_IS_FINISHED 

Returns 1 if file playback is considered as done (all streams finished, no active time sensors and no user interactions in the scene)

GF_OPT_IS_OVER 

Returns 1 if file timeline is considered as done (all streams finished, no active time sensors)

GF_OPT_ASPECT_RATIO 

set/get aspect ratio (value: one of AspectRatio enum)

GF_OPT_REFRESH 

send a redraw message (SetOption only): all graphics info (display list, vectorial path) is recomputed, and textures are reloaded in HW

GF_OPT_STRESS_MODE 

set/get stress mode (value: boolean) - in stress mode a GF_OPT_FORCE_REDRAW is emulated at each frame

GF_OPT_DRAW_BOUNDS 

get/set bounding volume drawing (value: one of the above option)

GF_OPT_TEXTURE_TEXT 

get/set texture text option - when enabled and usable (that depends on content), text is first rendered to a texture and only the texture is drawn, rather than drawing all the text each time (CPU intensive)

GF_OPT_RELOAD_CONFIG 

reload config file (set only), including drivers. Plugins configs are not reloaded

GF_OPT_NAVIGATION_TYPE 

get: returns whether the content enable navigation and if it's 2D or 3D. set: reset viewpoint (whatever value is given)

GF_OPT_NAVIGATION 

get current navigation mode - set navigation mode if allowed by content - this is not a resident option (eg not stored in cfg)

GF_OPT_PLAY_STATE 

get/set Play state - cf above states for set

GF_OPT_MAIN_ADDON 

get only: returns 1 if main addon is playing, 0 if regular scene is playing

GF_OPT_VIDEO_BENCH 

get/set bench mode - if enabled, video frames are drawn as soon as possible witthout checking synchronisation

GF_OPT_USE_OPENGL 

get/set OpenGL force mode - returns error if OpenGL is not supported

GF_OPT_DRAW_MODE 

set/get draw mode

GF_OPT_SCALABLE_ZOOM 

set/get scalable zoom (value: boolean)

GF_OPT_YUV_HARDWARE 

set/get YUV acceleration (value: boolean)

GF_OPT_YUV_FORMAT 

get (set not supported yet) hardware YUV format (value: YUV 4CC)

GF_OPT_VIDEO_CACHE_SIZE 

max video cache size in kbytes

GF_OPT_HTTP_MAX_RATE 

max HTTP download rate in bits per second, 0 if no limit

GF_OPT_FORCE_AUDIO_CONFIG 

set only (value: boolean). If set, the main audio mixer can no longer be reconfigured.

GF_OPT_RASTER_OUTLINES 

3D ONLY OPTIONS

set/get raster outline flag (value: boolean) - when set, no vectorial outlining is done, only OpenGL raster outline

GF_OPT_EMULATE_POW2 

set/get pow2 emulation flag (value: boolean) - when set, video textures with non power of 2 dimensions are emulated as pow2 by expanding the video buffer (image is not scaled). Otherwise the entire image is rescaled. This flag does not affect image textures, which are always rescaled

GF_OPT_POLYGON_ANTIALIAS 

get/set polygon antialiasing flag (value: boolean) (may be ugly with some cards)

GF_OPT_WIREFRAME 

get/set wireframe flag (value: cf above) (may be ugly with some cards)

GF_OPT_NORMALS 

get/set wireframe flag (value: cf above) (may be ugly with some cards)

GF_OPT_BACK_CULL 

disable backface culling

GF_OPT_NO_RECT_TEXTURE 

get/set RECT Ext flag (value: boolean) - when set, GL rectangular texture extension is not used (but NPO2 texturing is if available)

GF_OPT_HEADLIGHT 

set/get headlight (value: boolean)

GF_OPT_COLLISION 

set/get collision (value: cf above)

GF_OPT_GRAVITY 

set/get gravity

GF_OPT_NUM_STEREO_VIEWS 

get the number of offscreen views in stereo mode, or 1 if no offscreen stereo views are available

GF_OPT_MULTIVIEW_MODE 

set the mode of display of HEVC multiview videos, 0 to display the two views/layers and 1 to display just the first view/layer

GF_OPT_ORIENTATION_SENSORS_ACTIVE 

get orientation sensors flag, true if sensors are activated false if not

Function Documentation

◆ gf_sc_load()

GF_Err gf_sc_load ( GF_Compositor *  compositor)

loads a compositor object

Parameters
compositora preallocated structure for the compositor to initialize
Returns
error if any
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ gf_sc_unload()

void gf_sc_unload ( GF_Compositor *  compositor)

unloads compositor

Parameters
compositorthe compositor object to unload. The structure memory is not freed
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ gf_sc_set_fps()

void gf_sc_set_fps ( GF_Compositor *  compositor,
GF_Fraction  fps 
)

sets simulation frame rate. The compositor framerate impacts the frequency at which time nodes and animations are updated, but does not impact the video objects frame rates.

Parameters
compositorthe target compositor
fpsthe desired frame rate
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ gf_sc_set_scene()

GF_Err gf_sc_set_scene ( GF_Compositor *  compositor,
GF_SceneGraph *  scene_graph 
)

sets the root scene graph of the compositor.

Parameters
compositorthe target compositor
scene_graphthe scene graph to attach. If NULL, removes current scene and resets simulation time
Returns
error if any
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ gf_sc_draw_frame()

Bool gf_sc_draw_frame ( GF_Compositor *  compositor,
Bool  no_video_flush,
s32 ms_till_next 
)

draws a single frame. If the frame is drawn, a packet is sent on the compositor vout output pi

Parameters
compositorthe target compositor
no_video_flushdisables video frame flushing to graphics card. Ignored in non-player mode
ms_till_nextset to the number of milliseconds until next expected frame
Returns
GF_TRUE if there are pending tasks (frame late, fonts pending, etc) or GF_FALSE if everything was ready while drawing the frame
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ gf_sc_invalidate()

void gf_sc_invalidate ( GF_Compositor *  compositor,
GF_Node node 
)

notify the given node has been modified. The compositor filters object to decide whether the scene graph has to be traversed or not.

Parameters
compositorthe target compositor
nodethe node to invalidate. If NULL, this means complete traversing of the graph is requested
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ gf_sc_invalidate_next_frame()

void gf_sc_invalidate_next_frame ( GF_Compositor *  compositor)

mark next frame as required to be refreshed

Parameters
compositorthe target compositor

◆ gf_sc_frame_was_produced()

Bool gf_sc_frame_was_produced ( GF_Compositor *  compositor)

checks if a frame has been produced since last call to gf_sc_invalidate_next_frame. This is typically used when the caller app has no control over flush

Parameters
compositorthe target compositor
Returns
GF_TRUE if frame was produced , GF_FALSE otherwise

◆ gf_sc_get_clock()

u32 gf_sc_get_clock ( GF_Compositor *  compositor)

returns the compositor time. The compositor time is the time every time line is synchronized to

Parameters
compositorthe target compositor
Returns
compositor time in milliseconds
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ gf_sc_node_destroy()

void gf_sc_node_destroy ( GF_Compositor *  compositor,
GF_Node node,
GF_SceneGraph *  sg 
)

signals the node or scenegraph is about to be destroyed. This should be called after the node destructor if any. This function cleans up any pending events on the target node or graph.

Parameters
compositorthe target compositor
nodethe target node. If NULL, sg shall be set to the scenegraph about to be destroyed
sgthe target scenegraph
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ gf_sc_lock()

void gf_sc_lock ( GF_Compositor *  compositor,
Bool  do_lock 
)

locks/unlocks the visual scene rendering. Modifications of the scene tree shall only happen when scene compositor is locked

Parameters
compositorthe target compositor
do_lockindicates if the compositor should be locked (GF_TRUE) or released (GF_FALSE)
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ gf_sc_user_event()

Bool gf_sc_user_event ( GF_Compositor *  compositor,
GF_Event event 
)

notify user input

Parameters
compositorthe target compositor
eventthe target event to notify
Returns
GF_FALSE if event hasn't been handled by the compositor, GF_TRUE otherwise
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ gf_sc_disconnect()

void gf_sc_disconnect ( GF_Compositor *  compositor)

disconnects the current url

Parameters
compositorthe target compositor
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ gf_sc_connect_from_time()

void gf_sc_connect_from_time ( GF_Compositor *  compositor,
const char *  URL,
u64  startTime,
u32  pause_at_first_frame,
Bool  secondary_scene,
const char *  parent_path 
)

connects a given url

Parameters
compositorthe target compositor
URLthe target URL
startTimestart time in milliseconds
pause_at_first_frameindicate if compositor should pause once first frame is reached
  • If 1, pauses at the first frame
  • If 2, pauses at the first frame only if the compositor is in paused state
  • otherwise do not pause
secondary_sceneindicate this is a secondary scene (subs, etc)
parent_pathparent path of URL, may be NULL
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ gf_sc_map_point()

void gf_sc_map_point ( GF_Compositor *  compositor,
s32  X,
s32  Y,
Fixed bifsX,
Fixed bifsY 
)

maps screen coordinates to bifs 2D coordinates for the current zoom/pan settings. The input coordinate X and Y are point coordinates in the display expressed in BIFS-like fashion (0,0) at center of display and Y increasing from bottom to top

Parameters
compositorthe target compositor
Xhorizontal point coordinate
Yvertical point coordinate
bifsXset to the scene horizontal coordinate of the point
bifsYset to the scene vertical coordinate of the point
+ Here is the caller graph for this function:

◆ gf_sc_get_fps()

Double gf_sc_get_fps ( GF_Compositor *  compositor,
Bool  absoluteFPS 
)

returns current FPS

Parameters
compositorthe target compositor
absoluteFPSif set to GF_TRUE, the return value is the absolute framerate, eg NbFrameCount/NbTimeSpent regardless of whether a frame has been drawn or not, which means the FPS returned can be much greater than the compositor FPS. If set to GF_FALSE, the return value is the FPS taking into account not drawn frames (eg, less than or equal to compositor FPS)
Returns
the current frame rate
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ gf_sc_has_text_selection()

Bool gf_sc_has_text_selection ( GF_Compositor *  compositor)

checks if a text selection is in progress

Parameters
compositorthe target compositor
Returns
GF_TRUE is some text is selected, GF_FALSE otherwise
+ Here is the caller graph for this function:

◆ gf_sc_get_selected_text()

const char* gf_sc_get_selected_text ( GF_Compositor *  compositor)

gets text selection

Parameters
compositorthe target compositor
Returns
the selected text as UTF8 string
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ gf_sc_paste_text()

GF_Err gf_sc_paste_text ( GF_Compositor *  compositor,
const char *  text 
)

replace text selection content

Parameters
compositorthe target compositor
textthe text to paste as UTF8 string
Returns
error if any
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ gf_sc_add_object()

GF_Err gf_sc_add_object ( GF_Compositor *  compositor,
const char *  url,
Bool  auto_play 
)

adds an object to the scene - only possible if scene has selectable streams (cf GF_OPT_CAN_SELECT_STREAMS option)

Parameters
compositorthe target compositor
urlthe URL of the object to inject
auto_playselcts the object for playback when inserting it
Returns
error if any
+ Here is the call graph for this function:

◆ gf_sc_get_screen_buffer()

GF_Err gf_sc_get_screen_buffer ( GF_Compositor *  compositor,
GF_VideoSurface framebuffer,
GF_CompositorGrabMode  depth_grab_mode 
)

gets screen buffer. This locks the scene graph too until gf_sc_get_offscreen_buffer is called

Parameters
compositorthe target compositor
framebufferwill be set to the grabbed framebuffer. The pixel data is owned by the compositor and shall not be freed
depth_grab_modemode for depth grabbing in 3D
Returns
error if any
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ gf_sc_get_offscreen_buffer()

GF_Err gf_sc_get_offscreen_buffer ( GF_Compositor *  compositor,
GF_VideoSurface framebuffer,
u32  view_idx,
GF_CompositorGrabMode  depth_grab_mode 
)

gets offscreen buffer in autostereo rendering modes. This locks the scene graph too until gf_sc_get_offscreen_buffer is called

Parameters
compositorthe target compositor
framebufferwill be set to the grabbed framebuffer. The pixel data is owned by the compositor and shall not be freed
view_idxindicates the 0-based index of the view to grab
depth_grab_modemode for depth grabbing in 3D
Returns
error if any
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ gf_sc_release_screen_buffer()

GF_Err gf_sc_release_screen_buffer ( GF_Compositor *  compositor,
GF_VideoSurface framebuffer 
)

releases screen buffer and unlocks graph

Parameters
compositorthe target compositor
framebufferused during grab call
Returns
error if any
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ gf_sc_reset_graphics()

void gf_sc_reset_graphics ( GF_Compositor *  compositor)

forces full graphics reset (deletes GL textures, FBO, 2D offscreen caches, etc ...).

Parameters
compositorthe target compositor
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ gf_sc_get_viewpoint()

GF_Err gf_sc_get_viewpoint ( GF_Compositor *  compositor,
u32  viewpoint_idx,
const char **  out_name,
Bool is_bound 
)

gets viewpoints/viewports for main scene - idx is 1-based, and if greater than number of viewpoints return GF_EOS

Parameters
compositorthe target compositor
viewpoint_idxthe index of the requested viewport. This is a 1-based index, and if greater than number of viewpoints the function will return GF_EOS
out_nameset to the viewport name. May be NULL
is_boundset to GF_TRUE if the viewport is bound. May be NULL
Returns
GF_EOS if no more viewpoint, or error if any
+ Here is the call graph for this function:

◆ gf_sc_set_viewpoint()

GF_Err gf_sc_set_viewpoint ( GF_Compositor *  compositor,
u32  viewpoint_idx,
const char *  viewpoint_name 
)

sets viewpoints/viewports for main scene given its name - idx is 1-based, or 0 to retrieve by viewpoint name if only one viewpoint is present in the scene, this will bind/unbind it

Parameters
compositorthe target compositor
viewpoint_idxthe index of the viewport to bind. This is a 1-based index, and if greater than number of viewpoints the function will return GF_EOS. Use 0 to bind the viewpoint with the given name.
viewpoint_namename of the viewpoint to bind if viewpoint_idx is 0
Returns
error if any
+ Here is the call graph for this function:

◆ gf_sc_traverse_subscene()

void gf_sc_traverse_subscene ( GF_Compositor *  compositor,
GF_Node inline_parent,
GF_SceneGraph *  subscene,
void *  rs 
)

renders subscene root node. rs is the current traverse stack

Parameters
compositorthe target compositor
inline_parentthe parent node of the subscene (VRML Inline, SVG animation, ...)
subscenethe subscene tree to render
rsthe rendering state at the parent level. This is needed to handle graph metrics changes between scenes
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ gf_sc_set_size()

GF_Err gf_sc_set_size ( GF_Compositor *  compositor,
u32  new_width,
u32  new_height 
)

sets output (display) size

Parameters
compositorthe target compositor
new_widththe desired new output width
new_heightthe desired new output height
Returns
error if any
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ gf_sc_register_extra_graph()

void gf_sc_register_extra_graph ( GF_Compositor *  compositor,
GF_SceneGraph *  extra_scene,
Bool  do_remove 
)

adds or removes extra scene from compositor. Extra scenes are on-screen displays, text tracks or any other scene graphs not directly loaded by the main scene

Parameters
compositorthe target compositor
extra_scenethe scene graph to add/remove
do_removeif set to GF_TRUE, the given scene graph will be unregistered; otherwise, the given scene graph will be registered
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ gf_sc_get_compositor()

GF_Compositor* gf_sc_get_compositor ( GF_Node node)

retrieves the compositor object associated with a node. Currently GPAC only handles one possible compositor per node.

Parameters
nodethe target node
Returns
the compositor used by the node
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ gf_sc_script_action()

Bool gf_sc_script_action ( GF_Compositor *  compositor,
GF_JSAPIActionType  type,
GF_Node node,
GF_JSAPIParam param 
)

executes a script action

Parameters
compositorthe target compositor
typethe script action type
nodethe optional node on which the action takes place
paramthe parameter for this action
Returns
GF_TRUE if success
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ gf_sc_uri_is_hardcoded_proto()

Bool gf_sc_uri_is_hardcoded_proto ( GF_Compositor *  compositor,
const char *  uri 
)

checks if the given URI matches a built-in GPAC VRML Prototype node

Parameters
compositorthe target compositor
urithe URI to test
Returns
GF_TRUE if the URI indicates a built-in prototype, GF_FALSE otherwise
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ gf_sc_reload_config()

void gf_sc_reload_config ( GF_Compositor *  compositor)

reloads the compositor configuration from the GPAC config file

Parameters
compositorthe target compositor
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ gf_sc_get_time_in_ms()

u32 gf_sc_get_time_in_ms ( GF_Compositor *  compositor)

gets main scene current time

Parameters
compositorthe target compositor
Returns
time in milliseconds
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ gf_sc_switch_quality()

void gf_sc_switch_quality ( GF_Compositor *  compositor,
Bool  up 
)

switches quality up or down - can be called several time in the same direction this will call all decoders to adjust their quality levels

Parameters
compositorthe target compositor
upif GF_TRUE, switches quality up,otherwise down
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ gf_sc_toggle_addons()

void gf_sc_toggle_addons ( GF_Compositor *  compositor,
Bool  show_addons 
)

sets addon on or off (only one addon possible for now). When OFF, the associated service is shut down

Parameters
compositorthe target compositor
show_addonsif GF_TRUE, displays addons otheriwse hides the addons
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ gf_sc_set_speed()

GF_Err gf_sc_set_speed ( GF_Compositor *  compositor,
Fixed  speed 
)

sets playback speed

Parameters
compositorthe target compositor
speedthe requested speed
Returns
error if any
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ gf_sc_is_supported_url()

Bool gf_sc_is_supported_url ( GF_Compositor *  compositor,
const char *  URL,
Bool  use_parent_url 
)

checks if given URL is understood by client.

Parameters
compositorthe target compositor
URLthe URL to check
use_parent_urlif GF_TRUE, relative URLs are solved against the current presentation URL
Returns
GF_TRUE if client should be able to handle the URL
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ gf_sc_navigate_to()

void gf_sc_navigate_to ( GF_Compositor *  compositor,
const char *  toURL 
)

navigates to a given destination or shutdown/restart the current one if any. This is the only safe way of restarting/jumping a presentation from inside the EventProc where doing a disconnect/connect could deadlock if toURL is NULL, uses the current URL

Parameters
compositorthe target compositor
toURLthe new target URL
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ gf_sc_play_from_time()

u32 gf_sc_play_from_time ( GF_Compositor *  compositor,
u64  from_time,
u32  pause_at_first_frame 
)

restarts url from given time (in ms).

Parameters
compositorthe target compositor
from_timerestart time in milliseconds
pause_at_first_frameif 1, pauses at the first frame. If 2, pauses at the first frame only if the compositor is in paused state.
Returns
0: service is not connected yet, 1: service has no seeking capabilities, 2: service has been seeked
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ gf_sc_dump_scene()

GF_Err gf_sc_dump_scene ( GF_Compositor *  compositor,
char *  rad_name,
char **  filename,
Bool  xml_dump,
Bool  skip_proto 
)

dumps scene graph in specified file, in BT or XMT format

Parameters
compositorthe target compositor
rad_namefile radical (NULL for stdout) - if not NULL MUST BE GF_MAX_PATH length
filenamesets to the complete filename (rad + ext) and shall be destroyed by caller (optional can be NULL)
xml_dumpif GF_TRUE, duimps using XML format (XMT-A, X3D) for scene graphs having both XML and simple text representations
skip_protois GF_TRUE, proto declarations are not dumped
Returns
error if any
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ gf_sc_scene_update()

GF_Err gf_sc_scene_update ( GF_Compositor *  compositor,
char *  type,
char *  com 
)

sends a set of scene commands (BT, XMT, X3D, LASeR+XML) to the scene

Parameters
compositorthe target compositor
typeindicates the language used - accepted values are "model/x3d+xml" or "x3d": commands is an X3D+XML scene "model/x3d+vrml" or "xrdv": commands is an X3D+VRML scene "model/vrml" or "vrml": commands is an VRML scene "application/x-xmt" or "xmt": commands is an XMT-A scene or a list of XMT-A updates "application/x-bt" or "bt": commands is a BT scene or a list of BT updates "image/svg+xml" or "svg": commands is an SVG scene "application/x-laser+xml" or "laser": commands is an SVG/LASeR+XML scene or a list of LASeR+XML updates if not specified, the type will be guessed from the current root node if any
comthe textual update
Returns
error if any
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ gf_sc_select_service()

void gf_sc_select_service ( GF_Compositor *  compositor,
u32  service_id 
)

selects service by given ID for multiplexed services (MPEG-2 TS)

Parameters
compositorthe target compositor
service_idthe service ID to select
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ gf_sc_get_url()

const char* gf_sc_get_url ( GF_Compositor *  compositor)

gets URL of main scene

Parameters
compositorthe target compositor
Returns
URL
+ Here is the caller graph for this function:

◆ gf_sc_get_main_pid()

const void* gf_sc_get_main_pid ( GF_Compositor *  compositor)

gets main pid in scene

Parameters
compositorthe target compositor
Returns
PID
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ gf_sc_get_world_info()

const char* gf_sc_get_world_info ( GF_Compositor *  compositor,
GF_List *  descriptions 
)

gets world info of root scene

Parameters
compositorthe target compositor
descriptionsfilled with descriptions strings (do not free)
Returns
world title or NULL if no world info
+ Here is the call graph for this function:

◆ gf_sc_get_current_service_id()

u32 gf_sc_get_current_service_id ( GF_Compositor *  compositor)

gets service ID of root scene

Parameters
compositorthe target compositor
Returns
service ID or 0 if none speicifed (single service in URL)
+ Here is the call graph for this function:

◆ gf_sc_get_simulation_frame_rate()

Double gf_sc_get_simulation_frame_rate ( GF_Compositor *  compositor,
u32 nb_frames_drawn 
)

gets simulation frame rate

Parameters
compositorthe target compositor
nb_frames_drawnset to the number of frames drawn
Returns
simulation frames per seconds

◆ gf_sc_set_option()

GF_Err gf_sc_set_option ( GF_Compositor *  compositor,
GF_CompositorOption  type,
u32  value 
)

sets compositor run-time option

Parameters
compositorthe target compositor
typethe target option type
valuethe target option value
Returns
error if any
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ gf_sc_get_option()

u32 gf_sc_get_option ( GF_Compositor *  compositor,
GF_CompositorOption  type 
)

gets compositor run-time option.

Parameters
compositorthe target compositor
typethe target option type
Returns
the option value
+ Here is the call graph for this function:
+ Here is the caller graph for this function: