#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_t * | audio_find (const char *name) |
| void | audio_unregister (audio_t *audio) |
| int | codec_register (codec_t *codec) |
| codec_t * | codec_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_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_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 WATCHER_AUDIO |
( |
|
x | ) |
int x(int type, int fd, string_t buf, void *data) |
Dokumentacja definicji typów
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 |
|
Dokumentacja funkcji
| int audio_deinitialize |
( |
| ) |
|
| audio_t* audio_find |
( |
const char * |
name | ) |
|
audio_find()
Find audio_t by name
- Parametry:
-
- Zwraca:
- if name founded, return struct describing it. else NULL
| int audio_register |
( |
audio_t * |
audio | ) |
|
| void audio_unregister |
( |
audio_t * |
audio | ) |
|
| codec_t* codec_find |
( |
const char * |
name | ) |
|
codec_find()
Find codec_t by name
- Parametry:
-
- Zwraca:
- if name founded, return struct describing it, else NULL
| int codec_register |
( |
codec_t * |
codec | ) |
|
| void codec_unregister |
( |
codec_t * |
codec | ) |
|
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.