2007-09-12 19:28:59 +02:00
|
|
|
/*
|
|
|
|
* streamer.h: IPTV plugin for the Video Disk Recorder
|
|
|
|
*
|
|
|
|
* See the README file for copyright information and how to reach the author.
|
|
|
|
*
|
2007-09-13 18:58:22 +02:00
|
|
|
* $Id: streamer.h,v 1.5 2007/09/13 16:58:22 rahrenbe Exp $
|
2007-09-12 19:28:59 +02:00
|
|
|
*/
|
|
|
|
|
|
|
|
#ifndef __IPTV_STREAMER_H
|
|
|
|
#define __IPTV_STREAMER_H
|
|
|
|
|
|
|
|
#include <arpa/inet.h>
|
|
|
|
|
|
|
|
#include <vdr/thread.h>
|
|
|
|
#include <vdr/ringbuffer.h>
|
|
|
|
|
|
|
|
class cIptvStreamer : public cThread {
|
|
|
|
private:
|
2007-09-13 18:58:22 +02:00
|
|
|
char* streamAddr;
|
|
|
|
int streamPort;
|
2007-09-12 19:28:59 +02:00
|
|
|
int socketDesc;
|
2007-09-13 18:58:22 +02:00
|
|
|
struct sockaddr_in sockAddr;
|
2007-09-12 19:28:59 +02:00
|
|
|
cRingBufferLinear* pRingBuffer;
|
|
|
|
unsigned char* pReceiveBuffer;
|
|
|
|
unsigned int bufferSize;
|
|
|
|
cMutex* mutex;
|
|
|
|
bool mcastActive;
|
|
|
|
|
2007-09-13 18:58:22 +02:00
|
|
|
private:
|
|
|
|
bool OpenSocket(const int port);
|
|
|
|
void CloseSocket(void);
|
|
|
|
bool JoinMulticast(void);
|
|
|
|
bool DropMulticast(void);
|
2007-09-12 20:33:56 +02:00
|
|
|
|
2007-09-12 19:28:59 +02:00
|
|
|
public:
|
|
|
|
cIptvStreamer();
|
2007-09-12 23:55:57 +02:00
|
|
|
cIptvStreamer(cRingBufferLinear* Buffer, cMutex* Mutex);
|
2007-09-12 19:28:59 +02:00
|
|
|
virtual ~cIptvStreamer();
|
2007-09-13 18:58:22 +02:00
|
|
|
virtual void Action(void);
|
2007-09-12 23:14:51 +02:00
|
|
|
bool SetStream(const char* address, const int port, const char* protocol);
|
2007-09-13 18:58:22 +02:00
|
|
|
bool OpenStream(void);
|
|
|
|
bool CloseStream(void);
|
2007-09-12 19:28:59 +02:00
|
|
|
};
|
|
|
|
|
|
|
|
#endif // __IPTV_STREAMER_H
|
|
|
|
|