Jack2  1.9.9
JackNetOneDriver.h
1 /*
2 Copyright (C) 2008-2011 Torben Horn
3 
4 This program is free software; you can redistribute it and/or modify
5 it under the terms of the GNU General Public License as published by
6 the Free Software Foundation; either version 2 of the License, or
7 (at your option) any later version.
8 
9 This program is distributed in the hope that it will be useful,
10 but WITHOUT ANY WARRANTY; without even the implied warranty of
11 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 GNU General Public License for more details.
13 
14 You should have received a copy of the GNU General Public License
15 along with this program; if not, write to the Free Software
16 Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
17 
18 */
19 
20 #ifndef __JackNetDriver__
21 #define __JackNetDriver__
22 
23 #include "JackTimedDriver.h"
24 #include "netjack.h"
25 #include "netjack_packet.h"
26 
27 namespace Jack
28 {
34 {
35  private:
36 
38 
39  void
40  render_payload_to_jack_ports_float(void *packet_payload, jack_nframes_t net_period_down, JSList *capture_ports, JSList *capture_srcs, jack_nframes_t nframes, int dont_htonl_floats);
41  void
42  render_jack_ports_to_payload_float(JSList *playback_ports, JSList *playback_srcs, jack_nframes_t nframes, void *packet_payload, jack_nframes_t net_period_up, int dont_htonl_floats );
43 #if HAVE_CELT
44  void
45  render_payload_to_jack_ports_celt(void *packet_payload, jack_nframes_t net_period_down, JSList *capture_ports, JSList *capture_srcs, jack_nframes_t nframes);
46  void
47  render_jack_ports_to_payload_celt(JSList *playback_ports, JSList *playback_srcs, jack_nframes_t nframes, void *packet_payload, jack_nframes_t net_period_up);
48 #endif
49 #if HAVE_OPUS
50  void
51  render_payload_to_jack_ports_opus(void *packet_payload, jack_nframes_t net_period_down, JSList *capture_ports, JSList *capture_srcs, jack_nframes_t nframes);
52  void
53  render_jack_ports_to_payload_opus(JSList *playback_ports, JSList *playback_srcs, jack_nframes_t nframes, void *packet_payload, jack_nframes_t net_period_up);
54 #endif
55  void
56  render_payload_to_jack_ports(int bitdepth, void *packet_payload, jack_nframes_t net_period_down, JSList *capture_ports, JSList *capture_srcs, jack_nframes_t nframes, int dont_htonl_floats);
57  void
58  render_jack_ports_to_payload(int bitdepth, JSList *playback_ports, JSList *playback_srcs, jack_nframes_t nframes, void *packet_payload, jack_nframes_t net_period_up, int dont_htonl_floats);
59 
60  public:
61 
62  JackNetOneDriver(const char* name, const char* alias, JackLockedEngine* engine, JackSynchro* table,
63  int port, int mtu, int capture_ports, int playback_ports, int midi_input_ports, int midi_output_ports,
64  int sample_rate, int period_size, int resample_factor,
65  const char* net_name, uint transport_sync, int bitdepth, int use_autoconfig,
66  int latency, int redundancy, int dont_htonl_floats, int always_deadline, int jitter_val);
67  virtual ~JackNetOneDriver();
68 
69  int Close();
70  int Attach();
71  int Detach();
72 
73  int Read();
74  int Write();
75 
76  bool Initialize();
77  int AllocPorts();
78  void FreePorts();
79 
80  // BufferSize can't be changed
81  bool IsFixedBufferSize()
82  {
83  return true;
84  }
85 
86  int SetBufferSize(jack_nframes_t buffer_size)
87  {
88  return -1;
89  }
90 
91  int SetSampleRate(jack_nframes_t sample_rate)
92  {
93  return -1;
94  }
95 
96 };
97 
98 }
99 
100 #endif
Inter process synchronization using using Mach semaphore.
Locked Engine, access to methods is serialized using a mutex.