DVBDemuxSocketProtocol.cc

Go to the documentation of this file.
00001 // $Id: DVBDemuxSocketProtocol.cc 1742 2010-11-04 14:51:56Z g0dil $
00002 //
00003 // Copyright (C) 2007
00004 // Fraunhofer (FOKUS)
00005 // Competence Center NETwork research (NET), St. Augustin, GERMANY
00006 //     Thorsten Horstmann <tho@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 "DVBDemuxSocketProtocol.hh"
00027 //#include "DVBDemuxSocketProtocol.ih"
00028 
00029 // Custom includes
00030 #include <sys/socket.h>
00031 #include <iostream>
00032 #include <string>
00033 #include <sys/ioctl.h>
00034 #include <linux/sockios.h>
00035 #include <senf/Socket/SocketHandle.hh>
00036 
00037 //#include "DVBDemuxSocketProtocol.mpp"
00038 #define prefix_
00039 //-/////////////////////////////////////////////////////////////////////////////////////////////////
00040 
00041 prefix_ void senf::DVBDemuxSocketProtocol::setBufferSize(unsigned long size)
00042     const
00043 {
00044     if (::ioctl(fd(), DMX_SET_BUFFER_SIZE, size) < 0)
00045         SENF_THROW_SYSTEM_EXCEPTION("")
00046               << "Could not set the size of the buffer on DVB adapter. requested size: "
00047               << size << ".";
00048 }
00049 
00050 prefix_ void senf::DVBDemuxSocketProtocol::startFiltering()
00051     const
00052 {
00053     if (::ioctl(fd(), DMX_START) < 0)
00054         SENF_THROW_SYSTEM_EXCEPTION("Could not start filtering operation on DVB adapter.");
00055 }
00056 
00057 prefix_ void senf::DVBDemuxSocketProtocol::stopFiltering()
00058     const
00059 {
00060     if (::ioctl(fd(), DMX_STOP) < 0)
00061         SENF_THROW_SYSTEM_EXCEPTION("Could not stop filtering operation on DVB adapter.");
00062 }
00063 
00064 prefix_ bool senf::DVBDemuxSocketProtocol::eof()
00065     const
00066 {
00067     return false;
00068 }
00069 
00070 //-/////////////////////////////////////////////////////////////////////////////////////////////////
00071 #undef prefix_
00072 //#include "DVBDemuxSocketProtocol.mpp"
00073 
00074 
00075 // Local Variables:
00076 // mode: c++
00077 // fill-column: 100
00078 // c-file-style: "senf"
00079 // indent-tabs-mode: nil
00080 // ispell-local-dictionary: "american"
00081 // compile-command: "scons -u test"
00082 // comment-column: 40
00083 // End: