MythTV  master
Public Member Functions | Static Public Member Functions | Private Member Functions | Static Private Member Functions | Private Attributes | Friends | List of all members
NuppelDecoder Class Reference

#include <nuppeldecoder.h>

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

Public Member Functions

 NuppelDecoder (MythPlayer *parent, const ProgramInfo &pginfo)
 
 ~NuppelDecoder ()
 
int OpenFile (RingBuffer *rbuffer, bool novideo, char testbuf[kDecoderProbeBufferSize], int testbufsize=kDecoderProbeBufferSize) override
 
bool GetFrame (DecodeType, bool &) override
 Demux, preprocess and possibly decode a frame of video/audio. More...
 
bool IsLastFrameKey (void) const override
 
void WriteStoredData (RingBuffer *rb, bool storevid, long timecodeOffset) override
 
void ClearStoredData (void) override
 
long UpdateStoredFrameNum (long framenumber) override
 
QString GetCodecDecoderName (void) const override
 
QString GetRawEncodingType (void) override
 
MythCodecID GetVideoCodecID (void) const override
 
- Public Member Functions inherited from DecoderBase
 DecoderBase (MythPlayer *parent, const ProgramInfo &pginfo)
 
 DecoderBase (const DecoderBase &rhs)
 
virtual ~DecoderBase ()
 
virtual void Reset (bool reset_video_data, bool seek_reset, bool reset_file)
 
virtual void SetEofState (EofState eof)
 
virtual void SetEof (bool eof)
 
EofState GetEof (void)
 
void SetSeekSnap (uint64_t snap)
 
uint64_t GetSeekSnap (void) const
 
void SetLiveTVMode (bool live)
 
void SetProgramInfo (const ProgramInfo &pginfo)
 
virtual void SetDisablePassThrough (bool disable)
 Disables AC3/DTS pass through. More...
 
virtual void ForceSetupAudioStream (void)
 
virtual void SetWatchingRecording (bool mode)
 
MythPlayerGetPlayer ()
 
virtual int GetNumChapters (void)
 
virtual int GetCurrentChapter (long long)
 
virtual void GetChapterTimes (QList< long long > &)
 
virtual long long GetChapter (int)
 
virtual bool DoRewind (long long desiredFrame, bool discardFrames=true)
 
virtual bool DoFastForward (long long desiredFrame, bool discardFrames=true)
 Skips ahead or rewinds to desiredFrame. More...
 
virtual void SetIdrOnlyKeyframes (bool)
 
uint64_t TranslatePositionFrameToMs (long long position, float fallback_framerate, const frm_dir_map_t &cutlist)
 
uint64_t TranslatePositionMsToFrame (uint64_t dur_ms, float fallback_framerate, const frm_dir_map_t &cutlist)
 
float GetVideoAspect (void) const
 
virtual int64_t NormalizeVideoTimecode (int64_t timecode)
 
virtual void SetRawAudioState (bool state)
 
virtual bool GetRawAudioState (void) const
 
virtual void SetRawVideoState (bool state)
 
virtual bool GetRawVideoState (void) const
 
virtual double GetFPS (void) const
 
uint GetRawBitrate (void) const
 Returns the estimated bitrate if the video were played at normal speed. More...
 
virtual void UpdateFramesPlayed (void)
 
long long GetFramesRead (void) const
 
long long GetFramesPlayed (void) const
 
void SetFramesPlayed (long long newValue)
 
virtual void ResetPosMap (void)
 
virtual bool SyncPositionMap (void)
 Updates the position map used for skipping frames. More...
 
virtual bool PosMapFromDb (void)
 
virtual bool PosMapFromEnc (void)
 Queries encoder for position map data that has not been committed to the DB yet. More...
 
virtual bool FindPosition (long long desired_value, bool search_adjusted, int &lower_bound, int &upper_bound)
 
uint64_t SavePositionMapDelta (long long first_frame, long long last_frame)
 
void SetTranscoding (bool value)
 
bool IsErrored () const
 
bool HasPositionMap (void) const
 
void SetWaitForChange (void)
 
bool GetWaitForChange (void) const
 
void SetReadAdjust (long long adjust)
 
void SetDecodeAllSubtitles (bool val)
 
