MythTV  master
mythplayerui.cpp
Go to the documentation of this file.
1 #include <chrono>
2 
3 // MythTV
4 #include "mythsystemevent.h"
5 #include "audiooutput.h"
6 #include "mythmainwindow.h"
9 #include "interactivetv.h"
10 #include "osd.h"
11 #include "interactivescreen.h"
12 #include "tv_play.h"
13 #include "livetvchain.h"
14 #include "mythplayerui.h"
15 
16 using namespace std::chrono_literals;
17 
18 #define LOC QString("PlayerUI: ")
19 
22  : MythPlayerVisualiserUI(MainWindow, Tv, Context, Flags),
24 {
25  // Finish setting up the overlays
26  m_osd.SetPlayer(this);
28 
29  // User feedback during slow seeks
30  connect(this, &MythPlayerUI::SeekingSlow, [&](int Count)
31  {
32  UpdateOSDMessage(tr("Searching") + QString().fill('.', Count % 3), kOSDTimeout_Short);
34  });
35 
36  // Seeking has finished
37  connect(this, &MythPlayerUI::SeekingComplete, [=]()
38  {
39  m_osdLock.lock();
41  m_osdLock.unlock();
42  });
43 
44  // Setup OSD debug
45  m_osdDebugTimer.setInterval(1s);
48 
49  // Other connections
52 }
53 
55 {
56  LOG(VB_GENERAL, LOG_INFO, LOC + "Initialising player state");
58 }
59 
61 {
62  if (OpenFile() < 0)
63  {
64  LOG(VB_GENERAL, LOG_ERR, LOC + "Unable to open video file.");
65  return false;
66  }
67 
68  m_framesPlayed = 0;
69  m_rewindTime = m_ffTime = 0;
71  m_jumpChapter = 0;
74 
75  if (!InitVideo())
76  {
77  LOG(VB_GENERAL, LOG_ERR, LOC + "Unable to initialize video.");
79  return false;
80  }
81 
82  bool seek = m_bookmarkSeek > 30;
83  EventStart();
84  DecoderStart(true);
85  if (seek)
86  InitialSeek();
87  VideoStart();
88 
89  m_playerThread->setPriority(QThread::TimeCriticalPriority);
90 #ifdef Q_OS_ANDROID
91  setpriority(PRIO_PROCESS, m_playerThreadId, -20);
92 #endif
95  return !IsErrored();
96 }
97 
99 {
100  // TODO handle initial commskip and/or cutlist skip as well
101  if (m_bookmarkSeek > 30)
102  {
105  SetBookmark(true);
106  }
107 }
108 
110 {
111  // Handle decoder callbacks
113 
114  // Live TV program change
115  if (m_fileChanged)
116  FileChanged();
117 
118  // Check if visualiser is wanted on first start and after video change
120  AutoVisualise(!m_videoDim.isEmpty());
121 
122  // recreate the osd if a reinit was triggered by another thread
123  if (m_reinitOsd)
124  ReinitOSD();
125 
126  // reselect subtitle tracks if triggered by the decoder
127  if (m_enableCaptions)
128  SetCaptionsEnabled(true, false);
129  if (m_disableCaptions)
130  SetCaptionsEnabled(false, false);
131 
132  // enable/disable forced subtitles if signalled by the decoder
137 
138  // reset the scan (and hence deinterlacers) if triggered by the decoder
140 
141  // refresh the position map for an in-progress recording while editing
143  {
144  if (m_editUpdateTimer.hasExpired(2000))
145  {
146  // N.B. the positionmap update and osd refresh are asynchronous
147  m_forcePositionMapSync = true;
148  m_osdLock.lock();
150  m_osdLock.unlock();
151  m_editUpdateTimer.start();
152  }
153  }
154 
155  // Refresh the programinfo in use status
156  m_playerCtx->LockPlayingInfo(__FILE__, __LINE__);
159  m_playerCtx->UnlockPlayingInfo(__FILE__, __LINE__);
160 
161  // Disable timestretch if we are too close to the end of the buffer
162  if (m_ffrewSkip == 1 && (m_playSpeed > 1.0F) && IsNearEnd())
163  {
164  LOG(VB_PLAYBACK, LOG_INFO, LOC + "Near end, Slowing down playback.");
165  Play(1.0F, true, true);
166  }
167 
169  {
170  // Switch from the dummy recorder to the tuned program in livetv
171  m_playerCtx->m_tvchain->JumpToNext(true, 0);
172  JumpToProgram();
173  }
174  else if ((!m_allPaused || GetEof() != kEofStateNone) &&
177  {
178  // Switch to the next program in livetv
180  SwitchToProgram();
181  }
182 
183  // Jump to the next program in livetv
185  {
186  JumpToProgram();
187  }
188 
189  // Change interactive stream if requested
190  if (!m_newStream.isEmpty())
191  {
193  m_newStream = QString();
194  }
195 
196  // Disable fastforward if we are too close to the end of the buffer
197  if (m_ffrewSkip > 1 && (CalcMaxFFTime(100, false) < 100))
198  {
199  LOG(VB_PLAYBACK, LOG_INFO, LOC + "Near end, stopping fastforward.");
200  Play(1.0F, true, true);
201  }
202 
203  // Disable rewind if we are too close to the beginning of the buffer
204  if (m_ffrewSkip < 0 && CalcRWTime(-m_ffrewSkip) >= 0 &&
206  {
207  LOG(VB_PLAYBACK, LOG_INFO, LOC + "Near start, stopping rewind.");
208  float stretch = (m_ffrewSkip > 0) ? 1.0F : m_audio.GetStretchFactor();
209  Play(stretch, true, true);
210  }
211 
212  // Check for error
214  {
215  LOG(VB_GENERAL, LOG_ERR, LOC +
216  "Unknown recorder error, exiting decoder");
217  if (!IsErrored())
218  SetErrored(tr("Irrecoverable recorder error"));
219  m_killDecoder = true;
220  return;
221  }
222 
223  // Handle speed change
224  if (!qFuzzyCompare(m_playSpeed + 1.0F, m_nextPlaySpeed + 1.0F) &&
226  {
227  ChangeSpeed();
228  return;
229  }
230 
231  // Check if we got a communication error, and if so pause playback
233  {
234  Pause();
236  }
237 
238  // Handle end of file
239  EofState eof = GetEof();
240  if (HasReachedEof())
241  {
242 #ifdef USING_MHEG
244  {
245  Pause();
246  return;
247  }
248 #endif
250  {
251  LOG(VB_GENERAL, LOG_NOTICE, LOC + "LiveTV forcing JumpTo 1");
252  m_playerCtx->m_tvchain->JumpToNext(true, 0);
253  return;
254  }
255 
256  bool videoDrained =
258  bool audioDrained =
259  !m_audio.GetAudioOutput() ||
260  m_audio.IsPaused() ||
262  if (eof != kEofStateDelayed || (videoDrained && audioDrained))
263  {
264  if (eof == kEofStateDelayed)
265  {
266  LOG(VB_PLAYBACK, LOG_INFO,
267  QString("waiting for no video frames %1")
269  }
270  LOG(VB_PLAYBACK, LOG_INFO,
271  QString("HasReachedEof() at framesPlayed=%1 totalFrames=%2")
273  Pause();
274  SetPlaying(false);
275  return;
276  }
277  }
278 
279  // Handle rewind
280  if (m_rewindTime > 0 && (m_ffrewSkip == 1 || m_ffrewSkip == 0))
281  {
283  if (m_rewindTime > 0)
284  DoRewind(static_cast<uint64_t>(m_rewindTime), kInaccuracyDefault);
285  }
286 
287  // Handle fast forward
288  if (m_ffTime > 0 && (m_ffrewSkip == 1 || m_ffrewSkip == 0))
289  {
291  if (m_ffTime > 0)
292  {
293  DoFastForward(static_cast<uint64_t>(m_ffTime), kInaccuracyDefault);
294  if (GetEof() != kEofStateNone)
295  return;
296  }
297  }
298 
299  // Handle chapter jump
300  if (m_jumpChapter != 0)
302 
303  // Handle commercial skipping
304  if (m_commBreakMap.GetSkipCommercials() != 0 && (m_ffrewSkip == 1))
305  {
306  if (!m_commBreakMap.HasMap())
307  {
308  //: The commercials/adverts have not been flagged
309  SetOSDStatus(tr("Not Flagged"), kOSDTimeout_Med);
310  QString message = "COMMFLAG_REQUEST ";
311  m_playerCtx->LockPlayingInfo(__FILE__, __LINE__);
312  message += QString("%1").arg(m_playerCtx->m_playingInfo->GetChanID()) +
314  m_playerCtx->UnlockPlayingInfo(__FILE__, __LINE__);
315  gCoreContext->SendMessage(message);
316  }
317  else
318  {
319  QString msg;
320  uint64_t jumpto = 0;
321  uint64_t frameCount = GetCurrentFrameCount();
322  // XXX CommBreakMap should use duration map not m_videoFrameRate
323  bool jump = m_commBreakMap.DoSkipCommercials(jumpto, m_framesPlayed,
325  frameCount, msg);
326  if (!msg.isEmpty())
328  if (jump)
330  }
332  return;
333  }
334 
335  // Handle automatic commercial skipping
336  uint64_t jumpto = 0;
337  if (m_deleteMap.IsEmpty() && (m_ffrewSkip == 1) &&
340  {
341  QString msg;
342  uint64_t frameCount = GetCurrentFrameCount();
343  // XXX CommBreakMap should use duration map not m_videoFrameRate
346  frameCount, msg);
347  if (!msg.isEmpty())
349  if (jump)
351  }
352 
353  // Handle cutlist skipping
354  if (!m_allPaused && (m_ffrewSkip == 1) &&
356  {
357  if (jumpto == m_totalFrames)
358  {
361  }
362  else
363  {
365  }
366  }
367 }
368 
370 {
371 #ifdef USING_MHEG
372  // handle Interactive TV
373  if (GetInteractiveTV())
374  {
375  m_osdLock.lock();
376  m_itvLock.lock();
377  auto *window = qobject_cast<InteractiveScreen *>(m_captionsOverlay.GetWindow(OSD_WIN_INTERACT));
378  if ((m_interactiveTV->ImageHasChanged() || !m_itvVisible) && window)
379  {
381  m_itvVisible = true;
382  }
383  m_itvLock.unlock();
384  m_osdLock.unlock();
385  }
386 #endif // USING_MHEG
387 }
388 
390 {
392  // ensure we re-check double rate support following a speed change
393  UnlockScan();
394 }
395 
396 void MythPlayerUI::ReinitVideo(bool ForceUpdate)
397 {
398  MythPlayer::ReinitVideo(ForceUpdate);
399 
400  // Signal to the main thread to reinit OSD
401  m_reinitOsd = true;
402 
403  // Signal to main thread to reinit subtitles
405  EnableSubtitles(true);
406 
407  // Signal to the main thread to check auto visualise
408  m_checkAutoVisualise = true;
409 }
410 
412 {
413  QRect visible;
414  QRect total;
415  float aspect = NAN;
416  float scaling = NAN;
417 
418  m_osdLock.lock();
419  m_videoOutput->GetOSDBounds(total, visible, aspect, scaling, 1.0F);
420  m_osd.Init(visible, aspect);
421  m_captionsOverlay.Init(visible, aspect);
423 
424 #ifdef USING_MHEG
425  if (GetInteractiveTV())
426  {
427  QMutexLocker locker(&m_itvLock);
428  m_interactiveTV->Reinit(total, visible, aspect);
429  }
430 #endif // USING_MHEG
431 
432  // If there is a forced text subtitle track (which is possible
433  // in e.g. a .mkv container), and forced subtitles are
434  // allowed, then start playback with that subtitle track
435  // selected. Otherwise, use the frontend settings to decide
436  // which captions/subtitles (if any) to enable at startup.
437  // TODO: modify the fix to #10735 to use this approach
438  // instead.
439  bool hasForcedTextTrack = false;
440  uint forcedTrackNumber = 0;
442  {
443  uint numTextTracks = m_decoder->GetTrackCount(kTrackTypeRawText);
444  for (uint i = 0; !hasForcedTextTrack && i < numTextTracks; ++i)
445  {
447  {
448  hasForcedTextTrack = true;
449  forcedTrackNumber = i;
450  }
451  }
452  }
453  if (hasForcedTextTrack)
454  SetTrack(kTrackTypeRawText, static_cast<uint>(forcedTrackNumber));
455  else
457 
458  m_osdLock.unlock();
459 
460  SetPlaying(true);
461  ClearAfterSeek(false);
464 
467  AutoVisualise(!m_videoDim.isEmpty());
468 }
469 
471 {
472  m_playerCtx->LockPlayingInfo(__FILE__, __LINE__);
473  {
475  {
476  // When initial playback gets underway, we override the ProgramInfo
477  // flags such that future calls to GetBookmark() will consider only
478  // an actual bookmark and not progstart or lastplaypos information.
482  }
483  }
484  m_playerCtx->UnlockPlayingInfo(__FILE__, __LINE__);
486 }
487 
489 {
491 
492  if (m_videoPaused || m_isDummy)
494  else
496 
499  else if (m_decoder && m_decoder->GetEof() != kEofStateNone)
500  ++m_framesPlayed;
501  else
502  m_framesPlayed = static_cast<uint64_t>(m_videoOutput->GetFramesPlayed());
503  return !IsErrored();
504 }
505 
507 {
508  SetFrameInterval(GetScanType(), 1.0 / (m_videoFrameRate * static_cast<double>(m_playSpeed)));
510  LOG(VB_PLAYBACK, LOG_INFO, LOC + QString("Display Refresh Rate: %1 Video Frame Rate: %2")
511  .arg(1000000.0 / m_display->GetRefreshInterval(m_frameInterval), 0, 'f', 3)
512  .arg(1000000.0 / m_frameInterval, 0, 'f', 3));
513 }
514 
515 void MythPlayerUI::RenderVideoFrame(MythVideoFrame *Frame, FrameScanType Scan, bool Prepare, int64_t Wait)
516 {
517  if (!m_videoOutput)
518  return;
519 
520  if (Prepare)
528 
529  if (Wait > 0)
530  m_avSync.WaitForFrame(Wait);
531 
533 }
534 
536 {
537  m_fileChanged = false;
538  LOG(VB_PLAYBACK, LOG_INFO, LOC + "FileChanged");
539 
540  Pause();
541  ChangeSpeed();
542  if (dynamic_cast<AvFormatDecoder *>(m_decoder))
543  m_playerCtx->m_buffer->Reset(false, true);
544  else
545  m_playerCtx->m_buffer->Reset(false, true, true);
547  Play();
548 
550 
551  m_playerCtx->LockPlayingInfo(__FILE__, __LINE__);
553  if (m_decoder)
555  m_playerCtx->UnlockPlayingInfo(__FILE__, __LINE__);
556 
557  CheckTVChain();
558  m_forcePositionMapSync = true;
559 }
560 
562 {
564  {
566  {
568  m_needNewPauseFrame = false;
569 
570  if (m_deleteMap.IsEditing())
571  {
572  m_osdLock.lock();
574  m_osdLock.unlock();
575  }
576  }
577  else
578  {
579  m_decodeOneFrame = true;
580  }
581  }
582 }
583 
585 {
586  if (Due < 0)
587  {
588  m_videoOutput->SetFramesPlayed(static_cast<long long>(++m_framesPlayed));
589  }
590  else if (!FlagIsSet(kVideoIsNull) && Frame)
591  {
592 
593  // Check scan type
594  bool showsecondfield = false;
595  FrameScanType ps = GetScanForDisplay(Frame, showsecondfield);
596 
597  // if we get here, we're actually going to do video output
598  RenderVideoFrame(Frame, ps, true, Due);
599 
600  // Only double rate CPU deinterlacers require an extra call to PrepareFrame
601  bool secondprepare = Frame->GetDoubleRateOption(DEINT_CPU) && !Frame->GetDoubleRateOption(DEINT_SHADER);
602  // and the first deinterlacing pass will have marked the frame as already deinterlaced
603  // which will break GetScanForDisplay below and subsequent deinterlacing
604  bool olddeinterlaced = Frame->m_alreadyDeinterlaced;
605  if (secondprepare)
606  Frame->m_alreadyDeinterlaced = false;
607  // Update scan settings now that deinterlacer has been set and we know
608  // whether we need a second field
609  ps = GetScanForDisplay(Frame, showsecondfield);
610 
611  // Reset olddeinterlaced if necessary (pause frame etc)
612  if (!showsecondfield && secondprepare)
613  {
614  Frame->m_alreadyDeinterlaced = olddeinterlaced;
615  }
616  else if (showsecondfield)
617  {
618  // Second field
619  if (kScan_Interlaced == ps)
620  ps = kScan_Intr2ndField;
621  RenderVideoFrame(Frame, ps, secondprepare, Due + m_frameInterval / 2);
622  }
623  }
624  else
625  {
626  m_avSync.WaitForFrame(Due);
627  }
628 }
629 
631 {
632  if (!m_videoOutput)
633  return;
634 
635  if (m_videoOutput->IsErrored())
636  {
637  SetErrored(tr("Serious error detected in Video Output"));
638  return;
639  }
640 
641  // clear the buffering state
642  SetBuffering(false);
643 
645  PreProcessNormalFrame(); // Allow interactiveTV to draw on pause frame
646 
649  RenderVideoFrame(nullptr, scan, true, 0);
650 }
651 
652 void MythPlayerUI::DisplayNormalFrame(bool CheckPrebuffer)
653 {
654  if (m_allPaused)
655  return;
656 
657  if (CheckPrebuffer && !PrebufferEnoughFrames())
658  return;
659 
660  // clear the buffering state
661  SetBuffering(false);
662 
663  // retrieve the next frame
666 
667  // Check aspect ratio
668  CheckAspectRatio(frame);
669 
671  UpdateFFRewSkip();
672 
673  // Player specific processing (dvd, bd, mheg etc)
675 
676  // handle scan type changes
678 
679  // Detect letter boxing
680  // FIXME this is temporarily moved entirely into the main thread as there are
681  // too many threading issues and the decoder thread is not yet ready to handle
682  // QObject signals and slots.
683  // When refactoring is complete, move it into the decoder thread and
684  // signal switches via a new field in MythVideoFrame
687  {
689  ReinitOSD();
690  }
691 
692  // When is the next frame due
693  int64_t due = m_avSync.AVSync(&m_audio, frame, m_frameInterval, m_playSpeed, !m_videoDim.isEmpty(),
695  // Display it
696  DoDisplayVideoFrame(frame, due);
699 }
700 
701 void MythPlayerUI::SetVideoParams(int Width, int Height, double FrameRate, float Aspect,
702  bool ForceUpdate, int ReferenceFrames,
703  FrameScanType Scan, const QString &CodecName)
704 {
705  MythPlayer::SetVideoParams(Width, Height, FrameRate, Aspect, ForceUpdate, ReferenceFrames,
706  Scan, CodecName);
707 
708  // ensure deinterlacers are correctly reset after a change
709  UnlockScan();
710  FrameScanType newscan = DetectInterlace(Scan, static_cast<float>(m_videoFrameRate), m_videoDispDim.height());
712  ResetTracker();
713 }
714 
715 bool MythPlayerUI::DoFastForwardSecs(float Seconds, double Inaccuracy, bool UseCutlist)
716 {
717  float current = ComputeSecs(m_framesPlayed, UseCutlist);
718  uint64_t targetFrame = FindFrame(current + Seconds, UseCutlist);
719  return DoFastForward(targetFrame - m_framesPlayed, Inaccuracy);
720 }
721 
722 bool MythPlayerUI::DoRewindSecs(float Seconds, double Inaccuracy, bool UseCutlist)
723 {
724  float target = qMax(0.0F, ComputeSecs(m_framesPlayed, UseCutlist) - Seconds);
725  uint64_t targetFrame = FindFrame(target, UseCutlist);
726  return DoRewind(m_framesPlayed - targetFrame, Inaccuracy);
727 }
728 
743 void MythPlayerUI::SetWatched(bool ForceWatched)
744 {
745  m_playerCtx->LockPlayingInfo(__FILE__, __LINE__);
747  {
748  m_playerCtx->UnlockPlayingInfo(__FILE__, __LINE__);
749  return;
750  }
751 
752  uint64_t numFrames = GetCurrentFrameCount();
753 
754  // For recordings we want to ignore the post-roll and account for
755  // in-progress recordings where totalFrames doesn't represent
756  // the full length of the recording. For videos we can only rely on
757  // totalFrames as duration metadata can be wrong
760  {
761 
762  // If the recording is stopped early we need to use the recording end
763  // time, not the programme end time
765  qint64 starttime = pi->GetRecordingStartTime().toSecsSinceEpoch();
766  qint64 endactual = pi->GetRecordingEndTime().toSecsSinceEpoch();
767  qint64 endsched = pi->GetScheduledEndTime().toSecsSinceEpoch();
768  qint64 endtime = std::min(endactual, endsched);
769  numFrames = static_cast<uint64_t>((endtime - starttime) * m_videoFrameRate);
770  }
771 
772  auto offset = static_cast<int>(round(0.14 * (numFrames / m_videoFrameRate)));
773 
774  if (offset < 240)
775  offset = 240; // 4 Minutes Min
776  else if (offset > 720)
777  offset = 720; // 12 Minutes Max
778 
779  if (ForceWatched || (m_framesPlayed > (numFrames - (offset * m_videoFrameRate))))
780  {
782  LOG(VB_GENERAL, LOG_INFO, LOC + QString("Marking recording as watched using offset %1 minutes")
783  .arg(offset/60));
784  }
785 
786  m_playerCtx->UnlockPlayingInfo(__FILE__, __LINE__);
787 }
788 
790 {
791  m_playerCtx->LockPlayingInfo(__FILE__, __LINE__);
794  m_playerCtx->UnlockPlayingInfo(__FILE__, __LINE__);
795 }
796 
798 {
799  int refreshinterval = 1;
800  if (m_display)
801  refreshinterval = m_display->GetRefreshInterval(m_frameInterval);
802 
803  // At this point we may not have the correct frame rate.
804  // Since interlaced is always at 25 or 30 fps, if the interval
805  // is less than 30000 (33fps) it must be representing one
806  // field and not one frame, so multiply by 2.
807  int realfi = m_frameInterval;
808  if (m_frameInterval < 30000)
809  realfi = m_frameInterval * 2;
810  return ((realfi / 2.0) > (refreshinterval * 0.995));
811 }
812 
814 {
815  QString samplerate = MythMediaBuffer::BitrateToString(static_cast<uint64_t>(m_audio.GetSampleRate()), true);
816  Map.insert("samplerate", samplerate);
817  Map.insert("filename", m_playerCtx->m_buffer->GetSafeFilename());
818  Map.insert("decoderrate", m_playerCtx->m_buffer->GetDecoderRate());
819  Map.insert("storagerate", m_playerCtx->m_buffer->GetStorageRate());
820  Map.insert("bufferavail", m_playerCtx->m_buffer->GetAvailableBuffer());
821  Map.insert("buffersize", QString::number(m_playerCtx->m_buffer->GetBufferSize() >> 20));
822  m_avSync.GetAVSyncData(Map);
823 
824  if (m_videoOutput)
825  {
826  QString frames = QString("%1/%2").arg(m_videoOutput->ValidVideoFrames())
828  Map.insert("videoframes", frames);
829  }
830  if (m_decoder)
831  Map["videodecoder"] = m_decoder->GetCodecDecoderName();
832 
833  Map["framerate"] = QString("%1%2%3")
834  .arg(static_cast<double>(m_outputJmeter.GetLastFPS()), 0, 'f', 2).arg(QChar(0xB1, 0))
835  .arg(static_cast<double>(m_outputJmeter.GetLastSD()), 0, 'f', 2);
836  Map["load"] = m_outputJmeter.GetLastCPUStats();
837 
838  GetCodecDescription(Map);
839 }
840 
842 {
843  Map["audiocodec"] = ff_codec_id_string(m_audio.GetCodec());
844  Map["audiochannels"] = QString::number(m_audio.GetOrigChannels());
845 
846  int width = m_videoDispDim.width();
847  int height = m_videoDispDim.height();
848  Map["videocodec"] = GetEncodingType();
849  if (m_decoder)
850  Map["videocodecdesc"] = m_decoder->GetRawEncodingType();
851  Map["videowidth"] = QString::number(width);
852  Map["videoheight"] = QString::number(height);
853  Map["videoframerate"] = QString::number(m_videoFrameRate, 'f', 2);
854  Map["deinterlacer"] = GetDeinterlacerName();
855 
856  if (width < 640)
857  return;
858 
859  bool interlaced = is_interlaced(GetScanType());
860  if (height > 2100)
861  Map["videodescrip"] = interlaced ? "UHD_4K_I" : "UHD_4K_P";
862  else if (width == 1920 || height == 1080 || height == 1088)
863  Map["videodescrip"] = interlaced ? "HD_1080_I" : "HD_1080_P";
864  else if ((width == 1280 || height == 720) && !interlaced)
865  Map["videodescrip"] = "HD_720_P";
866  else if (height >= 720)
867  Map["videodescrip"] = "HD";
868  else
869  Map["videodescrip"] = "SD";
870 }
871 
873 {
875  if (Visible)
876  m_osdDebugTimer.start();
877  else
878  m_osdDebugTimer.stop();
879 }
880 
882 {
883  m_osdLock.lock();
884  InfoMap infoMap;
885  GetPlaybackData(infoMap);
888  m_osdLock.unlock();
889 }
890 
892 {
893  m_osdLock.lock();
894  bool enable = !m_osdDebug;
895  if (m_playerCtx->m_buffer)
897  EnableFrameRateMonitor(enable);
898  if (enable)
899  UpdateOSDDebug();
900  else
902  m_osdDebug = enable;
903  m_osdLock.unlock();
904 }
905 
907 {
908  bool verbose = VERBOSE_LEVEL_CHECK(VB_PLAYBACK, LOG_ANY);
909  double rate = Enable ? m_videoFrameRate : verbose ? (m_videoFrameRate * 4) : 0.0;
910  m_outputJmeter.SetNumCycles(static_cast<int>(rate));
911 }
912 
913 /* JumpToStream, JumpToProgram and SwitchToProgram all need to be moved into the
914  * parent object and hopefully simplified. The fairly involved logic does not
915  * sit well with the new design objectives for the player classes and are better
916  * suited to the high level logic in TV.
917  */
918 void MythPlayerUI::JumpToStream(const QString &stream)
919 {
920  LOG(VB_PLAYBACK, LOG_INFO, LOC + "JumpToStream - begin");
921 
922  // Shouldn't happen
923  if (stream.isEmpty())
924  return;
925 
926  Pause();
927  ResetCaptions();
928 
929  ProgramInfo pginfo(stream);
930  SetPlayingInfo(pginfo);
931 
934  else
935  m_playerCtx->m_buffer->OpenFile(stream);
936 
937  if (!m_playerCtx->m_buffer->IsOpen())
938  {
939  LOG(VB_GENERAL, LOG_ERR, LOC + "JumpToStream buffer OpenFile failed");
941  SetErrored(tr("Error opening remote stream buffer"));
942  return;
943  }
944 
945  m_watchingRecording = false;
946  m_totalLength = 0;
947  m_totalFrames = 0;
948  m_totalDuration = 0;
949 
950  // 120 retries ~= 60 seconds
951  if (OpenFile(120) < 0)
952  {
953  LOG(VB_GENERAL, LOG_ERR, LOC + "JumpToStream OpenFile failed.");
955  SetErrored(tr("Error opening remote stream"));
956  return;
957  }
958 
959  if (m_totalLength == 0)
960  {
961  long long len = m_playerCtx->m_buffer->GetRealFileSize();
962  m_totalLength = static_cast<int>(len / ((m_decoder->GetRawBitrate() * 1000) / 8));
963  m_totalFrames = static_cast<uint64_t>(m_totalLength * SafeFPS());
964  }
965 
966  LOG(VB_PLAYBACK, LOG_INFO, LOC + QString("JumpToStream length %1 bytes @ %2 Kbps = %3 Secs, %4 frames @ %5 fps")
968  .arg(m_totalLength).arg(m_totalFrames).arg(m_decoder->GetFPS()) );
969 
971 
972  // the bitrate is reset by m_playerCtx->m_buffer->OpenFile()...
974  m_decoder->SetProgramInfo(pginfo);
975 
976  Play();
977  ChangeSpeed();
978 
980 #ifdef USING_MHEG
982 #endif
983 
984  LOG(VB_PLAYBACK, LOG_INFO, LOC + "JumpToStream - end");
985 }
986 
988 {
989  if (!IsReallyNearEnd())
990  return;
991 
992  LOG(VB_PLAYBACK, LOG_INFO, LOC + "SwitchToProgram - start");
993  bool discontinuity = false;
994  bool newtype = false;
995  int newid = -1;
996  ProgramInfo *pginfo = m_playerCtx->m_tvchain->GetSwitchProgram(discontinuity, newtype, newid);
997  if (!pginfo)
998  return;
999 
1000  bool newIsDummy = m_playerCtx->m_tvchain->GetInputType(newid) == "DUMMY";
1001 
1002  SetPlayingInfo(*pginfo);
1003  Pause();
1004  ChangeSpeed();
1005 
1006  // Release all frames to ensure the current decoder resources are released
1007  DiscardVideoFrames(true, true);
1008 
1009  if (newIsDummy)
1010  {
1011  OpenDummy();
1012  ResetPlaying();
1014  delete pginfo;
1015  return;
1016  }
1017 
1019  {
1020  // Restore original ringbuffer
1021  auto *ic = dynamic_cast<MythInteractiveBuffer*>(m_playerCtx->m_buffer);
1022  if (ic)
1023  m_playerCtx->m_buffer = ic->TakeBuffer();
1024  delete ic;
1025  }
1026 
1028 
1029  if (!m_playerCtx->m_buffer->IsOpen())
1030  {
1031  LOG(VB_GENERAL, LOG_ERR, LOC + QString("SwitchToProgram's OpenFile failed (input type: %1)")
1032  .arg(m_playerCtx->m_tvchain->GetInputType(newid)));
1033  LOG(VB_GENERAL, LOG_ERR, m_playerCtx->m_tvchain->toString());
1035  SetErrored(tr("Error opening switch program buffer"));
1036  delete pginfo;
1037  return;
1038  }
1039 
1040  if (GetEof() != kEofStateNone)
1041  {
1042  discontinuity = true;
1043  ResetCaptions();
1044  }
1045 
1046  LOG(VB_PLAYBACK, LOG_INFO, LOC + QString("SwitchToProgram(void) "
1047  "discont: %1 newtype: %2 newid: %3 decoderEof: %4")
1048  .arg(discontinuity).arg(newtype).arg(newid).arg(GetEof()));
1049 
1050  if (discontinuity || newtype)
1051  {
1052  m_playerCtx->m_tvchain->SetProgram(*pginfo);
1053  if (m_decoder)
1054  m_decoder->SetProgramInfo(*pginfo);
1055 
1056  m_playerCtx->m_buffer->Reset(true);
1057  if (newtype)
1058  {
1059  if (OpenFile() < 0)
1060  SetErrored(tr("Error opening switch program file"));
1061  }
1062  else
1063  ResetPlaying();
1064  }
1065  else
1066  {
1068  if (m_decoder)
1069  {
1072  }
1073  }
1074  delete pginfo;
1075 
1076  if (IsErrored())
1077  {
1078  LOG(VB_GENERAL, LOG_ERR, LOC + "SwitchToProgram failed.");
1080  return;
1081  }
1082 
1084 
1085  // the bitrate is reset by m_playerCtx->m_buffer->OpenFile()...
1086  if (m_decoder)
1089 
1090  if (discontinuity || newtype)
1091  {
1092  CheckTVChain();
1093  m_forcePositionMapSync = true;
1094  }
1095 
1096  Play();
1097  LOG(VB_PLAYBACK, LOG_INFO, LOC + "SwitchToProgram - end");
1098 }
1099 
1101 {
1102  LOG(VB_PLAYBACK, LOG_INFO, LOC + "JumpToProgram - start");
1103  bool discontinuity = false;
1104  bool newtype = false;
1105  int newid = -1;
1106  long long nextpos = m_playerCtx->m_tvchain->GetJumpPos();
1107  ProgramInfo *pginfo = m_playerCtx->m_tvchain->GetSwitchProgram(discontinuity, newtype, newid);
1108  if (!pginfo)
1109  return;
1110 
1111  m_inJumpToProgramPause = true;
1112 
1113  bool newIsDummy = m_playerCtx->m_tvchain->GetInputType(newid) == "DUMMY";
1114  SetPlayingInfo(*pginfo);
1115 
1116  Pause();
1117  ChangeSpeed();
1118  ResetCaptions();
1119 
1120  // Release all frames to ensure the current decoder resources are released
1121  DiscardVideoFrames(true, true);
1122 
1123  m_playerCtx->m_tvchain->SetProgram(*pginfo);
1124  m_playerCtx->m_buffer->Reset(true);
1125 
1126  if (newIsDummy)
1127  {
1128  OpenDummy();
1129  ResetPlaying();
1131  delete pginfo;
1132  m_inJumpToProgramPause = false;
1133  return;
1134  }
1135 
1136  SendMythSystemPlayEvent("PLAY_CHANGED", pginfo);
1137 
1139  {
1140  // Restore original ringbuffer
1141  auto *ic = dynamic_cast<MythInteractiveBuffer*>(m_playerCtx->m_buffer);
1142  if (ic)
1143  m_playerCtx->m_buffer = ic->TakeBuffer();
1144  delete ic;
1145  }
1146 
1148  if (!m_playerCtx->m_buffer->IsOpen())
1149  {
1150  LOG(VB_GENERAL, LOG_ERR, LOC + QString("JumpToProgram's OpenFile failed (input type: %1)")
1151  .arg(m_playerCtx->m_tvchain->GetInputType(newid)));
1152  LOG(VB_GENERAL, LOG_ERR, m_playerCtx->m_tvchain->toString());
1154  SetErrored(tr("Error opening jump program file buffer"));
1155  delete pginfo;
1156  m_inJumpToProgramPause = false;
1157  return;
1158  }
1159 
1161 
1162  bool wasDummy = m_isDummy;
1163  if (newtype || wasDummy)
1164  {
1165  if (OpenFile() < 0)
1166  SetErrored(tr("Error opening jump program file"));
1167  }
1168  else
1169  ResetPlaying();
1170 
1171  if (IsErrored() || !m_decoder)
1172  {
1173  LOG(VB_GENERAL, LOG_ERR, LOC + "JumpToProgram failed.");
1174  if (!IsErrored())
1175  SetErrored(tr("Error reopening video decoder"));
1176  delete pginfo;
1177  m_inJumpToProgramPause = false;
1178  return;
1179  }
1180 
1182 
1183  // the bitrate is reset by m_playerCtx->m_buffer->OpenFile()...
1186 
1187  m_decoder->SetProgramInfo(*pginfo);
1188  delete pginfo;
1189 
1190  CheckTVChain();
1191  m_forcePositionMapSync = true;
1192  m_inJumpToProgramPause = false;
1193  Play();
1194  ChangeSpeed();
1195 
1196  // check that we aren't too close to the end of program.
1197  // and if so set it to 10s from the end if completed recordings
1198  // or 3s if live
1199  long long duration = m_playerCtx->m_tvchain->GetLengthAtCurPos();
1200  int maxpos = m_playerCtx->m_tvchain->HasNext() ? 10 : 3;
1201 
1202  if (nextpos > (duration - maxpos))
1203  {
1204  nextpos = duration - maxpos;
1205  if (nextpos < 0)
1206  nextpos = 0;
1207  }
1208  else if (nextpos < 0)
1209  {
1210  // it's a relative position to the end
1211  nextpos += duration;
1212  }
1213 
1214  // nextpos is the new position to use in seconds
1215  nextpos = static_cast<int64_t>(TranslatePositionMsToFrame(static_cast<uint64_t>(nextpos) * 1000, true));
1216 
1217  if (nextpos > 10)
1218  DoJumpToFrame(static_cast<uint64_t>(nextpos), kInaccuracyNone);
1219 
1221  LOG(VB_PLAYBACK, LOG_INFO, LOC + "JumpToProgram - end");
1222 }
1223 
1224 // Only edit stuff below here - to be moved
1225 #include "tv_actions.h"
1226 
1227 uint64_t MythPlayerUI::GetNearestMark(uint64_t Frame, bool Right)
1228 {
1229  return m_deleteMap.GetNearestMark(Frame, Right);
1230 }
1231 
1233 {
1235 }
1236 
1238 {
1239  return m_deleteMap.HasTemporaryMark();
1240 }
1241 
1243 {
1244  return m_deleteMap.IsSaved();
1245 }
1246 
1248 {
1249  return m_deleteMap.HasUndo();
1250 }
1251 
1253 {
1254  return m_deleteMap.HasRedo();
1255 }
1256 
1258 {
1259  return m_deleteMap.GetUndoMessage();
1260 }
1261 
1263 {
1264  return m_deleteMap.GetRedoMessage();
1265 }
1266 
1268 {
1269  m_deleteMap.SetEditing(false);
1270 
1271  if (!m_hasFullPositionMap)
1272  {
1273  LOG(VB_GENERAL, LOG_ERR, LOC + "Cannot edit - no full position map");
1274  SetOSDStatus(tr("No Seektable"), kOSDTimeout_Med);
1275  return;
1276  }
1277 
1278  if (m_deleteMap.IsFileEditing())
1279  return;
1280 
1281  QMutexLocker locker(&m_osdLock);
1283 
1285  m_tcWrap[TC_AUDIO] = 0;
1286 
1289  m_deleteMap.SetEditing(true);
1290  m_osd.DialogQuit();
1291  ResetCaptions();
1292  m_osd.HideAll();
1293 
1294  bool loadedAutoSave = m_deleteMap.LoadAutoSaveMap();
1295  if (loadedAutoSave)
1296  UpdateOSDMessage(tr("Using previously auto-saved cuts"), kOSDTimeout_Short);
1297 
1301  m_playerCtx->LockPlayingInfo(__FILE__, __LINE__);
1304  m_playerCtx->UnlockPlayingInfo(__FILE__, __LINE__);
1305  m_editUpdateTimer.start();
1306 }
1307 
1314 void MythPlayerUI::DisableEdit(int HowToSave)
1315 {
1316  QMutexLocker locker(&m_osdLock);
1317  m_deleteMap.SetEditing(false, &m_osd);
1318  if (HowToSave == 0)
1319  m_deleteMap.LoadMap();
1320  // Unconditionally save to remove temporary marks from the DB.
1321  if (HowToSave >= 0)
1322  m_deleteMap.SaveMap();
1324  m_deleteMap.SetFileEditing(false);
1325  m_playerCtx->LockPlayingInfo(__FILE__, __LINE__);
1328  m_playerCtx->UnlockPlayingInfo(__FILE__, __LINE__);
1329  ClearAudioGraph();
1332 
1333  if (!m_pausedBeforeEdit)
1335  else
1336  SetOSDStatus(tr("Paused"), kOSDTimeout_None);
1337 }
1338 
1339 void MythPlayerUI::HandleArbSeek(bool Direction)
1340 {
1341  if (qFuzzyCompare(m_deleteMap.GetSeekAmount() + 1000.0F, 1000.0F -2.0F))
1342  {
1343  uint64_t framenum = m_deleteMap.GetNearestMark(m_framesPlayed, Direction);
1344  if (Direction && (framenum > m_framesPlayed))
1346  else if (!Direction && (m_framesPlayed > framenum))
1348  }
1349  else
1350  {
1351  if (Direction)
1353  else
1355  }
1356 }
1357 
1359 {
1360  bool handled = false;
1361  bool refresh = true;
1362  auto frame = GetFramesPlayed();
1363 
1364  for (int i = 0; i < Actions.size() && !handled; i++)
1365  {
1366  QString action = Actions[i];
1367  handled = true;
1368  float seekamount = m_deleteMap.GetSeekAmount();
1369  bool seekzero = qFuzzyCompare(seekamount + 1.0F, 1.0F);
1370  if (action == ACTION_LEFT)
1371  {
1372  if (seekzero) // 1 frame
1373  {
1375  }
1376  else if (seekamount > 0)
1377  {
1378  // Use fully-accurate seeks for less than 1 second.
1379  DoRewindSecs(seekamount, seekamount < 1.0F ? kInaccuracyNone :
1380  kInaccuracyEditor, false);
1381  }
1382  else
1383  {
1384  HandleArbSeek(false);
1385  }
1386  }
1387  else if (action == ACTION_RIGHT)
1388  {
1389  if (seekzero) // 1 frame
1390  {
1392  }
1393  else if (seekamount > 0)
1394  {
1395  // Use fully-accurate seeks for less than 1 second.
1396  DoFastForwardSecs(seekamount, seekamount < 1.0F ? kInaccuracyNone :
1397  kInaccuracyEditor, false);
1398  }
1399  else
1400  {
1401  HandleArbSeek(true);
1402  }
1403  }
1404  else if (action == ACTION_LOADCOMMSKIP)
1405  {
1406  if (m_commBreakMap.HasMap())
1407  {
1408  frm_dir_map_t map;
1409  m_commBreakMap.GetMap(map);
1411  }
1412  }
1413  else if (action == ACTION_PREVCUT)
1414  {
1415  float old_seekamount = m_deleteMap.GetSeekAmount();
1417  HandleArbSeek(false);
1418  m_deleteMap.SetSeekAmount(old_seekamount);
1419  }
1420  else if (action == ACTION_NEXTCUT)
1421  {
1422  float old_seekamount = m_deleteMap.GetSeekAmount();
1424  HandleArbSeek(true);
1425  m_deleteMap.SetSeekAmount(old_seekamount);
1426  }
1427 #define FFREW_MULTICOUNT 10.0F
1428  else if (action == ACTION_BIGJUMPREW)
1429  {
1430  if (seekzero)
1432  else if (seekamount > 0)
1433  DoRewindSecs(seekamount * FFREW_MULTICOUNT, kInaccuracyEditor, false);
1434  else
1436  }
1437  else if (action == ACTION_BIGJUMPFWD)
1438  {
1439  if (seekzero)
1441  else if (seekamount > 0)
1443  else
1445  }
1446  else if (action == ACTION_SELECT)
1447  {
1448  m_deleteMap.NewCut(frame);
1449  UpdateOSDMessage(tr("New cut added."), kOSDTimeout_Short);
1450  refresh = true;
1451  }
1452  else if (action == "DELETE")
1453  {
1454  m_deleteMap.Delete(frame, tr("Delete"));
1455  refresh = true;
1456  }
1457  else if (action == "REVERT")
1458  {
1459  m_deleteMap.LoadMap(tr("Undo Changes"));
1460  refresh = true;
1461  }
1462  else if (action == "REVERTEXIT")
1463  {
1464  DisableEdit(0);
1465  refresh = false;
1466  }
1467  else if (action == ACTION_SAVEMAP)
1468  {
1469  m_deleteMap.SaveMap();
1470  refresh = true;
1471  }
1472  else if (action == "EDIT" || action == "SAVEEXIT")
1473  {
1474  DisableEdit(1);
1475  refresh = false;
1476  }
1477  else
1478  {
1479  QString undoMessage = m_deleteMap.GetUndoMessage();
1480  QString redoMessage = m_deleteMap.GetRedoMessage();
1481  handled = m_deleteMap.HandleAction(action, frame);
1482  if (handled && (action == "CUTTOBEGINNING" || action == "CUTTOEND" || action == "NEWCUT"))
1483  UpdateOSDMessage(tr("New cut added."), kOSDTimeout_Short);
1484  else if (handled && action == "UNDO")
1485  UpdateOSDMessage(tr("Undo - %1").arg(undoMessage), kOSDTimeout_Short);
1486  else if (handled && action == "REDO")
1487  UpdateOSDMessage(tr("Redo - %1").arg(redoMessage), kOSDTimeout_Short);
1488  }
1489  }
1490 
1491  if (handled && refresh)
1492  {
1493  m_osdLock.lock();
1495  m_osdLock.unlock();
1496  }
1497 
1498  return handled;
1499 }
1500 
MythPlayer::IsNearEnd
bool IsNearEnd(void)
Returns true iff near end of recording.
Definition: mythplayer.cpp:1513
MythMediaBuffer::OpenFile
virtual bool OpenFile(const QString &Filename, uint Retry=static_cast< uint >(kDefaultOpenTimeout))=0
MythPlayerCaptionsUI::GetInteractiveTV
InteractiveTV * GetInteractiveTV() override
Definition: mythplayercaptionsui.cpp:572
MythPlayerUI::DoFastForwardSecs
bool DoFastForwardSecs(float Seconds, double Inaccuracy, bool UseCutlist)
Definition: mythplayerui.cpp:715
MythPlayerVisualiserUI
Definition: mythplayervisualiserui.h:9
MythVideoOutput::GetOSDBounds
virtual void GetOSDBounds(QRect &Total, QRect &Visible, float &VisibleAspect, float &FontScaling, float ThemeAspect) const
Definition: mythvideoout.cpp:237
MythPlayerUI::SetBookmark
virtual void SetBookmark(bool Clear=false)
Definition: mythplayerui.cpp:789
OSD_WIN_INTERACT
#define OSD_WIN_INTERACT
Definition: mythcaptionsoverlay.h:9
MythPlayerUI::VideoStart
virtual void VideoStart()
Definition: mythplayerui.cpp:411
PlayerContext::IsRecorderErrored
bool IsRecorderErrored(void) const
Definition: playercontext.cpp:143
DeleteMap::SaveMap
void SaveMap(bool isAutoSave=false)
Saves the delete map to the database.
Definition: deletemap.cpp:773
MythPlayer::EnableSubtitles
void EnableSubtitles(bool enable)
Definition: mythplayer.cpp:670
MythPlayerCaptionsUI::SetTrack
virtual void SetTrack(uint Type, uint TrackNo)
Definition: mythplayercaptionsui.cpp:359
ProgramInfo::MakeUniqueKey
QString MakeUniqueKey(void) const
Creates a unique string that can be used to identify an existing recording.
Definition: programinfo.h:337
MythPlayer::m_frameInterval
int m_frameInterval
always adjusted for play_speed
Definition: mythplayer.h:490
DetectLetterbox::Detect
bool Detect(MythVideoFrame *Frame, float VideoAspect, AdjustFillMode &Current)
Detects if this frame is or is not letterboxed.
Definition: DetectLetterbox.cpp:27
PlayerContext::GetState
TVState GetState(void) const
Definition: playercontext.cpp:336
MythPlayer::m_enableForcedSubtitles
bool m_enableForcedSubtitles
Definition: mythplayer.h:468
MythCoreContext::SendMessage
void SendMessage(const QString &message)
Definition: mythcorecontext.cpp:1527
AudioOutput::GetAudioBufferedTime
virtual int64_t GetAudioBufferedTime(void)
report amount of audio buffered in milliseconds.
Definition: audiooutput.h:142
hardwareprofile.smolt.timeout
float timeout
Definition: smolt.py:103
MythVideoScanTracker::AutoDeint
virtual void AutoDeint(MythVideoFrame *Frame, MythVideoOutput *VideoOutput, int FrameInterval, bool AllowLock=true)
Check whether deinterlacing should be enabled.
Definition: mythvideoscantracker.cpp:176
MythPlayer::m_videoPaused
bool m_videoPaused
Definition: mythplayer.h:395
ProgramInfo::SaveEditing
void SaveEditing(bool edit)
Sets "editing" field in "recorded" table to "edit".
Definition: programinfo.cpp:2956
PlayerContext::UnlockPlayingInfo
void UnlockPlayingInfo(const char *file, int line) const
Definition: playercontext.cpp:248
MythPlayerUI::HandleArbSeek
void HandleArbSeek(bool Direction)
Definition: mythplayerui.cpp:1339
MythPlayer::m_watchingRecording
bool m_watchingRecording
Definition: mythplayer.h:406
MythPlayerUI::InitialiseState
void InitialiseState() override
Definition: mythplayerui.cpp:54
InteractiveTV::ImageHasChanged
bool ImageHasChanged(void)
Definition: interactivetv.cpp:41
MythPlayer::SetEof
void SetEof(EofState eof)
Definition: mythplayer.cpp:1074
MythPlayer::m_inJumpToProgramPause
bool m_inJumpToProgramPause
Definition: mythplayer.h:388
MythCaptionsOverlay::EnableSubtitles
void EnableSubtitles(int Type, bool ForcedOnly=false)
Definition: mythcaptionsoverlay.cpp:187
ProgramInfo::SaveBookmark
void SaveBookmark(uint64_t frame)
TODO Move to RecordingInfo.
Definition: programinfo.cpp:2574
kScan_Detect
@ kScan_Detect
Definition: videoouttypes.h:97
MythPlayer::UpdateFFRewSkip
bool UpdateFFRewSkip(void)
Definition: mythplayer.cpp:1312
mythplayerui.h
MythPlayer::m_commBreakMap
CommBreakMap m_commBreakMap
Definition: mythplayer.h:480
CommBreakMap::DoSkipCommercials
bool DoSkipCommercials(uint64_t &jumpToFrame, uint64_t framesPlayed, double video_frame_rate, uint64_t totalFrames, QString &comm_msg)
Definition: commbreakmap.cpp:251
MythPlayerVisualiserUI::m_checkAutoVisualise
bool m_checkAutoVisualise
Definition: mythplayervisualiserui.h:31
DecoderBase::GetEof
EofState GetEof(void)
Definition: decoderbase.h:135
MythPlayer::ChangeSpeed
virtual void ChangeSpeed(void)
Definition: mythplayer.cpp:1351
MythPlayerAudioUI::SetupAudioGraph
void SetupAudioGraph(double VideoFrameRate)
Definition: mythplayeraudioui.cpp:89
MythPlayerCaptionsUI::m_newStream
QString m_newStream
Definition: mythplayercaptionsui.h:79
kDisplayNone
@ kDisplayNone
Definition: videoouttypes.h:12
DEINT_SHADER
@ DEINT_SHADER
Definition: mythframe.h:69
DeleteMap::TrackerReset
void TrackerReset(uint64_t frame)
Resets the internal state tracker.
Definition: deletemap.cpp:806
TVPlaybackState::UpdateBookmark
void UpdateBookmark(bool Clear=false)
MythPlayerUI::DisableEdit
void DisableEdit(int HowToSave)
Leave cutlist edit mode, saving work in 1 of 3 ways.
Definition: mythplayerui.cpp:1314
kEofStateNone
@ kEofStateNone
Definition: decoderbase.h:69
MythPlayer::m_bufferingCounter
int m_bufferingCounter
Definition: mythplayer.h:506
MythPlayer::TranslatePositionMsToFrame
uint64_t TranslatePositionMsToFrame(uint64_t position, bool use_cutlist) const
Definition: mythplayer.h:261
LiveTVChain::HasNext
bool HasNext(void) const
Definition: livetvchain.cpp:405
Jitterometer::SetNumCycles
void SetNumCycles(int cycles)
Definition: jitterometer.cpp:64
MythPlayerVisualiserUI::PrepareVisualiser
void PrepareVisualiser()
Definition: mythplayervisualiserui.cpp:124
MythPlayer::SeekingSlow
void SeekingSlow(int Count)
MythPlayerUI::DeleteMapHasUndo
bool DeleteMapHasUndo()
Definition: mythplayerui.cpp:1247
MythPlayer::m_avSync
MythPlayerAVSync m_avSync
Definition: mythplayer.h:433
MythPlayerUI::EnableFrameRateMonitor
void EnableFrameRateMonitor(bool Enable=false)
Definition: mythplayerui.cpp:906
MythPlayer::m_playSpeed
float m_playSpeed
Definition: mythplayer.h:489
MythVideoOutput::FreeVideoFrames
int FreeVideoFrames()
Returns number of frames available for decoding onto.
Definition: mythvideoout.cpp:319
kMusicChoice
@ kMusicChoice
Definition: mythplayer.h:73
DeleteMap::LoadAutoSaveMap
bool LoadAutoSaveMap(void)
Returns true if an auto-save map was loaded.
Definition: deletemap.cpp:753
MythPlayerAudioUI::ClearAudioGraph
void ClearAudioGraph()
Definition: mythplayeraudioui.cpp:97
MythPlayer::CheckTVChain
void CheckTVChain()
Definition: mythplayer.cpp:924
DeleteMap::GetNearestMark
uint64_t GetNearestMark(uint64_t frame, bool right, bool *hasMark=nullptr) const
Returns the next or previous mark.
Definition: deletemap.cpp:610
MythPlayer::OpenFile
virtual int OpenFile(int Retries=4)
Definition: mythplayer.cpp:420
MythPlayerUI::EventStart
virtual void EventStart()
Definition: mythplayerui.cpp:470
LiveTVChain::GetLengthAtCurPos
int GetLengthAtCurPos(void)
Definition: livetvchain.cpp:360
MythVideoBounds::GetDisplayVisibleRect
QRect GetDisplayVisibleRect(void) const
Definition: mythvideobounds.h:73
MythPlayerUI::GetCodecDescription
void GetCodecDescription(InfoMap &Map)
Definition: mythplayerui.cpp:841
MythPlayerUI::DisplayNormalFrame
virtual void DisplayNormalFrame(bool CheckPrebuffer=true)
Definition: mythplayerui.cpp:652
MythMediaBuffer::EnableBitrateMonitor
void EnableBitrateMonitor(bool Enable)
Definition: mythmediabuffer.cpp:316
MythPlayerCaptionsUI::m_itvVisible
bool m_itvVisible
Definition: mythplayercaptionsui.h:78
MythPlayer::PrebufferEnoughFrames
virtual bool PrebufferEnoughFrames(int min_buffers=0)
Definition: mythplayer.cpp:722
Frame
Definition: zmdefines.h:94
PlayerContext::SetPlayerChangingBuffers
void SetPlayerChangingBuffers(bool val)
Definition: playercontext.h:88
MythPlayer::m_forcePositionMapSync
bool m_forcePositionMapSync
Definition: mythplayer.h:481
MythMediaBuffer::GetDecoderRate
QString GetDecoderRate(void)
Definition: mythmediabuffer.cpp:1526
MythPlayer::HasReachedEof
virtual bool HasReachedEof(void) const
Definition: mythplayer.cpp:650
MythPlayerAVSync::DisplayTimecode
int64_t & DisplayTimecode()
Definition: mythplayeravsync.cpp:35
MythPlayerUI::MythPlayerUI
MythPlayerUI(MythMainWindow *MainWindow, TV *Tv, PlayerContext *Context, PlayerFlags Flags)
Definition: mythplayerui.cpp:20
MythVideoOutput::PrepareFrame
virtual void PrepareFrame(MythVideoFrame *Frame, FrameScanType Scan=kScan_Ignore)=0
MythPlayerCaptionsUI::m_itvLock
QMutex m_itvLock
Definition: mythplayercaptionsui.h:76
OSD::ResetWindow
void ResetWindow(const QString &Window)
Definition: osd.cpp:620
MythPlayer::m_latestVideoTimecode
int64_t m_latestVideoTimecode
Definition: mythplayer.h:432
MythVideoOutput::UpdatePauseFrame
virtual void UpdatePauseFrame(int64_t &, FrameScanType=kScan_Progressive)
Definition: mythvideoout.h:87
arg
arg(title).arg(filename).arg(doDelete))
DeleteMap::SetFileEditing
void SetFileEditing(bool edit)
Update the editing status in the file's ProgramInfo.
Definition: deletemap.cpp:234
MythPlayer::m_ffrewSkip
int m_ffrewSkip
Definition: mythplayer.h:492
frm_dir_map_t
QMap< uint64_t, MarkTypes > frm_dir_map_t
Frame # -> Mark map.
Definition: programtypes.h:82
FrameScanType
FrameScanType
Definition: videoouttypes.h:95
osd.h
Context
QHash< QString, Action * > Context
Definition: action.h:77
MythPlayerVideoUI::m_detectLetterBox
DetectLetterbox m_detectLetterBox
Definition: mythplayervideoui.h:55
MythPlayerUI::PreProcessNormalFrame
virtual void PreProcessNormalFrame()
Definition: mythplayerui.cpp:369
MythPlayerUI::m_speedBeforeEdit
float m_speedBeforeEdit
Definition: mythplayerui.h:76
MythPlayer::IsErrored
bool IsErrored(void) const
Definition: mythplayer.cpp:1955
MythPlayer::m_normalSpeed
bool m_normalSpeed
Definition: mythplayer.h:496
MythMediaBuffer::Unpause
void Unpause(void)
Unpauses the read-ahead thread.
Definition: mythmediabuffer.cpp:700
ProgramInfo::GetScheduledEndTime
QDateTime GetScheduledEndTime(void) const
The scheduled end time of the program.
Definition: programinfo.h:395
LOG
#define LOG(_MASK_, _LEVEL_, _QSTRING_)
Definition: mythlogging.h:23
MythPlayerUI::DeleteMapHasRedo
bool DeleteMapHasRedo()
Definition: mythplayerui.cpp:1252
OSD::HideAll
void HideAll(bool KeepSubs=true, MythScreenType *Except=nullptr, bool DropNotification=false)
Definition: osd.cpp:89
MythMediaBuffer::GetSafeFilename
QString GetSafeFilename(void)
Definition: mythmediabuffer.cpp:1740
MythPlayer::GetCurrentFrameCount
uint64_t GetCurrentFrameCount(void) const
Definition: mythplayer.cpp:1746
DeleteMap::IsEmpty
bool IsEmpty(void) const
Definition: deletemap.cpp:259
OSD::SetText
void SetText(const QString &Window, const InfoMap &Map, OSDTimeout Timeout)
Definition: osd.cpp:204
CommBreakMap::GetMap
void GetMap(frm_dir_map_t &map) const
Definition: commbreakmap.cpp:92
ProgramInfo::UpdateInUseMark
void UpdateInUseMark(bool force=false)
Definition: programinfo.cpp:4708
ACTION_PREVCUT
#define ACTION_PREVCUT
Definition: tv_actions.h:91
ACTION_LOADCOMMSKIP
#define ACTION_LOADCOMMSKIP
Definition: tv_actions.h:89
MythVideoOutput::SetFramesPlayed
virtual void SetFramesPlayed(long long FramesPlayed)
Definition: mythvideoout.cpp:280
MythPlayer::CalcRWTime
long long CalcRWTime(long long rw) const
CalcRWTime(rw): rewind rw frames back.
Definition: mythplayer.cpp:1409
PlayerFlags
PlayerFlags
Definition: mythplayer.h:62
mythinteractivebuffer.h
mythsystemevent.h
MythPlayerVisualiserUI::RenderVisualiser
void RenderVisualiser()
Definition: mythplayervisualiserui.cpp:135
MythPlayer::GetEof
EofState GetEof(void) const
Definition: mythplayer.cpp:1061
MythPlayer::Pause
bool Pause(void)
Definition: mythplayer.cpp:159
MythPlayerUI::m_pausedBeforeEdit
bool m_pausedBeforeEdit
Definition: mythplayerui.h:77
kOSDTimeout_None
@ kOSDTimeout_None
Definition: osd.h:59
MythMediaBuffer::SetAdjustFilesize
long long SetAdjustFilesize(void)
Definition: mythmediabuffer.cpp:1158
MythPlayerUI::m_osdDebugTimer
QTimer m_osdDebugTimer
Definition: mythplayerui.h:87
MythPlayerAVSync::WaitForFrame
void WaitForFrame(int64_t FrameDue)
Definition: mythplayeravsync.cpp:27
MythPlayer::m_nextPlaySpeed
float m_nextPlaySpeed
Definition: mythplayer.h:488
ProgramInfo::GetRecordingEndTime
QDateTime GetRecordingEndTime(void) const
Approximate time the recording should have ended, did end, or is intended to end.
Definition: programinfo.h:410
DecoderBase::GetRawBitrate
uint GetRawBitrate(void) const
Returns the estimated bitrate if the video were played at normal speed.
Definition: decoderbase.h:199
MythPlayerUI::VideoLoop
virtual bool VideoLoop()
Definition: mythplayerui.cpp:488
MythMediaBuffer::UpdateRawBitrate
void UpdateRawBitrate(uint RawBitrate)
Set the raw bit rate, to allow RingBuffer adjust effective bitrate.
Definition: mythmediabuffer.cpp:280
MythPlayerOverlayUI::SetOSDStatus
void SetOSDStatus(const QString &Title, OSDTimeout Timeout)
Definition: mythplayeroverlayui.cpp:85
DecoderBase::GetWaitForChange
bool GetWaitForChange(void) const
Definition: decoderbase.cpp:898
InteractiveTV::Reinit
void Reinit(QRect videoRect, QRect dispRect, float aspect)
Definition: interactivetv.cpp:62
Visible
Definition: channelsettings.cpp:392
DecoderBase::SetWaitForChange
void SetWaitForChange(void)
Definition: decoderbase.cpp:893
MythPlayer::SeekingComplete
void SeekingComplete()
MythPlayerUI::ReinitVideo
void ReinitVideo(bool ForceUpdate) override
Definition: mythplayerui.cpp:396
AudioPlayer::GetOrigChannels
int GetOrigChannels(void) const
Definition: audioplayer.h:61
MythCaptionsState::m_textDisplayMode
uint m_textDisplayMode
Definition: mythplayerstate.h:69
MythMediaBuffer::BitrateToString
static QString BitrateToString(uint64_t Rate, bool Hz=false)
Definition: mythmediabuffer.cpp:1493
hardwareprofile.scan.scan
def scan(profile, smoonURL, gate)
Definition: scan.py:57
MythDate::current
QDateTime current(bool stripped)
Returns current Date and Time in UTC.
Definition: mythdate.cpp:10
MythVideoOutput::RenderOverlays
virtual void RenderOverlays(OSD &)
Definition: mythvideoout.h:86
DeleteMap::SetEditing
void SetEditing(bool edit, OSD *osd=nullptr)
Set the edit mode and optionally hide the edit mode OSD.
Definition: deletemap.cpp:226
ProgramInfo::GetRecordingStartTime
QDateTime GetRecordingStartTime(void) const
Approximate time the recording started.
Definition: programinfo.h:402
MythPlayer::SetErrored
void SetErrored(const QString &reason)
Definition: mythplayer.cpp:1931
LiveTVChain::NeedsToJump
bool NeedsToJump(void) const
Returns true iff a switch and jump are required.
Definition: livetvchain.h:68
MythPlayer::GetEncodingType
QString GetEncodingType(void) const
Definition: mythplayer.cpp:1716
MythPlayer::DiscardVideoFrames
void DiscardVideoFrames(bool KeyFrame, bool Flushed)
Places frames in the available frames queue.
Definition: mythplayer.cpp:644
MythPlayer::m_needNewPauseFrame
bool m_needNewPauseFrame
Definition: mythplayer.h:393
DeleteMap::GetUndoMessage
QString GetUndoMessage(void) const
Definition: deletemap.cpp:74
DeleteMap::TrackerWantsToJump
bool TrackerWantsToJump(uint64_t frame, uint64_t &to) const
Returns true if the given frame has passed the last cut point start and provides the frame number of ...
Definition: deletemap.cpp:840
MythPlayer::kInaccuracyNone
static const double kInaccuracyNone
Definition: mythplayer.h:244
MythMediaBuffer::GetBufferSize
uint GetBufferSize(void) const
Definition: mythmediabuffer.cpp:1546
InfoMap
QHash< QString, QString > InfoMap
Definition: mythtypes.h:15
AudioPlayer::IsPaused
bool IsPaused(void)
Definition: audioplayer.cpp:188
MythPlayerUI::OSDDebugVisibilityChanged
void OSDDebugVisibilityChanged(bool Visible)
Definition: mythplayerui.cpp:872
MythVideoScanTracker::DetectInterlace
FrameScanType DetectInterlace(FrameScanType NewScan, float Rate, int VideoHeight)
Definition: mythvideoscantracker.cpp:242
EofState
EofState
Definition: decoderbase.h:68
MythPlayer::m_audio
AudioPlayer m_audio
Definition: mythplayer.h:477
DEINT_CPU
@ DEINT_CPU
Definition: mythframe.h:68
MythVideoBounds::GetAdjustFill
AdjustFillMode GetAdjustFill(void) const
Definition: mythvideobounds.h:80
MythPlayerOverlayUI::UpdateOSDMessage
void UpdateOSDMessage(const QString &Message)
Definition: mythplayeroverlayui.cpp:71
TRANSCODING_COMPLETE
@ TRANSCODING_COMPLETE
Definition: programtypes.h:123
Jitterometer::GetLastFPS
float GetLastFPS(void) const
Definition: jitterometer.h:53
DecoderBase::GetTrackCount
virtual uint GetTrackCount(uint Type)
Definition: decoderbase.cpp:903
MythMediaBuffer::GetRealFileSize
long long GetRealFileSize(void) const
Definition: mythmediabuffer.cpp:464
MythPlayer::GetFramesPlayed
uint64_t GetFramesPlayed(void) const
Definition: mythplayer.h:143
MythPlayer::m_decoder
DecoderBase * m_decoder
Definition: mythplayer.h:366
MythPlayer::ComputeSecs
float ComputeSecs(uint64_t position, bool use_cutlist) const
Definition: mythplayer.h:276
ACTION_BIGJUMPREW
#define ACTION_BIGJUMPREW
Definition: tv_actions.h:92
MythVideoOutput::EndFrame
virtual void EndFrame()=0
DecoderBase::GetCodecDecoderName
virtual QString GetCodecDecoderName(void) const =0
DeleteMap::SetSeekAmount
void SetSeekAmount(float amount)
Definition: deletemap.h:35
kScan_Intr2ndField
@ kScan_Intr2ndField
Definition: videoouttypes.h:99
MythPlayer::m_framesPlayed
uint64_t m_framesPlayed
Definition: mythplayer.h:427
MythPlayer::m_rewindTime
long long m_rewindTime
Definition: mythplayer.h:431
LiveTVChain::JumpToNext
void JumpToNext(bool up, int pos)
JumpToNext(bool up, int pos) jump to the next (up == true) or previous (up == false) liveTV program I...
Definition: livetvchain.cpp:617
MythPlayer::m_totalLength
long long m_totalLength
Definition: mythplayer.h:429
DecoderBase::GetTrackInfo
StreamInfo GetTrackInfo(uint Type, uint TrackNo)
Definition: decoderbase.cpp:977
MythVideoOutput::ValidVideoFrames
virtual int ValidVideoFrames() const
Returns number of frames that are fully decoded.
Definition: mythvideoout.cpp:313
MythPlayer::m_ffTime
long long m_ffTime
If m_ffTime>0, number of frames to seek forward.
Definition: mythplayer.h:422
LOC
#define LOC
Definition: mythplayerui.cpp:18
AudioPlayer::DeleteOutput
void DeleteOutput(void)
Definition: audioplayer.cpp:92
kScan_Progressive
@ kScan_Progressive
Definition: videoouttypes.h:100
PlayerContext::m_playingInfo
ProgramInfo * m_playingInfo
Currently playing info.
Definition: playercontext.h:116
MythPlayerUI::SwitchToProgram
void SwitchToProgram()
Definition: mythplayerui.cpp:987
tv_actions.h
MythPlayer::m_tcWrap
tctype_arr m_tcWrap
Definition: mythplayer.h:499
ACTION_RIGHT
#define ACTION_RIGHT
Definition: mythuiactions.h:19
MythPlayer::SetPlayingInfo
void SetPlayingInfo(const ProgramInfo &pginfo)
Definition: mythplayer.cpp:237
DeleteMap::NewCut
void NewCut(uint64_t frame)
Add a new cut marker (to start or end a cut region)
Definition: deletemap.cpp:394
ACTION_NEXTCUT
#define ACTION_NEXTCUT
Definition: tv_actions.h:90
MythPlayerUI::IsTemporaryMark
bool IsTemporaryMark(uint64_t Frame)
Definition: mythplayerui.cpp:1232
MythPlayer::m_captionsEnabledbyDefault
bool m_captionsEnabledbyDefault
This allows us to enable captions/subtitles later if the streams are not immediately available when t...
Definition: mythplayer.h:465
PlayerContext::LockPlayingInfo
void LockPlayingInfo(const char *file, int line) const
Definition: playercontext.cpp:236
MythPlayer::FindFrame
uint64_t FindFrame(float offset, bool use_cutlist) const
Definition: mythplayer.cpp:1758
MythPlayer::m_bookmarkSeek
uint64_t m_bookmarkSeek
Definition: mythplayer.h:415
DecoderBase::GetfpsMultiplier
int GetfpsMultiplier(void) const
Definition: decoderbase.h:261
MythPlayer::DoJumpChapter
virtual bool DoJumpChapter(int chapter)
Definition: mythplayer.cpp:1843
MythPlayer::m_videoOutput
MythVideoOutput * m_videoOutput
Definition: mythplayer.h:368
MythPlayer::m_hasFullPositionMap
bool m_hasFullPositionMap
Definition: mythplayer.h:408
MythPlayer::m_clearSavedPosition
int m_clearSavedPosition
Definition: mythplayer.h:416
MythPlayerCaptionsUI::m_captionsOverlay
MythCaptionsOverlay m_captionsOverlay
Definition: mythplayercaptionsui.h:70
PlayerContext::m_buffer
MythMediaBuffer * m_buffer
Definition: playercontext.h:115
MythPlayerUIBase::m_painter
MythPainter * m_painter
Definition: mythplayeruibase.h:17
MythMediaBuffer::ResetCommsError
void ResetCommsError(void)
Definition: mythmediabuffer.cpp:1766
MythPlayer::m_totalDuration
int64_t m_totalDuration
Definition: mythplayer.h:430
MythPlayerUI::IsCutListSaved
bool IsCutListSaved()
Definition: mythplayerui.cpp:1242
MythPlayerUI::m_outputJmeter
Jitterometer m_outputJmeter
Definition: mythplayerui.h:72
LiveTVChain::GetSwitchProgram
ProgramInfo * GetSwitchProgram(bool &discont, bool &newtype, int &newid)
Returns the recording we should switch to.
Definition: livetvchain.cpp:428
MythPlayerUI::HandleProgramEditorActions
bool HandleProgramEditorActions(QStringList &Actions)
Definition: mythplayerui.cpp:1358
InteractiveTV::UpdateOSD
void UpdateOSD(InteractiveScreen *osdWindow, MythPainter *osdPainter)
Definition: interactivetv.cpp:47
MythPlayerUI::GetPlaybackData
void GetPlaybackData(InfoMap &Map)
Definition: mythplayerui.cpp:813
CommBreakMap::LoadMap
void LoadMap(PlayerContext *player_ctx, uint64_t framesPlayed)
Definition: commbreakmap.cpp:51
MythMediaBuffer::GetCommsError
bool GetCommsError(void) const
Definition: mythmediabuffer.cpp:1761
MythPlayerUI::SetVideoParams
void SetVideoParams(int Width, int Height, double FrameRate, float Aspect, bool ForceUpdate, int ReferenceFrames, FrameScanType Scan=kScan_Ignore, const QString &CodecName=QString()) override
Definition: mythplayerui.cpp:701
MythPlayer::ClearAfterSeek
void ClearAfterSeek(bool clearvideobuffers=true)
This is to support seeking...
Definition: mythplayer.cpp:1656
Jitterometer::GetLastSD
float GetLastSD(void) const
Definition: jitterometer.h:54
kOSDTimeout_Short
@ kOSDTimeout_Short
Definition: osd.h:60
FrameRate
Definition: recorderbase.h:37
FFREW_MULTICOUNT
#define FFREW_MULTICOUNT
ProgramInfo::QueryTranscodeStatus
TranscodingStatus QueryTranscodeStatus(void) const
Returns the "transcoded" field in "recorded" table.
Definition: programinfo.cpp:3124
MythVideoScanTracker::GetScanForDisplay
FrameScanType GetScanForDisplay(MythVideoFrame *Frame, bool &SecondField)
Definition: mythvideoscantracker.cpp:67
MythVideoScanTracker::SetScanType
void SetScanType(FrameScanType Scan, MythVideoOutput *VideoOutput, int FrameInterval)
Definition: mythvideoscantracker.cpp:122
MythPlayer::SetBuffering
void SetBuffering(bool new_buffering)
Definition: mythplayer.cpp:702
DeleteMap::LoadMap
void LoadMap(const QString &undoMessage="")
Loads the delete map from the database.
Definition: deletemap.cpp:737
ACTION_SELECT
#define ACTION_SELECT
Definition: mythuiactions.h:15
MythPlayer::m_totalFrames
uint64_t m_totalFrames
Definition: mythplayer.h:428
MythPlayer::ResetPlaying
virtual void ResetPlaying(bool resetframes=true)
Definition: mythplayer.cpp:910
MythPlayer::m_videoFrameRate
double m_videoFrameRate
Video (input) Frame Rate (often inaccurate)
Definition: mythplayer.h:438
DecoderBase::GetRawEncodingType
virtual QString GetRawEncodingType(void)
Definition: decoderbase.h:207
MythVideoOutput::GetFramesPlayed
virtual long long GetFramesPlayed()
Definition: mythvideoout.cpp:285
kMythBufferMHEG
@ kMythBufferMHEG
Definition: mythmediabuffer.h:46
MythPlayerOverlayUI::m_reinitOsd
bool m_reinitOsd
Definition: mythplayeroverlayui.h:47
MythPlayer::m_playerCtx
PlayerContext * m_playerCtx
Definition: mythplayer.h:369
MythPlayerUI::RenderVideoFrame
void RenderVideoFrame(MythVideoFrame *Frame, FrameScanType Scan, bool Prepare, int64_t Wait)
Definition: mythplayerui.cpp:515
DecoderBase::GetFPS
virtual double GetFPS(void) const
Definition: decoderbase.h:197
MythPlayer::m_videoDispDim
QSize m_videoDispDim
Video (input) width & height.
Definition: mythplayer.h:441
MythPlayerUI::DisplayPauseFrame
virtual void DisplayPauseFrame()
Definition: mythplayerui.cpp:630
DecoderBase::SetReadAdjust
void SetReadAdjust(long long adjust)
Definition: decoderbase.cpp:888
MythPlayerCaptionsUI::SetCaptionsEnabled
void SetCaptionsEnabled(bool Enable, bool UpdateOSD=true)
Definition: mythplayercaptionsui.cpp:307
MythPlayerUI::JumpToProgram
void JumpToProgram()
Definition: mythplayerui.cpp:1100
AvFormatDecoder
A decoder for media files.
Definition: avformatdecoder.h:87
MythPlayer::m_disableForcedSubtitles
bool m_disableForcedSubtitles
Definition: mythplayer.h:469
MythPlayerCaptionsUI::SafeFPS
double SafeFPS()
Definition: mythplayercaptionsui.cpp:660
MythPlayer::m_keyframeDist
uint m_keyframeDist
Video (input) Number of frames between key frames (often inaccurate)
Definition: mythplayer.h:448
MythVideoBounds::ToggleAdjustFill
void ToggleAdjustFill(AdjustFillMode AdjustFillMode=kAdjustFill_Toggle)
Sets up letterboxing for various standard video frame and monitor dimensions, then calls MoveResize()...
Definition: mythvideobounds.cpp:565
MythPlayerUI::HasTemporaryMark
bool HasTemporaryMark()
Definition: mythplayerui.cpp:1237
DeleteMap::IsFileEditing
bool IsFileEditing(void)
Determines whether the file is currently in edit mode.
Definition: deletemap.cpp:246
DeleteMap::LoadCommBreakMap
void LoadCommBreakMap(frm_dir_map_t &map)
Loads the given commercial break map into the deleteMap.
Definition: deletemap.cpp:726
MythPlayerUI::EnableEdit
void EnableEdit()
Definition: mythplayerui.cpp:1267
MythPlayer::m_fpsMultiplier
int m_fpsMultiplier
used to detect changes
Definition: mythplayer.h:491
DeleteMap::HasRedo
bool HasRedo(void) const
Definition: deletemap.h:87
uint
unsigned int uint
Definition: compat.h:141
MythPlayer::m_endExitPrompt
int m_endExitPrompt
Definition: mythplayer.h:417
gCoreContext
MythCoreContext * gCoreContext
This global variable contains the MythCoreContext instance for the app.
Definition: mythcorecontext.cpp:60
MythPlayerOverlayUI::m_osd
OSD m_osd
Definition: mythplayeroverlayui.h:43
TVPlaybackState::InitialisePlayerState
void InitialisePlayerState()
InteractiveTV::StreamStarted
bool StreamStarted(bool bStarted=true)
Definition: interactivetv.cpp:82
MythPlayer::UnpauseDecoder
void UnpauseDecoder(void)
Definition: mythplayer.cpp:983
MythPlayerAVSync::GetAVSyncData
void GetAVSyncData(InfoMap &Map) const
Definition: mythplayeravsync.cpp:70
interactivescreen.h
MythPlayer::GetAllowForcedSubtitles
bool GetAllowForcedSubtitles(void) const
Definition: mythplayer.h:209
CommBreakMap::GetSkipCommercials
int GetSkipCommercials(void) const
Definition: commbreakmap.h:29
MythPlayer::m_deleteMap
DeleteMap m_deleteMap
Definition: mythplayer.h:483
PlayerContext::m_tvchain
LiveTVChain * m_tvchain
Definition: playercontext.h:114
MythMediaOverlay::SetPlayer
void SetPlayer(MythPlayerUI *Player)
Definition: mythmediaoverlay.cpp:40
MythPlayer::DoFastForward
bool DoFastForward(uint64_t frames, double inaccuracy)
Definition: mythplayer.cpp:1562
MythPlayer::m_playerThread
QThread * m_playerThread
Definition: mythplayer.h:371
MythPlayerUI::DeleteMapGetUndoMessage
QString DeleteMapGetUndoMessage()
Definition: mythplayerui.cpp:1257
OSD::Init
bool Init(QRect Rect, float FontAspect) override
Definition: osd.cpp:50
MythPlayer::ReinitVideo
virtual void ReinitVideo(bool ForceUpdate)
Definition: mythplayer.cpp:300
MythMediaBuffer::IgnoreLiveEOF
void IgnoreLiveEOF(bool Ignore)
Tells RingBuffer whether to ignore the end-of-file.
Definition: mythmediabuffer.cpp:1811
MythPlayerAVSync::AVSync
int64_t AVSync(AudioPlayer *Audio, MythVideoFrame *Frame, int FrameInterval, float PlaySpeed, bool HaveVideo, bool Force)
Definition: mythplayeravsync.cpp:76
MythPlayerUI::m_editUpdateTimer
QElapsedTimer m_editUpdateTimer
Definition: mythplayerui.h:75
MythPlayer::DoJumpToFrame
void DoJumpToFrame(uint64_t frame, double inaccuracy)
Definition: mythplayer.cpp:1587
MythPlayer::SetVideoParams
virtual void SetVideoParams(int w, int h, double fps, float aspect, bool ForceUpdate, int ReferenceFrames, FrameScanType=kScan_Ignore, const QString &codecName=QString())
Definition: mythplayer.cpp:327
MythPlayerCaptionsUI::ResetCaptions
void ResetCaptions()
Definition: mythplayercaptionsui.cpp:121
DecoderBase::SetProgramInfo
void SetProgramInfo(const ProgramInfo &pginfo)
Definition: decoderbase.cpp:36
MythVideoOutput::StartDisplayingFrame
virtual void StartDisplayingFrame()
Tell GetLastShownFrame() to return the next frame from the head of the queue of frames to display.
Definition: mythvideoout.cpp:450
MythVideoOutput::IsErrored
bool IsErrored() const
Definition: mythvideoout.cpp:290
CommBreakMap::GetAutoCommercialSkip
CommSkipMode GetAutoCommercialSkip(void) const
Definition: commbreakmap.cpp:22
MythPlayerCaptionsUI::DoEnableForcedSubtitles
void DoEnableForcedSubtitles()
Definition: mythplayercaptionsui.cpp:400
MythPlayer::m_jumpChapter
int m_jumpChapter
Definition: mythplayer.h:412
MythPlayer::InitFrameInterval
virtual void InitFrameInterval()
Definition: mythplayer.cpp:696
MythPlayer::m_enableCaptions
bool m_enableCaptions
Definition: mythplayer.h:466
DeleteMap::IsSaved
bool IsSaved(void) const
Compares the current cut list with the saved cut list.
Definition: deletemap.cpp:872
kState_WatchingPreRecorded
@ kState_WatchingPreRecorded
Watching Pre-recorded is a TV only state for when we are watching a pre-existing recording.
Definition: tv.h:67
MythMediaOverlay::Init
virtual bool Init(QRect Rect, float FontAspect)
Definition: mythmediaoverlay.cpp:62
ACTION_SAVEMAP
#define ACTION_SAVEMAP
Definition: tv_actions.h:88
MythPlayerAVSync::InitAVSync
void InitAVSync()
Definition: mythplayeravsync.cpp:17
LiveTVChain::GetInputType
QString GetInputType(int pos=-1) const
Definition: livetvchain.cpp:696
MythPlayer::CalcMaxFFTime
virtual long long CalcMaxFFTime(long long ff, bool setjump=true) const
CalcMaxFFTime(ffframes): forward ffframes forward.
Definition: mythplayer.cpp:1428
ProgramInfo::GetChanID
uint GetChanID(void) const
This is the unique key used in the database to locate tuning information.
Definition: programinfo.h:370
MythPlayerUI::FileChanged
void FileChanged()
Definition: mythplayerui.cpp:535
AudioPlayer::GetAudioOutput
AudioOutput * GetAudioOutput(void) const
Return internal AudioOutput object.
Definition: audioplayer.h:104
livetvchain.h
kVideoIsNull
@ kVideoIsNull
Definition: mythplayer.h:70
MythVideoOutput::RenderFrame
virtual void RenderFrame(MythVideoFrame *Frame, FrameScanType)=0
DecoderBase::UpdateFramesPlayed
virtual void UpdateFramesPlayed(void)
Definition: decoderbase.cpp:870
MythVideoScanTracker::InitialiseScan
void InitialiseScan(MythVideoOutput *VideoOutput)
Definition: mythvideoscantracker.cpp:16
MythPlayerCaptionsUI::LoadExternalSubtitles
void LoadExternalSubtitles()
Definition: mythplayercaptionsui.cpp:68
VERBOSE_LEVEL_CHECK
#define VERBOSE_LEVEL_CHECK(_MASK_, _LEVEL_)
Definition: mythlogging.h:14
ProgramInfo
Holds information on recordings and videos.
Definition: programinfo.h:68
MythPlayerUI::InitialSeek
virtual void InitialSeek()
Definition: mythplayerui.cpp:98
kEofStateImmediate
@ kEofStateImmediate
Definition: decoderbase.h:71
AudioPlayer::GetCodec
AVCodecID GetCodec(void) const
Definition: audioplayer.h:60
MythPlayerVisualiserUI::InitialiseState
void InitialiseState() override
Set initial state and update player.
Definition: mythplayervisualiserui.cpp:31
MythPlayer::IsReallyNearEnd
bool IsReallyNearEnd(void) const
Returns true iff really near end of recording.
Definition: mythplayer.cpp:1502
MythPlayerVideoUI::CheckAspectRatio
void CheckAspectRatio(MythVideoFrame *Frame)
Definition: mythplayervideoui.cpp:181
MythPlayer::IsWatchingInprogress
bool IsWatchingInprogress(void) const
Definition: mythplayer.cpp:133
DeleteMap::Delete
void Delete(uint64_t frame, const QString &undoMessage)
Remove the mark at the given frame.
Definition: deletemap.cpp:361
kEofStateDelayed
@ kEofStateDelayed
Definition: decoderbase.h:70
SendMythSystemPlayEvent
void SendMythSystemPlayEvent(const QString &msg, const ProgramInfo *pginfo)
Definition: mythsystemevent.cpp:360
MythPlayer::m_fileChanged
bool m_fileChanged
Definition: mythplayer.h:494
kScan_Interlaced
@ kScan_Interlaced
Definition: videoouttypes.h:98
LiveTVChain::NeedsToSwitch
bool NeedsToSwitch(void) const
Returns true iff a switch is required but no jump is required m_jumppos sets to INT_MAX means not set...
Definition: livetvchain.h:65
Clear
#define Clear(a)
Definition: audiooutputopensles.cpp:47
Jitterometer::RecordCycleTime
bool RecordCycleTime()
Definition: jitterometer.cpp:71
AudioPlayer::GetSampleRate
int GetSampleRate(void) const
Definition: audioplayer.h:62
CommBreakMap::AutoCommercialSkip
bool AutoCommercialSkip(uint64_t &jumpToFrame, uint64_t framesPlayed, double video_frame_rate, uint64_t totalFrames, QString &comm_msg)
Definition: commbreakmap.cpp:145
ProgramInfo::SetIgnoreBookmark
void SetIgnoreBookmark(bool ignore)
If "ignore" is true GetBookmark() will return 0, otherwise GetBookmark() will return the bookmark pos...
Definition: programinfo.h:549
avformatdecoder.h
AdjustFillMode
AdjustFillMode
Definition: videoouttypes.h:72
setpriority
#define setpriority(x, y, z)
Definition: compat.h:205
TC_AUDIO
@ TC_AUDIO
Definition: mythplayer.h:54
ProgramInfo::GetPlaybackURL
QString GetPlaybackURL(bool checkMaster=false, bool forceCheckLocal=false)
Returns filename or URL to be used to play back this recording.
Definition: programinfo.cpp:2443
MythDisplay::GetRefreshInterval
int GetRefreshInterval(int Fallback) const
Definition: mythdisplay.cpp:730
MythVideoScanTracker::CheckScanUpdate
void CheckScanUpdate(MythVideoOutput *VideoOutput, int FrameInterval)
Definition: mythvideoscantracker.cpp:111
MythCaptionsOverlay::GetWindow
MythScreenType * GetWindow(const QString &Window) override
Definition: mythcaptionsoverlay.cpp:57
MythPlayer::m_disableCaptions
bool m_disableCaptions
Definition: mythplayer.h:467
MythPlayerVideoUI::ReinitOSD
void ReinitOSD()
Definition: mythplayervideoui.cpp:140
MythPlayer::kInaccuracyEditor
static const double kInaccuracyEditor
Definition: mythplayer.h:246
MythPlayer::m_decodeOneFrame
bool m_decodeOneFrame
Definition: mythplayer.h:392
MythPlayer::SetPlaying
void SetPlaying(bool is_playing)
Definition: mythplayer.cpp:248
audiooutput.h
MythPlayerCaptionsUI::m_interactiveTV
InteractiveTV * m_interactiveTV
Definition: mythplayercaptionsui.h:75
MythPlayerUI::GetNearestMark
uint64_t GetNearestMark(uint64_t Frame, bool Right)
Definition: mythplayerui.cpp:1227
MythPlayerUIBase::m_tv
TV * m_tv
Definition: mythplayeruibase.h:15
MythPlayerCaptionsUI::DoDisableForcedSubtitles
void DoDisableForcedSubtitles()
Definition: mythplayercaptionsui.cpp:392
LiveTVChain::toString
QString toString() const
Definition: livetvchain.cpp:739
MythPlayerVisualiserUI::AutoVisualise
void AutoVisualise(bool HaveVideo)
Enable visualisation if possible, there is no video and user has requested.
Definition: mythplayervisualiserui.cpp:104
ProgramInfo::SaveWatched
void SaveWatched(bool watchedFlag)
Set "watched" field in recorded/videometadata to "watchedFlag".
Definition: programinfo.cpp:2878
MythVideoScanTracker::GetDeinterlacerName
QString GetDeinterlacerName()
Definition: mythvideoscantracker.cpp:117
OSD::DialogQuit
void DialogQuit()
Definition: osd.cpp:704
OSD_WIN_DEBUG
#define OSD_WIN_DEBUG
Definition: osd.h:34
MythMediaBuffer::GetAvailableBuffer
QString GetAvailableBuffer(void)
Definition: mythmediabuffer.cpp:1536
StreamInfo::m_forced
bool m_forced
Definition: decoderbase.h:103
OSD_WIN_MESSAGE
#define OSD_WIN_MESSAGE
Definition: osd.h:30
MythPlayer::SetFrameInterval
void SetFrameInterval(FrameScanType scan, double frame_period)
Definition: mythplayer.cpp:686
OSD::HideWindow
void HideWindow(const QString &Window) override
Definition: osd.cpp:659
MythMediaBuffer::kLiveTVOpenTimeout
static const int kLiveTVOpenTimeout
Definition: mythmediabuffer.h:62
MythInteractiveBuffer
Definition: mythinteractivebuffer.h:10
PlayerContext
Definition: playercontext.h:49
MythPlayer::m_isDummy
bool m_isDummy
Definition: mythplayer.h:503
MythPlayer::m_videoDim
QSize m_videoDim
Video (input) buffer width & height.
Definition: mythplayer.h:442
DeleteMap::HasTemporaryMark
bool HasTemporaryMark(void) const
Returns true if a temporary placeholder mark is defined.
Definition: deletemap.cpp:642
build_compdb.action
action
Definition: build_compdb.py:9
ACTION_LEFT
#define ACTION_LEFT
Definition: mythuiactions.h:18
AudioPlayer::GetStretchFactor
float GetStretchFactor(void) const
Definition: audioplayer.h:66
MythPlayerUI::InitFrameInterval
void InitFrameInterval() override
Definition: mythplayerui.cpp:506
MythPlayerUI::SetWatched
void SetWatched(bool ForceWatched=false)
Determines if the recording should be considered watched.
Definition: mythplayerui.cpp:743
MythPlayerUI::DoDisplayVideoFrame
void DoDisplayVideoFrame(MythVideoFrame *Frame, int64_t Due)
Definition: mythplayerui.cpp:584
LiveTVChain::SetProgram
void SetProgram(const ProgramInfo &pginfo)
Definition: livetvchain.cpp:392
MythPlayerUI::m_osdDebug
bool m_osdDebug
Definition: mythplayerui.h:86
interactivetv.h
kTrackTypeRawText
@ kTrackTypeRawText
Definition: decoderbase.h:36
MythPlayer::m_videoAspect
float m_videoAspect
Video (input) Apect Ratio.
Definition: mythplayer.h:444
MythPlayerUI::RefreshPauseFrame
void RefreshPauseFrame()
Definition: mythplayerui.cpp:561
ACTION_BIGJUMPFWD
#define ACTION_BIGJUMPFWD
Definition: tv_actions.h:93
MythPlayer::kInaccuracyFull
static const double kInaccuracyFull
Definition: mythplayer.h:247
hardwareprofile.distros.mythtv_data.makeopts.verbose
verbose
Definition: makeopts.py:60
MythPlayer::m_allPaused
bool m_allPaused
Definition: mythplayer.h:396
ProgramInfo::SetIgnoreProgStart
void SetIgnoreProgStart(bool ignore)
If "ignore" is true QueryProgStart() will return 0, otherwise QueryProgStart() will return the progst...
Definition: programinfo.h:556
MythPlayerUI::ChangeSpeed
void ChangeSpeed() override
Definition: mythplayerui.cpp:389
LiveTVChain::GetJumpPos
int GetJumpPos(void)
Returns the jump position in seconds and clears it.
Definition: livetvchain.cpp:673
MythPlayerCaptionsUI::m_captionsState
MythCaptionsState m_captionsState
Definition: mythplayercaptionsui.h:71
MythCaptionsOverlay::Draw
void Draw(QRect Rect)
Definition: mythcaptionsoverlay.cpp:29
Jitterometer::GetLastCPUStats
QString GetLastCPUStats(void) const
Definition: jitterometer.h:55
MythPlayerUI::JumpToStream
void JumpToStream(const QString &stream)
Definition: mythplayerui.cpp:918
DeleteMap::HasUndo
bool HasUndo(void) const
Definition: deletemap.h:86
PRIO_PROCESS
#define PRIO_PROCESS
Definition: compat.h:204
kCommSkipOff
@ kCommSkipOff
Definition: tv.h:132
MythVideoScanTracker
Definition: mythvideoscantracker.h:13
MythPlayerUI::UpdateOSDDebug
void UpdateOSDDebug()
Definition: mythplayerui.cpp:881
MythVideoFrame
Definition: mythframe.h:83
MythVideoScanTracker::ResetTracker
void ResetTracker()
Definition: mythvideoscantracker.cpp:39
MythPlayer::OpenDummy
void OpenDummy(void)
Definition: mythplayer.cpp:398
MythPlayerUI::ChangeOSDDebug
void ChangeOSDDebug()
Definition: mythplayerui.cpp:891
round
#define round(x)
Definition: mythplayer.cpp:59
DeleteMap::IsTemporaryMark
bool IsTemporaryMark(uint64_t frame) const
Returns true if the given frame is a temporary/placeholder mark.
Definition: deletemap.cpp:595
MythVideoScanTracker::GetScanType
FrameScanType GetScanType() const
Definition: mythvideoscantracker.cpp:99
MythVideoScanTracker::UnlockScan
void UnlockScan()
Definition: mythvideoscantracker.cpp:33
MythPlayerVideoUI::ProcessCallbacks
void ProcessCallbacks()
Definition: mythplayervideoui.cpp:111
ProgramInfo::IsRecording
bool IsRecording(void) const
Definition: programinfo.h:483
MythVideoOutput::GetLastShownFrame
virtual MythVideoFrame * GetLastShownFrame()
Returns frame from the head of the ready to be displayed queue, if StartDisplayingFrame has been call...
Definition: mythvideoout.cpp:351
TVPlaybackState::ChangeOSDDebug
void ChangeOSDDebug()
MythVideoOutput::RenderEnd
virtual void RenderEnd()=0
CommBreakMap::HasMap
bool HasMap(void) const
Definition: commbreakmap.h:24
MythPlayerUI::CanSupportDoubleRate
bool CanSupportDoubleRate()
Definition: mythplayerui.cpp:797
mythmainwindow.h
DeleteMap::GetSeekAmount
float GetSeekAmount(void) const
Definition: deletemap.h:33
FlagIsSet
#define FlagIsSet(arg)
Definition: mythplayer.h:76
MythMediaBuffer::GetStorageRate
QString GetStorageRate(void)
Definition: mythmediabuffer.cpp:1531
is_interlaced
bool is_interlaced(FrameScanType Scan)
Definition: videoouttypes.h:188
DeleteMap::HandleAction
bool HandleAction(const QString &action, uint64_t frame)
Definition: deletemap.cpp:86
MythPlayerUI::DeleteMapGetRedoMessage
QString DeleteMapGetRedoMessage()
Definition: mythplayerui.cpp:1262
MythPlayer::DoRewind
bool DoRewind(uint64_t frames, double inaccuracy)
Definition: mythplayer.cpp:1382
kOSDTimeout_Med
@ kOSDTimeout_Med
Definition: osd.h:61
MythPlayerUI::EventLoop
virtual void EventLoop()
Definition: mythplayerui.cpp:109
MythPlayer::kInaccuracyDefault
static const double kInaccuracyDefault
Definition: mythplayer.h:245
MythPlayerUI::StartPlaying
bool StartPlaying()
Definition: mythplayerui.cpp:60
DeleteMap::UpdateOSD
void UpdateOSD(uint64_t frame, double frame_rate, OSD *osd)
Show and update the edit mode On Screen Display.
Definition: deletemap.cpp:177
MythPlayer::m_savedAudioTimecodeOffset
int64_t m_savedAudioTimecodeOffset
Definition: mythplayer.h:500
MythPlayerUI::DoRewindSecs
bool DoRewindSecs(float Seconds, double Inaccuracy, bool UseCutlist)
Definition: mythplayerui.cpp:722
MythPlayerVideoUI::InitVideo
bool InitVideo() override
Definition: mythplayervideoui.cpp:19
DeleteMap::IsEditing
bool IsEditing(void) const
Definition: deletemap.h:40
MythMainWindow
Definition: mythmainwindow.h:35
DeleteMap::UpdateSeekAmount
void UpdateSeekAmount(int change)
Definition: deletemap.cpp:137
MythPlayer::Play
bool Play(float speed=1.0, bool normal=true, bool unpauseaudio=true)
Definition: mythplayer.cpp:192
DeleteMap::GetRedoMessage
QString GetRedoMessage(void) const
Definition: deletemap.cpp:80
ProgramInfo::SetAllowLastPlayPos
void SetAllowLastPlayPos(bool allow)
If "ignore" is true QueryLastPlayPos() will return 0, otherwise QueryLastPlayPos() will return the la...
Definition: programinfo.h:564
kScan_Ignore
@ kScan_Ignore
Definition: videoouttypes.h:96
MythMediaBuffer::Reset
void Reset(bool Full=false, bool ToAdjust=false, bool ResetInternal=false)
Resets the read-ahead thread and our position in the file.
Definition: mythmediabuffer.cpp:239
MythPlayer::m_killDecoder
bool volatile m_killDecoder
Definition: mythplayer.h:391
CommBreakMap::SkipCommercials
void SkipCommercials(int direction)
Definition: commbreakmap.cpp:42
MythMediaBuffer::IsOpen
virtual bool IsOpen(void) const =0
MythMediaBuffer::GetType
MythBufferType GetType() const
Definition: mythmediabuffer.cpp:205
tv_play.h
MythPlayer::DecoderStart
virtual void DecoderStart(bool start_paused)
Definition: mythplayer.cpp:1010
MythVideoOutput::DoneDisplayingFrame
virtual void DoneDisplayingFrame(MythVideoFrame *Frame)
Releases frame returned from GetLastShownFrame() onto the queue of frames ready for decoding onto.
Definition: mythvideoout.cpp:457
MythPlayerUIBase::m_display
MythDisplay * m_display
Definition: mythplayeruibase.h:18
TV
Control TV playback.
Definition: tv_play.h:153
MythPlayerOverlayUI::m_osdLock
QMutex m_osdLock
Definition: mythplayeroverlayui.h:44