libannodex  0.7.3
anx_write.h
Go to the documentation of this file.
1 /*
2  Copyright (C) 2003 Commonwealth Scientific and Industrial Research
3  Organisation (CSIRO) Australia
4 
5  Redistribution and use in source and binary forms, with or without
6  modification, are permitted provided that the following conditions
7  are met:
8 
9  - Redistributions of source code must retain the above copyright
10  notice, this list of conditions and the following disclaimer.
11 
12  - Redistributions in binary form must reproduce the above copyright
13  notice, this list of conditions and the following disclaimer in the
14  documentation and/or other materials provided with the distribution.
15 
16  - Neither the name of CSIRO Australia nor the names of its
17  contributors may be used to endorse or promote products derived from
18  this software without specific prior written permission.
19 
20  THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
21  ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
22  LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A
23  PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE ORGANISATION OR
24  CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
25  EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
26  PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
27  PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
28  LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
29  NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
30  SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
31 */
32 
33 #ifndef __ANX_WRITE_H__
34 #define __ANX_WRITE_H__
35 
61 #include <annodex/anx_types.h>
62 
63 #ifdef __cplusplus
64 extern "C" {
65 #endif
66 
71 void anx_init_importers (char * content_type_pattern);
72 
77 long anx_write_get_next_page_size (ANNODEX * annodex);
78 
89 int
90 anx_write_import (ANNODEX * annodex, char * filename,
91  char * id, char * content_type,
92  double seek_offset, double seek_end, int flags);
93 
100 int
102  AnxImportHead import_head_callback,
103  AnxImportClip import_clip_callback,
104  AnxImportCMML import_cmml_callback,
105  void * user_data);
106 
112 void *
114 
122 int
124  AnxImportImport import_import_callback,
125  void * user_data);
126 
132 void *
134 
141 int
142 anx_insert_clip (ANNODEX * annodex, double at_time, AnxClip * clip);
143 
152 int anx_insert_cmml (ANNODEX * annodex, double at_time,
153  const char * cmml, long n);
154 
162 double anx_get_clip_time_by_id (ANNODEX * annodex, const char * id);
163 
164 double anx_writer_get_end (ANNODEX * annodex);
165 int anx_writer_set_end (ANNODEX * annodex, double end_time);
166 
173 long anx_write (ANNODEX * annodex, long n);
174 
183 long anx_write_output (ANNODEX * annodex, unsigned char * buf, long n);
184 
185 int anx_request_header (ANNODEX * annodex);
186 int anx_request_media_sync (ANNODEX * annodex);
187 
188 #ifdef _UNIMPLEMENTED_
189 
190 /* Scheduled commands to control the Annodex writer */
191 
192 typedef struct _AnxSchedule AnxSchedule;
193 typedef struct _AnxImport AnxImport;
194 
195 typedef enum _AnxSchedType {
196  ANX_SCHED_CLIP,
197  ANX_SCHED_IMPORT
198 } AnxSchedType;
199 
200 struct _AnxImport {
201  char * location; /* URI to media document */
202  char * content_type;
203  int flags;
204 };
205 
206 struct _AnxSchedule {
207  double start_time;
208  AnxSchedType type;
209  union {
210  AnxClip * clip;
211  AnxImport * import;
212  } data;
213 };
214 
215 AnxSchedule *
216 anx_schedule_query (ANNODEX * annodex, double at_time, AnxSchedType type);
217 
218 int
219 anx_schedule_remove (ANNODEX * annodex, double at_time, AnxSchedType type);
220 
221 AnxSchedule *
222 anx_schedule_first (ANNODEX * annodex);
223 
224 AnxSchedule *
225 anx_schedule_next (ANNODEX * annodex, AnxSchedule * schedule);
226 
227 AnxSchedule *
228 anx_schedule_prev (ANNODEX * annodex, AnxSchedule * schedule);
229 
230 #endif /* _UNIMPLEMENTED_ */
231 
232 #ifdef __cplusplus
233 }
234 #endif
235 
236 #endif /* __ANX_WRITE_H__ */
int anx_write_import(ANNODEX *annodex, char *filename, char *id, char *content_type, double seek_offset, double seek_end, int flags)
Import a file into the current ANNODEX* writer.
Definition: anx_types.h:102
int anx_insert_cmml(ANNODEX *annodex, double at_time, const char *cmml, long n)
Insert a CMML element into an ANNODEX* writer.
long anx_write(ANNODEX *annodex, long n)
Write to an annodex opened with anx_open() or anx_open_stdio().
Public structures and datatypes.
int anx_write_set_ii_callback(ANNODEX *annodex, AnxImportImport import_import_callback, void *user_data)
Override the Import Import callback, used when an importer wishes to initiate further importing.
void ANNODEX
An ANNODEX handle.
Definition: anx_types.h:55
long anx_write_output(ANNODEX *annodex, unsigned char *buf, long n)
Output data from an annodex into a memory buffer.
int anx_insert_clip(ANNODEX *annodex, double at_time, AnxClip *clip)
Insert a clip into an ANNODEX* writer.
void * anx_write_get_anno_user_data(ANNODEX *annodex)
Retrieve the user_data associated with attached annotation import callbacks.
double anx_get_clip_time_by_id(ANNODEX *annodex, const char *id)
Query the onset time of a clip.
void * anx_write_get_ii_user_data(ANNODEX *annodex)
Retrieve the user_data associated with attached recursive import callbacks.
int anx_write_set_anno_callbacks(ANNODEX *annodex, AnxImportHead import_head_callback, AnxImportClip import_clip_callback, AnxImportCMML import_cmml_callback, void *user_data)
Override the callbacks that importers should call when they wish to handle annotation elements.
long anx_write_get_next_page_size(ANNODEX *annodex)
Query the size of the next page to be written.
void anx_init_importers(char *content_type_pattern)
Initialise system importers matching a given content type pattern.