MythTV  master
Classes | Public Member Functions | Protected Types | Protected Attributes | Private Types | Private Member Functions | Static Private Member Functions | List of all members
MythCCExtractorPlayer Class Reference

#include <mythccextractorplayer.h>

Inheritance diagram for MythCCExtractorPlayer:
Inheritance graph
[legend]
Collaboration diagram for MythCCExtractorPlayer:
Collaboration graph
[legend]

Classes

class  Window
 Keeps cc708 windows (1-8) for all streams & services (which ids are the keys). More...
 

Public Member Functions

 MythCCExtractorPlayer (PlayerContext *Context, PlayerFlags flags, bool showProgress, QString fileName, const QString &destdir)
 
 MythCCExtractorPlayer (const MythCCExtractorPlayer &rhs)
 
 ~MythCCExtractorPlayer () override=default
 
bool run (void)
 
CC708ReaderGetCC708Reader (uint id=0) override
 
CC608ReaderGetCC608Reader (uint id=0) override
 
SubtitleReaderGetSubReader (uint id=0) override
 
TeletextReaderGetTeletextReader (uint id=0) override
 
- Public Member Functions inherited from MythPlayer
 MythPlayer (PlayerContext *Context, PlayerFlags Flags=kNoFlags)
 
 ~MythPlayer () override
 
virtual int OpenFile (int Retries=4)
 
virtual bool InitVideo (void)
 
virtual void ReinitVideo (bool ForceUpdate)
 
virtual void InitFrameInterval ()
 
void SetLength (std::chrono::seconds len)
 
void SetFramesPlayed (uint64_t played)
 
void SetEof (EofState eof)
 
void SetWatchingRecording (bool mode)
 
void SetKeyframeDistance (int keyframedistance)
 
virtual void SetVideoParams (int w, int h, double fps, float aspect, bool ForceUpdate, int ReferenceFrames, FrameScanType=kScan_Ignore, const QString &codecName=QString())
 
void SetFileLength (std::chrono::seconds total, int frames)
 
void SetDuration (std::chrono::seconds duration)
 
void SetFrameRate (double fps)
 
QSize GetVideoBufferSize (void) const
 
QSize GetVideoSize (void) const
 
float GetVideoAspect (void) const
 
float GetFrameRate (void) const
 
bool IsAudioNeeded (void)
 
int GetFreeVideoFrames (void) const
 Returns the number of frames available for decoding onto. More...
 
int GetFFRewSkip (void) const
 
float GetPlaySpeed (void) const
 
AudioPlayerGetAudio (void)
 
float GetNextPlaySpeed (void) const
 
std::chrono::seconds GetLength (void) const
 
uint64_t GetTotalFrameCount (void) const
 
uint64_t GetCurrentFrameCount (void) const
 
uint64_t GetFramesPlayed (void) const
 
virtual uint64_t GetBookmark (void)
 
QString GetError (void) const
 
QString GetEncodingType (void) const
 
QString GetXDS (const QString &key) const
 
bool IsPaused (void) const
 
bool GetRawAudioState (void) const
 
bool GetLimitKeyRepeat (void) const
 
EofState GetEof (void) const
 
bool IsErrored (void) const
 
bool IsPlaying (std::chrono::milliseconds wait_in_msec=0ms, bool wait_for=true) const
 
bool AtNormalSpeed (void) const
 
bool IsReallyNearEnd (void) const
 Returns true iff really near end of recording. More...
 
bool IsNearEnd (void)
 Returns true iff near end of recording. More...
 
bool HasTVChainNext (void) const
 
bool IsWatchingInprogress (void) const
 
virtual InteractiveTVGetInteractiveTV ()
 
MythVideoOutputGetVideoOutput (void)
 
virtual bool SwitchTitle (int)
 
virtual bool NextTitle (void)
 
virtual bool PrevTitle (void)
 
virtual bool SwitchAngle (int)
 
virtual bool NextAngle (void)
 
virtual bool PrevAngle (void)
 
MythVideoFrameGetNextVideoFrame (void)
 Removes a frame from the available queue for decoding onto. More...
 
void DeLimboFrame (MythVideoFrame *frame)
 
