-/-
tho [Tue, 15 Apr 2008 15:07:22 +0000 (15:07 +0000)]
git-svn-id: https://svn.berlios.de/svnroot/repos/senf/trunk@812 270642c3-0616-0410-b53a-bc976706d245

Examples/DVBAdapter/SConscript
Examples/RateStuffer/SConscript
Examples/psi2tsModule/psi2ts.cc
Examples/psi2tsModule/psi2ts.hh
Examples/psi2tsModule/psi2ts.test.cc

index c6de76e..c6b9285 100644 (file)
@@ -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' ]);
index 8c36a25..dec0b30 100644 (file)
@@ -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')
index f8da4fb..6878c38 100644 (file)
@@ -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 <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(
index 1b136db..14d25bd 100644 (file)
@@ -44,7 +44,7 @@ class Psi2TsModule
 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:
@@ -54,7 +54,7 @@ private:
     unsigned next_continuity_counter();
     state state_;
     unsigned pid_;
-        
+    senf::ClockService::clock_type timeout_;
 };
 
 
index 000dc74..6cd4f5d 100644 (file)
@@ -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 <senf/Utils/hexdump.hh>
 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<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>();