X-Git-Url: http://g0dil.de/git?a=blobdiff_plain;f=Packets%2FMPEGDVBBundle%2FTransportPacket.hh;h=2bf00b37ec08dad3438c13f68bcb237c20ced56e;hb=c05c8072901783422ac21cd9cc2438cd610b46f1;hp=83406f5fdd2d0afafb43e3b8a6bd1a9fef26ac46;hpb=bbff2057f39e475b00e598cae018c68db0e16a82;p=senf.git diff --git a/Packets/MPEGDVBBundle/TransportPacket.hh b/Packets/MPEGDVBBundle/TransportPacket.hh index 83406f5..2bf00b3 100644 --- a/Packets/MPEGDVBBundle/TransportPacket.hh +++ b/Packets/MPEGDVBBundle/TransportPacket.hh @@ -1,9 +1,9 @@ -// $Id$ +// $Id:TransportPacket.hh 560 2007-12-13 14:39:37Z tho $ // // Copyright (C) 2007 -// Fraunhofer Institut fuer offene Kommunikationssysteme (FOKUS) -// Kompetenzzentrum fuer Satelitenkommunikation (SatCom) -// Thorsten Horstmann +// Fraunhofer Institute for Open Communication Systems (FOKUS) +// Competence Center NETwork research (NET), St. Augustin, GERMANY +// 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 @@ -41,24 +41,30 @@ namespace senf { \see TransportPacketType */ - struct Parse_TransportPacket : public PacketParserBase + struct TransportPacketParser : public PacketParserBase { # include SENF_FIXED_PARSER() - SENF_PARSER_FIELD ( sync_byte , Parse_UInt8 ); - - SENF_PARSER_BITFIELD ( transport_error_indicator , 1 , bool ); - SENF_PARSER_BITFIELD ( pusi , 1 , bool ); - SENF_PARSER_BITFIELD ( transport_priority , 1 , bool ); - SENF_PARSER_BITFIELD ( pid , 13 , unsigned ); - SENF_PARSER_BITFIELD ( transport_scrmbl_ctrl , 2 , unsigned ); - SENF_PARSER_BITFIELD ( adaptation_field_ctrl , 2 , unsigned ); - SENF_PARSER_BITFIELD ( continuity_counter , 4 , unsigned ); + SENF_PARSER_FIELD ( sync_byte, UInt8Parser ); + + SENF_PARSER_BITFIELD ( transport_error_indicator, 1, bool ); + SENF_PARSER_BITFIELD ( pusi, 1, bool ); + SENF_PARSER_BITFIELD ( transport_priority, 1, bool ); + SENF_PARSER_BITFIELD ( pid, 13, unsigned ); + SENF_PARSER_BITFIELD ( transport_scrmbl_ctrl, 2, unsigned ); + SENF_PARSER_BITFIELD ( adaptation_field_ctrl, 2, unsigned ); + SENF_PARSER_BITFIELD ( continuity_counter, 4, unsigned ); - SENF_PARSER_FINALIZE( Parse_TransportPacket ); + SENF_PARSER_FINALIZE( TransportPacketParser ); + + void init_fields() const; + SENF_PARSER_INIT() { + defaultInit(); + init_fields(); + } -// Parse_UInt8 payload_pointer() const { -// return parse( Parse_TransportPacket::fixed_bytes ); +// UInt8Parser payload_pointer() const { +// return parse( TransportPacketParser::fixed_bytes ); // } }; @@ -71,28 +77,28 @@ namespace senf { transport_packet() { - \ref Parse_TransportPacket::sync_byte() "sync_byte" + \ref TransportPacketParser::sync_byte() "sync_byte" 8 - \ref Parse_TransportPacket::transport_error_indicator() "transport_error_indicator" + \ref TransportPacketParser::transport_error_indicator() "transport_error_indicator" 1 - \ref Parse_TransportPacket::pusi() "payload_uni_start_indicator" + \ref TransportPacketParser::pusi() "payload_uni_start_indicator" 1 - \ref Parse_TransportPacket::transport_priority() "transport_priority" + \ref TransportPacketParser::transport_priority() "transport_priority" 1 - \ref Parse_TransportPacket::pid() "PID" + \ref TransportPacketParser::pid() "PID" 13 - \ref Parse_TransportPacket::transport_scrmbl_ctrl() "transport_scrambling_control" + \ref TransportPacketParser::transport_scrmbl_ctrl() "transport_scrambling_control" 2 - \ref Parse_TransportPacket::adaptation_field_ctrl() "adaptation_field_control" + \ref TransportPacketParser::adaptation_field_ctrl() "adaptation_field_control" 2 - \ref Parse_TransportPacket::continuity_counter() "continuity_counter" + \ref TransportPacketParser::continuity_counter() "continuity_counter" 4 } @@ -102,7 +108,7 @@ namespace senf { \ref TransportPacket \par Fields: - \ref Parse_TransportPacket + \ref TransportPacketParser \ingroup protocolbundle_mpegdvb */ @@ -112,20 +118,18 @@ namespace senf { { typedef PacketTypeMixin mixin; typedef ConcretePacket packet; - typedef Parse_TransportPacket parser; + typedef TransportPacketParser parser; using mixin::nextPacketRange; using mixin::init; using mixin::initSize; static void dump(packet p, std::ostream & os); + static const byte SYNC_BYTE = 0x47; }; /** \brief Transport packet typedef */ - typedef TransportPacketType::packet TransportPacket; - - #define TRANSPORT_PACKET_SYNC_BYTE 0x47 - + typedef ConcretePacket TransportPacket; }