4 // Fraunhofer Institute for Open Communication Systems (FOKUS)
5 // Competence Center NETwork research (NET), St. Augustin, GERMANY
6 // Anton Gillert <atx@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 #ifndef HH_SENF_Socket_Protocols_DVB_DVBProtocolWrapper_
25 #define HH_SENF_Socket_Protocols_DVB_DVBProtocolWrapper_ 1
28 #include <senf/Utils/Console/Console.hh>
29 #include "DVBDemuxHandles.hh"
31 ///////////////////////////////hh.p////////////////////////////////////////
33 SENF_CONSOLE_REGISTER_ENUM( dmx_input_t, (DMX_IN_FRONTEND)(DMX_IN_DVR) );
34 SENF_CONSOLE_REGISTER_ENUM( dmx_output_t, (DMX_OUT_DECODER)(DMX_OUT_TAP)(DMX_OUT_TS_TAP) );
35 SENF_CONSOLE_REGISTER_ENUM( dmx_pes_type_t, (DMX_PES_AUDIO0)(DMX_PES_VIDEO0)(DMX_PES_TELETEXT0)(DMX_PES_SUBTITLE0)(DMX_PES_PCR0)
36 (DMX_PES_AUDIO1)(DMX_PES_VIDEO1)(DMX_PES_TELETEXT1)(DMX_PES_SUBTITLE1)(DMX_PES_PCR1)
37 (DMX_PES_AUDIO2)(DMX_PES_VIDEO2)(DMX_PES_TELETEXT2)(DMX_PES_SUBTITLE2)(DMX_PES_PCR2)
38 (DMX_PES_AUDIO3)(DMX_PES_VIDEO3)(DMX_PES_TELETEXT3)(DMX_PES_SUBTITLE3)(DMX_PES_PCR3)
43 /** \brief Helperclass for configuration and controlling DVB protocol handles.
46 class DVBSectionProtocolWrapper : public DVBProtocolWrapper
49 const DVBDemuxSectionSocketProtocol& protocol;
52 enum Flags {CHECK_CRC = DMX_CHECK_CRC,
53 ONESHOT = DMX_ONESHOT,
54 IMMEDIATE_START = DMX_IMMEDIATE_START,
55 KERNEL_CLIENT = DMX_KERNEL_CLIENT};
56 senf::console::ScopedDirectory<DVBSectionProtocolWrapper> dir;
58 DVBSectionProtocolWrapper(senf::DVBDemuxSectionHandle sh);
59 ~DVBSectionProtocolWrapper() { }
61 void setSectionFilter(unsigned short int pid, u_int8_t filter,
62 unsigned int flags, u_int8_t mask, u_int8_t mode, unsigned int timeout);
64 void setBufferSize(unsigned long size);
65 ///< Set the size of the circular buffer used for filtered data.
66 /**< The default size is two maximum sized sections, i.e. if
67 this function is not called a buffer size of 2 * 4096 bytes
69 \param[in] size Size of circular buffer. */
70 void startFiltering(); ///< Starts filtering
71 void stopFiltering(); ///< Stops filtering
74 SENF_CONSOLE_REGISTER_ENUM_MEMBER(DVBSectionProtocolWrapper, Flags,
75 (CHECK_CRC)(ONESHOT)(IMMEDIATE_START)(KERNEL_CLIENT));
78 class DVBPESProtocolWrapper : public senf::DVBProtocolWrapper
81 const senf::DVBDemuxPESSocketProtocol& protocol;
84 enum Flags {CHECK_CRC = DMX_CHECK_CRC,
85 ONESHOT = DMX_ONESHOT,
86 IMMEDIATE_START = DMX_IMMEDIATE_START,
87 KERNEL_CLIENT = DMX_KERNEL_CLIENT};
88 senf::console::ScopedDirectory<DVBPESProtocolWrapper> dir;
90 DVBPESProtocolWrapper(senf::DVBDemuxPESHandle sh);
91 ~DVBPESProtocolWrapper() { };
93 void setPESFilter(unsigned short int pid, dmx_input_t input,
94 dmx_output_t output, dmx_pes_type_t pesType, unsigned int flags);
95 void startFiltering(); ///< Starts filtering
96 void stopFiltering(); ///< Stops filtering
99 SENF_CONSOLE_REGISTER_ENUM_MEMBER(DVBPESProtocolWrapper, Flags,
100 (CHECK_CRC)(ONESHOT)(IMMEDIATE_START)(KERNEL_CLIENT));
103 ///////////////////////////////hh.e////////////////////////////////////////
104 #include "DVBProtocolWrapper.cci"
105 //#include "DVBProtocolWrapper.ct"
106 //#include "DVBProtocolWrapper.cti"