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.
24 \brief DVBDemuxHandles non-inline non-template implementation */
26 #include "DVBDemuxHandles.hh"
27 //#include "DVBDemuxHandles.ih"
30 #include <sys/types.h>
31 #include <sys/socket.h>
34 #include <sys/ioctl.h>
35 #include <linux/sockios.h>
39 #include "Utils/Exception.hh"
41 //#include "DVBDemuxHandles.mpp"
43 ///////////////////////////////cc.p////////////////////////////////////////
45 ///////////////////////////////////////////////////////////////////////////
46 // senf::DVBDemuxHandles
48 prefix_ void senf::DVBDemuxSectionProtocol::init_client()
51 int fd = open("/dev/dvb/adapter0/demux0", O_RDONLY | O_NONBLOCK);
53 throw SystemException(errno);
57 prefix_ unsigned senf::DVBDemuxSectionProtocol::available()
63 prefix_ std::auto_ptr<senf::SocketProtocol> senf::DVBDemuxSectionProtocol::clone()
66 return std::auto_ptr<SocketProtocol>(new DVBDemuxSectionProtocol());
69 prefix_ void senf::DVBDemuxSectionProtocol::setSectionFilter(struct dmx_sct_filter_params *filter)
72 if (::ioctl(body().fd(), DMX_SET_FILTER, filter) < 0)
73 throw SystemException(errno);
76 // ----------------------------------------------------------------
78 prefix_ void senf::DVBDemuxPESProtocol::init_client()
81 int fd = open("/dev/dvb/adapter0/demux0", O_RDONLY | O_NONBLOCK);
83 throw SystemException(errno);
87 prefix_ unsigned senf::DVBDemuxPESProtocol::available()
93 prefix_ std::auto_ptr<senf::SocketProtocol> senf::DVBDemuxPESProtocol::clone()
96 return std::auto_ptr<SocketProtocol>(new DVBDemuxPESProtocol());
99 prefix_ void senf::DVBDemuxPESProtocol::setPESFilter(struct dmx_pes_filter_params *filter)
102 if (::ioctl(body().fd(), DMX_SET_PES_FILTER, filter) < 0)
103 throw SystemException(errno);
106 // ----------------------------------------------------------------
108 prefix_ void senf::DVBDvrProtocol::init_client()
111 int fd = open("/dev/dvb/adapter0/dvr0", O_RDONLY | O_NONBLOCK);
113 throw SystemException(errno);
117 prefix_ unsigned senf::DVBDvrProtocol::available()
123 prefix_ std::auto_ptr<senf::SocketProtocol> senf::DVBDvrProtocol::clone()
126 return std::auto_ptr<SocketProtocol>(new DVBDvrProtocol());
129 ///////////////////////////////cc.e////////////////////////////////////////
131 //#include "DVBDemuxHandles.mpp"
137 // c-file-style: "senf"
138 // indent-tabs-mode: nil
139 // ispell-local-dictionary: "american"
140 // compile-command: "scons -u test"
141 // comment-column: 40