anx_general.h File Reference


Detailed Description

General functions related to Annodex media.

#include <annodex/anx_types.h>

Go to the source code of this file.

Functions

double anx_parse_time (const char *str)
 Time parsing.
int anx_last_error (ANNODEX *annodex)
 Retrieve the error code of the most recent error on an annodex.
const char * anx_strerror (ANNODEX *annodex)
 Retrieve a printable error string corresponding to the most recent error on annodex.
int anx_get_mode (ANNODEX *annodex)
 Get the mode of an Annodex.
ANNODEXanx_open (char *filename, int mode)
 Open a file containing Annodex media.
ANNODEXanx_open_stdio (FILE *file, int mode)
 Attach to an existing file descriptor.
ANNODEXanx_new (int mode)
 Create a managed Annodex handle This is an alternative interface for non-file annodexes.
int anx_flush (ANNODEX *annodex)
 Flush any unwritten data associated with an annodex.
ANNODEXanx_close (ANNODEX *annodex)
 Close an annodex.
int anx_destroy (ANNODEX *annodex)
 Forcefully close an annodex without flushing any file descriptors.
int anx_ready (ANNODEX *annodex)
 Query if an annodex is ready.
int anx_eos (ANNODEX *annodex)
 Query if an annodex has reached its 'End Of Stream' markers.
AnxHead * anx_set_head (ANNODEX *annodex, AnxHead *head)
 Set the head element of the Annodex.
AnxHead * anx_get_head (ANNODEX *annodex)
 Get a copy of the head element of an annodex.
anx_int64_t anx_tell (ANNODEX *annodex)
 Query the current byte offset of an annodex.
int anx_seek_id (ANNODEX *annodex, const char *id)
 Seek to an anchor identified by id.
double anx_get_presentation_time (ANNODEX *annodex)
 Query the presentation time of an annodex.
double anx_set_presentation_time (ANNODEX *annodex, double seconds)
 Set the presentation time of an annodex.
double anx_get_basetime (ANNODEX *annodex)
 Query the basetime of an annodex.
double anx_set_basetime (ANNODEX *annodex, double seconds)
 Set the basetime of an annodex.
double anx_get_bitrate (ANNODEX *annodex)
 Query the bitrate of an annodex.
double anx_get_duration (ANNODEX *annodex)
 Query the duration of an annodex.
double anx_tell_time (ANNODEX *annodex)
 Query the current offset of an annodex expressed as time in seconds.
double anx_seek_time (ANNODEX *annodex, double seconds, int whence)
 Seek to a time point in an annodex.
int anx_head_snprint (char *buf, int n, AnxHead *h)
 Print an AnxHead structure to a memory buffer.
int anx_clip_snprint (char *buf, int n, AnxClip *a, double start, double end)
 Print an AnxAnchor structure to a memory buffer.
AnxHead * anx_head_free (AnxHead *head)
 Free an AnxHead structure.
AnxClip * anx_clip_free (AnxClip *clip)
 Free an AnxClip structure.
AnxHead * anx_head_clone (AnxHead *head)
 Clone an AnxHead structure.
AnxClip * anx_clip_clone (AnxClip *clip)
 Clone an AnxClip structure.
AnxMetaElement * anx_meta_element_clone (AnxMetaElement *meta)
 Clone an AnxMetaElement structure.
AnxLinkElement * anx_link_element_clone (AnxLinkElement *link)
 Clone an AnxLinkElement structure.


Function Documentation

AnxClip* anx_clip_clone ( AnxClip *  clip  ) 

Clone an AnxClip structure.

Parameters:
clip the clip to clone
Returns:
a new clip structure
Note:
All components of the original clip are cloned, including all strings and its list of meta tags.

AnxClip* anx_clip_free ( AnxClip *  clip  ) 

Free an AnxClip structure.

Parameters:
clip the structure to free
Returns:
NULL on success

int anx_clip_snprint ( char *  buf,
int  n,
AnxClip *  a,
double  start,
double  end 
)

Print an AnxAnchor structure to a memory buffer.

The head is serialized to XML conformant with the anxa DTD.

Parameters:
buf a buffer to print into
n the maximum number of characters to print
a the anchor to print
start the value of the 'start' attribute, as a time in seconds. If start is negative, the 'start' attribute is not printed.
Returns:
the number of characters printed, -1 on potential overrun
Bug:
This should follow C99 semantics

ANNODEX* anx_close ( ANNODEX annodex  ) 

Close an annodex.

Parameters:
annodex an ANNODEX* handle
Returns:
NULL on success; returns the unchanged annodex on failure (eg. due to system close() failing)

int anx_destroy ( ANNODEX annodex  ) 

Forcefully close an annodex without flushing any file descriptors.

Parameters:
annodex an ANNODEX* handle
Returns:
0 on success, -1 on failure

int anx_eos ( ANNODEX annodex  ) 

Query if an annodex has reached its 'End Of Stream' markers.

Parameters:
annodex an ANNODEX* handle
Returns:
0 if annodex is not at eos, 1 if it is

int anx_flush ( ANNODEX annodex  ) 

Flush any unwritten data associated with an annodex.

Parameters:
annodex An ANNODEX* handle
Returns:
0 on success, -1 on failure

double anx_get_basetime ( ANNODEX annodex  ) 

Query the basetime of an annodex.

