MythTV  master
mythdvdplayer.cpp
Go to the documentation of this file.
1 #include "dvdringbuffer.h"
2 #include "DetectLetterbox.h"
3 #include "audiooutput.h"
4 #include "avformatdecoderdvd.h"
5 #include "mythdvdplayer.h"
6 
7 #include <unistd.h> // for usleep()
8 
9 #define LOC QString("DVDPlayer: ")
10 
11 void MythDVDPlayer::AutoDeint(VideoFrame *frame, bool allow_lock)
12 {
13  (void)frame;
14  (void)allow_lock;
16 }
17 
26  int64_t timecode, bool /*wrap*/)
27 {
28  MythPlayer::ReleaseNextVideoFrame(buffer, timecode,
30 }
31 
33 {
34  EofState eof = GetEof();
35  // DeleteMap and EditMode from the parent MythPlayer should not be
36  // relevant here.
37  return eof != kEofStateNone && !allpaused;
38 }
39 
40 void MythDVDPlayer::DisableCaptions(uint mode, bool osd_msg)
41 {
42  if ((kDisplayAVSubtitle & mode) && player_ctx->m_buffer->IsDVD())
44  MythPlayer::DisableCaptions(mode, osd_msg);
45 }
46 
47 void MythDVDPlayer::EnableCaptions(uint mode, bool osd_msg)
48 {
49  if ((kDisplayAVSubtitle & mode) && player_ctx->m_buffer->IsDVD())
50  {
51  int track = GetTrack(kTrackTypeSubtitle);
52  if (track >= 0 && track < (int)decoder->GetTrackCount(kTrackTypeSubtitle))
53  {
55  track);
57  stream.m_stream_id);
58  }
59  }
60  MythPlayer::EnableCaptions(mode, osd_msg);
61 }
62 
64 {
65  if (player_ctx->m_buffer->IsDVD() &&
67  {
69  }
72 }
73 
75 {
78 }
79 
80 bool MythDVDPlayer::PrebufferEnoughFrames(int /*min_buffers*/)
81 {
83 }
84 
86 {
88  if (decoder_change_lock.tryLock(1))
89  {
90  if (decoder)
92  decoder_change_lock.unlock();
93  }
94  return res;
95 }
96 
98 {
100  return (player_ctx->m_buffer->IsDVD() &&
101  (player_ctx->m_buffer->DVD()->GetCurrentTime() < 2));
102 }
103 
105 {
107 }
108 
110 {
111  if (!m_initial_dvdstate.isEmpty())
113 
115 }
116 
118 {
119  if (!player_ctx->m_buffer->IsDVD())
120  {
121  SetErrored("RingBuffer is not a DVD.");
122  return !IsErrored();
123  }
124 
125  int nbframes = 0;
126  if (videoOutput)
127  nbframes = videoOutput->ValidVideoFrames();
128 
129 #if 0
130  LOG(VB_PLAYBACK, LOG_DEBUG,
131  LOC + QString("Validframes %1, FreeFrames %2, VideoPaused %3")
132  .arg(nbframes).arg(videoOutput->FreeVideoFrames()).arg(videoPaused));
133 #endif
134 
135  // completely drain the video buffers for certain situations
136  bool release_all = player_ctx->m_buffer->DVD()->DVDWaitingForPlayer() &&
137  (nbframes > 0);
138  bool release_one = (nbframes > 1) && videoPaused && !allpaused &&
140  player_ctx->m_buffer->DVD()->IsWaiting() ||
142  if (release_all || release_one)
143  {
144  if (nbframes < 5 && videoOutput)
146 
147  // if we go below the pre-buffering limit, the player will pause
148  // so do this 'manually'
149  DisplayNormalFrame(false);
150  // unpause the still frame if more frames become available
151  if (m_dvd_stillframe_showing && nbframes > 1)
152  {
153  m_dvd_stillframe_showing = false;
154  UnpauseVideo();
155  }
156  return !IsErrored();
157  }
158 
159  // clear the mythtv imposed wait state
161  {
162  LOG(VB_PLAYBACK, LOG_INFO, LOC + "Clearing MythTV DVD wait state");
164  ClearAfterSeek(true);
165  if (videoPaused && !allpaused)
166  UnpauseVideo();
167  return !IsErrored();
168  }
169 
170  // wait for the video buffers to drain
171  if (nbframes < 2)
172  {
173  // clear the DVD wait state
174  if (player_ctx->m_buffer->DVD()->IsWaiting())
175  {
176  LOG(VB_PLAYBACK, LOG_INFO, LOC + "Clearing DVD wait state");
178  if (videoPaused && !allpaused)
179  UnpauseVideo();
180  return !IsErrored();
181  }
182 
183  // the still frame is treated as a pause frame
185  {
186  // ensure we refresh the pause frame
188  needNewPauseFrame = true;
189 
190  // we are in a still frame so pause video output
191  if (!videoPaused)
192  {
193  PauseVideo();
195  return !IsErrored();
196  }
197 
198  // see if the pause frame has timed out
199  StillFrameCheck();
200 
201  // flag if we have no frame
202  if (nbframes == 0)
203  {
204  LOG(VB_PLAYBACK, LOG_WARNING, LOC +
205  "In DVD Menu: No video frames in queue");
206  usleep(10000);
207  return !IsErrored();
208  }
209 
211  }
212  }
213 
214  // unpause the still frame if more frames become available
215  if (m_dvd_stillframe_showing && nbframes > 1)
216  {
217  UnpauseVideo();
218  m_dvd_stillframe_showing = false;
219  return !IsErrored();
220  }
221 
222  return MythPlayer::VideoLoop();
223 }
224 
226 {
227  // clear the buffering state
228  SetBuffering(false);
229 
232 
233  AVSync(nullptr, true);
234 }
235 
236 bool MythDVDPlayer::FastForward(float seconds)
237 {
238  if (decoder)
240  return MythPlayer::FastForward(seconds);
241 }
242 
243 bool MythDVDPlayer::Rewind(float seconds)
244 {
245  if (decoder)
247  return MythPlayer::Rewind(seconds);
248 }
249 
250 bool MythDVDPlayer::JumpToFrame(uint64_t frame)
251 {
252  if (frame == ~0x0ULL)
253  return false;
254 
255  if (decoder)
257  return MythPlayer::JumpToFrame(frame);
258 }
259 
261 {
262  if (player_ctx->m_buffer->DVD())
263  player_ctx->m_buffer->DVD()->SetParent(this);
264 
265  player_ctx->LockPlayingInfo(__FILE__, __LINE__);
267  {
268  QString name;
269  QString serialid;
270  if (player_ctx->m_playingInfo->GetTitle().isEmpty() &&
271  player_ctx->m_buffer->DVD() &&
273  {
275  }
276  }
277  player_ctx->UnlockPlayingInfo(__FILE__, __LINE__);
278 
280 }
281 
283 {
285 
286  if (m_initial_title > -1)
288 
289  if (m_initial_audio_track > -1)
292  if (m_initial_subtitle_track > -1)
295 
296  if (bookmarkseek > 30)
297  {
298  // we need to trigger a dvd cell change to ensure the new title length
299  // is set and the position map updated accordingly
300  decodeOneFrame = true;
301  int count = 0;
302  while (count++ < 100 && decodeOneFrame)
303  usleep(50000);
304  }
307 }
308 
309 void MythDVDPlayer::ResetPlaying(bool /*resetframes*/)
310 {
312 }
313 
315 {
316  if (player_ctx->m_buffer->DVD())
317  player_ctx->m_buffer->DVD()->SetParent(nullptr);
318 }
319 
320 bool MythDVDPlayer::PrepareAudioSample(int64_t &timecode)
321 {
323  WrapTimecode(timecode, TC_AUDIO);
324 
325  return player_ctx->m_buffer->IsDVD() &&
327 }
328 
330 {
331  if (!player_ctx->m_buffer->IsDVD())
332  return;
333 
334  QStringList fields;
335  QString name;
336  QString serialid;
337  QString dvdstate;
338 
339  if (!player_ctx->m_buffer->IsInMenu() &&
341  {
342  if (!player_ctx->m_buffer->DVD()->GetNameAndSerialNum(name, serialid))
343  {
344  LOG(VB_GENERAL, LOG_ERR, LOC +
345  "DVD has no name and serial number. Cannot set bookmark.");
346  return;
347  }
348 
349  if (!clear && !player_ctx->m_buffer->DVD()->GetDVDStateSnapshot(dvdstate))
350  {
351  LOG(VB_GENERAL, LOG_ERR, LOC +
352  "Unable to retrieve DVD state. Cannot set bookmark.");
353  return;
354  }
355 
356  player_ctx->LockPlayingInfo(__FILE__, __LINE__);
358  {
359  fields += serialid;
360  fields += name;
361 
362  if (!clear)
363  {
364  LOG(VB_PLAYBACK, LOG_INFO, LOC + "Set bookmark");
365  fields += dvdstate;
366  }
367  else
368  LOG(VB_PLAYBACK, LOG_INFO, LOC + "Clear bookmark");
369 
371 
372  }
373  player_ctx->UnlockPlayingInfo(__FILE__, __LINE__);
374  }
375 }
376 
378 {
380  return 0;
381 
382  QString name;
383  QString serialid;
384  uint64_t frames = 0;
385  player_ctx->LockPlayingInfo(__FILE__, __LINE__);
387  {
388  if (!player_ctx->m_buffer->DVD()->GetNameAndSerialNum(name, serialid))
389  {
390  player_ctx->UnlockPlayingInfo(__FILE__, __LINE__);
391  return 0;
392  }
393 
394  QStringList dvdbookmark = player_ctx->m_playingInfo->QueryDVDBookmark(serialid);
395 
396  if (!dvdbookmark.empty())
397  {
398  QStringList::Iterator it = dvdbookmark.begin();
399 
400  if (dvdbookmark.count() == 1)
401  {
402  m_initial_dvdstate = *it;
403  frames = ~0x0ULL;
404  LOG(VB_PLAYBACK, LOG_INFO, LOC + "Get Bookmark: bookmark found");
405  }
406  else
407  {
408  // Legacy bookmarks
409  m_initial_title = (*it).toInt();
410  frames = (uint64_t)((*++it).toLongLong() & 0xffffffffLL);
411  m_initial_audio_track = (*++it).toInt();
412  m_initial_subtitle_track = (*++it).toInt();
413  LOG(VB_PLAYBACK, LOG_INFO, LOC +
414  QString("Get Bookmark: title %1 audiotrack %2 subtrack %3 "
415  "frame %4")
417  .arg(m_initial_subtitle_track).arg(frames));
418  }
419  }
420  }
421  player_ctx->UnlockPlayingInfo(__FILE__, __LINE__);
422  return frames;;
423 }
424 
426 {
427  if (m_stillFrameLength > 0)
428  {
429  m_stillFrameTimerLock.lock();
430  // Get the timestretched elapsed time and transform
431  // it to what the unstretched value would have been
432  // had we been playing with the new timestretch value
433  // all along
434  int elapsed = (int)(m_stillFrameTimer.elapsed() * play_speed / next_play_speed);
436  m_stillFrameTimer.addMSecs(elapsed);
437  m_stillFrameTimerLock.unlock();
438  }
439 
441 
442  if (decoder)
444  if (player_ctx->m_buffer->IsDVD())
445  {
446  if (play_speed > 1.0F)
448  else
450  }
451 }
452 
453 void MythDVDPlayer::AVSync(VideoFrame *frame, bool /*limit_delay*/)
454 {
455  MythPlayer::AVSync(frame, true);
456 }
457 
458 long long MythDVDPlayer::CalcMaxFFTime(long long ff, bool setjump) const
459 {
460  if ((totalFrames > 0) && player_ctx->m_buffer->IsDVD() &&
462  return 0;
463  return MythPlayer::CalcMaxFFTime(ff, setjump);
464 }
465 
466 int64_t MythDVDPlayer::GetSecondsPlayed(bool /*honorCutList*/, int divisor) const
467 {
468  if (!player_ctx->m_buffer->IsDVD())
469  return 0;
470 
471  int64_t played = player_ctx->m_buffer->DVD()->GetCurrentTime();
472 
473  if (m_stillFrameLength > 0)
474  {
475  if (m_stillFrameLength == 255)
476  played = -1;
477  else
478  played = m_stillFrameTimer.elapsed() * play_speed / divisor;
479  }
480 
481  return played;
482 }
483 
484 int64_t MythDVDPlayer::GetTotalSeconds(bool /*honorCutList*/, int divisor) const
485 {
486  int64_t total = totalLength;
487 
488  if (m_stillFrameLength > 0)
489  {
490  if (m_stillFrameLength == 255)
491  return -1;
492  total = m_stillFrameLength;
493  }
494 
495  return total * 1000 / divisor;
496 }
497 
498 void MythDVDPlayer::SeekForScreenGrab(uint64_t &number, uint64_t frameNum,
499  bool /*absolute*/)
500 {
501  if (!player_ctx->m_buffer->IsDVD())
502  return;
503  if (GoToMenu("menu"))
504  {
505  if (player_ctx->m_buffer->DVD()->IsInMenu() &&
507  {
508  GoToDVDProgram(true);
509  }
510  }
511  else if (player_ctx->m_buffer->DVD()->GetTotalTimeOfTitle() < 60)
512  {
513  GoToDVDProgram(true);
514  number = frameNum;
515  if (number >= totalFrames)
516  number = totalFrames / 2;
517  }
518 }
519 
521 {
522  if (kTrackTypeAudio == type)
523  {
524  StreamInfo stream = decoder->GetTrackInfo(type, trackNo);
526  }
527 
528  return MythPlayer::SetTrack(type, trackNo);
529 }
530 
532 {
533  if (!player_ctx->m_buffer->IsDVD())
534  return 0;
535  return player_ctx->m_buffer->DVD()->NumPartsInTitle();
536 }
537 
539 {
540  if (!player_ctx->m_buffer->IsDVD())
541  return 0;
542  return player_ctx->m_buffer->DVD()->GetPart();
543 }
544 
545 void MythDVDPlayer::GetChapterTimes(QList<long long> &times)
546 {
547  if (!player_ctx->m_buffer->IsDVD())
548  return;
550 }
551 
553 {
554  if (!player_ctx->m_buffer->IsDVD())
555  return false;
556 
557  int total = GetNumChapters();
558  int current = GetCurrentChapter();
559 
560  if (chapter < 0 || chapter > total)
561  {
562  if (chapter < 0)
563  {
564  chapter = current -1;
565  if (chapter < 0) chapter = 0;
566  }
567  else if (chapter > total)
568  {
569  chapter = current + 1;
570  if (chapter > total) chapter = total;
571  }
572  }
573 
574  bool success = player_ctx->m_buffer->DVD()->playTrack(chapter);
575  if (success)
576  {
577  if (decoder)
578  {
580  if (player_ctx->m_buffer->DVD()->GetCellStart() == 0)
581  decoder->SeekReset(framesPlayed, 0, true, true);
582  }
584  }
585 
586  jumpchapter = 0;
587  return success;
588 }
589 
591 {
592  if (!osd || !player_ctx->m_buffer->IsDVD())
593  return;
594 
595  uint buttonversion = 0;
596  AVSubtitle *dvdSubtitle = player_ctx->m_buffer->DVD()->GetMenuSubtitle(buttonversion);
597  bool numbuttons = player_ctx->m_buffer->DVD()->NumMenuButtons() != 0;
598 
599  bool expired = false;
600 
601  VideoFrame *currentFrame = videoOutput ? videoOutput->GetLastShownFrame() : nullptr;
602 
603  if (!currentFrame)
604  {
606  return;
607  }
608 
609  if (dvdSubtitle &&
610  (dvdSubtitle->end_display_time > dvdSubtitle->start_display_time) &&
611  (dvdSubtitle->end_display_time < currentFrame->timecode))
612  {
613  expired = true;
614  }
615 
616  // nothing to do
617  if (!expired && (buttonversion == ((uint)m_buttonVersion)))
618  {
620  return;
621  }
622 
623  // clear any buttons
624  if (!numbuttons || !dvdSubtitle || (buttonversion == 0) || expired)
625  {
626  osdLock.lock();
627  if (osd)
628  osd->ClearSubtitles();
629  osdLock.unlock();
630  m_buttonVersion = 0;
632  return;
633  }
634 
635  if (currentFrame->timecode && (dvdSubtitle->start_display_time > currentFrame->timecode))
636  {
638  return;
639  }
640 
641  m_buttonVersion = buttonversion;
642  QRect buttonPos = player_ctx->m_buffer->DVD()->GetButtonCoords();
643  osdLock.lock();
644  if (osd)
645  osd->DisplayDVDButton(dvdSubtitle, buttonPos);
646  osdLock.unlock();
649 }
650 
651 bool MythDVDPlayer::GoToMenu(QString str)
652 {
653  if (!player_ctx->m_buffer->IsDVD())
654  return false;
656  bool ret = player_ctx->m_buffer->DVD()->GoToMenu(str);
657 
658  if (!ret)
659  {
660  SetOSDMessage(tr("DVD Menu Not Available"), kOSDTimeout_Med);
661  LOG(VB_GENERAL, LOG_ERR, "No DVD Menu available.");
662  return false;
663  }
664 
665  return true;
666 }
667 
668 void MythDVDPlayer::GoToDVDProgram(bool direction)
669 {
670  if (!player_ctx->m_buffer->IsDVD())
671  return;
672  if (direction)
674  else
676 }
677 
679 {
680  return (m_stillFrameLength > 0);
681 }
682 
684 {
685  if (player_ctx->m_buffer->DVD() && player_ctx->m_buffer->DVD()->IsOpen())
686  return player_ctx->m_buffer->DVD()->GetNumAngles();
687  return 0;
688 }
689 
691 {
692  if (player_ctx->m_buffer->DVD() && player_ctx->m_buffer->DVD()->IsOpen())
693  return player_ctx->m_buffer->DVD()->GetCurrentAngle();
694  return -1;
695 }
696 
697 QString MythDVDPlayer::GetAngleName(int angle) const
698 {
699  if (angle >= 1 && angle <= GetNumAngles())
700  {
701  QString name = tr("Angle %1").arg(angle);
702  return name;
703  }
704  return QString();
705 }
706 
708 {
709  uint total = GetNumAngles();
710  if (!total || angle == GetCurrentAngle())
711  return false;
712 
713  if (angle < 1 || angle > (int)total)
714  angle = 1;
715 
716  return player_ctx->m_buffer->DVD()->SwitchAngle(angle);
717 }
718 
720 {
721  m_stillFrameTimerLock.lock();
723  m_stillFrameTimerLock.unlock();
724 }
725 
727 {
728  if (length != m_stillFrameLength)
729  {
730  m_stillFrameTimerLock.lock();
731  m_stillFrameLength = length;
733  m_stillFrameTimerLock.unlock();
734  }
735 }
736 
738 {
739  if (player_ctx->m_buffer->IsDVD() &&
741  (m_stillFrameLength > 0) && (m_stillFrameLength < 0xff))
742  {
743  m_stillFrameTimerLock.lock();
744  int elapsedTime = (int)(m_stillFrameTimer.elapsed() * play_speed / 1000);
745  m_stillFrameTimerLock.unlock();
746  if (elapsedTime >= m_stillFrameLength)
747  {
748  LOG(VB_PLAYBACK, LOG_INFO, LOC +
749  QString("Stillframe timeout after %1 seconds (timestretch %2)")
750  .arg(m_stillFrameLength)
751  .arg(play_speed));
753  m_stillFrameLength = 0;
754  }
755  }
756 }
757 
758 void MythDVDPlayer::CreateDecoder(char *testbuf, int testreadsize)
759 {
761  testreadsize))
762  {
764  playerFlags));
765  }
766 }
int GetPart(void) const
uint64_t totalFrames
Definition: mythplayer.h:710
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
bool VideoLoop(void) override
int GetNumAngles(void) const override
void SetErrored(const QString &reason)
const DVDRingBuffer * DVD(void) const
int FreeVideoFrames(void)
Returns number of frames available for decoding onto.
Definition: videooutbase.h:192
void SeekForScreenGrab(uint64_t &number, uint64_t frameNum, bool absolute) override
virtual void SeekReset(long long newkey, uint skipFrames, bool doFlush, bool discardFrames)
Definition: decoderbase.cpp:73
int NumPartsInTitle(void) const
virtual void UpdatePauseFrame(int64_t &disp_timecode)=0
Updates frame displayed when video is paused.
virtual bool IsInDiscMenuOrStillFrame(void) const
QMutex m_stillFrameTimerLock
void SetScanType(FrameScanType)
Definition: mythplayer.cpp:762
void SkipDVDWaitingForPlayer(void)
void GoToNextProgram(void)
void ClearAfterSeek(bool clearvideobuffers=true)
This is to support seeking...
virtual int ValidVideoFrames(void) const
Returns number of frames that are fully decoded.
Definition: videooutbase.h:189
void AVSync(VideoFrame *frame, bool limit_delay=false) override
uint GetTotalTimeOfTitle(void)
get the total time of the title in seconds 90000 ticks = 1 sec
bool SwitchAngle(uint angle)
RingBuffer * m_buffer
virtual bool JumpToFrame(uint64_t frame)
void ClearSubtitles(void)
Definition: osd.cpp:1438
void UnlockPlayingInfo(const char *file, int line) const
long long totalLength
Definition: mythplayer.h:711
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 DoJumpChapter(int chapter) override
QString GetFilename(void) const
Returns name of file used by this RingBuffer.
void PauseVideo(void)
Definition: mythplayer.cpp:438
virtual void VideoStart(void)
void ChangeSpeed(void) override
virtual void DisableCaptions(uint mode, bool osd_msg=true)
unsigned int uint
Definition: compat.h:140
MythCoreContext * gCoreContext
This global variable contains the MythCoreContext instance for the app.
QMutex decoder_change_lock
Definition: mythplayer.h:638
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.
long long timecode
Definition: mythframe.h:49
virtual void ResetPlaying(bool resetframes=true)
QString GetAngleName(int angle) const override
long long CalcMaxFFTime(long long ff, bool setjump=true) const override
CalcMaxFFTime(ffframes): forward ffframes forward.
float play_speed
Definition: mythplayer.h:819
void GetChapterTimes(QList< long long > &times)
bool DecoderGetFrameFFREW(void) override
virtual bool FastForward(float seconds)
QRect GetButtonCoords(void)
get coordinates of highlighted button
uint64_t framesPlayed
Definition: mythplayer.h:706
#define LOC
virtual bool Rewind(float seconds)
bool DecoderGetFrameREW(void) override
void GetChapterTimes(QList< long long > &times) override
bool Rewind(float seconds) override
EofState
Definition: decoderbase.h:67
bool JumpToFrame(uint64_t frame) override
int64_t GetTotalSeconds(bool honorCutList, int divisor=1000) const override
void DecoderPauseCheck(void) override
ProgramInfo * m_playingInfo
Currently playing info.
bool IsDVD(void) const
int m_initial_audio_track
void InitialSeek(void) override
bool DVDWaitingForPlayer(void)
bool IsStillFramePending(void) const
bool HasReachedEof(void) const override
bool IsInStillFrame() const override
void AutoDeint(VideoFrame *frame, bool allow_lock=true) override
virtual bool IsInMenu(void) const
virtual void EventStart(void)
int64_t disp_timecode
Definition: mythplayer.h:840
QStringList QueryDVDBookmark(const QString &serialid) const
Queries "dvdbookmark" table for bookmarking DVD serial number.
QString m_initial_dvdstate
static void clear(SettingsMap &cache, SettingsMap &overrides, const QString &myKey)
Definition: mythdb.cpp:830
uint TitleTimeLeft(void)
returns seconds left in the title
int jumpchapter
Definition: mythplayer.h:691
QDateTime current(bool stripped)
Returns current Date and Time in UTC.
Definition: mythdate.cpp:10
bool GoToMenu(QString str) 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)
void DisableCaptions(uint mode, bool osd_msg=true) override
bool m_dvd_stillframe_showing
int GetCurrentChapter(void) override
void WrapTimecode(int64_t &timecode, TCTypes tc_type)
virtual bool IsBookmarkAllowed(void)
bool IsErrored(void) const
void VideoStart(void) override
const char * name
Definition: ParseText.cpp:328
void SetParent(MythDVDPlayer *p)
virtual bool DecoderGetFrameFFREW(void)
bool IsWaiting(void) const
virtual void DisplayNormalFrame(bool check_prebuffer=true)
bool IsOpen(void) const override
Returns true if open for either reading or writing.
float next_play_speed
Definition: mythplayer.h:816
AVSubtitle * GetMenuSubtitle(uint &version)
returns dvd menu button information if available.
MythTimer m_stillFrameTimer
void ResetPlaying(bool resetframes=true) override
uint textDisplayMode
Definition: mythplayer.h:746
bool allpaused
Definition: mythplayer.h:672
int elapsed(void) const
Returns milliseconds elapsed since last start() or restart()
Definition: mythtimer.cpp:90
void UnpauseVideo(void)
Definition: mythplayer.cpp:446
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)
void EnableCaptions(uint mode, bool osd_msg=true) override
virtual uint GetTrackCount(uint type) const
Definition: decoderbase.h:239
void ResetStillFrameTimer(void)
virtual void ReleaseNextVideoFrame(VideoFrame *buffer, int64_t timecode, bool wrap=true)
Places frame on the queue of frames ready for display.
#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 EnoughFreeFrames(void)
Returns true iff enough frames are available to decode onto.
Definition: videooutbase.h:194
StreamInfo GetTrackInfo(uint type, uint trackNo) const
uint GetCellStart(void)
get the start of the cell in seconds
void ReleaseNextVideoFrame(VideoFrame *buffer, int64_t timecode, bool wrap=true) override
void PlayTitleAndPart(int _title, int _part)
void StillFrameCheck(void)
virtual void ChangeSpeed(void)
bool FastForward(float seconds) override
virtual VideoFrame * GetLastShownFrame(void)
Returns frame from the head of the ready to be displayed queue, if StartDisplayingFrame has been call...
Definition: videooutbase.h:239
int m_initial_subtitle_track
void SetBuffering(bool new_buffering)
PlayerFlags playerFlags
Definition: mythplayer.h:636
bool needNewPauseFrame
Definition: mythplayer.h:666
virtual bool PrebufferEnoughFrames(int min_buffers=0)
int SetTrack(uint type, int trackNo) override
const char * frames[3]
Definition: element.c:46
int GetNumChapters(void) override
void GoToDVDProgram(bool direction) override
int GetNumAngles(void)
void PreProcessNormalFrame(void) override
bool SwitchAngle(int angle) override
bool IsInMenu(void) const override
virtual void InitialSeek(void)
VideoOutput * videoOutput
Definition: mythplayer.h:639
virtual void IgnoreWaitStates(bool)
virtual bool DecoderGetFrameREW(void)
virtual void EventEnd(void)
void SaveDVDBookmark(const QStringList &fields) const
virtual void DecoderPauseCheck(void)
OSD * osd
Definition: mythplayer.h:781
PlayerContext * player_ctx
Definition: mythplayer.h:640
int64_t GetSecondsPlayed(bool honorCutList, int divisor=1000) const override
uint64_t bookmarkseek
Definition: mythplayer.h:694
bool PrepareAudioSample(int64_t &timecode) override
void DisplayDVDButton(void)
bool videoPaused
Definition: mythplayer.h:671
int64_t GetCurrentTime(void)
virtual long long CalcMaxFFTime(long long ff, bool setjump=true) const
CalcMaxFFTime(ffframes): forward ffframes forward.
void EventStart(void) override
virtual void AVSync(VideoFrame *buffer, bool limit_delay=false)
virtual int SetTrack(uint type, int trackNo)
void DisplayPauseFrame(void) override
void CreateDecoder(char *testbuf, int testreadsize) override
bool PrebufferEnoughFrames(int min_buffers=0) override
void SetStillFrameTimeout(int length)
void SetBookmark(bool clear=false) override
virtual void DisplayPauseFrame(void)
bool GoToMenu(const QString &str)
jump to a dvd root or chapter menu
DecoderBase * decoder
Definition: mythplayer.h:637
void DisplayDVDButton(AVSubtitle *dvdButton, QRect &pos)
Definition: osd.cpp:1448
bool decodeOneFrame
Definition: mythplayer.h:665
bool GetDVDStateSnapshot(QString &state)
Get a snapshot of the current DVD VM state.
QMutex osdLock
Definition: mythplayer.h:783
void ReleaseMenuButton(void)