OSDN Git Service

add tstools.
[rec10/rec10-git.git] / tstools / DtsEdit / src / gpac / bifs.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 / BIFS codec 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 #ifndef _GF_BIFS_H_\r
26 #define _GF_BIFS_H_\r
27 \r
28 #ifdef __cplusplus\r
29 extern "C" {\r
30 #endif\r
31 \r
32 \r
33 #include <gpac/nodes_mpeg4.h>\r
34 /*for BIFSConfig*/\r
35 #include <gpac/mpeg4_odf.h>\r
36 \r
37 typedef struct __tag_bifs_dec GF_BifsDecoder;\r
38 \r
39 /*BIFS decoder constructor - \r
40  @command_dec: if set, the decoder will only work in memory mode (creating commands for the graph)\r
41  otherwise the decoder will always apply commands while decoding them*/\r
42 GF_BifsDecoder *gf_bifs_decoder_new(GF_SceneGraph *scenegraph, Bool command_dec);\r
43 void gf_bifs_decoder_del(GF_BifsDecoder *codec);\r
44 \r
45 /*sets the scene time. Scene time is the real clock of the bifs stream in secs*/\r
46 void gf_bifs_decoder_set_time_offset(GF_BifsDecoder *codec, Double ts);\r
47 \r
48 /*signals the sizeInfo of the config should be ignored - used for BIFS in AnimationStream nodes*/\r
49 void gf_bifs_decoder_ignore_size_info(GF_BifsDecoder *codec);\r
50 \r
51 /*setup a stream*/\r
52 GF_Err gf_bifs_decoder_configure_stream(GF_BifsDecoder *codec, u16 ESID, char *DecoderSpecificInfo, u32 DecoderSpecificInfoLength, u32 objectTypeIndication);\r
53 /*removes a stream*/\r
54 GF_Err gf_bifs_decoder_remove_stream(GF_BifsDecoder *codec, u16 ESID);\r
55 \r
56 /*decode a BIFS AU and applies it to the graph (non-memory mode only)*/\r
57 GF_Err gf_bifs_decode_au(GF_BifsDecoder *codec, u16 ESID, char *data, u32 data_length, Double ts_offset);\r
58 \r
59 /*Memory BIFS decoding - fills the command list with the content of the AU - cf scenegraph_vrml.h for commands usage\r
60         @ESID: ID of input stream\r
61         @data, @data_length: BIFS AU\r
62         @com_list: target list for decoded commands\r
63 */\r
64 GF_Err gf_bifs_decode_command_list(GF_BifsDecoder *codec, u16 ESID, char *data, u32 data_length, GF_List *com_list);\r
65 \r
66 \r
67 /*BIFS encoding*/\r
68 typedef struct __tag_bifs_enc GF_BifsEncoder;\r
69 \r
70 /*constructor - @graph: scene graph being encoded*/\r
71 GF_BifsEncoder *gf_bifs_encoder_new(GF_SceneGraph *graph);\r
72 /*destructor*/\r
73 void gf_bifs_encoder_del(GF_BifsEncoder *codec);\r
74 /*setup a destination stream*/\r
75 GF_Err gf_bifs_encoder_new_stream(GF_BifsEncoder *codec, u16 ESID, GF_BIFSConfig *cfg, Bool encodeNames, Bool has_predictive);\r
76 /*encodes a list of commands for the given stream in the output buffer - data is dynamically allocated for output\r
77 the scenegraph used is the one described in SceneReplace command, hence scalable streams shall be encoded in time order\r
78 */\r
79 GF_Err gf_bifs_encode_au(GF_BifsEncoder *codec, u16 ESID, GF_List *command_list, char **out_data, u32 *out_data_length);\r
80 /*returns encoded config desc*/\r
81 GF_Err gf_bifs_encoder_get_config(GF_BifsEncoder *codec, u16 ESID, char **out_data, u32 *out_data_length);\r
82 /*returns BIFS version used by codec for given stream*/\r
83 u8 gf_bifs_encoder_get_version(GF_BifsEncoder *codec, u16 ESID);\r
84 \r
85 /*Encodes current graph as a scene replace*/\r
86 GF_Err gf_bifs_encoder_get_rap(GF_BifsEncoder *codec, char **out_data, u32 *out_data_length);\r
87 \r
88 #ifdef __cplusplus\r
89 }\r
90 #endif\r
91 \r
92 \r
93 \r
94 #endif  /*_GF_BIFS_H_*/\r
95 \r