OSDN Git Service

stop using trunk directory in rectool
[rec10/rec10-git.git] / tstools / DtsEdit / src / gpac / user.h
1 /*\r
2  *                      GPAC - Multimedia Framework C SDK\r
3  *\r
4  *                      Copyright (c) Jean Le Feuvre 2000-2005 \r
5  *                                      All rights reserved\r
6  *\r
7  *  This file is part of GPAC / Stream Management sub-project\r
8  *\r
9  *  GPAC is free software; you can redistribute it and/or modify\r
10  *  it under the terms of the GNU Lesser General Public License as published by\r
11  *  the Free Software Foundation; either version 2, or (at your option)\r
12  *  any later version.\r
13  *   \r
14  *  GPAC is distributed in the hope that it will be useful,\r
15  *  but WITHOUT ANY WARRANTY; without even the implied warranty of\r
16  *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the\r
17  *  GNU Lesser General Public License for more details.\r
18  *   \r
19  *  You should have received a copy of the GNU Lesser General Public\r
20  *  License along with this library; see the file COPYING.  If not, write to\r
21  *  the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. \r
22  *\r
23  */\r
24 \r
25 \r
26 \r
27 #ifndef _GF_USER_H_\r
28 #define _GF_USER_H_\r
29 \r
30 #ifdef __cplusplus\r
31 extern "C" {\r
32 #endif\r
33 \r
34 //#include <gpac/math.h>\r
35 #include <gpac/events.h>\r
36 #include <gpac/module.h>\r
37 \r
38 /*GPAC client terminal*/\r
39 typedef struct _tag_terminal GF_Terminal;\r
40 \r
41         \r
42 \r
43 enum\r
44 {\r
45         /*display should be hidden upon initialization*/\r
46         GF_TERM_INIT_HIDE = 1,\r
47         /*no audio renderer will be created*/\r
48         GF_TERM_NO_AUDIO = 1<<1,\r
49         /*terminal is used without visual threading: \r
50                 * media codecs are not threaded\r
51                 * all composition memories are filled before rendering\r
52                 * rendering is done after media decoding\r
53                 * the user is responsible for updating the terminal\r
54         */\r
55         GF_TERM_NO_VISUAL_THREAD = 1<<2,\r
56         /*disables frame-rate regulation (used when dumping content)*/\r
57         GF_TERM_NO_REGULATION = 1<<3,\r
58         /*lets the main user handle window events (neede for browser plugins)*/\r
59         GF_TERM_NO_WINDOWPROC_OVERRIDE = 1<<4,\r
60         /*works in windowless mode - experimental, only supported on Win32*/\r
61         GF_TERM_WINDOWLESS = 1<<5\r
62 };\r
63 \r
64 /*user object for all callbacks*/\r
65 typedef struct \r
66 {\r
67         /*user defined callback for all functions - cannot be NULL*/\r
68         void *opaque;\r
69         /*the event proc. Return value depend on the event type, usually 0\r
70         cannot be NULL if os_window_handler is specified and dont_override_window_proc is set\r
71         may be NULL otherwise*/\r
72         Bool (*EventProc)(void *opaque, GF_Event *event);\r
73 \r
74         /*config file of client - cannot be NULL*/\r
75         GF_Config *config;\r
76         /*modules manager - cannot be NULL - owned by the user (to allow selection of module directory)*/\r
77         GF_ModuleManager *modules;\r
78         /*optional os window handler (HWND on win32/winCE, XWindow for X11) \r
79         if not set the video outut will create and manage the display window.*/\r
80         void *os_window_handler;\r
81         /*for now, only used by X11 (indicates display the window is on)*/\r
82         void *os_display;\r
83 \r
84         /*init flags bypassing GPAC config file */\r
85         u32 init_flags;\r
86 } GF_User;\r
87 \r
88 \r
89 /*macro for event forwarding*/\r
90 #define GF_USER_SENDEVENT(_user, _evt)  (_user->EventProc ? _user->EventProc(_user->opaque, _evt) : 0)\r
91 \r
92 /*macro for message event format/send*/\r
93 #define GF_USER_MESSAGE(_user, _serv, _msg, _e) \\r
94         {       \\r
95                 GF_Event evt;   \\r
96                 if (_user->EventProc) { \\r
97                         evt.type = GF_EVENT_MESSAGE;    \\r
98                         evt.message.service = _serv;    \\r
99                         evt.message.message = _msg;     \\r
100                         evt.message.error = _e; \\r
101                         _user->EventProc(_user->opaque, &evt);  \\r
102                 }       \\r
103         }\r
104 \r
105 \r
106 #ifdef __cplusplus\r
107 }\r
108 #endif\r
109 \r
110 #endif  /*_GF_USER_H_*/\r
111 \r