Go to the documentation of this file.
2 #ifndef RECORDERBASE_H_
3 #define RECORDERBASE_H_
7 #include <QWaitCondition>
26 #include "libavcodec/avcodec.h"
60 m_videoFrameRate = rate;
61 m_ntscFrameRate = (29.96 <= rate && 29.98 >= rate);
90 virtual void SetOption(
const QString &name,
const QString &value);
96 virtual void SetOption(
const QString &name,
int value);
103 { SetOption(name,
static_cast<int>(value)); }
111 virtual void SetVideoFilters(QString &filters) = 0;
120 const QString &videodev,
121 const QString &audiodev,
122 const QString &vbidev) = 0;
139 virtual void Initialize(
void) = 0;
145 void run(
void)
override = 0;
152 virtual void Reset(
void) = 0;
155 virtual bool IsErrored(
void) = 0;
162 virtual long long GetFramesWritten(
void) = 0;
172 virtual int GetVideoFd(
void) = 0;
188 long long GetKeyframePosition(
long long desired)
const;
189 bool GetKeyframePositions(
191 bool GetKeyframeDurations(
194 virtual void StopRecording(
void);
195 virtual bool IsRecording(
void);
196 virtual bool IsRecordingRequested(
void);
202 virtual void Pause(
bool clear =
true);
203 virtual void Unpause(
void);
204 virtual bool IsPaused(
bool holding_lock =
false)
const;
205 virtual bool WaitForPause(std::chrono::milliseconds
timeout = 1s);
213 virtual bool CheckForRingBufferSwitch(
void);
217 void SavePositionMap(
bool force =
false,
bool finished =
false);
220 ASPECT_UNKNOWN = 0x00,
224 ASPECT_2_21_1 = 0x04,
225 ASPECT_CUSTOM = 0x05,
243 virtual bool PauseAndWait(std::chrono::milliseconds
timeout = 100ms);
245 virtual void ResetForNewFile(
void) = 0;
247 const QString&
file,
int line);
248 virtual void ClearStatistics(
void);
249 virtual void FinishRecording(
void);
258 void AspectChange(
uint aspect,
long long frame);
262 void ResolutionChange(
uint width,
uint height,
long long frame);
266 void FrameRateChange(
uint framerate, uint64_t frame);
270 void VideoScanChange(
SCAN_t scan, uint64_t frame);
274 void VideoCodecChange(AVCodecID vCodec);
278 void AudioCodecChange(AVCodecID aCodec);
282 void SetDuration(std::chrono::milliseconds duration);
286 void SetTotalFrames(uint64_t total_frames);
288 void TryWriteProgStartMark(
const frm_pos_map_t &durationDeltaCopy);
292 bool m_weMadeBuffer {
true};
295 AVCodecID m_primaryVideoCodec {AV_CODEC_ID_NONE};
296 AVCodecID m_primaryAudioCodec {AV_CODEC_ID_NONE};
297 QString m_videocodec {
"rtjpeg"};
301 bool m_ntscFrameRate {
true};
302 double m_videoFrameRate {29.97};
314 bool m_requestPause {
false};
315 bool m_paused {
false};
319 bool m_requestRecording {
false};
321 bool m_recording {
false};
341 qint64 m_estimatedProgStartMS {0};
342 long long m_lastSavedKeyframe {0};
343 long long m_lastSavedDuration {0};
359 static constexpr std::chrono::milliseconds kTimeOfLatestDataIntervalTarget { 5s };
MythTimer m_positionMapTimer
MythTimer m_timeOfLatestDataTimer
void SetPositionMapType(MarkTypes type)
Set seektable type.
QDateTime m_timeOfLatestData
A QElapsedTimer based timer to replace use of QTime as a timer.
Holds information on a TV Program one might wish to record.
QAtomicInt m_timeOfLatestDataPacketInterval
def scan(profile, smoonURL, gate)
QWaitCondition m_recordingWait
frm_pos_map_t m_durationMapDelta
MythTimer m_ringBufferCheckTimer
Abstract class providing a generic interface to tuning hardware.
RecordingGaps m_recordingGaps
void SetBoolOption(const QString &name, bool value)
Set an specific boolean option.
double GetFrameRate(void) const
Returns the latest frame rate.
static void clear(SettingsMap &cache, SettingsMap &overrides, const QString &myKey)
void run(const QString &name, Class *object, void(Class::*fn)())
frm_pos_map_t m_durationMap
QMutex m_nextRingBufferLock
frm_pos_map_t m_positionMap
QMap< long long, long long > frm_pos_map_t
Frame # -> File offset map.
frm_pos_map_t m_positionMapDelta
void SetFrameRate(double rate)
Sets the video frame rate.
QWaitCondition m_pauseWait
QDateTime m_timeOfFirstData
virtual void StartNewFile(void)
QAtomicInt m_timeOfFirstDataIsSet
This is the abstract base class for supporting recorder hardware.
This is the coordinating class of the Recorder Subsystem.
C++ wrapper for FFmpeg libavutil AVRational.
QWaitCondition m_unpauseWait
QList< RecordingGap > RecordingGaps
QAtomicInt m_timeOfLatestDataCount