Go to the documentation of this file.
3 #undef HAVE_AV_CONFIG_H
15 #include <QCoreApplication>
20 #include <QtCore/qnumeric.h>
27 #include "libmythbase/mythconfig.h"
53 #include "libavcodec/avcodec.h"
58 #define LOC QString("Player(%1): ").arg(dbg_ident(this),0,36)
80 : m_playerCtx(Context),
83 m_cc608(this), m_cc708(this),
89 m_playerThreadId = gettid();
101 uint tmp = mypage.toInt(&valid, 16);
156 LOG(VB_PLAYBACK, LOG_INFO,
LOC +
"Waited 100ms to get pause lock.");
163 return already_paused;
182 return already_paused;
188 LOG(VB_PLAYBACK, LOG_INFO,
LOC +
189 QString(
"Play(%1, normal %2, unpause audio %3)")
190 .arg(speed,5,
'f',1).arg(normal).arg(unpauseaudio));
194 LOG(VB_GENERAL, LOG_ERR,
LOC +
"Ignoring Play(), in edit mode.");
254 if (wait_in_msec == 0ms)
260 while ((wait_for !=
m_playing) && (
t.elapsed() < wait_in_msec))
263 &
m_playingLock, std::max(0ms,wait_in_msec -
t.elapsed()).count());
276 LOG(VB_GENERAL, LOG_ERR,
LOC +
"Cannot create a video renderer without a decoder.");
285 LOG(VB_GENERAL, LOG_ERR,
LOC +
"Couldn't create VideoOutput instance. Exiting..");
286 SetErrored(tr(
"Failed to initialize video output"));
296 bool aspect_only =
false;
305 LOG(VB_GENERAL, LOG_ERR,
LOC +
"Failed to Reinitialize Video. Exiting..");
306 SetErrored(tr(
"Failed to reinitialize video output"));
321 float aspect,
bool ForceUpdate,
322 int ReferenceFrames,
FrameScanType ,
const QString& codecName)
324 bool paramsChanged = ForceUpdate;
326 if (width >= 0 && height >= 0)
328 paramsChanged =
true;
330 m_videoAspect = aspect > 0.0F ? aspect :
static_cast<float>(width) / height;
333 if (!qIsNaN(fps) && fps > 0.0 && fps < 121.0)
335 paramsChanged =
true;
350 if (!codecName.isEmpty())
353 paramsChanged =
true;
356 if (ReferenceFrames > 0)
359 paramsChanged =
true;
454 int testreadsize = 2048;
459 std::chrono::milliseconds
timeout =
460 std::max(500ms * (Retries + 1), 30000ms);
463 testbuf.resize(testreadsize);
472 LOG(VB_GENERAL, LOG_ERR,
LOC +
473 QString(
"OpenFile(): Could not read first %1 bytes of '%2'")
476 SetErrored(tr(
"Could not read first %1 bytes").arg(testreadsize));
479 LOG(VB_GENERAL, LOG_WARNING,
LOC +
"OpenFile() waiting on data");
480 std::this_thread::sleep_for(50ms);
494 LOG(VB_GENERAL, LOG_ERR,
LOC +
495 QString(
"Couldn't find an A/V decoder for: '%1'")
497 SetErrored(tr(
"Could not find an A/V decoder"));
504 LOG(VB_GENERAL, LOG_ERR,
LOC +
"Could not initialize A/V decoder.");
506 SetErrored(tr(
"Could not initialize A/V decoder"));
523 LOG(VB_GENERAL, LOG_ERR, QString(
"Couldn't open decoder for: %1")
600 std::chrono::milliseconds timecode,
609 LOG(VB_PLAYBACK, LOG_DEBUG,
LOC +
"Clearing decode one");
616 LOG(VB_PLAYBACK, LOG_DEBUG,
LOC +
"Setting render one");
655 LOG(VB_PLAYBACK, LOG_DEBUG,
LOC +
"Clearing render one");
694 LOG(VB_PLAYBACK, LOG_INFO,
LOC + QString(
"SetFrameInterval Interval:%1 Speed:%2 Scan:%3 (Multiplier: %4)")
708 LOG(VB_PLAYBACK, LOG_INFO,
LOC +
"Waiting for video buffers...");
756 if (framesLeft < margin)
760 LOG(VB_PLAYBACK, LOG_NOTICE,
LOC +
"Pause to allow live tv catch up");
761 LOG(VB_PLAYBACK, LOG_NOTICE,
LOC + QString(
"Played: %1 Avail: %2 Buffered: %3 Margin: %4")
769 auto waited_for = std::chrono::milliseconds(
m_bufferingStart.msecsTo(QTime::currentTime()));
770 auto last_msg = std::chrono::milliseconds(
m_bufferingLastMsg.msecsTo(QTime::currentTime()));
774 LOG(VB_GENERAL, LOG_NOTICE,
LOC +
775 "To see more buffering messages use -v playback");
778 LOG(VB_PLAYBACK, LOG_NOTICE,
LOC +
779 QString(
"Waited %1ms for video buffers %2")
784 LOG(VB_GENERAL, LOG_NOTICE,
LOC +
785 QString(
"Waited %1ms for video buffers %2")
793 LOG(VB_GENERAL, LOG_NOTICE,
LOC +
"Music Choice program detected - disabling AV Sync.");
801 LOG(VB_GENERAL, LOG_NOTICE,
LOC +
"Resetting audio buffer");
809 std::chrono::milliseconds msecs { 500ms };
814 LOG(VB_GENERAL, LOG_NOTICE,
LOC +
815 "Timed out waiting for frames, and"
816 "\n\t\t\tthere are not enough free frames. "
817 "Discarding buffered frames.");
825 if (waited_for > msecs)
827 LOG(VB_GENERAL, LOG_ERR,
LOC +
828 "Waited too long for decoder to fill video buffers. Exiting..");
829 SetErrored(tr(
"Video frame buffering failed too many times."));
952 LOG(VB_PLAYBACK, LOG_INFO,
LOC +
"FileChangedCallback");
958 LOG(VB_PLAYBACK, LOG_INFO,
LOC + QString(
"StopPlaying - begin"));
969 LOG(VB_PLAYBACK, LOG_INFO,
LOC + QString(
"StopPlaying - end"));
994 LOG(VB_GENERAL, LOG_WARNING,
LOC +
"Waited 100ms for decoder to pause");
1021 LOG(VB_GENERAL, LOG_WARNING,
LOC +
"Waited 100ms for decoder to unpause");
1034 LOG(VB_GENERAL, LOG_ERR,
LOC +
"Decoder thread already running");
1057 LOG(VB_PLAYBACK, LOG_INFO,
LOC +
1058 "Waited 100ms for decoder loop to stop");
1061 LOG(VB_GENERAL, LOG_ERR,
LOC +
"Failed to stop decoder loop.");
1063 LOG(VB_PLAYBACK, LOG_INFO,
LOC +
"Exited decoder loop.");
1121 std::this_thread::sleep_for(1ms);
1159 std::this_thread::sleep_for(1ms);
1195 LOG(VB_PLAYBACK, LOG_INFO,
LOC +
1196 QString(
"skip %1, adjust %2, ratio %3")
1213 long long target_frame = cur_frame + real_skip;
1219 LOG(VB_PLAYBACK, LOG_INFO,
LOC +
1220 QString(
"skip %1, adjust, %2, ratio %3")
1233 LOG(VB_PLAYBACK, LOG_DEBUG,
"Setting decode one");
1254 LOG(VB_GENERAL, LOG_ERR,
LOC +
1255 "Decoder timed out waiting for free video buffers.");
1258 SetErrored(
"Decoder timed out waiting for free video buffers.");
1262 std::this_thread::sleep_for(1ms);
1306 std::this_thread::sleep_for(1ms);
1326 uint64_t bookmark = 0;
1335 bookmark = pi->QueryStartMark();
1344 bool skip_changed =
false;
1356 LOG(VB_PLAYBACK, LOG_DEBUG,
LOC +
"Clearing render one");
1360 skip_changed =
true;
1373 LOG(VB_PLAYBACK, LOG_INFO,
LOC +
1374 QString(
"new skip %1, interval %2, scale %3")
1379 return skip_changed;
1398 LOG(VB_PLAYBACK, LOG_INFO,
LOC +
"Play speed: " +
1399 QString(
"rate: %1 speed: %2 skip: %3 => new interval %4")
1418 uint64_t number = frames + 1;
1425 uint64_t seeksnap_wanted = UINT64_MAX;
1427 seeksnap_wanted = frames * inaccuracy;
1461 float maxtime = 1.0;
1468 long long ret = ffframes;
1489 if ((ff + secsPlayed) > secsWritten)
1498 float behind = secsWritten - secsPlayed;
1500 if (behind < maxtime)
1502 else if (behind - ff <= maxtime)
1508 if (behind < maxtime * 3)
1513 uint64_t lastFrame =
1520 float secsMax = secsWritten - 2.F * maxtime;
1523 else if (secsMax < secsPlayed + ff)
1569 uint64_t framesLeft = 0;
1576 framesLeft = (frameCount > framesRead) ? frameCount - framesRead : 0;
1577 return (framesLeft < (uint64_t)margin);
1592 if (framesLeft < (uint64_t)margin)
1596 return (framesLeft < (uint64_t)margin);
1604 uint64_t number = (frames ? frames - 1 : 0);
1610 if (desiredFrame > endcheck)
1611 desiredFrame = endcheck;
1614 uint64_t seeksnap_wanted = UINT64_MAX;
1616 seeksnap_wanted = frames * inaccuracy;
1655 bool needclear =
false;
1666 std::this_thread::sleep_for(50ms);
1694 LOG(VB_PLAYBACK, LOG_INFO,
LOC + QString(
"ClearAfterSeek(%1)")
1695 .arg(clearvideobuffers));
1772 std::chrono::milliseconds position_ms = 0ms;
1773 auto offset_ms = std::chrono::milliseconds(llroundf(fabsf(offset) * 1000));
1775 if (signbit(offset))
1789 position_ms = (offset_ms > length_ms) ? 0ms : length_ms - offset_ms;
1793 position_ms = offset_ms;
1794 if (offset_ms > length_ms)
1798 (length_ms < offset_ms))
1800 long long framesWritten =
1806 position_ms = std::min(position_ms, length_ms);
1816 bool use_cutlist)
const
1819 if (position == UINT64_MAX &&
1823 if (recorderFrameRate > 0)
1824 frameRate = recorderFrameRate;
1853 int64_t desiredFrame = -1;
1857 if (chapter < 0 || chapter > total)
1863 if (chapter < 0) chapter = 0;
1865 else if (chapter > total)
1868 if (chapter > total) chapter = total;
1873 LOG(VB_PLAYBACK, LOG_INFO,
LOC +
1874 QString(
"DoJumpChapter: current %1 want %2 (frame %3)")
1875 .arg(
current).arg(chapter).arg(desiredFrame));
1877 if (desiredFrame < 0)
1879 LOG(VB_PLAYBACK, LOG_ERR,
LOC + QString(
"DoJumpChapter failed."));
1906 LOG(VB_GENERAL, LOG_INFO,
LOC +
"Waited 10ms for decoder lock");
1932 LOG(VB_PLAYBACK, LOG_INFO,
LOC +
1933 QString(
"Filling position map from %1 to %2") .arg(start).arg(
"end"));
1954 LOG(VB_GENERAL, LOG_ERR,
LOC + QString(
"%1").arg(reason));
2007 LOG(VB_PLAYBACK, LOG_INFO,
LOC +
2008 QString(
"Stretch Factor %1, %2 passthru ")
2029 static QMutex s_dbgLock;
2030 static unsigned s_dbgNextIdent = 0;
2031 using DbgMapType = QHash<const MythPlayer*, unsigned>;
2032 static DbgMapType s_dbgIdent;
2034 QMutexLocker locker(&s_dbgLock);
2035 DbgMapType::iterator it = s_dbgIdent.find(player);
2036 if (it != s_dbgIdent.end())
2038 return s_dbgIdent[player] = s_dbgNextIdent++;
bool IsNearEnd(void)
Returns true iff near end of recording.
void SetPlayerContext(PlayerContext *ctx)
virtual int GetCurrentChapter(long long)
virtual bool DoFastForward(long long desiredFrame, bool discardFrames=true)
Skips ahead or rewinds to desiredFrame.
std::enable_if_t< std::is_floating_point_v< T >, std::chrono::seconds > secondsFromFloat(T value)
Helper function for convert a floating point number to a duration.
std::chrono::milliseconds elapsed(void)
Returns milliseconds elapsed since last start() or restart()
static unsigned dbg_ident(const MythPlayer *)
TVState GetState(void) const
bool m_enableForcedSubtitles
int GetCurPos(void) const
void start(QThread::Priority p=QThread::InheritPriority)
Tell MThread to start running the thread in the near future.
const int kDecoderProbeBufferSize
QRecursiveMutex m_decoderChangeLock
virtual bool InputChanged(QSize VideoDim, QSize VideoDispDim, float VideoAspect, MythCodecID CodecID, bool &AspectChanged, int ReferenceFrames, bool ForceChange)
Tells video output to discard decoded frames and wait for new ones.
long long GetFramesPlayed(void) const
void SetFileLength(std::chrono::seconds total, int frames)
void UnlockPlayingInfo(const char *file, int line) const
static MythVideoOutputNull * Create(QSize VideoDim, QSize VideoDispDim, float VideoAspect, MythCodecID CodecID)
void JumpToNext(bool up, std::chrono::seconds pos)
jump to the next (up == true) or previous (up == false) liveTV program If pos > 0: indicate the absol...
int GetRecorderNumber(void) const
void SetEof(EofState eof)
bool m_inJumpToProgramPause
CommBreakMap m_commBreakMap
virtual void ChangeSpeed(void)
MythDecoderThread * m_decoderThread
void TrackerReset(uint64_t frame)
Resets the internal state tracker.
void SetPlayingInfo(const ProgramInfo *info)
assign programinfo to the context
A QElapsedTimer based timer to replace use of QTime as a timer.
static const int kNightModeContrastAdjustment
int m_ffrewAdjust
offset after last skip
QWaitCondition m_decoderThreadUnpause
void SeekingSlow(int Count)
MythPlayerAVSync m_avSync
virtual void DecoderPauseCheck(void)
int FreeVideoFrames()
Returns number of frames available for decoding onto.
std::chrono::microseconds m_frameInterval
always adjusted for play_speed
void FillDurationMap(int64_t start, int64_t end, frm_pos_map_t &durationMap)
VideoErrorState GetError() const
bool wait(std::chrono::milliseconds time=std::chrono::milliseconds::max())
Wait for the MThread to exit, with a maximum timeout.
static float ffrewSkipThresh
virtual int OpenFile(int Retries=4)
std::chrono::milliseconds TranslatePositionFrameToMs(uint64_t position, float fallback_framerate, bool use_cutlist) const
static bool SetStartChannel(uint inputid, const QString &channum)
virtual bool PrebufferEnoughFrames(int min_buffers=0)
std::chrono::seconds m_totalDuration
void SetTracker(uint64_t framesPlayed)
virtual bool PrepareAudioSample(std::chrono::milliseconds &timecode)
int m_videobufRetries
How often we have tried to wait for a video output buffer and failed.
bool IsPaused(void) const
QString GetChanNum(void) const
This is the channel "number", in the form 1, 1_2, 1-2, 1#1, etc.
bool m_forcePositionMapSync
static constexpr T chronomult(T duration, double f)
Multiply a duration by a float, returning a duration.
virtual bool HasReachedEof(void) const
virtual void AudioEnd(void)
bool IsDatabaseIgnored(void) const
/brief Returns true if database is being ignored.
static float ffrewScaleAdjust
std::enable_if_t< std::is_floating_point_v< T >, std::chrono::microseconds > microsecondsFromFloat(T value)
Helper function for convert a floating point number to a duration.
QString GetChannelSchedulingID(void) const
This is the unique programming identifier of a channel.
void SetStretchFactor(float factor)
QMap< uint64_t, MarkTypes > frm_dir_map_t
Frame # -> Mark map.
void syncWithAudioStretch()
QString m_errorMsg
Reason why NVP exited with a error.
bool IsBufferAlmostFull(void)
void SaveTotalFrames(void)
bool IsErrored(void) const
long long GetFramesWritten(void)
Returns number of frames written to disk by TVRec's RecorderBase instance.
void SetTTPageNum(int page)
float GetFrameRate(void) const
void start(void)
starts measuring elapsed time.
#define LOG(_MASK_, _LEVEL_, _QSTRING_)
uint64_t GetCurrentFrameCount(void) const
bool IsPlaying(std::chrono::milliseconds wait_in_msec=0ms, bool wait_for=true) const
bool HasAudioOut(void) const
static uint Parse(const QString &vbiformat)
bool is_current_thread(MThread *thread)
Use this to determine if you are in the named thread.
virtual void SetFramesPlayed(long long FramesPlayed)
long long CalcRWTime(long long rw) const
CalcRWTime(rw): rewind rw frames back.
EofState GetEof(void) const
bool IsValidRecorder(void) const
static float ffrewScaleHighest
virtual uint64_t GetBookmark(void)
virtual MythCodecID GetVideoCodecID(void) const =0
void SetMap(const frm_dir_map_t &newMap, uint64_t framesPlayed)
def scan(profile, smoonURL, gate)
QDateTime current(bool stripped)
Returns current Date and Time in UTC.
void SetErrored(const QString &reason)
QString GetEncodingType(void) const
void DiscardVideoFrames(bool KeyFrame, bool Flushed)
Places frames in the available frames queue.
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 ...
void SetDecoder(DecoderBase *dec)
Sets the stream decoder, deleting any existing recorder.
static const double kInaccuracyNone
void SetPrebuffering(bool Normal)
Sets whether to use a normal number of buffers or fewer buffers.
bool ResetAVSyncForLiveTV(AudioPlayer *Audio)
virtual long long GetChapter(int)
bool HasTVChainNext(void) const
bool GetRawAudioState(void) const
virtual void GetChapterTimes(QList< std::chrono::seconds > &)
void PauseChanged(bool Paused)
void SaveTotalDuration(void)
float ComputeSecs(uint64_t position, bool use_cutlist) const
long long GetCachedFramesWritten(void) const
Return value last returned by GetFramesWritten().
virtual void ForceSetupAudioStream(void)
static const int kNightModeBrightenssAdjustment
virtual int64_t GetChapter(int chapter)
#define codec_is_mediacodec(id)
virtual int ValidVideoFrames() const
Returns number of frames that are fully decoded.
long long m_ffTime
If m_ffTime>0, number of frames to seek forward.
ProgramInfo * m_playingInfo
Currently playing info.
bool DecoderGetFrame(DecodeType decodetype, bool unsafe=false)
void SetPlayingInfo(const ProgramInfo &pginfo)
virtual void ClearAfterSeek()
Tells video output to toss decoded buffers due to a seek.
bool m_captionsEnabledbyDefault
This allows us to enable captions/subtitles later if the streams are not immediately available when t...
virtual void DeLimboFrame(MythVideoFrame *Frame)
Releases a frame for reuse if it is in limbo.
float GetFrameRate(void)
Returns recordering frame rate set by nvr.
void LockPlayingInfo(const char *file, int line) const
uint64_t FindFrame(float offset, bool use_cutlist) const
std::chrono::milliseconds m_timecode
int GetfpsMultiplier(void) const
virtual bool DoJumpChapter(int chapter)
QString GetFrameStatus() const
Returns string with status of each frame for debugging.
void SetDuration(std::chrono::seconds duration)
MythVideoOutput * m_videoOutput
bool m_hasFullPositionMap
bool IsInDelete(uint64_t frame)
MythMediaBuffer * m_buffer
friend class MythDecoderThread
MythPlayer(PlayerContext *Context, PlayerFlags Flags=kNoFlags)
QString ScanTypeToString(FrameScanType Scan)
QMutex m_decoderPauseLock
bool GetAVSyncAudioPause() const
virtual MythVideoFrame * GetNextFreeFrame()
Blocks until it is possible to return a frame for decoding onto.
virtual bool InitVideo(void)
void WrapTimecode(std::chrono::milliseconds &timecode, TCTypes tc_type)
bool IsInDelete(uint64_t frame) const
Returns true if the given frame is deemed to be within a region that should be cut.
void ResetTotalDuration(void)
void ClearAfterSeek(bool clearvideobuffers=true)
This is to support seeking...
int m_ttPageNum
VBI page to display when in PAL vbimode.
void SetBuffering(bool new_buffering)
void LoadMap(const QString &undoMessage="")
Loads the delete map from the database.
virtual void ResetPlaying(bool resetframes=true)
void SetAVSyncMusicChoice(AudioPlayer *Audio)
double m_videoFrameRate
Video (input) Frame Rate (often inaccurate)
bool UpdateFFRewSkip(float ffrewScale=1.0F)
QString get_encoding_type(MythCodecID codecid)
virtual long long GetFramesPlayed()
std::vector< char > TestBufferVec
virtual QString GetXDS(const QString &) const
PlayerContext * m_playerCtx
virtual double GetFPS(void) const
float m_forcedVideoAspect
QSize m_videoDispDim
Video (input) width & height.
void DeLimboFrame(MythVideoFrame *frame)
virtual void DiscardFrames(bool KeyFrame, bool Flushed)
Releases all frames not being actively displayed from any queue onto the queue of frames ready for de...
QString m_codecName
Codec Name - used by playback profile.
bool PosMapFromEnc(uint64_t start, frm_pos_map_t &posMap, frm_pos_map_t &durMap)
std::chrono::milliseconds m_latestVideoTimecode
bool m_disableForcedSubtitles
uint m_keyframeDist
Video (input) Number of frames between key frames (often inaccurate)
static bool preBufferDebug
void RequestResetCaptions()
bool GetEditMode(void) const
void EnableForcedSubtitles(bool enable)
virtual void GetChapterTimes(QList< std::chrono::seconds > ×)
int m_fpsMultiplier
used to detect changes
MythCoreContext * gCoreContext
This global variable contains the MythCoreContext instance for the app.
PlayerFlags m_playerFlags
void UnpauseDecoder(void)
virtual bool GetRawAudioState(void) const
int GetNumSetting(const QString &key, int defaultval=0)
uint m_vbiMode
VBI decoder to use.
virtual void VideoEnd(void)
bool DoFastForward(uint64_t frames, double inaccuracy)
virtual void DecoderEnd(void)
virtual bool SyncPositionMap(void)
Updates the position map used for skipping frames.
virtual void ReinitVideo(bool ForceUpdate)
QMap< long long, long long > frm_pos_map_t
Frame # -> File offset map.
std::chrono::milliseconds TranslatePositionFrameToMs(uint64_t position, bool use_cutlist) const
bool EnoughFreeFrames()
Returns true iff enough frames are available to decode onto.
void DoJumpToFrame(uint64_t frame, double inaccuracy)
virtual void SetVideoParams(int w, int h, double fps, float aspect, bool ForceUpdate, int ReferenceFrames, FrameScanType=kScan_Ignore, const QString &codecName=QString())
void JumpChapter(int chapter)
virtual void ReleaseFrame(MythVideoFrame *Frame)
Releases a frame from the ready for decoding queue onto the queue of frames ready for display.
void SetSeekSnap(uint64_t snap)
virtual int GetNumChapters(void)
virtual int GetNumChapters(void)
bool GetBoolSetting(const QString &key, bool defaultval=false)
virtual void InitFrameInterval()
QString GetError(void) const
virtual void SetWatchingRecording(bool mode)
@ kState_WatchingPreRecorded
Watching Pre-recorded is a TV only state for when we are watching a pre-existing recording.
void SetTranscoding(bool value)
virtual bool GetFrame(DecodeType Type, bool &Retry)=0
Demux, preprocess and possibly decode a frame of video/audio.
void ResetAVSyncClockBase()
virtual void CreateDecoder(TestBufferVec &TestBuffer)
QString GetInputType(int pos=-1) const
virtual long long CalcMaxFFTime(long long ff, bool setjump=true) const
CalcMaxFFTime(ffframes): forward ffframes forward.
uint GetChanID(void) const
This is the unique key used in the database to locate tuning information.
AutoExpireType QueryAutoExpire(void) const
Returns "autoexpire" field from "recorded" table.
void SetKeyframeDistance(int keyframedistance)
virtual void UpdateFramesPlayed(void)
virtual void DiscardFrame(MythVideoFrame *Frame)
Releases frame from any queue onto the queue of frames ready for decoding onto.
void SetWatchingRecording(bool mode)
Holds information on recordings and videos.
bool IsReallyNearEnd(void) const
Returns true iff really near end of recording.
bool IsWatchingInprogress(void) const
QWaitCondition m_decoderThreadPause
void SetFramesPlayed(uint64_t played)
void FileChangedCallback()
int m_maxReferenceFrames
Number of reference frames used in the video stream.
void WaitForSeek(uint64_t frame, uint64_t seeksnap_wanted)
int GetFreeVideoFrames(void) const
Returns the number of frames available for decoding onto.
void SetRenderFormats(const VideoFrameTypes *RenderFormats)
#define setpriority(x, y, z)
void SetDisablePassThrough(bool disabled)
static const double kInaccuracyEditor
uint64_t TranslatePositionMsToFrame(std::chrono::milliseconds position, bool use_cutlist) const
void SetPlaying(bool is_playing)
MythVideoFrame * GetNextVideoFrame(void)
Removes a frame from the available queue for decoding onto.
float m_ffrewScale
scale skip for large gops
void FillPositionMap(int64_t start, int64_t end, frm_pos_map_t &positionMap)
void SetFrameRate(double fps)
void ResetTotalDuration(void)
std::chrono::seconds m_totalLength
void SetFrameInterval(FrameScanType scan, double frame_period)
bool isRunning(void) const
void SetCommBreakMap(const frm_dir_map_t &NewMap)
QSize m_videoDim
Video (input) buffer width & height.
float GetStretchFactor(void) const
virtual void SetDisablePassThrough(bool disable)
Disables AC3/DTS pass through.
bool FlagIsSet(PlayerFlags arg)
float m_videoAspect
Video (input) Apect Ratio.
virtual void DoFFRewSkip(void)
void ForceSetupAudioStream(void)
static const double kInaccuracyFull
virtual bool JumpToFrame(uint64_t frame)
virtual void StopPlaying(void)
void SaveTotalDuration(void)
virtual int OpenFile(MythMediaBuffer *Buffer, bool novideo, TestBufferVec &testbuf)=0
static float ffrewScaleLowest
virtual bool IsInStillFrame() const
QString GetXDS(const QString &key) const
void SaveSetting(const QString &key, int newValue)
RemoteEncoder * m_recorder
virtual void Reset(bool reset_video_data, bool seek_reset, bool reset_file)
uint64_t GetLastFrame(void) const
Returns the number of the last frame in the video that is not in a cut sequence.
bool EnoughDecodedFrames()
Returns true iff there are plenty of decoded frames ready for display.
virtual void DecoderLoop(bool pause)
virtual void SetEofState(EofState eof)
bool m_disablePassthrough
void SetLiveTVMode(bool live)
bool DoRewind(uint64_t frames, double inaccuracy)
static const double kInaccuracyDefault
virtual bool FastForward(float seconds)
long long GetFramesRead(void) const
virtual bool DoRewind(long long desiredFrame, bool discardFrames=true)
bool IsEditing(void) const
bool DoGetFrame(DecodeType DecodeType)
Get one frame from the decoder.
bool Play(float speed=1.0, bool normal=true, bool unpauseaudio=true)
QWaitCondition m_playingWaitCond
virtual void SetVideoFrameRate(float VideoFrameRate)
const VideoFrameTypes * m_renderFormats
bool volatile m_killDecoder
virtual void ReleaseNextVideoFrame(MythVideoFrame *buffer, std::chrono::milliseconds timecode, bool wrap=true)
Places frame on the queue of frames ready for display.
QString GetSetting(const QString &key, const QString &defaultval="")
std::enable_if_t< std::is_floating_point_v< T >, std::chrono::milliseconds > millisecondsFromFloat(T value)
Helper function for convert a floating point number to a duration.
virtual void DecoderStart(bool start_paused)
void SaveTotalFrames(void)
virtual bool Rewind(float seconds)
virtual int GetCurrentChapter(void)
void DiscardVideoFrame(MythVideoFrame *buffer)
Places frame in the available frames queue.