MythTV  master
Public Member Functions | Private Attributes | List of all members
MythCodecMap Class Reference

#include <mythavutil.h>

Public Member Functions

 MythCodecMap ()=default
 ~MythCodecMap ()
AVCodecContext * GetCodecContext (const AVStream *Stream, const AVCodec *Codec=nullptr, bool NullCodec=false)
AVCodecContext * FindCodecContext (const AVStream *Stream)
void FreeCodecContext (const AVStream *Stream)
void FreeAllContexts ()

Private Attributes

QMap< const AVStream *, AVCodecContext * > m_streamMap
QRecursiveMutex m_mapLock

Detailed Description

Utility class that keeps pointers to an AVStream and its AVCodecContext. The codec member of AVStream was previously used for this but is now deprecated.

Definition at line 29 of file mythavutil.h.

Constructor & Destructor Documentation

◆ MythCodecMap()

MythCodecMap::MythCodecMap ( )

◆ ~MythCodecMap()

MythCodecMap::~MythCodecMap ( )

Definition at line 282 of file mythavutil.cpp.

Member Function Documentation

◆ GetCodecContext()

AVCodecContext * MythCodecMap::GetCodecContext ( const AVStream *  Stream,
const AVCodec *  Codec = nullptr,
bool  NullCodec = false 

◆ FindCodecContext()

AVCodecContext * MythCodecMap::FindCodecContext ( const AVStream *  Stream)

◆ FreeCodecContext()

void MythCodecMap::FreeCodecContext ( const AVStream *  Stream)
This will not free a hardware or frames context that is in anyway referenced outside of the decoder. Probably need to force the VideoOutput class to discard buffers as well. Leaking hardware contexts is a very bad idea.

Definition at line 335 of file mythavutil.cpp.

Referenced by MythAVFormatWriter::AddVideoStream(), ThumbFinder::closeAVCodec(), AvFormatDecoder::CloseCodecs(), avfDecoder::deinit(), FreeAllContexts(), MythMediaCodecContext::GetBestSupportedCodec(), getFileInfo(), MythMMALContext::GetSupportedCodec(), grabThumbnail(), AvFormatDecoder::RemoveAudioStreams(), and AvFormatDecoder::ScanStreams().

◆ FreeAllContexts()

void MythCodecMap::FreeAllContexts ( )

Definition at line 347 of file mythavutil.cpp.

Referenced by ~MythCodecMap().

Member Data Documentation

◆ m_streamMap

QMap<const AVStream*, AVCodecContext*> MythCodecMap::m_streamMap

Definition at line 42 of file mythavutil.h.

Referenced by FindCodecContext(), FreeAllContexts(), FreeCodecContext(), and GetCodecContext().

◆ m_mapLock

QRecursiveMutex MythCodecMap::m_mapLock

Definition at line 46 of file mythavutil.h.

Referenced by FreeAllContexts(), FreeCodecContext(), and GetCodecContext().

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