virtual QStringList GetTracks (uint type) const
 
virtual uint GetTrackCount (uint type) const
 
virtual int GetTrackLanguageIndex (uint type, uint trackNo) const
 
virtual QString GetTrackDesc (uint type, uint trackNo) const
 
virtual int SetTrack (uint type, int trackNo)
 
int GetTrack (uint type) const
 
StreamInfo GetTrackInfo (uint type, uint trackNo) const
 
int IncrementTrack (uint type)
 
int DecrementTrack (uint type)
 
int ChangeTrack (uint type, int dir)
 
virtual bool InsertTrack (uint type, const StreamInfo &)
 
int NextTrack (uint type)
 
virtual int GetTeletextDecoderType (void) const
 
virtual QString GetXDS (const QString &) const
 
virtual QByteArray GetSubHeader (uint) const
 
virtual void GetAttachmentData (uint, QByteArray &, QByteArray &)
 
virtual bool SetAudioByComponentTag (int)
 
virtual bool SetVideoByComponentTag (int)
 
void SaveTotalDuration (void)
 
void ResetTotalDuration (void)
 
void SaveTotalFrames (void)
 
void TrackTotalDuration (bool track)
 
int GetfpsMultiplier (void)
 
MythCodecContextGetMythCodecContext (void)
 
VideoDisplayProfileGetVideoDisplayProfile (void)
 
AVPixelFormat GetBestVideoFormat (AVPixelFormat *Formats)
 Find a suitable frame format that is mutually acceptable to the decoder and render device. More...
 

Static Public Member Functions

static bool CanHandle (char testbuf[kDecoderProbeBufferSize], int testbufsize=kDecoderProbeBufferSize)
 
- Static Public Member Functions inherited from DecoderBase
static uint64_t TranslatePositionAbsToRel (const frm_dir_map_t &deleteMap, uint64_t absPosition, const frm_pos_map_t &map=frm_pos_map_t(), float fallback_ratio=1.0)
 
static uint64_t TranslatePositionRelToAbs (const frm_dir_map_t &deleteMap, uint64_t relPosition, const frm_pos_map_t &map=frm_pos_map_t(), float fallback_ratio=1.0)
 
static uint64_t TranslatePosition (const frm_pos_map_t &map, long long key, float fallback_ratio)
 

Private Member Functions

 NuppelDecoder (const NuppelDecoder &)=delete
 
NuppelDecoderoperator= (const NuppelDecoder &)=delete
 
bool ReadFileheader (struct rtfileheader *fh)
 
bool ReadFrameheader (struct rtframeheader *fh)
 
bool DecodeFrame (struct rtframeheader *frameheader, unsigned char *lstrm, VideoFrame *frame)
 
bool InitAVCodecVideo (int codec)
 
void CloseAVCodecVideo (void)
 
bool InitAVCodecAudio (int codec)
 
void CloseAVCodecAudio (void)
 
void StoreRawData (unsigned char *strm)
 
void SeekReset (long long newKey=0, uint skipFrames=0, bool doFlush=false, bool discardFrames=false) override
 

Static Private Member Functions

static bool isValidFrametype (char type)
 

Private Attributes

struct rtfileheader m_fileheader
 
struct rtframeheader m_frameheader
 
RTjpegm_rtjd {nullptr}
 
int m_video_width {0}
 
int m_video_height {0}
 
int m_video_size {0}
 
double m_video_frame_rate {0.0}
 
int m_audio_samplerate {44100}
 
int m_ffmpeg_extradatasize {0}
 
uint8_t * m_ffmpeg_extradata {nullptr}
 
struct extendeddata m_extradata
 
bool m_usingextradata {false}
 
bool m_disablevideo {false}
 
int m_totalLength {0}
 
long long m_totalFrames {0}
 
int m_effdsp {0}
 
VideoFramem_directframe {nullptr}
 
VideoFramem_decoded_video_frame {nullptr}
 
AVCodec * m_mpa_vidcodec {nullptr}
 
AVCodecContext * m_mpa_vidctx {nullptr}
 
AVCodec * m_mpa_audcodec {nullptr}
 
AVCodecContext * m_mpa_audctx {nullptr}
 
