Go to the documentation of this file.
9 #define LOC QString("DVDPlayer: ")
20 std::chrono::microseconds FrameInterval,
bool AllowLock)
40 std::chrono::milliseconds Timecode,
bool )
137 LOG(VB_PLAYBACK, LOG_DEBUG,
138 LOC + QString(
"Validframes %1, FreeFrames %2, VideoPaused %3")
139 .arg(nbframes).arg(videoOutput->FreeVideoFrames()).arg(videoPaused));
149 if (release_all || release_one)
169 LOG(VB_PLAYBACK, LOG_INFO,
LOC +
"Clearing MythTV DVD wait state");
183 LOG(VB_PLAYBACK, LOG_INFO,
LOC +
"Clearing DVD wait state");
211 LOG(VB_PLAYBACK, LOG_WARNING,
LOC +
"In DVD Menu: No video frames in queue");
212 std::this_thread::sleep_for(10ms);
247 if (
Frame == ~0x0ULL)
298 std::this_thread::sleep_for(50ms);
339 LOG(VB_GENERAL, LOG_ERR,
LOC +
340 "DVD has no name and serial number. Cannot set bookmark.");
346 LOG(VB_GENERAL, LOG_ERR,
LOC +
347 "Unable to retrieve DVD state. Cannot set bookmark.");
359 LOG(VB_PLAYBACK, LOG_INFO,
LOC +
"Set bookmark");
363 LOG(VB_PLAYBACK, LOG_INFO,
LOC +
"Clear bookmark");
391 if (!dvdbookmark.empty())
393 QStringList::Iterator it = dvdbookmark.begin();
395 if (dvdbookmark.count() == 1)
399 LOG(VB_PLAYBACK, LOG_INFO,
LOC +
"Get Bookmark: bookmark found");
405 frames = ((*++it).toLongLong() & 0xffffffffLL);
408 LOG(VB_PLAYBACK, LOG_INFO,
LOC +
409 QString(
"Get Bookmark: title %1 audiotrack %2 subtrack %3 "
528 if (Chapter < 0 || Chapter > total)
533 if (Chapter < 0) Chapter = 0;
535 else if (Chapter > total)
538 if (Chapter > total) Chapter = total;
563 uint buttonversion = 0;
567 bool expired =
false;
578 (dvdSubtitle->end_display_time > dvdSubtitle->start_display_time) &&
579 (dvdSubtitle->end_display_time < currentFrame->
m_timecode.count()))
592 if (!numbuttons || !dvdSubtitle || (buttonversion == 0) || expired)
601 (dvdSubtitle->start_display_time > currentFrame->
m_timecode.count()))
630 LOG(VB_GENERAL, LOG_ERR,
"No DVD Menu available.");
639 dvd->GoToPreviousProgram();
641 dvd->GoToNextProgram();
668 QString name = tr(
"Angle %1").arg(Angle);
680 if (Angle < 1 || Angle > total)
708 LOG(VB_PLAYBACK, LOG_INFO,
LOC +
709 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
QRecursiveMutex m_decoderChangeLock
void UnlockPlayingInfo(const char *file, int line) const
This class serves as the base class for all video output methods.
void SkipStillFrame(void)
virtual bool DisplayNormalFrame(bool CheckPrebuffer=true)
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 bool PrebufferEnoughFrames(int min_buffers=0)
QString m_initialDvdState
bool IsDatabaseIgnored(void) const
/brief Returns true if database is being ignored.
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
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)
QRecursiveMutex m_stillFrameTimerLock
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)
bool RestoreDVDStateSnapshot(const QString &State)
Restore a DVD VM from a snapshot.
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)
int GetCurrentChapter(void) override
bool EnoughFreeFrames()
Returns true iff enough frames are available to decode onto.
void GetChapterTimes(QList< std::chrono::seconds > &Times)
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::milliseconds & DisplayTimecode()
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
void DoFFRewSkip(void) override
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 void DoFFRewSkip(void)
virtual bool JumpToFrame(uint64_t frame)
void ChangeSpeed() override
MythCaptionsState m_captionsState
std::chrono::seconds m_stillFrameLength
void DoDisableDVDSubtitles()
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.