12#include <QCoreApplication>
48#include "libavcodec/avcodec.h"
53#define LOC QString("Player(%1): ").arg(dbg_ident(this),0,36)
78 : m_playerCtx(Context),
79 m_playerThread(QThread::currentThread()),
81 m_liveTV(Context->m_tvchain),
88 m_playerThreadId = gettid();
99 uint tmp = mypage.toInt(&valid, 16);
154 LOG(VB_PLAYBACK, LOG_INFO,
LOC +
"Waited 100ms to get pause lock.");
161 return already_paused;
180 return already_paused;
186 LOG(VB_PLAYBACK, LOG_INFO,
LOC +
187 QString(
"Play(%1, normal %2, unpause audio %3)")
188 .arg(speed,5,
'f',1).arg(normal).arg(unpauseaudio));
192 LOG(VB_GENERAL, LOG_ERR,
LOC +
"Ignoring Play(), in edit mode.");
252 if (wait_in_msec == 0ms)
258 while ((wait_for !=
m_playing) && (
t.elapsed() < wait_in_msec))
261 &
m_playingLock, std::max(0ms,wait_in_msec -
t.elapsed()).count());
274 LOG(VB_GENERAL, LOG_ERR,
LOC +
"Cannot create a video renderer without a decoder.");
283 LOG(VB_GENERAL, LOG_ERR,
LOC +
"Couldn't create VideoOutput instance. Exiting..");
284 SetErrored(tr(
"Failed to initialize video output"));
294 bool aspect_only =
false;
303 LOG(VB_GENERAL, LOG_ERR,
LOC +
"Failed to Reinitialize Video. Exiting..");
304 SetErrored(tr(
"Failed to reinitialize video output"));
319 float aspect,
bool ForceUpdate,
320 int ReferenceFrames,
FrameScanType ,
const QString& codecName)
322 bool paramsChanged = ForceUpdate;
324 if (width >= 0 && height >= 0)
326 paramsChanged =
true;
328 m_videoAspect = aspect > 0.0F ? aspect :
static_cast<float>(width) / height;
331 if (!qIsNaN(fps) && fps > 0.0 && fps < 121.0)
333 paramsChanged =
true;
348 if (!codecName.isEmpty())
351 paramsChanged =
true;
354 if (ReferenceFrames > 0)
357 paramsChanged =
true;
447 int testreadsize = 2048;
452 std::chrono::milliseconds
timeout =
453 std::max(500ms * (Retries + 1), 30000ms);
456 testbuf.resize(testreadsize);
465 LOG(VB_GENERAL, LOG_ERR,
LOC +
466 QString(
"OpenFile(): Could not read first %1 bytes of '%2'")
469 SetErrored(tr(
"Could not read first %1 bytes").arg(testreadsize));
472 LOG(VB_GENERAL, LOG_WARNING,
LOC +
"OpenFile() waiting on data");
473 std::this_thread::sleep_for(50ms);
487 LOG(VB_GENERAL, LOG_ERR,
LOC +
488 QString(
"Couldn't find an A/V decoder for: '%1'")
490 SetErrored(tr(
"Could not find an A/V decoder"));
497 LOG(VB_GENERAL, LOG_ERR,
LOC +
"Could not initialize A/V decoder.");
499 SetErrored(tr(
"Could not initialize A/V decoder"));
516 LOG(VB_GENERAL, LOG_ERR, QString(
"Couldn't open decoder for: %1")
593 std::chrono::milliseconds timecode,
602 LOG(VB_PLAYBACK, LOG_DEBUG,
LOC +
"Clearing decode one");
609 LOG(VB_PLAYBACK, LOG_DEBUG,
LOC +
"Setting render one");
648 LOG(VB_PLAYBACK, LOG_DEBUG,
LOC +
"Clearing render one");
687 LOG(VB_PLAYBACK, LOG_INFO,
LOC + QString(
"SetFrameInterval Interval:%1 Speed:%2 Scan:%3 (Multiplier: %4)")
701 LOG(VB_PLAYBACK, LOG_INFO,
LOC +
"Waiting for video buffers...");
758 LOG(VB_PLAYBACK, LOG_NOTICE,
LOC +
759 "Pause to allow live tv catch up");
765 auto waited_for = std::chrono::milliseconds(
m_bufferingStart.msecsTo(QTime::currentTime()));
766 auto last_msg = std::chrono::milliseconds(
m_bufferingLastMsg.msecsTo(QTime::currentTime()));
770 LOG(VB_GENERAL, LOG_NOTICE,
LOC +
771 "To see more buffering messages use -v playback");
774 QString(
"Waited %1ms for video buffers %2")
782 LOG(VB_GENERAL, LOG_NOTICE,
LOC +
"Music Choice program detected - disabling AV Sync.");
790 LOG(VB_GENERAL, LOG_NOTICE,
LOC +
"Resetting audio buffer");
796 LOG(VB_PLAYBACK, LOG_DEBUG,
LOC +
"Forcibly clearing render one");
801 std::chrono::milliseconds msecs { 500ms };
806 LOG(VB_GENERAL, LOG_NOTICE,
LOC +
807 "Timed out waiting for frames, and"
808 "\n\t\t\tthere are not enough free frames. "
809 "Discarding buffered frames.");
818 if (waited_for > msecs)
820 LOG(VB_GENERAL, LOG_ERR,
LOC +
821 "Waited too long for decoder to fill video buffers. Exiting..");
822 SetErrored(tr(
"Video frame buffering failed too many times."));
940 LOG(VB_PLAYBACK, LOG_INFO,
LOC +
"FileChangedCallback");
946 LOG(VB_PLAYBACK, LOG_INFO,
LOC + QString(
"StopPlaying - begin"));
957 LOG(VB_PLAYBACK, LOG_INFO,
LOC + QString(
"StopPlaying - end"));
982 LOG(VB_GENERAL, LOG_WARNING,
LOC +
"Waited 100ms for decoder to pause");
1009 LOG(VB_GENERAL, LOG_WARNING,
LOC +
"Waited 100ms for decoder to unpause");
1022 LOG(VB_GENERAL, LOG_ERR,
LOC +
"Decoder thread already running");
1045 LOG(VB_PLAYBACK, LOG_INFO,
LOC +
1046 "Waited 100ms for decoder loop to stop");
1049 LOG(VB_GENERAL, LOG_ERR,
LOC +
"Failed to stop decoder loop.");
1051 LOG(VB_PLAYBACK, LOG_INFO,
LOC +
"Exited decoder loop.");
1109 std::this_thread::sleep_for(1ms);
1147 std::this_thread::sleep_for(1ms);
1183 LOG(VB_PLAYBACK, LOG_INFO,
LOC +
1184 QString(
"skip %1, adjust %2, ratio %3")
1201 long long target_frame = cur_frame + real_skip;
1207 LOG(VB_PLAYBACK, LOG_INFO,
LOC +
1208 QString(
"skip %1, adjust, %2, ratio %3")
1221 LOG(VB_PLAYBACK, LOG_DEBUG,
"Setting decode one");
1242 LOG(VB_GENERAL, LOG_ERR,
LOC +
1243 "Decoder timed out waiting for free video buffers.");
1246 SetErrored(
"Decoder timed out waiting for free video buffers.");
1250 std::this_thread::sleep_for(1ms);
1294 std::this_thread::sleep_for(1ms);
1315 uint64_t bookmark = 0;
1324 bookmark = pi->QueryStartMark();
1333 bool skip_changed =
false;
1345 LOG(VB_PLAYBACK, LOG_DEBUG,
LOC +
"Clearing render one");
1349 skip_changed =
true;
1362 LOG(VB_PLAYBACK, LOG_INFO,
LOC +
1363 QString(
"new skip %1, interval %2, scale %3")
1368 return skip_changed;
1387 LOG(VB_PLAYBACK, LOG_INFO,
LOC +
"Play speed: " +
1388 QString(
"rate: %1 speed: %2 skip: %3 => new interval %4")
1407 uint64_t number = frames + 1;
1414 uint64_t seeksnap_wanted = UINT64_MAX;
1416 seeksnap_wanted = frames * inaccuracy;
1454 long long ret = ffframes;
1475 if ((ff + secsPlayed) > secsWritten)
1484 float behind = secsWritten - secsPlayed;
1486 if (behind < maxtime)
1488 else if (behind - ff <= maxtime)
1494 if (behind < maxtime * 3)
1499 uint64_t lastFrame =
1506 float secsMax = secsWritten - (2.F * maxtime);
1509 else if (secsMax < secsPlayed + ff)
1555 uint64_t framesLeft = 0;
1562 framesLeft = (frameCount > framesRead) ? frameCount - framesRead : 0;
1563 return (framesLeft < (uint64_t)margin);
1578 if (framesLeft < (uint64_t)margin)
1582 return (framesLeft < (uint64_t)margin);
1590 uint64_t number = (frames ? frames - 1 : 0);
1596 desiredFrame = std::min(desiredFrame, endcheck);
1599 uint64_t seeksnap_wanted = UINT64_MAX;
1601 seeksnap_wanted = frames * inaccuracy;
1640 bool needclear =
false;
1651 std::this_thread::sleep_for(50ms);
1681 LOG(VB_PLAYBACK, LOG_INFO,
LOC + QString(
"ClearAfterSeek(%1)")
1682 .arg(clearvideobuffers));
1752 std::chrono::milliseconds position_ms = 0ms;
1753 auto offset_ms = std::chrono::milliseconds(llroundf(fabsf(offset) * 1000));
1755 if (std::signbit(offset))
1769 position_ms = (offset_ms > length_ms) ? 0ms : length_ms - offset_ms;
1773 position_ms = offset_ms;
1774 if (offset_ms > length_ms)
1778 (length_ms < offset_ms))
1780 long long framesWritten =
1786 position_ms = std::min(position_ms, length_ms);
1796 bool use_cutlist)
const
1799 if (position == UINT64_MAX &&
1803 if (recorderFrameRate > 0)
1804 frameRate = recorderFrameRate;
1833 int64_t desiredFrame = -1;
1837 if (chapter < 0 || chapter > total)
1843 chapter = std::max(chapter, 0);
1845 else if (chapter > total)
1848 chapter = std::min(chapter, total);
1853 LOG(VB_PLAYBACK, LOG_INFO,
LOC +
1854 QString(
"DoJumpChapter: current %1 want %2 (frame %3)")
1855 .arg(
current).arg(chapter).arg(desiredFrame));
1857 if (desiredFrame < 0)
1859 LOG(VB_PLAYBACK, LOG_ERR,
LOC + QString(
"DoJumpChapter failed."));
1886 LOG(VB_GENERAL, LOG_INFO,
LOC +
"Waited 10ms for decoder lock");
1912 LOG(VB_PLAYBACK, LOG_INFO,
LOC +
1913 QString(
"Filling position map from %1 to %2") .arg(start).arg(
"end"));
1934 LOG(VB_GENERAL, LOG_ERR,
LOC + QString(
"%1").arg(reason));
1987 LOG(VB_PLAYBACK, LOG_INFO,
LOC +
1988 QString(
"Stretch Factor %1, %2 passthru ")
2009 static QMutex s_dbgLock;
2010 static unsigned s_dbgNextIdent = 0;
2011 using DbgMapType = QHash<const MythPlayer*, unsigned>;
2012 static DbgMapType s_dbgIdent;
2014 QMutexLocker locker(&s_dbgLock);
2015 DbgMapType::iterator it = s_dbgIdent.find(player);
2016 if (it != s_dbgIdent.end())
2018 return s_dbgIdent[player] = s_dbgNextIdent++;
float GetStretchFactor(void) const
bool HasAudioOut(void) const
bool IsBufferAlmostFull(void)
void SetStretchFactor(float factor)
void SetTTPageNum(int page)
static bool SetStartChannel(uint inputid, const QString &channum)
void SetMap(const frm_dir_map_t &newMap, uint64_t framesPlayed)
void SetTracker(uint64_t framesPlayed)
virtual void SetWatchingRecording(bool mode)
long long GetFramesPlayed(void) const
virtual bool GetFrame(DecodeType Type, bool &Retry)=0
Demux, preprocess and possibly decode a frame of video/audio.
virtual void SetDisablePassThrough(bool disable)
Disables AC3/DTS pass through.
virtual QString GetXDS(const QString &) const
virtual long long GetChapter(int)
virtual void UpdateFramesPlayed(void)
void SetTranscoding(bool value)
void SetRenderFormats(const VideoFrameTypes *RenderFormats)
virtual void GetChapterTimes(QList< std::chrono::seconds > &)
void SaveTotalDuration(void)
virtual void Reset(bool reset_video_data, bool seek_reset, bool reset_file)
virtual void SetEofState(EofState eof)
void SetLiveTVMode(bool live)
long long GetFramesRead(void) const
virtual void ForceSetupAudioStream(void)
virtual int GetCurrentChapter(long long)
int GetfpsMultiplier(void) const
virtual bool DoFastForward(long long desiredFrame, bool discardFrames=true)
Skips ahead or rewinds to desiredFrame.
void SaveTotalFrames(void)
virtual MythCodecID GetVideoCodecID(void) const =0
void ResetTotalDuration(void)
virtual int GetNumChapters(void)
virtual bool SyncPositionMap(void)
Updates the position map used for skipping frames.
void SetSeekSnap(uint64_t snap)
virtual bool DoRewind(long long desiredFrame, bool discardFrames=true)
virtual int OpenFile(MythMediaBuffer *Buffer, bool novideo, TestBufferVec &testbuf)=0
virtual double GetFPS(void) const
void SetPlayerContext(PlayerContext *ctx)
void TrackerReset(uint64_t frame)
Resets the internal state tracker.
uint64_t GetLastFrame(void) const
Returns the number of the last frame in the video that is not in a cut sequence.
bool TrackerWantsToJump(uint64_t frame, uint64_t &to) const
Returns true if the given frame has passed the last cut point start and provides the frame number of ...
bool IsEditing(void) const
bool IsInDelete(uint64_t frame) const
Returns true if the given frame is deemed to be within a region that should be cut.
std::chrono::milliseconds TranslatePositionFrameToMs(uint64_t position, float fallback_framerate, bool use_cutlist) const
void LoadMap(const QString &undoMessage="")
Loads the delete map from the database.
int GetCurPos(void) const
void JumpToNext(bool up, std::chrono::seconds pos)
jump to the next (up == true) or previous (up == false) liveTV program If pos > 0: indicate the absol...
QString GetInputType(int pos=-1) const
bool isRunning(void) const
void start(QThread::Priority p=QThread::InheritPriority)
Tell MThread to start running the thread in the near future.
bool wait(std::chrono::milliseconds time=std::chrono::milliseconds::max())
Wait for the MThread to exit, with a maximum timeout.
bool IsDatabaseIgnored(void) const
/brief Returns true if database is being ignored.
void SaveSetting(const QString &key, int newValue)
QString GetSetting(const QString &key, const QString &defaultval="")
int GetNumSetting(const QString &key, int defaultval=0)
bool GetBoolSetting(const QString &key, bool defaultval=false)
void SetAVSyncMusicChoice(AudioPlayer *Audio)
void ResetAVSyncClockBase()
AVSyncAudioPausedType GetAVSyncAudioPause() const
void ResetAVSyncForLiveTV(AudioPlayer *Audio)
void SaveTotalDuration(void)
virtual bool Rewind(float seconds)
QMutex m_decoderPauseLock
void SetDuration(std::chrono::seconds duration)
virtual void ReleaseNextVideoFrame(MythVideoFrame *buffer, std::chrono::milliseconds timecode, bool wrap=true)
Places frame on the queue of frames ready for display.
void syncWithAudioStretch()
void SetEof(EofState eof)
uint64_t FindFrame(float offset, bool use_cutlist) const
static const double kInaccuracyFull
bool FlagIsSet(PlayerFlags arg)
std::chrono::microseconds m_frameInterval
always adjusted for play_speed
bool HasTVChainNext(void) const
bool m_inJumpToProgramPause
virtual void SetVideoParams(int w, int h, double fps, float aspect, bool ForceUpdate, int ReferenceFrames, FrameScanType=kScan_Ignore, const QString &codecName=QString())
virtual bool HasReachedEof(void) const
uint64_t TranslatePositionMsToFrame(std::chrono::milliseconds position, bool use_cutlist) const
bool m_captionsEnabledbyDefault
This allows us to enable captions/subtitles later if the streams are not immediately available when t...
MythPlayer(PlayerContext *Context, PlayerFlags Flags=kNoFlags)
void SetFramesPlayed(uint64_t played)
bool m_disableForcedSubtitles
MythDecoderThread * m_decoderThread
virtual void DecoderStart(bool start_paused)
void SetDecoder(DecoderBase *dec)
Sets the stream decoder, deleting any existing recorder.
void WaitForSeek(uint64_t frame, uint64_t seeksnap_wanted)
void SetWatchingRecording(bool mode)
bool UpdateFFRewSkip(float ffrewScale=1.0F)
int m_videobufRetries
How often we have tried to wait for a video output buffer and failed.
int m_ffrewAdjust
offset after last skip
virtual bool JumpToFrame(uint64_t frame)
virtual bool FastForward(float seconds)
static const double kInaccuracyNone
QRecursiveMutex m_decoderChangeLock
QWaitCondition m_decoderThreadPause
static const int kNightModeContrastAdjustment
void DoJumpToFrame(uint64_t frame, double inaccuracy)
virtual int GetNumChapters(void)
uint64_t GetCurrentFrameCount(void) const
static const double kInaccuracyEditor
const VideoFrameTypes * m_renderFormats
QString GetError(void) const
CommBreakMap m_commBreakMap
int m_fpsMultiplier
used to detect changes
virtual void AudioEnd(void)
void SeekingSlow(int Count)
long long CalcRWTime(long long rw) const
CalcRWTime(rw): rewind rw frames back.
void DiscardVideoFrames(bool KeyFrame, bool Flushed)
Places frames in the available frames queue.
virtual void ResetPlaying(bool resetframes=true)
virtual int OpenFile(int Retries=4)
virtual void InitFrameInterval()
bool IsInDelete(uint64_t frame)
virtual long long CalcMaxFFTime(long long ff, bool setjump=true) const
CalcMaxFFTime(ffframes): forward ffframes forward.
bool m_forcePositionMapSync
virtual void ReinitVideo(bool ForceUpdate)
std::chrono::seconds m_totalDuration
void ResetTotalDuration(void)
bool IsPaused(void) const
void PauseChanged(bool Paused)
bool m_disablePassthrough
bool IsPlaying(std::chrono::milliseconds wait_in_msec=0ms, bool wait_for=true) const
void SetErrored(const QString &reason)
virtual void DecoderLoop(bool pause)
QWaitCondition m_playingWaitCond
void RequestResetCaptions()
static const double kSeekToEndOffset
virtual void VideoEnd(void)
void SetFrameRate(double fps)
virtual int GetCurrentChapter(void)
void ForceSetupAudioStream(void)
bool IsNearEnd(void)
Returns true iff near end of recording.
bool IsWatchingInprogress(void) const
PlayerFlags m_playerFlags
void DeLimboFrame(MythVideoFrame *frame)
bool m_enableForcedSubtitles
bool DoGetFrame(DecodeType DecodeType)
Get one frame from the decoder.
virtual bool IsInStillFrame() const
int m_maxReferenceFrames
Number of reference frames used in the video stream.
bool IsErrored(void) const
QSize m_videoDispDim
Video (input) width & height.
bool DecoderGetFrame(DecodeType decodetype, bool unsafe=false)
virtual uint64_t GetBookmark(void)
void EnableForcedSubtitles(bool enable)
bool volatile m_killDecoder
int m_ttPageNum
VBI page to display when in PAL vbimode.
QSize m_videoDim
Video (input) buffer width & height.
void SetKeyframeDistance(int keyframedistance)
virtual bool PrebufferEnoughFrames(int min_buffers=0)
void WrapTimecode(std::chrono::milliseconds &timecode, TCTypes tc_type)
float m_ffrewScale
scale skip for large gops
MythPlayerAVSync m_avSync
void SetDisablePassThrough(bool disabled)
void SetBuffering(bool new_buffering)
void SaveTotalFrames(void)
bool IsReallyNearEnd(void) const
Returns true iff really near end of recording.
void FileChangedCallback()
void SetFileLength(std::chrono::seconds total, int frames)
virtual void DecoderEnd(void)
float m_videoAspect
Video (input) Apect Ratio.
float m_forcedVideoAspect
float ComputeSecs(uint64_t position, bool use_cutlist) const
virtual bool DoJumpChapter(int chapter)
virtual void StopPlaying(void)
QWaitCondition m_decoderThreadUnpause
double m_videoFrameRate
Video (input) Frame Rate (often inaccurate)
void ClearAfterSeek(bool clearvideobuffers=true)
This is to support seeking...
virtual void ChangeSpeed(void)
bool GetEditMode(void) const
QString GetXDS(const QString &key) const
virtual void GetChapterTimes(QList< std::chrono::seconds > ×)
long long m_ffTime
If m_ffTime>0, number of frames to seek forward.
virtual void DecoderPauseCheck(void)
std::chrono::milliseconds m_latestVideoTimecode
virtual int64_t GetChapter(int chapter)
void SetPlayingInfo(const ProgramInfo &pginfo)
void UnpauseDecoder(void)
static const int kNightModeBrightenssAdjustment
bool Play(float speed=1.0, bool normal=true, bool unpauseaudio=true)
bool m_hasFullPositionMap
uint m_vbiMode
VBI decoder to use.
void SetPlaying(bool is_playing)
virtual void CreateDecoder(TestBufferVec &TestBuffer)
PlayerContext * m_playerCtx
bool PosMapFromEnc(uint64_t start, frm_pos_map_t &posMap, frm_pos_map_t &durMap)
MythVideoFrame * GetNextVideoFrame(void)
Removes a frame from the available queue for decoding onto.
friend class MythDecoderThread
std::chrono::seconds m_totalLength
MythVideoOutput * m_videoOutput
void JumpChapter(int chapter)
bool DoRewind(uint64_t frames, double inaccuracy)
int GetFreeVideoFrames(void) const
Returns the number of frames available for decoding onto.
void SetFrameInterval(FrameScanType scan, double frame_period)
virtual bool PrepareAudioSample(std::chrono::milliseconds &timecode)
QString GetEncodingType(void) const
void SetCommBreakMap(const frm_dir_map_t &NewMap)
QString m_codecName
Codec Name - used by playback profile.
virtual void DoFFRewSkip(void)
EofState GetEof(void) const
float GetFrameRate(void) const
std::chrono::milliseconds TranslatePositionFrameToMs(uint64_t position, bool use_cutlist) const
void DiscardVideoFrame(MythVideoFrame *buffer)
Places frame in the available frames queue.
std::chrono::milliseconds m_latestAudioTimecode
QString m_errorMsg
Reason why NVP exited with a error.
static const double kInaccuracyDefault
virtual bool InitVideo(void)
bool DoFastForward(uint64_t frames, double inaccuracy)
uint m_keyframeDist
Video (input) Number of frames between key frames (often inaccurate)
A QElapsedTimer based timer to replace use of QTime as a timer.
std::chrono::milliseconds elapsed(void)
Returns milliseconds elapsed since last start() or restart()
void start(void)
starts measuring elapsed time.
std::chrono::milliseconds m_timecode
static MythVideoOutputNull * Create(QSize VideoDim, QSize VideoDispDim, float VideoAspect, MythCodecID CodecID)
bool EnoughFreeFrames()
Returns true iff enough frames are available to decode onto.
bool EnoughDecodedFrames()
Returns true iff there are plenty of decoded frames ready for display.
virtual void ReleaseFrame(MythVideoFrame *Frame)
Releases a frame from the ready for decoding queue onto the queue of frames ready for display.
virtual int ValidVideoFrames() const
Returns number of frames that are fully decoded.
virtual void ClearAfterSeek()
Tells video output to toss decoded buffers due to a seek.
void SetPrebuffering(bool Normal)
Sets whether to use a normal number of buffers or fewer buffers.
virtual void SetVideoFrameRate(float VideoFrameRate)
virtual long long GetFramesPlayed()
QString GetFrameStatus() const
Returns string with status of each frame for debugging.
VideoErrorState GetError() const
virtual void DeLimboFrame(MythVideoFrame *Frame)
Releases a frame for reuse if it is in limbo.
virtual MythVideoFrame * GetNextFreeFrame()
Blocks until it is possible to return a frame for decoding onto.
int FreeVideoFrames()
Returns number of frames available for decoding onto.
virtual void DiscardFrame(MythVideoFrame *Frame)
Releases frame from any queue onto the queue of frames ready for decoding onto.
virtual void SetFramesPlayed(long long FramesPlayed)
virtual void DiscardFrames(bool KeyFrame, bool Flushed)
Releases all frames not being actively displayed from any queue onto the queue of frames ready for de...
virtual bool InputChanged(QSize VideoDim, QSize VideoDispDim, float VideoAspect, MythCodecID CodecID, bool &AspectChanged, int ReferenceFrames, bool ForceChange)
Tells video output to discard decoded frames and wait for new ones.
void SetPlayingInfo(const ProgramInfo *info)
assign programinfo to the context
void LockPlayingInfo(const char *file, int line) const
TVState GetState(void) const
RemoteEncoder * m_recorder
MythMediaBuffer * m_buffer
void UnlockPlayingInfo(const char *file, int line) const
ProgramInfo * m_playingInfo
Currently playing info.
Holds information on recordings and videos.
uint GetChanID(void) const
This is the unique key used in the database to locate tuning information.
AutoExpireType QueryAutoExpire(void) const
Returns "autoexpire" field from "recorded" table.
QString GetChanNum(void) const
This is the channel "number", in the form 1, 1_2, 1-2, 1#1, etc.
QString GetChannelSchedulingID(void) const
This is the unique programming identifier of a channel.
void FillPositionMap(int64_t start, int64_t end, frm_pos_map_t &positionMap)
bool IsValidRecorder(void) const
float GetFrameRate(void)
Returns recordering frame rate set by nvr.
long long GetFramesWritten(void)
Returns number of frames written to disk by TVRec's RecorderBase instance.
long long GetCachedFramesWritten(void) const
Return value last returned by GetFramesWritten().
void FillDurationMap(int64_t start, int64_t end, frm_pos_map_t &durationMap)
int GetRecorderNumber(void) const
static uint Parse(const QString &vbiformat)
#define setpriority(x, y, z)
std::vector< char > TestBufferVec
const int kDecoderProbeBufferSize
bool is_current_thread(MThread *thread)
Use this to determine if you are in the named thread.
std::enable_if_t< std::is_floating_point_v< T >, std::chrono::milliseconds > millisecondsFromFloat(T value)
Helper function for convert a floating point number to a duration.
static constexpr T chronomult(T duration, double f)
Multiply a duration by a float, returning a duration.
std::enable_if_t< std::is_floating_point_v< T >, std::chrono::seconds > secondsFromFloat(T value)
Helper function for convert a floating point number to a duration.
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.
QString get_encoding_type(MythCodecID codecid)
MythCoreContext * gCoreContext
This global variable contains the MythCoreContext instance for the app.
#define LOG(_MASK_, _LEVEL_, _QSTRING_)
static float ffrewScaleLowest
static float ffrewScaleHighest
static float ffrewSkipThresh
static unsigned dbg_ident(const MythPlayer *)
static bool preBufferDebug
static float ffrewScaleAdjust
@ kAVSyncAudioPausedLiveTV
QDateTime current(bool stripped)
Returns current Date and Time in UTC.
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.
@ kState_WatchingPreRecorded
Watching Pre-recorded is a TV only state for when we are watching a pre-existing recording.
QString ScanTypeToString(FrameScanType Scan)