uint8_t * m_audioSamples {nullptr}
 
bool m_directrendering {false}
 
char m_lastct {'1'}
 
unsigned char * m_strm {nullptr}
 
unsigned char * m_buf {nullptr}
 
unsigned char * m_buf2 {nullptr}
 
unsigned char * m_planes [3]
 
list< RawDataList * > m_storedData
 
int m_videosizetotal {0}
 
int m_videoframesread {0}
 
bool m_setreadahead {false}
 

Friends

int get_nuppel_buffer (struct AVCodecContext *c, AVFrame *pic, int flags)
 
void release_nuppel_buffer (void *opaque, uint8_t *data)
 

Additional Inherited Members

- Protected Member Functions inherited from DecoderBase
virtual int AutoSelectTrack (uint type)
 Select best track. More...
 
void AutoSelectTracks (void)
 
void ResetTracks (void)
 
void FileChanged (void)
 
virtual bool DoRewindSeek (long long desiredFrame)
 
virtual void DoFastForwardSeek (long long desiredFrame, bool &needflush)
 Seeks to the keyframe just before the desiredFrame if exact seeks is enabled, or the frame just after it if exact seeks is not enabled. More...
 
long long ConditionallyUpdatePosMap (long long desiredFrame)
 
long long GetLastFrameInPosMap (void) const
 
unsigned long GetPositionMapSize (void) const
 
long long GetKey (const PosMapEntry &entry) const
 
- Protected Attributes inherited from DecoderBase
MythPlayerm_parent {nullptr}
 
ProgramInfom_playbackinfo {nullptr}
 
AudioPlayerm_audio {nullptr}
 
RingBufferringBuffer {nullptr}
 
int m_current_width {640}
 
int m_current_height {480}
 
float m_current_aspect {1.33333f}
 
double m_fps {29.97}
 
int m_fpsMultiplier {1}
 
int m_fpsSkip {0}
 
uint m_bitrate {4000}
 
long long m_framesPlayed {0}
 
long long m_framesRead {0}
 
unsigned long long m_frameCounter {0}
 
AVRational m_totalDuration
 
long long m_lastKey {0}
 
int m_keyframedist {-1}
 
long long m_indexOffset {0}
 
MythAVCopy m_copyFrame
 
bool m_trackTotalDuration {false}
 
EofState m_ateof {kEofStateNone}
 
bool m_exitafterdecoded {false}
 
bool m_transcoding {false}
 
bool m_hasFullPositionMap {false}
 
bool m_recordingHasPositionMap {false}
 
bool m_posmapStarted {false}
 
MarkTypes m_positionMapType {MARK_UNSET}
 
QMutex m_positionMapLock {QMutex::Recursive}
 
vector< PosMapEntrym_positionMap
 
frm_pos_map_t m_frameToDurMap
 
frm_pos_map_t m_durToFrameMap
 
bool m_dontSyncPositionMap {false}
 
QDateTime m_lastPositionMapUpdate
 
uint64_t m_seeksnap {UINT64_MAX}
 
bool m_livetv {false}
 
bool m_watchingrecording {false}
 
bool m_hasKeyFrameAdjustTable {false}
 
bool m_getrawframes {false}
 
bool m_getrawvideo {false}
 
bool m_errored {false}
 
bool m_waitingForChange {false}
 
long long m_readAdjust {0}
 
bool m_justAfterChange {false}
 
int m_videoRotation {0}
 
bool m_decodeAllSubtitles {false}
 
int m_currentTrack [kTrackTypeCount]
 
sinfo_vec_t m_tracks [kTrackTypeCount]
 
StreamInfo m_wantedTrack [kTrackTypeCount]
 
StreamInfo m_selectedTrack [(uint) kTrackTypeCount]
 
vector< int > m_languagePreference
 language preferences for auto-selection of streams More...
 
MythCodecContextm_mythcodecctx {nullptr}
 
VideoDisplayProfile m_videoDisplayProfile
 

Detailed Description

Definition at line 33 of file nuppeldecoder.h.

Constructor & Destructor Documentation

◆ NuppelDecoder() [1/2]

NuppelDecoder::NuppelDecoder ( MythPlayer parent,
const ProgramInfo pginfo 
)

