libannodex  0.7.3
Functions
anx_write.h File Reference
#include <annodex/anx_types.h>

Go to the source code of this file.

Functions

void anx_init_importers (char *content_type_pattern)
 Initialise system importers matching a given content type pattern. More...
 
long anx_write_get_next_page_size (ANNODEX *annodex)
 Query the size of the next page to be written. More...
 
int anx_write_import (ANNODEX *annodex, char *filename, char *id, char *content_type, double seek_offset, double seek_end, int flags)
 Import a file into the current ANNODEX* writer. More...
 
int anx_write_set_anno_callbacks (ANNODEX *annodex, AnxImportHead import_head_callback, AnxImportClip import_clip_callback, AnxImportCMML import_cmml_callback, void *user_data)
 Override the callbacks that importers should call when they wish to handle annotation elements. More...
 
void * anx_write_get_anno_user_data (ANNODEX *annodex)
 Retrieve the user_data associated with attached annotation import callbacks. More...
 
int anx_write_set_ii_callback (ANNODEX *annodex, AnxImportImport import_import_callback, void *user_data)
 Override the Import Import callback, used when an importer wishes to initiate further importing. More...
 
void * anx_write_get_ii_user_data (ANNODEX *annodex)
 Retrieve the user_data associated with attached recursive import callbacks. More...
 
int anx_insert_clip (ANNODEX *annodex, double at_time, AnxClip *clip)
 Insert a clip into an ANNODEX* writer. More...
 
int anx_insert_cmml (ANNODEX *annodex, double at_time, const char *cmml, long n)
 Insert a CMML element into an ANNODEX* writer. More...
 
double anx_get_clip_time_by_id (ANNODEX *annodex, const char *id)
 Query the onset time of a clip. More...
 
double anx_writer_get_end (ANNODEX *annodex)
 
int anx_writer_set_end (ANNODEX *annodex, double end_time)
 
long anx_write (ANNODEX *annodex, long n)
 Write to an annodex opened with anx_open() or anx_open_stdio(). More...
 
long anx_write_output (ANNODEX *annodex, unsigned char *buf, long n)
 Output data from an annodex into a memory buffer. More...
 
int anx_request_header (ANNODEX *annodex)
 
int anx_request_media_sync (ANNODEX *annodex)
 

Detailed Description

Writer specific functions

Function Documentation

◆ anx_get_clip_time_by_id()

double anx_get_clip_time_by_id ( ANNODEX annodex,
const char *  id 
)

Query the onset time of a clip.

Parameters
annodexAn ANNNODEX* writer
idThe id of the clip
Returns
The time of the clip
Return values
-1.0Not found

◆ anx_init_importers()

void anx_init_importers ( char *  content_type_pattern)

Initialise system importers matching a given content type pattern.

Parameters
content_type_patternA content type or range of content types

◆ anx_insert_clip()

int anx_insert_clip ( ANNODEX annodex,
double  at_time,
AnxClip clip 
)

Insert a clip into an ANNODEX* writer.

Parameters
annodexAn ANNODEX* writer
at_timeTime in seconds to schedule the clip
clipa clip

◆ anx_insert_cmml()

int anx_insert_cmml ( ANNODEX annodex,
double  at_time,
const char *  cmml,
long  n 
)

Insert a CMML element into an ANNODEX* writer.

Parameters
annodexAn ANNODEX* writer
at_timeTime in seconds to schedule the clip
cmmlcmml
nAn upper bound on the number of characters to read
Returns
0 on success

◆ anx_write()

long anx_write ( ANNODEX annodex,
long  n 
)

Write to an annodex opened with anx_open() or anx_open_stdio().

Parameters
annodexAn ANNODEX* writer
ncount of bytes to write
Returns
the count of bytes actually written

◆ anx_write_get_anno_user_data()

void* anx_write_get_anno_user_data ( ANNODEX annodex)

Retrieve the user_data associated with attached annotation import callbacks.

Parameters
annodexan ANNODEX* handle
Returns
the associated user_data

◆ anx_write_get_ii_user_data()

void* anx_write_get_ii_user_data ( ANNODEX annodex)

Retrieve the user_data associated with attached recursive import callbacks.

Parameters
annodexan ANNODEX* handle
Returns
the associated user_data

◆ anx_write_get_next_page_size()

long anx_write_get_next_page_size ( ANNODEX annodex)

Query the size of the next page to be written.

Returns
the size in bytes of the next page to be written

◆ anx_write_import()

int anx_write_import ( ANNODEX annodex,
char *  filename,
char *  id,
char *  content_type,
double  seek_offset,
double  seek_end,
int  flags 
)

Import a file into the current ANNODEX* writer.

Parameters
annodexAn ANNODEX* writer
filenamethe file to import
idthe id of the file
content_typethe content-type of the whole import file.
seek_offseta time in seconds to begin importing data from
seek_enda time in seconds to finish importing data
flagswriter import flags (RECURSIVE etc.)

◆ anx_write_output()

long anx_write_output ( ANNODEX annodex,
unsigned char *  buf,
long  n 
)

Output data from an annodex into a memory buffer.

Usually the annodex would have been created with anx_new().

Parameters
annodexan ANNODEX* writer
bufa memory buffer of size at least n bytes in which to output
na count of bytes to output
Returns
the count of bytes actually output

◆ anx_write_set_anno_callbacks()

int anx_write_set_anno_callbacks ( ANNODEX annodex,
AnxImportHead  import_head_callback,
AnxImportClip  import_clip_callback,
AnxImportCMML  import_cmml_callback,
void *  user_data 
)

Override the callbacks that importers should call when they wish to handle annotation elements.

The default head callback overwrites the head and the default clip callback inserts an clip into the scheduling of the ANNODEX* writer.

◆ anx_write_set_ii_callback()

int anx_write_set_ii_callback ( ANNODEX annodex,
AnxImportImport  import_import_callback,
void *  user_data 
)

Override the Import Import callback, used when an importer wishes to initiate further importing.

Parameters
annodexAn ANNODEX* writer
import_import_callbcakThe new Import Import callback
user_dataUser-defined data to pass to the callback