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/ScopedDirectory.hh>
29 #include <senf/Utils/Console/Traits.hh>
30 #include "DVBDemuxHandles.hh"
32 //-/////////////////////////////////////////////////////////////////////////////////////////////////
34 SENF_CONSOLE_REGISTER_ENUM( dmx_input_t, (DMX_IN_FRONTEND)(DMX_IN_DVR) );
35 SENF_CONSOLE_REGISTER_ENUM( dmx_output_t, (DMX_OUT_DECODER)(DMX_OUT_TAP)(DMX_OUT_TS_TAP) );
36 SENF_CONSOLE_REGISTER_ENUM( dmx_pes_type_t, (DMX_PES_AUDIO0)(DMX_PES_VIDEO0)(DMX_PES_TELETEXT0)(DMX_PES_SUBTITLE0)(DMX_PES_PCR0)
37 (DMX_PES_AUDIO1)(DMX_PES_VIDEO1)(DMX_PES_TELETEXT1)(DMX_PES_SUBTITLE1)(DMX_PES_PCR1)
38 (DMX_PES_AUDIO2)(DMX_PES_VIDEO2)(DMX_PES_TELETEXT2)(DMX_PES_SUBTITLE2)(DMX_PES_PCR2)
39 (DMX_PES_AUDIO3)(DMX_PES_VIDEO3)(DMX_PES_TELETEXT3)(DMX_PES_SUBTITLE3)(DMX_PES_PCR3)
44 /** \brief Helperclass for configuration and controlling DVB protocol handles.
47 class DVBSectionProtocolWrapper : public DVBProtocolWrapper
50 const DVBDemuxSectionSocketProtocol& protocol;
53 enum Flags {CHECK_CRC = DMX_CHECK_CRC,
54 ONESHOT = DMX_ONESHOT,
55 IMMEDIATE_START = DMX_IMMEDIATE_START,
56 KERNEL_CLIENT = DMX_KERNEL_CLIENT};
57 senf::console::ScopedDirectory<DVBSectionProtocolWrapper> dir;
59 DVBSectionProtocolWrapper(senf::DVBDemuxSectionHandle sh);
60 ~DVBSectionProtocolWrapper() { }
62 void setSectionFilter(unsigned short int pid, u_int8_t filter,
63 unsigned int flags, u_int8_t mask, u_int8_t mode, unsigned int timeout);
65 void setBufferSize(unsigned long size);
66 ///< Set the size of the circular buffer used for filtered data.
67 /**< The default size is two maximum sized sections, i.e. if
68 this function is not called a buffer size of 2 * 4096 bytes
70 \param[in] size Size of circular buffer. */
71 void startFiltering(); ///< Starts filtering
72 void stopFiltering(); ///< Stops filtering
75 SENF_CONSOLE_REGISTER_ENUM_MEMBER(DVBSectionProtocolWrapper, Flags,
76 (CHECK_CRC)(ONESHOT)(IMMEDIATE_START)(KERNEL_CLIENT));
79 class DVBPESProtocolWrapper : public senf::DVBProtocolWrapper
82 const senf::DVBDemuxPESSocketProtocol& protocol;
85 enum Flags {CHECK_CRC = DMX_CHECK_CRC,
86 ONESHOT = DMX_ONESHOT,
87 IMMEDIATE_START = DMX_IMMEDIATE_START,
88 KERNEL_CLIENT = DMX_KERNEL_CLIENT};
89 senf::console::ScopedDirectory<DVBPESProtocolWrapper> dir;
91 DVBPESProtocolWrapper(senf::DVBDemuxPESHandle sh);
92 ~DVBPESProtocolWrapper() { };
94 void setPESFilter(unsigned short int pid, dmx_input_t input,
95 dmx_output_t output, dmx_pes_type_t pesType, unsigned int flags);
96 void startFiltering(); ///< Starts filtering
97 void stopFiltering(); ///< Stops filtering
100 SENF_CONSOLE_REGISTER_ENUM_MEMBER(DVBPESProtocolWrapper, Flags,
101 (CHECK_CRC)(ONESHOT)(IMMEDIATE_START)(KERNEL_CLIENT));
104 //-/////////////////////////////////////////////////////////////////////////////////////////////////
105 #include "DVBProtocolWrapper.cci"
106 //#include "DVBProtocolWrapper.ct"
107 //#include "DVBProtocolWrapper.cti"