X-Git-Url: http://g0dil.de/git?a=blobdiff_plain;f=Packets%2FMPEGDVBBundle%2FMPESection.hh;h=5b80e0502b20af8524bc7aa8e0f3b6c6c4f79dcd;hb=bd9f9d3fd6fbcff0112a7bf48ab9284da9576b11;hp=1e0bc2d396f704ebee1f3f9766a7bc1e9b403226;hpb=a1a6c76a214ad1935032826713cabaf9ac57bf07;p=senf.git diff --git a/Packets/MPEGDVBBundle/MPESection.hh b/Packets/MPEGDVBBundle/MPESection.hh index 1e0bc2d..5b80e05 100644 --- a/Packets/MPEGDVBBundle/MPESection.hh +++ b/Packets/MPEGDVBBundle/MPESection.hh @@ -23,8 +23,8 @@ /** \file \brief MPESection public header */ -#ifndef HH_MPESection_ -#define HH_MPESection_ 1 +#ifndef HH_SENF_Packets_MPEGDVBBundle_MPESection_ +#define HH_SENF_Packets_MPEGDVBBundle_MPESection_ 1 // Custom includes #include @@ -44,31 +44,32 @@ namespace senf { SENF_PARSER_BITFIELD ( table_boundary, 1, bool ); SENF_PARSER_BITFIELD ( frame_boundary, 1, bool ); SENF_PARSER_BITFIELD ( address, 18, unsigned ); - + SENF_PARSER_FINALIZE( MPERealTimeParametersParser ); }; - + /** \brief Parse a MPE Section - + Parser implementing the header of a MPE Section - + \see MPESectionType */ - struct MPESectionParser : public PacketParserBase + class MPESectionParser : public PacketParserBase { + public: # include SENF_FIXED_PARSER() SENF_PARSER_FIELD( table_id, UInt8Parser ); - + SENF_PARSER_BITFIELD ( section_syntax_indicator, 1, bool ); SENF_PARSER_BITFIELD ( private_indicator, 1, bool ); SENF_PARSER_PRIVATE_BITFIELD( reserved_1, 2, unsigned ); SENF_PARSER_BITFIELD ( section_length, 12, unsigned ); - + SENF_PARSER_FIELD( mac_addr_6, UInt8Parser ); SENF_PARSER_FIELD( mac_addr_5, UInt8Parser ); - + SENF_PARSER_PRIVATE_BITFIELD( reserved_2, 2, unsigned ); SENF_PARSER_BITFIELD ( payload_scrmbl_ctrl, 2, unsigned ); SENF_PARSER_BITFIELD ( addr_scrmbl_ctrl, 2, unsigned ); @@ -79,11 +80,11 @@ namespace senf { SENF_PARSER_FIELD( last_section_num, UInt8Parser ); SENF_PARSER_FIELD( real_time_parameters, MPERealTimeParametersParser ); - + SENF_PARSER_FINALIZE( MPESectionParser ); - + SENF_PARSER_PRIVATE_BITFIELD( ip_datagram_version, 4, unsigned ); - + SENF_PARSER_INIT() { table_id() = 0x3e; section_syntax_indicator() = 1; @@ -94,23 +95,25 @@ namespace senf { addr_scrmbl_ctrl() = 0; curr_next_indicator() = 1; } - + UInt32Parser crc() const { return parse( data().size()-4 ); } - -// typedef boost::crc_optimal<32, 0x04C11DB7, 0xFFFFFFFF, 0, false, false> crc32_t; -// boost::uint32_t calcCrc() const; - + boost::uint32_t calcCrc() const; + friend class MPESectionType; + + private: + typedef boost::crc_optimal<32, 0x04C11DB7, 0xFFFFFFFF, 0, false, false> crc32_t; }; - - + + /** \brief MPE Section - + \par Packet type (typedef): \ref MPESection \par Fields: \ref MPESectionParser + \image html MPESection.png \ingroup protocolbundle_mpegdvb */ @@ -118,20 +121,27 @@ namespace senf { : public PacketTypeBase, public PacketTypeMixin { +#ifndef DOXYGEN typedef PacketTypeMixin mixin; - typedef ConcretePacket packet; - typedef MPESectionParser parser; +#endif + typedef ConcretePacket packet; ///< MPESection packet typedef + typedef MPESectionParser parser; ///< typedef to the parser of MPESection using mixin::nextPacketRange; using mixin::init; - + + /** \brief Dump given MPESection in readable form to given output stream */ static void dump(packet p, std::ostream & os); + static void finalize(packet p); + static factory_t nextPacketType(packet p); + static PacketParserBase::size_type initSize(); static PacketParserBase::size_type initHeadSize(); }; - + + /** \brief MPESection packet typedef */ typedef ConcretePacket MPESection; } @@ -142,7 +152,7 @@ namespace senf { //#include "MPESection.cti" #endif - + // Local Variables: // mode: c++ // fill-column: 100