MythTV  master
Classes | 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]

Classes

struct  m_extraData
 
struct  m_fileHeader
 
struct  m_frameHeader
 

Public Member Functions

 NuppelDecoder (MythPlayer *parent, const ProgramInfo &pginfo)
 
 ~NuppelDecoder () override
 
 NuppelDecoder (const NuppelDecoder &)=delete
 
NuppelDecoderoperator= (const NuppelDecoder &)=delete
 
int OpenFile (MythMediaBuffer *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 (MythMediaBuffer *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 DecodeAll)
 
virtual QStringList GetTracks (uint Type)
 
virtual uint GetTrackCount (uint Type)
 
virtual int GetTrackLanguageIndex (uint Type, uint TrackNo)
 
virtual QString GetTrackDesc (uint Type, uint TrackNo)
 
virtual int SetTrack (uint Type, int TrackNo)
 
int GetTrack (uint Type)
 
StreamInfo GetTrackInfo (uint Type, uint TrackNo)
 
int ChangeTrack (uint Type, int Dir)
 
virtual bool InsertTrack (uint Type, const StreamInfo &Info)
 
int NextTrack (uint Type)
 
virtual int GetTeletextDecoderType (void) const
 
virtual QString GetXDS (const QString &) const
 
virtual QByteArray GetSubHeader (uint)
 
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) const
 
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

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

RTjpegm_rtjd {nullptr}
 
int m_videoWidth {0}
 
int m_videoHeight {0}
 
int m_videoSize {0}
 
double m_videoFrameRate {0.0}
 
int m_audioSamplerate {44100}
 
int m_ffmpegExtraDataSize {0}
 
uint8_t * m_ffmpegExtraData {nullptr}
 
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_decodedVideoFrame {nullptr}
 
AVCodec * m_mpaVidCodec {nullptr}
 
AVCodecContext * m_mpaVidCtx {nullptr}
 
AVCodec * m_mpaAudCodec {nullptr}
 
AVCodecContext * m_mpaAudCtx {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}
 
MythMediaBufferm_ringBuffer {nullptr}
 
double m_fps {29.97}
 
int m_fpsMultiplier {1}
 
int m_fpsSkip {0}
 
uint m_bitrate {4000}
 
int m_currentWidth {640}
 
int m_currentHeight {480}
 
float m_currentAspect {1.33333F}
 
long long m_framesPlayed {0}
 
long long m_framesRead {0}
 
unsigned long long m_frameCounter {0}
 
AVRational m_totalDuration
 
int m_keyframeDist {-1}
 
long long m_lastKey {0}
 
long long m_indexOffset {0}
 
MythAVCopy m_copyFrame
 
bool m_nextDecodedFrameIsKeyFrame { false }
 
EofState m_atEof {kEofStateNone}
 
bool m_trackTotalDuration {false}
 
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
 
QDateTime m_lastPositionMapUpdate
 
uint64_t m_seekSnap {UINT64_MAX}
 
bool m_dontSyncPositionMap {false}
 
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}
 
bool m_justAfterChange {false}
 
long long m_readAdjust {0}
 
int m_videoRotation {0}
 
QMutex m_trackLock { QMutex::Recursive }
 
bool m_decodeAllSubtitles { false }
 
int m_currentTrack [kTrackTypeCount] { -1 }
 
vector< StreamInfom_tracks [kTrackTypeCount]
 
StreamInfo m_wantedTrack [kTrackTypeCount]
 
StreamInfo m_selectedTrack [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 ( )
override

Definition at line 70 of file nuppeldecoder.cpp.

◆ NuppelDecoder() [2/2]

NuppelDecoder::NuppelDecoder ( const NuppelDecoder )
delete

Member Function Documentation

◆ operator=()

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

◆ 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 ( MythMediaBuffer 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 1017 of file nuppeldecoder.cpp.

Referenced by SeekReset().

◆ IsLastFrameKey()

bool NuppelDecoder::IsLastFrameKey ( void  ) const
inlineoverridevirtual

Implements DecoderBase.

Definition at line 53 of file nuppeldecoder.h.

◆ WriteStoredData()

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

Implements DecoderBase.

Definition at line 986 of file nuppeldecoder.cpp.

◆ ClearStoredData()

void NuppelDecoder::ClearStoredData ( void  )
overridevirtual

Reimplemented from DecoderBase.

Definition at line 1007 of file nuppeldecoder.cpp.

◆ UpdateStoredFrameNum()

long NuppelDecoder::UpdateStoredFrameNum ( long  framenumber)
overridevirtual

Implements DecoderBase.

Definition at line 967 of file nuppeldecoder.cpp.

◆ GetCodecDecoderName()

QString NuppelDecoder::GetCodecDecoderName ( void  ) const
inlineoverridevirtual

Implements DecoderBase.

Definition at line 61 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.

◆ 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 781 of file nuppeldecoder.cpp.

Referenced by GetFrame().

◆ isValidFrametype()

bool NuppelDecoder::isValidFrametype ( char  type)
staticprivate

Definition at line 940 of file nuppeldecoder.cpp.

Referenced by GetFrame().

◆ InitAVCodecVideo()

bool NuppelDecoder::InitAVCodecVideo ( int  codec)
private

Definition at line 634 of file nuppeldecoder.cpp.

Referenced by DecodeFrame().

◆ CloseAVCodecVideo()

void NuppelDecoder::CloseAVCodecVideo ( void  )
private

Definition at line 714 of file nuppeldecoder.cpp.

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

◆ InitAVCodecAudio()

bool NuppelDecoder::InitAVCodecAudio ( int  codec)
private

Definition at line 720 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 954 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 1336 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 614 of file nuppeldecoder.cpp.

Referenced by InitAVCodecVideo().

◆ release_nuppel_buffer

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

Definition at line 606 of file nuppeldecoder.cpp.

Member Data Documentation

◆ m_rtjd

RTjpeg* NuppelDecoder::m_rtjd {nullptr}
private

Definition at line 89 of file nuppeldecoder.h.

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

◆ m_videoWidth

int NuppelDecoder::m_videoWidth {0}
private

Definition at line 91 of file nuppeldecoder.h.

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

◆ m_videoHeight

int NuppelDecoder::m_videoHeight {0}
private

Definition at line 92 of file nuppeldecoder.h.

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

◆ m_videoSize

int NuppelDecoder::m_videoSize {0}
private

Definition at line 93 of file nuppeldecoder.h.

Referenced by DecodeFrame(), and OpenFile().

◆ m_videoFrameRate

double NuppelDecoder::m_videoFrameRate {0.0}
private

Definition at line 94 of file nuppeldecoder.h.

Referenced by GetFrame(), and OpenFile().

◆ m_audioSamplerate

int NuppelDecoder::m_audioSamplerate {44100}
private

Definition at line 95 of file nuppeldecoder.h.

Referenced by OpenFile().

◆ m_ffmpegExtraDataSize

int NuppelDecoder::m_ffmpegExtraDataSize {0}
private

Definition at line 100 of file nuppeldecoder.h.

Referenced by InitAVCodecVideo(), and OpenFile().

◆ m_ffmpegExtraData

uint8_t* NuppelDecoder::m_ffmpegExtraData {nullptr}
private

Definition at line 101 of file nuppeldecoder.h.

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

◆ m_usingExtraData

bool NuppelDecoder::m_usingExtraData {false}
private

Definition at line 104 of file nuppeldecoder.h.

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

◆ m_disableVideo

bool NuppelDecoder::m_disableVideo {false}
private

Definition at line 106 of file nuppeldecoder.h.

Referenced by OpenFile().

◆ m_totalLength

int NuppelDecoder::m_totalLength {0}
private

Definition at line 108 of file nuppeldecoder.h.

Referenced by OpenFile().

◆ m_totalFrames

long long NuppelDecoder::m_totalFrames {0}
private

Definition at line 109 of file nuppeldecoder.h.

Referenced by OpenFile().

◆ m_effDsp

int NuppelDecoder::m_effDsp {0}
private

Definition at line 111 of file nuppeldecoder.h.

Referenced by GetFrame(), and OpenFile().

◆ m_directFrame

VideoFrame* NuppelDecoder::m_directFrame {nullptr}
private

Definition at line 113 of file nuppeldecoder.h.

Referenced by DecodeFrame(), and GetFrame().

◆ m_decodedVideoFrame

VideoFrame* NuppelDecoder::m_decodedVideoFrame {nullptr}
private

Definition at line 114 of file nuppeldecoder.h.

Referenced by GetFrame(), and SeekReset().

◆ m_mpaVidCodec

AVCodec* NuppelDecoder::m_mpaVidCodec {nullptr}
private

◆ m_mpaVidCtx

AVCodecContext* NuppelDecoder::m_mpaVidCtx {nullptr}
private

◆ m_mpaAudCodec

AVCodec* NuppelDecoder::m_mpaAudCodec {nullptr}
private

Definition at line 118 of file nuppeldecoder.h.

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

◆ m_mpaAudCtx

AVCodecContext* NuppelDecoder::m_mpaAudCtx {nullptr}
private

Definition at line 119 of file nuppeldecoder.h.

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

◆ m_audioSamples

uint8_t* NuppelDecoder::m_audioSamples {nullptr}
private

Definition at line 120 of file nuppeldecoder.h.

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

◆ m_directRendering

bool NuppelDecoder::m_directRendering {false}
private

Definition at line 122 of file nuppeldecoder.h.

Referenced by DecodeFrame(), and InitAVCodecVideo().

◆ m_lastCt

char NuppelDecoder::m_lastCt {'1'}
private

Definition at line 124 of file nuppeldecoder.h.

Referenced by DecodeFrame().

◆ m_strm

unsigned char* NuppelDecoder::m_strm {nullptr}
private

Definition at line 126 of file nuppeldecoder.h.

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

◆ m_buf

unsigned char* NuppelDecoder::m_buf {nullptr}
private

Definition at line 127 of file nuppeldecoder.h.

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

◆ m_buf2

unsigned char* NuppelDecoder::m_buf2 {nullptr}
private

Definition at line 128 of file nuppeldecoder.h.

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

◆ m_planes

unsigned char* NuppelDecoder::m_planes[3] {}
private

Definition at line 129 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 133 of file nuppeldecoder.h.

Referenced by GetFrame(), and OpenFile().

◆ m_videoFramesRead

int NuppelDecoder::m_videoFramesRead {0}
private

Definition at line 134 of file nuppeldecoder.h.

Referenced by GetFrame(), and OpenFile().

◆ m_setReadAhead

bool NuppelDecoder::m_setReadAhead {false}
private

Definition at line 135 of file nuppeldecoder.h.

Referenced by GetFrame(), and OpenFile().


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