~ubuntu-branches/ubuntu/intrepid/gpac/intrepid-proposed

« back to all changes in this revision

Viewing changes to include/gpac/scene_manager.h

  • Committer: Bazaar Package Importer
  • Author(s): John Dong
  • Date: 2007-01-24 23:34:57 UTC
  • mfrom: (1.1.2 upstream)
  • Revision ID: james.westby@ubuntu.com-20070124233457-zzlls8afkt0nyakj
Tags: 0.4.2~rc2-0ubuntu1
* New upstream release
  * Most notably MP4 tagging support via MP4Box -itags
* debian/patches/01_64bits.dpatch: dropped; included upstream.

Show diffs side-by-side

added added

removed removed

Lines of Context:
46
46
typedef struct
47
47
{       
48
48
        /*AU timing in TimeStampResolution*/
49
 
        u32 timing;
 
49
        u64 timing;
50
50
        /*timing in sec - used if timing isn't set*/
51
51
        Double timing_sec;
52
52
        /*random access indication - may be overriden by encoder*/
70
70
        GF_List *AUs;
71
71
 
72
72
        /*last stream AU time, when playing the context directly*/
73
 
        u32 last_au_time;
 
73
        u64 last_au_time;
74
74
} GF_StreamContext;
75
75
 
76
76
/*generic presentation context*/
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);
111
113
 
112
114
 
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)
147
151
};
148
152
 
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,
164
170
};
165
171
 
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);
220
228
 
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)
223
235
*/
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);
225
237
 
226
238
 
227
239
/*scene dump mode*/
237
249
        GF_SM_DUMP_X3D_VRML,
238
250
        /*X3D XML*/
239
251
        GF_SM_DUMP_X3D_XML,
 
252
        /*LASeR XML*/
 
253
        GF_SM_DUMP_LASER,
 
254
        /*SVG dump (only dumps svg root of the first LASeR unit*/
 
255
        GF_SM_DUMP_SVG,
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*/
243
 
        GF_SM_DUMP_AUTO_XML
 
259
        GF_SM_DUMP_AUTO_XML,
244
260
};
245
261
 
 
262
#ifndef GPAC_READ_ONLY
 
263
 
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);
250
268
 
 
269
#endif
 
270
 
251
271
 
252
272
/*encoding flags*/
253
273
enum
254
274
{
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,
259
281
};
260
282
 
 
283
typedef struct
 
284
{
 
285
        /*encoding flags*/
 
286
        u32 flags;
 
287
        /*delay between 2 RAP in ms. If 0 RAPs are not forced - BIFS and LASeR only for now*/
 
288
        u32 rap_freq;
 
289
        /*encoding log or NULL*/
 
290
        char *logFile;
 
291
        /*if set, any unknown stream in the scene will be looked for in @mediaSource (MP4 only)*/
 
292
        char *mediaSource;
 
293
        /*LASeR */
 
294
        /*resolution*/
 
295
        s32 resolution;
 
296
        /*coordBits, scaleBits*/
 
297
        u32 coord_bits, scale_bits;
 
298
        Bool auto_qant;
 
299
} GF_SMEncodeOptions;
 
300
 
261
301
/*
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
267
304
*/
268
 
GF_Err gf_sm_encode_to_file(GF_SceneManager *ctx, GF_ISOFile *mp4, char *logFile, char *mediaSource, u32 flags, u32 rap_freq);
269
 
 
 
305
GF_Err gf_sm_encode_to_file(GF_SceneManager *ctx, GF_ISOFile *mp4, GF_SMEncodeOptions *opt);
270
306
 
271
307
/*Dumping tools*/
272
308
typedef struct _scenedump GF_SceneDumper;
292
328
*/
293
329
GF_Err gf_sm_dump_graph(GF_SceneDumper *sdump, Bool skip_proto, Bool skip_routes);
294
330
 
 
331
 
 
332
#ifndef GPAC_READ_ONLY
 
333
 
295
334
/*stat object - to refine :)*/
296
335
 
297
336
/*store nodes or proto stats*/
315
354
        
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;
 
361
 
 
362
        Fixed max_fixed, min_fixed;
 
363
 
318
364
        /*number of parsed 2D points*/
319
365
        u32 count_2d;
320
366
        /*number of deleted 2D points*/
355
401
/*produces stat report for the given command*/
356
402
GF_Err gf_sm_stats_for_command(GF_StatManager *stat, GF_Command *com);
357
403
 
 
404
#endif
 
405
 
358
406
 
359
407
#ifdef __cplusplus
360
408
}