MythTV  master
mythdvdplayer.cpp
Go to the documentation of this file.
1 // MythTV
2 #include "dvdringbuffer.h"
3 #include "DetectLetterbox.h"
4 #include "audiooutput.h"
5 #include "avformatdecoderdvd.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 
523 {
524  if (kTrackTypeAudio == Type)
525  {
526  StreamInfo stream = m_decoder->GetTrackInfo(Type, static_cast<uint>(TrackNo));
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(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(static_cast<uint>(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 
759 void MythDVDPlayer::CreateDecoder(char *Testbuf, int TestReadSize)
760 {
762  TestReadSize))
763  {
765  m_playerFlags));
766  }
767 }
int GetPart(void) const
bool DoJumpChapter(int Chapter) override
int GetCurrentAngle(void) const override
void SetTrack(uint type, int trackNo)
set the dvd subtitle/audio track used
int restart(void)
Returns milliseconds elapsed since last start() or restart() and resets the count.
Definition: mythtimer.cpp:62
int GetCurrentAngle(void) const
uint m_textDisplayMode
Definition: mythplayer.h:749
void GetChapterTimes(QList< long long > &Times) override
int64_t m_dispTimecode
Definition: mythplayer.h:828
bool VideoLoop(void) override
int GetNumAngles(void) const override
virtual void AutoDeint(VideoFrame *frame, bool allow_lock=true)
Definition: mythplayer.cpp:541
bool GoToMenu(QString Menu) override
void SetErrored(const QString &reason)
const DVDRingBuffer * DVD(void) const
bool m_dvdStillFrameShowing
Definition: mythdvdplayer.h:73
virtual void AVSync(VideoFrame *buffer)
bool FastForward(float Seconds) override
MythCodecContext * GetMythCodecContext(void)
Definition: decoderbase.h:267
virtual void SeekReset(long long newkey, uint skipFrames, bool doFlush, bool discardFrames)
Definition: decoderbase.cpp:72
int NumPartsInTitle(void) const
virtual bool IsInDiscMenuOrStillFrame(void) const
void EnableCaptions(uint Mode, bool OSDMsg=true) override
long long timecode
Definition: mythframe.h:149
QMutex m_stillFrameTimerLock
Definition: mythdvdplayer.h:84
void SetScanType(FrameScanType)
Definition: mythplayer.cpp:583
void SkipDVDWaitingForPlayer(void)
QMutex m_decoderChangeLock
Definition: mythplayer.h:636
bool m_decodeOneFrame
Definition: mythplayer.h:664
void GoToNextProgram(void)
int64_t GetSecondsPlayed(bool HonorCutList, int Divisor=1000) override
void ClearAfterSeek(bool clearvideobuffers=true)
This is to support seeking...
int64_t GetTotalSeconds(bool HonorCutList, int Divisor=1000) const override
uint64_t m_framesPlayed
Definition: mythplayer.h:703
uint64_t m_totalFrames
Definition: mythplayer.h:707
void AutoDeint(VideoFrame *Frame, bool AllowLock=true) override
uint GetTotalTimeOfTitle(void)
get the total time of the title in seconds 90000 ticks = 1 sec
uint64_t m_bookmarkSeek
Definition: mythplayer.h:691
bool SwitchAngle(uint angle)
RingBuffer * m_buffer
virtual bool JumpToFrame(uint64_t frame)
void ClearSubtitles(void)
Definition: osd.cpp:1215
void UnlockPlayingInfo(const char *file, int line) const
bool SwitchAngle(int Angle) override
bool RestoreDVDStateSnapshot(QString &state)
Restore a DVD VM from a snapshot.
QString GetTitle(void) const
Definition: programinfo.h:353
void SetDVDSpeed(void)
set dvd speed.
bool PrepareAudioSample(int64_t &Timecode) override
QString GetFilename(void) const
Returns name of file used by this RingBuffer.
void PauseVideo(void)
Definition: mythplayer.cpp:313
virtual void VideoStart(void)
void ChangeSpeed(void) override
virtual void DisableCaptions(uint mode, bool osd_msg=true)
virtual int ValidVideoFrames(void) const
Returns number of frames that are fully decoded.
MythCoreContext * gCoreContext
This global variable contains the MythCoreContext instance for the app.
void DisplayLastFrame(void)
void SkipStillFrame(void)
virtual bool VideoLoop(void)
void SetOSDMessage(const QString &msg, OSDTimeout timeout)
bool IsDatabaseIgnored(void) const
/brief Returns true if database is being ignored.
virtual void ResetPlaying(bool resetframes=true)
PlayerContext * m_playerCtx
Definition: mythplayer.h:638
void ReleaseNextVideoFrame(VideoFrame *Buffer, int64_t Timecode, bool Wrap=true) override
void GetChapterTimes(QList< long long > &times)
bool DecoderGetFrameFFREW(void) override
virtual bool FastForward(float seconds)
QRect GetButtonCoords(void)
get coordinates of highlighted button
virtual void UpdatePauseFrame(int64_t &DisplayTimecode)=0
bool PrebufferEnoughFrames(int MinBuffers=0) override
#define LOC
virtual bool Rewind(float seconds)
bool DecoderGetFrameREW(void) override
EofState
Definition: decoderbase.h:67
void DecoderPauseCheck(void) override
ProgramInfo * m_playingInfo
Currently playing info.
bool IsDVD(void) const
void InitialSeek(void) override
int m_jumpChapter
Definition: mythplayer.h:688
bool DVDWaitingForPlayer(void)
bool IsStillFramePending(void) const
bool HasReachedEof(void) const override
bool IsInStillFrame() const override
virtual bool IsInMenu(void) const
virtual void EventStart(void)
static void SaveDVDBookmark(const QStringList &fields)
QStringList QueryDVDBookmark(const QString &serialid) const
Queries "dvdbookmark" table for bookmarking DVD serial number.
void SeekForScreenGrab(uint64_t &Number, uint64_t FrameNum, bool Absolute) override
uint TitleTimeLeft(void)
returns seconds left in the title
QDateTime current(bool stripped)
Returns current Date and Time in UTC.
Definition: mythdate.cpp:10
bool Rewind(float Seconds) override
int GetTrack(uint type)
void LockPlayingInfo(const char *file, int line) const
bool IsInStillFrame(void) const override
int m_stream_id
Definition: decoderbase.h:99
EofState GetEof(void) const
bool playTrack(int track)
int NumMenuButtons(void) const
virtual void UpdateFramesPlayed(void)
float m_nextPlaySpeed
Definition: mythplayer.h:810
void SetStillFrameTimeout(int Length)
int GetCurrentChapter(void) override
void ResetPlaying(bool ResetFrames=true) override
unsigned int uint
Definition: compat.h:140
bool EnoughFreeFrames(void)
Returns true iff enough frames are available to decode onto.
void WrapTimecode(int64_t &timecode, TCTypes tc_type)
virtual bool IsBookmarkAllowed(void)
bool IsErrored(void) const
void VideoStart(void) override
void SetParent(MythDVDPlayer *p)
virtual bool DecoderGetFrameFFREW(void)
bool IsWaiting(void) const
bool m_allPaused
Definition: mythplayer.h:671
virtual void DisplayNormalFrame(bool check_prebuffer=true)
bool IsOpen(void) const override
Returns true if open for either reading or writing.
AVSubtitle * GetMenuSubtitle(uint &version)
returns dvd menu button information if available.
MythTimer m_stillFrameTimer
Definition: mythdvdplayer.h:82
QString m_initialDvdState
Definition: mythdvdplayer.h:79
void SetBookmark(bool Clear=false) override
long long m_totalLength
Definition: mythplayer.h:708
int m_stillFrameLength
Definition: mythdvdplayer.h:83
void UnpauseVideo(void)
Definition: mythplayer.cpp:321
DecoderBase * m_decoder
Definition: mythplayer.h:635
static bool CanHandle(char testbuf[kDecoderProbeBufferSize], const QString &filename, int testbufsize=kDecoderProbeBufferSize)
Perform an av_probe_input_format on the passed data to see if we can decode it with this class.
void addMSecs(int ms)
Adds an offset to the last call to start() or restart().
Definition: mythtimer.cpp:145
void GoToPreviousProgram(void)
uint64_t GetBookmark(void) override
void SetTitle(const QString &t, const QString &st=nullptr)
virtual uint GetTrackCount(uint type) const
Definition: decoderbase.h:237
void ResetStillFrameTimer(void)
bool m_needNewPauseFrame
Definition: mythplayer.h:665
virtual void ReleaseNextVideoFrame(VideoFrame *buffer, int64_t timecode, bool wrap=true)
Places frame on the queue of frames ready for display.
Definition: mythplayer.cpp:913
int SetTrack(uint Type, int TrackNo) override
#define LOG(_MASK_, _LEVEL_, _STRING_)
Definition: mythlogging.h:41
void WaitSkip(void)
virtual void EnableCaptions(uint mode, bool osd_msg=true)
void SetDecoder(DecoderBase *dec)
Sets the stream decoder, deleting any existing recorder.
bool GetNameAndSerialNum(QString &_name, QString &_serialnum)
Get the dvd title and serial num.
bool m_videoPaused
Definition: mythplayer.h:670
int m_initialAudioTrack
Definition: mythdvdplayer.h:77
StreamInfo GetTrackInfo(uint type, uint trackNo) const
uint GetCellStart(void)
get the start of the cell in seconds
void DisableCaptions(uint Mode, bool OSDMsg=true) override
int elapsed(void)
Returns milliseconds elapsed since last start() or restart()
Definition: mythtimer.cpp:90
void PlayTitleAndPart(int _title, int _part)
void StillFrameCheck(void)
virtual void ChangeSpeed(void)
float m_playSpeed
Definition: mythplayer.h:813
void SetBuffering(bool new_buffering)
virtual bool PrebufferEnoughFrames(int min_buffers=0)
const char * frames[3]
Definition: element.c:46
void CreateDecoder(char *Testbuf, int TestReadSize) override
MythVideoOutput * m_videoOutput
Definition: mythplayer.h:637
virtual bool IsDeinterlacing(bool &, bool=false)
int GetNumChapters(void) override
int GetNumAngles(void)
void PreProcessNormalFrame(void) override
virtual VideoFrame * GetLastShownFrame(void)
Returns frame from the head of the ready to be displayed queue, if StartDisplayingFrame has been call...
void DisplayDVDButton(AVSubtitle *DVDButton, QRect &Pos)
Definition: osd.cpp:1225
bool IsInMenu(void) const override
virtual void InitialSeek(void)
void GoToDVDProgram(bool Direction) override
virtual void IgnoreWaitStates(bool)
virtual bool DecoderGetFrameREW(void)
virtual void EventEnd(void)
virtual void DecoderPauseCheck(void)
OSD * m_osd
Definition: mythplayer.h:784
QString GetAngleName(int Angle) const override
void DisplayDVDButton(void)
int64_t GetCurrentTime(void)
long long CalcMaxFFTime(long long FastFwd, bool Setjump=true) const override
CalcMaxFFTime(ffframes): forward ffframes forward.
virtual long long CalcMaxFFTime(long long ff, bool setjump=true) const
CalcMaxFFTime(ffframes): forward ffframes forward.
void EventStart(void) override
PlayerFlags m_playerFlags
Definition: mythplayer.h:634
#define Clear(a)
int m_initialSubtitleTrack
Definition: mythdvdplayer.h:78
virtual int SetTrack(uint type, int trackNo)
void DisplayPauseFrame(void) override
bool JumpToFrame(uint64_t Frame) override
virtual void DisplayPauseFrame(void)
bool GoToMenu(const QString &str)
jump to a dvd root or chapter menu
QMutex m_osdLock
Definition: mythplayer.h:786
bool GetDVDStateSnapshot(QString &state)
Get a snapshot of the current DVD VM state.
void ReleaseMenuButton(void)