4 // Fraunhofer Institute for Open Communication Systems (FOKUS)
5 // Competence Center NETwork research (NET), St. Augustin, GERMANY
6 // Thorsten Horstmann <tho@berlios.de>
8 // This program is free software; you can redistribute it and/or modify
9 // it under the terms of the GNU General Public License as published by
10 // the Free Software Foundation; either version 2 of the License, or
11 // (at your option) any later version.
13 // This program is distributed in the hope that it will be useful,
14 // but WITHOUT ANY WARRANTY; without even the implied warranty of
15 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16 // GNU General Public License for more details.
18 // You should have received a copy of the GNU General Public License
19 // along with this program; if not, write to the
20 // Free Software Foundation, Inc.,
21 // 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
24 \brief DVBDemuxHandles public header */
26 #ifndef HH_SENF_Socket_Protocols_DVB_DVBDemuxHandles_
27 #define HH_SENF_Socket_Protocols_DVB_DVBDemuxHandles_ 1
30 #include <senf/Socket/FramingPolicy.hh>
31 #include <senf/Socket/CommunicationPolicy.hh>
32 #include <senf/Socket/ReadWritePolicy.hh>
33 #include <senf/Socket/ProtocolClientSocketHandle.hh>
34 #include "DVBDemuxSocketProtocol.hh"
36 //#include "DVBDemuxHandles.mpp"
37 #include <boost/enable_shared_from_this.hpp>
38 #include <boost/shared_ptr.hpp>
40 ///////////////////////////////hh.p////////////////////////////////////////
44 /// \addtogroup concrete_protocol_group
47 typedef MakeSocketPolicy<
49 DatagramFramingPolicy,
50 UnconnectedCommunicationPolicy,
53 >::policy DVBDemux_Policy; ///< Socket Policy for xxxx
55 /** \brief Baseclass of various DVBProtocolWrappers which are defined in DVBProtocolWrapper.hh
57 class DVBProtocolWrapper :public boost::enable_shared_from_this<DVBProtocolWrapper> {
59 DVBProtocolWrapper() {}
60 virtual ~DVBProtocolWrapper() {}
62 /** \brief Baseclass for DVBSocketProtocols which want use Wrappers for console.
64 class DVBSocketProtocol : public virtual SocketProtocol {
66 boost::shared_ptr<DVBProtocolWrapper> wrap_;
68 DVBSocketProtocol() {}
69 ~DVBSocketProtocol() {}
71 void addWrapper(boost::shared_ptr<DVBProtocolWrapper> wrap)/**< Binds a wrapper to a DVBProtocol,
72 so if it is closed the functionality of the wrapper is automatically removed from console.*/
79 SocketProtocol::close();
85 class DVBDemuxSectionSocketProtocol
86 : public ConcreteSocketProtocol<DVBDemux_Policy, DVBDemuxSectionSocketProtocol>,
87 public DVBDemuxSocketProtocol,
88 public DVBSocketProtocol
92 ///////////////////////////////////////////////////////////////////////////
98 void init_client(unsigned short adapter=0, unsigned short device=0) const; ///< xxx
99 /**< \note This member is implicitly called from the
100 ProtocolClientSocketHandle::ProtocolClientSocketHandle()
104 ///\name Abstract Interface Implementation
107 unsigned available() const;
111 void setSectionFilter(unsigned short int pid,
112 unsigned char filter= 0x3e,
113 unsigned int flags= DMX_IMMEDIATE_START | DMX_CHECK_CRC,
114 unsigned char mask = 0xff,
115 unsigned char mode =0x00,
116 unsigned int timeout =0x00) const;
120 typedef ProtocolClientSocketHandle<DVBDemuxSectionSocketProtocol> DVBDemuxSectionHandle;
122 // ----------------------------------------------------------------
126 class DVBDemuxPESSocketProtocol
127 : public ConcreteSocketProtocol<DVBDemux_Policy,DVBDemuxPESSocketProtocol>,
128 public DVBDemuxSocketProtocol,
129 public DVBSocketProtocol
132 ///////////////////////////////////////////////////////////////////////////
133 // internal interface
135 ///\name Constructors
138 void init_client(unsigned short adapter=0, unsigned short device=0) const; ///< xxx
139 /**< \note This member is implicitly called from the
140 ProtocolClientSocketHandle::ProtocolClientSocketHandle()
144 ///\name Abstract Interface Implementation
147 unsigned available() const;
151 void setPESFilter(unsigned short int pid, dmx_input_t input, dmx_output_t output, dmx_pes_type_t pesType, unsigned int flags)const;
154 typedef ProtocolClientSocketHandle<DVBDemuxPESSocketProtocol> DVBDemuxPESHandle;
157 // ----------------------------------------------------------------
162 class DVBDvrSocketProtocol
163 : public ConcreteSocketProtocol<DVBDemux_Policy, DVBDvrSocketProtocol>,
164 public DVBDemuxSocketProtocol
167 ///////////////////////////////////////////////////////////////////////////
168 // internal interface
170 ///\name Constructors
173 void init_client(unsigned short adapter=0, unsigned short device=0) const; ///< xxx
174 /**< \note This member is implicitly called from the
175 ProtocolClientSocketHandle::ProtocolClientSocketHandle()
179 ///\name Abstract Interface Implementation
182 unsigned available() const;
187 typedef ProtocolClientSocketHandle<DVBDvrSocketProtocol> DVBDvrHandle;
193 ///////////////////////////////hh.e////////////////////////////////////////
194 //#include "DVBDemuxHandles.cci"
195 //#include "DVBDemuxHandles.ct"
196 //#include "DVBDemuxHandles.cti"
203 // c-file-style: "senf"
204 // indent-tabs-mode: nil
205 // ispell-local-dictionary: "american"
206 // compile-command: "scons -u test"
207 // comment-column: 40