00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020 #ifndef __JackNetDriver__
00021 #define __JackNetDriver__
00022
00023 #include "JackTimedDriver.h"
00024 #include "netjack.h"
00025 #include "netjack_packet.h"
00026
00027 namespace Jack
00028 {
00033 class JackNetOneDriver : public JackWaiterDriver
00034 {
00035 private:
00036
00037 netjack_driver_state_t netj;
00038
00039 void
00040 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);
00041 void
00042 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 );
00043 #if HAVE_CELT
00044 void
00045 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);
00046 void
00047 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);
00048 #endif
00049 void
00050 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);
00051 void
00052 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);
00053
00054 public:
00055
00056 JackNetOneDriver(const char* name, const char* alias, JackLockedEngine* engine, JackSynchro* table,
00057 int port, int mtu, int capture_ports, int playback_ports, int midi_input_ports, int midi_output_ports,
00058 int sample_rate, int period_size, int resample_factor,
00059 const char* net_name, uint transport_sync, int bitdepth, int use_autoconfig,
00060 int latency, int redundancy, int dont_htonl_floats, int always_deadline, int jitter_val);
00061 virtual ~JackNetOneDriver();
00062
00063 int Close();
00064 int Attach();
00065 int Detach();
00066
00067 int Read();
00068 int Write();
00069
00070 bool Initialize();
00071 int AllocPorts();
00072 void FreePorts();
00073
00074
00075 bool IsFixedBufferSize()
00076 {
00077 return true;
00078 }
00079
00080 int SetBufferSize(jack_nframes_t buffer_size)
00081 {
00082 return -1;
00083 }
00084
00085 int SetSampleRate(jack_nframes_t sample_rate)
00086 {
00087 return -1;
00088 }
00089
00090 };
00091
00092 }
00093
00094 #endif