virtual void ReleaseNextVideoFrame (MythVideoFrame *buffer, std::chrono::milliseconds timecode, bool wrap=true)
 Places frame on the queue of frames ready for display. More...
 
void DiscardVideoFrame (MythVideoFrame *buffer)
 Places frame in the available frames queue. More...
 
void DiscardVideoFrames (bool KeyFrame, bool Flushed)
 Places frames in the available frames queue. More...
 
DecoderBaseGetDecoder (void)
 Returns the stream decoder currently in use. More...
 
virtual bool HasReachedEof (void) const
 
void SetDisablePassThrough (bool disabled)
 
void ForceSetupAudioStream (void)
 
virtual bool PrepareAudioSample (std::chrono::milliseconds &timecode)
 
void EnableForcedSubtitles (bool enable)
 
bool GetAllowForcedSubtitles (void) const
 
void CheckTVChain ()
 
void FileChangedCallback ()
 
virtual int GetNumChapters (void)
 
virtual int GetCurrentChapter (void)
 
virtual void GetChapterTimes (QList< std::chrono::seconds > &times)
 
virtual int GetNumTitles (void) const
 
virtual int GetCurrentTitle (void) const
 
virtual std::chrono::seconds GetTitleDuration (int) const
 
virtual QString GetTitleName (int) const
 
virtual int GetNumAngles (void) const
 
virtual int GetCurrentAngle (void) const
 
virtual QString GetAngleName (int) const
 
virtual bool IsInStillFrame () const
 
bool PosMapFromEnc (uint64_t start, frm_pos_map_t &posMap, frm_pos_map_t &durMap)
 
void SaveTotalDuration (void)
 
void ResetTotalDuration (void)
 
void SaveTotalFrames (void)
 
void SetErrored (const QString &reason)
 

Protected Types

using WindowsOnService = QHash< uint, QMap< int, Window > >
 

Protected Attributes

CC608Info m_cc608Info
 
CC708Info m_cc708Info
 
TeletextInfo m_ttxInfo
 
DVBSubInfo m_dvbsubInfo
 
QHash< uint, WindowsOnServicem_cc708Windows
 
std::chrono::milliseconds m_curTime {0ms}
 Keeps track for decoding time to make timestamps for subtitles. More...
 
uint64_t m_myFramesPlayed {0}
 
bool m_showProgress {false}
 
QString m_fileName
 
QDir m_workingDir
 
QString m_baseName
 
- Protected Attributes inherited from MythPlayer
DecoderBasem_decoder {nullptr}
 
QRecursiveMutex m_decoderChangeLock
 
MythVideoOutputm_videoOutput {nullptr}
 
const VideoFrameTypesm_renderFormats { &MythVideoFrame::kDefaultRenderFormats }
 
PlayerContextm_playerCtx {nullptr}
 
MythDecoderThreadm_decoderThread {nullptr}
 
QThread * m_playerThread {nullptr}
 
PlayerFlags m_playerFlags
 
QWaitCondition m_decoderThreadPause
 
QWaitCondition m_decoderThreadUnpause
 
QMutex m_decoderPauseLock
 
QMutex m_decoderSeekLock
 
QMutex m_bufferPauseLock
 
QMutex m_videoPauseLock
 
QMutex m_pauseLock
 
int64_t m_decoderSeek {-1}
 
bool m_totalDecoderPause {false}
 
bool m_decoderPaused {false}
 
bool m_inJumpToProgramPause {false}
 
bool m_pauseDecoder {false}
 
bool m_unpauseDecoder {false}
 
bool volatile m_killDecoder {false}
 
bool m_decodeOneFrame {false}
 
bool m_renderOneFrame {false}
 
bool m_needNewPauseFrame {false}
 
bool m_bufferPaused {false}
 
bool m_videoPaused {false}
 
bool m_allPaused {false}
 
bool m_playing {false}
 
QWaitCondition m_playingWaitCond
 
QMutex m_vidExitLock
 
QMutex m_playingLock
 
QMutex m_errorLock
 
QString m_errorMsg
 Reason why NVP exited with a error. More...
 
int m_errorType {kError_None}
 
bool m_liveTV {false}
 
bool m_watchingRecording {false}
 
