doclib: changed copyright information in footer
[senf.git] / senf / Socket / Protocols / DVB / DVBProtocolWrapper.cc
1 // $Id$
2 //
3 // Copyright (C) 2007
4 // Fraunhofer Institute for Open Communication Systems (FOKUS)
5 // Competence Center NETwork research (NET), St. Augustin, GERMANY
6 //     Anton Gillert <atx@berlios.de>
7 //
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.
12 //
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.
17 //
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.
22
23 /** \file
24     \brief DVBSocketController non-inline non-template implementation */
25
26 #include "DVBProtocolWrapper.hh"
27
28 // Custom includes
29
30 #define prefix_
31 ///////////////////////////////cc.p////////////////////////////////////////
32
33 prefix_ senf::DVBSectionProtocolWrapper::DVBSectionProtocolWrapper(senf::DVBDemuxSectionHandle sh) 
34     : protocol(sh.protocol()), dir(this)
35 {
36     namespace kw = senf::console::kw;
37     dir.add("buffersize", &DVBSectionProtocolWrapper::setBufferSize)
38        .doc("Set the size of the circular buffer used for filtered data.")
39        .arg("size", "in byte");
40
41     dir.add("start", &DVBSectionProtocolWrapper::startFiltering)
42        .doc("Starts filtering");
43
44     dir.add("stop", &DVBSectionProtocolWrapper::setBufferSize)
45        .doc("Stops filtering");
46
47     dir.node().add("filter", boost::function<void (unsigned short int, unsigned, senf::console::FlagCollection<Flags>, unsigned, unsigned, unsigned)>(senf::membind(&DVBSectionProtocolWrapper::setSectionFilter, this)))
48        .arg("pid", "pid to filter")
49        .arg("filter", "filter", kw::default_value = 62, kw::default_doc = "0x3e")
50        .arg("flags", "or-able: CHECK_CRC, ONESHOT, IMMEDIATE_START, KERNEL_CLIENT", kw::default_value = DMX_IMMEDIATE_START | DMX_CHECK_CRC, kw::default_doc = "(IMMEDIATE_START CHECK_CRC)")
51        .arg("mask", "mask", kw::default_value = 0xff, kw::default_doc = "0xff")
52        .arg("mode", "mode", kw::default_value = 0, kw::default_doc = "0x00")
53        .arg("timeout", "timeout", kw::default_value = 0, kw::default_doc = "0x00")
54        .doc("Sets parameters for section filter.");
55
56     dir.add("stop", &DVBSectionProtocolWrapper::setBufferSize)
57        .doc("Stops filtering");
58 }
59
60
61 prefix_ senf::DVBPESProtocolWrapper::DVBPESProtocolWrapper(senf::DVBDemuxPESHandle sh) 
62     : protocol(sh.protocol()), dir(this) 
63 {
64     namespace kw = senf::console::kw;
65
66     dir.node().add("filter", boost::function<void ( unsigned short int, dmx_input_t, dmx_output_t, dmx_pes_type_t, senf::console::FlagCollection<Flags>)>(senf::membind(&DVBPESProtocolWrapper::setPESFilter, this)))
67        .arg("pid", "pid to filter")
68        .arg("input", "input-filter: DMX_IN_FRONTEND DMX_IN_DVR ")
69        .arg("output", "output-filter: DMX_OUT_DECODER DMX_OUT_TAP DMX_OUT_TS_TAP ")
70        .arg("pesType", "PES type: DMX_PES_AUDIO[0-3] DMX_PES_VIDEO[0-3] DMX_PES_TELETEXT[0-3], DMX_PES_SUBTITLE[0-3], DMX_PES_PCR[0-3], DMX_PES_OTHER")
71        .arg("flags", "or-able: CHECK_CRC, ONESHOT, IMMEDIATE_START, KERNEL_CLIENT", kw::default_value = DMX_IMMEDIATE_START | DMX_CHECK_CRC, kw::default_doc = "(IMMEDIATE_START CHECK_CRC)")
72        .doc("Sets parameters for PES filter.");
73
74     dir.add("start", &DVBPESProtocolWrapper::startFiltering)
75        .doc("Starts filtering");
76
77     dir.add("stop", &DVBPESProtocolWrapper::stopFiltering)
78        .doc("Stops filtering");
79 }
80
81 ///////////////////////////////cc.e////////////////////////////////////////
82 #undef prefix_