123456789101112131415161718192021222324252627282930313233343536373839 |
- #ifndef __AUDIOCACHE_H__
- #define __AUDIOCACHE_H__
- #pragma once
- #ifdef __cplusplus
- extern "C" {
- #endif
- #include <apr_tables.h>
- #include "audiostream.h"
- #include "audiodriver.h"
- typedef struct audiocache_t {
- audiostream_t stream_base;
- audiodriver_t driver_base;
- audioframe_t pending_read;
- audioframe_t pending_write;
- apr_array_header_t *arr_istream;
- apr_array_header_t *arr_ostream;
- }audiocache_t;
- apr_status_t audiocache_create(apr_pool_t *pool,
- audioengine_t *engine,
- int istream_cnt, // additional read frame stream
- int ostream_cnt, // additional write frame stream
- audiocache_t **p_cache);
- void audiocache_destroy(audiocache_t *cache);
- static audiodriver_t* audiocache_get_driver(audiocache_t *cache) { return &cache->driver_base; }
- static audiostream_t* audiocache_get_stream(audiocache_t *cache) { return &cache->stream_base; }
- audiostream_t* audiocache_get_istream(audiocache_t *cache, int idx);
- audiostream_t* audiocache_get_ostream(audiocache_t *cache, int idx);
- #ifdef __cplusplus
- } // extern "C" {
- #endif
- #endif //__AUDIOCACHE_H__
|