1 // $Id: DVBSectionHandle.cc 321 2007-07-19 09:00:23Z tho $
4 // Fraunhofer Institut fuer offene Kommunikationssysteme (FOKUS)
5 // Kompetenzzentrum fuer Satelitenkommunikation (SatCom)
6 // Stefan Bund <stefan.bund@fokus.fraunhofer.de>
8 // This program is free software; you can redistribute it and/or modify
9 // it under the terms of the GNU General Public License as published by
10 // the Free Software Foundation; either version 2 of the License, or
11 // (at your option) any later version.
13 // This program is distributed in the hope that it will be useful,
14 // but WITHOUT ANY WARRANTY; without even the implied warranty of
15 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16 // GNU General Public License for more details.
18 // You should have received a copy of the GNU General Public License
19 // along with this program; if not, write to the
20 // Free Software Foundation, Inc.,
21 // 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
27 #include "DVBDemuxHandles.hh"
28 //#include "DVBDemuxHandles.ih"
31 #include <sys/types.h>
32 #include <sys/socket.h>
35 #include <sys/ioctl.h>
36 #include <linux/sockios.h>
40 #include "Utils/Exception.hh"
42 //#include "DVBDemuxHandles.mpp"
44 ///////////////////////////////cc.p////////////////////////////////////////
46 ///////////////////////////////////////////////////////////////////////////
47 // senf::DVBDemuxHandles
49 prefix_ void senf::DVBDemuxSectionProtocol::init_client()
52 int fd = open("/dev/dvb/adapter0/demux0", O_RDONLY | O_NONBLOCK);
54 throw SystemException(errno);
58 prefix_ unsigned senf::DVBDemuxSectionProtocol::available()
64 prefix_ std::auto_ptr<senf::SocketProtocol> senf::DVBDemuxSectionProtocol::clone()
67 return std::auto_ptr<SocketProtocol>(new DVBDemuxSectionProtocol());
70 prefix_ void senf::DVBDemuxSectionProtocol::setSectionFilter(struct dmx_sct_filter_params *filter)
73 if (::ioctl(body().fd(), DMX_SET_FILTER, filter) < 0)
74 throw SystemException(errno);
77 // ----------------------------------------------------------------
79 prefix_ void senf::DVBDemuxPESProtocol::init_client()
82 int fd = open("/dev/dvb/adapter0/demux0", O_RDONLY | O_NONBLOCK);
84 throw SystemException(errno);
88 prefix_ unsigned senf::DVBDemuxPESProtocol::available()
94 prefix_ std::auto_ptr<senf::SocketProtocol> senf::DVBDemuxPESProtocol::clone()
97 return std::auto_ptr<SocketProtocol>(new DVBDemuxPESProtocol());
100 prefix_ void senf::DVBDemuxPESProtocol::setPESFilter(struct dmx_pes_filter_params *filter)
103 if (::ioctl(body().fd(), DMX_SET_PES_FILTER, filter) < 0)
104 throw SystemException(errno);
107 // ----------------------------------------------------------------
109 prefix_ void senf::DVBDvrProtocol::init_client()
112 int fd = open("/dev/dvb/adapter0/dvr0", O_RDONLY | O_NONBLOCK);
114 throw SystemException(errno);
118 prefix_ unsigned senf::DVBDvrProtocol::available()
124 prefix_ std::auto_ptr<senf::SocketProtocol> senf::DVBDvrProtocol::clone()
127 return std::auto_ptr<SocketProtocol>(new DVBDvrProtocol());
130 ///////////////////////////////cc.e////////////////////////////////////////
132 //#include "DVBDemuxHandles.mpp"
138 // c-file-style: "senf"
139 // indent-tabs-mode: nil
140 // ispell-local-dictionary: "american"
141 // compile-command: "scons -u test"
142 // comment-column: 40