Go to the documentation of this file.
2 #ifndef RECORDERBASE_H_
3 #define RECORDERBASE_H_
7 #include <QWaitCondition>
23 #include "libavcodec/avcodec.h"
84 m_videoFrameRate = rate;
85 m_ntscFrameRate = (29.96 <= rate && 29.98 >= rate);
86 m_frameRate =
FrameRate(lround(rate * 100), 100);
114 virtual void SetOption(
const QString &name,
const QString &value);
120 virtual void SetOption(
const QString &name,
int value);
127 { SetOption(name,
static_cast<int>(value)); }
135 virtual void SetVideoFilters(QString &filters) = 0;
144 const QString &videodev,
145 const QString &audiodev,
146 const QString &vbidev) = 0;
163 virtual void Initialize(
void) = 0;
169 void run(
void)
override = 0;
176 virtual void Reset(
void) = 0;
179 virtual bool IsErrored(
void) = 0;
186 virtual long long GetFramesWritten(
void) = 0;
196 virtual int GetVideoFd(
void) = 0;
212 long long GetKeyframePosition(
long long desired)
const;
213 bool GetKeyframePositions(
215 bool GetKeyframeDurations(
218 virtual void StopRecording(
void);
219 virtual bool IsRecording(
void);
220 virtual bool IsRecordingRequested(
void);
226 virtual void Pause(
bool clear =
true);
227 virtual void Unpause(
void);
228 virtual bool IsPaused(
bool holding_lock =
false)
const;
229 virtual bool WaitForPause(std::chrono::milliseconds
timeout = 1s);
237 virtual bool CheckForRingBufferSwitch(
void);
241 void SavePositionMap(
bool force =
false,
bool finished =
false);
244 ASPECT_UNKNOWN = 0x00,
248 ASPECT_2_21_1 = 0x04,
249 ASPECT_CUSTOM = 0x05,
267 virtual bool PauseAndWait(std::chrono::milliseconds
timeout = 100ms);
269 virtual void ResetForNewFile(
void) = 0;
271 const QString&
file,
int line);
272 virtual void ClearStatistics(
void);
273 virtual void FinishRecording(
void);
282 void AspectChange(
uint aspect,
long long frame);
286 void ResolutionChange(
uint width,
uint height,
long long frame);
290 void FrameRateChange(
uint framerate, uint64_t frame);
294 void VideoScanChange(
SCAN_t scan, uint64_t frame);
298 void VideoCodecChange(AVCodecID vCodec);
302 void AudioCodecChange(AVCodecID aCodec);
306 void SetDuration(std::chrono::milliseconds duration);
310 void SetTotalFrames(uint64_t total_frames);
312 void TryWriteProgStartMark(
const frm_pos_map_t &durationDeltaCopy);
316 bool m_weMadeBuffer {
true};
319 AVCodecID m_primaryVideoCodec {AV_CODEC_ID_NONE};
320 AVCodecID m_primaryAudioCodec {AV_CODEC_ID_NONE};
321 QString m_videocodec {
"rtjpeg"};
325 bool m_ntscFrameRate {
true};
326 double m_videoFrameRate {29.97};
338 bool m_requestPause {
false};
339 bool m_paused {
false};
343 bool m_requestRecording {
false};
345 bool m_recording {
false};
365 qint64 m_estimatedProgStartMS {0};
366 long long m_lastSavedKeyframe {0};
367 long long m_lastSavedDuration {0};
383 static constexpr std::chrono::milliseconds kTimeOfLatestDataIntervalTarget { 5s };
MythTimer m_positionMapTimer
MythTimer m_timeOfLatestDataTimer
void SetPositionMapType(MarkTypes type)
Set seektable type.
QDateTime m_timeOfLatestData
double toDouble(void) const
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)
bool isNonzero(void) const
QWaitCondition m_recordingWait
frm_pos_map_t m_durationMapDelta
MythTimer m_ringBufferCheckTimer
bool operator==(const FrameRate other) const
Abstract class providing a generic interface to tuning hardware.
RecordingGaps m_recordingGaps
bool operator!=(const FrameRate other) const
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)
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
FrameRate(uint n, uint d=1)
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.
QString toString(void) const
static const iso6937table * d
QWaitCondition m_unpauseWait
QList< RecordingGap > RecordingGaps
QAtomicInt m_timeOfLatestDataCount