###########################################################################
-for f in glob.glob('*.cc'):
- bin = os.path.splitext(f)[0]
-
- SENFSCons.Binary(env, bin, f,
- LIBS = [ 'Scheduler', 'Packets', 'Socket', 'Utils' ],
- OBJECTS = [ '#/Packets/DefaultBundle/DefaultBundle.o',
- '#/Packets/MPEGDVBBundle/MPEGDVBBundle.o' ]);
+#for f in glob.glob('*.cc'):
+# bin = os.path.splitext(f)[0]
+#
+# SENFSCons.Binary(env, bin, f,
+# LIBS = [ 'Scheduler', 'Packets', 'Socket', 'Utils' ],
+# OBJECTS = [ '#/Packets/DefaultBundle/DefaultBundle.o',
+# '#/Packets/MPEGDVBBundle/MPEGDVBBundle.o' ]);
###########################################################################
SENFSCons.Binary( env, 'ratestuffer', SENFSCons.GlobSources(),
- LIBS = [ 'PPI', 'Scheduler', 'Packets', 'Socket', 'Scheduler', 'Utils' ] );
+ LIBS = [ 'PPI', 'Scheduler', 'Packets', 'Socket', 'Utils' ] );
SENFSCons.Doxygen(env, extra_sources=[
env.Dia2Png('ratestuffer.dia')
}
-prefix_ Psi2TsModule::Psi2TsModule(unsigned pid)
+prefix_ Psi2TsModule::Psi2TsModule(unsigned pid, senf::ClockService::clock_type timeout)
{
pid_ = pid;
continuity_counter_ = 0;
state_ = IDLE;
route( input, output );
input.onRequest( &Psi2TsModule::onRequest );
+ timeout_ = timeout;
}
-
+#include <senf/Utils/hexdump.hh>
prefix_ void Psi2TsModule::onRequest()
{
senf::PacketData & section = input.read().data();
iterator sec_end = section.end();
iterator begin = section.begin();
iterator end = section.begin();
- advance_max( end, 184, sec_end);
-
+ advance_max( end, 183, sec_end);
+
do {
senf::TransportPacket tsPacket (senf::TransportPacket::create(188));
tsPacket->continuity_counter() = next_continuity_counter();
tsPacket->pid() = pid_;
if (state_ == IDLE) {
state_ = PROC;
- tsPacket->pusi() = true;
+ tsPacket->setPUSI(true);
+ tsPacket->pointer_field() = 0;
}
senf::PacketData & payloadData (tsPacket.next().data());
std::fill(
public:
senf::ppi::connector::PassiveInput<> input;
senf::ppi::connector::ActiveOutput<senf::TransportPacket> output;
- Psi2TsModule(unsigned pid);
+ Psi2TsModule(unsigned pid, senf::ClockService::clock_type timout=0);
void onRequest();
private:
unsigned next_continuity_counter();
state state_;
unsigned pid_;
-
+ senf::ClockService::clock_type timeout_;
};
BOOST_CHECK_EQUAL( tsPacket->transport_scrmbl_ctrl(), 0x0u );
BOOST_CHECK_EQUAL( tsPacket->adaptation_field_ctrl(), 0x1u );
BOOST_CHECK_EQUAL( tsPacket->continuity_counter(), counter );
+ if (pusi)
+ BOOST_CHECK_EQUAL( tsPacket->pointer_field(), 0x0u );
}
ts_payload_data.end(),
0xffu));
}
-
+#include <senf/Utils/hexdump.hh>
BOOST_AUTO_UNIT_TEST(one_section_to_two_transportpackets)
{
senf::ppi::module::debug::ActiveSource source;
senf::ppi::connect( psi2ts, sink);
senf::ppi::init();
- std::string sec_data ( 184, 0x42);
+ std::string sec_data ( 183, 0x42);
std::string sec_data2 ( "psi2ts_test: one_section_to_two_transportpackets");
sec_data.append( sec_data2);
senf::Packet sec_packet (senf::DataPacket::create(sec_data));
senf::TransportPacket ts_packet = sink.pop_front().as<senf::TransportPacket>();
check_transportpacket_header( ts_packet, true, PID, 1);
senf::PacketData & ts_payload_data1 = ts_packet.next().data();
+
BOOST_CHECK( equal_elements( ts_payload_data1.begin(), ts_payload_data1.end(), 0x42));
ts_packet = sink.pop_front().as<senf::TransportPacket>();