udp_input.h 1.15 KB
Newer Older
jcaceres's avatar
jcaceres committed
1
2
3
4
5
6
7
#ifndef 	_UDP_INPUT_H
#define 	_UDP_INPUT_H

#include "input_plugin.h"
#include "udp.h"
#include "networkInfo.h"
#include "audioInfo.h"
8
9
//#include <q3socketdevice.h> //***JPC Port to qt4*****************
#include <QUdpSocket> //***JPC Port to qt4*****************
jcaceres's avatar
jcaceres committed
10
11
12
13
14
15
16
17
18
#include <qobject.h>

/**
 * @brief Sends buffers received from a UDP input stream into
 * a Stream.
 */

class UDPInput:public InputPlugin
{
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
private:
  
  NetworkInfoT netInfo;
  AudioInfoT audInfo;
  
  //Q3SocketDevice *sock;//***JPC Port to qt4*****************
  QUdpSocket *sock;//***JPC Port to qt4*****************
  
  bool _running;
  bool has_peer;
  
  int packetIndex;	//used for netdebug, checking order of incoming packets
  int maxPacketIndex;
  char *packetData;
  
  void setPacketSize (int size);

  QHostAddress *peerAddress;//***JPC Port to qt4*****************

public:
  UDPInput (NetworkInfoT netInfo, AudioInfoT audInfo);
  virtual ~UDPInput();
  int rcvz1 (char *bufz1, int z);
  int rcv (char *buf);
  bool hasPeer ();
  QHostAddress peer ();
  void Initial ();
  void run ();
  void stop ();
  int bpp;
  int wholeSize;
  int numRedundantBuffers;
  void plotVal (double v);
};
jcaceres's avatar
jcaceres committed
53
54
55


#endif