MythTV  master
v4l2encrecorder.h
Go to the documentation of this file.
1 // -*- Mode: c++ -*-
2 /*
3  * Copyright (C) John Poet 2013
4  *
5  * Copyright notice is in v4l2recorder.cpp of the MythTV project.
6  */
7 
8 #ifndef _V4L2encRecorder_H_
9 #define _V4L2encRecorder_H_
10 
11 // MythTV includes
12 #include "v4l2encstreamhandler.h"
13 #include "v4lrecorder.h"
14 #include "dtvrecorder.h"
15 
16 class RecordingProfile;
17 class V4LChannel;
18 class QString;
19 class TVRec;
20 
30 {
31  public:
32  V4L2encRecorder(TVRec *rec, V4LChannel *channel);
33 
34  void run(void) override; // RecorderBase
35 
36  bool Open(void);
37  bool IsOpen(void) const { return m_streamHandler; }
38  void Close(void);
39  void StartNewFile(void) override; // RecorderBase
40 
41  bool PauseAndWait(int timeout = 500) override; // RecorderBase
42 
43  protected:
44  bool StartEncoding(void);
45  bool StopEncoding(void);
46 
47  void SetIntOption(RecordingProfile *profile, const QString &name);
48  void SetStrOption(RecordingProfile *profile, const QString &name);
50  const QString &videodev,
51  const QString &audiodev,
52  const QString &vbidev) override; // DTVRecorder
53 
54  private:
55  V4LChannel *m_channel {nullptr};
57 };
58 
59 #endif // _V4L2enc_RECORDER_H_
This is a specialization of DTVRecorder used to handle streams from V4L2 recorders.
V4L2encRecorder(TVRec *rec, V4LChannel *channel)
void SetOptionsFromProfile(RecordingProfile *profile, const QString &videodev, const QString &audiodev, const QString &vbidev) override
Sets basic recorder options.
void StartNewFile(void) override
bool StartEncoding(void)
void run(void) override
run() starts the recording process, and does not exit until the recording is complete.
void SetIntOption(RecordingProfile *profile, const QString &name)
V4L2encStreamHandler * m_streamHandler
bool StopEncoding(void)
Abstract base class for Video4Linux based recorders.
Definition: v4lrecorder.h:24
This is the coordinating class of the Recorder Subsystem.
Definition: tv_rec.h:142
Implements tuning for TV cards using the V4L driver API, both versions 1 and 2.
Definition: v4lchannel.h:35
V4LChannel * m_channel
bool IsOpen(void) const
bool PauseAndWait(int timeout=500) override
If m_requestPause is true, sets pause and blocks up to timeout milliseconds or until unpaused,...
void SetStrOption(RecordingProfile *profile, const QString &name)