4 // Fraunhofer Institute for Open Communication Systems (FOKUS)
6 // The contents of this file are subject to the Fraunhofer FOKUS Public License
7 // Version 1.0 (the "License"); you may not use this file except in compliance
8 // with the License. You may obtain a copy of the License at
9 // http://senf.berlios.de/license.html
11 // The Fraunhofer FOKUS Public License Version 1.0 is based on,
12 // but modifies the Mozilla Public License Version 1.1.
13 // See the full license text for the amendments.
15 // Software distributed under the License is distributed on an "AS IS" basis,
16 // WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
17 // for the specific language governing rights and limitations under the License.
19 // The Original Code is Fraunhofer FOKUS code.
21 // The Initial Developer of the Original Code is Fraunhofer-Gesellschaft e.V.
22 // (registered association), Hansastraße 27 c, 80686 Munich, Germany.
23 // All Rights Reserved.
26 // Thorsten Horstmann <tho@berlios.de>
29 \brief DVBDemuxHandles public header */
31 #ifndef HH_SENF_Socket_Protocols_DVB_DVBDemuxHandles_
32 #define HH_SENF_Socket_Protocols_DVB_DVBDemuxHandles_ 1
35 #include <senf/Socket/FramingPolicy.hh>
36 #include <senf/Socket/CommunicationPolicy.hh>
37 #include <senf/Socket/ReadWritePolicy.hh>
38 #include <senf/Socket/ProtocolClientSocketHandle.hh>
39 #include "DVBDemuxSocketProtocol.hh"
41 //#include "DVBDemuxHandles.mpp"
42 #include <boost/enable_shared_from_this.hpp>
43 #include <boost/shared_ptr.hpp>
45 //-/////////////////////////////////////////////////////////////////////////////////////////////////
49 /// \addtogroup concrete_protocol_group
52 typedef MakeSocketPolicy<
54 DatagramFramingPolicy,
55 UnconnectedCommunicationPolicy,
58 >::policy DVBDemux_Policy; ///< Socket Policy for xxxx
60 /** \brief Baseclass of various DVBProtocolWrappers which are defined in DVBProtocolWrapper.hh
62 class DVBProtocolWrapper :public boost::enable_shared_from_this<DVBProtocolWrapper> {
64 DVBProtocolWrapper() {}
65 virtual ~DVBProtocolWrapper() {}
67 /** \brief Baseclass for DVBSocketProtocols which want use Wrappers for console.
69 class DVBSocketProtocol : public virtual SocketProtocol {
71 boost::shared_ptr<DVBProtocolWrapper> wrap_;
73 DVBSocketProtocol() {}
74 ~DVBSocketProtocol() {}
76 void addWrapper(boost::shared_ptr<DVBProtocolWrapper> wrap)/**< Binds a wrapper to a DVBProtocol,
77 so if it is closed the functionality of the wrapper is automatically removed from console.*/
84 SocketProtocol::close();
90 class DVBDemuxSectionSocketProtocol
91 : public ConcreteSocketProtocol<DVBDemux_Policy, DVBDemuxSectionSocketProtocol>,
92 public DVBDemuxSocketProtocol,
93 public DVBSocketProtocol
97 //-////////////////////////////////////////////////////////////////////////
100 ///\name Constructors
103 void init_client(unsigned short adapter=0, unsigned short device=0) const; ///< xxx
104 /**< \note This member is implicitly called from the
105 ProtocolClientSocketHandle::ProtocolClientSocketHandle()
109 ///\name Abstract Interface Implementation
112 unsigned available() const;
116 void setSectionFilter(unsigned short int pid,
117 unsigned char filter= 0x3e,
118 unsigned int flags= DMX_IMMEDIATE_START | DMX_CHECK_CRC,
119 unsigned char mask = 0xff,
120 unsigned char mode =0x00,
121 unsigned int timeout =0x00) const;
125 typedef ProtocolClientSocketHandle<DVBDemuxSectionSocketProtocol> DVBDemuxSectionHandle;
127 // ----------------------------------------------------------------
131 class DVBDemuxPESSocketProtocol
132 : public ConcreteSocketProtocol<DVBDemux_Policy,DVBDemuxPESSocketProtocol>,
133 public DVBDemuxSocketProtocol,
134 public DVBSocketProtocol
137 //-////////////////////////////////////////////////////////////////////////
138 // internal interface
140 ///\name Constructors
143 void init_client(unsigned short adapter=0, unsigned short device=0) const; ///< xxx
144 /**< \note This member is implicitly called from the
145 ProtocolClientSocketHandle::ProtocolClientSocketHandle()
149 ///\name Abstract Interface Implementation
152 unsigned available() const;
156 void setPESFilter(unsigned short int pid, dmx_input_t input, dmx_output_t output, dmx_pes_type_t pesType, unsigned int flags)const;
159 typedef ProtocolClientSocketHandle<DVBDemuxPESSocketProtocol> DVBDemuxPESHandle;
162 // ----------------------------------------------------------------
167 class DVBDvrSocketProtocol
168 : public ConcreteSocketProtocol<DVBDemux_Policy, DVBDvrSocketProtocol>,
169 public DVBDemuxSocketProtocol
172 //-////////////////////////////////////////////////////////////////////////
173 // internal interface
175 ///\name Constructors
178 void init_client(unsigned short adapter=0, unsigned short device=0) const; ///< xxx
179 /**< \note This member is implicitly called from the
180 ProtocolClientSocketHandle::ProtocolClientSocketHandle()
184 ///\name Abstract Interface Implementation
187 unsigned available() const;
192 typedef ProtocolClientSocketHandle<DVBDvrSocketProtocol> DVBDvrHandle;
198 //-/////////////////////////////////////////////////////////////////////////////////////////////////
199 //#include "DVBDemuxHandles.cci"
200 //#include "DVBDemuxHandles.ct"
201 //#include "DVBDemuxHandles.cti"
208 // c-file-style: "senf"
209 // indent-tabs-mode: nil
210 // ispell-local-dictionary: "american"
211 // compile-command: "scons -u test"
212 // comment-column: 40