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 
12  : MythPlayer(flags), m_buttonVersion(0),
13  dvd_stillframe_showing(false),
14  m_initial_title(-1), m_initial_audio_track(-1),
15  m_initial_subtitle_track(-1),
16  m_stillFrameLength(0)
17 {
18 }
19 
20 void MythDVDPlayer::AutoDeint(VideoFrame *frame, bool allow_lock)
21 {
22  (void)frame;
23  (void)allow_lock;
25 }
26 
35  int64_t timecode, bool /*wrap*/)
36 {
37  MythPlayer::ReleaseNextVideoFrame(buffer, timecode,
39 }
40 
42 {
43  EofState eof = GetEof();
44  if (eof != kEofStateNone && !allpaused)
45  return true;
46  // DeleteMap and EditMode from the parent MythPlayer should not be
47  // relevant here.
48  return false;
49 }
50 
52 {
53  if ((kDisplayAVSubtitle & mode) && player_ctx->buffer->IsDVD())
55  MythPlayer::DisableCaptions(mode, osd_msg);
56 }
57 
59 {
60  if ((kDisplayAVSubtitle & mode) && player_ctx->buffer->IsDVD())
61  {
62  int track = GetTrack(kTrackTypeSubtitle);
63  if (track >= 0 && track < (int)decoder->GetTrackCount(kTrackTypeSubtitle))
64  {
66  track);
68  stream.stream_id);
69  }
70  }
71  MythPlayer::EnableCaptions(mode, osd_msg);
72 }
73 
75 {
76  if (player_ctx->buffer->IsDVD() &&
78  {
80  }
83 }
84 
86 {
89 }
90 
91 bool MythDVDPlayer::PrebufferEnoughFrames(int /*min_buffers*/)
92 {
94 }
95 
97 {
99  if (decoder_change_lock.tryLock(1))
100  {
101  if (decoder)
103  decoder_change_lock.unlock();
104  }
105  return res;
106 }
107 
109 {
111  return (player_ctx->buffer->IsDVD() &&
112  (player_ctx->buffer->DVD()->GetCurrentTime() < 2));
113 }
114 
116 {
118 }
119 
121 {
122  if (!m_initial_dvdstate.isEmpty())
124 
126 }
127 
129 {
130  if (!player_ctx->buffer->IsDVD())
131  {
132  SetErrored("RingBuffer is not a DVD.");
133  return !IsErrored();
134  }
135 
136  int nbframes = 0;
137  if (videoOutput)
138  nbframes = videoOutput->ValidVideoFrames();
139 
140 #if 0
141  LOG(VB_PLAYBACK, LOG_DEBUG,
142  LOC + QString("Validframes %1, FreeFrames %2, VideoPaused %3")
143  .arg(nbframes).arg(videoOutput->FreeVideoFrames()).arg(videoPaused));
144 #endif
145 
146  // completely drain the video buffers for certain situations
147  bool release_all = player_ctx->buffer->DVD()->DVDWaitingForPlayer() &&
148  (nbframes > 0);
149  bool release_one = (nbframes > 1) && videoPaused && !allpaused &&
151  player_ctx->buffer->DVD()->IsWaiting() ||
153  if (release_all || release_one)
154  {
155  if (nbframes < 5 && videoOutput)
157 
158  // if we go below the pre-buffering limit, the player will pause
159  // so do this 'manually'
160  DisplayNormalFrame(false);
161  // unpause the still frame if more frames become available
162  if (dvd_stillframe_showing && nbframes > 1)
163  {
164  dvd_stillframe_showing = false;
165  UnpauseVideo();
166  }
167  return !IsErrored();
168  }
169 
170  // clear the mythtv imposed wait state
172  {
173  LOG(VB_PLAYBACK, LOG_INFO, LOC + "Clearing MythTV DVD wait state");
175  ClearAfterSeek(true);
176  if (videoPaused && !allpaused)
177  UnpauseVideo();
178  return !IsErrored();
179  }
180 
181  // wait for the video buffers to drain
182  if (nbframes < 2)
183  {
184  // clear the DVD wait state
185  if (player_ctx->buffer->DVD()->IsWaiting())
186  {
187  LOG(VB_PLAYBACK, LOG_INFO, LOC + "Clearing DVD wait state");
188  player_ctx->buffer->DVD()->WaitSkip();
189  if (videoPaused && !allpaused)
190  UnpauseVideo();
191  return !IsErrored();
192  }
193 
194  // the still frame is treated as a pause frame
196  {
197  // ensure we refresh the pause frame
199  needNewPauseFrame = true;
200 
201  // we are in a still frame so pause video output
202  if (!videoPaused)
203  {
204  PauseVideo();
205  dvd_stillframe_showing = true;
206  return !IsErrored();
207  }
208 
209  // see if the pause frame has timed out
210  StillFrameCheck();
211 
212  // flag if we have no frame
213  if (nbframes == 0)
214  {
215  LOG(VB_PLAYBACK, LOG_WARNING, LOC +
216  "In DVD Menu: No video frames in queue");
217  usleep(10000);
218  return !IsErrored();
219  }
220 
221  dvd_stillframe_showing = true;
222  }
223  }
224 
225  // unpause the still frame if more frames become available
226  if (dvd_stillframe_showing && nbframes > 1)
227  {
228  UnpauseVideo();
229  dvd_stillframe_showing = false;
230  return !IsErrored();
231  }
232 
233  return MythPlayer::VideoLoop();
234 }
235 
237 {
238  // clear the buffering state
239  SetBuffering(false);
240 
243 
244  AVSync(NULL, true);
245 }
246 
247 bool MythDVDPlayer::FastForward(float seconds)
248 {
249  if (decoder)
251  return MythPlayer::FastForward(seconds);
252 }
253 
254 bool MythDVDPlayer::Rewind(float seconds)
255 {
256  if (decoder)
258  return MythPlayer::Rewind(seconds);
259 }
260 
261 bool MythDVDPlayer::JumpToFrame(uint64_t frame)
262 {
263  if (frame == ~0x0ULL)
264  return false;
265 
266  if (decoder)
268  return MythPlayer::JumpToFrame(frame);
269 }
270 
272 {
273  if (player_ctx->buffer->DVD())
274  player_ctx->buffer->DVD()->SetParent(this);
275 
276  player_ctx->LockPlayingInfo(__FILE__, __LINE__);
277  if (player_ctx->playingInfo)
278  {
279  QString name;
280  QString serialid;
281  if (player_ctx->playingInfo->GetTitle().isEmpty() &&
282  player_ctx->buffer->DVD() &&
283  player_ctx->buffer->DVD()->GetNameAndSerialNum(name, serialid))
284  {
286  }
287  }
288  player_ctx->UnlockPlayingInfo(__FILE__, __LINE__);
289 
291 }
292 
294 {
296 
297  if (m_initial_title > -1)
299 
300  if (m_initial_audio_track > -1)
303  if (m_initial_subtitle_track > -1)
306 
307  if (bookmarkseek > 30)
308  {
309  // we need to trigger a dvd cell change to ensure the new title length
310  // is set and the position map updated accordingly
311  decodeOneFrame = true;
312  int count = 0;
313  while (count++ < 100 && decodeOneFrame)
314  usleep(50000);
315  }
318 }
319 
320 void MythDVDPlayer::ResetPlaying(bool /*resetframes*/)
321 {
323 }
324 
326 {
327  if (player_ctx->buffer->DVD())
328  player_ctx->buffer->DVD()->SetParent(NULL);
329 }
330 
331 bool MythDVDPlayer::PrepareAudioSample(int64_t &timecode)
332 {
334  WrapTimecode(timecode, TC_AUDIO);
335 
336  if (player_ctx->buffer->IsDVD() &&
338  return true;
339  return false;
340 }
341 
343 {
344  if (!player_ctx->buffer->IsDVD())
345  return;
346 
347  QStringList fields;
348  QString name;
349  QString serialid;
350  QString dvdstate;
351 
352  if (!player_ctx->buffer->IsInMenu() &&
354  {
355  if (!player_ctx->buffer->DVD()->GetNameAndSerialNum(name, serialid))
356  {
357  LOG(VB_GENERAL, LOG_ERR, LOC +
358  "DVD has no name and serial number. Cannot set bookmark.");
359  return;
360  }
361 
362  if (!clear && !player_ctx->buffer->DVD()->GetDVDStateSnapshot(dvdstate))
363  {
364  LOG(VB_GENERAL, LOG_ERR, LOC +
365  "Unable to retrieve DVD state. Cannot set bookmark.");
366  return;
367  }
368 
369  player_ctx->LockPlayingInfo(__FILE__, __LINE__);
370  if (player_ctx->playingInfo)
371  {
372  fields += serialid;
373  fields += name;
374 
375  if (!clear)
376  {
377  LOG(VB_PLAYBACK, LOG_INFO, LOC + "Set bookmark");
378  fields += dvdstate;
379  }
380  else
381  LOG(VB_PLAYBACK, LOG_INFO, LOC + "Clear bookmark");
382 
384 
385  }
386  player_ctx->UnlockPlayingInfo(__FILE__, __LINE__);
387  }
388 }
389 
391 {
393  return 0;
394 
395  QStringList dvdbookmark = QStringList();
396  QString name;
397  QString serialid;
398  uint64_t frames = 0;
399  player_ctx->LockPlayingInfo(__FILE__, __LINE__);
400  if (player_ctx->playingInfo)
401  {
402  if (!player_ctx->buffer->DVD()->GetNameAndSerialNum(name, serialid))
403  {
404  player_ctx->UnlockPlayingInfo(__FILE__, __LINE__);
405  return 0;
406  }
407 
408  dvdbookmark = player_ctx->playingInfo->QueryDVDBookmark(serialid);
409 
410  if (!dvdbookmark.empty())
411  {
412  QStringList::Iterator it = dvdbookmark.begin();
413 
414  if (dvdbookmark.count() == 1)
415  {
416  m_initial_dvdstate = *it;
417  frames = ~0x0ULL;
418  LOG(VB_PLAYBACK, LOG_INFO, LOC + "Get Bookmark: bookmark found");
419  }
420  else
421  {
422  // Legacy bookmarks
423  m_initial_title = (*it).toInt();
424  frames = (uint64_t)((*++it).toLongLong() & 0xffffffffLL);
425  m_initial_audio_track = (*++it).toInt();
426  m_initial_subtitle_track = (*++it).toInt();
427  LOG(VB_PLAYBACK, LOG_INFO, LOC +
428  QString("Get Bookmark: title %1 audiotrack %2 subtrack %3 "
429  "frame %4")
431  .arg(m_initial_subtitle_track).arg(frames));
432  }
433  }
434  }
435  player_ctx->UnlockPlayingInfo(__FILE__, __LINE__);
436  return frames;;
437 }
438 
440 {
441  if (m_stillFrameLength > 0)
442  {
443  m_stillFrameTimerLock.lock();
444  // Get the timestretched elapsed time and transform
445  // it to what the unstretched value would have been
446  // had we been playing with the new timestretch value
447  // all along
448  int elapsed = (int)(m_stillFrameTimer.elapsed() * play_speed / next_play_speed);
450  m_stillFrameTimer.addMSecs(elapsed);
451  m_stillFrameTimerLock.unlock();
452  }
453 
455 
456  if (decoder)
458  if (player_ctx->buffer->IsDVD())
459  {
460  if (play_speed > 1.0f)
461  player_ctx->buffer->DVD()->SetDVDSpeed(-1);
462  else
464  }
465 }
466 
467 void MythDVDPlayer::AVSync(VideoFrame *frame, bool /*limit_delay*/)
468 {
469  MythPlayer::AVSync(frame, true);
470 }
471 
472 long long MythDVDPlayer::CalcMaxFFTime(long long ff, bool setjump) const
473 {
474  if ((totalFrames > 0) && player_ctx->buffer->IsDVD() &&
475  player_ctx->buffer->DVD()->TitleTimeLeft() < 5)
476  return 0;
477  return MythPlayer::CalcMaxFFTime(ff, setjump);
478 }
479 
480 int64_t MythDVDPlayer::GetSecondsPlayed(bool, int divisor) const
481 {
482  if (!player_ctx->buffer->IsDVD())
483  return 0;
484 
485  int64_t played = player_ctx->buffer->DVD()->GetCurrentTime();
486 
487  if (m_stillFrameLength > 0)
488  {
489  if (m_stillFrameLength == 255)
490  played = -1;
491  else
492  played = m_stillFrameTimer.elapsed() * play_speed / divisor;
493  }
494 
495  return played;
496 }
497 
498 int64_t MythDVDPlayer::GetTotalSeconds(bool /*honorCutList*/, int divisor) const
499 {
500  int64_t total = totalLength;
501 
502  if (m_stillFrameLength > 0)
503  {
504  if (m_stillFrameLength == 255)
505  return -1;
506  else
507  total = m_stillFrameLength;
508  }
509 
510  return total * 1000 / divisor;
511 }
512 
513 void MythDVDPlayer::SeekForScreenGrab(uint64_t &number, uint64_t frameNum,
514  bool /*absolute*/)
515 {
516  if (!player_ctx->buffer->IsDVD())
517  return;
518  if (GoToMenu("menu"))
519  {
520  if (player_ctx->buffer->DVD()->IsInMenu() &&
522  {
523  GoToDVDProgram(1);
524  }
525  }
526  else if (player_ctx->buffer->DVD()->GetTotalTimeOfTitle() < 60)
527  {
528  GoToDVDProgram(1);
529  number = frameNum;
530  if (number >= totalFrames)
531  number = totalFrames / 2;
532  }
533 }
534 
536 {
537  if (kTrackTypeAudio == type)
538  {
539  StreamInfo stream = decoder->GetTrackInfo(type, trackNo);
540  player_ctx->buffer->DVD()->SetTrack(type, stream.stream_id);
541  }
542 
543  return MythPlayer::SetTrack(type, trackNo);
544 }
545 
547 {
548  if (!player_ctx->buffer->IsDVD())
549  return 0;
550  return player_ctx->buffer->DVD()->NumPartsInTitle();
551 }
552 
554 {
555  if (!player_ctx->buffer->IsDVD())
556  return 0;
557  return player_ctx->buffer->DVD()->GetPart();
558 }
559 
560 void MythDVDPlayer::GetChapterTimes(QList<long long> &times)
561 {
562  if (!player_ctx->buffer->IsDVD())
563  return;
564  player_ctx->buffer->DVD()->GetChapterTimes(times);
565 }
566 
568 {
569  if (!player_ctx->buffer->IsDVD())
570  return false;
571 
572  int total = GetNumChapters();
573  int current = GetCurrentChapter();
574 
575  if (chapter < 0 || chapter > total)
576  {
577  if (chapter < 0)
578  {
579  chapter = current -1;
580  if (chapter < 0) chapter = 0;
581  }
582  else if (chapter > total)
583  {
584  chapter = current + 1;
585  if (chapter > total) chapter = total;
586  }
587  }
588 
589  bool success = player_ctx->buffer->DVD()->playTrack(chapter);
590  if (success)
591  {
592  if (decoder)
593  {
595  if (player_ctx->buffer->DVD()->GetCellStart() == 0)
596  decoder->SeekReset(framesPlayed, 0, true, true);
597  }
599  }
600 
601  jumpchapter = 0;
602  return success;
603 }
604 
606 {
607  if (!osd || !player_ctx->buffer->IsDVD())
608  return;
609 
610  uint buttonversion = 0;
611  AVSubtitle *dvdSubtitle = player_ctx->buffer->DVD()->GetMenuSubtitle(buttonversion);
612  bool numbuttons = player_ctx->buffer->DVD()->NumMenuButtons();
613 
614  bool expired = false;
615 
616  VideoFrame *currentFrame = videoOutput ? videoOutput->GetLastShownFrame() : NULL;
617 
618  if (!currentFrame)
619  {
621  return;
622  }
623 
624  if (dvdSubtitle &&
625  (dvdSubtitle->end_display_time > dvdSubtitle->start_display_time) &&
626  (dvdSubtitle->end_display_time < currentFrame->timecode))
627  {
628  expired = true;
629  }
630 
631  // nothing to do
632  if (!expired && (buttonversion == ((uint)m_buttonVersion)))
633  {
635  return;
636  }
637 
638  // clear any buttons
639  if (!numbuttons || !dvdSubtitle || (buttonversion == 0) || expired)
640  {
641  osdLock.lock();
642  if (osd)
643  osd->ClearSubtitles();
644  osdLock.unlock();
645  m_buttonVersion = 0;
647  return;
648  }
649 
650  if (currentFrame->timecode && (dvdSubtitle->start_display_time > currentFrame->timecode))
651  {
653  return;
654  }
655 
656  m_buttonVersion = buttonversion;
657  QRect buttonPos = player_ctx->buffer->DVD()->GetButtonCoords();
658  osdLock.lock();
659  if (osd)
660  osd->DisplayDVDButton(dvdSubtitle, buttonPos);
661  osdLock.unlock();
664 }
665 
666 bool MythDVDPlayer::GoToMenu(QString str)
667 {
668  if (!player_ctx->buffer->IsDVD())
669  return false;
671  bool ret = player_ctx->buffer->DVD()->GoToMenu(str);
672 
673  if (!ret)
674  {
675  SetOSDMessage(tr("DVD Menu Not Available"), kOSDTimeout_Med);
676  LOG(VB_GENERAL, LOG_ERR, "No DVD Menu available.");
677  return false;
678  }
679 
680  return true;
681 }
682 
683 void MythDVDPlayer::GoToDVDProgram(bool direction)
684 {
685  if (!player_ctx->buffer->IsDVD())
686  return;
687  if (direction == 0)
689  else
691 }
692 
694 {
695  return (m_stillFrameLength > 0);
696 }
697 
699 {
700  if (player_ctx->buffer->DVD() && player_ctx->buffer->DVD()->IsOpen())
701  return player_ctx->buffer->DVD()->GetNumAngles();
702  return 0;
703 }
704 
706 {
707  if (player_ctx->buffer->DVD() && player_ctx->buffer->DVD()->IsOpen())
708  return player_ctx->buffer->DVD()->GetCurrentAngle();
709  return -1;
710 }
711 
712 QString MythDVDPlayer::GetAngleName(int angle) const
713 {
714  if (angle >= 1 && angle <= GetNumAngles())
715  {
716  QString name = tr("Angle %1").arg(angle);
717  return name;
718  }
719  return QString();
720 }
721 
723 {
724  uint total = GetNumAngles();
725  if (!total || angle == GetCurrentAngle())
726  return false;
727 
728  if (angle < 1 || angle > (int)total)
729  angle = 1;
730 
731  return player_ctx->buffer->DVD()->SwitchAngle(angle);
732 }
733 
735 {
736  m_stillFrameTimerLock.lock();
738  m_stillFrameTimerLock.unlock();
739 }
740 
742 {
743  if (length != m_stillFrameLength)
744  {
745  m_stillFrameTimerLock.lock();
746  m_stillFrameLength = length;
748  m_stillFrameTimerLock.unlock();
749  }
750 }
751 
753 {
754  if (player_ctx->buffer->IsDVD() &&
756  (m_stillFrameLength > 0) && (m_stillFrameLength < 0xff))
757  {
758  m_stillFrameTimerLock.lock();
759  int elapsedTime = (int)(m_stillFrameTimer.elapsed() * play_speed / 1000);
760  m_stillFrameTimerLock.unlock();
761  if (elapsedTime >= m_stillFrameLength)
762  {
763  LOG(VB_PLAYBACK, LOG_INFO, LOC +
764  QString("Stillframe timeout after %1 seconds (timestretch %2)")
765  .arg(m_stillFrameLength)
766  .arg(play_speed));
768  m_stillFrameLength = 0;
769  }
770  }
771 }
772 
773 void MythDVDPlayer::CreateDecoder(char *testbuf, int testreadsize)
774 {
776  testreadsize))
777  {
779  playerFlags));
780  }
781 }
int GetPart(void) const
uint64_t totalFrames
Definition: mythplayer.h:700
void SetTrack(uint type, int trackNo)
set the dvd subtitle/audio track used
virtual bool DoJumpChapter(int chapter)
int restart(void)
Returns milliseconds elapsed since last start() or restart() and resets the count.
Definition: mythtimer.cpp:62
int GetCurrentAngle(void) const
virtual bool DecoderGetFrameFFREW(void)
void SetErrored(const QString &reason)
const DVDRingBuffer * DVD(void) const
int FreeVideoFrames(void)
Returns number of frames available for decoding onto.
Definition: videooutbase.h:188
PlayerFlags
Definition: mythplayer.h:88
virtual void SeekReset(long long newkey, uint skipFrames, bool doFlush, bool discardFrames)
Definition: decoderbase.cpp:95
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:729
void SkipDVDWaitingForPlayer(void)
virtual void EventStart(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:185
virtual bool VideoLoop(void)
virtual bool IsInMenu(void) const
virtual void DisplayPauseFrame(void)
uint GetTotalTimeOfTitle(void)
get the total time of the title in seconds 90000 ticks = 1 sec
virtual void DecoderPauseCheck(void)
bool SwitchAngle(uint angle)
virtual bool JumpToFrame(uint64_t frame)
void ClearSubtitles(void)
Definition: osd.cpp:1390
void UnlockPlayingInfo(const char *file, int line) const
virtual bool IsInStillFrame() const
long long totalLength
Definition: mythplayer.h:701
bool RestoreDVDStateSnapshot(QString &state)
Restore a DVD VM from a snapshot.
QString GetTitle(void) const
Definition: programinfo.h:343
virtual int GetCurrentAngle(void) const
virtual bool FastForward(float seconds)
void SetDVDSpeed(void)
set dvd speed.
QString GetFilename(void) const
Returns name of file used by this RingBuffer.
virtual void CreateDecoder(char *testbuf, int testreadsize)
void PauseVideo(void)
Definition: mythplayer.cpp:421
virtual void VideoStart(void)
virtual bool SwitchAngle(int angle)
virtual void DisableCaptions(uint mode, bool osd_msg=true)
virtual bool GoToMenu(QString str)
virtual void EnableCaptions(uint mode, bool osd_msg=true)
virtual QString GetAngleName(int angle) const
virtual bool IsInStillFrame(void) const
unsigned int uint
Definition: compat.h:136
MythCoreContext * gCoreContext
This global variable contains the MythCoreContext instance for the app.
bool IsOpen(void) const
Returns true if open for either reading or writing.
QMutex decoder_change_lock
Definition: mythplayer.h:628
void DisplayLastFrame(void)
void SkipStillFrame(void)
virtual bool VideoLoop(void)
void SetOSDMessage(const QString &msg, OSDTimeout timeout)
typedef int(ZCALLBACK *close_file_func) OF((voidpf opaque
bool IsDatabaseIgnored(void) const
/brief Returns true if database is being ignored.
long long timecode
Definition: mythframe.h:44
virtual void ResetPlaying(bool resetframes=true)
float play_speed
Definition: mythplayer.h:808
void GetChapterTimes(QList< long long > &times)
virtual bool FastForward(float seconds)
QRect GetButtonCoords(void)
get coordinates of highlighted button
virtual bool PrepareAudioSample(int64_t &timecode)
uint64_t framesPlayed
Definition: mythplayer.h:696
#define LOC
virtual bool Rewind(float seconds)
virtual int GetNumAngles(void) const
virtual void GoToDVDProgram(bool direction)
EofState
Definition: decoderbase.h:66
virtual void AutoDeint(VideoFrame *frame, bool allow_lock=true)
bool IsDVD(void) const
int m_initial_audio_track
bool DVDWaitingForPlayer(void)
bool IsStillFramePending(void) const
virtual bool JumpToFrame(uint64_t frame)
virtual int GetNumChapters(void)
virtual void InitialSeek(void)
virtual void ChangeSpeed(void)
virtual uint64_t GetBookmark(void)
virtual bool IsInMenu(void) const
virtual void EventStart(void)
VERBOSE_PREAMBLE false
Definition: verbosedefs.h:83
int64_t disp_timecode
Definition: mythplayer.h:827
virtual void AVSync(VideoFrame *buffer, bool limit_delay=false)
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:815
uint TitleTimeLeft(void)
returns seconds left in the title
virtual void ReleaseNextVideoFrame(VideoFrame *buffer, int64_t timecode, bool wrap=true)
int jumpchapter
Definition: mythplayer.h:681
QDateTime current(bool stripped)
Returns current Date and Time in UTC.
Definition: mythdate.cpp:10
virtual void PreProcessNormalFrame(void)
virtual void DisableCaptions(uint mode, bool osd_msg=true)
int GetTrack(uint type)
void LockPlayingInfo(const char *file, int line) const
EofState GetEof(void) const
MythDVDPlayer(PlayerFlags flags=kNoFlags)
bool playTrack(int track)
int NumMenuButtons(void) const
virtual void UpdateFramesPlayed(void)
virtual void VideoStart(void)
virtual void SeekForScreenGrab(uint64_t &number, uint64_t frameNum, bool absolute)
void WrapTimecode(int64_t &timecode, TCTypes tc_type)
virtual bool IsBookmarkAllowed(void)
RingBuffer * buffer
bool IsErrored(void) const
const char * name
Definition: ParseText.cpp:339
void SetParent(MythDVDPlayer *p)
virtual bool DecoderGetFrameFFREW(void)
bool IsWaiting(void) const
virtual void DisplayNormalFrame(bool check_prebuffer=true)
float next_play_speed
Definition: mythplayer.h:805
AVSubtitle * GetMenuSubtitle(uint &version)
returns dvd menu button information if available.
ProgramInfo * playingInfo
Currently playing info.
MythTimer m_stillFrameTimer
virtual bool Rewind(float seconds)
virtual long long CalcMaxFFTime(long long ff, bool setjump=true) const
CalcMaxFFTime(ffframes): forward ffframes forward.
uint textDisplayMode
Definition: mythplayer.h:735
bool allpaused
Definition: mythplayer.h:662
int elapsed(void) const
Returns milliseconds elapsed since last start() or restart()
Definition: mythtimer.cpp:90
void UnpauseVideo(void)
Definition: mythplayer.cpp:429
virtual void ResetPlaying(bool resetframes=true)
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)
virtual uint GetTrackCount(uint type) const
Definition: decoderbase.h:242
void ResetStillFrameTimer(void)
voidpf stream
Definition: ioapi.h:136
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:38
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:190
StreamInfo GetTrackInfo(uint type, uint trackNo) const
uint GetCellStart(void)
get the start of the cell in seconds
virtual bool PrebufferEnoughFrames(int min_buffers=0)
virtual bool HasReachedEof(void) const
void PlayTitleAndPart(int _title, int _part)
void StillFrameCheck(void)
virtual void ChangeSpeed(void)
virtual VideoFrame * GetLastShownFrame(void)
Returns frame from the head of the ready to be displayed queue, if StartDisplayingFrame has been call...
Definition: videooutbase.h:235
virtual int GetCurrentChapter(void)
int m_initial_subtitle_track
virtual int64_t GetSecondsPlayed(bool honorCutList, int divisor=1000) const
void SetBuffering(bool new_buffering)
virtual int SetTrack(uint type, int trackNo)
PlayerFlags playerFlags
Definition: mythplayer.h:626
virtual bool DecoderGetFrameREW(void)
void SetTitle(const QString &t)
Definition: programinfo.h:491
bool needNewPauseFrame
Definition: mythplayer.h:656
virtual bool PrebufferEnoughFrames(int min_buffers=0)
const char * frames[3]
Definition: element.c:46
virtual void SetBookmark(bool clear=false)
const char int mode
Definition: ioapi.h:135
int GetNumAngles(void)
virtual void InitialSeek(void)
virtual void GetChapterTimes(QList< long long > &times)
VideoOutput * videoOutput
Definition: mythplayer.h:629
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:770
PlayerContext * player_ctx
Definition: mythplayer.h:630
uint64_t bookmarkseek
Definition: mythplayer.h:684
void DisplayDVDButton(void)
virtual int64_t GetTotalSeconds(bool honorCutList, int divisor=1000) const
bool videoPaused
Definition: mythplayer.h:661
int64_t GetCurrentTime(void)
virtual long long CalcMaxFFTime(long long ff, bool setjump=true) const
CalcMaxFFTime(ffframes): forward ffframes forward.
virtual void AVSync(VideoFrame *buffer, bool limit_delay=false)
bool dvd_stillframe_showing
virtual int SetTrack(uint type, int trackNo)
void SetStillFrameTimeout(int length)
virtual void DisplayPauseFrame(void)
bool GoToMenu(const QString &str)
jump to a dvd root or chapter menu
DecoderBase * decoder
Definition: mythplayer.h:627
void DisplayDVDButton(AVSubtitle *dvdButton, QRect &pos)
Definition: osd.cpp:1400
bool decodeOneFrame
Definition: mythplayer.h:655
bool GetDVDStateSnapshot(QString &state)
Get a snapshot of the current DVD VM state.
QMutex osdLock
Definition: mythplayer.h:772
void ReleaseMenuButton(void)