jack2 codebase
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.

66 lines
2.0KB

  1. /*
  2. Copyright (C) 2016-2019 Christoph Kuhr
  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, write to the Free Software
  13. Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
  14. */
  15. #ifndef _JACK_AVB_DRIVER_H_
  16. #define _JACK_AVB_DRIVER_H_
  17. #include "JackTimedDriver.h"
  18. #include "avb.h"
  19. namespace Jack
  20. {
  21. // Brief This class describes the AVB Backend
  22. class JackAVBDriver : public JackWaiterDriver
  23. {
  24. private:
  25. avb_driver_state_t avb_ctx;
  26. int num_packets_even_odd;
  27. uint64_t lastPeriodDuration;
  28. uint64_t timeCompensation;
  29. uint64_t monotonicTime;
  30. int preRunCnt;
  31. public:
  32. JackAVBDriver(const char* name, const char* alias, JackLockedEngine* engine, JackSynchro* table,
  33. char* stream_id, char* destination_mac, char* eth_dev,
  34. int sample_rate, int period_size, int num_periods,
  35. int adjust, int capture_ports, int playback_ports);
  36. virtual ~JackAVBDriver();
  37. int Close();
  38. int Attach(){return 0;}
  39. int Detach(){return 0;}
  40. int Read();
  41. int Write();
  42. bool Initialize();
  43. int AllocPorts();
  44. void FreePorts();
  45. // BufferSize can't be changed
  46. bool IsFixedBufferSize(){return true;}
  47. int SetBufferSize(jack_nframes_t buffer_size){return -1;}
  48. int SetSampleRate(jack_nframes_t sample_rate){return -1;}
  49. };
  50. }
  51. #endif //_JACK_AVB_DRIVER_H_