Definition at line 40 of file nuppeldecoder.cpp.

◆ ~NuppelDecoder()

NuppelDecoder::~NuppelDecoder ( )

Definition at line 70 of file nuppeldecoder.cpp.

◆ NuppelDecoder() [2/2]

NuppelDecoder::NuppelDecoder ( const NuppelDecoder )
privatedelete

Member Function Documentation

◆ CanHandle()

bool NuppelDecoder::CanHandle ( char  testbuf[kDecoderProbeBufferSize],
int  testbufsize = kDecoderProbeBufferSize 
)
static

Definition at line 92 of file nuppeldecoder.cpp.

Referenced by MythPlayer::CreateDecoder().

◆ OpenFile()

int NuppelDecoder::OpenFile ( RingBuffer rbuffer,
bool  novideo,
char  testbuf[kDecoderProbeBufferSize],
int  testbufsize = kDecoderProbeBufferSize 
)
overridevirtual

Implements DecoderBase.

Definition at line 155 of file nuppeldecoder.cpp.

◆ GetFrame()

bool NuppelDecoder::GetFrame ( DecodeType  Type,
bool Retry 
)
overridevirtual

Demux, preprocess and possibly decode a frame of video/audio.

Implements DecoderBase.

Definition at line 1028 of file nuppeldecoder.cpp.

Referenced by SeekReset().

◆ IsLastFrameKey()

bool NuppelDecoder::IsLastFrameKey ( void  ) const
inlineoverridevirtual

Implements DecoderBase.

Definition at line 49 of file nuppeldecoder.h.

◆ WriteStoredData()

void NuppelDecoder::WriteStoredData ( RingBuffer rb,
bool  storevid,
long  timecodeOffset 
)
overridevirtual

Implements DecoderBase.

Definition at line 997 of file nuppeldecoder.cpp.

◆ ClearStoredData()

void NuppelDecoder::ClearStoredData ( void  )
overridevirtual

Reimplemented from DecoderBase.

Definition at line 1018 of file nuppeldecoder.cpp.

◆ UpdateStoredFrameNum()

long NuppelDecoder::UpdateStoredFrameNum ( long  framenumber)
overridevirtual

Implements DecoderBase.

Definition at line 976 of file nuppeldecoder.cpp.

◆ GetCodecDecoderName()

QString NuppelDecoder::GetCodecDecoderName ( void  ) const
inlineoverridevirtual

Implements DecoderBase.

Definition at line 57 of file nuppeldecoder.h.

◆ GetRawEncodingType()

QString NuppelDecoder::GetRawEncodingType ( void  )
overridevirtual

Reimplemented from DecoderBase.

Definition at line 114 of file nuppeldecoder.cpp.

◆ GetVideoCodecID()

MythCodecID NuppelDecoder::GetVideoCodecID ( void  ) const
overridevirtual

Implements DecoderBase.

Definition at line 99 of file nuppeldecoder.cpp.

◆ operator=()

NuppelDecoder& NuppelDecoder::operator= ( const NuppelDecoder )
privatedelete

◆ ReadFileheader()

bool NuppelDecoder::ReadFileheader ( struct rtfileheader fh)
inlineprivate

Definition at line 121 of file nuppeldecoder.cpp.

Referenced by OpenFile().

◆ ReadFrameheader()

bool NuppelDecoder::ReadFrameheader ( struct rtframeheader fh)
inlineprivate

Definition at line 142 of file nuppeldecoder.cpp.

Referenced by GetFrame(), and OpenFile().

◆ DecodeFrame()

bool NuppelDecoder::DecodeFrame ( struct rtframeheader frameheader,
unsigned char *  lstrm,
VideoFrame frame 
)
private

Definition at line 783 of file nuppeldecoder.cpp.

Referenced by GetFrame().

◆ isValidFrametype()

bool NuppelDecoder::isValidFrametype ( char  type)
staticprivate

Definition at line 947 of file nuppeldecoder.cpp.

Referenced by GetFrame().

◆ InitAVCodecVideo()

bool NuppelDecoder::InitAVCodecVideo ( int  codec)
private

Definition at line 638 of file nuppeldecoder.cpp.

Referenced by DecodeFrame().

◆ CloseAVCodecVideo()

void NuppelDecoder::CloseAVCodecVideo ( void  )
private

Definition at line 715 of file nuppeldecoder.cpp.

Referenced by InitAVCodecVideo(), and ~NuppelDecoder().

◆ InitAVCodecAudio()

bool NuppelDecoder::InitAVCodecAudio ( int  codec)
private

Definition at line 723 of file nuppeldecoder.cpp.

Referenced by GetFrame().

◆ CloseAVCodecAudio()

void NuppelDecoder::CloseAVCodecAudio ( void  )
private

Definition at line 767 of file nuppeldecoder.cpp.

Referenced by InitAVCodecAudio(), and ~NuppelDecoder().

◆ StoreRawData()

void NuppelDecoder::StoreRawData ( unsigned char *  strm)
private

Definition at line 961 of file nuppeldecoder.cpp.

Referenced by GetFrame().

◆ SeekReset()

void NuppelDecoder::SeekReset ( long long  newKey = 0,
uint  skipFrames = 0,
bool  doFlush = false,
bool  discardFrames = false 
)
overrideprivatevirtual

Reimplemented from DecoderBase.

Definition at line 1349 of file nuppeldecoder.cpp.

Friends And Related Function Documentation

◆ get_nuppel_buffer

int get_nuppel_buffer ( struct AVCodecContext *  c,
AVFrame pic,
int  flags 
)
friend

Definition at line 616 of file nuppeldecoder.cpp.

Referenced by InitAVCodecVideo().

◆ release_nuppel_buffer

void release_nuppel_buffer ( void *  opaque,
uint8_t *  data 
)
friend

Definition at line 608 of file nuppeldecoder.cpp.

Member Data Documentation

◆ m_fileheader

struct rtfileheader NuppelDecoder::m_fileheader
private

Definition at line 85 of file nuppeldecoder.h.

Referenced by GetFrame(), NuppelDecoder(), and OpenFile().

◆ m_frameheader

struct rtframeheader NuppelDecoder::m_frameheader
private

Definition at line 86 of file nuppeldecoder.h.

Referenced by GetFrame(), NuppelDecoder(), and StoreRawData().

◆ m_rtjd

RTjpeg* NuppelDecoder::m_rtjd {nullptr}
private

Definition at line 88 of file nuppeldecoder.h.

Referenced by DecodeFrame(), NuppelDecoder(), and ~NuppelDecoder().

◆ m_video_width

int NuppelDecoder::m_video_width {0}
private

Definition at line 90 of file nuppeldecoder.h.

Referenced by DecodeFrame(), InitAVCodecVideo(), and OpenFile().

◆ m_video_height

int NuppelDecoder::m_video_height {0}
private

Definition at line 91 of file nuppeldecoder.h.

Referenced by DecodeFrame(), InitAVCodecVideo(), and OpenFile().

◆ m_video_size

int NuppelDecoder::m_video_size {0}
private

Definition at line 92 of file nuppeldecoder.h.

Referenced by DecodeFrame(), and OpenFile().

◆ m_video_frame_rate

double NuppelDecoder::m_video_frame_rate {0.0}
private

Definition at line 93 of file nuppeldecoder.h.

Referenced by GetFrame(), and OpenFile().

◆ m_audio_samplerate

int NuppelDecoder::m_audio_samplerate {44100}
private

Definition at line 94 of file nuppeldecoder.h.

Referenced by OpenFile().

◆ m_ffmpeg_extradatasize

int NuppelDecoder::m_ffmpeg_extradatasize {0}
private

Definition at line 99 of file nuppeldecoder.h.

Referenced by InitAVCodecVideo(), and OpenFile().

◆ m_ffmpeg_extradata

uint8_t* NuppelDecoder::m_ffmpeg_extradata {nullptr}
private

Definition at line 100 of file nuppeldecoder.h.

Referenced by InitAVCodecVideo(), OpenFile(), and ~NuppelDecoder().

◆ m_extradata

struct extendeddata NuppelDecoder::m_extradata
private

◆ m_usingextradata

bool NuppelDecoder::m_usingextradata {false}
private

Definition at line 103 of file nuppeldecoder.h.

