tdav_producer_audio.h 2.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263
  1. /*
  2. * Copyright (C) 2010-2011 Mamadou Diop.
  3. *
  4. * Contact: Mamadou Diop <diopmamadou(at)doubango.org>
  5. *
  6. * This file is part of Open Source Doubango Framework.
  7. *
  8. * DOUBANGO is free software: you can redistribute it and/or modify
  9. * it under the terms of the GNU General Public License as published by
  10. * the Free Software Foundation, either version 3 of the License, or
  11. * (at your option) any later version.
  12. *
  13. * DOUBANGO is distributed in the hope that it will be useful,
  14. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  15. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  16. * GNU General Public License for more details.
  17. *
  18. * You should have received a copy of the GNU General Public License
  19. * along with DOUBANGO.
  20. *
  21. */
  22. /**@file tdav_producer_audio.h
  23. * @brief Base class for all Audio producers.
  24. *
  25. * @author Mamadou Diop <diopmamadou(at)doubango.org>
  26. *
  27. */
  28. #ifndef TINYDAV_PRODUCER_AUDIO_H
  29. #define TINYDAV_PRODUCER_AUDIO_H
  30. #include "tinydav_config.h"
  31. #include "tinymedia/tmedia_producer.h"
  32. TDAV_BEGIN_DECLS
  33. #define TDAV_BITS_PER_SAMPLE_DEFAULT 16
  34. #define TDAV_PRODUCER_AUDIO(self) ((tdav_producer_audio_t*)(self))
  35. typedef struct tdav_producer_audio_s {
  36. TMEDIA_DECLARE_PRODUCER;
  37. }
  38. tdav_producer_audio_t;
  39. TINYDAV_API int tdav_producer_audio_init(tdav_producer_audio_t* self);
  40. TINYDAV_API int tdav_producer_audio_cmp(const tsk_object_t* producer1, const tsk_object_t* producer2);
  41. #define tdav_producer_audio_prepare(self, codec) tmedia_producer_prepare(TMEDIA_PRODUCER(self), codec)
  42. #define tmedia_producer_audio_set_callback(self, callback, callback_data) tmedia_producer_set_callback(TMEDIA_PRODUCER(self), callback, callback_data)
  43. #define tdav_producer_audio_start(self) tdav_producer_start(TMEDIA_PRODUCER(self))
  44. #define tdav_producer_audio_pause(self) tdav_producer_pause(TMEDIA_PRODUCER(self))
  45. #define tdav_producer_audio_stop(self) tdav_producer_stop(TMEDIA_PRODUCER(self))
  46. TINYDAV_API int tdav_producer_audio_set(tdav_producer_audio_t* self, const tmedia_param_t* param);
  47. TINYDAV_API int tdav_producer_audio_deinit(tdav_producer_audio_t* self);
  48. #define TDAV_DECLARE_PRODUCER_AUDIO tdav_producer_audio_t __producer_audio__
  49. TDAV_END_DECLS
  50. #endif /* TINYDAV_PRODUCER_AUDIO_H */