ekg2
Struktury danych | Definicje | Definicje typów | Wyliczenia | Funkcje
Dokumentacja pliku ekg/audio.h
#include "dynstuff.h"
#include "plugins.h"

Idź do kodu źródłowego tego pliku.

Struktury danych

struct  audio
struct  audio_io_t
struct  codec
struct  audio_codec_t
struct  stream

Definicje

#define WATCHER_AUDIO(x)   int x(int type, int fd, string_t buf, void *data)
#define __AINIT(a, way, args...)   a ? a->control_handler(AUDIO_CONTROL_SET, way, NULL, args, NULL) : NULL
#define __CINIT(c, args...)   c ? c->control_handler(AUDIO_CONTROL_SET, AUDIO_RDWR, NULL, args, NULL) : NULL
#define __AINIT_F(name, way, args...)   __AINIT((audio_find(name)), way, args)
#define __CINIT_F(name, args...)   __CINIT((codec_find(name)), args)
#define CODEC_RECODE(x)   int x(int type, string_t input, string_t output, void *data)
#define AUDIO_CONTROL(x)   audio_io_t *x(audio_control_t type, audio_way_t way, audio_io_t *aio, ...)
#define CODEC_CONTROL(x)   audio_codec_t *x(audio_control_t type, audio_way_t way, audio_codec_t *aco, ...)
#define AUDIO_DEFINE(x)
#define CODEC_DEFINE(x)

Definicje typów

typedef int audio_handler_func_t (int type, int fd, string_t buf, void *data)
typedef struct audio audio_t
typedef struct codec codec_t
typedef struct stream stream_t

Wyliczenia

enum  audio_control_t {
  AUDIO_CONTROL_INIT = 0, AUDIO_CONTROL_SET, AUDIO_CONTROL_GET, AUDIO_CONTROL_DEINIT,
  AUDIO_CONTROL_HELP
}
enum  audio_way_t { AUDIO_READ = 0, AUDIO_WRITE, AUDIO_RDWR }
enum  codec_way_t { CODEC_CODE = 0, CODEC_DECODE }

Funkcje

int stream_create (char *name, audio_io_t *in, audio_codec_t *co, audio_io_t *out)
int audio_register (audio_t *audio)
audio_taudio_find (const char *name)
void audio_unregister (audio_t *audio)
int codec_register (codec_t *codec)
codec_tcodec_find (const char *name)
void codec_unregister (codec_t *codec)
int audio_initialize ()
int audio_deinitialize ()

Dokumentacja definicji

#define __AINIT (   a,
  way,
  args... 
)    a ? a->control_handler(AUDIO_CONTROL_SET, way, NULL, args, NULL) : NULL
#define __AINIT_F (   name,
  way,
  args... 
)    __AINIT((audio_find(name)), way, args)
#define __CINIT (   c,
  args... 
)    c ? c->control_handler(AUDIO_CONTROL_SET, AUDIO_RDWR, NULL, args, NULL) : NULL
#define __CINIT_F (   name,
  args... 
)    __CINIT((codec_find(name)), args)
#define AUDIO_CONTROL (   x)    audio_io_t *x(audio_control_t type, audio_way_t way, audio_io_t *aio, ...)
#define AUDIO_DEFINE (   x)
Wartość:
extern AUDIO_CONTROL(x##_audio_control);\
        extern WATCHER_AUDIO(x##_audio_read);           \
        extern WATCHER_AUDIO(x##_audio_write);  \
        audio_t x##_audio = { \
                .name = #x, \
                .control_handler= (void*) x##_audio_control, \
                .read_handler   = x##_audio_read, \
                .write_handler  = x##_audio_write, \
        }
#define CODEC_CONTROL (   x)    audio_codec_t *x(audio_control_t type, audio_way_t way, audio_codec_t *aco, ...)
#define CODEC_DEFINE (   x)
Wartość:
extern CODEC_CONTROL(x##_codec_control);\
        extern CODEC_RECODE(x##_codec_code);    \
        extern CODEC_RECODE(x##_codec_decode);  \
        codec_t x##_codec = { \
                .name = #x, \
                .control_handler= (void*) x##_codec_control,    \
                .code_handler   = x##_codec_code,       \
                .decode_handler = x##_codec_decode,     \
        }
#define CODEC_RECODE (   x)    int x(int type, string_t input, string_t output, void *data)
#define WATCHER_AUDIO (   x)    int x(int type, int fd, string_t buf, void *data)

Dokumentacja definicji typów

typedef int audio_handler_func_t(int type, int fd, string_t buf, void *data)
typedef struct audio audio_t
typedef struct codec codec_t
typedef struct stream stream_t

Dokumentacja typów wyliczanych

Wartości wyliczeń:
AUDIO_CONTROL_INIT 
AUDIO_CONTROL_SET 
AUDIO_CONTROL_GET 
AUDIO_CONTROL_DEINIT 
AUDIO_CONTROL_HELP 
Wartości wyliczeń:
AUDIO_READ 
AUDIO_WRITE 
AUDIO_RDWR 
Wartości wyliczeń:
CODEC_CODE 
CODEC_DECODE 

Dokumentacja funkcji

int audio_deinitialize ( )
audio_t* audio_find ( const char *  name)

audio_find()

Find audio_t by name

Parametry:
name- name of audio_t
Zwraca:
if name founded, return struct describing it. else NULL
int audio_initialize ( )
int audio_register ( audio_t audio)

audio_register()

Register new audio I/O (audio)

Nota:
This should be done @ *_plugin_init() and just before plugin_register() If audio_register() fails (return not 0) than you should NOT call plugin_register() only display some info... and return -1
Parametry:
audio- audio_t to register
Zobacz również:
audio_unregister() - to unregister audio_t
Zwraca:
-1 if invalid params (audio NULL)
-2 if audio with such name already exists
0 on success
void audio_unregister ( audio_t audio)

audio_unregister()

Unregister audio_t

Nota:
This should be done @ *_plugin_destroy() just before plugin_unregister()
Parametry:
audio- audio_t to unregister
codec_t* codec_find ( const char *  name)

codec_find()

Find codec_t by name

Parametry:
name- name of codec_t
Zwraca:
if name founded, return struct describing it, else NULL
int codec_register ( codec_t codec)

codec_register()

Register new codec_t (codec)

Nota:
This should be done @ *_plugin_init() and just before plugin_register() If codec_register() fails (return not 0) than you should NOT call plugin_register() only display some info... and return -1
Parametry:
codec- codec_t to register
Zobacz również:
codec_unregister() - to unregister codec_t
Zwraca:
-1 if invalid params (codec NULL)
-2 if codec with such name already exists
0 on success
void codec_unregister ( codec_t codec)

audio_unregister()

Unregister codec_t

Nota:
This should be done @ *_plugin_destroy() just before plugin_unregister()
Parametry:
codec- codec_t to unregister
int stream_create ( char *  name,
audio_io_t in,
audio_codec_t co,
audio_io_t out 
)

stream_create()

Function to create streams /input fd/ --> [codec function] --> /output fd or function/

Nota:
in->fd must != -1, out->fd can be -1
Do zrobienia:
Implement errors. make param , char **error
Pass it to AUDIO_CONTROL_INIT and if smth fail, there should be allocated description of error.
Do zrobienia:
Implement stream_close()
Zwraca:
1 on sucess [created stream_t] or 0 if fail.
 All Struktury Danych Pliki Funkcje Zmienne Definicje typów Wyliczenia Wartości wyliczeń Definicje