X-Git-Url: http://g0dil.de/git?a=blobdiff_plain;f=Packets%2FMPEGDVBBundle%2FDSMCCSection.hh;h=e6c2cef9ffd949bf11f585ad95fde912ccaf7b62;hb=ff0f2fabb3dbb76ee9383a98291a1420d2a59a7f;hp=1f47945d6633af7d6fbe07087a914b52d36ff5af;hpb=8d2d26f114d3df0a60c5c516fcf40671b1e55558;p=senf.git diff --git a/Packets/MPEGDVBBundle/DSMCCSection.hh b/Packets/MPEGDVBBundle/DSMCCSection.hh index 1f47945..e6c2cef 100644 --- a/Packets/MPEGDVBBundle/DSMCCSection.hh +++ b/Packets/MPEGDVBBundle/DSMCCSection.hh @@ -28,9 +28,7 @@ // Custom includes #include -#include "../../Packets/PacketType.hh" -#include "../../Packets/ParseInt.hh" -#include "../../Packets/PacketParser.hh" +#include "../../Packets/Packets.hh" //#include "DSMCCSection.mpp" ///////////////////////////////hh.p//////////////////////////////////////// @@ -45,49 +43,26 @@ namespace senf { */ struct Parse_DSMCCSection : public PacketParserBase { - typedef Parse_UInt8 Parse_table_id; - typedef Parse_Flag < 0 > Parse_ssi; // section_syntax_indicator - typedef Parse_Flag < 1 > Parse_pi; // private_indicator - typedef Parse_UIntField < 2, 4 > Parse_reserved_1; - typedef Parse_UIntField < 4, 16 > Parse_sec_length; - typedef Parse_UIntField < 0, 2 > Parse_reserved_2; - typedef Parse_UIntField < 2, 7 > Parse_version_num; - typedef Parse_Flag < 7 > Parse_curr_next_indicator; - -# ifndef DOXYGEN - - SENF_PACKET_PARSER_INIT(Parse_DSMCCSection); - - SENF_PACKET_PARSER_DEFINE_FIXED_FIELDS( - ((Field ) ( table_id, Parse_table_id )) - ((OverlayField) ( ssi, Parse_ssi )) - ((OverlayField) ( private_indicator, Parse_pi )) - ((OverlayField) ( reserved_1, Parse_reserved_1 )) - ((Field ) ( sec_length, Parse_sec_length )) - ((Field ) ( tabel_id_extension, Parse_UInt16 )) - ((OverlayField) ( reserved_2, Parse_reserved_2 )) - ((OverlayField) ( version_num, Parse_version_num )) - ((Field ) ( curr_next_indicator, Parse_curr_next_indicator )) - ((Field ) ( sec_num, Parse_UInt8 )) - ((Field ) ( last_sec_num, Parse_UInt8 )) - ); - -# else +# include SENF_FIXED_PARSER() + + SENF_PARSER_FIELD ( table_id , Parse_UInt8 ); - Parse_table_id table_id() const; - Parse_ssi ssi() const; - Parse_pi pi() const; - Parse_reserved_1 reserved_1() const; - Parse_sec_length sec_length const; - Parse_UInt16 tabel_id_extension() const; - Parse_reserved_2 reserved_2() const; - Parse_version_num version_num() const; - Parse_curr_next_indicator curr_next_indicator() const; - Parse_UInt8 sec_num() const; - Parse_UInt8 last_sec_num() const; + SENF_PARSER_BITFIELD ( ssi , 1 , bool ); + SENF_PARSER_BITFIELD ( private_indicator , 1 , bool ); + SENF_PARSER_SKIP_BITS( 2 ); + SENF_PARSER_BITFIELD ( sec_length , 12 , unsigned ); -# endif + SENF_PARSER_FIELD ( table_id_extension , Parse_UInt16 ); + SENF_PARSER_SKIP_BITS( 2 ); + SENF_PARSER_BITFIELD ( version_num , 5 , unsigned ); + SENF_PARSER_BITFIELD ( curr_next_indicator , 1 , bool ); + + SENF_PARSER_FIELD ( sec_num , Parse_UInt8 ); + SENF_PARSER_FIELD ( last_sec_num , Parse_UInt8 ); + + SENF_PARSER_FINALIZE( Parse_DSMCCSection ); + Parse_UInt32 crc() const { return parse( data().size()-4 ); } };