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 // Anton Gillert <atx@berlios.de>
29 #ifndef HH_SENF_Socket_Protocols_DVB_DVBProtocolWrapper_
30 #define HH_SENF_Socket_Protocols_DVB_DVBProtocolWrapper_ 1
33 #include <senf/Utils/Console/ScopedDirectory.hh>
34 #include <senf/Utils/Console/Traits.hh>
35 #include "DVBDemuxHandles.hh"
37 //-/////////////////////////////////////////////////////////////////////////////////////////////////
39 SENF_CONSOLE_REGISTER_ENUM( dmx_input_t, (DMX_IN_FRONTEND)(DMX_IN_DVR) );
40 SENF_CONSOLE_REGISTER_ENUM( dmx_output_t, (DMX_OUT_DECODER)(DMX_OUT_TAP)(DMX_OUT_TS_TAP) );
41 SENF_CONSOLE_REGISTER_ENUM( dmx_pes_type_t, (DMX_PES_AUDIO0)(DMX_PES_VIDEO0)(DMX_PES_TELETEXT0)(DMX_PES_SUBTITLE0)(DMX_PES_PCR0)
42 (DMX_PES_AUDIO1)(DMX_PES_VIDEO1)(DMX_PES_TELETEXT1)(DMX_PES_SUBTITLE1)(DMX_PES_PCR1)
43 (DMX_PES_AUDIO2)(DMX_PES_VIDEO2)(DMX_PES_TELETEXT2)(DMX_PES_SUBTITLE2)(DMX_PES_PCR2)
44 (DMX_PES_AUDIO3)(DMX_PES_VIDEO3)(DMX_PES_TELETEXT3)(DMX_PES_SUBTITLE3)(DMX_PES_PCR3)
49 /** \brief Helperclass for configuration and controlling DVB protocol handles.
52 class DVBSectionProtocolWrapper : public DVBProtocolWrapper
55 const DVBDemuxSectionSocketProtocol& protocol;
58 enum Flags {CHECK_CRC = DMX_CHECK_CRC,
59 ONESHOT = DMX_ONESHOT,
60 IMMEDIATE_START = DMX_IMMEDIATE_START,
61 KERNEL_CLIENT = DMX_KERNEL_CLIENT};
62 senf::console::ScopedDirectory<DVBSectionProtocolWrapper> dir;
64 DVBSectionProtocolWrapper(senf::DVBDemuxSectionHandle sh);
65 ~DVBSectionProtocolWrapper() { }
67 void setSectionFilter(unsigned short int pid, u_int8_t filter,
68 unsigned int flags, u_int8_t mask, u_int8_t mode, unsigned int timeout);
70 void setBufferSize(unsigned long size);
71 ///< Set the size of the circular buffer used for filtered data.
72 /**< The default size is two maximum sized sections, i.e. if
73 this function is not called a buffer size of 2 * 4096 bytes
75 \param[in] size Size of circular buffer. */
76 void startFiltering(); ///< Starts filtering
77 void stopFiltering(); ///< Stops filtering
80 SENF_CONSOLE_REGISTER_ENUM_MEMBER(DVBSectionProtocolWrapper, Flags,
81 (CHECK_CRC)(ONESHOT)(IMMEDIATE_START)(KERNEL_CLIENT));
84 class DVBPESProtocolWrapper : public senf::DVBProtocolWrapper
87 const senf::DVBDemuxPESSocketProtocol& protocol;
90 enum Flags {CHECK_CRC = DMX_CHECK_CRC,
91 ONESHOT = DMX_ONESHOT,
92 IMMEDIATE_START = DMX_IMMEDIATE_START,
93 KERNEL_CLIENT = DMX_KERNEL_CLIENT};
94 senf::console::ScopedDirectory<DVBPESProtocolWrapper> dir;
96 DVBPESProtocolWrapper(senf::DVBDemuxPESHandle sh);
97 ~DVBPESProtocolWrapper() { };
99 void setPESFilter(unsigned short int pid, dmx_input_t input,
100 dmx_output_t output, dmx_pes_type_t pesType, unsigned int flags);
101 void startFiltering(); ///< Starts filtering
102 void stopFiltering(); ///< Stops filtering
105 SENF_CONSOLE_REGISTER_ENUM_MEMBER(DVBPESProtocolWrapper, Flags,
106 (CHECK_CRC)(ONESHOT)(IMMEDIATE_START)(KERNEL_CLIENT));
109 //-/////////////////////////////////////////////////////////////////////////////////////////////////
110 #include "DVBProtocolWrapper.cci"
111 //#include "DVBProtocolWrapper.ct"
112 //#include "DVBProtocolWrapper.cti"