MythTV
master
|
#include <libmythtv/Bluray/mythbddecoder.h>
Public Member Functions | |
MythBDDecoder (MythPlayer *Parent, const ProgramInfo &PGInfo, PlayerFlags Flags) | |
void | Reset (bool ResetVideoData, bool SeekReset, bool ResetFile) override |
void | UpdateFramesPlayed (void) override |
int | ReadPacket (AVFormatContext *Ctx, AVPacket *Pkt, bool &StorePacket) override |
Public Member Functions inherited from AvFormatDecoder | |
AvFormatDecoder (MythPlayer *parent, const ProgramInfo &pginfo, PlayerFlags flags) | |
~AvFormatDecoder () override | |
AvFormatDecoder (const AvFormatDecoder &)=delete | |
AvFormatDecoder & | operator= (const AvFormatDecoder &)=delete |
void | SetEof (bool eof) override |
MythCodecMap * | CodecMap (void) |
void | CloseCodecs () |
void | CloseContext () |
void | Reset (bool reset_video_data, bool seek_reset, bool reset_file) override |
int | OpenFile (MythMediaBuffer *Buffer, bool novideo, TestBufferVec &testbuf) override |
Open our file and set up or audio and video parameters. More... | |
bool | GetFrame (DecodeType Type, bool &Retry) override |
Demux, preprocess and possibly decode a frame of video/audio. More... | |
bool | IsLastFrameKey (void) const override |
QString | GetCodecDecoderName (void) const override |
QString | GetRawEncodingType (void) override |
MythCodecID | GetVideoCodecID (void) const override |
void | SetDisablePassThrough (bool disable) override |
Disables AC3/DTS pass through. More... | |
void | ForceSetupAudioStream (void) override |
void | AddTextData (unsigned char *buf, int len, int64_t timecode, char type) |
QString | GetTrackDesc (uint Type, uint TrackNo) override |
int | SetTrack (uint Type, int TrackNo) override |
int | ScanStreams (bool novideo) |
int | FindStreamInfo (void) |
int | GetNumChapters () override |
void | GetChapterTimes (QList< std::chrono::seconds > ×) override |
int | GetCurrentChapter (long long framesPlayed) override |
long long | GetChapter (int chapter) override |
bool | DoRewind (long long desiredFrame, bool discardFrames=true) override |
bool | DoFastForward (long long desiredFrame, bool discardFrames=true) override |
Skips ahead or rewinds to desiredFrame. More... | |
void | SetIdrOnlyKeyframes (bool value) override |
std::chrono::milliseconds | NormalizeVideoTimecode (std::chrono::milliseconds timecode) override |
virtual std::chrono::milliseconds | NormalizeVideoTimecode (AVStream *st, std::chrono::milliseconds timecode) |
int | GetTeletextDecoderType (void) const override |
QString | GetXDS (const QString &Key) const override |
QByteArray | GetSubHeader (uint TrackNo) override |
void | GetAttachmentData (uint TrackNo, QByteArray &Filename, QByteArray &Data) override |
bool | SetAudioByComponentTag (int Tag) override |
bool | SetVideoByComponentTag (int Tag) override |
virtual int | GetTeletextLanguage (uint Index) |
Returns TeleText language. More... | |
virtual int | GetCaptionLanguage (TrackType TrackType, int ServiceNum) |
Return ATSC Closed Caption Language. More... | |
virtual AudioTrackType | GetAudioTrackType (uint StreamIndex) |
Public Member Functions inherited from DecoderBase | |
DecoderBase (MythPlayer *parent, const ProgramInfo &pginfo) | |
virtual | ~DecoderBase () |
void | SetRenderFormats (const VideoFrameTypes *RenderFormats) |
virtual void | SetEofState (EofState 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 | SetWatchingRecording (bool mode) |
MythPlayer * | GetPlayer () |
std::chrono::milliseconds | TranslatePositionFrameToMs (long long position, float fallback_framerate, const frm_dir_map_t &cutlist) |
uint64_t | TranslatePositionMsToFrame (std::chrono::milliseconds dur_ms, float fallback_framerate, const frm_dir_map_t &cutlist) |
float | GetVideoAspect (void) const |
virtual double | GetFPS (void) const |
uint | GetRawBitrate (void) const |
Returns the estimated bitrate if the video were played at normal speed. More... | |
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) |
int | GetTrack (uint Type) |
StreamInfo | GetTrackInfo (uint Type, uint TrackNo) |
int | ChangeTrack (uint Type, int Dir) |
int | NextTrack (uint Type) |
void | SaveTotalDuration (void) |
void | ResetTotalDuration (void) |
void | SaveTotalFrames (void) |
void | TrackTotalDuration (bool track) |
int | GetfpsMultiplier (void) const |
MythCodecContext * | GetMythCodecContext (void) |
Protected Member Functions | |
bool | IsValidStream (int StreamId) override |
Protected Member Functions inherited from AvFormatDecoder | |
int | AutoSelectTrack (uint type) override |
Select best track. More... | |
void | ScanATSCCaptionStreams (int av_index) |
void | UpdateATSCCaptionTracks (void) |
void | UpdateCaptionTracksFromStreams (bool check_608, bool check_708) |
void | ScanTeletextCaptions (int av_index) |
void | ScanRawTextCaptions (int av_stream_index) |
void | ScanDSMCCStreams (AVBufferRef *pmt_section) |
Check to see whether there is a Network Boot Ifo sub-descriptor in the PMT which requires the MHEG application to reboot. More... | |
int | AutoSelectAudioTrack (void) |
Selects the best audio track. More... | |
int | filter_max_ch (const AVFormatContext *ic, const sinfo_vec_t &tracks, const std::vector< int > &fs, enum AVCodecID codecId=AV_CODEC_ID_NONE, int profile=-1) |
int | selectBestAudioTrack (int lang_key, const std::vector< int > &ftype) |
void | DecodeCCx08 (const uint8_t *buf, uint buf_size) |
void | InitVideoCodec (AVStream *stream, AVCodecContext *codecContext, bool selectedStream=false) |
void | MpegPreProcessPkt (AVCodecContext *codecContext, AVStream *stream, AVPacket *pkt) |
Preprocess a packet, setting the video parms if necessary. More... | |
int | H264PreProcessPkt (AVCodecContext *codecContext, AVStream *stream, AVPacket *pkt) |
bool | PreProcessVideoPacket (AVCodecContext *codecContext, AVStream *stream, AVPacket *pkt) |
virtual bool | ProcessVideoPacket (AVCodecContext *codecContext, AVStream *stream, AVPacket *pkt, bool &Retry) |
virtual bool | ProcessVideoFrame (AVCodecContext *codecContext, AVStream *Stream, AVFrame *AvFrame) |
bool | ProcessAudioPacket (AVCodecContext *codecContext, AVStream *stream, AVPacket *pkt, DecodeType decodetype) |
bool | ProcessSubtitlePacket (AVCodecContext *codecContext, AVStream *stream, AVPacket *pkt) |
bool | ProcessRawTextPacket (AVPacket *Packet) |
virtual bool | ProcessDataPacket (AVStream *curstream, AVPacket *pkt, DecodeType decodetype) |
void | ProcessVBIDataPacket (const AVStream *stream, const AVPacket *pkt) |
Process ivtv proprietary embedded vertical blanking interval captions. More... | |
void | ProcessDVBDataPacket (const AVStream *stream, const AVPacket *pkt) |
Process DVB Teletext. More... | |
void | ProcessDSMCCPacket (const AVStream *stream, const AVPacket *pkt) |
Process DSMCC object carousel packet. More... | |
void | SeekReset (long long newkey, uint skipFrames, bool doFlush, bool discardFrames) override |
bool | DecoderWillDownmix (const AVCodecContext *ctx) |
bool | DoPassThrough (const AVCodecParameters *par, bool withProfile=true) |
bool | SetupAudioStream (void) |
Reinitializes audio if it needs to be reinitialized. More... | |
void | SetupAudioStreamSubIndexes (int streamIndex) |
Reacts to DUAL/STEREO changes on the fly and fix streams. More... | |
void | RemoveAudioStreams () |
remove audio streams from the context used by dvd code during title transitions to remove stale audio streams More... | |
void | HandleGopStart (AVPacket *pkt, bool can_reliably_parse_keyframes) |
Update our position map, keyframe distance, and the like. More... | |
bool | GenerateDummyVideoFrames (void) |
bool | HasVideo () |
float | GetVideoFrameRate (AVStream *Stream, AVCodecContext *Context, bool Sanitise=false) |
bool | OpenAVCodec (AVCodecContext *avctx, const AVCodec *codec) |
void | UpdateFramesPlayed (void) override |
bool | DoRewindSeek (long long desiredFrame) override |
void | DoFastForwardSeek (long long desiredFrame, bool &needflush) override |
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... | |
virtual void | PostProcessTracks (void) |
int | DecodeAudio (AVCodecContext *ctx, uint8_t *buffer, int &data_size, AVPacket *pkt) |
bool | FlagIsSet (PlayerFlags arg) |
int | autoSelectVideoTrack (int &scanerror) |
void | remove_tracks_not_in_same_AVProgram (int stream_index) |
int | get_current_AVStream_index (TrackType type) |
AVProgram * | get_current_AVProgram () |
bool | do_av_seek (long long desiredFrame, bool discardFrames, int flags) |
Protected Member Functions inherited from DecoderBase | |
int | BestTrack (uint Type, bool forcedPreferred, int preferredLanguage=0) |
Determine the best track according to weights. More... | |
void | AutoSelectTracks (void) |
void | ResetTracks (void) |
void | FileChanged (void) |
long long | ConditionallyUpdatePosMap (long long desiredFrame) |
long long | GetLastFrameInPosMap (void) const |
unsigned long | GetPositionMapSize (void) const |
long long | GetKey (const PosMapEntry &entry) const |
Private Member Functions | |
bool | DoRewindSeek (long long DesiredFrame) override |
void | DoFastForwardSeek (long long DesiredFrame, bool &Needflush) override |
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... | |
void | StreamChangeCheck (void) override |
int | GetSubtitleLanguage (uint SubtitleIndex, uint StreamIndex) override |
Returns DVD Subtitle language. More... | |
int | GetAudioLanguage (uint AudioIndex, uint StreamIndex) override |
long long | BDFindPosition (long long DesiredFrame) |
Additional Inherited Members | |
Static Public Member Functions inherited from AvFormatDecoder | |
static bool | CanHandle (TestBufferVec &testbuf, const QString &filename) |
Perform an av_probe_input_format on the passed data to see if we can decode it with this class. More... | |
static int | GetMaxReferenceFrames (AVCodecContext *Context) |
static void | streams_changed (void *data, int avprogram_id) |
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) |
static AVPixelFormat | GetBestVideoFormat (AVPixelFormat *Formats, const VideoFrameTypes *RenderFormats) |
Find a suitable frame format that is mutually acceptable to the decoder and render device. More... | |
Static Protected Member Functions inherited from AvFormatDecoder | |
static void | av_update_stream_timings_video (AVFormatContext *ic) |
Protected Attributes inherited from AvFormatDecoder | |
bool | m_isDbIgnored |
AVCParser * | m_avcParser {nullptr} |
AVFormatContext * | m_ic {nullptr} |
MythCodecMap | m_codecMap |
int | m_frameDecoded {0} |
MythVideoFrame * | m_decodedVideoFrame {nullptr} |
MythAVFormatBuffer * | m_avfRingBuffer {nullptr} |
struct SwsContext * | m_swsCtx {nullptr} |
bool | m_directRendering {false} |
bool | m_gopSet {false} |
bool | m_seenGop {false} |
A flag to indicate that we've seen a GOP frame. Used in junction with seq_count. More... | |
int | m_seqCount {0} |
A counter used to determine if we need to force a call to HandleGopStart. More... | |
QList< AVPacket * > | m_storedPackets |
int | m_prevGopPos {0} |
bool | m_gotVideoFrame {false} |
bool | m_hasVideo {false} |
bool | m_needDummyVideoFrames {false} |
bool | m_skipAudio {false} |
bool | m_allowedQuit {false} |
uint32_t | m_startCodeState {0xffffffff} |
std::chrono::milliseconds | m_lastVPts {0ms} |
std::chrono::milliseconds | m_lastAPts {0ms} |
std::chrono::microseconds | m_lastCcPtsu {0ms} |
std::chrono::milliseconds | m_firstVPts {0ms} |
bool | m_firstVPtsInuse {false} |
PlayerFlags | m_playerFlags |
MythCodecID | m_videoCodecId {kCodec_NONE} |
int | m_maxKeyframeDist {-1} |
int | m_averrorCount {0} |
CC608Decoder * | m_ccd608 {nullptr} |
CC708Decoder * | m_ccd708 {nullptr} |
TeletextDecoder * | m_ttd {nullptr} |
std::array< bool, 68 > | m_ccX08InPmt {} |
Lookup table for whether a stream was seen in the PMT entries 0-3 correspond to CEA-608 CC1 through CC4, while entries 4-67 corresport to CEA-708 streams 0 through 64. More... | |
std::array< bool, 68 > | m_ccX08InTracks {} |
Lookup table for whether a stream is represented in the UI entries 0-3 correspond to CEA-608 CC1 through CC4, while entries 4-67 corresport to CEA-708 streams 0 through 64. More... | |
QList< StreamInfo > | m_pmtTracks |
StreamInfo for 608 and 708 Captions seen in the PMT descriptor. More... | |
QList< TrackType > | m_pmtTrackTypes |
TrackType (608 or 708) for Captions seen in the PMT descriptor. More... | |
QList< StreamInfo > | m_streamTracks |
StreamInfo for 608 and 708 Captions seen in the caption stream itself but not seen in the PMT. More... | |
QList< TrackType > | m_streamTrackTypes |
TrackType (608 or 708) for Captions seen in the caption stream itself but not seen in the PMT. More... | |
InteractiveTV * | m_itv {nullptr} |
MHEG/MHP decoder. More... | |
uint8_t * | m_audioSamples {nullptr} |
bool | m_disablePassthru {false} |
AudioInfo | m_audioIn |
AudioInfo | m_audioOut |
bool | m_processFrames {true} |
bool | m_streamsChanged { false } |
bool | m_resetHardwareDecoders { false } |
std::chrono::milliseconds | m_audioReadAhead {100ms} |
QRecursiveMutex | m_avCodecLock |
Protected Attributes inherited from DecoderBase | |
MythPlayer * | m_parent {nullptr} |
ProgramInfo * | m_playbackInfo {nullptr} |
AudioPlayer * | m_audio {nullptr} |
MythMediaBuffer * | m_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} |
uint64_t | m_frameCounter {0} |
MythAVRational | m_totalDuration {0} |
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} |
QRecursiveMutex | m_positionMapLock |
std::vector< PosMapEntry > | m_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_errored {false} |
bool | m_waitingForChange {false} |
bool | m_justAfterChange {false} |
long long | m_readAdjust {0} |
int | m_videoRotation {0} |
uint | m_stereo3D {0} |
QRecursiveMutex | m_trackLock |
bool | m_decodeAllSubtitles { false } |
std::array< int, kTrackTypeCount > | m_currentTrack {} |
std::array< sinfo_vec_t, kTrackTypeCount > | m_tracks |
std::array< StreamInfo, kTrackTypeCount > | m_wantedTrack |
std::array< StreamInfo, kTrackTypeCount > | m_selectedTrack |
std::array< StreamInfo, kTrackTypeCount > | m_selectedForcedTrack |
std::vector< int > | m_languagePreference |
language preferences for auto-selection of streams More... | |
MythCodecContext * | m_mythCodecCtx { nullptr } |
MythVideoProfile | m_videoDisplayProfile |
const VideoFrameTypes * | m_renderFormats { &MythVideoFrame::kDefaultRenderFormats } |
Definition at line 7 of file mythbddecoder.h.
MythBDDecoder::MythBDDecoder | ( | MythPlayer * | Parent, |
const ProgramInfo & | PGInfo, | ||
PlayerFlags | Flags | ||
) |
Definition at line 9 of file mythbddecoder.cpp.
Reimplemented from DecoderBase.
Definition at line 21 of file mythbddecoder.cpp.
Referenced by StreamChangeCheck().
|
overridevirtual |
Reimplemented from DecoderBase.
Definition at line 27 of file mythbddecoder.cpp.
Referenced by StreamChangeCheck().
|
overridevirtual |
Reimplemented from AvFormatDecoder.
Definition at line 106 of file mythbddecoder.cpp.
|
overrideprotectedvirtual |
Reimplemented from AvFormatDecoder.
Definition at line 14 of file mythbddecoder.cpp.
|
overrideprivatevirtual |
Reimplemented from DecoderBase.
Definition at line 37 of file mythbddecoder.cpp.
|
overrideprivatevirtual |
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.
The seek is not made if framesPlayed is greater than the keyframe this would jump too. This means that frame-by-frame seeking after a keyframe must be done elsewhere.
If the seek is made the needflush parameter is set.
desiredFrame | frame we are attempting to seek to. |
needflush | set to true if a seek is made. |
Reimplemented from DecoderBase.
Definition at line 48 of file mythbddecoder.cpp.
|
overrideprivatevirtual |
Reimplemented from AvFormatDecoder.
Definition at line 59 of file mythbddecoder.cpp.
Returns DVD Subtitle language.
Reimplemented from AvFormatDecoder.
Definition at line 84 of file mythbddecoder.cpp.
Reimplemented from AvFormatDecoder.
Definition at line 95 of file mythbddecoder.cpp.
|
private |
Definition at line 135 of file mythbddecoder.cpp.
Referenced by DoFastForwardSeek(), and DoRewindSeek().