1 // $Id: ULEdec.cc 355 2007-07-26 14:17:02Z tho $
4 // Fraunhofer Institut fuer offene Kommunikationssysteme (FOKUS)
5 // Kompetenzzentrum fuer Satelitenkommunikation (SatCom)
6 // Thorsten Horstmann <thorsten.horstmann@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.
23 // Definition of non-inline non-template functions
25 #include <senf/Scheduler/Scheduler.hh>
26 #include <senf/Packets/MPEGDVBBundle/TransportPacket.hh>
27 #include <senf/Packets/MPEGDVBBundle/SNDUPacket.hh>
28 #include <senf/Socket/Protocols/DVB.hh>
34 ULEdec(unsigned short adapter=0, unsigned short device=0);
37 typedef senf::PacketData::iterator iterator;
44 senf::DVBDemuxPESHandle demuxHandle;
45 senf::DVBDvrHandle dvrHandle;
47 senf::SNDUPacket snduPacket;
49 ReceiverState receiver_state;
50 unsigned char priv_tscc;
51 bool priv_sndu_type_1;
52 iterator snduPacketData_iter;
54 void handleEvent(senf::Scheduler::EventId event);
55 void handleTSPacket(senf::TransportPacket tsPacket);
56 void handleSNDUPacket();
58 iterator readNewSNDUPacket(iterator i, const iterator i_end);
59 iterator readContSNDUPacket(iterator i, const iterator i_end);
60 iterator readRawSNDUPacketData(iterator i, iterator const i_end);
62 inline bool isSDNUPacketComplete();
63 inline iterator::difference_type snduPacketBytesLeft();
68 struct ULEdecException : public std::exception
70 ULEdecException(char const * what) : what_(what) {};
71 ULEdecException(std::string const what) : what_(what) {};
72 virtual char const * what() const throw() { return what_.c_str(); }
73 virtual ~ULEdecException() throw() {};
82 // c-file-style: "senf"
83 // indent-tabs-mode: nil
84 // ispell-local-dictionary: "american"
85 // compile-command: "scons -u"