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