MythTV  master
mythdvdplayer.cpp
Go to the documentation of this file.
1 // MythTV
2 #include "tv_play.h"
3 #include "mythdvdbuffer.h"
4 #include "audiooutput.h"
5 #include "mythdvddecoder.h"
6 #include "mythdvdplayer.h"
7 
8 #define LOC QString("DVDPlayer: ")
9 
11  : MythPlayerUI(MainWindow, Tv, Context, Flags)
12 {
13  connect(Tv, &TV::GoToMenu, this, &MythDVDPlayer::GoToMenu);
16 }
17 
19  std::chrono::microseconds FrameInterval, bool AllowLock)
20 {
21  bool dummy = false;
23  {
24  MythPlayerUI::AutoDeint(Frame, VideoOutput, FrameInterval, AllowLock);
25  return;
26  }
27 
29 }
30 
39  std::chrono::milliseconds Timecode, bool /*wrap*/)
40 {
43 }
44 
46 {
47  EofState eof = GetEof();
48  // DeleteMap and EditMode from the parent MythPlayer should not be
49  // relevant here.
50  return eof != kEofStateNone && !m_allPaused;
51 }
52 
54 {
56  SetCaptionsEnabled(false, false);
57 }
58 
59 void MythDVDPlayer::DisableCaptions(uint Mode, bool OSDMsg)
60 {
61  if ((kDisplayAVSubtitle & Mode) && m_playerCtx->m_buffer->IsDVD())
63  MythPlayerUI::DisableCaptions(Mode, OSDMsg);
64 }
65 
66 void MythDVDPlayer::EnableCaptions(uint Mode, bool OSDMsg)
67 {
68  if ((kDisplayAVSubtitle & Mode) && m_playerCtx->m_buffer->IsDVD())
69  {
70  int track = GetTrack(kTrackTypeSubtitle);
71  if (track >= 0 && track < static_cast<int>(m_decoder->GetTrackCount(kTrackTypeSubtitle)))
72  {
73  StreamInfo stream = m_decoder->GetTrackInfo(kTrackTypeSubtitle, static_cast<uint>(track));
75  }
76  }
77  MythPlayerUI::EnableCaptions(Mode, OSDMsg);
78 }
79 
81 {
86 }
87 
89 {
92 }
93 
94 bool MythDVDPlayer::PrebufferEnoughFrames(int /*MinBuffers*/)
95 {
97 }
98 
100 {
102  if (m_decoderChangeLock.tryLock(1))
103  {
104  if (m_decoder)
106  m_decoderChangeLock.unlock();
107  }
108  return res;
109 }
110 
112 {
114  return (m_playerCtx->m_buffer->IsDVD() &&
115  (m_playerCtx->m_buffer->DVD()->GetCurrentTime() < 2s));
116 }
117 
119 {
121 }
122 
124 {
125  if (!m_initialDvdState.isEmpty())
127 
129 }
130 
132 {
133  if (!m_playerCtx->m_buffer->IsDVD())
134  {
135  SetErrored("RingBuffer is not a DVD.");
136  return !IsErrored();
137  }
138 
139  int nbframes = 0;
140  if (m_videoOutput)
141  nbframes = m_videoOutput->ValidVideoFrames();
142 
143 #if 0
144  LOG(VB_PLAYBACK, LOG_DEBUG,
145  LOC + QString("Validframes %1, FreeFrames %2, VideoPaused %3")
146  .arg(nbframes).arg(videoOutput->FreeVideoFrames()).arg(videoPaused));
147 #endif
148 
149  // completely drain the video buffers for certain situations
150  bool release_all = m_playerCtx->m_buffer->DVD()->DVDWaitingForPlayer() &&
151  (nbframes > 0);
152  bool release_one = (nbframes > 1) && m_videoPaused && !m_allPaused &&
156  if (release_all || release_one)
157  {
158  if (nbframes < 5 && m_videoOutput)
160 
161  // if we go below the pre-buffering limit, the player will pause
162  // so do this 'manually'
163  DisplayNormalFrame(false);
164  // unpause the still frame if more frames become available
165  if (m_dvdStillFrameShowing && nbframes > 1)
166  {
167  m_dvdStillFrameShowing = false;
168  UnpauseVideo();
169  }
170  return !IsErrored();
171  }
172 
173  // clear the mythtv imposed wait state
175  {
176  LOG(VB_PLAYBACK, LOG_INFO, LOC + "Clearing MythTV DVD wait state");
178  ClearAfterSeek(true);
179  if (m_videoPaused && !m_allPaused)
180  UnpauseVideo();
181  return !IsErrored();
182  }
183 
184  // wait for the video buffers to drain
185  if (nbframes < 2)
186  {
187  // clear the DVD wait state
188  if (m_playerCtx->m_buffer->DVD()->IsWaiting())
189  {
190  LOG(VB_PLAYBACK, LOG_INFO, LOC + "Clearing DVD wait state");
192  if (m_videoPaused && !m_allPaused)
193  UnpauseVideo();
194  return !IsErrored();
195  }
196 
197  // the still frame is treated as a pause frame
199  {
200  // ensure we refresh the pause frame
202  m_needNewPauseFrame = true;
203 
204  // we are in a still frame so pause video output
205  if (!m_videoPaused)
206  {
207  PauseVideo();
208  m_dvdStillFrameShowing = true;
209  return !IsErrored();
210  }
211 
212  // see if the pause frame has timed out
213  StillFrameCheck();
214 
215  // flag if we have no frame
216  if (nbframes == 0)
217  {
218  LOG(VB_PLAYBACK, LOG_WARNING, LOC + "In DVD Menu: No video frames in queue");
219  std::this_thread::sleep_for(10ms);
220  return !IsErrored();
221  }
222 
223  m_dvdStillFrameShowing = true;
224  }
225  }
226 
227  // unpause the still frame if more frames become available
228  if (m_dvdStillFrameShowing && nbframes > 1)
229  {
230  UnpauseVideo();
231  m_dvdStillFrameShowing = false;
232  return !IsErrored();
233  }
234 
235  return MythPlayerUI::VideoLoop();
236 }
237 
238 bool MythDVDPlayer::FastForward(float Seconds)
239 {
240  if (m_decoder)
242  return MythPlayerUI::FastForward(Seconds);
243 }
244 
245 bool MythDVDPlayer::Rewind(float Seconds)
246 {
247  if (m_decoder)
249  return MythPlayerUI::Rewind(Seconds);
250 }
251 
253 {
254  if (Frame == ~0x0ULL)
255  return false;
256 
257  if (m_decoder)
260 }
261 
263 {
264  if (m_playerCtx->m_buffer->DVD())
265  m_playerCtx->m_buffer->DVD()->SetParent(this);
266 
267  m_playerCtx->LockPlayingInfo(__FILE__, __LINE__);
269  {
270  QString name;
271  QString serialid;
272  if (m_playerCtx->m_playingInfo->GetTitle().isEmpty() &&
273  m_playerCtx->m_buffer->DVD() &&
274  m_playerCtx->m_buffer->DVD()->GetNameAndSerialNum(name, serialid))
275  {
277  }
278  }
279  m_playerCtx->UnlockPlayingInfo(__FILE__, __LINE__);
280 
282 }
283 
285 {
287 
288  if (m_initialTitle > -1)
290 
291  if (m_initialAudioTrack > -1)
294  if (m_initialSubtitleTrack > -1)
297 
298  if (m_bookmarkSeek > 30)
299  {
300  // we need to trigger a dvd cell change to ensure the new title length
301  // is set and the position map updated accordingly
302  m_decodeOneFrame = true;
303  int count = 0;
304  while (count++ < 100 && m_decodeOneFrame)
305  std::this_thread::sleep_for(50ms);
306  }
309 }
310 
311 void MythDVDPlayer::ResetPlaying(bool /*ResetFrames*/)
312 {
314 }
315 
317 {
318  if (m_playerCtx->m_buffer->DVD())
319  m_playerCtx->m_buffer->DVD()->SetParent(nullptr);
320 }
321 
322 bool MythDVDPlayer::PrepareAudioSample(std::chrono::milliseconds &Timecode)
323 {
325  WrapTimecode(Timecode, TC_AUDIO);
326 
327  return m_playerCtx->m_buffer->IsDVD() &&
329 }
330 
332 {
333  if (!m_playerCtx->m_buffer->IsDVD())
334  return;
335 
336  QStringList fields;
337  QString name;
338  QString serialid;
339  QString dvdstate;
340 
341  if (!m_playerCtx->m_buffer->IsInMenu() &&
343  {
344  if (!m_playerCtx->m_buffer->DVD()->GetNameAndSerialNum(name, serialid))
345  {
346  LOG(VB_GENERAL, LOG_ERR, LOC +
347  "DVD has no name and serial number. Cannot set bookmark.");
348  return;
349  }
350 
351  if (!Clear && !m_playerCtx->m_buffer->DVD()->GetDVDStateSnapshot(dvdstate))
352  {
353  LOG(VB_GENERAL, LOG_ERR, LOC +
354  "Unable to retrieve DVD state. Cannot set bookmark.");
355  return;
356  }
357 
358  m_playerCtx->LockPlayingInfo(__FILE__, __LINE__);
360  {
361  fields += serialid;
362  fields += name;
363 
364  if (!Clear)
365  {
366  LOG(VB_PLAYBACK, LOG_INFO, LOC + "Set bookmark");
367  fields += dvdstate;
368  }
369  else
370  LOG(VB_PLAYBACK, LOG_INFO, LOC + "Clear bookmark");
371 
373 
374  }
375  m_playerCtx->UnlockPlayingInfo(__FILE__, __LINE__);
376  }
377 }
378 
380 {
382  return 0;
383 
384  QString name;
385  QString serialid;
386  uint64_t frames = 0;
387  m_playerCtx->LockPlayingInfo(__FILE__, __LINE__);
389  {
390  if (!m_playerCtx->m_buffer->DVD()->GetNameAndSerialNum(name, serialid))
391  {
392  m_playerCtx->UnlockPlayingInfo(__FILE__, __LINE__);
393  return 0;
394  }
395 
396  QStringList dvdbookmark = m_playerCtx->m_playingInfo->QueryDVDBookmark(serialid);
397 
398  if (!dvdbookmark.empty())
399  {
400  QStringList::Iterator it = dvdbookmark.begin();
401 
402  if (dvdbookmark.count() == 1)
403  {
404  m_initialDvdState = *it;
405  frames = ~0x0ULL;
406  LOG(VB_PLAYBACK, LOG_INFO, LOC + "Get Bookmark: bookmark found");
407  }
408  else
409  {
410  // Legacy bookmarks
411  m_initialTitle = (*it).toInt();
412  frames = ((*++it).toLongLong() & 0xffffffffLL);
413  m_initialAudioTrack = (*++it).toInt();
414  m_initialSubtitleTrack = (*++it).toInt();
415  LOG(VB_PLAYBACK, LOG_INFO, LOC +
416  QString("Get Bookmark: title %1 audiotrack %2 subtrack %3 "
417  "frame %4")
419  .arg(m_initialSubtitleTrack).arg(frames));
420  }
421  }
422  }
423  m_playerCtx->UnlockPlayingInfo(__FILE__, __LINE__);
424  return frames;
425 }
426 
428 {
429  if (m_stillFrameLength > 0s)
430  {
431  m_stillFrameTimerLock.lock();
432  // Get the timestretched elapsed time and transform
433  // it to what the unstretched value would have been
434  // had we been playing with the new timestretch value
435  // all along
436  auto elapsed = millisecondsFromFloat(m_stillFrameTimer.elapsed().count() *
439  m_stillFrameTimer.addMSecs(elapsed);
440  m_stillFrameTimerLock.unlock();
441  }
442 
444 
445  if (m_decoder)
447  if (m_playerCtx->m_buffer->IsDVD())
448  {
449  if (m_playSpeed > 1.0F)
451  else
453  }
454 }
455 
456 long long MythDVDPlayer::CalcMaxFFTime(long long FastFwd, bool Setjump) const
457 {
458  if ((m_totalFrames > 0) && m_playerCtx->m_buffer->IsDVD() &&
460  return 0;
461  return MythPlayerUI::CalcMaxFFTime(FastFwd, Setjump);
462 }
463 
464 std::chrono::milliseconds MythDVDPlayer::GetMillisecondsPlayed(bool /*HonorCutList*/)
465 {
466  if (!m_playerCtx->m_buffer->IsDVD())
467  return 0ms;
468 
469  std::chrono::milliseconds played = m_playerCtx->m_buffer->DVD()->GetCurrentTime();
470 
471  if (m_stillFrameLength > 0s)
472  {
473  if (m_stillFrameLength == 255s)
474  return -1ms;
476  }
477 
478  return played;
479 }
480 
481 std::chrono::milliseconds MythDVDPlayer::GetTotalMilliseconds(bool /*HonorCutList*/) const
482 {
483  std::chrono::milliseconds total = m_totalLength;
484 
485  if (m_stillFrameLength > 0s)
486  {
487  if (m_stillFrameLength == 255s)
488  return -1ms;
489  total = duration_cast<std::chrono::milliseconds>(m_stillFrameLength);
490  }
491 
492  return total;
493 }
494 
495 void MythDVDPlayer::SetTrack(uint Type, uint TrackNo)
496 {
497  if (kTrackTypeAudio == Type)
498  {
499  StreamInfo stream = m_decoder->GetTrackInfo(Type, static_cast<uint>(TrackNo));
500  m_playerCtx->m_buffer->DVD()->SetTrack(Type, stream.m_stream_id);
501  }
502 
503  MythPlayerUI::SetTrack(Type, TrackNo);
504 }
505 
507 {
508  if (!m_playerCtx->m_buffer->IsDVD())
509  return 0;
510  return m_playerCtx->m_buffer->DVD()->NumPartsInTitle();
511 }
512 
514 {
515  if (!m_playerCtx->m_buffer->IsDVD())
516  return 0;
517  return m_playerCtx->m_buffer->DVD()->GetPart();
518 }
519 
520 void MythDVDPlayer::GetChapterTimes(QList<std::chrono::seconds> &Times)
521 {
522  if (!m_playerCtx->m_buffer->IsDVD())
523  return;
525 }
526 
528 {
529  if (!m_playerCtx->m_buffer->IsDVD())
530  return false;
531 
532  int total = GetNumChapters();
533  int current = GetCurrentChapter();
534 
535  if (Chapter < 0 || Chapter > total)
536  {
537  if (Chapter < 0)
538  {
539  Chapter = current -1;
540  if (Chapter < 0) Chapter = 0;
541  }
542  else if (Chapter > total)
543  {
544  Chapter = current + 1;
545  if (Chapter > total) Chapter = total;
546  }
547  }
548 
549  bool success = m_playerCtx->m_buffer->DVD()->PlayTrack(Chapter);
550  if (success)
551  {
552  if (m_decoder)
553  {
555  if (m_playerCtx->m_buffer->DVD()->GetCellStart() == 0s)
556  m_decoder->SeekReset(static_cast<long long>(m_framesPlayed), 0, true, true);
557  }
559  }
560 
561  m_jumpChapter = 0;
562  return success;
563 }
564 
566 {
567  if (!m_playerCtx->m_buffer->IsDVD())
568  return;
569 
570  uint buttonversion = 0;
571  AVSubtitle *dvdSubtitle = m_playerCtx->m_buffer->DVD()->GetMenuSubtitle(buttonversion);
572  bool numbuttons = m_playerCtx->m_buffer->DVD()->NumMenuButtons() != 0;
573 
574  bool expired = false;
575 
576  MythVideoFrame *currentFrame = m_videoOutput ? m_videoOutput->GetLastShownFrame() : nullptr;
577 
578  if (!currentFrame)
579  {
581  return;
582  }
583 
584  if (dvdSubtitle &&
585  (dvdSubtitle->end_display_time > dvdSubtitle->start_display_time) &&
586  (dvdSubtitle->end_display_time < currentFrame->m_timecode.count()))
587  {
588  expired = true;
589  }
590 
591  // nothing to do
592  if (!expired && (buttonversion == (static_cast<uint>(m_buttonVersion))))
593  {
595  return;
596  }
597 
598  // clear any buttons
599  if (!numbuttons || !dvdSubtitle || (buttonversion == 0) || expired)
600  {
602  m_buttonVersion = 0;
604  return;
605  }
606 
607  if ((currentFrame->m_timecode > 0ms) &&
608  (dvdSubtitle->start_display_time > currentFrame->m_timecode.count()))
609  {
611  return;
612  }
613 
614  m_buttonVersion = static_cast<int>(buttonversion);
615  QRect buttonPos = m_playerCtx->m_buffer->DVD()->GetButtonCoords();
616  m_captionsOverlay.DisplayDVDButton(dvdSubtitle, buttonPos);
617  uint oldcaptions = m_captionsState.m_textDisplayMode;
619  if (oldcaptions != m_captionsState.m_textDisplayMode)
622 }
623 
624 void MythDVDPlayer::GoToMenu(const QString& Menu)
625 {
626  if (!m_playerCtx->m_buffer->IsDVD())
627  return;
628 
629  uint oldcaptions = m_captionsState.m_textDisplayMode;
631  if (oldcaptions != m_captionsState.m_textDisplayMode)
633 
634  if (!m_playerCtx->m_buffer->DVD()->GoToMenu(Menu))
635  {
636  UpdateOSDMessage(tr("DVD Menu Not Available"), kOSDTimeout_Med);
637  LOG(VB_GENERAL, LOG_ERR, "No DVD Menu available.");
638  }
639 }
640 
641 void MythDVDPlayer::GoToDVDProgram(bool Direction)
642 {
643  if (auto * dvd = m_playerCtx->m_buffer->DVD(); dvd)
644  {
645  if (Direction)
646  dvd->GoToPreviousProgram();
647  else
648  dvd->GoToNextProgram();
649  }
650 }
651 
653 {
654  return (m_stillFrameLength > 0s);
655 }
656 
658 {
660  return m_playerCtx->m_buffer->DVD()->GetNumAngles();
661  return 0;
662 }
663 
665 {
667  return m_playerCtx->m_buffer->DVD()->GetCurrentAngle();
668  return -1;
669 }
670 
671 QString MythDVDPlayer::GetAngleName(int Angle) const
672 {
673  if (Angle >= 1 && Angle <= GetNumAngles())
674  {
675  QString name = tr("Angle %1").arg(Angle);
676  return name;
677  }
678  return QString();
679 }
680 
682 {
683  int total = GetNumAngles();
684  if (!total || Angle == GetCurrentAngle())
685  return false;
686 
687  if (Angle < 1 || Angle > total)
688  Angle = 1;
689 
690  return m_playerCtx->m_buffer->DVD()->SwitchAngle(Angle);
691 }
692 
693 void MythDVDPlayer::SetStillFrameTimeout(std::chrono::seconds Length)
694 {
695  if (Length != m_stillFrameLength)
696  {
697  m_stillFrameTimerLock.lock();
698  m_stillFrameLength = Length;
700  m_stillFrameTimerLock.unlock();
701  }
702 }
703 
705 {
706  if (m_playerCtx->m_buffer->IsDVD() &&
708  (m_stillFrameLength > 0s) && (m_stillFrameLength < 255s))
709  {
710  m_stillFrameTimerLock.lock();
711  auto elapsedTime = secondsFromFloat(m_stillFrameTimer.elapsed().count() * m_playSpeed / 1000.0F);
712  m_stillFrameTimerLock.unlock();
713  if (elapsedTime >= m_stillFrameLength)
714  {
715  LOG(VB_PLAYBACK, LOG_INFO, LOC +
716  QString("Stillframe timeout after %1 seconds (timestretch %2)")
717  .arg(m_stillFrameLength.count()).arg(static_cast<double>(m_playSpeed)));
719  m_stillFrameLength = 0s;
720  }
721  }
722 }
723 
725 {
728 }
ProgramInfo::SaveDVDBookmark
static void SaveDVDBookmark(const QStringList &fields)
Definition: programinfo.cpp:2848
MythDVDBuffer::PlayTrack
bool PlayTrack(int Track)
Definition: mythdvdbuffer.cpp:1099
MythPlayerUI::VideoStart
virtual void VideoStart()
Definition: mythplayerui.cpp:400
MythDVDBuffer::GetCurrentTime
std::chrono::seconds GetCurrentTime(void) const
Definition: mythdvdbuffer.cpp:1979
MythDVDPlayer::EnableCaptions
void EnableCaptions(uint Mode, bool OSDMsg=true) override
Definition: mythdvdplayer.cpp:66
MythDVDBuffer::IsOpen
bool IsOpen(void) const override
Definition: mythdvdbuffer.cpp:212
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:59
MythPlayerCaptionsUI::SetTrack
virtual void SetTrack(uint Type, uint TrackNo)
Definition: mythplayercaptionsui.cpp:329
MythDVDPlayer::VideoStart
void VideoStart(void) override
Definition: mythdvdplayer.cpp:123
MythDVDBuffer::TitleTimeLeft
std::chrono::seconds TitleTimeLeft(void) const
returns seconds left in the title
Definition: mythdvdbuffer.cpp:1974
MythPlayer::m_videoPaused
bool m_videoPaused
Definition: mythplayer.h:400
MythPlayer::m_decoderChangeLock
QRecursiveMutex m_decoderChangeLock
Definition: mythplayer.h:370
PlayerContext::UnlockPlayingInfo
void UnlockPlayingInfo(const char *file, int line) const
Definition: playercontext.cpp:245
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:1196
kDisplayNone
@ kDisplayNone
Definition: videoouttypes.h:12
kEofStateNone
@ kEofStateNone
Definition: decoderbase.h:69
MythDVDPlayer::JumpToFrame
bool JumpToFrame(uint64_t Frame) override
Definition: mythdvdplayer.cpp:252
MythPlayer::m_avSync
MythPlayerAVSync m_avSync
Definition: mythplayer.h:438
MythPlayer::DecoderPauseCheck
virtual void DecoderPauseCheck(void)
Definition: mythplayer.cpp:1043
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:724
MythDVDBuffer::IsInStillFrame
bool IsInStillFrame(void) const override
Definition: mythdvdbuffer.cpp:222
MythDVDPlayer::HasReachedEof
bool HasReachedEof(void) const override
Definition: mythdvdplayer.cpp:45
MythPlayerCaptionsUI::GetTrack
int GetTrack(uint Type)
Definition: mythplayercaptionsui.cpp:368
MythPlayerUI::EventStart
virtual void EventStart()
Definition: mythplayerui.cpp:459
MythDVDBuffer::SetTrack
void SetTrack(uint Type, int TrackNo)
set the dvd subtitle/audio track used
Definition: mythdvdbuffer.cpp:1853
MythPlayerUI::DisplayNormalFrame
virtual void DisplayNormalFrame(bool CheckPrebuffer=true)
Definition: mythplayerui.cpp:641
MythPlayer::PrebufferEnoughFrames
virtual bool PrebufferEnoughFrames(int min_buffers=0)
Definition: mythplayer.cpp:707
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:80
mythdvdbuffer.h
MythCaptionsOverlay::ClearSubtitles
void ClearSubtitles()
Definition: mythcaptionsoverlay.cpp:203
MythCoreContext::IsDatabaseIgnored
bool IsDatabaseIgnored(void) const
/brief Returns true if database is being ignored.
Definition: mythcorecontext.cpp:900
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:18
MythMediaBuffer::IgnoreWaitStates
virtual void IgnoreWaitStates(bool)
Definition: mythmediabuffer.h:130
MythPlayer::IsErrored
bool IsErrored(void) const
Definition: mythplayer.cpp:1987
MythMediaBuffer::IsDVD
bool IsDVD(void) const
Definition: mythmediabuffer.cpp:1830
DecoderBase::GetMythCodecContext
MythCodecContext * GetMythCodecContext(void)
Definition: decoderbase.h:263
LOG
#define LOG(_MASK_, _LEVEL_, _QSTRING_)
Definition: mythlogging.h:23
MythDVDPlayer::GetMillisecondsPlayed
std::chrono::milliseconds GetMillisecondsPlayed(bool HonorCutList) override
Definition: mythdvdplayer.cpp:464
MythDVDBuffer::GoToMenu
bool GoToMenu(const QString &str)
jump to a dvd root or chapter menu
Definition: mythdvdbuffer.cpp:1234
PlayerFlags
PlayerFlags
Definition: mythplayer.h:65
MythPlayer::GetEof
EofState GetEof(void) const
Definition: mythplayer.cpp:1055
MythMediaBuffer::IsInMenu
virtual bool IsInMenu(void) const
Definition: mythmediabuffer.h:131
MythPlayerAVSync::DisplayTimecode
std::chrono::milliseconds & DisplayTimecode()
Definition: mythplayeravsync.cpp:35
MythPlayer::m_nextPlaySpeed
float m_nextPlaySpeed
Definition: mythplayer.h:495
MythDVDPlayer::DecoderGetFrameFFREW
bool DecoderGetFrameFFREW(void) override
Definition: mythdvdplayer.cpp:99
MythPlayerUI::VideoLoop
virtual bool VideoLoop()
Definition: mythplayerui.cpp:477
MythDVDBuffer::SkipDVDWaitingForPlayer
void SkipDVDWaitingForPlayer(void)
Definition: mythdvdbuffer.cpp:1217
MythDVDPlayer::IsInStillFrame
bool IsInStillFrame() const override
Definition: mythdvdplayer.cpp:652
TVPlaybackState::GoToDVDProgram
void GoToDVDProgram(bool Direction)
MythDVDPlayer::PrepareAudioSample
bool PrepareAudioSample(std::chrono::milliseconds &Timecode) override
Definition: mythdvdplayer.cpp:322
MythCaptionsState::m_textDisplayMode
uint m_textDisplayMode
Definition: mythplayerstate.h:70
MythDVDPlayer::SwitchAngle
bool SwitchAngle(int Angle) override
Definition: mythdvdplayer.cpp:681
MythDate::current
QDateTime current(bool stripped)
Returns current Date and Time in UTC.
Definition: mythdate.cpp:10
MythDVDDecoder
Definition: mythdvddecoder.h:14
MythPlayer::SetErrored
void SetErrored(const QString &reason)
Definition: mythplayer.cpp:1963
MythPlayer::m_needNewPauseFrame
bool m_needNewPauseFrame
Definition: mythplayer.h:398
TVPlaybackState::GoToMenu
void GoToMenu(const QString &Menu)
MythDVDPlayer::InitialSeek
void InitialSeek(void) override
Definition: mythdvdplayer.cpp:284
MythPlayer::SetDecoder
void SetDecoder(DecoderBase *dec)
Sets the stream decoder, deleting any existing recorder.
Definition: mythplayer.cpp:1921
MythDVDBuffer::SetParent
void SetParent(MythDVDPlayer *Parent)
Definition: mythdvdbuffer.cpp:2165
MythDVDPlayer::m_stillFrameTimerLock
QRecursiveMutex m_stillFrameTimerLock
Definition: mythdvdplayer.h:88
MythDVDBuffer::DVDWaitingForPlayer
bool DVDWaitingForPlayer(void) const
Definition: mythdvdbuffer.cpp:431
EofState
EofState
Definition: decoderbase.h:67
MythPlayerOverlayUI::UpdateOSDMessage
void UpdateOSDMessage(const QString &Message)
Definition: mythplayeroverlayui.cpp:74
MythDVDBuffer::GetCurrentAngle
int GetCurrentAngle(void) const
Definition: mythdvdbuffer.cpp:441
MythPlayerUI
Definition: mythplayerui.h:10
MythMediaBuffer::GetFilename
QString GetFilename(void) const
Definition: mythmediabuffer.cpp:1739
MythPlayer::UnpauseVideo
void UnpauseVideo(void)
Definition: mythplayer.cpp:230
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:520
MythPlayer::m_framesPlayed
uint64_t m_framesPlayed
Definition: mythplayer.h:432
MythDVDPlayer::PreProcessNormalFrame
void PreProcessNormalFrame(void) override
Definition: mythdvdplayer.cpp:118
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:277
StreamInfo
Definition: decoderbase.h:74
MythDVDBuffer::PlayTitleAndPart
void PlayTitleAndPart(int Title, int Part)
Definition: mythdvdbuffer.cpp:1954
kScan_Progressive
@ kScan_Progressive
Definition: videoouttypes.h:100
MythDVDBuffer::GetButtonCoords
QRect GetButtonCoords(void)
get coordinates of highlighted button
Definition: mythdvdbuffer.cpp:1440
PlayerContext::m_playingInfo
ProgramInfo * m_playingInfo
Currently playing info.
Definition: playercontext.h:120
MythMediaBuffer::IsInDiscMenuOrStillFrame
virtual bool IsInDiscMenuOrStillFrame(void) const
Definition: mythmediabuffer.h:133
MythDVDPlayer::m_dvdStillFrameShowing
bool m_dvdStillFrameShowing
Definition: mythdvdplayer.h:74
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:420
MythVideoFrame::m_timecode
std::chrono::milliseconds m_timecode
Definition: mythframe.h:131
ProgramInfo::GetTitle
QString GetTitle(void) const
Definition: programinfo.h:360
MythDVDPlayer::StillFrameCheck
void StillFrameCheck(void)
Definition: mythdvdplayer.cpp:704
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:2815
MythCodecContext::IsDeinterlacing
virtual bool IsDeinterlacing(bool &, bool=false)
Definition: mythcodeccontext.h:157
MythPlayerCaptionsUI::m_captionsOverlay
MythCaptionsOverlay m_captionsOverlay
Definition: mythplayercaptionsui.h:69
PlayerContext::m_buffer
MythMediaBuffer * m_buffer
Definition: playercontext.h:119
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:1300
MythPlayer::PauseVideo
void PauseVideo(void)
Definition: mythplayer.cpp:222
MythPlayer::ClearAfterSeek
void ClearAfterSeek(bool clearvideobuffers=true)
This is to support seeking...
Definition: mythplayer.cpp:1687
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:904
MythDVDBuffer::RestoreDVDStateSnapshot
bool RestoreDVDStateSnapshot(const QString &State)
Restore a DVD VM from a snapshot.
Definition: mythdvdbuffer.cpp:1925
MythDVDPlayer::GetTotalMilliseconds
std::chrono::milliseconds GetTotalMilliseconds(bool HonorCutList) const override
Definition: mythdvdplayer.cpp:481
MythDVDPlayer::GetCurrentAngle
int GetCurrentAngle(void) const override
Definition: mythdvdplayer.cpp:664
ProgramInfo::SetTitle
void SetTitle(const QString &t, const QString &st=nullptr)
Definition: programinfo.cpp:1156
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:619
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:456
MythDVDPlayer::ReleaseNextVideoFrame
void ReleaseNextVideoFrame(MythVideoFrame *Buffer, std::chrono::milliseconds Timecode, bool Wrap=true) override
Definition: mythdvdplayer.cpp:38
uint
unsigned int uint
Definition: compat.h:144
MythDVDBuffer::ReleaseMenuButton
void ReleaseMenuButton(void)
Definition: mythdvdbuffer.cpp:1433
MythDVDBuffer::NumPartsInTitle
int NumPartsInTitle(void) const
Definition: mythdvdbuffer.cpp:1182
gCoreContext
MythCoreContext * gCoreContext
This global variable contains the MythCoreContext instance for the app.
Definition: mythcorecontext.cpp:60
MythPlayer::m_playerFlags
PlayerFlags m_playerFlags
Definition: mythplayer.h:380
MythDVDBuffer::IsWaiting
bool IsWaiting(void) const
Definition: mythdvdbuffer.cpp:1177
MythDVDPlayer::Rewind
bool Rewind(float Seconds) override
Definition: mythdvdplayer.cpp:245
MythDVDPlayer::EventEnd
virtual void EventEnd(void)
Definition: mythdvdplayer.cpp:316
kTrackTypeSubtitle
@ kTrackTypeSubtitle
Definition: decoderbase.h:31
MythPlayerCaptionsUI::DisableCaptions
virtual void DisableCaptions(uint Mode, bool UpdateOSD=true)
Definition: mythplayercaptionsui.cpp:148
MythPlayer::DecoderGetFrameREW
virtual bool DecoderGetFrameREW(void)
Definition: mythplayer.cpp:1192
MythDVDPlayer::GetCurrentChapter
int GetCurrentChapter(void) override
Definition: mythdvdplayer.cpp:513
MythVideoOutput::EnoughFreeFrames
bool EnoughFreeFrames()
Returns true iff enough frames are available to decode onto.
Definition: mythvideoout.cpp:289
MythDVDBuffer::GetChapterTimes
void GetChapterTimes(QList< std::chrono::seconds > &Times)
Definition: mythdvdbuffer.cpp:368
MythPlayer::m_jumpChapter
int m_jumpChapter
Definition: mythplayer.h:417
MythDVDBuffer::GetMenuSubtitle
AVSubtitle * GetMenuSubtitle(uint &Version)
returns dvd menu button information if available.
Definition: mythdvdbuffer.cpp:1418
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:1960
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:311
MythMediaBuffer::IsBookmarkAllowed
virtual bool IsBookmarkAllowed(void)
Definition: mythmediabuffer.h:127
MythDVDPlayer::DisplayPauseFrame
void DisplayPauseFrame(void) override
Definition: mythdvdplayer.cpp:80
DecoderBase::UpdateFramesPlayed
virtual void UpdateFramesPlayed(void)
Definition: decoderbase.cpp:876
Buffer
Definition: MythExternControl.h:36
MythDVDBuffer::GetCellStart
std::chrono::seconds GetCellStart(void) const
get the start of the cell in seconds
Definition: mythdvdbuffer.cpp:1153
MythPlayerUI::InitialSeek
virtual void InitialSeek()
Definition: mythplayerui.cpp:94
MythDVDBuffer::GetNumAngles
int GetNumAngles(void) const
Definition: mythdvdbuffer.cpp:446
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:506
MythDVDPlayer::GoToDVDProgram
void GoToDVDProgram(bool Direction)
Definition: mythdvdplayer.cpp:641
kScan_Interlaced
@ kScan_Interlaced
Definition: videoouttypes.h:98
Clear
#define Clear(a)
Definition: audiooutputopensles.cpp:47
MythDVDPlayer::MythDVDPlayer
MythDVDPlayer(MythMainWindow *MainWindow, TV *Tv, PlayerContext *Context, PlayerFlags Flags=kNoFlags)
Definition: mythdvdplayer.cpp:10
MythDVDPlayer::GetBookmark
uint64_t GetBookmark(void) override
Definition: mythdvdplayer.cpp:379
MythDVDPlayer::DecoderPauseCheck
void DecoderPauseCheck(void) override
Definition: mythdvdplayer.cpp:88
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:1900
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:436
MythPlayer::m_decodeOneFrame
bool m_decodeOneFrame
Definition: mythplayer.h:397
audiooutput.h
MythDVDPlayer::m_stillFrameTimer
MythTimer m_stillFrameTimer
Definition: mythdvdplayer.h:83
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:873
MythPlayer::m_totalLength
std::chrono::seconds m_totalLength
Definition: mythplayer.h:434
MythDVDPlayer::PrebufferEnoughFrames
bool PrebufferEnoughFrames(int MinBuffers=0) override
Definition: mythdvdplayer.cpp:94
PlayerContext
Definition: playercontext.h:52
MythDVDBuffer::IsStillFramePending
bool IsStillFramePending(void) const
Definition: mythdvdbuffer.cpp:1167
MythDVDBuffer::NumMenuButtons
int NumMenuButtons(void) const
Definition: mythdvdbuffer.cpp:1704
MythDVDPlayer::m_initialSubtitleTrack
int m_initialSubtitleTrack
Definition: mythdvdplayer.h:79
MythDVDPlayer::SetTrack
void SetTrack(uint Type, uint TrackNo) override
Definition: mythdvdplayer.cpp:495
MythPlayerCaptionsUI::CaptionsStateChanged
void CaptionsStateChanged(MythCaptionsState &CaptionsState)
MythDVDPlayer::GoToMenu
void GoToMenu(const QString &Menu)
Definition: mythdvdplayer.cpp:624
MythDVDBuffer::WaitSkip
void WaitSkip(void)
Definition: mythdvdbuffer.cpp:1209
MythPlayer::DecoderGetFrameFFREW
virtual bool DecoderGetFrameFFREW(void)
Definition: mythplayer.cpp:1156
MythPlayer::JumpToFrame
virtual bool JumpToFrame(uint64_t frame)
Definition: mythplayer.cpp:877
MythMediaBuffer::DVD
const MythDVDBuffer * DVD(void) const
Definition: mythmediabuffer.cpp:1840
MythPlayer::m_allPaused
bool m_allPaused
Definition: mythplayer.h:401
MythPlayerUI::ChangeSpeed
void ChangeSpeed() override
Definition: mythplayerui.cpp:378
MythPlayerCaptionsUI::m_captionsState
MythCaptionsState m_captionsState
Definition: mythplayercaptionsui.h:70
MythDVDPlayer::m_stillFrameLength
std::chrono::seconds m_stillFrameLength
Definition: mythdvdplayer.h:84
MythVideoFrame
Definition: mythframe.h:88
kDisplayAVSubtitle
@ kDisplayAVSubtitle
Definition: videoouttypes.h:15
MythDVDPlayer::DoDisableDVDSubtitles
void DoDisableDVDSubtitles()
Definition: mythdvdplayer.cpp:53
MythDVDPlayer::DecoderGetFrameREW
bool DecoderGetFrameREW(void) override
Definition: mythdvdplayer.cpp:111
MythDVDPlayer::SetStillFrameTimeout
void SetStillFrameTimeout(std::chrono::seconds Length)
Definition: mythdvdplayer.cpp:693
MythDVDPlayer::SetBookmark
void SetBookmark(bool Clear=false) override
Definition: mythdvdplayer.cpp:331
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:315
MythDVDPlayer::DoJumpChapter
bool DoJumpChapter(int Chapter) override
Definition: mythdvdplayer.cpp:527
kOSDTimeout_Med
@ kOSDTimeout_Med
Definition: osd.h:61
MythDVDBuffer::SwitchAngle
bool SwitchAngle(int Angle)
Definition: mythdvdbuffer.cpp:2150
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:824
MythDVDPlayer::ChangeSpeed
void ChangeSpeed(void) override
Definition: mythdvdplayer.cpp:427
MythDVDPlayer::VideoLoop
bool VideoLoop(void) override
Definition: mythdvdplayer.cpp:131
MythDVDPlayer::EventStart
void EventStart(void) override
Definition: mythdvdplayer.cpp:262
LOC
#define LOC
Definition: mythdvdplayer.cpp:8
MythDVDPlayer::m_initialTitle
int m_initialTitle
Definition: mythdvdplayer.h:77
MythMainWindow
Definition: mythmainwindow.h:35
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:238
MythDVDPlayer::m_initialAudioTrack
int m_initialAudioTrack
Definition: mythdvdplayer.h:78
MythCaptionsOverlay::DisplayDVDButton
void DisplayDVDButton(AVSubtitle *DVDButton, QRect &Pos)
Definition: mythcaptionsoverlay.cpp:213
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:598
MythDVDPlayer::GetAngleName
QString GetAngleName(int Angle) const override
Definition: mythdvdplayer.cpp:671
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:565
MythDVDPlayer::GetNumAngles
int GetNumAngles(void) const override
Definition: mythdvdplayer.cpp:657
tv_play.h
MythPlayer::Rewind
virtual bool Rewind(float seconds)
Definition: mythplayer.cpp:854
MythDVDBuffer::GetDVDStateSnapshot
bool GetDVDStateSnapshot(QString &State)
Get a snapshot of the current DVD VM state.
Definition: mythdvdbuffer.cpp:1909
MythDVDPlayer::m_buttonVersion
int m_buttonVersion
Definition: mythdvdplayer.h:73
TV
Control TV playback.
Definition: tv_play.h:154