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
 
QMutex m_mapLock { QMutex::Recursive }
 

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 23 of file mythavutil.h.

Constructor & Destructor Documentation

◆ MythCodecMap()

MythCodecMap::MythCodecMap ( )
default

◆ ~MythCodecMap()

MythCodecMap::~MythCodecMap ( )

Definition at line 236 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)
Note
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 289 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 301 of file mythavutil.cpp.

Referenced by ~MythCodecMap().

Member Data Documentation

◆ m_streamMap

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

Definition at line 36 of file mythavutil.h.

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

◆ m_mapLock

QMutex MythCodecMap::m_mapLock { QMutex::Recursive }
private

Definition at line 37 of file mythavutil.h.

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


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