libannodex
0.7.3
|
00001 /* 00002 Copyright (C) 2003 Commonwealth Scientific and Industrial Research 00003 Organisation (CSIRO) Australia 00004 00005 Redistribution and use in source and binary forms, with or without 00006 modification, are permitted provided that the following conditions 00007 are met: 00008 00009 - Redistributions of source code must retain the above copyright 00010 notice, this list of conditions and the following disclaimer. 00011 00012 - Redistributions in binary form must reproduce the above copyright 00013 notice, this list of conditions and the following disclaimer in the 00014 documentation and/or other materials provided with the distribution. 00015 00016 - Neither the name of CSIRO Australia nor the names of its 00017 contributors may be used to endorse or promote products derived from 00018 this software without specific prior written permission. 00019 00020 THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 00021 ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 00022 LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A 00023 PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE ORGANISATION OR 00024 CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, 00025 EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, 00026 PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR 00027 PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF 00028 LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING 00029 NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS 00030 SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 00031 */ 00032 00033 #ifndef __ANX_WRITE_H__ 00034 #define __ANX_WRITE_H__ 00035 00061 #include <annodex/anx_types.h> 00062 00063 #ifdef __cplusplus 00064 extern "C" { 00065 #endif 00066 00071 void anx_init_importers (char * content_type_pattern); 00072 00077 long anx_write_get_next_page_size (ANNODEX * annodex); 00078 00089 int 00090 anx_write_import (ANNODEX * annodex, char * filename, 00091 char * id, char * content_type, 00092 double seek_offset, double seek_end, int flags); 00093 00100 int 00101 anx_write_set_anno_callbacks (ANNODEX * annodex, 00102 AnxImportHead import_head_callback, 00103 AnxImportClip import_clip_callback, 00104 AnxImportCMML import_cmml_callback, 00105 void * user_data); 00106 00112 void * 00113 anx_write_get_anno_user_data (ANNODEX * annodex); 00114 00122 int 00123 anx_write_set_ii_callback (ANNODEX * annodex, 00124 AnxImportImport import_import_callback, 00125 void * user_data); 00126 00132 void * 00133 anx_write_get_ii_user_data (ANNODEX * annodex); 00134 00141 int 00142 anx_insert_clip (ANNODEX * annodex, double at_time, AnxClip * clip); 00143 00152 int anx_insert_cmml (ANNODEX * annodex, double at_time, 00153 const char * cmml, long n); 00154 00162 double anx_get_clip_time_by_id (ANNODEX * annodex, const char * id); 00163 00164 double anx_writer_get_end (ANNODEX * annodex); 00165 int anx_writer_set_end (ANNODEX * annodex, double end_time); 00166 00173 long anx_write (ANNODEX * annodex, long n); 00174 00183 long anx_write_output (ANNODEX * annodex, unsigned char * buf, long n); 00184 00185 int anx_request_header (ANNODEX * annodex); 00186 int anx_request_media_sync (ANNODEX * annodex); 00187 00188 #ifdef _UNIMPLEMENTED_ 00189 00190 /* Scheduled commands to control the Annodex writer */ 00191 00192 typedef struct _AnxSchedule AnxSchedule; 00193 typedef struct _AnxImport AnxImport; 00194 00195 typedef enum _AnxSchedType { 00196 ANX_SCHED_CLIP, 00197 ANX_SCHED_IMPORT 00198 } AnxSchedType; 00199 00200 struct _AnxImport { 00201 char * location; /* URI to media document */ 00202 char * content_type; 00203 int flags; 00204 }; 00205 00206 struct _AnxSchedule { 00207 double start_time; 00208 AnxSchedType type; 00209 union { 00210 AnxClip * clip; 00211 AnxImport * import; 00212 } data; 00213 }; 00214 00215 AnxSchedule * 00216 anx_schedule_query (ANNODEX * annodex, double at_time, AnxSchedType type); 00217 00218 int 00219 anx_schedule_remove (ANNODEX * annodex, double at_time, AnxSchedType type); 00220 00221 AnxSchedule * 00222 anx_schedule_first (ANNODEX * annodex); 00223 00224 AnxSchedule * 00225 anx_schedule_next (ANNODEX * annodex, AnxSchedule * schedule); 00226 00227 AnxSchedule * 00228 anx_schedule_prev (ANNODEX * annodex, AnxSchedule * schedule); 00229 00230 #endif /* _UNIMPLEMENTED_ */ 00231 00232 #ifdef __cplusplus 00233 } 00234 #endif 00235 00236 #endif /* __ANX_WRITE_H__ */