audiocustom.h 925 B

123456789101112131415161718192021222324252627282930313233343536373839
  1. #ifndef __AUDIOCUSTOM_H__
  2. #define __AUDIOCUSTOM_H__
  3. #pragma once
  4. #ifdef __cplusplus
  5. extern "C" {
  6. #endif
  7. #include "audiostream.h"
  8. // used to hook stream pipeline
  9. typedef struct audiocustom_t audiocustom_t;
  10. typedef apr_status_t (*audiocustom_on_read_frame)(void *cust, audioframe_t *frm, void *user_data);
  11. typedef apr_status_t (*audiocustom_on_write_frame)(void *cust, const audioframe_t *frm, void *user_data);
  12. struct audiocustom_t
  13. {
  14. audiostream_t base;
  15. audiocustom_on_read_frame on_read;
  16. audiocustom_on_write_frame on_write;
  17. void *user_data;
  18. };
  19. apr_status_t audiocustom_create(apr_pool_t *pool,
  20. audioengine_t *engine,
  21. audiocustom_on_read_frame on_read,
  22. audiocustom_on_write_frame on_write,
  23. void *user_data,
  24. audiocustom_t **p_audiocust);
  25. apr_status_t audiocustom_destroy(audiocustom_t *audiocust);
  26. #ifdef __cplusplus
  27. } // extern "C" {
  28. #endif
  29. #endif //__AUDIOCUSTOM_H__