jack-wrapper.h 1.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051
  1. /*
  2. Copyright (C) 2015 by Bernd Buschinski <[email protected]>
  3. This program is free software: you can redistribute it and/or modify
  4. it under the terms of the GNU General Public License as published by
  5. the Free Software Foundation, either version 2 of the License, or
  6. (at your option) 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 General Public License for more details.
  11. You should have received a copy of the GNU General Public License
  12. along with this program. If not, see <http://www.gnu.org/licenses/>.
  13. */
  14. #pragma once
  15. #include <jack/jack.h>
  16. #include <obs.h>
  17. #include <util/threading.h>
  18. struct jack_data {
  19. obs_source_t *source;
  20. /* user settings */
  21. char *device;
  22. uint_fast8_t channels;
  23. bool start_jack_server;
  24. /* server info */
  25. enum speaker_layout speakers;
  26. uint_fast32_t samples_per_sec;
  27. uint_fast32_t bytes_per_frame;
  28. jack_client_t *jack_client;
  29. jack_port_t **jack_ports;
  30. pthread_mutex_t jack_mutex;
  31. };
  32. /**
  33. * Initialize the jack client and register the ports
  34. */
  35. int_fast32_t jack_init(struct jack_data *data);
  36. /**
  37. * Destroys the jack client and unregisters the ports
  38. */
  39. void deactivate_jack(struct jack_data *data);