Audio plugin host https://kx.studio/carla
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

ad_plugin.h 1.9KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364
  1. /**
  2. Copyright (C) 2011-2013 Robin Gareus <robin@gareus.org>
  3. This program is free software; you can redistribute it and/or modify
  4. it under the terms of the GNU Lesser Public License as published by
  5. the Free Software Foundation; either version 2.1, or (at your option)
  6. any later version.
  7. This program is distributed in the hope that it will be useful,
  8. but WITHOUT ANY WARRANTY; without even the implied warranty of
  9. MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  10. GNU Lesser Public License for more details.
  11. You should have received a copy of the GNU Lesser General Public
  12. License along with this library; if not, write to the Free Software
  13. Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
  14. */
  15. #ifndef __AD_PLUGIN_H__
  16. #define __AD_PLUGIN_H__
  17. #include <stdint.h>
  18. #include "audio_decoder/ad.h"
  19. #define dbg(A, B, ...) ad_debug_printf(__func__, A, B, ##__VA_ARGS__)
  20. #ifndef __PRI64_PREFIX
  21. #if (defined __X86_64__ || defined __LP64__)
  22. # define __PRI64_PREFIX "l"
  23. #else
  24. # define __PRI64_PREFIX "ll"
  25. #endif
  26. #endif
  27. #ifndef PRIu64
  28. # define PRIu64 __PRI64_PREFIX "u"
  29. #endif
  30. #ifndef PRIi64
  31. # define PRIi64 __PRI64_PREFIX "i"
  32. #endif
  33. extern int ad_debug_level;
  34. void ad_debug_printf(const char* func, int level, const char* format, ...);
  35. typedef struct {
  36. int (*eval)(const char *);
  37. void * (*open)(const char *, struct adinfo *);
  38. int (*close)(void *);
  39. int (*info)(void *, struct adinfo *);
  40. int64_t (*seek)(void *, int64_t);
  41. ssize_t (*read)(void *, float *, size_t);
  42. } ad_plugin;
  43. int ad_eval_null(const char *);
  44. void * ad_open_null(const char *, struct adinfo *);
  45. int ad_close_null(void *);
  46. int ad_info_null(void *, struct adinfo *);
  47. int64_t ad_seek_null(void *, int64_t);
  48. ssize_t ad_read_null(void *, float*, size_t);
  49. /* hardcoded backends */
  50. const ad_plugin * adp_get_sndfile();
  51. const ad_plugin * adp_get_ffmpeg();
  52. #endif