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.*/
78 SocketProtocol::close();
84 class DVBDemuxSectionSocketProtocol
85 : public ConcreteSocketProtocol<DVBDemux_Policy, DVBDemuxSectionSocketProtocol>,
86 public DVBDemuxSocketProtocol,
87 public DVBSocketProtocol
91 ///////////////////////////////////////////////////////////////////////////
97 void init_client(unsigned short adapter=0, unsigned short device=0) const; ///< xxx
98 /**< \note This member is implicitly called from the
99 ProtocolClientSocketHandle::ProtocolClientSocketHandle()
103 ///\name Abstract Interface Implementation
106 unsigned available() const;
110 void setSectionFilter(unsigned short int pid,
111 unsigned char filter= 0x3e,
112 unsigned int flags= DMX_IMMEDIATE_START | DMX_CHECK_CRC,
113 unsigned char mask = 0xff,
114 unsigned char mode =0x00,
115 unsigned int timeout =0x00) const;
119 typedef ProtocolClientSocketHandle<DVBDemuxSectionSocketProtocol> DVBDemuxSectionHandle;
121 // ----------------------------------------------------------------
125 class DVBDemuxPESSocketProtocol
126 : public ConcreteSocketProtocol<DVBDemux_Policy,DVBDemuxPESSocketProtocol>,
127 public DVBDemuxSocketProtocol,
128 public DVBSocketProtocol
131 ///////////////////////////////////////////////////////////////////////////
132 // internal interface
134 ///\name Constructors
137 void init_client(unsigned short adapter=0, unsigned short device=0) const; ///< xxx
138 /**< \note This member is implicitly called from the
139 ProtocolClientSocketHandle::ProtocolClientSocketHandle()
143 ///\name Abstract Interface Implementation
146 unsigned available() const;
150 void setPESFilter(unsigned short int pid, dmx_input_t input, dmx_output_t output, dmx_pes_type_t pesType, unsigned int flags)const;
153 typedef ProtocolClientSocketHandle<DVBDemuxPESSocketProtocol> DVBDemuxPESHandle;
156 // ----------------------------------------------------------------
161 class DVBDvrSocketProtocol
162 : public ConcreteSocketProtocol<DVBDemux_Policy, DVBDvrSocketProtocol>,
163 public DVBDemuxSocketProtocol
166 ///////////////////////////////////////////////////////////////////////////
167 // internal interface
169 ///\name Constructors
172 void init_client(unsigned short adapter=0, unsigned short device=0) const; ///< xxx
173 /**< \note This member is implicitly called from the
174 ProtocolClientSocketHandle::ProtocolClientSocketHandle()
178 ///\name Abstract Interface Implementation
181 unsigned available() const;
186 typedef ProtocolClientSocketHandle<DVBDvrSocketProtocol> DVBDvrHandle;
192 ///////////////////////////////hh.e////////////////////////////////////////
193 //#include "DVBDemuxHandles.cci"
194 //#include "DVBDemuxHandles.ct"
195 //#include "DVBDemuxHandles.cti"
202 // c-file-style: "senf"
203 // indent-tabs-mode: nil
204 // ispell-local-dictionary: "american"
205 // compile-command: "scons -u test"
206 // comment-column: 40