bool m_transcoding {false}
 
bool m_hasFullPositionMap {false}
 
bool m_limitKeyRepeat {false}
 
int m_jumpChapter {0}
 
uint64_t m_bookmarkSeek {0}
 
int m_endExitPrompt
 
long long m_ffTime {0}
 If m_ffTime>0, number of frames to seek forward. More...
 
int m_videobufRetries {0}
 How often we have tried to wait for a video output buffer and failed. More...
 
uint64_t m_framesPlayed {0}
 
uint64_t m_totalFrames {0}
 
std::chrono::seconds m_totalLength {0s}
 
std::chrono::seconds m_totalDuration {0s}
 
long long m_rewindTime {0}
 
std::chrono::milliseconds m_latestVideoTimecode {-1ms}
 
MythPlayerAVSync m_avSync
 
double m_videoFrameRate {29.97}
 Video (input) Frame Rate (often inaccurate) More...
 
QString m_codecName
 Codec Name - used by playback profile. More...
 
QSize m_videoDispDim {0,0}
 Video (input) width & height. More...
 
QSize m_videoDim {0,0}
 Video (input) buffer width & height. More...
 
int m_maxReferenceFrames {0}
 Number of reference frames used in the video stream. More...
 
float m_videoAspect {4.0F / 3.0F}
 Video (input) Apect Ratio. More...
 
float m_forcedVideoAspect {-1}
 
uint m_keyframeDist {30}
 Video (input) Number of frames between key frames (often inaccurate) More...
 
bool m_buffering {false}
 
QTime m_bufferingStart
 
QTime m_bufferingLastMsg
 
uint m_vbiMode {VBIMode::None}
 VBI decoder to use. More...
 
int m_ttPageNum {0x888}
 VBI page to display when in PAL vbimode. More...
 
SubtitleReader m_subReader
 
TeletextReader m_ttxReader
 
bool m_captionsEnabledbyDefault {false}
 This allows us to enable captions/subtitles later if the streams are not immediately available when the video starts playing. More...
 
bool m_enableForcedSubtitles {false}
 
bool m_disableForcedSubtitles {false}
 
bool m_allowForcedSubtitles {true}
 
CC608Reader m_cc608
 
CC708Reader m_cc708
 
AudioPlayer m_audio
 
CommBreakMap m_commBreakMap
 
bool m_forcePositionMapSync {false}
 
DeleteMap m_deleteMap
 
QRecursiveMutex m_decoderLock
 Lock for next_play_speed and next_normal_speed. More...
 
float m_nextPlaySpeed {1.0F}
 
float m_playSpeed {1.0F}
 
std::chrono::microseconds m_frameInterval {microsecondsFromFloat(1000000.0F / 30)}
 always adjusted for play_speed More...
 
int m_fpsMultiplier {1}
 used to detect changes More...
 
int m_ffrewSkip {1}
 
int m_ffrewAdjust {0}
 offset after last skip More...
 
float m_ffrewScale {1.0F}
 scale skip for large gops More...
 
bool m_fileChanged {false}
 
bool m_nextNormalSpeed {true}
 
bool m_normalSpeed {true}
 
tctype_arr m_tcWrap {}
 
std::chrono::milliseconds m_savedAudioTimecodeOffset {0ms}
 
bool m_isDummy {false}
 
int m_bufferingCounter {0}
 

Private Types

enum  { kProcessNormal = 0, kProcessFinalize = 1 }
 

Private Member Functions

void IngestSubtitle (QList< OneSubtitle > &list, const QStringList &content) const
 Adds new subtitle, finishes last if needed. More...
 
void Ingest608Captions (void)
 
void Process608Captions (uint flags)
 
void Ingest708Captions (void)
 
void Ingest708Caption (uint streamId, uint serviceIdx, uint windowIdx, uint start_row, uint start_column, const CC708Window &win, const std::vector< CC708String * > &content)
 
void Process708Captions (uint flags)
 
void IngestTeletext (void)
 
void ProcessTeletext (uint flags)
 
void IngestDVBSubtitles (void)
 
void ProcessDVBSubtitles (uint flags)
 
void OnGotNewFrame (void)
 Call it when you got new video frame to process subtitles if any. More...
 

