OSDN Git Service

add tstools.
[rec10/rec10-git.git] / tstools / DtsEdit / src / gpac / compositor.h
diff --git a/tstools/DtsEdit/src/gpac/compositor.h b/tstools/DtsEdit/src/gpac/compositor.h
new file mode 100644 (file)
index 0000000..9eb001b
--- /dev/null
@@ -0,0 +1,164 @@
+/*\r
+ *                     GPAC - Multimedia Framework C SDK\r
+ *\r
+ *                     Copyright (c) Jean Le Feuvre 2000-2005 \r
+ *                                     All rights reserved\r
+ *\r
+ *  This file is part of GPAC / Scene Compositor sub-project\r
+ *\r
+ *  GPAC is free software; you can redistribute it and/or modify\r
+ *  it under the terms of the GNU Lesser General Public License as published by\r
+ *  the Free Software Foundation; either version 2, or (at your option)\r
+ *  any later version.\r
+ *   \r
+ *  GPAC is distributed in the hope that it will be useful,\r
+ *  but WITHOUT ANY WARRANTY; without even the implied warranty of\r
+ *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the\r
+ *  GNU Lesser General Public License for more details.\r
+ *   \r
+ *  You should have received a copy of the GNU Lesser General Public\r
+ *  License along with this library; see the file COPYING.  If not, write to\r
+ *  the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. \r
+ *\r
+ */\r
+\r
+#ifndef _GF_COMPOSITOR_H_\r
+#define _GF_COMPOSITOR_H_\r
+\r
+#ifdef __cplusplus\r
+extern "C" {\r
+#endif\r
+\r
+\r
+/*include scene graph API*/\r
+#include <gpac/scenegraph.h>\r
+/*GF_User and GF_Terminal */\r
+#include <gpac/user.h>\r
+/*frame buffer definition*/\r
+#include <gpac/color.h>\r
+\r
+typedef struct __tag_compositor GF_Compositor;\r
+\r
+/*creates default compositor \r
+if self_threaded, video compositor uses a dedicated thread, otherwise visual rendering is done by the user\r
+audio compositor always runs in its own thread if enabled\r
+term may be NULL, in which case InputSensors won't be enabled\r
+*/\r
+GF_Compositor *gf_sc_new(GF_User *user_interface, Bool self_threaded, GF_Terminal *term);\r
+void gf_sc_del(GF_Compositor *sr);\r
+\r
+/*sets simulation frame rate*/\r
+void gf_sc_set_fps(GF_Compositor *sr, Double fps);\r
+\r
+/*set the root scene graph of the compositor - if NULL remove current and reset simulation time*/\r
+GF_Err gf_sc_set_scene(GF_Compositor *sr, GF_SceneGraph *scene_graph);\r
+\r
+/*if the compositor doesn't use its own thread for visual, this will perform a render pass*/\r
+Bool gf_sc_draw_frame(GF_Compositor *sr);\r
+\r
+/*inits rendering info for the node - shall be called for all nodes the parent system doesn't handle*/\r
+void gf_sc_on_node_init(GF_Compositor *sr, GF_Node *node);\r
+\r
+/*notify the given node has been modified. The compositor filters object to decide whether the scene graph has to be \r
+traversed or not- if object is NULL, this means complete traversing of the graph is requested (use carefully since it\r
+can be a time consuming operation)*/\r
+void gf_sc_invalidate(GF_Compositor *sr, GF_Node *byObj);\r
+\r
+/*return the compositor time - this is the time every time line syncs on*/\r
+u32 gf_sc_get_clock(GF_Compositor *sr);\r
+\r
+\r
+/*locks/unlocks the visual scene rendering - modification of the scene tree shall only happen when scene compositor is locked*/\r
+void gf_sc_lock(GF_Compositor *sr, Bool doLock);\r
+/*locks/unlocks the audio scene rendering - this is needed whenever an audio object changes config on the fly*/\r
+void gf_sc_lock_audio(GF_Compositor *sr, Bool doLock);\r
+\r
+/*notify user input - returns 0 if event hasn't been handled by the compositor*/\r
+Bool gf_sc_user_event(GF_Compositor *sr, GF_Event *event);\r
+\r
+/*maps screen coordinates to bifs 2D coordinates for the current zoom/pan settings\r
+X and Y are point coordinates in the display expressed in BIFS-like fashion (0,0) at center of \r
+display and Y increasing from bottom to top*/\r
+void gf_sc_map_point(GF_Compositor *sr, s32 X, s32 Y, Fixed *bifsX, Fixed *bifsY);\r
+\r
+/*signal the size of the display area has been changed*/\r
+GF_Err gf_sc_size_changed(GF_Compositor *sr, u32 NewWidth, u32 NewHeight);\r
+\r
+/*set/get user options - options are as defined in user.h*/\r
+GF_Err gf_sc_set_option(GF_Compositor *sr, u32 type, u32 value);\r
+u32 gf_sc_get_option(GF_Compositor *sr, u32 type);\r
+\r
+/*returns current FPS\r
+if @absoluteFPS is set, the return value is the absolute framerate, eg NbFrameCount/NbTimeSpent regardless of\r
+whether a frame has been drawn or not, which means the FPS returned can be much greater than the compositor FPS\r
+if @absoluteFPS is not set, the return value is the FPS taking into account not drawn frames (eg, less than or equal to\r
+compositor FPS)\r
+*/\r
+Double gf_sc_get_fps(GF_Compositor *sr, Bool absoluteFPS);\r
+\r
+Bool gf_sc_has_text_selection(GF_Compositor *compositor);\r
+const char *gf_sc_get_selected_text(GF_Compositor *compositor);\r
+\r
+GF_Err gf_sc_paste_text(GF_Compositor *compositor, const char *text);\r
+\r
+/*user-define management: this is used for instant visual rendering of the scene graph, \r
+for exporting or authoring tools preview. User is responsible for calling render when desired and shall also maintain\r
+scene timing*/\r
+\r
+/*force render tick*/\r
+void gf_sc_render(GF_Compositor *sr);\r
+/*gets screen buffer - this locks the scene graph too until released is called*/\r
+GF_Err gf_sc_get_screen_buffer(GF_Compositor *sr, GF_VideoSurface *framebuffer, Bool depth_buffer);\r
+/*releases screen buffer and unlocks graph*/\r
+GF_Err gf_sc_release_screen_buffer(GF_Compositor *sr, GF_VideoSurface *framebuffer);\r
+\r
+/*renders one frame*/\r
+void gf_sc_simulation_tick(GF_Compositor *sr);\r
+\r
+/*forces graphics cache recompute*/\r
+void gf_sc_reset_graphics(GF_Compositor *sr);\r
+\r
+/*picks a node (may return NULL) - coords are given in OS client system coordinate, as in UserInput*/\r
+GF_Node *gf_sc_pick_node(GF_Compositor *sr, s32 X, s32 Y);\r
+\r
+/*get viewpoints/viewports for main scene - idx is 1-based, and if greater than number of viewpoints return GF_EOS*/\r
+GF_Err gf_sc_get_viewpoint(GF_Compositor *sr, u32 viewpoint_idx, const char **outName, Bool *is_bound);\r
+/*set viewpoints/viewports for main scene given its name - idx is 1-based, or 0 to retrieve by viewpoint name\r
+if only one viewpoint is present in the scene, this will bind/unbind it*/\r
+GF_Err gf_sc_set_viewpoint(GF_Compositor *sr, u32 viewpoint_idx, const char *viewpoint_name);\r
+\r
+/*render subscene root node. rs is the current traverse stack\r
+this is needed to handle graph metrics changes between scenes...*/\r
+void gf_sc_traverse_subscene(GF_Compositor *sr, GF_Node *inline_parent, GF_SceneGraph *subscene, void *rs);\r
+\r
+/*set outupt size*/\r
+GF_Err gf_sc_set_size(GF_Compositor *sr, u32 NewWidth, u32 NewHeight);\r
+/*get outupt size*/\r
+Bool gf_sc_get_size(GF_Compositor *sr, u32 *Width, u32 *Height);\r
+\r
+/*returns total length of audio hardware buffer in ms, 0 if no audio*/\r
+u32 gf_sc_get_audio_buffer_length(GF_Compositor *sr);\r
+\r
+/*add/remove extra scene from compositor (extra scenes are OSDs or any other scene graphs not directly\r
+usable by main scene, like 3GP text streams*/\r
+void gf_sc_register_extra_graph(GF_Compositor *sr, GF_SceneGraph *extra_scene, Bool do_remove);\r
+\r
+/*gets audio hardware delay*/\r
+u32 gf_sc_get_audio_delay(GF_Compositor *sr);\r
+\r
+/*returns total length of audio hardware buffer in ms, 0 if no audio*/\r
+u32 gf_sc_get_audio_buffer_length(GF_Compositor *sr);\r
+\r
+void *gf_sc_get_visual_compositor(GF_Compositor *sr);\r
+\r
+GF_Compositor *gf_sc_get_compositor(GF_Node *node);\r
+\r
+Bool gf_sc_script_action(GF_Compositor *sr, u32 type, GF_Node *n, GF_JSAPIParam *param);\r
+\r
+\r
+#ifdef __cplusplus\r
+}\r
+#endif\r
+\r
+#endif /*_GF_COMPOSITOR_H_*/\r
+\r