MythTV  master
mythdvdplayer.cpp
Go to the documentation of this file.
1 #include <algorithm>
2 
3 // MythTV
7 
8 #include "DVD/mythdvdbuffer.h"
9 #include "DVD/mythdvddecoder.h"
10 #include "DVD/mythdvdplayer.h"
11 #include "tv_play.h"
12 
13 #define LOC QString("DVDPlayer: ")
14 
16  : MythPlayerUI(MainWindow, Tv, Context, Flags)
17 {
18  connect(Tv, &TV::GoToMenu, this, &MythDVDPlayer::GoToMenu);
21 }
22 
24  std::chrono::microseconds FrameInterval, bool AllowLock)
25 {
26  bool dummy = false;
28  {
29  MythPlayerUI::AutoDeint(Frame, VideoOutput, FrameInterval, AllowLock);
30  return;
31  }
32 
34 }
35 
44  std::chrono::milliseconds Timecode, bool /*wrap*/)
45 {
48 }
49 
51 {
52  EofState eof = GetEof();
53  // DeleteMap and EditMode from the parent MythPlayer should not be
54  // relevant here.
55  return eof != kEofStateNone && !m_allPaused;
56 }
57 
59 {
61  SetCaptionsEnabled(false, false);
62 }
63 
65 {
69 }
70 
72 {
74  {
75  int track = GetTrack(kTrackTypeSubtitle);
76  if (track >= 0 && track < static_cast<int>(m_decoder->GetTrackCount(kTrackTypeSubtitle)))
77  {
78  StreamInfo stream = m_decoder->GetTrackInfo(kTrackTypeSubtitle, static_cast<uint>(track));
80  }
81  }
83 }
84 
86 {
91 }
92 
94 {
97 }
98 
99 bool MythDVDPlayer::PrebufferEnoughFrames(int /*MinBuffers*/)
100 {
102 }
103 
105 {
107  if (m_decoderChangeLock.tryLock(1))
108  {
109  if (m_decoder)
111  m_decoderChangeLock.unlock();
112  }
113 }
114 
116 {
118 }
119 
121 {
122  if (!m_initialDvdState.isEmpty())
124 
126 }
127 
129 {
130  if (!m_playerCtx->m_buffer->IsDVD())
131  {
132  SetErrored("RingBuffer is not a DVD.");
133  return !IsErrored();
134  }
135 
136  int nbframes = 0;
137  if (m_videoOutput)
138  nbframes = m_videoOutput->ValidVideoFrames();
139 
140 #if 0
141  LOG(VB_PLAYBACK, LOG_DEBUG,
142  LOC + QString("Validframes %1, FreeFrames %2, VideoPaused %3")
143  .arg(nbframes).arg(videoOutput->FreeVideoFrames()).arg(videoPaused));
144 #endif
145 
146  // completely drain the video buffers for certain situations
147  bool release_all = m_playerCtx->m_buffer->DVD()->DVDWaitingForPlayer() &&
148  (nbframes > 0);
149  bool release_one = (nbframes > 1) && m_videoPaused && !m_allPaused &&
153  if (release_all || release_one)
154  {
155  if (nbframes < 5 && m_videoOutput)
157 
158  // if we go below the pre-buffering limit, the player will pause
159  // so do this 'manually'
160  DisplayNormalFrame(false);
161  // unpause the still frame if more frames become available
162  if (m_dvdStillFrameShowing && nbframes > 1)
163  {
164  m_dvdStillFrameShowing = false;
165  UnpauseVideo();
166  }
167  return !IsErrored();
168  }
169 
170  // clear the mythtv imposed wait state
172  {
173  LOG(VB_PLAYBACK, LOG_INFO, LOC + "Clearing MythTV DVD wait state");
175  ClearAfterSeek(true);
176  if (m_videoPaused && !m_allPaused)
177  UnpauseVideo();
178  return !IsErrored();
179  }
180 
181  // wait for the video buffers to drain
182  if (nbframes < 2)
183  {
184  // clear the DVD wait state
185  if (m_playerCtx->m_buffer->DVD()->IsWaiting())
186  {
187  LOG(VB_PLAYBACK, LOG_INFO, LOC + "Clearing DVD wait state");
189  if (m_videoPaused && !m_allPaused)
190  UnpauseVideo();
191  return !IsErrored();
192  }
193 
194  // the still frame is treated as a pause frame
196  {
197  // ensure we refresh the pause frame
199  m_needNewPauseFrame = true;
200 
201  // we are in a still frame so pause video output
202  if (!m_videoPaused)
203  {
204  PauseVideo();
205  m_dvdStillFrameShowing = true;
206  return !IsErrored();
207  }
208 
209  // see if the pause frame has timed out
210  StillFrameCheck();
211 
212  // flag if we have no frame
213  if (nbframes == 0)
214  {
215  LOG(VB_PLAYBACK, LOG_WARNING, LOC + "In DVD Menu: No video frames in queue");
216  std::this_thread::sleep_for(10ms);
217  return !IsErrored();
218  }
219 
220  m_dvdStillFrameShowing = true;
221  }
222  }
223 
224  // unpause the still frame if more frames become available
225  if (m_dvdStillFrameShowing && nbframes > 1)
226  {
227  UnpauseVideo();
228  m_dvdStillFrameShowing = false;
229  return !IsErrored();
230  }
231 
232  return MythPlayerUI::VideoLoop();
233 }
234 
235 bool MythDVDPlayer::FastForward(float Seconds)
236 {
237  if (m_decoder)
239  return MythPlayerUI::FastForward(Seconds);
240 }
241 
242 bool MythDVDPlayer::Rewind(float Seconds)
243 {
244  if (m_decoder)
246  return MythPlayerUI::Rewind(Seconds);
247 }
248 
250 {
251  if (Frame == ~0x0ULL)
252  return false;
253 
254  if (m_decoder)
257 }
258 
260 {
261  if (m_playerCtx->m_buffer->DVD())
262  m_playerCtx->m_buffer->DVD()->SetParent(this);
263 
264  m_playerCtx->LockPlayingInfo(__FILE__, __LINE__);
266  {
267  QString name;
268  QString serialid;
269  if (m_playerCtx->m_playingInfo->GetTitle().isEmpty() &&
270  m_playerCtx->m_buffer->DVD() &&
271  m_playerCtx->m_buffer->DVD()->GetNameAndSerialNum(name, serialid))
272  {
274  }
275  }
276  m_playerCtx->UnlockPlayingInfo(__FILE__, __LINE__);
277 
279 }
280 
282 {
284 
285  if (m_initialTitle > -1)
287 
288  if (m_initialAudioTrack > -1)
291  if (m_initialSubtitleTrack > -1)
294 
295  if (m_bookmarkSeek > 30)
296  {
297  // we need to trigger a dvd cell change to ensure the new title length
298  // is set and the position map updated accordingly
299  m_decodeOneFrame = true;
300  int count = 0;
301  while (count++ < 100 && m_decodeOneFrame)
302  std::this_thread::sleep_for(50ms);
303  }
306 }
307 
308 void MythDVDPlayer::ResetPlaying(bool /*ResetFrames*/)
309 {
311 }
312 
314 {
315  if (m_playerCtx->m_buffer->DVD())
316  m_playerCtx->m_buffer->DVD()->SetParent(nullptr);
317 }
318 
319 bool MythDVDPlayer::PrepareAudioSample(std::chrono::milliseconds &Timecode)
320 {
322  WrapTimecode(Timecode, TC_AUDIO);
323 
324  return m_playerCtx->m_buffer->IsDVD() &&
326 }
327 
329 {
330  if (!m_playerCtx->m_buffer->IsDVD())
331  return;
332 
333  QStringList fields;
334  QString name;
335  QString serialid;
336  QString dvdstate;
337 
338  if (!m_playerCtx->m_buffer->IsInMenu() &&
340  {
341  if (!m_playerCtx->m_buffer->DVD()->GetNameAndSerialNum(name, serialid))
342  {
343  LOG(VB_GENERAL, LOG_ERR, LOC +
344  "DVD has no name and serial number. Cannot set bookmark.");
345  return;
346  }
347 
348  if (!Clear && !m_playerCtx->m_buffer->DVD()->GetDVDStateSnapshot(dvdstate))
349  {
350  LOG(VB_GENERAL, LOG_ERR, LOC +
351  "Unable to retrieve DVD state. Cannot set bookmark.");
352  return;
353  }
354 
355  m_playerCtx->LockPlayingInfo(__FILE__, __LINE__);
357  {
358  fields += serialid;
359  fields += name;
360 
361  if (!Clear)
362  {
363  LOG(VB_PLAYBACK, LOG_INFO, LOC + "Set bookmark");
364  fields += dvdstate;
365  }
366  else
367  {
368  LOG(VB_PLAYBACK, LOG_INFO, LOC + "Clear bookmark");
369  }
370 
372 
373  }
374  m_playerCtx->UnlockPlayingInfo(__FILE__, __LINE__);
375  }
376 }
377 
379 {
381  return 0;
382 
383  QString name;
384  QString serialid;
385  uint64_t frames = 0;
386  m_playerCtx->LockPlayingInfo(__FILE__, __LINE__);
388  {
389  if (!m_playerCtx->m_buffer->DVD()->GetNameAndSerialNum(name, serialid))
390  {
391  m_playerCtx->UnlockPlayingInfo(__FILE__, __LINE__);
392  return 0;
393  }
394 
395  QStringList dvdbookmark = m_playerCtx->m_playingInfo->QueryDVDBookmark(serialid);
396 
397  if (!dvdbookmark.empty())
398  {
399  QStringList::Iterator it = dvdbookmark.begin();
400 
401  if (dvdbookmark.count() == 1)
402  {
403  m_initialDvdState = *it;
404  frames = ~0x0ULL;
405  LOG(VB_PLAYBACK, LOG_INFO, LOC + "Get Bookmark: bookmark found");
406  }
407  else
408  {
409  // Legacy bookmarks
410  m_initialTitle = (*it).toInt();
411  frames = ((*++it).toLongLong() & 0xffffffffLL);
412  m_initialAudioTrack = (*++it).toInt();
413  m_initialSubtitleTrack = (*++it).toInt();
414  LOG(VB_PLAYBACK, LOG_INFO, LOC +
415  QString("Get Bookmark: title %1 audiotrack %2 subtrack %3 "
416  "frame %4")
418  .arg(m_initialSubtitleTrack).arg(frames));
419  }
420  }
421  }
422  m_playerCtx->UnlockPlayingInfo(__FILE__, __LINE__);
423  return frames;
424 }
425 
427 {
428  if (m_stillFrameLength > 0s)
429  {
430  m_stillFrameTimerLock.lock();
431  // Get the timestretched elapsed time and transform
432  // it to what the unstretched value would have been
433  // had we been playing with the new timestretch value
434  // all along
435  auto elapsed = millisecondsFromFloat(m_stillFrameTimer.elapsed().count() *
438  m_stillFrameTimer.addMSecs(elapsed);
439  m_stillFrameTimerLock.unlock();
440  }
441 
443 
444  if (m_decoder)
446  if (m_playerCtx->m_buffer->IsDVD())
447  {
448  if (m_playSpeed > 1.0F)
450  else
452  }
453 }
454 
455 long long MythDVDPlayer::CalcMaxFFTime(long long FastFwd, bool Setjump) const
456 {
457  if ((m_totalFrames > 0) && m_playerCtx->m_buffer->IsDVD() &&
459  return 0;
460  return MythPlayerUI::CalcMaxFFTime(FastFwd, Setjump);
461 }
462 
463 std::chrono::milliseconds MythDVDPlayer::GetMillisecondsPlayed(bool /*HonorCutList*/)
464 {
465  if (!m_playerCtx->m_buffer->IsDVD())
466  return 0ms;
467 
468  std::chrono::milliseconds played = m_playerCtx->m_buffer->DVD()->GetCurrentTime();
469 
470  if (m_stillFrameLength > 0s)
471  {
472  if (m_stillFrameLength == 255s)
473  return -1ms;
475  }
476 
477  return played;
478 }
479 
480 std::chrono::milliseconds MythDVDPlayer::GetTotalMilliseconds(bool /*HonorCutList*/) const
481 {
482  std::chrono::milliseconds total = m_totalLength;
483 
484  if (m_stillFrameLength > 0s)
485  {
486  if (m_stillFrameLength == 255s)
487  return -1ms;
488  total = duration_cast<std::chrono::milliseconds>(m_stillFrameLength);
489  }
490 
491  return total;
492 }
493 
494 void MythDVDPlayer::SetTrack(uint Type, uint TrackNo)
495 {
496  if (kTrackTypeAudio == Type)
497  {
498  StreamInfo stream = m_decoder->GetTrackInfo(Type, TrackNo);
499  m_playerCtx->m_buffer->DVD()->SetTrack(Type, stream.m_stream_id);
500  }
501 
502  MythPlayerUI::SetTrack(Type, TrackNo);
503 }
504 
506 {
507  if (!m_playerCtx->m_buffer->IsDVD())
508  return 0;
509  return m_playerCtx->m_buffer->DVD()->NumPartsInTitle();
510 }
511 
513 {
514  if (!m_playerCtx->m_buffer->IsDVD())
515  return 0;
516  return m_playerCtx->m_buffer->DVD()->GetPart();
517 }
518 
519 void MythDVDPlayer::GetChapterTimes(QList<std::chrono::seconds> &Times)
520 {
521  if (!m_playerCtx->m_buffer->IsDVD())
522  return;
524 }
525 
527 {
528  if (!m_playerCtx->m_buffer->IsDVD())
529  return false;
530 
531  int total = GetNumChapters();
532  int current = GetCurrentChapter();
533 
534  if (Chapter < 0 || Chapter > total)
535  {
536  if (Chapter < 0)
537  {
538  Chapter = current -1;
539  Chapter = std::max(Chapter, 0);
540  }
541  else if (Chapter > total)
542  {
543  Chapter = current + 1;
544  Chapter = std::min(Chapter, total);
545  }
546  }
547 
548  bool success = m_playerCtx->m_buffer->DVD()->PlayTrack(Chapter);
549  if (success)
550  {
551  if (m_decoder)
552  {
554  if (m_playerCtx->m_buffer->DVD()->GetCellStart() == 0s)
555  m_decoder->SeekReset(static_cast<long long>(m_framesPlayed), 0, true, true);
556  }
558  }
559 
560  m_jumpChapter = 0;
561  return success;
562 }
563 
565 {
566  if (!m_playerCtx->m_buffer->IsDVD())
567  return;
568 
569  uint buttonversion = 0;
570  AVSubtitle *dvdSubtitle = m_playerCtx->m_buffer->DVD()->GetMenuSubtitle(buttonversion);
571  bool numbuttons = m_playerCtx->m_buffer->DVD()->NumMenuButtons() != 0;
572 
573  bool expired = false;
574 
575  MythVideoFrame *currentFrame = m_videoOutput ? m_videoOutput->GetLastShownFrame() : nullptr;
576 
577  if (!currentFrame)
578  {
580  return;
581  }
582 
583  if (dvdSubtitle &&
584  (dvdSubtitle->end_display_time > dvdSubtitle->start_display_time) &&
585  (dvdSubtitle->end_display_time < currentFrame->m_timecode.count()))
586  {
587  expired = true;
588  }
589 
590  // nothing to do
591  if (!expired && (buttonversion == (static_cast<uint>(m_buttonVersion))))
592  {
594  return;
595  }
596 
597  // clear any buttons
598  if (!numbuttons || !dvdSubtitle || (buttonversion == 0) || expired)
599  {
601  m_buttonVersion = 0;
603  return;
604  }
605 
606  if ((currentFrame->m_timecode > 0ms) &&
607  (dvdSubtitle->start_display_time > currentFrame->m_timecode.count()))
608  {
610  return;
611  }
612 
613  m_buttonVersion = static_cast<int>(buttonversion);
614  QRect buttonPos = m_playerCtx->m_buffer->DVD()->GetButtonCoords();
615  m_captionsOverlay.DisplayDVDButton(dvdSubtitle, buttonPos);
616  uint oldcaptions = m_captionsState.m_textDisplayMode;
618  if (oldcaptions != m_captionsState.m_textDisplayMode)
621 }
622 
623 void MythDVDPlayer::GoToMenu(const QString& Menu)
624 {
625  if (!m_playerCtx->m_buffer->IsDVD())
626  return;
627 
628  uint oldcaptions = m_captionsState.m_textDisplayMode;
630  if (oldcaptions != m_captionsState.m_textDisplayMode)
632 
633  if (!m_playerCtx->m_buffer->DVD()->GoToMenu(Menu))
634  {
635  UpdateOSDMessage(tr("DVD Menu Not Available"), kOSDTimeout_Med);
636  LOG(VB_GENERAL, LOG_ERR, "No DVD Menu available.");
637  }
638 }
639 
640 void MythDVDPlayer::GoToDVDProgram(bool Direction)
641 {
642  if (auto * dvd = m_playerCtx->m_buffer->DVD(); dvd)
643  {
644  if (Direction)
645  dvd->GoToPreviousProgram();
646  else
647  dvd->GoToNextProgram();
648  }
649 }
650 
652 {
653  return (m_stillFrameLength > 0s);
654 }
655 
657 {
659  return m_playerCtx->m_buffer->DVD()->GetNumAngles();
660  return 0;
661 }
662 
664 {
666  return m_playerCtx->m_buffer->DVD()->GetCurrentAngle();
667  return -1;
668 }
669 
670 QString MythDVDPlayer::GetAngleName(int Angle) const
671 {
672  if (Angle >= 1 && Angle <= GetNumAngles())
673  {
674  QString name = tr("Angle %1").arg(Angle);
675  return name;
676  }
677  return {};
678 }
679 
681 {
682  int total = GetNumAngles();
683  if (!total || Angle == GetCurrentAngle())
684  return false;
685 
686  if (Angle < 1 || Angle > total)
687  Angle = 1;
688 
689  return m_playerCtx->m_buffer->DVD()->SwitchAngle(Angle);
690 }
691 
692 void MythDVDPlayer::SetStillFrameTimeout(std::chrono::seconds Length)
693 {
694  if (Length != m_stillFrameLength)
695  {
696  m_stillFrameTimerLock.lock();
697  m_stillFrameLength = Length;
699  m_stillFrameTimerLock.unlock();
700  }
701 }
702 
704 {
705  if (m_playerCtx->m_buffer->IsDVD() &&
707  (m_stillFrameLength > 0s) && (m_stillFrameLength < 255s))
708  {
709  m_stillFrameTimerLock.lock();
710  auto elapsedTime = secondsFromFloat(m_stillFrameTimer.elapsed().count() * m_playSpeed / 1000.0F);
711  m_stillFrameTimerLock.unlock();
712  if (elapsedTime >= m_stillFrameLength)
713  {
714  LOG(VB_PLAYBACK, LOG_INFO, LOC +
715  QString("Stillframe timeout after %1 seconds (timestretch %2)")
716  .arg(m_stillFrameLength.count()).arg(static_cast<double>(m_playSpeed)));
718  m_stillFrameLength = 0s;
719  }
720  }
721 }
722 
724 {
727 }
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:421
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:71
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:64
MythPlayerCaptionsUI::SetTrack
virtual void SetTrack(uint Type, uint TrackNo)
Definition: mythplayercaptionsui.cpp:333
MythDVDPlayer::VideoStart
void VideoStart(void) override
Definition: mythdvdplayer.cpp:120
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:670
kTrackTypeSubtitle
@ kTrackTypeSubtitle
Definition: decoderbase.h:31
MythDVDPlayer::JumpToFrame
bool JumpToFrame(uint64_t Frame) override
Definition: mythdvdplayer.cpp:249
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:723
MythDVDBuffer::IsInStillFrame
bool IsInStillFrame(void) const override
Definition: mythdvdbuffer.cpp:225
MythDVDPlayer::HasReachedEof
bool HasReachedEof(void) const override
Definition: mythdvdplayer.cpp:50
MythPlayerCaptionsUI::GetTrack
int GetTrack(uint Type)
Definition: mythplayercaptionsui.cpp:372
MythPlayerUI::EventStart
virtual void EventStart()
Definition: mythplayerui.cpp:480
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:104
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:67
MythCoreContext::IsDatabaseIgnored
bool IsDatabaseIgnored(void) const
/brief Returns true if database is being ignored.
Definition: mythcorecontext.cpp:882
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:23
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:253
LOG
#define LOG(_MASK_, _LEVEL_, _QSTRING_)
Definition: mythlogging.h:39
MythDVDPlayer::GetMillisecondsPlayed
std::chrono::milliseconds GetMillisecondsPlayed(bool HonorCutList) override
Definition: mythdvdplayer.cpp:463
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:498
MythDVDBuffer::SkipDVDWaitingForPlayer
void SkipDVDWaitingForPlayer(void)
Definition: mythdvdbuffer.cpp:1233
MythDVDPlayer::IsInStillFrame
bool IsInStillFrame() const override
Definition: mythdvdplayer.cpp:651
TVPlaybackState::GoToDVDProgram
void GoToDVDProgram(bool Direction)
MythDVDPlayer::PrepareAudioSample
bool PrepareAudioSample(std::chrono::milliseconds &Timecode) override
Definition: mythdvdplayer.cpp:319
MythCaptionsState::m_textDisplayMode
uint m_textDisplayMode
Definition: mythplayerstate.h:70
MythDVDPlayer::SwitchAngle
bool SwitchAngle(int Angle) override
Definition: mythdvdplayer.cpp:680
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:281
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:78
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:69
MythDVDPlayer::GetChapterTimes
void GetChapterTimes(QList< std::chrono::seconds > &Times) override
Definition: mythdvdplayer.cpp:519
MythPlayer::m_framesPlayed
uint64_t m_framesPlayed
Definition: mythplayer.h:424
MythDVDPlayer::PreProcessNormalFrame
void PreProcessNormalFrame(void) override
Definition: mythdvdplayer.cpp:115
kDisplayDVDButton
@ kDisplayDVDButton
Definition: videoouttypes.h:19
mythlogging.h
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:74
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:703
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:480
MythDVDPlayer::GetCurrentAngle
int GetCurrentAngle(void) const override
Definition: mythdvdplayer.cpp:663
ProgramInfo::SetTitle
void SetTitle(const QString &t, const QString &st=nullptr)
Definition: programinfo.cpp:1162
TestBufferVec
std::vector< char > TestBufferVec
Definition: decoderbase.h:23
MythPlayer::m_playerCtx
PlayerContext * m_playerCtx
Definition: mythplayer.h:366
MythPlayerUI::DisplayPauseFrame
virtual void DisplayPauseFrame()
Definition: mythplayerui.cpp:648
MythPlayerCaptionsUI::SetCaptionsEnabled
void SetCaptionsEnabled(bool Enable, bool UpdateOSD=true)
Definition: mythplayercaptionsui.cpp:286
MythDVDPlayer::CalcMaxFFTime
long long CalcMaxFFTime(long long FastFwd, bool Setjump=true) const override
CalcMaxFFTime(ffframes): forward ffframes forward.
Definition: mythdvdplayer.cpp:455
MythDVDPlayer::ReleaseNextVideoFrame
void ReleaseNextVideoFrame(MythVideoFrame *Buffer, std::chrono::milliseconds Timecode, bool Wrap=true) override
Definition: mythdvdplayer.cpp:43
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:57
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:242
MythDVDPlayer::EventEnd
virtual void EventEnd(void)
Definition: mythdvdplayer.cpp:313
MythPlayerCaptionsUI::DisableCaptions
virtual void DisableCaptions(uint Mode, bool UpdateOSD=true)
Definition: mythplayercaptionsui.cpp:150
MythDVDPlayer::GetCurrentChapter
int GetCurrentChapter(void) override
Definition: mythdvdplayer.cpp:512
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:200
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:308
MythMediaBuffer::IsBookmarkAllowed
virtual bool IsBookmarkAllowed(void)
Definition: mythmediabuffer.h:136
MythDVDPlayer::DisplayPauseFrame
void DisplayPauseFrame(void) override
Definition: mythdvdplayer.cpp:85
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:109
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:505
mythcorecontext.h
MythDVDPlayer::GoToDVDProgram
void GoToDVDProgram(bool Direction)
Definition: mythdvdplayer.cpp:640
Clear
#define Clear(a)
Definition: audiooutputopensles.cpp:54
MythDVDPlayer::MythDVDPlayer
MythDVDPlayer(MythMainWindow *MainWindow, TV *Tv, PlayerContext *Context, PlayerFlags Flags=kNoFlags)
Definition: mythdvdplayer.cpp:15
MythDVDPlayer::GetBookmark
uint64_t GetBookmark(void) override
Definition: mythdvdplayer.cpp:378
MythDVDPlayer::DecoderPauseCheck
void DecoderPauseCheck(void) override
Definition: mythdvdplayer.cpp:93
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:825
MythDVDPlayer::DoFFRewSkip
void DoFFRewSkip(void) override
Definition: mythdvdplayer.cpp:104
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:99
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:494
MythPlayerCaptionsUI::CaptionsStateChanged
void CaptionsStateChanged(MythCaptionsState &CaptionsState)
MythDVDPlayer::GoToMenu
void GoToMenu(const QString &Menu)
Definition: mythdvdplayer.cpp:623
MythPlayer::DoFFRewSkip
virtual void DoFFRewSkip(void)
Definition: mythplayer.cpp:1164
kTrackTypeAudio
@ kTrackTypeAudio
Definition: decoderbase.h:29
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:399
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:58
MythDVDPlayer::SetStillFrameTimeout
void SetStillFrameTimeout(std::chrono::seconds Length)
Definition: mythdvdplayer.cpp:692
MythDVDPlayer::SetBookmark
void SetBookmark(bool Clear=false) override
Definition: mythdvdplayer.cpp:328
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:526
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:426
MythDVDPlayer::VideoLoop
bool VideoLoop(void) override
Definition: mythdvdplayer.cpp:128
MythDVDPlayer::EventStart
void EventStart(void) override
Definition: mythdvdplayer.cpp:259
LOC
#define LOC
Definition: mythdvdplayer.cpp:13
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:235
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:670
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:564
MythDVDPlayer::GetNumAngles
int GetNumAngles(void) const override
Definition: mythdvdplayer.cpp:656
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