File: dvbsddevice.c

package info (click to toggle)
vdr-plugin-dvbsddevice 2.2.0-9
  • links: PTS, VCS
  • area: main
  • in suites: bullseye, buster
  • size: 128 kB
  • sloc: ansic: 989; makefile: 42
file content (61 lines) | stat: -rw-r--r-- 1,575 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
/*
 * dvbsddevice.c: A plugin for the Video Disk Recorder
 *
 * See the README file for copyright information and how to reach the author.
 *
 * $Id: dvbsddevice.c 4.0 2015/02/17 13:11:55 kls Exp $
 */

#include <getopt.h>
#include <vdr/plugin.h>
#include "dvbsdffdevice.h"

static const char *VERSION        = "2.2.0";
static const char *DESCRIPTION    = "SD Full Featured DVB device";

class cPluginDvbsddevice : public cPlugin {
private:
  cDvbSdFfDeviceProbe *probe;
public:
  cPluginDvbsddevice(void);
  virtual ~cPluginDvbsddevice();
  virtual const char *Version(void) { return VERSION; }
  virtual const char *Description(void) { return DESCRIPTION; }
  virtual const char *CommandLineHelp(void);
  virtual bool ProcessArgs(int argc, char *argv[]);
  };

cPluginDvbsddevice::cPluginDvbsddevice(void)
{
  probe = new cDvbSdFfDeviceProbe;
}

cPluginDvbsddevice::~cPluginDvbsddevice()
{
  delete probe;
}

const char *cPluginDvbsddevice::CommandLineHelp(void)
{
  return "  -o        --outputonly   do not receive, just use as output device\n";
}

bool cPluginDvbsddevice::ProcessArgs(int argc, char *argv[])
{
  static struct option long_options[] = {
       { "outputonly", no_argument, NULL, 'o' },
       { NULL,         no_argument, NULL,  0  }
     };

  int c;
  while ((c = getopt_long(argc, argv, "o", long_options, NULL)) != -1) {
        switch (c) {
          case 'o': probe->SetOutputOnly(true);
                    break;
          default:  return false;
          }
        }
  return true;
}

VDRPLUGINCREATOR(cPluginDvbsddevice); // Don't touch this!