Static Private Member Functions

static void IngestSubtitle (QList< OneSubtitle > &list, const OneSubtitle &content)
 Adds new subtitle, finishes last if needed. More...
 

Additional Inherited Members

- Signals inherited from MythPlayer
void CheckCallbacks ()
 
void SeekingSlow (int Count)
 
void SeekingComplete ()
 
void SeekingDone ()
 
void PauseChanged (bool Paused)
 
void RequestResetCaptions ()
 
void SignalTracksChanged (uint Type)
 
- Static Public Attributes inherited from MythPlayer
static const int kNightModeBrightenssAdjustment = 10
 
static const int kNightModeContrastAdjustment = 10
 
static const double kInaccuracyNone = 0
 
static const double kInaccuracyDefault = 0.1
 
static const double kInaccuracyEditor = 0.5
 
static const double kInaccuracyFull = -1.0
 
static const double kSeekToEndOffset = 1.0
 
- Protected Member Functions inherited from MythPlayer
void OpenDummy (void)
 
virtual long long CalcMaxFFTime (long long ff, bool setjump=true) const
 CalcMaxFFTime(ffframes): forward ffframes forward. More...
 
long long CalcRWTime (long long rw) const
 CalcRWTime(rw): rewind rw frames back. More...
 
std::chrono::milliseconds TranslatePositionFrameToMs (uint64_t position, bool use_cutlist) const
 
uint64_t TranslatePositionMsToFrame (std::chrono::milliseconds position, bool use_cutlist) const
 
uint64_t TranslatePositionAbsToRel (uint64_t position) const
 
uint64_t TranslatePositionRelToAbs (uint64_t position) const
 
float ComputeSecs (uint64_t position, bool use_cutlist) const
 
uint64_t FindFrame (float offset, bool use_cutlist) const
 
void SetAutoCommercialSkip (CommSkipMode autoskip)
 
void SkipCommercials (int direction)
 
void SetCommBreakMap (const frm_dir_map_t &NewMap)
 
CommSkipMode GetAutoCommercialSkip (void)
 
virtual void ResetPlaying (bool resetframes=true)
 
virtual void StopPlaying (void)
 
bool PauseDecoder (void)
 
void UnpauseDecoder (void)
 
bool Pause (void)
 
bool Play (float speed=1.0, bool normal=true, bool unpauseaudio=true)
 
virtual bool FastForward (float seconds)
 
virtual bool Rewind (float seconds)
 
virtual bool JumpToFrame (uint64_t frame)
 
void JumpChapter (int chapter)
 
virtual bool PrebufferEnoughFrames (int min_buffers=0)
 
void SetBuffering (bool new_buffering)
 
virtual void VideoEnd (void)
 
virtual void DecoderStart (bool start_paused)
 
virtual void DecoderLoop (bool pause)
 
virtual void DecoderEnd (void)
 
virtual void DecoderPauseCheck (void)
 
virtual void AudioEnd (void)
 
bool GetEditMode (void) const
 
bool IsInDelete (uint64_t frame)
 
bool FlagIsSet (PlayerFlags arg)
 
void SetPlayingInfo (const ProgramInfo &pginfo)
 
void SetPlaying (bool is_playing)
 
void ResetErrored (void)
 
void PauseVideo (void)
 
void UnpauseVideo (void)
 
void PauseBuffer (void)
 
void UnpauseBuffer (void)
 
virtual void CreateDecoder (TestBufferVec &TestBuffer)
 
void SetDecoder (DecoderBase *dec)
 Sets the stream decoder, deleting any existing recorder. More...
 
const DecoderBaseGetDecoder (void) const
 Returns the stream decoder currently in use. More...
 
virtual void DoFFRewSkip (void)
 
bool DecoderGetFrame (DecodeType decodetype, bool unsafe=false)
 
bool DoGetFrame (DecodeType DecodeType)
 Get one frame from the decoder. More...
 
bool UpdateFFRewSkip (float ffrewScale=1.0F)
 
virtual void ChangeSpeed (void)
 
bool DoFastForward (uint64_t frames, double inaccuracy)
 
bool DoRewind (uint64_t frames, double inaccuracy)
 
