#ifndef __streamplayer_udpplayer_h__
#define __streamplayer_udpplayer_h__

#include "player.h"

//
// cDataStreamSocketUDP
//

class cDataStreamSocketUDP : public cDataStreamSource {
public:
	cDataStreamSocketUDP(uint16_t port) { Port=port; sock=0; }
	virtual ~cDataStreamSocketUDP() { Close(); }
	virtual uchar* Get(int &Count);
	virtual void Del(int Count);
	virtual void Reset();
	virtual int GetPollHandle();
	
protected:
	uint16_t Port;

	int sock;
	sockaddr_in sServ;
	uchar SrcBuffer[20480];
	uchar *pSrcBuffer;
	int nSrcBuffer;

	bool Open();
	void Close();
};

//
// cStreamPlayerUDP
//

class cStreamPlayerUDP : public cStreamPlayer {
protected:
  uint16_t port;
  char StatusString[80];

public:
  cStreamPlayerUDP(char *url);
  virtual ~cStreamPlayerUDP();
  virtual cDataStreamSource* NewSource();
  virtual void DeleteSource(cDataStreamSource *src);
  virtual char* GetStatus();
};



#endif
