vdr-plugin-streamdev/server/connectionIGMP.c
schmirl fa578940f7 - using SIGINT in externremux to kill mencoder works better than SIGTERM;
especially x264 still needs a SIGKILL sometimes
- added --remove-destination to cp commands installing plugins
- updated Italian translation (thanks to Diego Pierotto)
- config option "client may suspend" hidden if not applicable
- updated and enhanced README
- added support for HTTP method HEAD
- rewrite of externremux.sh, including support for various URL parameters,
  logging and improved shutdown
- start externremux script in a separate process group
- changed HTTP URL path for externremux from EXTERN to EXT (suggested by
  Rolf Ahrenberg)
- HTTP headers now have to be emitted by externremux script
- pass channel related information and URL parameters to externremux script
  through environment
- implement CGI like interface for externremux script
Modified Files:
 Tag: v0_4
	CONTRIBUTORS HISTORY Makefile README common.c common.h i18n.c
	remux/extern.c remux/extern.h server/connection.c
	server/connection.h server/connectionHTTP.c
	server/connectionHTTP.h server/connectionIGMP.c
	server/connectionVTP.c server/livestreamer.c
	server/livestreamer.h server/menuHTTP.c server/setup.c
	server/setup.h server/streamer.c server/streamer.h
	streamdev/externremux.sh streamdev/streamdevhosts.conf
2010-07-19 13:50:11 +00:00

65 lines
1.5 KiB
C

/*
* $Id: connectionIGMP.c,v 1.1.2.3 2010/07/19 13:50:14 schmirl Exp $
*/
#include <ctype.h>
#include "server/connectionIGMP.h"
#include "server/server.h"
#include "server/setup.h"
#include <vdr/channels.h>
cConnectionIGMP::cConnectionIGMP(const char* Name, int ClientPort, eStreamType StreamType) :
cServerConnection(Name, SOCK_DGRAM),
m_LiveStreamer(NULL),
m_ClientPort(ClientPort),
m_StreamType(StreamType)
{
}
cConnectionIGMP::~cConnectionIGMP()
{
delete m_LiveStreamer;
}
bool cConnectionIGMP::Start(cChannel *Channel, in_addr_t Dst)
{
if (Channel != NULL) {
cDevice *device = GetDevice(Channel, 0);
if (device != NULL) {
device->SwitchChannel(Channel, false);
struct in_addr ip;
ip.s_addr = Dst;
if (Connect(inet_ntoa(ip), m_ClientPort)) {
m_LiveStreamer = new cStreamdevLiveStreamer(0, this);
if (m_LiveStreamer->SetChannel(Channel, m_StreamType)) {
m_LiveStreamer->SetDevice(device);
if (!SetDSCP())
LOG_ERROR_STR("unable to set DSCP sockopt");
Dprintf("streamer start\n");
m_LiveStreamer->Start(this);
return true;
}
else
esyslog("streamdev-server IGMP: SetDevice failed");
DELETENULL(m_LiveStreamer);
}
else
esyslog("streamdev-server IGMP: Connect failed: %m");
}
else
esyslog("streamdev-server IGMP: GetDevice failed");
}
else
esyslog("streamdev-server IGMP: Channel not found");
return false;
}
void cConnectionIGMP::Stop()
{
if (m_LiveStreamer) {
m_LiveStreamer->Stop();
DELETENULL(m_LiveStreamer);
}
}