libannodex  0.7.3
Data Structures | Typedefs | Functions
anx_import.h File Reference
#include <annodex/anx_types.h>
#include <annodex/anx_core.h>

Go to the source code of this file.

Data Structures

struct  _AnxImporter
 
struct  _AnxSourceTrack
 
struct  _AnxSource
 

Typedefs

typedef struct _AnxImporter AnxImporter
 An AnxImporter implements generic functions for retrieving data from sources of a particular content type.
 
typedef struct _AnxSourceTrack AnxSourceTrack
 An AnxSourceTrack contains one track of data.
 
typedef struct _AnxSource AnxSource
 An AnxSource contains an instance of an active source object, which may in turn contain several tracks.
 
typedef 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. More...
 
typedef 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. More...
 
typedef long(* AnxImporterReadFunc) (AnxSource *source, unsigned char *buf, long n, long bound)
 Signature of a function for reading bytes from a source object. More...
 
typedef long(* AnxImporterSizeofNextReadFunc) (AnxSource *source, long bound)
 Signature of a function to return the preferred next read size. More...
 
typedef int(* AnxImporterCloseFunc) (AnxSource *source)
 Signature of a function to close a source object. More...
 

Functions

int anx_importer_register (AnxImporter *importer)
 Register an AnxImporter object with libannodex. More...
 
int anx_importer_unregister (AnxImporter *importer)
 Unregister an AnxImporter previously registered with libannodex. More...
 
AnxImporteranx_importer_find (char *content_type)
 Find the AnxImporter registered with the given content type. More...
 

Detailed Description

Specification of AnxImporter

Note
Always check not to seek before start_packet and not to seek or read past end_packet.

Backends must implement the following function:

Importers are accessed by index i using values from 0 upwards. For out of range indexes, this function must return NULL.

No other symbols in a backend should be visible (ie. declare all other globals and functions as static).

Typedef Documentation

◆ AnxImporterCloseFunc

typedef int(* AnxImporterCloseFunc) (AnxSource *source)

Signature of a function to close a source object.

Parameters
sourcean AnxSource* handle

◆ AnxImporterOpenFDFunc

typedef 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.

Parameters
fdan open file descriptor
idthe id of this
ignore_rawa flag to indicate that the importer should ignore any raw source read requests, ie. just deliver clips
start_timethe start time to initially seek to
end_timea time bound to end on
import_callbackscallbacks to call when further importing or anchor inserting is required.
Returns
a new AnxSource * handle

◆ AnxImporterOpenFunc

typedef 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.

Parameters
paththe path to the source file
idthe id of this
ignore_rawa flag to indicate that the importer should ignore any raw source read requests, ie. just deliver clips
start_timethe start time to initially seek to
end_timea time bound to end on
import_callbackscallbacks to call when further importing or anchor inserting is required.
Returns
a new AnxSource * handle

◆ AnxImporterReadFunc

typedef long(* AnxImporterReadFunc) (AnxSource *source, unsigned char *buf, long n, long bound)

Signature of a function for reading bytes from a source object.

Parameters
sourcean AnxSource * handle
bufa buffer to read data into
na maximum number of bytes to read
bounda maximum granulecount to read

◆ AnxImporterSizeofNextReadFunc

typedef long(* AnxImporterSizeofNextReadFunc) (AnxSource *source, long bound)

Signature of a function to return the preferred next read size.

Parameters
sourcean AnxSource * handle
bounda maximum granulecount to read

Function Documentation

◆ anx_importer_find()

AnxImporter* anx_importer_find ( char *  content_type)

Find the AnxImporter registered with the given content type.

Parameters
content_typethe content type
Returns
the AnxImporter * on success, NULL on failure

◆ anx_importer_register()

int anx_importer_register ( AnxImporter importer)

Register an AnxImporter object with libannodex.

Parameters
importerthe importer
Returns
0 on success, -1 on failure

◆ anx_importer_unregister()

int anx_importer_unregister ( AnxImporter importer)

Unregister an AnxImporter previously registered with libannodex.

Parameters
importerthe importer
Returns
0 on success, -1 on failure