Main Page | Modules | Data Structures | File List | Data Fields | Globals | Related Pages

anx_media.h File Reference


Detailed Description

Specification of AnxMediaImporter.

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

#include <annodex/anx_int64.h>
#include <annodex/anx_types.h>
#include <annodex/anx_core.h>

Go to the source code of this file.

Data Structures

struct  _AnxMedia
struct  _AnxMediaImporter
struct  _AnxMediaTrack

Typedefs

typedef _AnxMediaImporter AnxMediaImporter
 An AnxMediaImporter implements generic functions for retrieving data from sources of a particular content type.

typedef _AnxMediaTrack AnxMediaTrack
 An AnxMediaTrack contains one track of data.

typedef _AnxMedia AnxMedia
 An AnxMedia contains an instance of an active media object, which may in turn contain several tracks.

typedef AnxMedia *(* AnxMediaOpenFunc )(const char *path, const char *id, int ignore_media, double start_time, double end_time, AnxImportCallbacks *import_callbacks)
 Signature of a function for opening a media object by filename.

typedef AnxMedia *(* AnxMediaOpenFDFunc )(int fd, const char *id, int ignore_media, double start_time, double end_time, AnxImportCallbacks *import_callbacks)
 Signature of a function for opening a media object attached to an open file descriptor.

typedef long(* AnxMediaReadFunc )(AnxMedia *media, unsigned char *buf, long n, long bound)
 Signature of a function for reading bytes from a media object.

typedef long(* AnxMediaSizeofNextReadFunc )(AnxMedia *media, long bound)
 Signature of a function to return the preferred next read size.

typedef int(* AnxMediaCloseFunc )(AnxMedia *media)
 Signature of a function to close a media object.


Functions

int anx_register_media_importer (AnxMediaImporter *importer)
 Register an AnxMediaImporter object with libannodex.

int anx_unregister_media_importer (AnxMediaImporter *importer)
 Unregister an importer previously registered with libannodex.


Typedef Documentation

typedef int(* AnxMediaCloseFunc)(AnxMedia * media)
 

Signature of a function to close a media object.

Parameters:
media an AnxMedia* handle

typedef AnxMedia*(* AnxMediaOpenFDFunc)(int fd, const char * id, int ignore_media, double start_time, double end_time, AnxImportCallbacks * import_callbacks)
 

Signature of a function for opening a media object attached to an open file descriptor.

Parameters:
fd an open file descriptor
id the id of this
ignore_media a flag to indicate that the importer should ignore any media read requests, ie. just deliver anchors
start_time the start time to initially seek to
end_time a time bound to end on
import_callbacks callbacks to call when further importing or anchor inserting is required.
Returns:
a new AnxMedia* handle

typedef AnxMedia*(* AnxMediaOpenFunc)(const char * path, const char * id, int ignore_media, double start_time, double end_time, AnxImportCallbacks * import_callbacks)
 

Signature of a function for opening a media object by filename.

Parameters:
path the path to the media file
id the id of this
ignore_media a flag to indicate that the importer should ignore any media read requests, ie. just deliver anchors
start_time the start time to initially seek to
end_time a time bound to end on
import_callbacks callbacks to call when further importing or anchor inserting is required.
Returns:
a new AnxMedia* handle

typedef long(* AnxMediaReadFunc)(AnxMedia * media, unsigned char * buf, long n, long bound)
 

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

Parameters:
media an AnxMedia* handle
buf a buffer to read data into
n a maximum number of bytes to read
bound a maximum granulecount to read

typedef long(* AnxMediaSizeofNextReadFunc)(AnxMedia * media, long bound)
 

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

Parameters:
media an AnxMedia* handle
bound a maximum granulecount to read


Function Documentation

int anx_register_media_importer AnxMediaImporter importer  ) 
 

Register an AnxMediaImporter object with libannodex.

Parameters:
importer the importer
Returns:
0 on success, -1 on failure

int anx_unregister_media_importer AnxMediaImporter importer  ) 
 

Unregister an importer previously registered with libannodex.

Parameters:
importer the importer
Returns:
0 on success, -1 on failure


Generated on Tue Nov 11 20:42:56 2003 for libannodex by doxygen 1.3.4