From: tho Date: Tue, 15 Apr 2008 15:07:22 +0000 (+0000) Subject: -/- X-Git-Url: http://g0dil.de/git?a=commitdiff_plain;h=f86ea444009c0b82929b141fa2324183258e1587;p=senf.git -/- git-svn-id: https://svn.berlios.de/svnroot/repos/senf/trunk@812 270642c3-0616-0410-b53a-bc976706d245 --- diff --git a/Examples/DVBAdapter/SConscript b/Examples/DVBAdapter/SConscript index c6de76e..c6b9285 100644 --- a/Examples/DVBAdapter/SConscript +++ b/Examples/DVBAdapter/SConscript @@ -6,10 +6,10 @@ import os.path ########################################################################### -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' ]); diff --git a/Examples/RateStuffer/SConscript b/Examples/RateStuffer/SConscript index 8c36a25..dec0b30 100644 --- a/Examples/RateStuffer/SConscript +++ b/Examples/RateStuffer/SConscript @@ -4,7 +4,7 @@ import SENFSCons ########################################################################### 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') diff --git a/Examples/psi2tsModule/psi2ts.cc b/Examples/psi2tsModule/psi2ts.cc index f8da4fb..6878c38 100644 --- a/Examples/psi2tsModule/psi2ts.cc +++ b/Examples/psi2tsModule/psi2ts.cc @@ -43,30 +43,32 @@ namespace { } -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 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( diff --git a/Examples/psi2tsModule/psi2ts.hh b/Examples/psi2tsModule/psi2ts.hh index 1b136db..14d25bd 100644 --- a/Examples/psi2tsModule/psi2ts.hh +++ b/Examples/psi2tsModule/psi2ts.hh @@ -44,7 +44,7 @@ class Psi2TsModule public: senf::ppi::connector::PassiveInput<> input; senf::ppi::connector::ActiveOutput output; - Psi2TsModule(unsigned pid); + Psi2TsModule(unsigned pid, senf::ClockService::clock_type timout=0); void onRequest(); private: @@ -54,7 +54,7 @@ private: unsigned next_continuity_counter(); state state_; unsigned pid_; - + senf::ClockService::clock_type timeout_; }; diff --git a/Examples/psi2tsModule/psi2ts.test.cc b/Examples/psi2tsModule/psi2ts.test.cc index 000dc74..6cd4f5d 100644 --- a/Examples/psi2tsModule/psi2ts.test.cc +++ b/Examples/psi2tsModule/psi2ts.test.cc @@ -46,6 +46,8 @@ void check_transportpacket_header(senf::TransportPacket tsPacket, bool pusi, uns 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 ); } @@ -87,7 +89,7 @@ BOOST_AUTO_UNIT_TEST(one_section_to_one_transportpacket) ts_payload_data.end(), 0xffu)); } - +#include BOOST_AUTO_UNIT_TEST(one_section_to_two_transportpackets) { senf::ppi::module::debug::ActiveSource source; @@ -99,7 +101,7 @@ BOOST_AUTO_UNIT_TEST(one_section_to_two_transportpackets) 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)); @@ -111,6 +113,7 @@ BOOST_AUTO_UNIT_TEST(one_section_to_two_transportpackets) senf::TransportPacket ts_packet = sink.pop_front().as(); 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();