DVBDemuxHandles.hh
Go to the documentation of this file.
1 //
2 // Copyright (c) 2020 Fraunhofer Institute for Applied Information Technology (FIT)
3 // Network Research Group (NET)
4 // Schloss Birlinghoven, 53754 Sankt Augustin, GERMANY
5 // Contact: support@wiback.org
6 //
7 // This file is part of the SENF code tree.
8 // It is licensed under the 3-clause BSD License (aka New BSD License).
9 // See LICENSE.txt in the top level directory for details or visit
10 // https://opensource.org/licenses/BSD-3-Clause
11 //
12 
13 
17 #ifndef HH_SENF_Socket_Protocols_DVB_DVBDemuxHandles_
18 #define HH_SENF_Socket_Protocols_DVB_DVBDemuxHandles_ 1
19 
20 // Custom includes
21 #include <boost/enable_shared_from_this.hpp>
22 #include <boost/shared_ptr.hpp>
28 
29 //-/////////////////////////////////////////////////////////////////////////////////////////////////
30 
31 namespace senf {
32 
34  //\{
35 
36  typedef MakeSocketPolicy<
37  NoAddressingPolicy,
38  DatagramFramingPolicy,
39  UnconnectedCommunicationPolicy,
40  ReadablePolicy,
41  NotWriteablePolicy
42  >::policy DVBDemux_Policy;
43 
46  class DVBProtocolWrapper :public boost::enable_shared_from_this<DVBProtocolWrapper> {
47  public:
49  virtual ~DVBProtocolWrapper() {}
50  };
53  class DVBSocketProtocol : public virtual SocketProtocol {
54 private:
55  boost::shared_ptr<DVBProtocolWrapper> wrap_;
56 public:
59 
60  void addWrapper(boost::shared_ptr<DVBProtocolWrapper> wrap)
62  {
63  wrap_ = wrap;
64  }
65  virtual void close()
66  {
67  wrap_.reset();
69 
70  }
71  };
72 
73 
75  : public ConcreteSocketProtocol<DVBDemux_Policy, DVBDemuxSectionSocketProtocol>,
77  public DVBSocketProtocol
78  {
79 
80  public:
81  //-////////////////////////////////////////////////////////////////////////
82  // internal interface
83 
85  //\{
86 
87  void init_client(unsigned short adapter=0, unsigned short device=0) const;
88 
92  //\}
94  //\{
95 
96  unsigned available() const;
97 
98  //\}
99 
100  void setSectionFilter(unsigned short int pid,
101  unsigned char filter= 0x3e,
102  unsigned int flags= DMX_IMMEDIATE_START | DMX_CHECK_CRC,
103  unsigned char mask = 0xff,
104  unsigned char mode =0x00,
105  unsigned int timeout =0x00) const;
106 
107  };
108 
110 
111  // ----------------------------------------------------------------
112 
116  : public ConcreteSocketProtocol<DVBDemux_Policy,DVBDemuxPESSocketProtocol>,
117  public DVBDemuxSocketProtocol,
118  public DVBSocketProtocol
119  {
120  public:
121  //-////////////////////////////////////////////////////////////////////////
122  // internal interface
123 
125  //\{
126 
127  void init_client(unsigned short adapter=0, unsigned short device=0) const;
128 
132  //\}
134  //\{
135 
136  unsigned available() const;
137 
138  //\}
139 
140  void setPESFilter(unsigned short int pid, dmx_input_t input, dmx_output_t output, dmx_pes_type_t pesType, unsigned int flags)const;
141  };
142 
144 
145 
146  // ----------------------------------------------------------------
147 
148 
152  : public ConcreteSocketProtocol<DVBDemux_Policy, DVBDvrSocketProtocol>,
154  {
155  public:
156  //-////////////////////////////////////////////////////////////////////////
157  // internal interface
158 
160  //\{
161 
162  void init_client(unsigned short adapter=0, unsigned short device=0) const;
163 
167  //\}
169  //\{
170 
171  unsigned available() const;
172 
173  //\}
174  };
175 
177 
178  //\}
179 
180 }
181 
182 //-/////////////////////////////////////////////////////////////////////////////////////////////////
183 //#include "DVBDemuxHandles.cci"
184 //#include "DVBDemuxHandles.ct"
185 //#include "DVBDemuxHandles.cti"
186 #endif
187 
188 
189 // Local Variables:
190 // mode: c++
191 // fill-column: 100
192 // c-file-style: "senf"
193 // indent-tabs-mode: nil
194 // ispell-local-dictionary: "american"
195 // compile-command: "scons -u test"
196 // comment-column: 40
197 // End:
CommunicationPolicy public header.
MakeSocketPolicy< NoAddressingPolicy, DatagramFramingPolicy, UnconnectedCommunicationPolicy, ReadablePolicy, NotWriteablePolicy >::policy DVBDemux_Policy
Socket Policy for xxxx.
Baseclass of various DVBProtocolWrappers which are defined in DVBProtocolWrapper.hh.
ProtocolClientSocketHandle public header.
__u32 mask
Socket Protocol base class.
ReadPolicy and WritePolicy public header.
virtual void close()
Close socket.
void addWrapper(boost::shared_ptr< DVBProtocolWrapper > wrap)
ProtocolClientSocketHandle< DVBDvrSocketProtocol > DVBDvrHandle
DVBDemuxSocketProtocol public header.
Protocol specific socket handle (client interface)
ProtocolClientSocketHandle< DVBDemuxPESSocketProtocol > DVBDemuxPESHandle
ProtocolClientSocketHandle< DVBDemuxSectionSocketProtocol > DVBDemuxSectionHandle
Concrete Socket Protocol implementation base class.
FramingPolicy public header.
virtual void close()
Close socket.
Baseclass for DVBSocketProtocols which want use Wrappers for console.