void DoJumpToFrame (uint64_t frame, double inaccuracy)
 
void WaitForSeek (uint64_t frame, uint64_t seeksnap_wanted)
 
void ClearAfterSeek (bool clearvideobuffers=true)
 This is to support seeking... More...
 
virtual bool DoJumpChapter (int chapter)
 
virtual int64_t GetChapter (int chapter)
 
void WrapTimecode (std::chrono::milliseconds &timecode, TCTypes tc_type)
 
void SetFrameInterval (FrameScanType scan, double frame_period)
 

Detailed Description

Definition at line 112 of file mythccextractorplayer.h.

Member Typedef Documentation

◆ WindowsOnService

using MythCCExtractorPlayer::WindowsOnService = QHash<uint, QMap<int, Window> >
protected

Definition at line 165 of file mythccextractorplayer.h.

Member Enumeration Documentation

◆ anonymous enum

anonymous enum
private
Enumerator
kProcessNormal 
kProcessFinalize 

Definition at line 131 of file mythccextractorplayer.h.

Constructor & Destructor Documentation

◆ MythCCExtractorPlayer() [1/2]

MythCCExtractorPlayer::MythCCExtractorPlayer ( PlayerContext Context,
PlayerFlags  flags,
bool  showProgress,
QString  fileName,
const QString &  destdir 
)

Definition at line 50 of file mythccextractorplayer.cpp.

◆ MythCCExtractorPlayer() [2/2]

MythCCExtractorPlayer::MythCCExtractorPlayer ( const MythCCExtractorPlayer rhs)

◆ ~MythCCExtractorPlayer()

MythCCExtractorPlayer::~MythCCExtractorPlayer ( )
overridedefault

Member Function Documentation

◆ run()

bool MythCCExtractorPlayer::run ( void  )

Definition at line 123 of file mythccextractorplayer.cpp.

◆ GetCC708Reader()

CC708Reader * MythCCExtractorPlayer::GetCC708Reader ( uint  id = 0)
overridevirtual

Reimplemented from MythPlayer.

Definition at line 787 of file mythccextractorplayer.cpp.

◆ GetCC608Reader()

CC608Reader * MythCCExtractorPlayer::GetCC608Reader ( uint  id = 0)
overridevirtual

Reimplemented from MythPlayer.

Definition at line 798 of file mythccextractorplayer.cpp.

◆ GetSubReader()

SubtitleReader * MythCCExtractorPlayer::GetSubReader ( uint  id = 0)
overridevirtual

Reimplemented from MythPlayer.

Definition at line 815 of file mythccextractorplayer.cpp.

◆ GetTeletextReader()

TeletextReader * MythCCExtractorPlayer::GetTeletextReader ( uint  id = 0)
overridevirtual

Reimplemented from MythPlayer.

Definition at line 808 of file mythccextractorplayer.cpp.

◆ IngestSubtitle() [1/2]

void MythCCExtractorPlayer::IngestSubtitle ( QList< OneSubtitle > &  list,
const QStringList &  content 
) const
private

Adds new subtitle, finishes last if needed.

Parameters
contentText content of new subtitle (may be empty).
listQueue of subtitles we modify.

Definition at line 214 of file mythccextractorplayer.cpp.

Referenced by Ingest608Captions(), Ingest708Caption(), IngestDVBSubtitles(), and IngestTeletext().

◆ IngestSubtitle() [2/2]

void MythCCExtractorPlayer::IngestSubtitle ( QList< OneSubtitle > &  list,
const OneSubtitle content 
)
staticprivate

Adds new subtitle, finishes last if needed.

This is a version for DVB graphical subtitles only.

Parameters
listQueue of subtitles we modify.
contentContent of the new subtitle (may be empty). We're going to use it's m_img & m_startTime fields.

Definition at line 257 of file mythccextractorplayer.cpp.

◆ Ingest608Captions()

void MythCCExtractorPlayer::Ingest608Captions ( void  )
private

Definition at line 292 of file mythccextractorplayer.cpp.

Referenced by OnGotNewFrame().

◆ Process608Captions()

void MythCCExtractorPlayer::Process608Captions ( uint  flags)
private

