2 * GPAC Multimedia Framework
\r
4 * Authors: Cyril Concolato - Jean le Feuvre
\r
5 * Copyright (c) 2005-200X ENST
\r
6 * All rights reserved
\r
8 * This file is part of GPAC / ISO Media File Format sub-project
\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
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
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
27 #ifndef _GF_BIFSENGINE_H_
\r
28 #define _GF_BIFSENGINE_H_
\r
34 #include <gpac/scene_manager.h>
\r
36 #ifndef GPAC_READ_ONLY
\r
38 typedef struct __tag_bifs_engine GF_BifsEngine;
\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
44 * must be called only one time (by process calling the DLL) before other calls
\r
46 GF_BifsEngine *gf_beng_init(void *calling_object, char *inputContext);
\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
54 * must be called only one time (by process calling the DLL) before other calls
\r
56 GF_BifsEngine *gf_beng_init_from_string(void *calling_object, char *inputContext, u32 width, u32 height, Bool usePixelMetrics);
\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
63 * must be called only one time (by process calling the DLL) before other calls
\r
65 GF_BifsEngine *gf_beng_init_from_context(void *calling_object, GF_SceneManager *ctx);
\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
72 * must be called after BENC_Init
\r
74 void gf_beng_get_stream_config(GF_BifsEngine *beng, char **config, u32 *config_len);
\r
77 * Encodes the AU context which is not encoded when calling BENC_EncodeAUFromString/File
\r
78 * Should be called after Aggregate.
\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
84 GF_Err gf_beng_encode_context(GF_BifsEngine *beng, GF_Err (*AUCallback)(void *, char *data, u32 size, u64 ts));
\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
92 GF_Err gf_beng_encode_from_file(GF_BifsEngine *beng, char *auFile, GF_Err (*AUCallback)(void *, char *data, u32 size, u64 ts));
\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
100 GF_Err gf_beng_encode_from_string(GF_BifsEngine *beng, char *auString, GF_Err (*AUCallback)(void *, char *data, u32 size, u64 ts));
\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
106 * save the current context of the beng.
\r
107 * if you want to save an aggregate context, use BENC_AggregateCurrentContext before
\r
110 GF_Err gf_beng_save_context(GF_BifsEngine *beng, char *ctxFileName);
\r
113 * @beng, pointer to the GF_BifsEngine returned by BENC_Init
\r
115 * aggregates the current context of the beng, creates a scene replace
\r
118 GF_Err gf_beng_aggregate_context(GF_BifsEngine *beng);
\r
121 * @beng, pointer to the GF_BifsEngine returned by BENC_Init
\r
123 * release the memory used by this beng, no more call on the beng should happen after this
\r
126 void gf_beng_terminate(GF_BifsEngine *beng);
\r
134 #endif // __cplusplus
\r
137 #endif /*_GF_BIFSENGINE_H_*/
\r