libannodex 0.7.3
anx_import.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_IMPORT_H__
34#define __ANX_IMPORT_H__
35
36#include <annodex/anx_types.h>
37#include <annodex/anx_core.h>
38
62
68
73
78typedef struct _AnxSource AnxSource;
79
92typedef AnxSource* (*AnxImporterOpenFunc) (const char * path, const char * id,
93 int ignore_raw,
94 double start_time, double end_time,
95 AnxImportCallbacks * import_callbacks);
96
110typedef AnxSource * (*AnxImporterOpenFDFunc) (int fd, const char * id,
111 int ignore_raw,
112 double start_time, double end_time,
113 AnxImportCallbacks * import_callbacks);
114
122typedef long (*AnxImporterReadFunc) (AnxSource * source, unsigned char * buf,
123 long n, long bound);
124
130typedef long (*AnxImporterSizeofNextReadFunc) (AnxSource * source, long bound);
131
136typedef int (*AnxImporterCloseFunc) (AnxSource * source);
137
143 AnxImporterSizeofNextReadFunc sizeof_next_read;
144 char * content_type;
145};
146
148 char * id;
149 char * content_type;
150 long nr_header_packets;
151 anx_int64_t granule_rate_n;
152 anx_int64_t granule_rate_d;
153 anx_int64_t start_granule;
154 anx_int64_t end_granule;
155 anx_int64_t current_granule;
156 int eos;
157 anx_int64_t basegranule;/*< Base granule */
158 int preroll; /*< Preroll */
159 int granuleshift; /*< Granuleshift */
160};
161
163 AnxImporter * importer;
164 AnxList * tracks;
165 AnxSourceTrack * current_track; /* points within tracks,
166 managed by importer */
167
168 int eos;
169 double start_time;
170 double end_time;
171 void * custom_data;
172 double current_time;
173 int written_secondaries;
174 double duration;
175 long byte_length;
176};
177
178#ifdef __cplusplus
179extern "C" {
180#endif
181
188
195
196
202
203AnxImporter *anx_importer_find (char * content_type);
204
205#ifdef __cplusplus
206}
207#endif
208
209#endif /* __ANX_IMPORT_H__ */
Core datatypes etc.
long(* AnxImporterReadFunc)(AnxSource *source, unsigned char *buf, long n, long bound)
Signature of a function for reading bytes from a source object.
Definition anx_import.h:122
struct _AnxSource AnxSource
An AnxSource contains an instance of an active source object, which may in turn contain several track...
Definition anx_import.h:78
AnxSource *(* AnxImporterOpenFunc)(const char *path, const char *id, int ignore_raw, double start_time, double end_time, AnxImportCallbacks *import_callbacks)
Signature of a function for opening a source object by filename.
Definition anx_import.h:92
int anx_importer_unregister(AnxImporter *importer)
Unregister an AnxImporter previously registered with libannodex.
struct _AnxImporter AnxImporter
An AnxImporter implements generic functions for retrieving data from sources of a particular content ...
Definition anx_import.h:67
int(* AnxImporterCloseFunc)(AnxSource *source)
Signature of a function to close a source object.
Definition anx_import.h:136
int anx_importer_register(AnxImporter *importer)
Register an AnxImporter object with libannodex.
AnxImporter * anx_importer_find(char *content_type)
Find the AnxImporter registered with the given content type.
struct _AnxSourceTrack AnxSourceTrack
An AnxSourceTrack contains one track of data.
Definition anx_import.h:72
AnxSource *(* AnxImporterOpenFDFunc)(int fd, const char *id, int ignore_raw, double start_time, double end_time, AnxImportCallbacks *import_callbacks)
Signature of a function for opening a source object attached to an open file descriptor.
Definition anx_import.h:110
long(* AnxImporterSizeofNextReadFunc)(AnxSource *source, long bound)
Signature of a function to return the preferred next read size.
Definition anx_import.h:130
int64_t anx_int64_t
This typedef was determined on the system on which the documentation was generated.
Definition anx_int64.h:93
struct _AnxList AnxList
A doubly linked list.
Definition anx_list.h:45
Public structures and datatypes.
Definition anx_import.h:138
Definition anx_import.h:147
Definition anx_import.h:162