OSDN Git Service

add tstools.
[rec10/rec10-git.git] / tstools / DtsEdit / src / gpac / terminal.h
diff --git a/tstools/DtsEdit/src/gpac/terminal.h b/tstools/DtsEdit/src/gpac/terminal.h
new file mode 100644 (file)
index 0000000..0d95ff2
--- /dev/null
@@ -0,0 +1,183 @@
+/*\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 / Stream Management 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_TERMINAL_H_\r
+#define _GF_TERMINAL_H_\r
+\r
+\r
+#ifdef __cplusplus\r
+extern "C" {\r
+#endif\r
+\r
+#include <gpac/user.h>\r
+\r
+/*creates a new terminal for a userApp callback*/\r
+GF_Terminal *gf_term_new(GF_User *user);\r
+\r
+/*delete the app - stop is done automatically, you don't have to do it before deleting the app\r
+returns GF_IO_ERR if client couldn't be shutdown normally*/\r
+GF_Err gf_term_del(GF_Terminal *term);\r
+\r
+/*connects to a URL*/\r
+void gf_term_connect(GF_Terminal *term, const char *URL);\r
+/*disconnects the url*/\r
+void gf_term_disconnect(GF_Terminal *term);\r
+/*navigates to a given destination or shutdown/restart the current one if any.\r
+This is the only safe way of restarting/jumping a presentation from inside the EventProc \r
+where doing a disconnect/connect could deadlock if toURL is NULL, uses the current URL*/\r
+void gf_term_navigate_to(GF_Terminal *term, const char *toURL);\r
+/*restarts url from given time (in ms). Return value: \r
+       0: service is not connected yet\r
+       1: service has no seeking capabilities\r
+       2: service has been seeked\r
+*/\r
+u32 gf_term_play_from_time(GF_Terminal *term, u64 from_time, Bool pause_at_first_frame);\r
+/*connect URL and seek right away - only needed when reloading the complete player (avoids waiting\r
+for connection and post a seek..)*/\r
+void gf_term_connect_from_time(GF_Terminal *term, const char *URL, u64 time_in_ms, Bool pause_at_first_frame);\r
+\r
+/*same as gf_term_connect but specifies a parent path*/\r
+void gf_term_connect_with_path(GF_Terminal *term, const char *URL, const char *parent_URL);\r
+\r
+/*returns current framerate\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 target rendering \r
+framerate\r
+       if @absoluteFPS is not set, the return value is the FPS taking into account not drawn frames (eg, less than \r
+       or equal to compositor FPS)\r
+*/\r
+Double gf_term_get_framerate(GF_Terminal *term, Bool absoluteFPS);\r
+/*get main scene current time in milliseconds*/\r
+u32 gf_term_get_time_in_ms(GF_Terminal *term);\r
+\r
+/*returns current URL address*/\r
+const char *gf_term_get_url(GF_Terminal *term);\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_term_get_viewpoint(GF_Terminal *term, u32 viewpoint_idx, const char **outName, Bool *is_bound);\r
+/*set active viewpoints/viewports for main scene given its name - idx is 1-based, or 0 to set by viewpoint name\r
+if only one viewpoint is present in the scene, this will bind/unbind it*/\r
+GF_Err gf_term_set_viewpoint(GF_Terminal *term, u32 viewpoint_idx, const char *viewpoint_name);\r
+\r
+/*adds an object to the scene - only possible if scene has selectable streams (cf GF_OPT_CAN_SELECT_STREAMS option)*/\r
+GF_Err gf_term_add_object(GF_Terminal *term, const char *url, Bool auto_play);\r
+\r
+\r
+/*set/set option - most of the terminal cfg is done through options, please refer to user.h for details*/\r
+GF_Err gf_term_set_option(GF_Terminal *term, u32 opt_type, u32 opt_value);\r
+u32 gf_term_get_option(GF_Terminal *term, u32 opt_type);\r
+\r
+/*checks if given URL is understood by client.\r
+if use_parent_url is set, relative URLs are solved against the current presentation URL*/\r
+Bool gf_term_is_supported_url(GF_Terminal *term, const char *fileName, Bool use_parent_url, Bool no_mime_check);\r
+\r
+/*sets simulation frame rate*/\r
+GF_Err gf_term_set_simulation_frame_rate(GF_Terminal * term, Double frame_rate);\r
+/*gets simulation frame rate*/\r
+Double gf_term_get_simulation_frame_rate(GF_Terminal *term);\r
+\r
+/*sends a set of scene commands (BT, XMT, X3D, LASeR+XML) to the scene\r
+type indicates the language used - accepted values are \r
+       "model/x3d+xml" or "x3d": commands is an X3D+XML scene\r
+       "model/x3d+vrml" or  "xrdv": commands is an X3D+VRML scene\r
+       "model/vrml" or "vrml": commands is an VRML scene\r
+       "application/x-xmt" or "xmt": commands is an XMT-A scene or a list of XMT-A updates\r
+       "application/x-bt" or "bt": commands is a BT scene or a list of BT updates\r
+       "image/svg+xml" or "svg": commands is an SVG scene\r
+       "application/x-laser+xml" or "laser": commands is an SVG/LASeR+XML  scene or a list of LASeR+XML updates\r
+       if not specified, the type will be guessed from the current root node if any\r
+*/\r
+GF_Err gf_term_scene_update(GF_Terminal *term, char *type, char *com);\r
+\r
+\r
+/*request visual output size change:\r
+       * NOT NEEDED WHEN THE TERMINAL IS HANDLING THE DISPLAY WINDOW (cf user.h)\r
+       * if the user app manages the output window it shall resize it before calling this\r
+*/\r
+GF_Err gf_term_set_size(GF_Terminal *term, u32 NewWidth, u32 NewHeight);\r
+\r
+/*returns current text selection if any, or NULL otherwise. If probe mode is set, returns a non-NULL string ("") \r
+if some text is selected*/\r
+const char *gf_term_get_text_selection(GF_Terminal *term, Bool probe_only);\r
+/*pastes text into current selection if any. If probe mode is set, only check if text is currently edited\r
+if some text is selected*/\r
+GF_Err gf_term_paste_text(GF_Terminal *term, const char *txt, Bool probe_only);\r
+\r
+\r
+/*decodes pending media and render frame. \r
+NOTE: This can only be used when the terminal runs without visual thread (GF_TERM_NO_VISUAL_THREAD flag set)\r
+*/\r
+GF_Err gf_term_process_step(GF_Terminal *term);\r
+\r
+/*decodes all pending media and render frame until no scene changes are detected.\r
+NOTE: This can only be used when the terminal runs without visual thread (GF_TERM_NO_VISUAL_THREAD flag set)\r
+*/\r
+GF_Err gf_term_process_flush(GF_Terminal *term);\r
+\r
+/*post user interaction to terminal*/\r
+/*NOT NEEDED WHEN THE TERMINAL IS HANDLING THE DISPLAY WINDOW (cf user.h)*/\r
+Bool gf_term_user_event(GF_Terminal *term, GF_Event *event);\r
+\r
+/*post extended user mouse interaction to terminal \r
+       X and Y are point coordinates in the display expressed in 2D coord system top-left (0,0), Y increasing towards bottom\r
+       @xxx_but_down: specifiy whether the mouse button is down(2) or up (1), 0 if unchanged\r
+       @wheel: specifiy current wheel inc (0: unchanged , +1 for one wheel delta forward, -1 for one wheel delta backward)\r
+*/\r
+/*NOT NEEDED WHEN THE TERMINAL IS HANDLING THE DISPLAY WINDOW (cf user.h)*/\r
+void gf_term_mouse_input(GF_Terminal *term, GF_EventMouse *event);\r
+\r
+/*post extended user key interaction to terminal \r
+       @key_code: GPAC DOM code of input key\r
+       @hw_code: hardware code of input key\r
+       @isKeyUp: set if key is released\r
+*/\r
+/*NOT NEEDED WHEN THE TERMINAL IS HANDLING THE DISPLAY WINDOW (cf user.h)*/\r
+void gf_term_keyboard_input(GF_Terminal *term, u32 key_code, u32 hw_code, Bool isKeyUp);\r
+\r
+/*post extended user character interaction to terminal \r
+       @character: unicode character input\r
+*/\r
+/*NOT NEEDED WHEN THE TERMINAL IS HANDLING THE DISPLAY WINDOW (cf user.h)*/\r
+void gf_term_string_input(GF_Terminal *term, u32 character);\r
+\r
+\r
+\r
+/*framebuffer access*/\r
+#include <gpac/color.h>\r
+\r
+/*gets screen buffer - this locks the scene graph too until released is called*/\r
+GF_Err gf_term_get_screen_buffer(GF_Terminal *term, GF_VideoSurface *framebuffer);\r
+/*releases screen buffer and unlocks graph*/\r
+GF_Err gf_term_release_screen_buffer(GF_Terminal *term, GF_VideoSurface *framebuffer);\r
+\r
+\r
+/*ObjectManager used by both terminal and object browser (term_info.h)*/\r
+typedef struct _od_manager GF_ObjectManager;\r
+\r
+#ifdef __cplusplus\r
+}\r
+#endif\r
+\r
+\r
+#endif /*_GF_TERMINAL_H_*/\r