10#include <QCoreApplication>
13#include <QRecursiveMutex>
20#include <QWaitCondition>
61using tctype_arr = std::array<std::chrono::milliseconds,TCTYPESMAX>;
109 virtual int OpenFile(
int Retries = 4);
110 virtual bool InitVideo(
void);
111 virtual void ReinitVideo(
bool ForceUpdate);
112 virtual void InitFrameInterval();
115 void SetLength(std::chrono::seconds len) { m_totalLength = len; }
116 void SetFramesPlayed(uint64_t played);
118 void SetWatchingRecording(
bool mode);
119 void SetKeyframeDistance(
int keyframedistance);
120 virtual void SetVideoParams(
int w,
int h,
double fps,
float aspect,
121 bool ForceUpdate,
int ReferenceFrames,
123 const QString& codecName = QString());
124 void SetFileLength(std::chrono::seconds total,
int frames);
125 void SetDuration(std::chrono::seconds duration);
126 void SetFrameRate(
double fps);
134 int GetFreeVideoFrames(
void)
const;
140 std::chrono::seconds
GetLength(
void)
const {
return m_totalLength; }
142 uint64_t GetCurrentFrameCount(
void)
const;
144 virtual uint64_t GetBookmark(
void);
145 QString GetError(
void)
const;
146 QString GetEncodingType(
void)
const;
147 QString GetXDS(
const QString &key)
const;
153 bool IsErrored(
void)
const;
154 bool IsPlaying(std::chrono::milliseconds wait_in_msec = 0ms,
155 bool wait_for =
true)
const;
157 bool IsReallyNearEnd(
void)
const;
158 bool IsNearEnd(
void);
159 bool HasTVChainNext(
void)
const;
160 bool IsWatchingInprogress(
void)
const;
178 virtual void ReleaseNextVideoFrame(
MythVideoFrame *buffer, std::chrono::milliseconds timecode,
181 void DiscardVideoFrames(
bool KeyFrame,
bool Flushed);
184 virtual bool HasReachedEof(
void)
const;
185 void SetDisablePassThrough(
bool disabled);
186 void ForceSetupAudioStream(
void);
189 virtual bool PrepareAudioSample(std::chrono::milliseconds &timecode);
198 void EnableForcedSubtitles(
bool enable);
209 void FileChangedCallback();
212 virtual int GetNumChapters(
void);
213 virtual int GetCurrentChapter(
void);
214 virtual void GetChapterTimes(QList<std::chrono::seconds> ×);
233 void SaveTotalDuration(
void);
234 void ResetTotalDuration(
void);
244 void SaveTotalFrames(
void);
245 void SetErrored(
const QString &reason);
249 void OpenDummy(
void);
252 virtual long long CalcMaxFFTime(
long long ff,
bool setjump =
true)
const;
253 long long CalcRWTime(
long long rw)
const;
254 std::chrono::milliseconds TranslatePositionFrameToMs(uint64_t position,
255 bool use_cutlist)
const;
257 bool use_cutlist)
const {
258 return m_deleteMap.TranslatePositionMsToFrame(position,
266 return m_deleteMap.TranslatePositionAbsToRel(position);
269 return m_deleteMap.TranslatePositionRelToAbs(position);
272 return TranslatePositionFrameToMs(position, use_cutlist).count() / 1000.0F;
274 uint64_t FindFrame(
float offset,
bool use_cutlist)
const;
278 { m_commBreakMap.SetAutoCommercialSkip(autoskip, m_framesPlayed); }
280 { m_commBreakMap.SkipCommercials(direction); }
283 {
return m_commBreakMap.GetAutoCommercialSkip(); }
286 virtual void ResetPlaying(
bool resetframes =
true);
287 virtual void StopPlaying(
void);
290 bool PauseDecoder(
void);
291 void UnpauseDecoder(
void);
293 bool Play(
float speed = 1.0,
bool normal =
true,
bool unpauseaudio =
true);
296 virtual bool FastForward(
float seconds);
297 virtual bool Rewind(
float seconds);
298 virtual bool JumpToFrame(uint64_t frame);
301 void JumpChapter(
int chapter);
304 virtual bool PrebufferEnoughFrames(
int min_buffers = 0);
305 void SetBuffering(
bool new_buffering);
306 virtual void VideoEnd(
void);
307 virtual void DecoderStart(
bool start_paused);
308 virtual void DecoderLoop(
bool pause);
309 virtual void DecoderEnd(
void);
310 virtual void DecoderPauseCheck(
void);
311 virtual void AudioEnd(
void);
315 bool IsInDelete(uint64_t frame);
322 void SetPlaying(
bool is_playing);
323 void ResetErrored(
void);
326 void PauseVideo(
void);
327 void UnpauseVideo(
void);
328 void PauseBuffer(
void);
329 void UnpauseBuffer(
void);
336 virtual void DoFFRewSkip(
void);
337 bool DecoderGetFrame(
DecodeType decodetype,
bool unsafe =
false);
341 bool UpdateFFRewSkip(
float ffrewScale = 1.0F);
342 virtual void ChangeSpeed(
void);
344 bool DoFastForward(uint64_t frames,
double inaccuracy);
345 bool DoRewind(uint64_t frames,
double inaccuracy);
346 void DoJumpToFrame(uint64_t frame,
double inaccuracy);
349 void WaitForSeek(uint64_t frame, uint64_t seeksnap_wanted);
350 void ClearAfterSeek(
bool clearvideobuffers =
true);
353 virtual bool DoJumpChapter(
int chapter);
354 virtual int64_t GetChapter(
int chapter);
357 void WrapTimecode(std::chrono::milliseconds &timecode,
TCTypes tc_type);
367 QThread *m_playerThread {
nullptr};
369 int m_playerThreadId {0};
381 int64_t m_decoderSeek {-1};
382 bool m_totalDecoderPause {
false};
383 bool m_decoderPaused {
false};
384 bool m_inJumpToProgramPause {
false};
385 bool m_pauseDecoder {
false};
386 bool m_unpauseDecoder {
false};
387 bool volatile m_killDecoder {
false};
388 bool m_decodeOneFrame {
false};
389 bool m_renderOneFrame {
false};
390 bool m_needNewPauseFrame {
false};
391 bool m_bufferPaused {
false};
392 bool m_videoPaused {
false};
393 bool m_allPaused {
false};
394 bool m_playing {
false};
402 bool m_liveTV {
false};
403 bool m_watchingRecording {
false};
404 bool m_transcoding {
false};
405 bool m_hasFullPositionMap {
false};
406 mutable bool m_limitKeyRepeat {
false};
409 int m_jumpChapter {0};
412 uint64_t m_bookmarkSeek {0};
418 long long m_ffTime {0};
422 int m_videobufRetries {0};
423 uint64_t m_framesPlayed {0};
424 uint64_t m_totalFrames {0};
425 std::chrono::seconds m_totalLength {0s};
426 std::chrono::seconds m_totalDuration {0s};
427 long long m_rewindTime {0};
428 std::chrono::milliseconds m_latestVideoTimecode {-1ms};
429 std::chrono::milliseconds m_latestAudioTimecode {-1ms};
435 double m_videoFrameRate {29.97};
438 QSize m_videoDispDim {0,0};
439 QSize m_videoDim {0,0};
440 int m_maxReferenceFrames {0};
441 float m_videoAspect {4.0F / 3.0F};
442 float m_forcedVideoAspect {-1};
448 bool m_buffering {
false};
455 int m_ttPageNum {0x888};
462 bool m_captionsEnabledbyDefault {
false};
463 bool m_enableForcedSubtitles {
false};
464 bool m_disableForcedSubtitles {
false};
465 bool m_allowForcedSubtitles {
true};
476 bool m_forcePositionMapSync {
false};
483 float m_nextPlaySpeed {1.0F};
484 float m_playSpeed {1.0F};
485 std::chrono::microseconds m_frameInterval
487 int m_fpsMultiplier {1};
489 int m_ffrewAdjust {0};
490 float m_ffrewScale {1.0F};
491 bool m_fileChanged {
false};
492 bool m_nextNormalSpeed {
true};
493 bool m_normalSpeed {
true};
497 std::chrono::milliseconds m_savedAudioTimecodeOffset {0ms};
500 bool m_isDummy {
false};
503 int m_bufferingCounter {0};
507 void syncWithAudioStretch();
508 bool m_disablePassthrough {
false};
This is the interface between an MHEG engine and a MythTV TV object.
virtual CC708Reader * GetCC708Reader(uint=0)
DecoderBase * GetDecoder(void)
Returns the stream decoder currently in use.
QMutex m_decoderPauseLock
virtual bool PrevTitle(void)
float GetNextPlaySpeed(void) const
virtual int GetNumAngles(void) const
static const double kInaccuracyFull
uint64_t GetTotalFrameCount(void) const
bool FlagIsSet(PlayerFlags arg)
uint64_t TranslatePositionAbsToRel(uint64_t position) const
CommSkipMode GetAutoCommercialSkip(void)
QSize GetVideoSize(void) const
uint64_t TranslatePositionMsToFrame(std::chrono::milliseconds position, bool use_cutlist) const
virtual QString GetTitleName(int) const
virtual int GetNumTitles(void) const
virtual QString GetAngleName(int) const
virtual std::chrono::seconds GetTitleDuration(int) const
uint64_t TranslatePositionRelToAbs(uint64_t position) const
virtual InteractiveTV * GetInteractiveTV()
static const double kInaccuracyNone
bool AtNormalSpeed(void) const
virtual int GetCurrentAngle(void) const
QRecursiveMutex m_decoderChangeLock
QWaitCondition m_decoderThreadPause
static const int kNightModeContrastAdjustment
virtual bool NextAngle(void)
static const double kInaccuracyEditor
const DecoderBase * GetDecoder(void) const
Returns the stream decoder currently in use.
CommBreakMap m_commBreakMap
void SeekingSlow(int Count)
TeletextReader m_ttxReader
virtual int GetCurrentTitle(void) const
QSize GetVideoBufferSize(void) const
void SkipCommercials(int direction)
MythVideoOutput * GetVideoOutput(void)
float GetVideoAspect(void) const
bool IsPaused(void) const
void PauseChanged(bool Paused)
QRecursiveMutex m_decoderLock
Lock for next_play_speed and next_normal_speed.
uint64_t GetFramesPlayed(void) const
QWaitCondition m_playingWaitCond
void RequestResetCaptions()
void SetLength(std::chrono::seconds len)
static const double kSeekToEndOffset
PlayerFlags m_playerFlags
virtual bool IsInStillFrame() const
bool GetLimitKeyRepeat(void) const
int GetFFRewSkip(void) const
MythPlayerAVSync m_avSync
virtual void tracksChanged(uint TrackType)
virtual bool PrevAngle(void)
virtual CC608Reader * GetCC608Reader(uint=0)
float GetPlaySpeed(void) const
float ComputeSecs(uint64_t position, bool use_cutlist) const
SubtitleReader m_subReader
QWaitCondition m_decoderThreadUnpause
virtual SubtitleReader * GetSubReader(uint=0)
bool GetEditMode(void) const
virtual bool SwitchAngle(int)
bool GetAllowForcedSubtitles(void) const
static const int kNightModeBrightenssAdjustment
virtual bool SwitchTitle(int)
virtual bool NextTitle(void)
std::chrono::seconds GetLength(void) const
AudioPlayer * GetAudio(void)
void SetAutoCommercialSkip(CommSkipMode autoskip)
QString m_codecName
Codec Name - used by playback profile.
float GetFrameRate(void) const
QString m_errorMsg
Reason why NVP exited with a error.
virtual TeletextReader * GetTeletextReader(uint=0)
static const double kInaccuracyDefault
static const VideoFrameTypes kDefaultRenderFormats
Holds information on recordings and videos.
std::vector< char > TestBufferVec
std::enable_if_t< std::is_floating_point_v< T >, std::chrono::microseconds > microsecondsFromFloat(T value)
Helper function for convert a floating point number to a duration.
std::vector< VideoFrameType > VideoFrameTypes
std::array< std::chrono::milliseconds, TCTYPESMAX > tctype_arr
void(*)(int, void *) StatusCallback
static constexpr size_t TCTYPESMAX
def scan(profile, smoonURL, gate)
QMap< uint64_t, MarkTypes > frm_dir_map_t
Frame # -> Mark map.
QMap< long long, long long > frm_pos_map_t
Frame # -> File offset map.