X-Git-Url: http://g0dil.de/git?a=blobdiff_plain;f=Examples%2FDVBAdapter%2FULEdec.hh;h=c6dc7384565ff14b185b857047642bd8a5e7ab72;hb=ae06fe86f16fdabb7ffb219d255444d2eb4f4f79;hp=bfd177f9f8e9d8ed80c6fcf15bbbc16226db3cd8;hpb=9027d68d973f1d8ad8f25d6827166ba2ee9be7a7;p=senf.git diff --git a/Examples/DVBAdapter/ULEdec.hh b/Examples/DVBAdapter/ULEdec.hh index bfd177f..c6dc738 100644 --- a/Examples/DVBAdapter/ULEdec.hh +++ b/Examples/DVBAdapter/ULEdec.hh @@ -1,9 +1,9 @@ // $Id: ULEdec.cc 355 2007-07-26 14:17:02Z tho $ // -// Copyright (C) 2006 +// Copyright (C) 2007 // Fraunhofer Institut fuer offene Kommunikationssysteme (FOKUS) // Kompetenzzentrum fuer Satelitenkommunikation (SatCom) -// Stefan Bund +// Thorsten Horstmann // // This program is free software; you can redistribute it and/or modify // it under the terms of the GNU General Public License as published by @@ -22,47 +22,59 @@ // Definition of non-inline non-template functions -#include -#include -#include -#include -#include -#include - -#include "Scheduler/Scheduler.hh" -#include "Packets/DefaultBundle/EthernetPacket.hh" -#include "Packets/MPEGDVBBundle/TransportPacket.hh" -#include "Packets/MPEGDVBBundle/SNDUPacket.hh" -#include "Utils/membind.hh" -#include "Socket/Protocols/DVB/DVBDemuxHandles.hh" -#include "Packets/ParseInt.hh" -#include "Packets/Packet.hh" -#include "Packets/PacketData.hh" -#include "Packets/ParseInt.hh" +#include +#include +#include +#include class ULEdec { public: - ULEdec(); + ULEdec(unsigned short adapter=0, unsigned short device=0); private: + typedef senf::PacketData::iterator iterator; + + enum ReceiverState { + Idle, + Reassembly + }; + senf::DVBDemuxPESHandle demuxHandle; senf::DVBDvrHandle dvrHandle; + senf::SNDUPacket snduPacket; - unsigned char receiver_state; + + ReceiverState receiver_state; unsigned char priv_tscc; + bool priv_sndu_type_1; + iterator snduPacketData_iter; - static const unsigned BLOCK_SIZE = 16; + void handleEvent(senf::FileHandle, senf::Scheduler::EventId event); + void handleTSPacket(senf::TransportPacket tsPacket); + void handleSNDUPacket(); - template - void hexdump(Iterator i, Iterator const & i_end, std::ostream& stream); + iterator readNewSNDUPacket(iterator i, const iterator i_end); + iterator readContSNDUPacket(iterator i, const iterator i_end); + iterator readRawSNDUPacketData(iterator i, iterator const i_end); - void handleEvent(senf::FileHandle, senf::Scheduler::EventId event); + inline bool isSDNUPacketComplete(); + inline iterator::difference_type snduPacketBytesLeft(); - void handleTSPacket(senf::TransportPacket tsPacket); }; + +struct ULEdecException : public std::exception +{ + ULEdecException(char const * what) : what_(what) {}; + ULEdecException(std::string const what) : what_(what) {}; + virtual char const * what() const throw() { return what_.c_str(); } + virtual ~ULEdecException() throw() {}; + std::string what_; +}; + + // Local Variables: // mode: c++