13#define LOC QString("DVDPlayer: ")
24 std::chrono::microseconds FrameInterval,
bool AllowLock)
44 std::chrono::milliseconds Timecode,
bool )
141 LOG(VB_PLAYBACK, LOG_DEBUG,
142 LOC + QString(
"Validframes %1, FreeFrames %2, VideoPaused %3")
143 .arg(nbframes).arg(videoOutput->FreeVideoFrames()).arg(videoPaused));
153 if (release_all || release_one)
173 LOG(VB_PLAYBACK, LOG_INFO,
LOC +
"Clearing MythTV DVD wait state");
187 LOG(VB_PLAYBACK, LOG_INFO,
LOC +
"Clearing DVD wait state");
215 LOG(VB_PLAYBACK, LOG_WARNING,
LOC +
"In DVD Menu: No video frames in queue");
216 std::this_thread::sleep_for(10ms);
251 if (
Frame == ~0x0ULL)
302 std::this_thread::sleep_for(50ms);
343 LOG(VB_GENERAL, LOG_ERR,
LOC +
344 "DVD has no name and serial number. Cannot set bookmark.");
350 LOG(VB_GENERAL, LOG_ERR,
LOC +
351 "Unable to retrieve DVD state. Cannot set bookmark.");
363 LOG(VB_PLAYBACK, LOG_INFO,
LOC +
"Set bookmark");
368 LOG(VB_PLAYBACK, LOG_INFO,
LOC +
"Clear bookmark");
397 if (!dvdbookmark.empty())
399 QStringList::Iterator it = dvdbookmark.begin();
401 if (dvdbookmark.count() == 1)
405 LOG(VB_PLAYBACK, LOG_INFO,
LOC +
"Get Bookmark: bookmark found");
411 frames = ((*++it).toLongLong() & 0xffffffffLL);
414 LOG(VB_PLAYBACK, LOG_INFO,
LOC +
415 QString(
"Get Bookmark: title %1 audiotrack %2 subtrack %3 "
534 if (Chapter < 0 || Chapter > total)
539 Chapter = std::max(Chapter, 0);
541 else if (Chapter > total)
544 Chapter = std::min(Chapter, total);
569 uint buttonversion = 0;
573 bool expired =
false;
584 (dvdSubtitle->end_display_time > dvdSubtitle->start_display_time) &&
585 (dvdSubtitle->end_display_time < currentFrame->
m_timecode.count()))
598 if (!numbuttons || !dvdSubtitle || (buttonversion == 0) || expired)
607 (dvdSubtitle->start_display_time > currentFrame->
m_timecode.count()))
636 LOG(VB_GENERAL, LOG_ERR,
"No DVD Menu available.");
645 dvd->GoToPreviousProgram();
647 dvd->GoToNextProgram();
674 QString name = tr(
"Angle %1").arg(Angle);
686 if (Angle < 1 || Angle > total)
714 LOG(VB_PLAYBACK, LOG_INFO,
LOC +
715 QString(
"Stillframe timeout after %1 seconds (timestretch %2)")
virtual uint GetTrackCount(uint Type)
virtual void UpdateFramesPlayed(void)
virtual void SeekReset(long long newkey, uint skipFrames, bool doFlush, bool discardFrames)
StreamInfo GetTrackInfo(uint Type, uint TrackNo)
MythCodecContext * GetMythCodecContext(void)
void DisplayDVDButton(AVSubtitle *DVDButton, QRect &Pos)
virtual bool IsDeinterlacing(bool &, bool=false)
bool IsDatabaseIgnored(void) const
/brief Returns true if database is being ignored.
int NumMenuButtons(void) const
bool PlayTrack(int Track)
void SkipDVDWaitingForPlayer(void)
int NumPartsInTitle(void) const
void SetDVDSpeed(void)
set dvd speed. uses the constant DVD_DRIVE_SPEED table
bool GetDVDStateSnapshot(QString &State)
Get a snapshot of the current DVD VM state.
void PlayTitleAndPart(int Title, int Part)
bool SwitchAngle(int Angle)
bool RestoreDVDStateSnapshot(const QString &State)
Restore a DVD VM from a snapshot.
bool DVDWaitingForPlayer(void) const
void GetChapterTimes(QList< std::chrono::seconds > &Times)
int GetNumAngles(void) const
bool IsStillFramePending(void) const
QRect GetButtonCoords(void)
get coordinates of highlighted button
std::chrono::seconds TitleTimeLeft(void) const
returns seconds left in the title
std::chrono::seconds GetCellStart(void) const
get the start of the cell in seconds
std::chrono::seconds GetCurrentTime(void) const
void SkipStillFrame(void)
bool GoToMenu(const QString &str)
jump to a dvd root or chapter menu
int GetCurrentAngle(void) const
void ReleaseMenuButton(void)
void SetTrack(uint Type, int TrackNo)
set the dvd subtitle/audio track used
AVSubtitle * GetMenuSubtitle(uint &Version)
returns dvd menu button information if available.
bool IsOpen(void) const override
void SetParent(MythDVDPlayer *Parent)
bool IsInStillFrame(void) const override
bool GetNameAndSerialNum(QString &Name, QString &SerialNumber) override
Get the dvd title and serial num.
bool IsWaiting(void) const
bool Rewind(float Seconds) override
bool SwitchAngle(int Angle) override
void DisableDVDSubtitles()
bool IsInStillFrame() const override
int GetCurrentAngle(void) const override
bool DoJumpChapter(int Chapter) override
void DisableCaptions(uint Mode, bool OSDMsg=true) override
void VideoStart(void) override
virtual void EventEnd(void)
uint64_t GetBookmark(void) override
bool JumpToFrame(uint64_t Frame) override
bool FastForward(float Seconds) override
bool HasReachedEof(void) const override
MythTimer m_stillFrameTimer
std::chrono::milliseconds GetTotalMilliseconds(bool HonorCutList) const override
bool PrebufferEnoughFrames(int MinBuffers=0) override
void DisplayPauseFrame(void) override
bool VideoLoop(void) override
void ChangeSpeed(void) override
void InitialSeek(void) override
int GetCurrentChapter(void) override
void GoToDVDProgram(bool Direction)
QRecursiveMutex m_stillFrameTimerLock
void StillFrameCheck(void)
void EventStart(void) override
QString GetAngleName(int Angle) const override
bool m_dvdStillFrameShowing
int GetNumChapters(void) override
bool PrepareAudioSample(std::chrono::milliseconds &Timecode) override
void SetStillFrameTimeout(std::chrono::seconds Length)
void GoToMenu(const QString &Menu)
void SetBookmark(bool Clear=false) override
void DisplayDVDButton(void)
std::chrono::seconds m_stillFrameLength
void CreateDecoder(TestBufferVec &Testbuf) override
void DoFFRewSkip(void) override
MythDVDPlayer(MythMainWindow *MainWindow, TV *Tv, PlayerContext *Context, PlayerFlags Flags=kNoFlags)
void AutoDeint(MythVideoFrame *Frame, MythVideoOutput *VideoOutput, std::chrono::microseconds FrameInterval, bool AllowLock=true) override
Check whether deinterlacing should be enabled.
void ReleaseNextVideoFrame(MythVideoFrame *Buffer, std::chrono::milliseconds Timecode, bool Wrap=true) override
void ResetPlaying(bool ResetFrames=true) override
int m_initialSubtitleTrack
void GetChapterTimes(QList< std::chrono::seconds > &Times) override
void DecoderPauseCheck(void) override
void DoDisableDVDSubtitles()
long long CalcMaxFFTime(long long FastFwd, bool Setjump=true) const override
CalcMaxFFTime(ffframes): forward ffframes forward.
void SetTrack(uint Type, uint TrackNo) override
std::chrono::milliseconds GetMillisecondsPlayed(bool HonorCutList) override
void PreProcessNormalFrame(void) override
QString m_initialDvdState
void EnableCaptions(uint Mode, bool OSDMsg=true) override
int GetNumAngles(void) const override
std::chrono::milliseconds & DisplayTimecode()
virtual void SetTrack(uint Type, uint TrackNo)
void CaptionsStateChanged(MythCaptionsState &CaptionsState)
void SetCaptionsEnabled(bool Enable, bool UpdateOSD=true)
MythCaptionsOverlay m_captionsOverlay
MythCaptionsState m_captionsState
virtual void DisableCaptions(uint Mode, bool UpdateOSD=true)
virtual void EnableCaptions(uint Mode, bool UpdateOSD=true)
void UpdateOSDMessage(const QString &Message)
virtual void VideoStart()
virtual void InitialSeek()
virtual void DisplayPauseFrame()
virtual void EventStart()
void ChangeSpeed() override
virtual bool DisplayNormalFrame(bool CheckPrebuffer=true)
virtual bool Rewind(float seconds)
virtual void ReleaseNextVideoFrame(MythVideoFrame *buffer, std::chrono::milliseconds timecode, bool wrap=true)
Places frame on the queue of frames ready for display.
std::chrono::microseconds m_frameInterval
always adjusted for play_speed
void SetDecoder(DecoderBase *dec)
Sets the stream decoder, deleting any existing recorder.
virtual bool JumpToFrame(uint64_t frame)
virtual bool FastForward(float seconds)
QRecursiveMutex m_decoderChangeLock
virtual void ResetPlaying(bool resetframes=true)
virtual long long CalcMaxFFTime(long long ff, bool setjump=true) const
CalcMaxFFTime(ffframes): forward ffframes forward.
void SetErrored(const QString &reason)
PlayerFlags m_playerFlags
bool IsErrored(void) const
virtual bool PrebufferEnoughFrames(int min_buffers=0)
void WrapTimecode(std::chrono::milliseconds &timecode, TCTypes tc_type)
MythPlayerAVSync m_avSync
void ClearAfterSeek(bool clearvideobuffers=true)
This is to support seeking...
virtual void DecoderPauseCheck(void)
PlayerContext * m_playerCtx
std::chrono::seconds m_totalLength
MythVideoOutput * m_videoOutput
virtual void DoFFRewSkip(void)
EofState GetEof(void) const
void addMSecs(std::chrono::milliseconds ms)
Adds an offset to the last call to start() or restart().
std::chrono::milliseconds restart(void)
Returns milliseconds elapsed since last start() or restart() and resets the count.
std::chrono::milliseconds elapsed(void)
Returns milliseconds elapsed since last start() or restart()
std::chrono::milliseconds m_timecode
virtual void UpdatePauseFrame(std::chrono::milliseconds &, FrameScanType=kScan_Progressive)
bool EnoughFreeFrames()
Returns true iff enough frames are available to decode onto.
virtual int ValidVideoFrames() const
Returns number of frames that are fully decoded.
virtual MythVideoFrame * GetLastShownFrame()
Returns frame from the head of the ready to be displayed queue, if StartDisplayingFrame has been call...
void SetScanType(FrameScanType Scan, MythVideoOutput *VideoOutput, std::chrono::microseconds FrameInterval)
virtual void AutoDeint(MythVideoFrame *Frame, MythVideoOutput *VideoOutput, std::chrono::microseconds FrameInterval, bool AllowLock=true)
Check whether deinterlacing should be enabled.
void LockPlayingInfo(const char *file, int line) const
MythMediaBuffer * m_buffer
void UnlockPlayingInfo(const char *file, int line) const
ProgramInfo * m_playingInfo
Currently playing info.
void SetTitle(const QString &t, const QString &st=nullptr)
QString GetTitle(void) const
QStringList QueryDVDBookmark(const QString &serialid) const
Queries "dvdbookmark" table for bookmarking DVD serial number.
static void SaveDVDBookmark(const QStringList &fields)
void GoToDVDProgram(bool Direction)
void GoToMenu(const QString &Menu)
This class serves as the base class for all video output methods.
std::vector< char > TestBufferVec
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.
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.
MythCoreContext * gCoreContext
This global variable contains the MythCoreContext instance for the app.
#define LOG(_MASK_, _LEVEL_, _QSTRING_)
QDateTime current(bool stripped)
Returns current Date and Time in UTC.