MythTV  master
mythdvdplayer.cpp
Go to the documentation of this file.
1 // MythTV
2 #include "mythdvdbuffer.h"
3 #include "DetectLetterbox.h"
4 #include "audiooutput.h"
5 #include "mythdvddecoder.h"
6 #include "mythdvdplayer.h"
7 
8 // Std
9 #include <unistd.h> // for usleep()
10 
11 #define LOC QString("DVDPlayer: ")
12 
14 {
15  bool dummy = false;
17  {
18  MythPlayer::AutoDeint(Frame, AllowLock);
19  return;
20  }
21 
23 }
24 
33  int64_t Timecode, bool /*wrap*/)
34 {
37 }
38 
40 {
41  EofState eof = GetEof();
42  // DeleteMap and EditMode from the parent MythPlayer should not be
43  // relevant here.
44  return eof != kEofStateNone && !m_allPaused;
45 }
46 
47 void MythDVDPlayer::DisableCaptions(uint Mode, bool OSDMsg)
48 {
49  if ((kDisplayAVSubtitle & Mode) && m_playerCtx->m_buffer->IsDVD())
51  MythPlayer::DisableCaptions(Mode, OSDMsg);
52 }
53 
54 void MythDVDPlayer::EnableCaptions(uint Mode, bool OSDMsg)
55 {
56  if ((kDisplayAVSubtitle & Mode) && m_playerCtx->m_buffer->IsDVD())
57  {
58  int track = GetTrack(kTrackTypeSubtitle);
59  if (track >= 0 && track < static_cast<int>(m_decoder->GetTrackCount(kTrackTypeSubtitle)))
60  {
62  static_cast<uint>(track));
64  stream.m_stream_id);
65  }
66  }
67  MythPlayer::EnableCaptions(Mode, OSDMsg);
68 }
69 
71 {
72  if (m_playerCtx->m_buffer->IsDVD() &&
74  {
76  }
79 }
80 
82 {
85 }
86 
87 bool MythDVDPlayer::PrebufferEnoughFrames(int /*MinBuffers*/)
88 {
90 }
91 
93 {
95  if (m_decoderChangeLock.tryLock(1))
96  {
97  if (m_decoder)
99  m_decoderChangeLock.unlock();
100  }
101  return res;
102 }
103 
105 {
107  return (m_playerCtx->m_buffer->IsDVD() &&
108  (m_playerCtx->m_buffer->DVD()->GetCurrentTime() < 2));
109 }
110 
112 {
114 }
115 
117 {
118  if (!m_initialDvdState.isEmpty())
120 
122 }
123 
125 {
126  if (!m_playerCtx->m_buffer->IsDVD())
127  {
128  SetErrored("RingBuffer is not a DVD.");
129  return !IsErrored();
130  }
131 
132  int nbframes = 0;
133  if (m_videoOutput)
134  nbframes = m_videoOutput->ValidVideoFrames();
135 
136 #if 0
137  LOG(VB_PLAYBACK, LOG_DEBUG,
138  LOC + QString("Validframes %1, FreeFrames %2, VideoPaused %3")
139  .arg(nbframes).arg(videoOutput->FreeVideoFrames()).arg(videoPaused));
140 #endif
141 
142  // completely drain the video buffers for certain situations
143  bool release_all = m_playerCtx->m_buffer->DVD()->DVDWaitingForPlayer() &&
144  (nbframes > 0);
145  bool release_one = (nbframes > 1) && m_videoPaused && !m_allPaused &&
149  if (release_all || release_one)
150  {
151  if (nbframes < 5 && m_videoOutput)
153 
154  // if we go below the pre-buffering limit, the player will pause
155  // so do this 'manually'
156  DisplayNormalFrame(false);
157  // unpause the still frame if more frames become available
158  if (m_dvdStillFrameShowing && nbframes > 1)
159  {
160  m_dvdStillFrameShowing = false;
161  UnpauseVideo();
162  }
163  return !IsErrored();
164  }
165 
166  // clear the mythtv imposed wait state
168  {
169  LOG(VB_PLAYBACK, LOG_INFO, LOC + "Clearing MythTV DVD wait state");
171  ClearAfterSeek(true);
172  if (m_videoPaused && !m_allPaused)
173  UnpauseVideo();
174  return !IsErrored();
175  }
176 
177  // wait for the video buffers to drain
178  if (nbframes < 2)
179  {
180  // clear the DVD wait state
181  if (m_playerCtx->m_buffer->DVD()->IsWaiting())
182  {
183  LOG(VB_PLAYBACK, LOG_INFO, LOC + "Clearing DVD wait state");
185  if (m_videoPaused && !m_allPaused)
186  UnpauseVideo();
187  return !IsErrored();
188  }
189 
190  // the still frame is treated as a pause frame
192  {
193  // ensure we refresh the pause frame
195  m_needNewPauseFrame = true;
196 
197  // we are in a still frame so pause video output
198  if (!m_videoPaused)
199  {
200  PauseVideo();
201  m_dvdStillFrameShowing = true;
202  return !IsErrored();
203  }
204 
205  // see if the pause frame has timed out
206  StillFrameCheck();
207 
208  // flag if we have no frame
209  if (nbframes == 0)
210  {
211  LOG(VB_PLAYBACK, LOG_WARNING, LOC +
212  "In DVD Menu: No video frames in queue");
213  usleep(10000);
214  return !IsErrored();
215  }
216 
217  m_dvdStillFrameShowing = true;
218  }
219  }
220 
221  // unpause the still frame if more frames become available
222  if (m_dvdStillFrameShowing && nbframes > 1)
223  {
224  UnpauseVideo();
225  m_dvdStillFrameShowing = false;
226  return !IsErrored();
227  }
228 
229  return MythPlayer::VideoLoop();
230 }
231 
233 {
234  // clear the buffering state
235  SetBuffering(false);
236 
239 
240  AVSync(nullptr);
241 }
242 
243 bool MythDVDPlayer::FastForward(float Seconds)
244 {
245  if (m_decoder)
247  return MythPlayer::FastForward(Seconds);
248 }
249 
250 bool MythDVDPlayer::Rewind(float Seconds)
251 {
252  if (m_decoder)
254  return MythPlayer::Rewind(Seconds);
255 }
256 
258 {
259  if (Frame == ~0x0ULL)
260  return false;
261 
262  if (m_decoder)
265 }
266 
268 {
269  if (m_playerCtx->m_buffer->DVD())
270  m_playerCtx->m_buffer->DVD()->SetParent(this);
271 
272  m_playerCtx->LockPlayingInfo(__FILE__, __LINE__);
274  {
275  QString name;
276  QString serialid;
277  if (m_playerCtx->m_playingInfo->GetTitle().isEmpty() &&
278  m_playerCtx->m_buffer->DVD() &&
279  m_playerCtx->m_buffer->DVD()->GetNameAndSerialNum(name, serialid))
280  {
282  }
283  }
284  m_playerCtx->UnlockPlayingInfo(__FILE__, __LINE__);
285 
287 }
288 
290 {
292 
293  if (m_initialTitle > -1)
295 
296  if (m_initialAudioTrack > -1)
299  if (m_initialSubtitleTrack > -1)
302 
303  if (m_bookmarkSeek > 30)
304  {
305  // we need to trigger a dvd cell change to ensure the new title length
306  // is set and the position map updated accordingly
307  m_decodeOneFrame = true;
308  int count = 0;
309  while (count++ < 100 && m_decodeOneFrame)
310  usleep(50000);
311  }
314 }
315 
316 void MythDVDPlayer::ResetPlaying(bool /*ResetFrames*/)
317 {
319 }
320 
322 {
323  if (m_playerCtx->m_buffer->DVD())
324  m_playerCtx->m_buffer->DVD()->SetParent(nullptr);
325 }
326 
327 bool MythDVDPlayer::PrepareAudioSample(int64_t &Timecode)
328 {
330  WrapTimecode(Timecode, TC_AUDIO);
331 
332  return m_playerCtx->m_buffer->IsDVD() &&
334 }
335 
337 {
338  if (!m_playerCtx->m_buffer->IsDVD())
339  return;
340 
341  QStringList fields;
342  QString name;
343  QString serialid;
344  QString dvdstate;
345 
346  if (!m_playerCtx->m_buffer->IsInMenu() &&
348  {
349  if (!m_playerCtx->m_buffer->DVD()->GetNameAndSerialNum(name, serialid))
350  {
351  LOG(VB_GENERAL, LOG_ERR, LOC +
352  "DVD has no name and serial number. Cannot set bookmark.");
353  return;
354  }
355 
356  if (!Clear && !m_playerCtx->m_buffer->DVD()->GetDVDStateSnapshot(dvdstate))
357  {
358  LOG(VB_GENERAL, LOG_ERR, LOC +
359  "Unable to retrieve DVD state. Cannot set bookmark.");
360  return;
361  }
362 
363  m_playerCtx->LockPlayingInfo(__FILE__, __LINE__);
365  {
366  fields += serialid;
367  fields += name;
368 
369  if (!Clear)
370  {
371  LOG(VB_PLAYBACK, LOG_INFO, LOC + "Set bookmark");
372  fields += dvdstate;
373  }
374  else
375  LOG(VB_PLAYBACK, LOG_INFO, LOC + "Clear bookmark");
376 
378 
379  }
380  m_playerCtx->UnlockPlayingInfo(__FILE__, __LINE__);
381  }
382 }
383 
385 {
387  return 0;
388 
389  QString name;
390  QString serialid;
391  uint64_t frames = 0;
392  m_playerCtx->LockPlayingInfo(__FILE__, __LINE__);
394  {
395  if (!m_playerCtx->m_buffer->DVD()->GetNameAndSerialNum(name, serialid))
396  {
397  m_playerCtx->UnlockPlayingInfo(__FILE__, __LINE__);
398  return 0;
399  }
400 
401  QStringList dvdbookmark = m_playerCtx->m_playingInfo->QueryDVDBookmark(serialid);
402 
403  if (!dvdbookmark.empty())
404  {
405  QStringList::Iterator it = dvdbookmark.begin();
406 
407  if (dvdbookmark.count() == 1)
408  {
409  m_initialDvdState = *it;
410  frames = ~0x0ULL;
411  LOG(VB_PLAYBACK, LOG_INFO, LOC + "Get Bookmark: bookmark found");
412  }
413  else
414  {
415  // Legacy bookmarks
416  m_initialTitle = (*it).toInt();
417  frames = ((*++it).toLongLong() & 0xffffffffLL);
418  m_initialAudioTrack = (*++it).toInt();
419  m_initialSubtitleTrack = (*++it).toInt();
420  LOG(VB_PLAYBACK, LOG_INFO, LOC +
421  QString("Get Bookmark: title %1 audiotrack %2 subtrack %3 "
422  "frame %4")
424  .arg(m_initialSubtitleTrack).arg(frames));
425  }
426  }
427  }
428  m_playerCtx->UnlockPlayingInfo(__FILE__, __LINE__);
429  return frames;;
430 }
431 
433 {
434  if (m_stillFrameLength > 0)
435  {
436  m_stillFrameTimerLock.lock();
437  // Get the timestretched elapsed time and transform
438  // it to what the unstretched value would have been
439  // had we been playing with the new timestretch value
440  // all along
441  int elapsed = static_cast<int>((m_stillFrameTimer.elapsed() * m_playSpeed / m_nextPlaySpeed));
443  m_stillFrameTimer.addMSecs(elapsed);
444  m_stillFrameTimerLock.unlock();
445  }
446 
448 
449  if (m_decoder)
451  if (m_playerCtx->m_buffer->IsDVD())
452  {
453  if (m_playSpeed > 1.0F)
455  else
457  }
458 }
459 
460 long long MythDVDPlayer::CalcMaxFFTime(long long FastFwd, bool Setjump) const
461 {
462  if ((m_totalFrames > 0) && m_playerCtx->m_buffer->IsDVD() &&
464  return 0;
465  return MythPlayer::CalcMaxFFTime(FastFwd, Setjump);
466 }
467 
468 int64_t MythDVDPlayer::GetSecondsPlayed(bool /*HonorCutList*/, int Divisor)
469 {
470  if (!m_playerCtx->m_buffer->IsDVD())
471  return 0;
472 
473  int64_t played = m_playerCtx->m_buffer->DVD()->GetCurrentTime();
474 
475  if (m_stillFrameLength > 0)
476  {
477  if (m_stillFrameLength == 255)
478  played = -1;
479  else
480  played = static_cast<int64_t>(m_stillFrameTimer.elapsed() * m_playSpeed / Divisor);
481  }
482 
483  return played;
484 }
485 
486 int64_t MythDVDPlayer::GetTotalSeconds(bool /*HonorCutList*/, int Divisor) const
487 {
488  int64_t total = m_totalLength;
489 
490  if (m_stillFrameLength > 0)
491  {
492  if (m_stillFrameLength == 255)
493  return -1;
494  total = m_stillFrameLength;
495  }
496 
497  return total * 1000 / Divisor;
498 }
499 
500 void MythDVDPlayer::SeekForScreenGrab(uint64_t &Number, uint64_t FrameNum,
501  bool /*Absolute*/)
502 {
503  if (!m_playerCtx->m_buffer->IsDVD())
504  return;
505  if (GoToMenu("menu"))
506  {
507  if (m_playerCtx->m_buffer->DVD()->IsInMenu() &&
509  {
510  GoToDVDProgram(true);
511  }
512  }
513  else if (m_playerCtx->m_buffer->DVD()->GetTotalTimeOfTitle() < 60)
514  {
515  GoToDVDProgram(true);
516  Number = FrameNum;
517  if (Number >= m_totalFrames)
518  Number = m_totalFrames / 2;
519  }
520 }
521 
522 int MythDVDPlayer::SetTrack(uint Type, int TrackNo)
523 {
524  if (kTrackTypeAudio == Type)
525  {
526  StreamInfo stream = m_decoder->GetTrackInfo(Type, static_cast<uint>(TrackNo));
527  m_playerCtx->m_buffer->DVD()->SetTrack(Type, stream.m_stream_id);
528  }
529 
530  return MythPlayer::SetTrack(Type, TrackNo);
531 }
532 
534 {
535  if (!m_playerCtx->m_buffer->IsDVD())
536  return 0;
537  return m_playerCtx->m_buffer->DVD()->NumPartsInTitle();
538 }
539 
541 {
542  if (!m_playerCtx->m_buffer->IsDVD())
543  return 0;
544  return m_playerCtx->m_buffer->DVD()->GetPart();
545 }
546 
547 void MythDVDPlayer::GetChapterTimes(QList<long long> &Times)
548 {
549  if (!m_playerCtx->m_buffer->IsDVD())
550  return;
552 }
553 
555 {
556  if (!m_playerCtx->m_buffer->IsDVD())
557  return false;
558 
559  int total = GetNumChapters();
560  int current = GetCurrentChapter();
561 
562  if (Chapter < 0 || Chapter > total)
563  {
564  if (Chapter < 0)
565  {
566  Chapter = current -1;
567  if (Chapter < 0) Chapter = 0;
568  }
569  else if (Chapter > total)
570  {
571  Chapter = current + 1;
572  if (Chapter > total) Chapter = total;
573  }
574  }
575 
576  bool success = m_playerCtx->m_buffer->DVD()->PlayTrack(Chapter);
577  if (success)
578  {
579  if (m_decoder)
580  {
582  if (m_playerCtx->m_buffer->DVD()->GetCellStart() == 0)
583  m_decoder->SeekReset(static_cast<long long>(m_framesPlayed), 0, true, true);
584  }
586  }
587 
588  m_jumpChapter = 0;
589  return success;
590 }
591 
593 {
594  if (!m_osd || !m_playerCtx->m_buffer->IsDVD())
595  return;
596 
597  uint buttonversion = 0;
598  AVSubtitle *dvdSubtitle = m_playerCtx->m_buffer->DVD()->GetMenuSubtitle(buttonversion);
599  bool numbuttons = m_playerCtx->m_buffer->DVD()->NumMenuButtons() != 0;
600 
601  bool expired = false;
602 
603  VideoFrame *currentFrame = m_videoOutput ? m_videoOutput->GetLastShownFrame() : nullptr;
604 
605  if (!currentFrame)
606  {
608  return;
609  }
610 
611  if (dvdSubtitle &&
612  (dvdSubtitle->end_display_time > dvdSubtitle->start_display_time) &&
613  (dvdSubtitle->end_display_time < currentFrame->timecode))
614  {
615  expired = true;
616  }
617 
618  // nothing to do
619  if (!expired && (buttonversion == (static_cast<uint>(m_buttonVersion))))
620  {
622  return;
623  }
624 
625  // clear any buttons
626  if (!numbuttons || !dvdSubtitle || (buttonversion == 0) || expired)
627  {
628  m_osdLock.lock();
629  if (m_osd)
631  m_osdLock.unlock();
632  m_buttonVersion = 0;
634  return;
635  }
636 
637  if (currentFrame->timecode && (dvdSubtitle->start_display_time > currentFrame->timecode))
638  {
640  return;
641  }
642 
643  m_buttonVersion = static_cast<int>(buttonversion);
644  QRect buttonPos = m_playerCtx->m_buffer->DVD()->GetButtonCoords();
645  m_osdLock.lock();
646  if (m_osd)
647  m_osd->DisplayDVDButton(dvdSubtitle, buttonPos);
648  m_osdLock.unlock();
651 }
652 
653 bool MythDVDPlayer::GoToMenu(const QString& Menu)
654 {
655  if (!m_playerCtx->m_buffer->IsDVD())
656  return false;
658  bool ret = m_playerCtx->m_buffer->DVD()->GoToMenu(Menu);
659 
660  if (!ret)
661  {
662  SetOSDMessage(tr("DVD Menu Not Available"), kOSDTimeout_Med);
663  LOG(VB_GENERAL, LOG_ERR, "No DVD Menu available.");
664  return false;
665  }
666 
667  return true;
668 }
669 
670 void MythDVDPlayer::GoToDVDProgram(bool Direction)
671 {
672  if (!m_playerCtx->m_buffer->IsDVD())
673  return;
674  if (Direction)
676  else
678 }
679 
681 {
682  return (m_stillFrameLength > 0);
683 }
684 
686 {
688  return m_playerCtx->m_buffer->DVD()->GetNumAngles();
689  return 0;
690 }
691 
693 {
695  return m_playerCtx->m_buffer->DVD()->GetCurrentAngle();
696  return -1;
697 }
698 
699 QString MythDVDPlayer::GetAngleName(int Angle) const
700 {
701  if (Angle >= 1 && Angle <= GetNumAngles())
702  {
703  QString name = tr("Angle %1").arg(Angle);
704  return name;
705  }
706  return QString();
707 }
708 
710 {
711  int total = GetNumAngles();
712  if (!total || Angle == GetCurrentAngle())
713  return false;
714 
715  if (Angle < 1 || Angle > total)
716  Angle = 1;
717 
718  return m_playerCtx->m_buffer->DVD()->SwitchAngle(Angle);
719 }
720 
722 {
723  m_stillFrameTimerLock.lock();
725  m_stillFrameTimerLock.unlock();
726 }
727 
729 {
730  if (Length != m_stillFrameLength)
731  {
732  m_stillFrameTimerLock.lock();
733  m_stillFrameLength = Length;
735  m_stillFrameTimerLock.unlock();
736  }
737 }
738 
740 {
741  if (m_playerCtx->m_buffer->IsDVD() &&
743  (m_stillFrameLength > 0) && (m_stillFrameLength < 0xff))
744  {
745  m_stillFrameTimerLock.lock();
746  int elapsedTime = static_cast<int>(m_stillFrameTimer.elapsed() * m_playSpeed / 1000.0F);
747  m_stillFrameTimerLock.unlock();
748  if (elapsedTime >= m_stillFrameLength)
749  {
750  LOG(VB_PLAYBACK, LOG_INFO, LOC +
751  QString("Stillframe timeout after %1 seconds (timestretch %2)")
752  .arg(m_stillFrameLength).arg(static_cast<double>(m_playSpeed)));
754  m_stillFrameLength = 0;
755  }
756  }
757 }
758 
760 {
763 }
ProgramInfo::SaveDVDBookmark
static void SaveDVDBookmark(const QStringList &fields)
Definition: programinfo.cpp:2740
MythDVDBuffer::PlayTrack
bool PlayTrack(int Track)
Definition: mythdvdbuffer.cpp:1097
MythDVDPlayer::EnableCaptions
void EnableCaptions(uint Mode, bool OSDMsg=true) override
Definition: mythdvdplayer.cpp:54
MythDVDBuffer::IsOpen
bool IsOpen(void) const override
Definition: mythdvdbuffer.cpp:211
MythDVDPlayer::DisableCaptions
void DisableCaptions(uint Mode, bool OSDMsg=true) override
Definition: mythdvdplayer.cpp:47
MythDVDPlayer::VideoStart
void VideoStart(void) override
Definition: mythdvdplayer.cpp:116
MythPlayer::m_videoPaused
bool m_videoPaused
Definition: mythplayer.h:693
MythDVDPlayer::SetTrack
int SetTrack(uint Type, int TrackNo) override
Definition: mythdvdplayer.cpp:522
PlayerContext::UnlockPlayingInfo
void UnlockPlayingInfo(const char *file, int line) const
Definition: playercontext.cpp:556
mythdvddecoder.h
MythDVDPlayer::SetStillFrameTimeout
void SetStillFrameTimeout(int Length)
Definition: mythdvdplayer.cpp:728
MythDVDBuffer::RestoreDVDStateSnapshot
bool RestoreDVDStateSnapshot(QString &State)
Restore a DVD VM from a snapshot.
Definition: mythdvdbuffer.cpp:1923
MythDVDBuffer::SkipStillFrame
void SkipStillFrame(void)
Definition: mythdvdbuffer.cpp:1194
MythPlayer::ChangeSpeed
virtual void ChangeSpeed(void)
Definition: mythplayer.cpp:3642
kEofStateNone
@ kEofStateNone
Definition: decoderbase.h:70
MythPlayer::InitialSeek
virtual void InitialSeek(void)
Definition: mythplayer.cpp:2745
MythDVDPlayer::GoToMenu
bool GoToMenu(const QString &Menu) override
Definition: mythdvdplayer.cpp:653
MythDVDPlayer::JumpToFrame
bool JumpToFrame(uint64_t Frame) override
Definition: mythdvdplayer.cpp:257
MythPlayer::DecoderPauseCheck
virtual void DecoderPauseCheck(void)
Definition: mythplayer.cpp:3189
MythOpticalBuffer::IsInMenu
bool IsInMenu(void) const override
Definition: mythopticalbuffer.cpp:9
MythPlayer::m_playSpeed
float m_playSpeed
Definition: mythplayer.h:829
MythDVDPlayer::CreateDecoder
void CreateDecoder(TestBufferVec &Testbuf) override
Definition: mythdvdplayer.cpp:759
MythDVDBuffer::IsInStillFrame
bool IsInStillFrame(void) const override
Definition: mythdvdbuffer.cpp:221
MythDVDPlayer::HasReachedEof
bool HasReachedEof(void) const override
Definition: mythdvdplayer.cpp:39
MythDVDPlayer::ResetStillFrameTimer
void ResetStillFrameTimer(void)
Definition: mythdvdplayer.cpp:721
OSD::DisplayDVDButton
void DisplayDVDButton(AVSubtitle *DVDButton, QRect &Pos)
Definition: osd.cpp:1217
MythDVDBuffer::SetTrack
void SetTrack(uint Type, int TrackNo)
set the dvd subtitle/audio track used
Definition: mythdvdbuffer.cpp:1851
MythTimer::addMSecs
void addMSecs(int ms)
Adds an offset to the last call to start() or restart().
Definition: mythtimer.cpp:145
MythPlayer::EventStart
virtual void EventStart(void)
Definition: mythplayer.cpp:2773
MythPlayer::PrebufferEnoughFrames
virtual bool PrebufferEnoughFrames(int min_buffers=0)
Definition: mythplayer.cpp:1957
StreamInfo::m_stream_id
int m_stream_id
Definition: decoderbase.h:100
DetectLetterbox.h
Frame
Definition: zmdefines.h:94
VideoFrame::timecode
long long timecode
Definition: mythframe.h:147
MythDVDPlayer::m_initialDvdState
QString m_initialDvdState
Definition: mythdvdplayer.h:79
mythdvdbuffer.h
MythDVDPlayer::DisplayLastFrame
void DisplayLastFrame(void)
Definition: mythdvdplayer.cpp:232
kDisplayNone
@ kDisplayNone
Definition: mythplayer.h:76
kDisplayDVDButton
@ kDisplayDVDButton
Definition: mythplayer.h:83
MythCoreContext::IsDatabaseIgnored
bool IsDatabaseIgnored(void) const
/brief Returns true if database is being ignored.
Definition: mythcorecontext.cpp:894
arg
arg(title).arg(filename).arg(doDelete))
MythPlayer::DisplayNormalFrame
virtual void DisplayNormalFrame(bool check_prebuffer=true)
Definition: mythplayer.cpp:2089
MythMediaBuffer::IgnoreWaitStates
virtual void IgnoreWaitStates(bool)
Definition: mythmediabuffer.h:129
MythPlayer::IsErrored
bool IsErrored(void) const
Definition: mythplayer.cpp:5397
MythMediaBuffer::IsDVD
bool IsDVD(void) const
Definition: mythmediabuffer.cpp:1823
DecoderBase::GetMythCodecContext
MythCodecContext * GetMythCodecContext(void)
Definition: decoderbase.h:264
LOG
#define LOG(_MASK_, _LEVEL_, _QSTRING_)
Definition: mythlogging.h:23
MythPlayer::GetTrack
int GetTrack(uint type)
Definition: mythplayer.cpp:1442
MythDVDBuffer::GoToMenu
bool GoToMenu(const QString &str)
jump to a dvd root or chapter menu
Definition: mythdvdbuffer.cpp:1232
MythDVDBuffer::TitleTimeLeft
uint TitleTimeLeft(void) const
returns seconds left in the title
Definition: mythdvdbuffer.cpp:1972
MythPlayer::GetEof
EofState GetEof(void) const
Definition: mythplayer.cpp:3201
VideoFrame
Definition: mythframe.h:135
MythMediaBuffer::IsInMenu
virtual bool IsInMenu(void) const
Definition: mythmediabuffer.h:130
MythPlayer::m_nextPlaySpeed
float m_nextPlaySpeed
Definition: mythplayer.h:828
MythDVDPlayer::DecoderGetFrameFFREW
bool DecoderGetFrameFFREW(void) override
Definition: mythdvdplayer.cpp:92
MythDVDBuffer::SkipDVDWaitingForPlayer
void SkipDVDWaitingForPlayer(void)
Definition: mythdvdbuffer.cpp:1215
MythVideoOutput::UpdatePauseFrame
virtual void UpdatePauseFrame(int64_t &DisplayTimecode, FrameScanType Scan=kScan_Progressive)=0
MythDVDPlayer::IsInStillFrame
bool IsInStillFrame() const override
Definition: mythdvdplayer.cpp:680
MythPlayer::DisplayPauseFrame
virtual void DisplayPauseFrame(void)
Definition: mythplayer.cpp:1912
MythDVDPlayer::SwitchAngle
bool SwitchAngle(int Angle) override
Definition: mythdvdplayer.cpp:709
MythDate::current
QDateTime current(bool stripped)
Returns current Date and Time in UTC.
Definition: mythdate.cpp:10
OSD::ClearSubtitles
void ClearSubtitles(void)
Definition: osd.cpp:1207
MythDVDDecoder
Definition: mythdvddecoder.h:15
MythPlayer::ReleaseNextVideoFrame
virtual void ReleaseNextVideoFrame(VideoFrame *buffer, int64_t timecode, bool wrap=true)
Places frame on the queue of frames ready for display.
Definition: mythplayer.cpp:956
MythPlayer::SetErrored
void SetErrored(const QString &reason)
Definition: mythplayer.cpp:5373
MythPlayer::m_needNewPauseFrame
bool m_needNewPauseFrame
Definition: mythplayer.h:691
MythDVDPlayer::InitialSeek
void InitialSeek(void) override
Definition: mythdvdplayer.cpp:289
MythPlayer::SetDecoder
void SetDecoder(DecoderBase *dec)
Sets the stream decoder, deleting any existing recorder.
Definition: mythplayer.cpp:5333
MythDVDPlayer::ReleaseNextVideoFrame
void ReleaseNextVideoFrame(VideoFrame *Buffer, int64_t Timecode, bool Wrap=true) override
Definition: mythdvdplayer.cpp:32
MythDVDBuffer::SetParent
void SetParent(MythDVDPlayer *Parent)
Definition: mythdvdbuffer.cpp:2163
MythPlayer::AutoDeint
virtual void AutoDeint(VideoFrame *frame, bool allow_lock=true)
Check whether deinterlacing should be enabled.
Definition: mythplayer.cpp:534
MythPlayer::m_osdLock
QMutex m_osdLock
Definition: mythplayer.h:804
MythDVDBuffer::DVDWaitingForPlayer
bool DVDWaitingForPlayer(void) const
Definition: mythdvdbuffer.cpp:429
EofState
EofState
Definition: decoderbase.h:69
MythPlayer::SetScanType
void SetScanType(FrameScanType Scan)
Definition: mythplayer.cpp:626
MythDVDPlayer::SeekForScreenGrab
void SeekForScreenGrab(uint64_t &Number, uint64_t FrameNum, bool Absolute) override
Definition: mythdvdplayer.cpp:500
MythDVDBuffer::GetCurrentAngle
int GetCurrentAngle(void) const
Definition: mythdvdbuffer.cpp:439
MythMediaBuffer::GetFilename
QString GetFilename(void) const
Definition: mythmediabuffer.cpp:1732
MythPlayer::UnpauseVideo
void UnpauseVideo(void)
Definition: mythplayer.cpp:306
DecoderBase::GetTrackCount
virtual uint GetTrackCount(uint Type)
Definition: decoderbase.cpp:904
MythPlayer::m_decoder
DecoderBase * m_decoder
Definition: mythplayer.h:656
MythPlayer::m_framesPlayed
uint64_t m_framesPlayed
Definition: mythplayer.h:726
MythDVDPlayer::PreProcessNormalFrame
void PreProcessNormalFrame(void) override
Definition: mythdvdplayer.cpp:111
MythPlayer::m_totalLength
long long m_totalLength
Definition: mythplayer.h:728
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:544
MythPlayer::AVSync
virtual void AVSync(VideoFrame *buffer)
Definition: mythplayer.cpp:1643
StreamInfo
Definition: decoderbase.h:76
MythDVDPlayer::GoToDVDProgram
void GoToDVDProgram(bool Direction) override
Definition: mythdvdplayer.cpp:670
MythDVDBuffer::PlayTitleAndPart
void PlayTitleAndPart(int Title, int Part)
Definition: mythdvdbuffer.cpp:1952
kScan_Progressive
@ kScan_Progressive
Definition: videoouttypes.h:84
MythDVDBuffer::GetButtonCoords
QRect GetButtonCoords(void)
get coordinates of highlighted button
Definition: mythdvdbuffer.cpp:1438
PlayerContext::m_playingInfo
ProgramInfo * m_playingInfo
Currently playing info.
Definition: playercontext.h:156
MythMediaBuffer::IsInDiscMenuOrStillFrame
virtual bool IsInDiscMenuOrStillFrame(void) const
Definition: mythmediabuffer.h:132
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:544
MythPlayer::m_bookmarkSeek
uint64_t m_bookmarkSeek
Definition: mythplayer.h:714
MythPlayer::EnableCaptions
virtual void EnableCaptions(uint mode, bool osd_msg=true)
Definition: mythplayer.cpp:1212
ProgramInfo::GetTitle
QString GetTitle(void) const
Definition: programinfo.h:359
MythDVDPlayer::StillFrameCheck
void StillFrameCheck(void)
Definition: mythdvdplayer.cpp:739
MythPlayer::m_videoOutput
MythVideoOutput * m_videoOutput
Definition: mythplayer.h:660
ProgramInfo::QueryDVDBookmark
QStringList QueryDVDBookmark(const QString &serialid) const
Queries "dvdbookmark" table for bookmarking DVD serial number.
Definition: programinfo.cpp:2707
MythDVDPlayer::AutoDeint
void AutoDeint(VideoFrame *Frame, bool AllowLock=true) override
Check whether deinterlacing should be enabled.
Definition: mythdvdplayer.cpp:13
MythCodecContext::IsDeinterlacing
virtual bool IsDeinterlacing(bool &, bool=false)
Definition: mythcodeccontext.h:152
PlayerContext::m_buffer
MythMediaBuffer * m_buffer
Definition: playercontext.h:155
MythPlayer::PauseVideo
void PauseVideo(void)
Definition: mythplayer.cpp:298
MythDVDPlayer::PrepareAudioSample
bool PrepareAudioSample(int64_t &Timecode) override
Definition: mythdvdplayer.cpp:327
MythDVDPlayer::GetChapterTimes
void GetChapterTimes(QList< long long > &Times) override
Definition: mythdvdplayer.cpp:547
MythPlayer::ClearAfterSeek
void ClearAfterSeek(bool clearvideobuffers=true)
This is to support seeking...
Definition: mythplayer.cpp:3978
MythPlayer::VideoLoop
virtual bool VideoLoop(void)
Definition: mythplayer.cpp:2282
MythPlayer::SetBuffering
void SetBuffering(bool new_buffering)
Definition: mythplayer.cpp:1937
MythPlayer::m_totalFrames
uint64_t m_totalFrames
Definition: mythplayer.h:727
MythPlayer::ResetPlaying
virtual void ResetPlaying(bool resetframes=true)
Definition: mythplayer.cpp:2399
MythPlayer::m_osd
OSD * m_osd
Definition: mythplayer.h:802
MythDVDPlayer::GetCurrentAngle
int GetCurrentAngle(void) const override
Definition: mythdvdplayer.cpp:692
ProgramInfo::SetTitle
void SetTitle(const QString &t, const QString &st=nullptr)
Definition: programinfo.cpp:1145
TestBufferVec
std::vector< char > TestBufferVec
Definition: decoderbase.h:24
MythPlayer::m_playerCtx
PlayerContext * m_playerCtx
Definition: mythplayer.h:661
kTrackTypeAudio
@ kTrackTypeAudio
Definition: decoderbase.h:30
MythDVDPlayer::CalcMaxFFTime
long long CalcMaxFFTime(long long FastFwd, bool Setjump=true) const override
CalcMaxFFTime(ffframes): forward ffframes forward.
Definition: mythdvdplayer.cpp:460
MythPlayer::DisableCaptions
virtual void DisableCaptions(uint mode, bool osd_msg=true)
Definition: mythplayer.cpp:1164
uint
unsigned int uint
Definition: compat.h:140
MythDVDBuffer::ReleaseMenuButton
void ReleaseMenuButton(void)
Definition: mythdvdbuffer.cpp:1431
MythDVDBuffer::NumPartsInTitle
int NumPartsInTitle(void) const
Definition: mythdvdbuffer.cpp:1180
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:667
MythDVDBuffer::IsWaiting
bool IsWaiting(void) const
Definition: mythdvdbuffer.cpp:1175
MythDVDPlayer::Rewind
bool Rewind(float Seconds) override
Definition: mythdvdplayer.cpp:250
MythPlayer::SetTrack
virtual int SetTrack(uint type, int trackNo)
Definition: mythplayer.cpp:1349
MythDVDPlayer::EventEnd
virtual void EventEnd(void)
Definition: mythdvdplayer.cpp:321
kTrackTypeSubtitle
@ kTrackTypeSubtitle
Definition: decoderbase.h:32
MythPlayer::DecoderGetFrameREW
virtual bool DecoderGetFrameREW(void)
Definition: mythplayer.cpp:3321
MythDVDPlayer::GetCurrentChapter
int GetCurrentChapter(void) override
Definition: mythdvdplayer.cpp:540
MythVideoOutput::EnoughFreeFrames
bool EnoughFreeFrames()
Returns true iff enough frames are available to decode onto.
Definition: mythvideoout.cpp:556
MythDVDPlayer::m_stillFrameTimerLock
QMutex m_stillFrameTimerLock
Definition: mythdvdplayer.h:84
MythPlayer::m_jumpChapter
int m_jumpChapter
Definition: mythplayer.h:711
MythDVDBuffer::GetMenuSubtitle
AVSubtitle * GetMenuSubtitle(uint &Version)
returns dvd menu button information if available.
Definition: mythdvdbuffer.cpp:1416
MythTimer::elapsed
int elapsed(void)
Returns milliseconds elapsed since last start() or restart()
Definition: mythtimer.cpp:90
MythPlayer::m_textDisplayMode
uint m_textDisplayMode
Definition: mythplayer.h:767
MythDVDBuffer::SetDVDSpeed
void SetDVDSpeed(void)
set dvd speed. uses the constant DVD_DRIVE_SPEED table
Definition: mythdvdbuffer.cpp:1958
MythPlayer::CalcMaxFFTime
virtual long long CalcMaxFFTime(long long ff, bool setjump=true) const
CalcMaxFFTime(ffframes): forward ffframes forward.
Definition: mythplayer.cpp:3733
MythDVDBuffer::GoToNextProgram
void GoToNextProgram(void)
Definition: mythdvdbuffer.cpp:1294
MythDVDPlayer::ResetPlaying
void ResetPlaying(bool ResetFrames=true) override
Definition: mythdvdplayer.cpp:316
MythMediaBuffer::IsBookmarkAllowed
virtual bool IsBookmarkAllowed(void)
Definition: mythmediabuffer.h:126
MythDVDPlayer::DisplayPauseFrame
void DisplayPauseFrame(void) override
Definition: mythdvdplayer.cpp:70
DecoderBase::UpdateFramesPlayed
virtual void UpdateFramesPlayed(void)
Definition: decoderbase.cpp:871
Buffer
Definition: MythExternControl.h:37
MythDVDBuffer::GetNumAngles
int GetNumAngles(void) const
Definition: mythdvdbuffer.cpp:444
MythVideoOutput::GetLastShownFrame
virtual VideoFrame * GetLastShownFrame()
Returns frame from the head of the ready to be displayed queue, if StartDisplayingFrame has been call...
Definition: mythvideoout.cpp:582
MythPlayer::m_dispTimecode
int64_t m_dispTimecode
Definition: mythplayer.h:842
MythDVDPlayer::GetNumChapters
int GetNumChapters(void) override
Definition: mythdvdplayer.cpp:533
kScan_Interlaced
@ kScan_Interlaced
Definition: videoouttypes.h:82
Clear
#define Clear(a)
Definition: audiooutputopensles.cpp:49
MythDVDPlayer::GetBookmark
uint64_t GetBookmark(void) override
Definition: mythdvdplayer.cpp:384
MythDVDPlayer::DecoderPauseCheck
void DecoderPauseCheck(void) override
Definition: mythdvdplayer.cpp:81
TC_AUDIO
@ TC_AUDIO
Definition: mythplayer.h:66
MythDVDBuffer::GetNameAndSerialNum
bool GetNameAndSerialNum(QString &Name, QString &SerialNumber) override
Get the dvd title and serial num.
Definition: mythdvdbuffer.cpp:1898
kDisplayAVSubtitle
@ kDisplayAVSubtitle
Definition: mythplayer.h:79
MythDVDBuffer::GetPart
int GetPart(void) const
Definition: mythdvdbuffer.cpp:434
MythPlayer::m_decodeOneFrame
bool m_decodeOneFrame
Definition: mythplayer.h:690
MythDVDPlayer::m_stillFrameLength
int m_stillFrameLength
Definition: mythdvdplayer.h:83
audiooutput.h
MythDVDBuffer::GetTotalTimeOfTitle
uint GetTotalTimeOfTitle(void) const
get the total time of the title in seconds 90000 ticks = 1 sec
Definition: mythdvdbuffer.cpp:1139
MythDVDBuffer::GetCurrentTime
int64_t GetCurrentTime(void) const
Definition: mythdvdbuffer.cpp:1977
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:855
MythDVDBuffer::GetCellStart
uint GetCellStart(void) const
get the start of the cell in seconds
Definition: mythdvdbuffer.cpp:1151
MythDVDPlayer::PrebufferEnoughFrames
bool PrebufferEnoughFrames(int MinBuffers=0) override
Definition: mythdvdplayer.cpp:87
MythDVDBuffer::IsStillFramePending
bool IsStillFramePending(void) const
Definition: mythdvdbuffer.cpp:1165
MythDVDBuffer::NumMenuButtons
int NumMenuButtons(void) const
Definition: mythdvdbuffer.cpp:1702
MythDVDPlayer::m_initialSubtitleTrack
int m_initialSubtitleTrack
Definition: mythdvdplayer.h:78
MythDVDBuffer::WaitSkip
void WaitSkip(void)
Definition: mythdvdbuffer.cpp:1207
MythPlayer::DecoderGetFrameFFREW
virtual bool DecoderGetFrameFFREW(void)
Definition: mythplayer.cpp:3297
MythPlayer::JumpToFrame
virtual bool JumpToFrame(uint64_t frame)
Definition: mythplayer.cpp:2372
MythMediaBuffer::DVD
const MythDVDBuffer * DVD(void) const
Definition: mythmediabuffer.cpp:1833
MythPlayer::m_allPaused
bool m_allPaused
Definition: mythplayer.h:694
MythPlayer::m_decoderChangeLock
QMutex m_decoderChangeLock
Definition: mythplayer.h:659
MythDVDBuffer::GetChapterTimes
void GetChapterTimes(QList< long long > &Times)
Definition: mythdvdbuffer.cpp:367
MythDVDPlayer::DecoderGetFrameREW
bool DecoderGetFrameREW(void) override
Definition: mythdvdplayer.cpp:104
MythDVDPlayer::SetBookmark
void SetBookmark(bool Clear=false) override
Definition: mythdvdplayer.cpp:336
MythDVDBuffer::GoToPreviousProgram
void GoToPreviousProgram(void)
Definition: mythdvdbuffer.cpp:1303
MythPlayer::WrapTimecode
void WrapTimecode(int64_t &timecode, TCTypes tc_type)
Definition: mythplayer.cpp:3497
MythDVDPlayer::DoJumpChapter
bool DoJumpChapter(int Chapter) override
Definition: mythdvdplayer.cpp:554
kOSDTimeout_Med
@ kOSDTimeout_Med
Definition: osd.h:62
MythDVDBuffer::SwitchAngle
bool SwitchAngle(int Angle)
Definition: mythdvdbuffer.cpp:2148
DecoderBase::SeekReset
virtual void SeekReset(long long newkey, uint skipFrames, bool doFlush, bool discardFrames)
Definition: decoderbase.cpp:70
MythPlayer::FastForward
virtual bool FastForward(float seconds)
Definition: mythplayer.cpp:2325
MythDVDPlayer::ChangeSpeed
void ChangeSpeed(void) override
Definition: mythdvdplayer.cpp:432
MythDVDPlayer::VideoLoop
bool VideoLoop(void) override
Definition: mythdvdplayer.cpp:124
MythDVDPlayer::EventStart
void EventStart(void) override
Definition: mythdvdplayer.cpp:267
MythPlayer::VideoStart
virtual void VideoStart(void)
Definition: mythplayer.cpp:2200
LOC
#define LOC
Definition: mythdvdplayer.cpp:11
MythDVDPlayer::m_initialTitle
int m_initialTitle
Definition: mythdvdplayer.h:76
MThread::usleep
static void usleep(unsigned long time)
Definition: mthread.cpp:343
MythTimer::restart
int restart(void)
Returns milliseconds elapsed since last start() or restart() and resets the count.
Definition: mythtimer.cpp:62
MythDVDPlayer::FastForward
bool FastForward(float Seconds) override
Definition: mythdvdplayer.cpp:243
MythDVDPlayer::m_initialAudioTrack
int m_initialAudioTrack
Definition: mythdvdplayer.h:77
MythDVDPlayer::GetTotalSeconds
int64_t GetTotalSeconds(bool HonorCutList, int Divisor=1000) const override
Definition: mythdvdplayer.cpp:486
MythDVDPlayer::GetSecondsPlayed
int64_t GetSecondsPlayed(bool HonorCutList, int Divisor=1000) override
Definition: mythdvdplayer.cpp:468
MythDVDPlayer::GetAngleName
QString GetAngleName(int Angle) const override
Definition: mythdvdplayer.cpp:699
MythDVDPlayer::DisplayDVDButton
void DisplayDVDButton(void)
Definition: mythdvdplayer.cpp:592
MythDVDPlayer::GetNumAngles
int GetNumAngles(void) const override
Definition: mythdvdplayer.cpp:685
MythPlayer::SetOSDMessage
void SetOSDMessage(const QString &msg, OSDTimeout timeout)
Definition: mythplayer.cpp:5500
MythPlayer::Rewind
virtual bool Rewind(float seconds)
Definition: mythplayer.cpp:2350
MythDVDBuffer::GetDVDStateSnapshot
bool GetDVDStateSnapshot(QString &State)
Get a snapshot of the current DVD VM state.
Definition: mythdvdbuffer.cpp:1907
MythDVDPlayer::m_buttonVersion
int m_buttonVersion
Definition: mythdvdplayer.h:72