X-Git-Url: http://g0dil.de/git?a=blobdiff_plain;f=Packets%2FMPEGDVBBundle%2FTransportPacket.hh;h=5ff4889bddc1061d91cae0794010fa25d1378352;hb=a4ebeef29f8eb69dc2dad10668d762540002b924;hp=6e9caa2ee95eecd12fba77cc1d19f5a1b48dc0ca;hpb=e57e1ec99a16261d1f436d1ea42f60dda6aae5cc;p=senf.git diff --git a/Packets/MPEGDVBBundle/TransportPacket.hh b/Packets/MPEGDVBBundle/TransportPacket.hh index 6e9caa2..5ff4889 100644 --- a/Packets/MPEGDVBBundle/TransportPacket.hh +++ b/Packets/MPEGDVBBundle/TransportPacket.hh @@ -1,8 +1,8 @@ // $Id:TransportPacket.hh 560 2007-12-13 14:39:37Z tho $ // // Copyright (C) 2007 -// Fraunhofer Institute for Open Communication Systems (FOKUS) -// Competence Center NETwork research (NET), St. Augustin, GERMANY +// 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 @@ -27,7 +27,6 @@ #define HH_TransportPacket_ 1 // Custom includes -#include #include "../../Packets/Packets.hh" //#include "TransportPacket.mpp" @@ -35,6 +34,13 @@ namespace senf { +// struct PSIPayloadPacketParser : public PacketParserBase +// { +// static const size_type fixed_bytes = 184; +// +// }; + + /** \brief Parse a Transport Stream packet Parser implementing the header of a MPEG Transport Stream packet. @@ -43,23 +49,31 @@ namespace senf { */ struct TransportPacketParser : public PacketParserBase { -# include SENF_FIXED_PARSER() +# include SENF_PARSER() - SENF_PARSER_FIELD ( sync_byte, UInt8Parser ); + 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_BITFIELD ( transport_error_indicator, 1, bool ); + SENF_PARSER_BITFIELD_RO ( 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_PRIVATE_VARIANT ( pointer_field_, pusi, + (senf::VoidPacketParser) (UInt8Parser) ); + SENF_PARSER_FINALIZE( TransportPacketParser ); - -// UInt8Parser payload_pointer() const { -// return parse( TransportPacketParser::fixed_bytes ); -// } + + UInt8Parser pointer_field() const; + void init_fields() const; + void setPUSI(bool pusi) const; + + SENF_PARSER_INIT() { + defaultInit(); + init_fields(); + } }; /** \brief Transport Stream packet @@ -119,13 +133,11 @@ namespace senf { 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; }