File: ffmpeg.h

package info (click to toggle)
vdr-plugin-live 3.5.2-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 6,116 kB
  • sloc: cpp: 12,988; javascript: 3,220; makefile: 241; sh: 40
file content (48 lines) | stat: -rw-r--r-- 892 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
#ifndef VDR_LIVE_THREAD_H
#define VDR_LIVE_THREAD_H

#include <vdr/thread.h>
#include <string>

namespace vdrlive {

class FFmpegThread : public cThread {
public:
  FFmpegThread();
  ~FFmpegThread();

  void StartFFmpeg(std::string s, std::string url, std::string tag);
  void Stop();
  void Touch();

protected:
  void Action();

private:
  cCondWait cw;
  bool touch = false;
  std::string targetUrl;
  std::string targetTag;
  std::string session;
};

// cPipe2 implements a pipe that closes all unnecessary file descriptors in
// the child process. This is an improved variant of the vdr::cPipe

class cPipe2 {
private:
  pid_t pid;
  bool terminated = false;
  FILE *f;
public:
  cPipe2(void);
  ~cPipe2();
  operator FILE* () { return f; }
  bool Open(const char *Command, const char *Mode);
  int Check(void);
  int Close(void);
};

} // namespace vdrlive

#endif // VDR_LIVE_THREAD_H