Definition at line 343 of file mythccextractorplayer.cpp.

Referenced by OnGotNewFrame(), and run().

◆ Ingest708Captions()

void MythCCExtractorPlayer::Ingest708Captions ( void  )
private

Definition at line 403 of file mythccextractorplayer.cpp.

Referenced by OnGotNewFrame().

◆ Ingest708Caption()

void MythCCExtractorPlayer::Ingest708Caption ( uint  streamId,
uint  serviceIdx,
uint  windowIdx,
uint  start_row,
uint  start_column,
const CC708Window win,
const std::vector< CC708String * > &  content 
)
private

Definition at line 432 of file mythccextractorplayer.cpp.

Referenced by Ingest708Captions().

◆ Process708Captions()

void MythCCExtractorPlayer::Process708Captions ( uint  flags)
private

Definition at line 463 of file mythccextractorplayer.cpp.

Referenced by OnGotNewFrame(), and run().

◆ IngestTeletext()

void MythCCExtractorPlayer::IngestTeletext ( void  )
private

Definition at line 535 of file mythccextractorplayer.cpp.

Referenced by OnGotNewFrame().

◆ ProcessTeletext()

void MythCCExtractorPlayer::ProcessTeletext ( uint  flags)
private

Definition at line 560 of file mythccextractorplayer.cpp.

Referenced by OnGotNewFrame(), and run().

◆ IngestDVBSubtitles()

void MythCCExtractorPlayer::IngestDVBSubtitles ( void  )
private

Definition at line 618 of file mythccextractorplayer.cpp.

Referenced by OnGotNewFrame().

◆ ProcessDVBSubtitles()

void MythCCExtractorPlayer::ProcessDVBSubtitles ( uint  flags)
private

Definition at line 719 of file mythccextractorplayer.cpp.

Referenced by OnGotNewFrame(), and run().

◆ OnGotNewFrame()

void MythCCExtractorPlayer::OnGotNewFrame ( void  )
private

Call it when you got new video frame to process subtitles if any.

Definition at line 76 of file mythccextractorplayer.cpp.

Referenced by run().

Member Data Documentation

◆ m_cc608Info

CC608Info MythCCExtractorPlayer::m_cc608Info
protected

◆ m_cc708Info

CC708Info MythCCExtractorPlayer::m_cc708Info
protected

◆ m_ttxInfo

TeletextInfo MythCCExtractorPlayer::m_ttxInfo
protected

Definition at line 153 of file mythccextractorplayer.h.

Referenced by GetTeletextReader(), IngestTeletext(), and ProcessTeletext().

◆ m_dvbsubInfo

DVBSubInfo MythCCExtractorPlayer::m_dvbsubInfo
protected

Definition at line 154 of file mythccextractorplayer.h.

Referenced by GetSubReader(), IngestDVBSubtitles(), and ProcessDVBSubtitles().

◆ m_cc708Windows

QHash<uint, WindowsOnService > MythCCExtractorPlayer::m_cc708Windows
protected

Definition at line 166 of file mythccextractorplayer.h.

Referenced by Ingest708Caption().

◆ m_curTime

std::chrono::milliseconds MythCCExtractorPlayer::m_curTime {0ms}
protected

Keeps track for decoding time to make timestamps for subtitles.

Definition at line 169 of file mythccextractorplayer.h.

Referenced by IngestSubtitle(), OnGotNewFrame(), and run().

◆ m_myFramesPlayed

uint64_t MythCCExtractorPlayer::m_myFramesPlayed {0}
protected

Definition at line 170 of file mythccextractorplayer.h.

Referenced by OnGotNewFrame(), and run().

◆ m_showProgress

bool MythCCExtractorPlayer::m_showProgress {false}
protected

Definition at line 171 of file mythccextractorplayer.h.

Referenced by run().

◆ m_fileName

QString MythCCExtractorPlayer::m_fileName
protected

Definition at line 172 of file mythccextractorplayer.h.

Referenced by MythCCExtractorPlayer().

◆ m_workingDir

QDir MythCCExtractorPlayer::m_workingDir
protected

◆ m_baseName

QString MythCCExtractorPlayer::m_baseName
protected

The documentation for this class was generated from the following files: