MythTV  master
mythdvdplayer.cpp
Go to the documentation of this file.
1 // MythTV
3 
4 #include "DVD/mythdvdbuffer.h"
5 #include "DVD/mythdvddecoder.h"
6 #include "DVD/mythdvdplayer.h"
7 #include "tv_play.h"
8 
9 #define LOC QString("DVDPlayer: ")
10 
12  : MythPlayerUI(MainWindow, Tv, Context, Flags)
13 {
14  connect(Tv, &TV::GoToMenu, this, &MythDVDPlayer::GoToMenu);
17 }
18 
20  std::chrono::microseconds FrameInterval, bool AllowLock)
21 {
22  bool dummy = false;
24  {
25  MythPlayerUI::AutoDeint(Frame, VideoOutput, FrameInterval, AllowLock);
26  return;
27  }
28 
30 }
31 
40  std::chrono::milliseconds Timecode, bool /*wrap*/)
41 {
44 }
45 
47 {
48  EofState eof = GetEof();
49  // DeleteMap and EditMode from the parent MythPlayer should not be
50  // relevant here.
51  return eof != kEofStateNone && !m_allPaused;
52 }
53 
55 {
57  SetCaptionsEnabled(false, false);
58 }
59 
61 {
65 }
66 
68 {
70  {
71  int track = GetTrack(kTrackTypeSubtitle);
72  if (track >= 0 && track < static_cast<int>(m_decoder->GetTrackCount(kTrackTypeSubtitle)))
73  {
74  StreamInfo stream = m_decoder->GetTrackInfo(kTrackTypeSubtitle, static_cast<uint>(track));
76  }
77  }
79 }
80 
82 {
87 }
88 
90 {
93 }
94 
95 bool MythDVDPlayer::PrebufferEnoughFrames(int /*MinBuffers*/)
96 {
98 }
99 
101 {
103  if (m_decoderChangeLock.tryLock(1))
104  {
105  if (m_decoder)
107  m_decoderChangeLock.unlock();
108  }
109 }
110 
112 {
114 }
115 
117 {
118  if (!m_initialDvdState.isEmpty())
120 
122 }
123 
125 {
126  if (!m_playerCtx->m_buffer->IsDVD())
127  {
128  SetErrored("RingBuffer is not a DVD.");
129  return !IsErrored();
130  }
131 
132  int nbframes = 0;
133  if (m_videoOutput)
134  nbframes = m_videoOutput->ValidVideoFrames();
135 
136 #if 0
137  LOG(VB_PLAYBACK, LOG_DEBUG,
138  LOC + QString("Validframes %1, FreeFrames %2, VideoPaused %3")
139  .arg(nbframes).arg(videoOutput->FreeVideoFrames()).arg(videoPaused));
140 #endif
141 
142  // completely drain the video buffers for certain situations
143  bool release_all = m_playerCtx->m_buffer->DVD()->DVDWaitingForPlayer() &&
144  (nbframes > 0);
145  bool release_one = (nbframes > 1) && m_videoPaused && !m_allPaused &&
149  if (release_all || release_one)
150  {
151  if (nbframes < 5 && m_videoOutput)
153 
154  // if we go below the pre-buffering limit, the player will pause
155  // so do this 'manually'
156  DisplayNormalFrame(false);
157  // unpause the still frame if more frames become available
158  if (m_dvdStillFrameShowing && nbframes > 1)
159  {
160  m_dvdStillFrameShowing = false;
161  UnpauseVideo();
162  }
163  return !IsErrored();
164  }
165 
166  // clear the mythtv imposed wait state
168  {
169  LOG(VB_PLAYBACK, LOG_INFO, LOC + "Clearing MythTV DVD wait state");
171  ClearAfterSeek(true);
172  if (m_videoPaused && !m_allPaused)
173  UnpauseVideo();
174  return !IsErrored();
175  }
176 
177  // wait for the video buffers to drain
178  if (nbframes < 2)
179  {
180  // clear the DVD wait state
181  if (m_playerCtx->m_buffer->DVD()->IsWaiting())
182  {
183  LOG(VB_PLAYBACK, LOG_INFO, LOC + "Clearing DVD wait state");
185  if (m_videoPaused && !m_allPaused)
186  UnpauseVideo();
187  return !IsErrored();
188  }
189 
190  // the still frame is treated as a pause frame
192  {
193  // ensure we refresh the pause frame
195  m_needNewPauseFrame = true;
196 
197  // we are in a still frame so pause video output
198  if (!m_videoPaused)
199  {
200  PauseVideo();
201  m_dvdStillFrameShowing = true;
202  return !IsErrored();
203  }
204 
205  // see if the pause frame has timed out
206  StillFrameCheck();
207 
208  // flag if we have no frame
209  if (nbframes == 0)
210  {
211  LOG(VB_PLAYBACK, LOG_WARNING, LOC + "In DVD Menu: No video frames in queue");
212  std::this_thread::sleep_for(10ms);
213  return !IsErrored();
214  }
215 
216  m_dvdStillFrameShowing = true;
217  }
218  }
219 
220  // unpause the still frame if more frames become available
221  if (m_dvdStillFrameShowing && nbframes > 1)
222  {
223  UnpauseVideo();
224  m_dvdStillFrameShowing = false;
225  return !IsErrored();
226  }
227 
228  return MythPlayerUI::VideoLoop();
229 }
230 
231 bool MythDVDPlayer::FastForward(float Seconds)
232 {
233  if (m_decoder)
235  return MythPlayerUI::FastForward(Seconds);
236 }
237 
238 bool MythDVDPlayer::Rewind(float Seconds)
239 {
240  if (m_decoder)
242  return MythPlayerUI::Rewind(Seconds);
243 }
244 
246 {
247  if (Frame == ~0x0ULL)
248  return false;
249 
250  if (m_decoder)
253 }
254 
256 {
257  if (m_playerCtx->m_buffer->DVD())
258  m_playerCtx->m_buffer->DVD()->SetParent(this);
259 
260  m_playerCtx->LockPlayingInfo(__FILE__, __LINE__);
262  {
263  QString name;
264  QString serialid;
265  if (m_playerCtx->m_playingInfo->GetTitle().isEmpty() &&
266  m_playerCtx->m_buffer->DVD() &&
267  m_playerCtx->m_buffer->DVD()->GetNameAndSerialNum(name, serialid))
268  {
270  }
271  }
272  m_playerCtx->UnlockPlayingInfo(__FILE__, __LINE__);
273 
275 }
276 
278 {
280 
281  if (m_initialTitle > -1)
283 
284  if (m_initialAudioTrack > -1)
287  if (m_initialSubtitleTrack > -1)
290 
291  if (m_bookmarkSeek > 30)
292  {
293  // we need to trigger a dvd cell change to ensure the new title length
294  // is set and the position map updated accordingly
295  m_decodeOneFrame = true;
296  int count = 0;
297  while (count++ < 100 && m_decodeOneFrame)
298  std::this_thread::sleep_for(50ms);
299  }
302 }
303 
304 void MythDVDPlayer::ResetPlaying(bool /*ResetFrames*/)
305 {
307 }
308 
310 {
311  if (m_playerCtx->m_buffer->DVD())
312  m_playerCtx->m_buffer->DVD()->SetParent(nullptr);
313 }
314 
315 bool MythDVDPlayer::PrepareAudioSample(std::chrono::milliseconds &Timecode)
316 {
318  WrapTimecode(Timecode, TC_AUDIO);
319 
320  return m_playerCtx->m_buffer->IsDVD() &&
322 }
323 
325 {
326  if (!m_playerCtx->m_buffer->IsDVD())
327  return;
328 
329  QStringList fields;
330  QString name;
331  QString serialid;
332  QString dvdstate;
333 
334  if (!m_playerCtx->m_buffer->IsInMenu() &&
336  {
337  if (!m_playerCtx->m_buffer->DVD()->GetNameAndSerialNum(name, serialid))
338  {
339  LOG(VB_GENERAL, LOG_ERR, LOC +
340  "DVD has no name and serial number. Cannot set bookmark.");
341  return;
342  }
343 
344  if (!Clear && !m_playerCtx->m_buffer->DVD()->GetDVDStateSnapshot(dvdstate))
345  {
346  LOG(VB_GENERAL, LOG_ERR, LOC +
347  "Unable to retrieve DVD state. Cannot set bookmark.");
348  return;
349  }
350 
351  m_playerCtx->LockPlayingInfo(__FILE__, __LINE__);
353  {
354  fields += serialid;
355  fields += name;
356 
357  if (!Clear)
358  {
359  LOG(VB_PLAYBACK, LOG_INFO, LOC + "Set bookmark");
360  fields += dvdstate;
361  }
362  else
363  LOG(VB_PLAYBACK, LOG_INFO, LOC + "Clear bookmark");
364 
366 
367  }
368  m_playerCtx->UnlockPlayingInfo(__FILE__, __LINE__);
369  }
370 }
371 
373 {
375  return 0;
376 
377  QString name;
378  QString serialid;
379  uint64_t frames = 0;
380  m_playerCtx->LockPlayingInfo(__FILE__, __LINE__);
382  {
383  if (!m_playerCtx->m_buffer->DVD()->GetNameAndSerialNum(name, serialid))
384  {
385  m_playerCtx->UnlockPlayingInfo(__FILE__, __LINE__);
386  return 0;
387  }
388 
389  QStringList dvdbookmark = m_playerCtx->m_playingInfo->QueryDVDBookmark(serialid);
390 
391  if (!dvdbookmark.empty())
392  {
393  QStringList::Iterator it = dvdbookmark.begin();
394 
395  if (dvdbookmark.count() == 1)
396  {
397  m_initialDvdState = *it;
398  frames = ~0x0ULL;
399  LOG(VB_PLAYBACK, LOG_INFO, LOC + "Get Bookmark: bookmark found");
400  }
401  else
402  {
403  // Legacy bookmarks
404  m_initialTitle = (*it).toInt();
405  frames = ((*++it).toLongLong() & 0xffffffffLL);
406  m_initialAudioTrack = (*++it).toInt();
407  m_initialSubtitleTrack = (*++it).toInt();
408  LOG(VB_PLAYBACK, LOG_INFO, LOC +
409  QString("Get Bookmark: title %1 audiotrack %2 subtrack %3 "
410  "frame %4")
412  .arg(m_initialSubtitleTrack).arg(frames));
413  }
414  }
415  }
416  m_playerCtx->UnlockPlayingInfo(__FILE__, __LINE__);
417  return frames;
418 }
419 
421 {
422  if (m_stillFrameLength > 0s)
423  {
424  m_stillFrameTimerLock.lock();
425  // Get the timestretched elapsed time and transform
426  // it to what the unstretched value would have been
427  // had we been playing with the new timestretch value
428  // all along
429  auto elapsed = millisecondsFromFloat(m_stillFrameTimer.elapsed().count() *
432  m_stillFrameTimer.addMSecs(elapsed);
433  m_stillFrameTimerLock.unlock();
434  }
435 
437 
438  if (m_decoder)
440  if (m_playerCtx->m_buffer->IsDVD())
441  {
442  if (m_playSpeed > 1.0F)
444  else
446  }
447 }
448 
449 long long MythDVDPlayer::CalcMaxFFTime(long long FastFwd, bool Setjump) const
450 {
451  if ((m_totalFrames > 0) && m_playerCtx->m_buffer->IsDVD() &&
453  return 0;
454  return MythPlayerUI::CalcMaxFFTime(FastFwd, Setjump);
455 }
456 
457 std::chrono::milliseconds MythDVDPlayer::GetMillisecondsPlayed(bool /*HonorCutList*/)
458 {
459  if (!m_playerCtx->m_buffer->IsDVD())
460  return 0ms;
461 
462  std::chrono::milliseconds played = m_playerCtx->m_buffer->DVD()->GetCurrentTime();
463 
464  if (m_stillFrameLength > 0s)
465  {
466  if (m_stillFrameLength == 255s)
467  return -1ms;
469  }
470 
471  return played;
472 }
473 
474 std::chrono::milliseconds MythDVDPlayer::GetTotalMilliseconds(bool /*HonorCutList*/) const
475 {
476  std::chrono::milliseconds total = m_totalLength;
477 
478  if (m_stillFrameLength > 0s)
479  {
480  if (m_stillFrameLength == 255s)
481  return -1ms;
482  total = duration_cast<std::chrono::milliseconds>(m_stillFrameLength);
483  }
484 
485  return total;
486 }
487 
488 void MythDVDPlayer::SetTrack(uint Type, uint TrackNo)
489 {
490  if (kTrackTypeAudio == Type)
491  {
492  StreamInfo stream = m_decoder->GetTrackInfo(Type, static_cast<uint>(TrackNo));
493  m_playerCtx->m_buffer->DVD()->SetTrack(Type, stream.m_stream_id);
494  }
495 
496  MythPlayerUI::SetTrack(Type, TrackNo);
497 }
498 
500 {
501  if (!m_playerCtx->m_buffer->IsDVD())
502  return 0;
503  return m_playerCtx->m_buffer->DVD()->NumPartsInTitle();
504 }
505 
507 {
508  if (!m_playerCtx->m_buffer->IsDVD())
509  return 0;
510  return m_playerCtx->m_buffer->DVD()->GetPart();
511 }
512 
513 void MythDVDPlayer::GetChapterTimes(QList<std::chrono::seconds> &Times)
514 {
515  if (!m_playerCtx->m_buffer->IsDVD())
516  return;
518 }
519 
521 {
522  if (!m_playerCtx->m_buffer->IsDVD())
523  return false;
524 
525  int total = GetNumChapters();
526  int current = GetCurrentChapter();
527 
528  if (Chapter < 0 || Chapter > total)
529  {
530  if (Chapter < 0)
531  {
532  Chapter = current -1;
533  if (Chapter < 0) Chapter = 0;
534  }
535  else if (Chapter > total)
536  {
537  Chapter = current + 1;
538  if (Chapter > total) Chapter = total;
539  }
540  }
541 
542  bool success = m_playerCtx->m_buffer->DVD()->PlayTrack(Chapter);
543  if (success)
544  {
545  if (m_decoder)
546  {
548  if (m_playerCtx->m_buffer->DVD()->GetCellStart() == 0s)
549  m_decoder->SeekReset(static_cast<long long>(m_framesPlayed), 0, true, true);
550  }
552  }
553 
554  m_jumpChapter = 0;
555  return success;
556 }
557 
559 {
560  if (!m_playerCtx->m_buffer->IsDVD())
561  return;
562 
563  uint buttonversion = 0;
564  AVSubtitle *dvdSubtitle = m_playerCtx->m_buffer->DVD()->GetMenuSubtitle(buttonversion);
565  bool numbuttons = m_playerCtx->m_buffer->DVD()->NumMenuButtons() != 0;
566 
567  bool expired = false;
568 
569  MythVideoFrame *currentFrame = m_videoOutput ? m_videoOutput->GetLastShownFrame() : nullptr;
570 
571  if (!currentFrame)
572  {
574  return;
575  }
576 
577  if (dvdSubtitle &&
578  (dvdSubtitle->end_display_time > dvdSubtitle->start_display_time) &&
579  (dvdSubtitle->end_display_time < currentFrame->m_timecode.count()))
580  {
581  expired = true;
582  }
583 
584  // nothing to do
585  if (!expired && (buttonversion == (static_cast<uint>(m_buttonVersion))))
586  {
588  return;
589  }
590 
591  // clear any buttons
592  if (!numbuttons || !dvdSubtitle || (buttonversion == 0) || expired)
593  {
595  m_buttonVersion = 0;
597  return;
598  }
599 
600  if ((currentFrame->m_timecode > 0ms) &&
601  (dvdSubtitle->start_display_time > currentFrame->m_timecode.count()))
602  {
604  return;
605  }
606 
607  m_buttonVersion = static_cast<int>(buttonversion);
608  QRect buttonPos = m_playerCtx->m_buffer->DVD()->GetButtonCoords();
609  m_captionsOverlay.DisplayDVDButton(dvdSubtitle, buttonPos);
610  uint oldcaptions = m_captionsState.m_textDisplayMode;
612  if (oldcaptions != m_captionsState.m_textDisplayMode)
615 }
616 
617 void MythDVDPlayer::GoToMenu(const QString& Menu)
618 {
619  if (!m_playerCtx->m_buffer->IsDVD())
620  return;
621 
622  uint oldcaptions = m_captionsState.m_textDisplayMode;
624  if (oldcaptions != m_captionsState.m_textDisplayMode)
626 
627  if (!m_playerCtx->m_buffer->DVD()->GoToMenu(Menu))
628  {
629  UpdateOSDMessage(tr("DVD Menu Not Available"), kOSDTimeout_Med);
630  LOG(VB_GENERAL, LOG_ERR, "No DVD Menu available.");
631  }
632 }
633 
634 void MythDVDPlayer::GoToDVDProgram(bool Direction)
635 {
636  if (auto * dvd = m_playerCtx->m_buffer->DVD(); dvd)
637  {
638  if (Direction)
639  dvd->GoToPreviousProgram();
640  else
641  dvd->GoToNextProgram();
642  }
643 }
644 
646 {
647  return (m_stillFrameLength > 0s);
648 }
649 
651 {
653  return m_playerCtx->m_buffer->DVD()->GetNumAngles();
654  return 0;
655 }
656 
658 {
660  return m_playerCtx->m_buffer->DVD()->GetCurrentAngle();
661  return -1;
662 }
663 
664 QString MythDVDPlayer::GetAngleName(int Angle) const
665 {
666  if (Angle >= 1 && Angle <= GetNumAngles())
667  {
668  QString name = tr("Angle %1").arg(Angle);
669  return name;
670  }
671  return {};
672 }
673 
675 {
676  int total = GetNumAngles();
677  if (!total || Angle == GetCurrentAngle())
678  return false;
679 
680  if (Angle < 1 || Angle > total)
681  Angle = 1;
682 
683  return m_playerCtx->m_buffer->DVD()->SwitchAngle(Angle);
684 }
685 
686 void MythDVDPlayer::SetStillFrameTimeout(std::chrono::seconds Length)
687 {
688  if (Length != m_stillFrameLength)
689  {
690  m_stillFrameTimerLock.lock();
691  m_stillFrameLength = Length;
693  m_stillFrameTimerLock.unlock();
694  }
695 }
696 
698 {
699  if (m_playerCtx->m_buffer->IsDVD() &&
701  (m_stillFrameLength > 0s) && (m_stillFrameLength < 255s))
702  {
703  m_stillFrameTimerLock.lock();
704  auto elapsedTime = secondsFromFloat(m_stillFrameTimer.elapsed().count() * m_playSpeed / 1000.0F);
705  m_stillFrameTimerLock.unlock();
706  if (elapsedTime >= m_stillFrameLength)
707  {
708  LOG(VB_PLAYBACK, LOG_INFO, LOC +
709  QString("Stillframe timeout after %1 seconds (timestretch %2)")
710  .arg(m_stillFrameLength.count()).arg(static_cast<double>(m_playSpeed)));
712  m_stillFrameLength = 0s;
713  }
714  }
715 }
716 
718 {
721 }
ProgramInfo::SaveDVDBookmark
static void SaveDVDBookmark(const QStringList &fields)
Definition: programinfo.cpp:2921
MythDVDBuffer::PlayTrack
bool PlayTrack(int Track)
Definition: mythdvdbuffer.cpp:1106
MythPlayerUI::VideoStart
virtual void VideoStart()
Definition: mythplayerui.cpp:418
MythDVDBuffer::GetCurrentTime
std::chrono::seconds GetCurrentTime(void) const
Definition: mythdvdbuffer.cpp:1987
MythDVDPlayer::EnableCaptions
void EnableCaptions(uint Mode, bool OSDMsg=true) override
Definition: mythdvdplayer.cpp:67
MythDVDBuffer::IsOpen
bool IsOpen(void) const override
Definition: mythdvdbuffer.cpp:216
secondsFromFloat
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.
Definition: mythchrono.h:80
MythTimer::elapsed
std::chrono::milliseconds elapsed(void)
Returns milliseconds elapsed since last start() or restart()
Definition: mythtimer.cpp:91
MythDVDPlayer::DisableCaptions
void DisableCaptions(uint Mode, bool OSDMsg=true) override
Definition: mythdvdplayer.cpp:60
MythPlayerCaptionsUI::SetTrack
virtual void SetTrack(uint Type, uint TrackNo)
Definition: mythplayercaptionsui.cpp:329
MythDVDPlayer::VideoStart
void VideoStart(void) override
Definition: mythdvdplayer.cpp:116
MythDVDBuffer::TitleTimeLeft
std::chrono::seconds TitleTimeLeft(void) const
returns seconds left in the title
Definition: mythdvdbuffer.cpp:1982
MythPlayer::m_videoPaused
bool m_videoPaused
Definition: mythplayer.h:401
MythPlayer::m_decoderChangeLock
QRecursiveMutex m_decoderChangeLock
Definition: mythplayer.h:370
PlayerContext::UnlockPlayingInfo
void UnlockPlayingInfo(const char *file, int line) const
Definition: playercontext.cpp:243
MythVideoOutput
Definition: mythvideoout.h:35
mythdvddecoder.h
VideoOutput
This class serves as the base class for all video output methods.
MythDVDBuffer::SkipStillFrame
void SkipStillFrame(void)
Definition: mythdvdbuffer.cpp:1203
MythPlayerUI::DisplayNormalFrame
virtual bool DisplayNormalFrame(bool CheckPrebuffer=true)
Definition: mythplayerui.cpp:667
kDisplayNone
@ kDisplayNone
Definition: videoouttypes.h:12
kEofStateNone
@ kEofStateNone
Definition: decoderbase.h:69
MythDVDPlayer::JumpToFrame
bool JumpToFrame(uint64_t Frame) override
Definition: mythdvdplayer.cpp:245
MythPlayer::m_avSync
MythPlayerAVSync m_avSync
Definition: mythplayer.h:438
MythPlayer::DecoderPauseCheck
virtual void DecoderPauseCheck(void)
Definition: mythplayer.cpp:1061
MythPlayer::m_playSpeed
float m_playSpeed
Definition: mythplayer.h:496
MythPlayer::m_frameInterval
std::chrono::microseconds m_frameInterval
always adjusted for play_speed
Definition: mythplayer.h:498
MythDVDPlayer::CreateDecoder
void CreateDecoder(TestBufferVec &Testbuf) override
Definition: mythdvdplayer.cpp:717
MythDVDBuffer::IsInStillFrame
bool IsInStillFrame(void) const override
Definition: mythdvdbuffer.cpp:226
MythDVDPlayer::HasReachedEof
bool HasReachedEof(void) const override
Definition: mythdvdplayer.cpp:46
MythPlayerCaptionsUI::GetTrack
int GetTrack(uint Type)
Definition: mythplayercaptionsui.cpp:368
MythPlayerUI::EventStart
virtual void EventStart()
Definition: mythplayerui.cpp:477
MythDVDBuffer::SetTrack
void SetTrack(uint Type, int TrackNo)
set the dvd subtitle/audio track used
Definition: mythdvdbuffer.cpp:1861
Mode
Mode
Definition: synaesthesia.h:23
MythPlayer::PrebufferEnoughFrames
virtual bool PrebufferEnoughFrames(int min_buffers=0)
Definition: mythplayer.cpp:729
StreamInfo::m_stream_id
int m_stream_id
Definition: decoderbase.h:99
Frame
Definition: zmdefines.h:93
MythDVDPlayer::m_initialDvdState
QString m_initialDvdState
Definition: mythdvdplayer.h:79
mythdvdbuffer.h
MythCaptionsOverlay::ClearSubtitles
void ClearSubtitles()
Definition: mythcaptionsoverlay.cpp:206
MythCoreContext::IsDatabaseIgnored
bool IsDatabaseIgnored(void) const
/brief Returns true if database is being ignored.
Definition: mythcorecontext.cpp:875
MythDVDPlayer::AutoDeint
void AutoDeint(MythVideoFrame *Frame, MythVideoOutput *VideoOutput, std::chrono::microseconds FrameInterval, bool AllowLock=true) override
Check whether deinterlacing should be enabled.
Definition: mythdvdplayer.cpp:19
MythMediaBuffer::IgnoreWaitStates
virtual void IgnoreWaitStates(bool)
Definition: mythmediabuffer.h:130
MythPlayer::IsErrored
bool IsErrored(void) const
Definition: mythplayer.cpp:1958
MythMediaBuffer::IsDVD
bool IsDVD(void) const
Definition: mythmediabuffer.cpp:1831
DecoderBase::GetMythCodecContext
MythCodecContext * GetMythCodecContext(void)
Definition: decoderbase.h:263
LOG
#define LOG(_MASK_, _LEVEL_, _QSTRING_)
Definition: mythlogging.h:39
MythDVDPlayer::GetMillisecondsPlayed
std::chrono::milliseconds GetMillisecondsPlayed(bool HonorCutList) override
Definition: mythdvdplayer.cpp:457
MythDVDBuffer::GoToMenu
bool GoToMenu(const QString &str)
jump to a dvd root or chapter menu
Definition: mythdvdbuffer.cpp:1241
PlayerFlags
PlayerFlags
Definition: mythplayer.h:65
MythPlayer::GetEof
EofState GetEof(void) const
Definition: mythplayer.cpp:1073
MythMediaBuffer::IsInMenu
virtual bool IsInMenu(void) const
Definition: mythmediabuffer.h:131
MythPlayer::m_nextPlaySpeed
float m_nextPlaySpeed
Definition: mythplayer.h:495
MythPlayerUI::VideoLoop
virtual bool VideoLoop()
Definition: mythplayerui.cpp:495
MythDVDBuffer::SkipDVDWaitingForPlayer
void SkipDVDWaitingForPlayer(void)
Definition: mythdvdbuffer.cpp:1224
MythDVDPlayer::IsInStillFrame
bool IsInStillFrame() const override
Definition: mythdvdplayer.cpp:645
TVPlaybackState::GoToDVDProgram
void GoToDVDProgram(bool Direction)
MythDVDPlayer::PrepareAudioSample
bool PrepareAudioSample(std::chrono::milliseconds &Timecode) override
Definition: mythdvdplayer.cpp:315
MythCaptionsState::m_textDisplayMode
uint m_textDisplayMode
Definition: mythplayerstate.h:70
MythDVDPlayer::SwitchAngle
bool SwitchAngle(int Angle) override
Definition: mythdvdplayer.cpp:674
MythDate::current
QDateTime current(bool stripped)
Returns current Date and Time in UTC.
Definition: mythdate.cpp:14
MythDVDDecoder
Definition: mythdvddecoder.h:14
MythPlayer::SetErrored
void SetErrored(const QString &reason)
Definition: mythplayer.cpp:1934
MythPlayer::m_needNewPauseFrame
bool m_needNewPauseFrame
Definition: mythplayer.h:399
TVPlaybackState::GoToMenu
void GoToMenu(const QString &Menu)
MythDVDPlayer::InitialSeek
void InitialSeek(void) override
Definition: mythdvdplayer.cpp:277
MythPlayer::SetDecoder
void SetDecoder(DecoderBase *dec)
Sets the stream decoder, deleting any existing recorder.
Definition: mythplayer.cpp:1892
MythDVDBuffer::SetParent
void SetParent(MythDVDPlayer *Parent)
Definition: mythdvdbuffer.cpp:2173
MythDVDPlayer::m_stillFrameTimerLock
QRecursiveMutex m_stillFrameTimerLock
Definition: mythdvdplayer.h:87
MythDVDBuffer::DVDWaitingForPlayer
bool DVDWaitingForPlayer(void) const
Definition: mythdvdbuffer.cpp:435
EofState
EofState
Definition: decoderbase.h:67
MythPlayerOverlayUI::UpdateOSDMessage
void UpdateOSDMessage(const QString &Message)
Definition: mythplayeroverlayui.cpp:76
MythDVDBuffer::GetCurrentAngle
int GetCurrentAngle(void) const
Definition: mythdvdbuffer.cpp:445
MythPlayerUI
Definition: mythplayerui.h:10
MythMediaBuffer::GetFilename
QString GetFilename(void) const
Definition: mythmediabuffer.cpp:1740
MythPlayer::UnpauseVideo
void UnpauseVideo(void)
Definition: mythplayer.cpp:228
DecoderBase::GetTrackCount
virtual uint GetTrackCount(uint Type)
Definition: decoderbase.cpp:909
MythPlayer::m_decoder
DecoderBase * m_decoder
Definition: mythplayer.h:366
MythDVDPlayer::GetChapterTimes
void GetChapterTimes(QList< std::chrono::seconds > &Times) override
Definition: mythdvdplayer.cpp:513
MythPlayer::m_framesPlayed
uint64_t m_framesPlayed
Definition: mythplayer.h:432
MythDVDPlayer::PreProcessNormalFrame
void PreProcessNormalFrame(void) override
Definition: mythdvdplayer.cpp:111
DecoderBase::GetTrackInfo
StreamInfo GetTrackInfo(uint Type, uint TrackNo)
Definition: decoderbase.cpp:983
MythVideoOutput::ValidVideoFrames
virtual int ValidVideoFrames() const
Returns number of frames that are fully decoded.
Definition: mythvideoout.cpp:278
StreamInfo
Definition: decoderbase.h:74
MythDVDBuffer::PlayTitleAndPart
void PlayTitleAndPart(int Title, int Part)
Definition: mythdvdbuffer.cpp:1962
kScan_Progressive
@ kScan_Progressive
Definition: videoouttypes.h:100
MythDVDBuffer::GetButtonCoords
QRect GetButtonCoords(void)
get coordinates of highlighted button
Definition: mythdvdbuffer.cpp:1447
PlayerContext::m_playingInfo
ProgramInfo * m_playingInfo
Currently playing info.
Definition: playercontext.h:121
MythMediaBuffer::IsInDiscMenuOrStillFrame
virtual bool IsInDiscMenuOrStillFrame(void) const
Definition: mythmediabuffer.h:133
MythDVDPlayer::m_dvdStillFrameShowing
bool m_dvdStillFrameShowing
Definition: mythdvdplayer.h:73
mythdvdplayer.h
PlayerContext::LockPlayingInfo
void LockPlayingInfo(const char *file, int line) const
Definition: playercontext.cpp:233
MythPlayer::m_bookmarkSeek
uint64_t m_bookmarkSeek
Definition: mythplayer.h:421
MythVideoFrame::m_timecode
std::chrono::milliseconds m_timecode
Definition: mythframe.h:131
ProgramInfo::GetTitle
QString GetTitle(void) const
Definition: programinfo.h:361
MythDVDPlayer::StillFrameCheck
void StillFrameCheck(void)
Definition: mythdvdplayer.cpp:697
MythPlayer::m_videoOutput
MythVideoOutput * m_videoOutput
Definition: mythplayer.h:372
ProgramInfo::QueryDVDBookmark
QStringList QueryDVDBookmark(const QString &serialid) const
Queries "dvdbookmark" table for bookmarking DVD serial number.
Definition: programinfo.cpp:2888
MythCodecContext::IsDeinterlacing
virtual bool IsDeinterlacing(bool &, bool=false)
Definition: mythcodeccontext.h:158
MythPlayerCaptionsUI::m_captionsOverlay
MythCaptionsOverlay m_captionsOverlay
Definition: mythplayercaptionsui.h:69
PlayerContext::m_buffer
MythMediaBuffer * m_buffer
Definition: playercontext.h:120
MythTimer::restart
std::chrono::milliseconds restart(void)
Returns milliseconds elapsed since last start() or restart() and resets the count.
Definition: mythtimer.cpp:62
MythPlayer::WrapTimecode
void WrapTimecode(std::chrono::milliseconds &timecode, TCTypes tc_type)
Definition: mythplayer.cpp:1307
MythPlayer::PauseVideo
void PauseVideo(void)
Definition: mythplayer.cpp:220
MythPlayer::ClearAfterSeek
void ClearAfterSeek(bool clearvideobuffers=true)
This is to support seeking...
Definition: mythplayer.cpp:1685
MythDVDPlayer::DisableDVDSubtitles
void DisableDVDSubtitles()
MythPlayer::m_totalFrames
uint64_t m_totalFrames
Definition: mythplayer.h:433
MythPlayer::ResetPlaying
virtual void ResetPlaying(bool resetframes=true)
Definition: mythplayer.cpp:922
MythDVDBuffer::RestoreDVDStateSnapshot
bool RestoreDVDStateSnapshot(const QString &State)
Restore a DVD VM from a snapshot.
Definition: mythdvdbuffer.cpp:1933
MythDVDPlayer::GetTotalMilliseconds
std::chrono::milliseconds GetTotalMilliseconds(bool HonorCutList) const override
Definition: mythdvdplayer.cpp:474
MythDVDPlayer::GetCurrentAngle
int GetCurrentAngle(void) const override
Definition: mythdvdplayer.cpp:657
ProgramInfo::SetTitle
void SetTitle(const QString &t, const QString &st=nullptr)
Definition: programinfo.cpp:1153
TestBufferVec
std::vector< char > TestBufferVec
Definition: decoderbase.h:23
MythPlayer::m_playerCtx
PlayerContext * m_playerCtx
Definition: mythplayer.h:374
MythPlayerUI::DisplayPauseFrame
virtual void DisplayPauseFrame()
Definition: mythplayerui.cpp:645
MythPlayerCaptionsUI::SetCaptionsEnabled
void SetCaptionsEnabled(bool Enable, bool UpdateOSD=true)
Definition: mythplayercaptionsui.cpp:282
kTrackTypeAudio
@ kTrackTypeAudio
Definition: decoderbase.h:29
MythDVDPlayer::CalcMaxFFTime
long long CalcMaxFFTime(long long FastFwd, bool Setjump=true) const override
CalcMaxFFTime(ffframes): forward ffframes forward.
Definition: mythdvdplayer.cpp:449
MythDVDPlayer::ReleaseNextVideoFrame
void ReleaseNextVideoFrame(MythVideoFrame *Buffer, std::chrono::milliseconds Timecode, bool Wrap=true) override
Definition: mythdvdplayer.cpp:39
uint
unsigned int uint
Definition: compat.h:81
MythDVDBuffer::ReleaseMenuButton
void ReleaseMenuButton(void)
Definition: mythdvdbuffer.cpp:1440
MythDVDBuffer::NumPartsInTitle
int NumPartsInTitle(void) const
Definition: mythdvdbuffer.cpp:1189
gCoreContext
MythCoreContext * gCoreContext
This global variable contains the MythCoreContext instance for the app.
Definition: mythcorecontext.cpp:55
MythPlayer::m_playerFlags
PlayerFlags m_playerFlags
Definition: mythplayer.h:380
MythDVDBuffer::IsWaiting
bool IsWaiting(void) const
Definition: mythdvdbuffer.cpp:1184
MythDVDPlayer::Rewind
bool Rewind(float Seconds) override
Definition: mythdvdplayer.cpp:238
MythDVDPlayer::EventEnd
virtual void EventEnd(void)
Definition: mythdvdplayer.cpp:309
kTrackTypeSubtitle
@ kTrackTypeSubtitle
Definition: decoderbase.h:31
MythPlayerCaptionsUI::DisableCaptions
virtual void DisableCaptions(uint Mode, bool UpdateOSD=true)
Definition: mythplayercaptionsui.cpp:148
MythDVDPlayer::GetCurrentChapter
int GetCurrentChapter(void) override
Definition: mythdvdplayer.cpp:506
MythVideoOutput::EnoughFreeFrames
bool EnoughFreeFrames()
Returns true iff enough frames are available to decode onto.
Definition: mythvideoout.cpp:290
MythDVDBuffer::GetChapterTimes
void GetChapterTimes(QList< std::chrono::seconds > &Times)
Definition: mythdvdbuffer.cpp:372
MythPlayer::m_jumpChapter
int m_jumpChapter
Definition: mythplayer.h:418
MythDVDBuffer::GetMenuSubtitle
AVSubtitle * GetMenuSubtitle(uint &Version)
returns dvd menu button information if available.
Definition: mythdvdbuffer.cpp:1425
MythPlayerCaptionsUI::EnableCaptions
virtual void EnableCaptions(uint Mode, bool UpdateOSD=true)
Definition: mythplayercaptionsui.cpp:198
kDisplayDVDButton
@ kDisplayDVDButton
Definition: videoouttypes.h:19
MythDVDBuffer::SetDVDSpeed
void SetDVDSpeed(void)
set dvd speed. uses the constant DVD_DRIVE_SPEED table
Definition: mythdvdbuffer.cpp:1968
MythPlayer::CalcMaxFFTime
virtual long long CalcMaxFFTime(long long ff, bool setjump=true) const
CalcMaxFFTime(ffframes): forward ffframes forward.
Definition: mythplayer.cpp:1453
MythVideoScanTracker::AutoDeint
virtual void AutoDeint(MythVideoFrame *Frame, MythVideoOutput *VideoOutput, std::chrono::microseconds FrameInterval, bool AllowLock=true)
Check whether deinterlacing should be enabled.
Definition: mythvideoscantracker.cpp:177
MythDVDPlayer::ResetPlaying
void ResetPlaying(bool ResetFrames=true) override
Definition: mythdvdplayer.cpp:304
MythMediaBuffer::IsBookmarkAllowed
virtual bool IsBookmarkAllowed(void)
Definition: mythmediabuffer.h:127
MythDVDPlayer::DisplayPauseFrame
void DisplayPauseFrame(void) override
Definition: mythdvdplayer.cpp:81
DecoderBase::UpdateFramesPlayed
virtual void UpdateFramesPlayed(void)
Definition: decoderbase.cpp:876
MythPlayerAVSync::DisplayTimecode
std::chrono::milliseconds & DisplayTimecode()
Definition: mythplayeravsync.h:31
Buffer
Definition: MythExternControl.h:36
MythDVDBuffer::GetCellStart
std::chrono::seconds GetCellStart(void) const
get the start of the cell in seconds
Definition: mythdvdbuffer.cpp:1160
MythPlayerUI::InitialSeek
virtual void InitialSeek()
Definition: mythplayerui.cpp:106
MythDVDBuffer::GetNumAngles
int GetNumAngles(void) const
Definition: mythdvdbuffer.cpp:450
MythVideoScanTracker::SetScanType
void SetScanType(FrameScanType Scan, MythVideoOutput *VideoOutput, std::chrono::microseconds FrameInterval)
Definition: mythvideoscantracker.cpp:122
MythDVDPlayer::GetNumChapters
int GetNumChapters(void) override
Definition: mythdvdplayer.cpp:499
MythDVDPlayer::GoToDVDProgram
void GoToDVDProgram(bool Direction)
Definition: mythdvdplayer.cpp:634
kScan_Interlaced
@ kScan_Interlaced
Definition: videoouttypes.h:98
Clear
#define Clear(a)
Definition: audiooutputopensles.cpp:54
MythDVDPlayer::MythDVDPlayer
MythDVDPlayer(MythMainWindow *MainWindow, TV *Tv, PlayerContext *Context, PlayerFlags Flags=kNoFlags)
Definition: mythdvdplayer.cpp:11
MythDVDPlayer::GetBookmark
uint64_t GetBookmark(void) override
Definition: mythdvdplayer.cpp:372
MythDVDPlayer::DecoderPauseCheck
void DecoderPauseCheck(void) override
Definition: mythdvdplayer.cpp:89
TC_AUDIO
@ TC_AUDIO
Definition: mythplayer.h:58
MythDVDBuffer::GetNameAndSerialNum
bool GetNameAndSerialNum(QString &Name, QString &SerialNumber) override
Get the dvd title and serial num.
Definition: mythdvdbuffer.cpp:1908
MythTimer::addMSecs
void addMSecs(std::chrono::milliseconds ms)
Adds an offset to the last call to start() or restart().
Definition: mythtimer.cpp:146
MythDVDBuffer::GetPart
int GetPart(void) const
Definition: mythdvdbuffer.cpp:440
MythPlayer::m_decodeOneFrame
bool m_decodeOneFrame
Definition: mythplayer.h:397
audiooutput.h
MythDVDPlayer::m_stillFrameTimer
MythTimer m_stillFrameTimer
Definition: mythdvdplayer.h:82
AvFormatDecoder::CanHandle
static bool CanHandle(TestBufferVec &testbuf, const QString &filename)
Perform an av_probe_input_format on the passed data to see if we can decode it with this class.
Definition: avformatdecoder.cpp:840
MythDVDPlayer::DoFFRewSkip
void DoFFRewSkip(void) override
Definition: mythdvdplayer.cpp:100
MythPlayer::m_totalLength
std::chrono::seconds m_totalLength
Definition: mythplayer.h:434
MythDVDPlayer::PrebufferEnoughFrames
bool PrebufferEnoughFrames(int MinBuffers=0) override
Definition: mythdvdplayer.cpp:95
PlayerContext
Definition: playercontext.h:53
MythDVDBuffer::IsStillFramePending
bool IsStillFramePending(void) const
Definition: mythdvdbuffer.cpp:1174
MythDVDBuffer::NumMenuButtons
int NumMenuButtons(void) const
Definition: mythdvdbuffer.cpp:1712
MythDVDPlayer::m_initialSubtitleTrack
int m_initialSubtitleTrack
Definition: mythdvdplayer.h:78
MythDVDPlayer::SetTrack
void SetTrack(uint Type, uint TrackNo) override
Definition: mythdvdplayer.cpp:488
MythPlayerCaptionsUI::CaptionsStateChanged
void CaptionsStateChanged(MythCaptionsState &CaptionsState)
MythDVDPlayer::GoToMenu
void GoToMenu(const QString &Menu)
Definition: mythdvdplayer.cpp:617
MythPlayer::DoFFRewSkip
virtual void DoFFRewSkip(void)
Definition: mythplayer.cpp:1173
MythDVDBuffer::WaitSkip
void WaitSkip(void)
Definition: mythdvdbuffer.cpp:1216
MythPlayer::JumpToFrame
virtual bool JumpToFrame(uint64_t frame)
Definition: mythplayer.cpp:895
MythMediaBuffer::DVD
const MythDVDBuffer * DVD(void) const
Definition: mythmediabuffer.cpp:1841
MythPlayer::m_allPaused
bool m_allPaused
Definition: mythplayer.h:402
MythPlayerUI::ChangeSpeed
void ChangeSpeed() override
Definition: mythplayerui.cpp:396
MythPlayerCaptionsUI::m_captionsState
MythCaptionsState m_captionsState
Definition: mythplayercaptionsui.h:70
MythDVDPlayer::m_stillFrameLength
std::chrono::seconds m_stillFrameLength
Definition: mythdvdplayer.h:83
MythVideoFrame
Definition: mythframe.h:88
kDisplayAVSubtitle
@ kDisplayAVSubtitle
Definition: videoouttypes.h:15
MythDVDPlayer::DoDisableDVDSubtitles
void DoDisableDVDSubtitles()
Definition: mythdvdplayer.cpp:54
MythDVDPlayer::SetStillFrameTimeout
void SetStillFrameTimeout(std::chrono::seconds Length)
Definition: mythdvdplayer.cpp:686
MythDVDPlayer::SetBookmark
void SetBookmark(bool Clear=false) override
Definition: mythdvdplayer.cpp:324
MythVideoOutput::GetLastShownFrame
virtual MythVideoFrame * GetLastShownFrame()
Returns frame from the head of the ready to be displayed queue, if StartDisplayingFrame has been call...
Definition: mythvideoout.cpp:316
MythDVDPlayer::DoJumpChapter
bool DoJumpChapter(int Chapter) override
Definition: mythdvdplayer.cpp:520
kOSDTimeout_Med
@ kOSDTimeout_Med
Definition: osd.h:60
MythDVDBuffer::SwitchAngle
bool SwitchAngle(int Angle)
Definition: mythdvdbuffer.cpp:2158
DecoderBase::SeekReset
virtual void SeekReset(long long newkey, uint skipFrames, bool doFlush, bool discardFrames)
Definition: decoderbase.cpp:75
MythPlayer::FastForward
virtual bool FastForward(float seconds)
Definition: mythplayer.cpp:842
MythDVDPlayer::ChangeSpeed
void ChangeSpeed(void) override
Definition: mythdvdplayer.cpp:420
MythDVDPlayer::VideoLoop
bool VideoLoop(void) override
Definition: mythdvdplayer.cpp:124
MythDVDPlayer::EventStart
void EventStart(void) override
Definition: mythdvdplayer.cpp:255
LOC
#define LOC
Definition: mythdvdplayer.cpp:9
MythDVDPlayer::m_initialTitle
int m_initialTitle
Definition: mythdvdplayer.h:76
MythMainWindow
Definition: mythmainwindow.h:28
MythVideoOutput::UpdatePauseFrame
virtual void UpdatePauseFrame(std::chrono::milliseconds &, FrameScanType=kScan_Progressive)
Definition: mythvideoout.h:87
MythDVDPlayer::FastForward
bool FastForward(float Seconds) override
Definition: mythdvdplayer.cpp:231
MythDVDPlayer::m_initialAudioTrack
int m_initialAudioTrack
Definition: mythdvdplayer.h:77
MythCaptionsOverlay::DisplayDVDButton
void DisplayDVDButton(AVSubtitle *DVDButton, QRect &Pos)
Definition: mythcaptionsoverlay.cpp:216
MythPlayer::ReleaseNextVideoFrame
virtual void ReleaseNextVideoFrame(MythVideoFrame *buffer, std::chrono::milliseconds timecode, bool wrap=true)
Places frame on the queue of frames ready for display.
Definition: mythplayer.cpp:604
MythDVDPlayer::GetAngleName
QString GetAngleName(int Angle) const override
Definition: mythdvdplayer.cpp:664
millisecondsFromFloat
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.
Definition: mythchrono.h:91
MythDVDPlayer::DisplayDVDButton
void DisplayDVDButton(void)
Definition: mythdvdplayer.cpp:558
MythDVDPlayer::GetNumAngles
int GetNumAngles(void) const override
Definition: mythdvdplayer.cpp:650
tv_play.h
MythPlayer::Rewind
virtual bool Rewind(float seconds)
Definition: mythplayer.cpp:872
MythDVDBuffer::GetDVDStateSnapshot
bool GetDVDStateSnapshot(QString &State)
Get a snapshot of the current DVD VM state.
Definition: mythdvdbuffer.cpp:1917
MythDVDPlayer::m_buttonVersion
int m_buttonVersion
Definition: mythdvdplayer.h:72
TV
Control TV playback.
Definition: tv_play.h:154