106
106
GF_StreamContext *gf_sm_stream_new(GF_SceneManager *ctx, u16 ES_ID, u8 streamType, u8 objectType);
107
107
/*removes and destroy stream context from presentation context*/
108
108
void gf_sm_stream_del(GF_SceneManager *ctx, GF_StreamContext *sc);
109
/*locate a stream based on its id*/
110
GF_StreamContext *gf_sm_stream_find(GF_SceneManager *ctx, u16 ES_ID);
109
111
/*create a new AU context in the given stream context*/
110
GF_AUContext *gf_sm_stream_au_new(GF_StreamContext *stream, u32 timing, Double time_ms, Bool isRap);
112
GF_AUContext *gf_sm_stream_au_new(GF_StreamContext *stream, u64 timing, Double time_ms, Bool isRap);
113
115
/*applies all commands in all streams (only BIFS for now): the context manager will only have one command per
144
146
/*when using SplitTimeline, this flag will prevent generating an AnimationStream in the scene (this is used
145
147
by direct playback only)*/
146
148
GF_SM_SWF_NO_ANIM_STREAM = (1<<8),
149
/*enable appearance reuse*/
150
GF_SM_SWF_REUSE_APPEARANCE = (1<<9)
149
153
/*general loader flags*/
161
165
this is used when performing diff encoding (eg the file to load only has updates).
162
166
When set, gf_sm_load_init will NOT attempt to parse first frame*/
163
167
GF_SM_LOAD_CONTEXT_READY = 4,
168
/*indicates binary reading should be dumped (LSR only)*/
169
GF_SM_LOAD_DUMP_BINARY = 8,
166
172
/*loader type, usually detected based on file ext*/
171
177
GF_SM_LOAD_X3DV, /*X3D VRML loader*/
172
178
GF_SM_LOAD_XMTA, /*XMT-A loader*/
173
179
GF_SM_LOAD_X3D, /*X3D XML loader*/
180
GF_SM_LOAD_SVG, /*SVG loader*/
181
GF_SM_LOAD_XSR, /*LASeR+XML loader*/
174
182
GF_SM_LOAD_SWF, /*SWF->MPEG-4 converter*/
175
183
GF_SM_LOAD_QT, /*MOV->MPEG-4 converter (only cubic QTVR for now)*/
176
184
GF_SM_LOAD_MP4 /*MP4 memory loader*/
219
227
void gf_sm_load_done(GF_SceneLoader *load);
221
229
/*parses memory scene (any textural format) into the context
222
!! THE LOADER TYPE MUST BE ASSIGNED (BT/WRL/XMT/X3D only !!
230
!! THE LOADER TYPE MUST BE ASSIGNED (BT/WRL/XMT/X3D/SVG only) !!
231
The string MUST be at least 4 bytes long in order to detect BOM (unicode encoding).
232
The string can ba either UTF-8 or UTF-16 data
233
if clean_at_end is set, associated parser is destroyed. Otherwise, a call to gf_sm_load_done must be done
234
to clean ressources (needed for SAX progressive loading)
224
GF_Err gf_sm_load_from_string(GF_SceneLoader *load, char *str);
236
GF_Err gf_sm_load_string(GF_SceneLoader *load, char *str, Bool clean_at_end);
227
239
/*scene dump mode*/
237
249
GF_SM_DUMP_X3D_VRML,
239
251
GF_SM_DUMP_X3D_XML,
254
/*SVG dump (only dumps svg root of the first LASeR unit*/
240
256
/*automatic selection of MPEG4 vs X3D, text mode*/
241
257
GF_SM_DUMP_AUTO_TXT,
242
258
/*automatic selection of MPEG4 vs X3D, xml mode*/
262
#ifndef GPAC_READ_ONLY
246
264
/*dumps scene context to BT or XMT
247
265
@rad_name: file name & loc without extension - if NULL dump will happen in stdout
248
266
@dump_mode: one of the above*/
249
267
GF_Err gf_sm_dump(GF_SceneManager *ctx, char *rad_name, u32 dump_mode);
252
272
/*encoding flags*/
255
275
/*if flag set, DEF names are encoded*/
256
276
GF_SM_ENCODE_USE_NAMES = 1,
257
/*if flag set, RAP are generated inband rather than as sync shadow*/
277
/*if flag set, RAP are generated inband rather than as redundant samples*/
258
278
GF_SM_ENCODE_RAP_INBAND = 2,
279
/*if flag set, RAP are generated inband rather than as sync shadow samples*/
280
GF_SM_ENCODE_RAP_SHADOW = 4,
287
/*delay between 2 RAP in ms. If 0 RAPs are not forced - BIFS and LASeR only for now*/
289
/*encoding log or NULL*/
291
/*if set, any unknown stream in the scene will be looked for in @mediaSource (MP4 only)*/
296
/*coordBits, scaleBits*/
297
u32 coord_bits, scale_bits;
299
} GF_SMEncodeOptions;
262
302
encodes scene context into @mp4.
263
303
if @log is set, generates BIFS encoder log file
264
if @mediaSource is set, any unknown stream in the scene will be looked for in @mediaSource (MP4 only)
265
@flags: encoding flags
266
@rap_freq: delay between 2 RAP in ms. If 0 RAPs are not forced - BIFS only
268
GF_Err gf_sm_encode_to_file(GF_SceneManager *ctx, GF_ISOFile *mp4, char *logFile, char *mediaSource, u32 flags, u32 rap_freq);
305
GF_Err gf_sm_encode_to_file(GF_SceneManager *ctx, GF_ISOFile *mp4, GF_SMEncodeOptions *opt);
271
307
/*Dumping tools*/
272
308
typedef struct _scenedump GF_SceneDumper;
316
355
/*ranges of all SFVec2fs for points only (MFVec2fs)*/
317
356
SFVec2f max_2d, min_2d;
357
/* resolution of 2D points (nb bits for integer part and decimal part)*/
358
u32 int_res_2d, frac_res_2d;
359
/* resolution of scale coefficient (nb bits for integer part)*/
360
u32 scale_int_res_2d, scale_frac_res_2d;
362
Fixed max_fixed, min_fixed;
318
364
/*number of parsed 2D points*/
320
366
/*number of deleted 2D points*/