Parameters:
annodex an ANNODEX* handle
Returns:
the basetime of the annodex

double anx_get_bitrate ( ANNODEX annodex  ) 

Query the bitrate of an annodex.

Parameters:
annodex an ANNODEX* handle
Returns:
the bitrate of the annodex
Return values:
-1.0 Unknown

double anx_get_duration ( ANNODEX annodex  ) 

Query the duration of an annodex.

Parameters:
annodex an ANNODEX* handle
Returns:
the duration of the annodex

AnxHead* anx_get_head ( ANNODEX annodex  ) 

Get a copy of the head element of an annodex.

Parameters:
annodex an ANNODEX* handle
Returns:
a copy of the head element

int anx_get_mode ( ANNODEX annodex  ) 

Get the mode of an Annodex.

Parameters:
annodex an ANNODEX* handle
Return values:
ANX_READ annodex is a reader
ANX_WRITE annodex is a writer
ANX_ERR_INVALID annodex is invalid

double anx_get_presentation_time ( ANNODEX annodex  ) 

Query the presentation time of an annodex.

Parameters:
annodex an ANNODEX* handle
Returns:
the presentation time of the annodex

AnxHead* anx_head_clone ( AnxHead *  head  ) 

Clone an AnxHead structure.

Parameters:
head the head to clone
Returns:
a new head structure
Note:
All components of the original head are cloned, including all strings and its list of meta tags.

AnxHead* anx_head_free ( AnxHead *  head  ) 

Free an AnxHead structure.

Parameters:
head the structure to free
Returns:
NULL on success

int anx_head_snprint ( char *  buf,
int  n,
AnxHead *  h 
)

Print an AnxHead structure to a memory buffer.

The head is serialized to XML conformant with the anxhead DTD.

Parameters:
buf a buffer to print into
n the maximum number of characters to print
h the head to print
Returns:
the number of characters printed, -1 on potential overrun
Bug:
This should follow C99 semantics

int anx_last_error ( ANNODEX annodex  ) 

Retrieve the error code of the most recent error on an annodex.

Parameters:
annodex an ANNODEX* handle
Returns:
the error code of the most recent error

AnxLinkElement* anx_link_element_clone ( AnxLinkElement *  link  ) 

Clone an AnxLinkElement structure.

Parameters:
link the link tag structure to clone
Returns:
a new link tag structure

AnxMetaElement* anx_meta_element_clone ( AnxMetaElement *  meta  ) 

Clone an AnxMetaElement structure.

Parameters:
meta the meta tag structure to clone
Returns:
a new meta tag structure

ANNODEX* anx_new ( int  mode  ) 

Create a managed Annodex handle This is an alternative interface for non-file annodexes.

Parameters:
mode ANX_READ or ANX_WRITE
Returns:
an ANNODEX* handle

ANNODEX* anx_open ( char *  filename,
int  mode 
)

Open a file containing Annodex media.

Parameters:
filename path to the file
mode ANX_READ or ANX_WRITE
Returns:
an ANNODEX* handle

ANNODEX* anx_open_stdio ( FILE *  file,
int  mode 
)

Attach to an existing file descriptor.

Parameters:
fd an open file descriptor
mode ANX_READ or ANX_WRITE
Returns:
an ANNODEX* handle

int anx_ready ( ANNODEX annodex  ) 

Query if an annodex is ready.

Parameters:
annodex an ANNODEX* handle
Returns:
0 if annodex is not ready, 1 if it is

int anx_seek_id ( ANNODEX annodex,
const char *  id 
)

Seek to an anchor identified by id.

Parameters:
annodex an ANNODEX* handle
id The id of the anchor to seek to

double anx_seek_time ( ANNODEX annodex,
double  seconds,
int  whence 
)

Seek to a time point in an annodex.

Parameters:
annodex an ANNODEX* handle
seconds the time to seek to
whence whence parameter (defined in anx_constants.h)

double anx_set_basetime ( ANNODEX annodex,
double  seconds 
)

Set the basetime of an annodex.

Parameters:
annodex an ANNODEX* handle
seconds the new basetime

AnxHead* anx_set_head ( ANNODEX annodex,
AnxHead *  head 
)

Set the head element of the Annodex.

Parameters:
annodex an ANNODEX* handle
head a complete AnxHead structure to set
Returns:
the head if successful, NULL on failure
Note:
libannodex makes a copy of the head; it can be safely freed after returning from this call.

double anx_set_presentation_time ( ANNODEX annodex,
double  seconds 
)

Set the presentation time of an annodex.

Parameters:
annodex an ANNODEX* handle
seconds the new presentation time

const char* anx_strerror ( ANNODEX annodex  ) 

Retrieve a printable error string corresponding to the most recent error on annodex.

Parameters:
annodex an ANNODEX* handle
Returns:
an error string

anx_int64_t anx_tell ( ANNODEX annodex  ) 

Query the current byte offset of an annodex.

Parameters:
annodex an ANNODEX* handle
Returns:
the current byte offset XXX: Deprecated?

double anx_tell_time ( ANNODEX annodex  ) 

Query the current offset of an annodex expressed as time in seconds.

Parameters:
annodex an ANNODEX* handle
Returns:
the current time offset


Generated on Mon Jul 10 11:41:47 2006 for libannodex by  doxygen 1.4.7