2 * GPAC - Multimedia Framework C SDK
\r
4 * Copyright (c) Jean Le Feuvre 2000-2005
\r
5 * All rights reserved
\r
7 * This file is part of GPAC / BIFS codec sub-project
\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
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
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
33 #include <gpac/nodes_mpeg4.h>
\r
35 #include <gpac/mpeg4_odf.h>
\r
37 typedef struct __tag_bifs_dec GF_BifsDecoder;
\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
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
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
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
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
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
64 GF_Err gf_bifs_decode_command_list(GF_BifsDecoder *codec, u16 ESID, char *data, u32 data_length, GF_List *com_list);
\r
68 typedef struct __tag_bifs_enc GF_BifsEncoder;
\r
70 /*constructor - @graph: scene graph being encoded*/
\r
71 GF_BifsEncoder *gf_bifs_encoder_new(GF_SceneGraph *graph);
\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
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
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
94 #endif /*_GF_BIFS_H_*/
\r