OSDN Git Service

stop using trunk directory in rectool
[rec10/rec10-git.git] / tstools / DtsEdit / src / gpac / bifsengine.h
1 /*\r
2  *                                      GPAC Multimedia Framework\r
3  *\r
4  *                      Authors: Cyril Concolato - Jean le Feuvre\r
5  *                              Copyright (c) 2005-200X ENST\r
6  *                                      All rights reserved\r
7  *\r
8  *  This file is part of GPAC / ISO Media File Format sub-project\r
9  *\r
10  *  GPAC is free software; you can redistribute it and/or modify\r
11  *  it under the terms of the GNU Lesser General Public License as published by\r
12  *  the Free Software Foundation; either version 2, or (at your option)\r
13  *  any later version.\r
14  *   \r
15  *  GPAC is distributed in the hope that it will be useful,\r
16  *  but WITHOUT ANY WARRANTY; without even the implied warranty of\r
17  *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the\r
18  *  GNU Lesser General Public License for more details.\r
19  *   \r
20  *  You should have received a copy of the GNU Lesser General Public\r
21  *  License along with this library; see the file COPYING.  If not, write to\r
22  *  the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. \r
23  *\r
24  */\r
25 \r
26 \r
27 #ifndef _GF_BIFSENGINE_H_\r
28 #define _GF_BIFSENGINE_H_\r
29 \r
30 #ifdef __cplusplus\r
31 extern "C" {\r
32 #endif\r
33 \r
34 #include <gpac/scene_manager.h>\r
35 \r
36 #ifndef GPAC_READ_ONLY\r
37         \r
38 typedef struct __tag_bifs_engine GF_BifsEngine;\r
39 \r
40 /**\r
41  * @calling_object is the calling object on which call back will be called\r
42  * @inputContext is the name of a scene file (bt, xmt or mp4) to initialize the coding context\r
43  *\r
44  * must be called only one time (by process calling the DLL) before other calls\r
45  */\r
46 GF_BifsEngine *gf_beng_init(void *calling_object, char *inputContext);\r
47 \r
48 /**\r
49  * @calling_object is the calling object on which call back will be called\r
50  * @inputContext is an UTF-8 scene description (with or without IOD) in BT or XMT-A format\r
51  * @width, @height: width and height of scene if no IOD is given in the context.\r
52  * @usePixelMetrics: metrics system used in the scene, if no IOD is given in the context.\r
53  *\r
54  * must be called only one time (by process calling the DLL) before other calls\r
55  */\r
56 GF_BifsEngine *gf_beng_init_from_string(void *calling_object, char *inputContext, u32 width, u32 height, Bool usePixelMetrics);\r
57 \r
58 \r
59 /**\r
60  * @calling_object is the calling object on which call back will be called\r
61  * @ctx is an already loaded scene manager\r
62  *\r
63  * must be called only one time (by process calling the DLL) before other calls\r
64  */\r
65 GF_BifsEngine *gf_beng_init_from_context(void *calling_object, GF_SceneManager *ctx);\r
66 \r
67 /**\r
68  * @beng, pointer to the GF_BifsEngine returned by BENC_Init\r
69  * @config: pointer to the encoded BIFS config (memory is not allocated)\r
70  * @config_len: length of the buffer\r
71  *\r
72  * must be called after BENC_Init\r
73  */\r
74 void gf_beng_get_stream_config(GF_BifsEngine *beng, char **config, u32 *config_len);\r
75 \r
76 /**\r
77  * Encodes the AU context which is not encoded when calling BENC_EncodeAUFromString/File\r
78  * Should be called after Aggregate.\r
79  *\r
80  * @beng, pointer to the GF_BifsEngine returned by BENC_Init\r
81  * @AUCallback, pointer on a callback function to get the result of the coding the AU using the current context\r
82  *\r
83  */\r
84 GF_Err gf_beng_encode_context(GF_BifsEngine *beng, GF_Err (*AUCallback)(void *, char *data, u32 size, u64 ts));\r
85 \r
86 /**\r
87  * @beng, pointer to the GF_BifsEngine returned by BENC_Init\r
88  * @auFile, name of a file containing a description for an access unit (BT or XMT)\r
89  * @AUCallback, pointer on a callback function to get the result of the coding the AU using the current context\r
90  *\r
91  */\r
92 GF_Err gf_beng_encode_from_file(GF_BifsEngine *beng, char *auFile, GF_Err (*AUCallback)(void *, char *data, u32 size, u64 ts));\r
93 \r
94 /**\r
95  * @beng, pointer to the GF_BifsEngine returned by BENC_Init\r
96  * @auString, a char string to encode (must one or several complete nodes in BT\r
97  * @AUCallback, pointer on a callback function to get the result of the coding the AU using the current context\r
98  *\r
99  */\r
100 GF_Err gf_beng_encode_from_string(GF_BifsEngine *beng, char *auString, GF_Err (*AUCallback)(void *, char *data, u32 size, u64 ts));\r
101 \r
102 /**\r
103  * @beng, pointer to the GF_BifsEngine returned by BENC_Init\r
104  * @ctxFileName, name of the file to save the current state of the BIFS scene to\r
105  *\r
106  * save the current context of the beng.\r
107  * if you want to save an aggregate context, use BENC_AggregateCurrentContext before\r
108  *\r
109  */\r
110 GF_Err gf_beng_save_context(GF_BifsEngine *beng, char *ctxFileName);\r
111 \r
112 /**\r
113  * @beng, pointer to the GF_BifsEngine returned by BENC_Init\r
114  *\r
115  * aggregates the current context of the beng, creates a scene replace\r
116  *\r
117  */\r
118 GF_Err gf_beng_aggregate_context(GF_BifsEngine *beng);\r
119 \r
120 /**\r
121  * @beng, pointer to the GF_BifsEngine returned by BENC_Init\r
122  *\r
123  * release the memory used by this beng, no more call on the beng should happen after this\r
124  *\r
125  */\r
126 void gf_beng_terminate(GF_BifsEngine *beng);\r
127 \r
128 \r
129 #endif\r
130 \r
131 \r
132 #ifdef __cplusplus\r
133 }\r
134 #endif // __cplusplus\r
135 \r
136 \r
137 #endif  /*_GF_BIFSENGINE_H_*/\r
138 \r