00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00026 #include "DVBProtocolWrapper.hh"
00027
00028
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
00118
00119
00120
00121
00122
00123
00124
00125