DVBDemuxHandles.hh
Go to the documentation of this file.
00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00026 #ifndef HH_SENF_Socket_Protocols_DVB_DVBDemuxHandles_
00027 #define HH_SENF_Socket_Protocols_DVB_DVBDemuxHandles_ 1
00028
00029
00030 #include <senf/Socket/FramingPolicy.hh>
00031 #include <senf/Socket/CommunicationPolicy.hh>
00032 #include <senf/Socket/ReadWritePolicy.hh>
00033 #include <senf/Socket/ProtocolClientSocketHandle.hh>
00034 #include "DVBDemuxSocketProtocol.hh"
00035
00036
00037 #include <boost/enable_shared_from_this.hpp>
00038 #include <boost/shared_ptr.hpp>
00039 #include <iostream>
00040
00041
00042 namespace senf {
00043
00045
00046
00047 typedef MakeSocketPolicy<
00048 NoAddressingPolicy,
00049 DatagramFramingPolicy,
00050 UnconnectedCommunicationPolicy,
00051 ReadablePolicy,
00052 NotWriteablePolicy
00053 >::policy DVBDemux_Policy;
00054
00057 class DVBProtocolWrapper :public boost::enable_shared_from_this<DVBProtocolWrapper> {
00058 public:
00059 DVBProtocolWrapper() {}
00060 virtual ~DVBProtocolWrapper() {}
00061 };
00064 class DVBSocketProtocol : public virtual SocketProtocol {
00065 private:
00066 boost::shared_ptr<DVBProtocolWrapper> wrap_;
00067 public:
00068 DVBSocketProtocol() {}
00069 ~DVBSocketProtocol() {}
00070
00071 void addWrapper(boost::shared_ptr<DVBProtocolWrapper> wrap)
00073 {
00074 wrap_ = wrap;
00075 }
00076 virtual void close()
00077 {
00078 wrap_.reset();
00079 SocketProtocol::close();
00080
00081 }
00082 };
00083
00084
00085 class DVBDemuxSectionSocketProtocol
00086 : public ConcreteSocketProtocol<DVBDemux_Policy, DVBDemuxSectionSocketProtocol>,
00087 public DVBDemuxSocketProtocol,
00088 public DVBSocketProtocol
00089 {
00090
00091 public:
00092
00093
00094
00096
00097
00098 void init_client(unsigned short adapter=0, unsigned short device=0) const;
00099
00103
00105
00106
00107 unsigned available() const;
00108
00109
00110
00111 void setSectionFilter(unsigned short int pid,
00112 unsigned char filter= 0x3e,
00113 unsigned int flags= DMX_IMMEDIATE_START | DMX_CHECK_CRC,
00114 unsigned char mask = 0xff,
00115 unsigned char mode =0x00,
00116 unsigned int timeout =0x00) const;
00117
00118 };
00119
00120 typedef ProtocolClientSocketHandle<DVBDemuxSectionSocketProtocol> DVBDemuxSectionHandle;
00121
00122
00123
00126 class DVBDemuxPESSocketProtocol
00127 : public ConcreteSocketProtocol<DVBDemux_Policy,DVBDemuxPESSocketProtocol>,
00128 public DVBDemuxSocketProtocol,
00129 public DVBSocketProtocol
00130 {
00131 public:
00132
00133
00134
00136
00137
00138 void init_client(unsigned short adapter=0, unsigned short device=0) const;
00139
00143
00145
00146
00147 unsigned available() const;
00148
00149
00150
00151 void setPESFilter(unsigned short int pid, dmx_input_t input, dmx_output_t output, dmx_pes_type_t pesType, unsigned int flags)const;
00152 };
00153
00154 typedef ProtocolClientSocketHandle<DVBDemuxPESSocketProtocol> DVBDemuxPESHandle;
00155
00156
00157
00158
00159
00162 class DVBDvrSocketProtocol
00163 : public ConcreteSocketProtocol<DVBDemux_Policy, DVBDvrSocketProtocol>,
00164 public DVBDemuxSocketProtocol
00165 {
00166 public:
00167
00168
00169
00171
00172
00173 void init_client(unsigned short adapter=0, unsigned short device=0) const;
00174
00178
00180
00181
00182 unsigned available() const;
00183
00184
00185 };
00186
00187 typedef ProtocolClientSocketHandle<DVBDvrSocketProtocol> DVBDvrHandle;
00188
00189
00190
00191 }
00192
00193
00194
00195
00196
00197 #endif
00198
00199
00200
00201
00202
00203
00204
00205
00206
00207
00208