DVBProtocolWrapper.cc

Go to the documentation of this file.
00001 // $Id: DVBProtocolWrapper.cc 1772 2011-03-10 12:45:21Z tho $
00002 //
00003 // Copyright (C) 2007
00004 // Fraunhofer (FOKUS)
00005 // Competence Center NETwork research (NET), St. Augustin, GERMANY
00006 //     Anton Gillert <atx@berlios.de>
00007 //
00008 // This program is free software; you can redistribute it and/or modify
00009 // it under the terms of the GNU General Public License as published by
00010 // the Free Software Foundation; either version 2 of the License, or
00011 // (at your option) any later version.
00012 //
00013 // This program is distributed in the hope that it will be useful,
00014 // but WITHOUT ANY WARRANTY; without even the implied warranty of
00015 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00016 // GNU General Public License for more details.
00017 //
00018 // You should have received a copy of the GNU General Public License
00019 // along with this program; if not, write to the
00020 // Free Software Foundation, Inc.,
00021 // 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
00022 
00026 #include "DVBProtocolWrapper.hh"
00027 
00028 // Custom includes
00029 #include <senf/Utils/Console/ParsedCommand.hh>
00030 #include <senf/Utils/Console/Utility.hh>
00031 
00032 #define prefix_
00033 //-/////////////////////////////////////////////////////////////////////////////////////////////////
00034 
00035 prefix_ senf::DVBSectionProtocolWrapper::DVBSectionProtocolWrapper(senf::DVBDemuxSectionHandle sh)
00036     : protocol(sh.protocol()), dir(this)
00037 {
00038     namespace kw = console::kw;
00039     namespace fty = console::factory;
00040 
00041     dir.add("buffersize", fty::Command(&DVBSectionProtocolWrapper::setBufferSize, this)
00042             .doc("Set the size of the circular buffer used for filtered data.")
00043             .arg("size", "in byte") );
00044 
00045     dir.add("start", fty::Command(&DVBSectionProtocolWrapper::startFiltering, this)
00046             .doc("Starts filtering") );
00047 
00048     dir.add("stop", fty::Command(&DVBSectionProtocolWrapper::setBufferSize, this)
00049             .doc("Stops filtering") );
00050 
00051     dir.add("filter",
00052             fty::Command<void (unsigned short int,
00053                                     unsigned,
00054                                     senf::console::FlagCollection<Flags>,
00055                                     unsigned,
00056                                     unsigned,
00057                                     unsigned)
00058             >(&DVBSectionProtocolWrapper::setSectionFilter, this)
00059             .arg("pid", "pid to filter")
00060             .arg("filter", "filter",
00061                  kw::default_value = 62,
00062                  kw::default_doc = "0x3e")
00063             .arg("flags", "or-able: CHECK_CRC, ONESHOT, IMMEDIATE_START, KERNEL_CLIENT",
00064                  kw::default_value = DMX_IMMEDIATE_START | DMX_CHECK_CRC,
00065                  kw::default_doc = "(IMMEDIATE_START CHECK_CRC)")
00066             .arg("mask", "mask",
00067                  kw::default_value = 0xff,
00068                  kw::default_doc = "0xff")
00069             .arg("mode", "mode",
00070                  kw::default_value = 0,
00071                  kw::default_doc = "0x00")
00072             .arg("timeout", "timeout",
00073                  kw::default_value = 0,
00074                  kw::default_doc = "0x00")
00075             .doc("Sets parameters for section filter.") );
00076 
00077     dir.add("stop", fty::Command(&DVBSectionProtocolWrapper::setBufferSize, this)
00078             .doc("Stops filtering") );
00079 }
00080 
00081 
00082 prefix_ senf::DVBPESProtocolWrapper::DVBPESProtocolWrapper(senf::DVBDemuxPESHandle sh)
00083     : protocol(sh.protocol()), dir(this)
00084 {
00085     namespace kw = console::kw;
00086     namespace fty = console::factory;
00087 
00088     dir.add("filter",
00089             fty::Command<void (unsigned short int,
00090                                     dmx_input_t,
00091                                     dmx_output_t,
00092                                     dmx_pes_type_t,
00093                                     senf::console::FlagCollection<Flags>)
00094             >(&DVBPESProtocolWrapper::setPESFilter, this)
00095             .arg("pid", "pid to filter")
00096             .arg("input", "input-filter: DMX_IN_FRONTEND DMX_IN_DVR ")
00097             .arg("output", "output-filter: DMX_OUT_DECODER DMX_OUT_TAP DMX_OUT_TS_TAP ")
00098             .arg("pesType", "PES type: DMX_PES_AUDIO[0-3] DMX_PES_VIDEO[0-3] "
00099                             "DMX_PES_TELETEXT[0-3], DMX_PES_SUBTITLE[0-3], DMX_PES_PCR[0-3], "
00100                             "DMX_PES_OTHER")
00101             .arg("flags", "or-able: CHECK_CRC, ONESHOT, IMMEDIATE_START, KERNEL_CLIENT",
00102                  kw::default_value = DMX_IMMEDIATE_START | DMX_CHECK_CRC,
00103                  kw::default_doc = "(IMMEDIATE_START CHECK_CRC)")
00104             .doc("Sets parameters for PES filter.") );
00105 
00106     dir.add("start", fty::Command(&DVBPESProtocolWrapper::startFiltering, this)
00107             .doc("Starts filtering") );
00108 
00109     dir.add("stop", fty::Command(&DVBPESProtocolWrapper::stopFiltering, this)
00110             .doc("Stops filtering") );
00111 }
00112 
00113 //-/////////////////////////////////////////////////////////////////////////////////////////////////
00114 #undef prefix_
00115 
00116 
00117 // Local Variables:
00118 // mode: c++
00119 // fill-column: 100
00120 // c-file-style: "senf"
00121 // indent-tabs-mode: nil
00122 // ispell-local-dictionary: "american"
00123 // compile-command: "scons -u test"
00124 // comment-column: 40
00125 // End: