From: tho Date: Fri, 7 Mar 2008 12:07:59 +0000 (+0000) Subject: miscellaneous bits and bobs ;) X-Git-Url: http://g0dil.de/git?a=commitdiff_plain;h=16a7043409c142f245eb5f55daa6cfafb84bbd06;p=senf.git miscellaneous bits and bobs ;) git-svn-id: https://svn.berlios.de/svnroot/repos/senf/trunk@734 270642c3-0616-0410-b53a-bc976706d245 --- diff --git a/Examples/DVBAdapter/ULEdec.cc b/Examples/DVBAdapter/ULEdec.cc index f70b49f..8fc629d 100644 --- a/Examples/DVBAdapter/ULEdec.cc +++ b/Examples/DVBAdapter/ULEdec.cc @@ -67,7 +67,7 @@ void ULEdec::handleEvent(senf::Scheduler::EventId event) dvrHandle.read( ts_packet.data() ); // Check TS error conditions: sync_byte, transport_error_indicator, scrambling_control. - if ( (ts_packet->sync_byte() != TRANSPORT_PACKET_SYNC_BYTE) || + if ( (ts_packet->sync_byte() != senf::TransportPacketType::SYNC_BYTE) || (ts_packet->transport_error_indicator() == true) || (ts_packet->transport_scrmbl_ctrl() != 0)) { diff --git a/Examples/Sniffer/SConscript b/Examples/Sniffer/SConscript index 250abc6..ecf3cad 100644 --- a/Examples/Sniffer/SConscript +++ b/Examples/Sniffer/SConscript @@ -3,9 +3,8 @@ import SENFSCons ########################################################################### -SENFSCons.Binary(env, 'sniffer', SENFSCons.GlobSources(), - LIBS = [ 'Scheduler', 'Packets', 'Socket', 'Utils' ], - OBJECTS = [ '#/Packets/DefaultBundle/DefaultBundle.o', - '#/Packets/MPEGDVBBundle/MPEGDVBBundle.o' ]) +SENFSCons.Binary(env, 'sniffer', SENFSCons.GlobSources(), LIBS = [ + 'Packets_DefaultBundle', 'Packets_MPEGDVBBundle', + 'Scheduler', 'Packets', 'Socket', 'Utils' ]) SENFSCons.Doxygen(env) diff --git a/Packets/MPEGDVBBundle/TransportPacket.hh b/Packets/MPEGDVBBundle/TransportPacket.hh index 36fd10f..ab9d495 100644 --- a/Packets/MPEGDVBBundle/TransportPacket.hh +++ b/Packets/MPEGDVBBundle/TransportPacket.hh @@ -119,13 +119,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; } diff --git a/Packets/MPEGDVBBundle/TransportPacket.test.cc b/Packets/MPEGDVBBundle/TransportPacket.test.cc index 9aa131f..fc843de 100644 --- a/Packets/MPEGDVBBundle/TransportPacket.test.cc +++ b/Packets/MPEGDVBBundle/TransportPacket.test.cc @@ -69,14 +69,14 @@ BOOST_AUTO_UNIT_TEST(transportPacket_packet) senf::TransportPacket p (senf::TransportPacket::create(data)); - BOOST_CHECK_EQUAL( p->sync_byte(), TRANSPORT_PACKET_SYNC_BYTE ); - BOOST_CHECK( ! p->transport_error_indicator() ); - BOOST_CHECK( p->pusi() ); - BOOST_CHECK( ! p->transport_priority() ); - BOOST_CHECK_EQUAL( p->pid(), 0x010fu ); - BOOST_CHECK_EQUAL( p->transport_scrmbl_ctrl(), 0x0u ); - BOOST_CHECK_EQUAL( p->adaptation_field_ctrl(), 0x1u ); - BOOST_CHECK_EQUAL( p->continuity_counter(), 0x0eu ); + BOOST_CHECK_EQUAL( p->sync_byte(), TransportPacketType::SYNC_BYTE ); + BOOST_CHECK( ! p->transport_error_indicator() ); + BOOST_CHECK( p->pusi() ); + BOOST_CHECK( ! p->transport_priority() ); + BOOST_CHECK_EQUAL( p->pid(), 0x010fu ); + BOOST_CHECK_EQUAL( p->transport_scrmbl_ctrl(), 0x0u ); + BOOST_CHECK_EQUAL( p->adaptation_field_ctrl(), 0x1u ); + BOOST_CHECK_EQUAL( p->continuity_counter(), 0x0eu ); } ///////////////////////////////cc.e//////////////////////////////////////// diff --git a/Socket/Protocols/DVB/DVBDemuxSocketProtocol.hh b/Socket/Protocols/DVB/DVBDemuxSocketProtocol.hh index e5963e9..7545022 100644 --- a/Socket/Protocols/DVB/DVBDemuxSocketProtocol.hh +++ b/Socket/Protocols/DVB/DVBDemuxSocketProtocol.hh @@ -39,14 +39,18 @@ namespace senf { /// \addtogroup protocol_facets_group /// @{ - /** xxx + /** \todo Document me! */ class DVBDemuxSocketProtocol : public virtual SocketProtocol { public: - void setBufferSize(unsigned long size) const; - + void setBufferSize(unsigned long size) const; + ///< set the size of the circular buffer used for filtered data. + /**< The default size is two maximum sized sections, i.e. if this + function is not called a buffer size of 2 * 4096 bytes will + be used. + \param[in] size Size of circular buffer. */ void startFiltering() const; void stopFiltering() const; diff --git a/Socket/Protocols/UN/ConnectedUNDatagramSocketHandle.cc b/Socket/Protocols/UN/ConnectedUNDatagramSocketHandle.cc index 2a9a4db..21e7ddc 100644 --- a/Socket/Protocols/UN/ConnectedUNDatagramSocketHandle.cc +++ b/Socket/Protocols/UN/ConnectedUNDatagramSocketHandle.cc @@ -38,10 +38,10 @@ prefix_ void senf::ConnectedUNDatagramSocketProtocol::init_client() const { - int sock = ::socket(PF_UNIX,SOCK_DGRAM,0); + int sock = ::socket(PF_UNIX, SOCK_DGRAM, 0); if (sock < 0) throw SystemException( "Could not create socket(PF_UNIX,SOCK_DGRAM,0)." ); - fd(sock); + fd(sock); } prefix_ void senf::ConnectedUNDatagramSocketProtocol::init_client(UNSocketAddress const & address) const diff --git a/Utils/Logger/IOStreamTarget.cc b/Utils/Logger/IOStreamTarget.cc index 6d720b5..dbf4454 100644 --- a/Utils/Logger/IOStreamTarget.cc +++ b/Utils/Logger/IOStreamTarget.cc @@ -71,9 +71,9 @@ prefix_ void senf::log::IOStreamTarget::v_write(boost::posix_time::ptime timesta for (; i != i_end; ++i) { stream_ << timestamp << sep; + stream_ << "[" << LEVELNAMES_[level] << "]"; if (area != "senf::log::DefaultArea") - stream_ << "[" << area << "]"; - stream_ << "[" << LEVELNAMES_[level] << "] "; + stream_ << "[" << area << "] "; stream_ << *i << "\n"; sep = '-'; }