MythTV  master
mythdvdplayer.cpp
Go to the documentation of this file.
1 #include <algorithm>
2 
3 // MythTV
5 
6 #include "DVD/mythdvdbuffer.h"
7 #include "DVD/mythdvddecoder.h"
8 #include "DVD/mythdvdplayer.h"
9 #include "tv_play.h"
10 
11 #define LOC QString("DVDPlayer: ")
12 
14  : MythPlayerUI(MainWindow, Tv, Context, Flags)
15 {
16  connect(Tv, &TV::GoToMenu, this, &MythDVDPlayer::GoToMenu);
19 }
20 
22  std::chrono::microseconds FrameInterval, bool AllowLock)
23 {
24  bool dummy = false;
26  {
27  MythPlayerUI::AutoDeint(Frame, VideoOutput, FrameInterval, AllowLock);
28  return;
29  }
30 
32 }
33 
42  std::chrono::milliseconds Timecode, bool /*wrap*/)
43 {
46 }
47 
49 {
50  EofState eof = GetEof();
51  // DeleteMap and EditMode from the parent MythPlayer should not be
52  // relevant here.
53  return eof != kEofStateNone && !m_allPaused;
54 }
55 
57 {
59  SetCaptionsEnabled(false, false);
60 }
61 
63 {
67 }
68 
70 {
72  {
73  int track = GetTrack(kTrackTypeSubtitle);
74  if (track >= 0 && track < static_cast<int>(m_decoder->GetTrackCount(kTrackTypeSubtitle)))
75  {
76  StreamInfo stream = m_decoder->GetTrackInfo(kTrackTypeSubtitle, static_cast<uint>(track));
78  }
79  }
81 }
82 
84 {
89 }
90 
92 {
95 }
96 
97 bool MythDVDPlayer::PrebufferEnoughFrames(int /*MinBuffers*/)
98 {
100 }
101 
103 {
105  if (m_decoderChangeLock.tryLock(1))
106  {
107  if (m_decoder)
109  m_decoderChangeLock.unlock();
110  }
111 }
112 
114 {
116 }
117 
119 {
120  if (!m_initialDvdState.isEmpty())
122 
124 }
125 
127 {
128  if (!m_playerCtx->m_buffer->IsDVD())
129  {
130  SetErrored("RingBuffer is not a DVD.");
131  return !IsErrored();
132  }
133 
134  int nbframes = 0;
135  if (m_videoOutput)
136  nbframes = m_videoOutput->ValidVideoFrames();
137 
138 #if 0
139  LOG(VB_PLAYBACK, LOG_DEBUG,
140  LOC + QString("Validframes %1, FreeFrames %2, VideoPaused %3")
141  .arg(nbframes).arg(videoOutput->FreeVideoFrames()).arg(videoPaused));
142 #endif
143 
144  // completely drain the video buffers for certain situations
145  bool release_all = m_playerCtx->m_buffer->DVD()->DVDWaitingForPlayer() &&
146  (nbframes > 0);
147  bool release_one = (nbframes > 1) && m_videoPaused && !m_allPaused &&
151  if (release_all || release_one)
152  {
153  if (nbframes < 5 && m_videoOutput)
155 
156  // if we go below the pre-buffering limit, the player will pause
157  // so do this 'manually'
158  DisplayNormalFrame(false);
159  // unpause the still frame if more frames become available
160  if (m_dvdStillFrameShowing && nbframes > 1)
161  {
162  m_dvdStillFrameShowing = false;
163  UnpauseVideo();
164  }
165  return !IsErrored();
166  }
167 
168  // clear the mythtv imposed wait state
170  {
171  LOG(VB_PLAYBACK, LOG_INFO, LOC + "Clearing MythTV DVD wait state");
173  ClearAfterSeek(true);
174  if (m_videoPaused && !m_allPaused)
175  UnpauseVideo();
176  return !IsErrored();
177  }
178 
179  // wait for the video buffers to drain
180  if (nbframes < 2)
181  {
182  // clear the DVD wait state
183  if (m_playerCtx->m_buffer->DVD()->IsWaiting())
184  {
185  LOG(VB_PLAYBACK, LOG_INFO, LOC + "Clearing DVD wait state");
187  if (m_videoPaused && !m_allPaused)
188  UnpauseVideo();
189  return !IsErrored();
190  }
191 
192  // the still frame is treated as a pause frame
194  {
195  // ensure we refresh the pause frame
197  m_needNewPauseFrame = true;
198 
199  // we are in a still frame so pause video output
200  if (!m_videoPaused)
201  {
202  PauseVideo();
203  m_dvdStillFrameShowing = true;
204  return !IsErrored();
205  }
206 
207  // see if the pause frame has timed out
208  StillFrameCheck();
209 
210  // flag if we have no frame
211  if (nbframes == 0)
212  {
213  LOG(VB_PLAYBACK, LOG_WARNING, LOC + "In DVD Menu: No video frames in queue");
214  std::this_thread::sleep_for(10ms);
215  return !IsErrored();
216  }
217 
218  m_dvdStillFrameShowing = true;
219  }
220  }
221 
222  // unpause the still frame if more frames become available
223  if (m_dvdStillFrameShowing && nbframes > 1)
224  {
225  UnpauseVideo();
226  m_dvdStillFrameShowing = false;
227  return !IsErrored();
228  }
229 
230  return MythPlayerUI::VideoLoop();
231 }
232 
233 bool MythDVDPlayer::FastForward(float Seconds)
234 {
235  if (m_decoder)
237  return MythPlayerUI::FastForward(Seconds);
238 }
239 
240 bool MythDVDPlayer::Rewind(float Seconds)
241 {
242  if (m_decoder)
244  return MythPlayerUI::Rewind(Seconds);
245 }
246 
248 {
249  if (Frame == ~0x0ULL)
250  return false;
251 
252  if (m_decoder)
255 }
256 
258 {
259  if (m_playerCtx->m_buffer->DVD())
260  m_playerCtx->m_buffer->DVD()->SetParent(this);
261 
262  m_playerCtx->LockPlayingInfo(__FILE__, __LINE__);
264  {
265  QString name;
266  QString serialid;
267  if (m_playerCtx->m_playingInfo->GetTitle().isEmpty() &&
268  m_playerCtx->m_buffer->DVD() &&
269  m_playerCtx->m_buffer->DVD()->GetNameAndSerialNum(name, serialid))
270  {
272  }
273  }
274  m_playerCtx->UnlockPlayingInfo(__FILE__, __LINE__);
275 
277 }
278 
280 {
282 
283  if (m_initialTitle > -1)
285 
286  if (m_initialAudioTrack > -1)
289  if (m_initialSubtitleTrack > -1)
292 
293  if (m_bookmarkSeek > 30)
294  {
295  // we need to trigger a dvd cell change to ensure the new title length
296  // is set and the position map updated accordingly
297  m_decodeOneFrame = true;
298  int count = 0;
299  while (count++ < 100 && m_decodeOneFrame)
300  std::this_thread::sleep_for(50ms);
301  }
304 }
305 
306 void MythDVDPlayer::ResetPlaying(bool /*ResetFrames*/)
307 {
309 }
310 
312 {
313  if (m_playerCtx->m_buffer->DVD())
314  m_playerCtx->m_buffer->DVD()->SetParent(nullptr);
315 }
316 
317 bool MythDVDPlayer::PrepareAudioSample(std::chrono::milliseconds &Timecode)
318 {
320  WrapTimecode(Timecode, TC_AUDIO);
321 
322  return m_playerCtx->m_buffer->IsDVD() &&
324 }
325 
327 {
328  if (!m_playerCtx->m_buffer->IsDVD())
329  return;
330 
331  QStringList fields;
332  QString name;
333  QString serialid;
334  QString dvdstate;
335 
336  if (!m_playerCtx->m_buffer->IsInMenu() &&
338  {
339  if (!m_playerCtx->m_buffer->DVD()->GetNameAndSerialNum(name, serialid))
340  {
341  LOG(VB_GENERAL, LOG_ERR, LOC +
342  "DVD has no name and serial number. Cannot set bookmark.");
343  return;
344  }
345 
346  if (!Clear && !m_playerCtx->m_buffer->DVD()->GetDVDStateSnapshot(dvdstate))
347  {
348  LOG(VB_GENERAL, LOG_ERR, LOC +
349  "Unable to retrieve DVD state. Cannot set bookmark.");
350  return;
351  }
352 
353  m_playerCtx->LockPlayingInfo(__FILE__, __LINE__);
355  {
356  fields += serialid;
357  fields += name;
358 
359  if (!Clear)
360  {
361  LOG(VB_PLAYBACK, LOG_INFO, LOC + "Set bookmark");
362  fields += dvdstate;
363  }
364  else
365  {
366  LOG(VB_PLAYBACK, LOG_INFO, LOC + "Clear bookmark");
367  }
368 
370 
371  }
372  m_playerCtx->UnlockPlayingInfo(__FILE__, __LINE__);
373  }
374 }
375 
377 {
379  return 0;
380 
381  QString name;
382  QString serialid;
383  uint64_t frames = 0;
384  m_playerCtx->LockPlayingInfo(__FILE__, __LINE__);
386  {
387  if (!m_playerCtx->m_buffer->DVD()->GetNameAndSerialNum(name, serialid))
388  {
389  m_playerCtx->UnlockPlayingInfo(__FILE__, __LINE__);
390  return 0;
391  }
392 
393  QStringList dvdbookmark = m_playerCtx->m_playingInfo->QueryDVDBookmark(serialid);
394 
395  if (!dvdbookmark.empty())
396  {
397  QStringList::Iterator it = dvdbookmark.begin();
398 
399  if (dvdbookmark.count() == 1)
400  {
401  m_initialDvdState = *it;
402  frames = ~0x0ULL;
403  LOG(VB_PLAYBACK, LOG_INFO, LOC + "Get Bookmark: bookmark found");
404  }
405  else
406  {
407  // Legacy bookmarks
408  m_initialTitle = (*it).toInt();
409  frames = ((*++it).toLongLong() & 0xffffffffLL);
410  m_initialAudioTrack = (*++it).toInt();
411  m_initialSubtitleTrack = (*++it).toInt();
412  LOG(VB_PLAYBACK, LOG_INFO, LOC +
413  QString("Get Bookmark: title %1 audiotrack %2 subtrack %3 "
414  "frame %4")
416  .arg(m_initialSubtitleTrack).arg(frames));
417  }
418  }
419  }
420  m_playerCtx->UnlockPlayingInfo(__FILE__, __LINE__);
421  return frames;
422 }
423 
425 {
426  if (m_stillFrameLength > 0s)
427  {
428  m_stillFrameTimerLock.lock();
429  // Get the timestretched elapsed time and transform
430  // it to what the unstretched value would have been
431  // had we been playing with the new timestretch value
432  // all along
433  auto elapsed = millisecondsFromFloat(m_stillFrameTimer.elapsed().count() *
436  m_stillFrameTimer.addMSecs(elapsed);
437  m_stillFrameTimerLock.unlock();
438  }
439 
441 
442  if (m_decoder)
444  if (m_playerCtx->m_buffer->IsDVD())
445  {
446  if (m_playSpeed > 1.0F)
448  else
450  }
451 }
452 
453 long long MythDVDPlayer::CalcMaxFFTime(long long FastFwd, bool Setjump) const
454 {
455  if ((m_totalFrames > 0) && m_playerCtx->m_buffer->IsDVD() &&
457  return 0;
458  return MythPlayerUI::CalcMaxFFTime(FastFwd, Setjump);
459 }
460 
461 std::chrono::milliseconds MythDVDPlayer::GetMillisecondsPlayed(bool /*HonorCutList*/)
462 {
463  if (!m_playerCtx->m_buffer->IsDVD())
464  return 0ms;
465 
466  std::chrono::milliseconds played = m_playerCtx->m_buffer->DVD()->GetCurrentTime();
467 
468  if (m_stillFrameLength > 0s)
469  {
470  if (m_stillFrameLength == 255s)
471  return -1ms;
473  }
474 
475  return played;
476 }
477 
478 std::chrono::milliseconds MythDVDPlayer::GetTotalMilliseconds(bool /*HonorCutList*/) const
479 {
480  std::chrono::milliseconds total = m_totalLength;
481 
482  if (m_stillFrameLength > 0s)
483  {
484  if (m_stillFrameLength == 255s)
485  return -1ms;
486  total = duration_cast<std::chrono::milliseconds>(m_stillFrameLength);
487  }
488 
489  return total;
490 }
491 
492 void MythDVDPlayer::SetTrack(uint Type, uint TrackNo)
493 {
494  if (kTrackTypeAudio == Type)
495  {
496  StreamInfo stream = m_decoder->GetTrackInfo(Type, TrackNo);
497  m_playerCtx->m_buffer->DVD()->SetTrack(Type, stream.m_stream_id);
498  }
499 
500  MythPlayerUI::SetTrack(Type, TrackNo);
501 }
502 
504 {
505  if (!m_playerCtx->m_buffer->IsDVD())
506  return 0;
507  return m_playerCtx->m_buffer->DVD()->NumPartsInTitle();
508 }
509 
511 {
512  if (!m_playerCtx->m_buffer->IsDVD())
513  return 0;
514  return m_playerCtx->m_buffer->DVD()->GetPart();
515 }
516 
517 void MythDVDPlayer::GetChapterTimes(QList<std::chrono::seconds> &Times)
518 {
519  if (!m_playerCtx->m_buffer->IsDVD())
520  return;
522 }
523 
525 {
526  if (!m_playerCtx->m_buffer->IsDVD())
527  return false;
528 
529  int total = GetNumChapters();
530  int current = GetCurrentChapter();
531 
532  if (Chapter < 0 || Chapter > total)
533  {
534  if (Chapter < 0)
535  {
536  Chapter = current -1;
537  Chapter = std::max(Chapter, 0);
538  }
539  else if (Chapter > total)
540  {
541  Chapter = current + 1;
542  Chapter = std::min(Chapter, total);
543  }
544  }
545 
546  bool success = m_playerCtx->m_buffer->DVD()->PlayTrack(Chapter);
547  if (success)
548  {
549  if (m_decoder)
550  {
552  if (m_playerCtx->m_buffer->DVD()->GetCellStart() == 0s)
553  m_decoder->SeekReset(static_cast<long long>(m_framesPlayed), 0, true, true);
554  }
556  }
557 
558  m_jumpChapter = 0;
559  return success;
560 }
561 
563 {
564  if (!m_playerCtx->m_buffer->IsDVD())
565  return;
566 
567  uint buttonversion = 0;
568  AVSubtitle *dvdSubtitle = m_playerCtx->m_buffer->DVD()->GetMenuSubtitle(buttonversion);
569  bool numbuttons = m_playerCtx->m_buffer->DVD()->NumMenuButtons() != 0;
570 
571  bool expired = false;
572 
573  MythVideoFrame *currentFrame = m_videoOutput ? m_videoOutput->GetLastShownFrame() : nullptr;
574 
575  if (!currentFrame)
576  {
578  return;
579  }
580 
581  if (dvdSubtitle &&
582  (dvdSubtitle->end_display_time > dvdSubtitle->start_display_time) &&
583  (dvdSubtitle->end_display_time < currentFrame->m_timecode.count()))
584  {
585  expired = true;
586  }
587 
588  // nothing to do
589  if (!expired && (buttonversion == (static_cast<uint>(m_buttonVersion))))
590  {
592  return;
593  }
594 
595  // clear any buttons
596  if (!numbuttons || !dvdSubtitle || (buttonversion == 0) || expired)
597  {
599  m_buttonVersion = 0;
601  return;
602  }
603 
604  if ((currentFrame->m_timecode > 0ms) &&
605  (dvdSubtitle->start_display_time > currentFrame->m_timecode.count()))
606  {
608  return;
609  }
610 
611  m_buttonVersion = static_cast<int>(buttonversion);
612  QRect buttonPos = m_playerCtx->m_buffer->DVD()->GetButtonCoords();
613  m_captionsOverlay.DisplayDVDButton(dvdSubtitle, buttonPos);
614  uint oldcaptions = m_captionsState.m_textDisplayMode;
616  if (oldcaptions != m_captionsState.m_textDisplayMode)
619 }
620 
621 void MythDVDPlayer::GoToMenu(const QString& Menu)
622 {
623  if (!m_playerCtx->m_buffer->IsDVD())
624  return;
625 
626  uint oldcaptions = m_captionsState.m_textDisplayMode;
628  if (oldcaptions != m_captionsState.m_textDisplayMode)
630 
631  if (!m_playerCtx->m_buffer->DVD()->GoToMenu(Menu))
632  {
633  UpdateOSDMessage(tr("DVD Menu Not Available"), kOSDTimeout_Med);
634  LOG(VB_GENERAL, LOG_ERR, "No DVD Menu available.");
635  }
636 }
637 
638 void MythDVDPlayer::GoToDVDProgram(bool Direction)
639 {
640  if (auto * dvd = m_playerCtx->m_buffer->DVD(); dvd)
641  {
642  if (Direction)
643  dvd->GoToPreviousProgram();
644  else
645  dvd->GoToNextProgram();
646  }
647 }
648 
650 {
651  return (m_stillFrameLength > 0s);
652 }
653 
655 {
657  return m_playerCtx->m_buffer->DVD()->GetNumAngles();
658  return 0;
659 }
660 
662 {
664  return m_playerCtx->m_buffer->DVD()->GetCurrentAngle();
665  return -1;
666 }
667 
668 QString MythDVDPlayer::GetAngleName(int Angle) const
669 {
670  if (Angle >= 1 && Angle <= GetNumAngles())
671  {
672  QString name = tr("Angle %1").arg(Angle);
673  return name;
674  }
675  return {};
676 }
677 
679 {
680  int total = GetNumAngles();
681  if (!total || Angle == GetCurrentAngle())
682  return false;
683 
684  if (Angle < 1 || Angle > total)
685  Angle = 1;
686 
687  return m_playerCtx->m_buffer->DVD()->SwitchAngle(Angle);
688 }
689 
690 void MythDVDPlayer::SetStillFrameTimeout(std::chrono::seconds Length)
691 {
692  if (Length != m_stillFrameLength)
693  {
694  m_stillFrameTimerLock.lock();
695  m_stillFrameLength = Length;
697  m_stillFrameTimerLock.unlock();
698  }
699 }
700 
702 {
703  if (m_playerCtx->m_buffer->IsDVD() &&
705  (m_stillFrameLength > 0s) && (m_stillFrameLength < 255s))
706  {
707  m_stillFrameTimerLock.lock();
708  auto elapsedTime = secondsFromFloat(m_stillFrameTimer.elapsed().count() * m_playSpeed / 1000.0F);
709  m_stillFrameTimerLock.unlock();
710  if (elapsedTime >= m_stillFrameLength)
711  {
712  LOG(VB_PLAYBACK, LOG_INFO, LOC +
713  QString("Stillframe timeout after %1 seconds (timestretch %2)")
714  .arg(m_stillFrameLength.count()).arg(static_cast<double>(m_playSpeed)));
716  m_stillFrameLength = 0s;
717  }
718  }
719 }
720 
722 {
725 }
ProgramInfo::SaveDVDBookmark
static void SaveDVDBookmark(const QStringList &fields)
Definition: programinfo.cpp:2941
MythDVDBuffer::PlayTrack
bool PlayTrack(int Track)
Definition: mythdvdbuffer.cpp:1115
MythPlayerUI::VideoStart
virtual void VideoStart()
Definition: mythplayerui.cpp:419
MythDVDBuffer::GetCurrentTime
std::chrono::seconds GetCurrentTime(void) const
Definition: mythdvdbuffer.cpp:1996
MythDVDPlayer::EnableCaptions
void EnableCaptions(uint Mode, bool OSDMsg=true) override
Definition: mythdvdplayer.cpp:69
MythDVDBuffer::IsOpen
bool IsOpen(void) const override
Definition: mythdvdbuffer.cpp:215
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:62
MythPlayerCaptionsUI::SetTrack
virtual void SetTrack(uint Type, uint TrackNo)
Definition: mythplayercaptionsui.cpp:330
MythDVDPlayer::VideoStart
void VideoStart(void) override
Definition: mythdvdplayer.cpp:118
MythDVDBuffer::TitleTimeLeft
std::chrono::seconds TitleTimeLeft(void) const
returns seconds left in the title
Definition: mythdvdbuffer.cpp:1991
MythPlayer::m_videoPaused
bool m_videoPaused
Definition: mythplayer.h:393
MythPlayer::m_decoderChangeLock
QRecursiveMutex m_decoderChangeLock
Definition: mythplayer.h:363
PlayerContext::UnlockPlayingInfo
void UnlockPlayingInfo(const char *file, int line) const
Definition: playercontext.cpp:249
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:1212
MythPlayerUI::DisplayNormalFrame
virtual bool DisplayNormalFrame(bool CheckPrebuffer=true)
Definition: mythplayerui.cpp:668
kTrackTypeSubtitle
@ kTrackTypeSubtitle
Definition: decoderbase.h:32
MythDVDPlayer::JumpToFrame
bool JumpToFrame(uint64_t Frame) override
Definition: mythdvdplayer.cpp:247
MythPlayer::m_avSync
MythPlayerAVSync m_avSync
Definition: mythplayer.h:430
MythPlayer::DecoderPauseCheck
virtual void DecoderPauseCheck(void)
Definition: mythplayer.cpp:1052
MythPlayer::m_playSpeed
float m_playSpeed
Definition: mythplayer.h:484
MythPlayer::m_frameInterval
std::chrono::microseconds m_frameInterval
always adjusted for play_speed
Definition: mythplayer.h:486
MythDVDPlayer::CreateDecoder
void CreateDecoder(TestBufferVec &Testbuf) override
Definition: mythdvdplayer.cpp:721
MythDVDBuffer::IsInStillFrame
bool IsInStillFrame(void) const override
Definition: mythdvdbuffer.cpp:225
MythDVDPlayer::HasReachedEof
bool HasReachedEof(void) const override
Definition: mythdvdplayer.cpp:48
MythPlayerCaptionsUI::GetTrack
int GetTrack(uint Type)
Definition: mythplayercaptionsui.cpp:369
MythPlayerUI::EventStart
virtual void EventStart()
Definition: mythplayerui.cpp:478
MythDVDBuffer::SetTrack
void SetTrack(uint Type, int TrackNo)
set the dvd subtitle/audio track used
Definition: mythdvdbuffer.cpp:1870
kScan_Progressive
@ kScan_Progressive
Definition: videoouttypes.h:100
MythPlayer::PrebufferEnoughFrames
virtual bool PrebufferEnoughFrames(int min_buffers=0)
Definition: mythplayer.cpp:720
StreamInfo::m_stream_id
int m_stream_id
Definition: decoderbase.h:105
Frame
Definition: zmdefines.h:102
MythDVDPlayer::m_initialDvdState
QString m_initialDvdState
Definition: mythdvdplayer.h:79
mythdvdbuffer.h
MythCaptionsOverlay::ClearSubtitles
void ClearSubtitles()
Definition: mythcaptionsoverlay.cpp:206
kOSDTimeout_Med
@ kOSDTimeout_Med
Definition: osd.h:60
EofState
EofState
Definition: decoderbase.h:68
MythCoreContext::IsDatabaseIgnored
bool IsDatabaseIgnored(void) const
/brief Returns true if database is being ignored.
Definition: mythcorecontext.cpp:880
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:21
MythMediaBuffer::IgnoreWaitStates
virtual void IgnoreWaitStates(bool)
Definition: mythmediabuffer.h:139
MythPlayer::IsErrored
bool IsErrored(void) const
Definition: mythplayer.cpp:1941
MythMediaBuffer::IsDVD
bool IsDVD(void) const
Definition: mythmediabuffer.cpp:1840
DecoderBase::GetMythCodecContext
MythCodecContext * GetMythCodecContext(void)
Definition: decoderbase.h:254
LOG
#define LOG(_MASK_, _LEVEL_, _QSTRING_)
Definition: mythlogging.h:39
MythDVDPlayer::GetMillisecondsPlayed
std::chrono::milliseconds GetMillisecondsPlayed(bool HonorCutList) override
Definition: mythdvdplayer.cpp:461
MythDVDBuffer::GoToMenu
bool GoToMenu(const QString &str)
jump to a dvd root or chapter menu
Definition: mythdvdbuffer.cpp:1250
PlayerFlags
PlayerFlags
Definition: mythplayer.h:64
MythPlayer::GetEof
EofState GetEof(void) const
Definition: mythplayer.cpp:1064
MythMediaBuffer::IsInMenu
virtual bool IsInMenu(void) const
Definition: mythmediabuffer.h:140
MythPlayer::m_nextPlaySpeed
float m_nextPlaySpeed
Definition: mythplayer.h:483
MythPlayerUI::VideoLoop
virtual bool VideoLoop()
Definition: mythplayerui.cpp:496
MythDVDBuffer::SkipDVDWaitingForPlayer
void SkipDVDWaitingForPlayer(void)
Definition: mythdvdbuffer.cpp:1233
MythDVDPlayer::IsInStillFrame
bool IsInStillFrame() const override
Definition: mythdvdplayer.cpp:649
TVPlaybackState::GoToDVDProgram
void GoToDVDProgram(bool Direction)
MythDVDPlayer::PrepareAudioSample
bool PrepareAudioSample(std::chrono::milliseconds &Timecode) override
Definition: mythdvdplayer.cpp:317
MythCaptionsState::m_textDisplayMode
uint m_textDisplayMode
Definition: mythplayerstate.h:70
MythDVDPlayer::SwitchAngle
bool SwitchAngle(int Angle) override
Definition: mythdvdplayer.cpp:678
MythDate::current
QDateTime current(bool stripped)
Returns current Date and Time in UTC.
Definition: mythdate.cpp:15
MythDVDDecoder
Definition: mythdvddecoder.h:14
MythPlayer::SetErrored
void SetErrored(const QString &reason)
Definition: mythplayer.cpp:1917
MythPlayer::m_needNewPauseFrame
bool m_needNewPauseFrame
Definition: mythplayer.h:391
TVPlaybackState::GoToMenu
void GoToMenu(const QString &Menu)
MythDVDPlayer::InitialSeek
void InitialSeek(void) override
Definition: mythdvdplayer.cpp:279
MythPlayer::SetDecoder
void SetDecoder(DecoderBase *dec)
Sets the stream decoder, deleting any existing recorder.
Definition: mythplayer.cpp:1875
MythDVDBuffer::SetParent
void SetParent(MythDVDPlayer *Parent)
Definition: mythdvdbuffer.cpp:2181
MythDVDPlayer::m_stillFrameTimerLock
QRecursiveMutex m_stillFrameTimerLock
Definition: mythdvdplayer.h:84
MythDVDBuffer::DVDWaitingForPlayer
bool DVDWaitingForPlayer(void) const
Definition: mythdvdbuffer.cpp:434
MythPlayerOverlayUI::UpdateOSDMessage
void UpdateOSDMessage(const QString &Message)
Definition: mythplayeroverlayui.cpp:76
MythDVDBuffer::GetCurrentAngle
int GetCurrentAngle(void) const
Definition: mythdvdbuffer.cpp:444
MythPlayerUI
Definition: mythplayerui.h:12
MythMediaBuffer::GetFilename
QString GetFilename(void) const
Definition: mythmediabuffer.cpp:1749
MythPlayer::UnpauseVideo
void UnpauseVideo(void)
Definition: mythplayer.cpp:224
DecoderBase::GetTrackCount
virtual uint GetTrackCount(uint Type)
Definition: decoderbase.cpp:897
MythPlayer::m_decoder
DecoderBase * m_decoder
Definition: mythplayer.h:362
kEofStateNone
@ kEofStateNone
Definition: decoderbase.h:70
MythDVDPlayer::GetChapterTimes
void GetChapterTimes(QList< std::chrono::seconds > &Times) override
Definition: mythdvdplayer.cpp:517
MythPlayer::m_framesPlayed
uint64_t m_framesPlayed
Definition: mythplayer.h:424
MythDVDPlayer::PreProcessNormalFrame
void PreProcessNormalFrame(void) override
Definition: mythdvdplayer.cpp:113
kDisplayDVDButton
@ kDisplayDVDButton
Definition: videoouttypes.h:19
DecoderBase::GetTrackInfo
StreamInfo GetTrackInfo(uint Type, uint TrackNo)
Definition: decoderbase.cpp:978
MythVideoOutput::ValidVideoFrames
virtual int ValidVideoFrames() const
Returns number of frames that are fully decoded.
Definition: mythvideoout.cpp:278
StreamInfo
Definition: decoderbase.h:75
MythDVDBuffer::PlayTitleAndPart
void PlayTitleAndPart(int Title, int Part)
Definition: mythdvdbuffer.cpp:1971
MythDVDBuffer::GetButtonCoords
QRect GetButtonCoords(void)
get coordinates of highlighted button
Definition: mythdvdbuffer.cpp:1456
PlayerContext::m_playingInfo
ProgramInfo * m_playingInfo
Currently playing info.
Definition: playercontext.h:117
MythMediaBuffer::IsInDiscMenuOrStillFrame
virtual bool IsInDiscMenuOrStillFrame(void) const
Definition: mythmediabuffer.h:142
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:239
MythPlayer::m_bookmarkSeek
uint64_t m_bookmarkSeek
Definition: mythplayer.h:413
MythVideoFrame::m_timecode
std::chrono::milliseconds m_timecode
Definition: mythframe.h:130
ProgramInfo::GetTitle
QString GetTitle(void) const
Definition: programinfo.h:362
MythDVDPlayer::StillFrameCheck
void StillFrameCheck(void)
Definition: mythdvdplayer.cpp:701
MythPlayer::m_videoOutput
MythVideoOutput * m_videoOutput
Definition: mythplayer.h:364
ProgramInfo::QueryDVDBookmark
QStringList QueryDVDBookmark(const QString &serialid) const
Queries "dvdbookmark" table for bookmarking DVD serial number.
Definition: programinfo.cpp:2908
MythCodecContext::IsDeinterlacing
virtual bool IsDeinterlacing(bool &, bool=false)
Definition: mythcodeccontext.h:156
MythPlayerCaptionsUI::m_captionsOverlay
MythCaptionsOverlay m_captionsOverlay
Definition: mythplayercaptionsui.h:70
PlayerContext::m_buffer
MythMediaBuffer * m_buffer
Definition: playercontext.h:116
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:1298
MythPlayer::PauseVideo
void PauseVideo(void)
Definition: mythplayer.cpp:216
MythPlayer::ClearAfterSeek
void ClearAfterSeek(bool clearvideobuffers=true)
This is to support seeking...
Definition: mythplayer.cpp:1675
MythDVDPlayer::DisableDVDSubtitles
void DisableDVDSubtitles()
MythPlayer::m_totalFrames
uint64_t m_totalFrames
Definition: mythplayer.h:425
MythPlayer::ResetPlaying
virtual void ResetPlaying(bool resetframes=true)
Definition: mythplayer.cpp:913
MythDVDBuffer::RestoreDVDStateSnapshot
bool RestoreDVDStateSnapshot(const QString &State)
Restore a DVD VM from a snapshot.
Definition: mythdvdbuffer.cpp:1942
kDisplayAVSubtitle
@ kDisplayAVSubtitle
Definition: videoouttypes.h:15
MythDVDPlayer::GetTotalMilliseconds
std::chrono::milliseconds GetTotalMilliseconds(bool HonorCutList) const override
Definition: mythdvdplayer.cpp:478
MythDVDPlayer::GetCurrentAngle
int GetCurrentAngle(void) const override
Definition: mythdvdplayer.cpp:661
ProgramInfo::SetTitle
void SetTitle(const QString &t, const QString &st=nullptr)
Definition: programinfo.cpp:1162
TestBufferVec
std::vector< char > TestBufferVec
Definition: decoderbase.h:24
MythPlayer::m_playerCtx
PlayerContext * m_playerCtx
Definition: mythplayer.h:366
MythPlayerUI::DisplayPauseFrame
virtual void DisplayPauseFrame()
Definition: mythplayerui.cpp:646
MythPlayerCaptionsUI::SetCaptionsEnabled
void SetCaptionsEnabled(bool Enable, bool UpdateOSD=true)
Definition: mythplayercaptionsui.cpp:283
MythDVDPlayer::CalcMaxFFTime
long long CalcMaxFFTime(long long FastFwd, bool Setjump=true) const override
CalcMaxFFTime(ffframes): forward ffframes forward.
Definition: mythdvdplayer.cpp:453
MythDVDPlayer::ReleaseNextVideoFrame
void ReleaseNextVideoFrame(MythVideoFrame *Buffer, std::chrono::milliseconds Timecode, bool Wrap=true) override
Definition: mythdvdplayer.cpp:41
MythDVDBuffer::ReleaseMenuButton
void ReleaseMenuButton(void)
Definition: mythdvdbuffer.cpp:1449
MythDVDBuffer::NumPartsInTitle
int NumPartsInTitle(void) const
Definition: mythdvdbuffer.cpp:1198
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:372
MythDVDBuffer::IsWaiting
bool IsWaiting(void) const
Definition: mythdvdbuffer.cpp:1193
MythDVDPlayer::Rewind
bool Rewind(float Seconds) override
Definition: mythdvdplayer.cpp:240
MythDVDPlayer::EventEnd
virtual void EventEnd(void)
Definition: mythdvdplayer.cpp:311
MythPlayerCaptionsUI::DisableCaptions
virtual void DisableCaptions(uint Mode, bool UpdateOSD=true)
Definition: mythplayercaptionsui.cpp:147
MythDVDPlayer::GetCurrentChapter
int GetCurrentChapter(void) override
Definition: mythdvdplayer.cpp:510
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:371
MythPlayer::m_jumpChapter
int m_jumpChapter
Definition: mythplayer.h:410
kScan_Interlaced
@ kScan_Interlaced
Definition: videoouttypes.h:98
MythDVDBuffer::GetMenuSubtitle
AVSubtitle * GetMenuSubtitle(uint &Version)
returns dvd menu button information if available.
Definition: mythdvdbuffer.cpp:1434
MythPlayerCaptionsUI::EnableCaptions
virtual void EnableCaptions(uint Mode, bool UpdateOSD=true)
Definition: mythplayercaptionsui.cpp:197
MythDVDBuffer::SetDVDSpeed
void SetDVDSpeed(void)
set dvd speed. uses the constant DVD_DRIVE_SPEED table
Definition: mythdvdbuffer.cpp:1977
MythPlayer::CalcMaxFFTime
virtual long long CalcMaxFFTime(long long ff, bool setjump=true) const
CalcMaxFFTime(ffframes): forward ffframes forward.
Definition: mythplayer.cpp:1444
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:306
MythMediaBuffer::IsBookmarkAllowed
virtual bool IsBookmarkAllowed(void)
Definition: mythmediabuffer.h:136
MythDVDPlayer::DisplayPauseFrame
void DisplayPauseFrame(void) override
Definition: mythdvdplayer.cpp:83
DecoderBase::UpdateFramesPlayed
virtual void UpdateFramesPlayed(void)
Definition: decoderbase.cpp:864
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:1169
MythPlayerUI::InitialSeek
virtual void InitialSeek()
Definition: mythplayerui.cpp:107
MythDVDBuffer::GetNumAngles
int GetNumAngles(void) const
Definition: mythdvdbuffer.cpp:449
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:503
MythDVDPlayer::GoToDVDProgram
void GoToDVDProgram(bool Direction)
Definition: mythdvdplayer.cpp:638
Clear
#define Clear(a)
Definition: audiooutputopensles.cpp:54
MythDVDPlayer::MythDVDPlayer
MythDVDPlayer(MythMainWindow *MainWindow, TV *Tv, PlayerContext *Context, PlayerFlags Flags=kNoFlags)
Definition: mythdvdplayer.cpp:13
MythDVDPlayer::GetBookmark
uint64_t GetBookmark(void) override
Definition: mythdvdplayer.cpp:376
MythDVDPlayer::DecoderPauseCheck
void DecoderPauseCheck(void) override
Definition: mythdvdplayer.cpp:91
MythDVDBuffer::GetNameAndSerialNum
bool GetNameAndSerialNum(QString &Name, QString &SerialNumber) override
Get the dvd title and serial num.
Definition: mythdvdbuffer.cpp:1917
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:439
MythPlayer::m_decodeOneFrame
bool m_decodeOneFrame
Definition: mythplayer.h:389
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:829
MythDVDPlayer::DoFFRewSkip
void DoFFRewSkip(void) override
Definition: mythdvdplayer.cpp:102
MythPlayer::m_totalLength
std::chrono::seconds m_totalLength
Definition: mythplayer.h:426
TC_AUDIO
@ TC_AUDIO
Definition: mythplayer.h:57
MythDVDPlayer::PrebufferEnoughFrames
bool PrebufferEnoughFrames(int MinBuffers=0) override
Definition: mythdvdplayer.cpp:97
PlayerContext
Definition: playercontext.h:49
MythDVDBuffer::IsStillFramePending
bool IsStillFramePending(void) const
Definition: mythdvdbuffer.cpp:1183
MythDVDBuffer::NumMenuButtons
int NumMenuButtons(void) const
Definition: mythdvdbuffer.cpp:1721
MythDVDPlayer::m_initialSubtitleTrack
int m_initialSubtitleTrack
Definition: mythdvdplayer.h:78
MythDVDPlayer::SetTrack
void SetTrack(uint Type, uint TrackNo) override
Definition: mythdvdplayer.cpp:492
MythPlayerCaptionsUI::CaptionsStateChanged
void CaptionsStateChanged(MythCaptionsState &CaptionsState)
MythDVDPlayer::GoToMenu
void GoToMenu(const QString &Menu)
Definition: mythdvdplayer.cpp:621
MythPlayer::DoFFRewSkip
virtual void DoFFRewSkip(void)
Definition: mythplayer.cpp:1164
kTrackTypeAudio
@ kTrackTypeAudio
Definition: decoderbase.h:30
MythDVDBuffer::WaitSkip
void WaitSkip(void)
Definition: mythdvdbuffer.cpp:1225
MythPlayer::JumpToFrame
virtual bool JumpToFrame(uint64_t frame)
Definition: mythplayer.cpp:886
MythMediaBuffer::DVD
const MythDVDBuffer * DVD(void) const
Definition: mythmediabuffer.cpp:1850
MythPlayer::m_allPaused
bool m_allPaused
Definition: mythplayer.h:394
MythPlayerUI::ChangeSpeed
void ChangeSpeed() override
Definition: mythplayerui.cpp:397
MythPlayerCaptionsUI::m_captionsState
MythCaptionsState m_captionsState
Definition: mythplayercaptionsui.h:71
MythDVDPlayer::m_stillFrameLength
std::chrono::seconds m_stillFrameLength
Definition: mythdvdplayer.h:83
MythVideoFrame
Definition: mythframe.h:87
MythDVDPlayer::DoDisableDVDSubtitles
void DoDisableDVDSubtitles()
Definition: mythdvdplayer.cpp:56
MythDVDPlayer::SetStillFrameTimeout
void SetStillFrameTimeout(std::chrono::seconds Length)
Definition: mythdvdplayer.cpp:690
MythDVDPlayer::SetBookmark
void SetBookmark(bool Clear=false) override
Definition: mythdvdplayer.cpp:326
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:524
MythDVDBuffer::SwitchAngle
bool SwitchAngle(int Angle)
Definition: mythdvdbuffer.cpp:2166
DecoderBase::SeekReset
virtual void SeekReset(long long newkey, uint skipFrames, bool doFlush, bool discardFrames)
Definition: decoderbase.cpp:74
MythPlayer::FastForward
virtual bool FastForward(float seconds)
Definition: mythplayer.cpp:833
MythDVDPlayer::ChangeSpeed
void ChangeSpeed(void) override
Definition: mythdvdplayer.cpp:424
MythDVDPlayer::VideoLoop
bool VideoLoop(void) override
Definition: mythdvdplayer.cpp:126
MythDVDPlayer::EventStart
void EventStart(void) override
Definition: mythdvdplayer.cpp:257
LOC
#define LOC
Definition: mythdvdplayer.cpp:11
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:233
MythDVDPlayer::m_initialAudioTrack
int m_initialAudioTrack
Definition: mythdvdplayer.h:77
Mode
Mode
Definition: synaesthesia.h:23
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:595
uint
unsigned int uint
Definition: freesurround.h:24
kDisplayNone
@ kDisplayNone
Definition: videoouttypes.h:12
MythDVDPlayer::GetAngleName
QString GetAngleName(int Angle) const override
Definition: mythdvdplayer.cpp:668
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:562
MythDVDPlayer::GetNumAngles
int GetNumAngles(void) const override
Definition: mythdvdplayer.cpp:654
tv_play.h
MythPlayer::Rewind
virtual bool Rewind(float seconds)
Definition: mythplayer.cpp:863
MythDVDBuffer::GetDVDStateSnapshot
bool GetDVDStateSnapshot(QString &State)
Get a snapshot of the current DVD VM state.
Definition: mythdvdbuffer.cpp:1926
MythDVDPlayer::m_buttonVersion
int m_buttonVersion
Definition: mythdvdplayer.h:72
TV
Control TV playback.
Definition: tv_play.h:154