Go to the documentation of this file.
2 #ifndef RECORDERBASE_H_
3 #define RECORDERBASE_H_
7 #include <QWaitCondition>
26 #include "libavcodec/avcodec.h"
62 m_videoFrameRate = rate;
63 m_ntscFrameRate = (29.96 <= rate && 29.98 >= rate);
92 virtual void SetOption(
const QString &name,
const QString &value);
98 virtual void SetOption(
const QString &name,
int value);
105 { SetOption(name,
static_cast<int>(value)); }
113 virtual void SetVideoFilters(QString &filters) = 0;
122 const QString &videodev,
123 const QString &audiodev,
124 const QString &vbidev) = 0;
141 virtual void Initialize(
void) = 0;
147 void run(
void)
override = 0;
154 virtual void Reset(
void) = 0;
157 virtual bool IsErrored(
void) = 0;
164 virtual long long GetFramesWritten(
void) = 0;
174 virtual int GetVideoFd(
void) = 0;
190 long long GetKeyframePosition(
long long desired)
const;
191 bool GetKeyframePositions(
193 bool GetKeyframeDurations(
196 virtual void StopRecording(
void);
197 virtual bool IsRecording(
void);
198 virtual bool IsRecordingRequested(
void);
204 virtual void Pause(
bool clear =
true);
205 virtual void Unpause(
void);
206 virtual bool IsPaused(
bool holding_lock =
false)
const;
207 virtual bool WaitForPause(std::chrono::milliseconds
timeout = 1s);
215 virtual bool CheckForRingBufferSwitch(
void);
219 void SavePositionMap(
bool force =
false,
bool finished =
false);
222 ASPECT_UNKNOWN = 0x00,
226 ASPECT_2_21_1 = 0x04,
227 ASPECT_CUSTOM = 0x05,
245 virtual bool PauseAndWait(std::chrono::milliseconds
timeout = 100ms);
247 virtual void ResetForNewFile(
void) = 0;
249 const QString&
file,
int line);
250 virtual void ClearStatistics(
void);
251 virtual void FinishRecording(
void);
260 void AspectChange(
uint aspect,
long long frame);
264 void ResolutionChange(
uint width,
uint height,
long long frame);
268 void FrameRateChange(
uint framerate, uint64_t frame);
272 void VideoScanChange(
SCAN_t scan, uint64_t frame);
276 void VideoCodecChange(AVCodecID vCodec);
280 void AudioCodecChange(AVCodecID aCodec);
284 void SetDuration(std::chrono::milliseconds duration);
288 void SetTotalFrames(uint64_t total_frames);
290 void TryWriteProgStartMark(
const frm_pos_map_t &durationDeltaCopy);
294 bool m_weMadeBuffer {
true};
297 AVCodecID m_primaryVideoCodec {AV_CODEC_ID_NONE};
298 AVCodecID m_primaryAudioCodec {AV_CODEC_ID_NONE};
299 QString m_videocodec {
"rtjpeg"};
303 bool m_ntscFrameRate {
true};
304 double m_videoFrameRate {29.97};
316 bool m_requestPause {
false};
317 bool m_paused {
false};
321 bool m_requestRecording {
false};
323 bool m_recording {
false};
343 qint64 m_estimatedProgStartMS {0};
344 long long m_lastSavedKeyframe {0};
345 long long m_lastSavedDuration {0};
361 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