Referenced by GetVideoCodecID(), InitAVCodecAudio(), InitAVCodecVideo(), and OpenFile().

◆ m_disablevideo

bool NuppelDecoder::m_disablevideo {false}
private

Definition at line 105 of file nuppeldecoder.h.

Referenced by OpenFile().

◆ m_totalLength

int NuppelDecoder::m_totalLength {0}
private

Definition at line 107 of file nuppeldecoder.h.

Referenced by OpenFile().

◆ m_totalFrames

long long NuppelDecoder::m_totalFrames {0}
private

Definition at line 108 of file nuppeldecoder.h.

Referenced by OpenFile().

◆ m_effdsp

int NuppelDecoder::m_effdsp {0}
private

Definition at line 110 of file nuppeldecoder.h.

Referenced by GetFrame(), and OpenFile().

◆ m_directframe

VideoFrame* NuppelDecoder::m_directframe {nullptr}
private

Definition at line 112 of file nuppeldecoder.h.

Referenced by DecodeFrame(), and GetFrame().

◆ m_decoded_video_frame

VideoFrame* NuppelDecoder::m_decoded_video_frame {nullptr}
private

Definition at line 113 of file nuppeldecoder.h.

Referenced by GetFrame(), and SeekReset().

◆ m_mpa_vidcodec

AVCodec* NuppelDecoder::m_mpa_vidcodec {nullptr}
private

◆ m_mpa_vidctx

AVCodecContext* NuppelDecoder::m_mpa_vidctx {nullptr}
private

◆ m_mpa_audcodec

AVCodec* NuppelDecoder::m_mpa_audcodec {nullptr}
private

Definition at line 117 of file nuppeldecoder.h.

Referenced by CloseAVCodecAudio(), GetFrame(), and InitAVCodecAudio().

◆ m_mpa_audctx

AVCodecContext* NuppelDecoder::m_mpa_audctx {nullptr}
private

Definition at line 118 of file nuppeldecoder.h.

Referenced by CloseAVCodecAudio(), GetFrame(), and InitAVCodecAudio().

◆ m_audioSamples

uint8_t* NuppelDecoder::m_audioSamples {nullptr}
private

Definition at line 119 of file nuppeldecoder.h.

Referenced by GetFrame(), NuppelDecoder(), and ~NuppelDecoder().

◆ m_directrendering

bool NuppelDecoder::m_directrendering {false}
private

Definition at line 121 of file nuppeldecoder.h.

Referenced by DecodeFrame(), and InitAVCodecVideo().

◆ m_lastct

char NuppelDecoder::m_lastct {'1'}
private

Definition at line 123 of file nuppeldecoder.h.

Referenced by DecodeFrame().

◆ m_strm

unsigned char* NuppelDecoder::m_strm {nullptr}
private

Definition at line 125 of file nuppeldecoder.h.

Referenced by GetFrame(), OpenFile(), and ~NuppelDecoder().

◆ m_buf

unsigned char* NuppelDecoder::m_buf {nullptr}
private

Definition at line 126 of file nuppeldecoder.h.

Referenced by DecodeFrame(), OpenFile(), and ~NuppelDecoder().

◆ m_buf2

unsigned char* NuppelDecoder::m_buf2 {nullptr}
private

Definition at line 127 of file nuppeldecoder.h.

Referenced by DecodeFrame(), and ~NuppelDecoder().

◆ m_planes

unsigned char* NuppelDecoder::m_planes[3]
private

Definition at line 128 of file nuppeldecoder.h.

Referenced by DecodeFrame(), and NuppelDecoder().

◆ m_storedData

list<RawDataList*> NuppelDecoder::m_storedData
private

◆ m_videosizetotal

int NuppelDecoder::m_videosizetotal {0}
private

Definition at line 132 of file nuppeldecoder.h.

Referenced by GetFrame(), and OpenFile().

◆ m_videoframesread

int NuppelDecoder::m_videoframesread {0}
private

Definition at line 133 of file nuppeldecoder.h.

Referenced by GetFrame(), and OpenFile().

◆ m_setreadahead

bool NuppelDecoder::m_setreadahead {false}
private

Definition at line 134 of file nuppeldecoder.h.

Referenced by GetFrame(), and OpenFile().


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