00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00026 #ifndef HH_SENF_Packets_MPEGDVBBundle_TransportPacket_
00027 #define HH_SENF_Packets_MPEGDVBBundle_TransportPacket_ 1
00028
00029
00030 #include <senf/Packets/Packets.hh>
00031
00032
00033
00034
00035 namespace senf {
00036
00044 struct TransportPacketParser : public PacketParserBase
00045 {
00046 # include SENF_PARSER()
00047
00048 SENF_PARSER_FIELD ( sync_byte, UInt8Parser );
00049
00050 SENF_PARSER_BITFIELD ( transport_error_indicator, 1, bool );
00051 SENF_PARSER_BITFIELD_RO ( pusi, 1, bool );
00052 SENF_PARSER_BITFIELD ( transport_priority, 1, bool );
00053 SENF_PARSER_BITFIELD ( pid, 13, unsigned );
00054 SENF_PARSER_BITFIELD ( transport_scrmbl_ctrl, 2, unsigned );
00055 SENF_PARSER_BITFIELD ( adaptation_field_ctrl, 2, unsigned );
00056 SENF_PARSER_BITFIELD ( continuity_counter, 4, unsigned );
00057
00058 SENF_PARSER_PRIVATE_VARIANT ( pointer_field_, pusi,
00059 (senf::VoidPacketParser) (UInt8Parser) );
00060
00061 SENF_PARSER_FINALIZE( TransportPacketParser );
00062
00063 UInt8Parser pointer_field() const;
00064 void init_fields() const;
00065 void setPUSI(bool pusi) const;
00066
00067 SENF_PARSER_INIT() {
00068 defaultInit();
00069 init_fields();
00070 }
00071 };
00072
00117 struct TransportPacketType
00118 : public PacketTypeBase,
00119 public PacketTypeMixin<TransportPacketType>
00120 {
00121 #ifndef DOXYGEN
00122 typedef PacketTypeMixin<TransportPacketType> mixin;
00123 #endif
00124 typedef ConcretePacket<TransportPacketType> packet;
00125 typedef TransportPacketParser parser;
00126
00127 using mixin::nextPacketRange;
00128 using mixin::init;
00129 using mixin::initSize;
00130
00132 static void dump(packet p, std::ostream & os);
00133 static const byte SYNC_BYTE = 0x47;
00134 };
00135
00137 typedef ConcretePacket<TransportPacketType> TransportPacket;
00138 }
00139
00140
00141
00142
00143
00144
00145 #endif
00146
00147
00148
00149
00150
00151
00152
00153
00154
00155
00156