MythTV  master
Public Member Functions | Static Public Member Functions | Protected Member Functions | Protected Attributes | Private Attributes | List of all members
Decoder Class Referenceabstract

#include <mythplugins/mythmusic/mythmusic/decoder.h>

Inheritance diagram for Decoder:
[legend]
Collaboration diagram for Decoder:
[legend]

Public Member Functions

 ~Decoder () override
 
virtual bool initialize ()=0
 
virtual void seek (double)=0
 
virtual void stop ()=0
 
DecoderFactoryfactory () const
 
AudioOutputoutput ()
 
void setOutput (AudioOutput *o)
 
void setURL (const QString &url)
 
virtual void lock (void)
 
virtual void unlock (void)
 
virtual bool tryLock (void)
 
QWaitCondition * cond ()
 
QString getURL (void) const
 
- Public Member Functions inherited from MThread
 MThread (const QString &objectName)
 Standard constructor. More...
 
 MThread (const QString &objectName, QRunnable *runnable)
 Use this constructor if you want the default run() method to run the QRunnable's run() method instead of entering the Qt event loop. More...
 
virtual ~MThread ()
 
 MThread (const MThread &)=delete
 
MThreadoperator= (const MThread &)=delete
 
void RunProlog (void)
 Sets up a thread, call this if you reimplement run(). More...
 
void RunEpilog (void)
 Cleans up a thread's resources, call this if you reimplement run(). More...
 
QThread * qthread (void)
 Returns the thread, this will always return the same pointer no matter how often you restart the thread. More...
 
void setObjectName (const QString &name)
 
QString objectName (void) const
 
void setPriority (QThread::Priority priority)
 
QThread::Priority priority (void) const
 
bool isFinished (void) const
 
bool isRunning (void) const
 
void setStackSize (uint stackSize)
 
uint stackSize (void) const
 
void exit (int retcode=0)
 Use this to exit from the thread if you are using a Qt event loop. More...
 
void start (QThread::Priority p=QThread::InheritPriority)
 Tell MThread to start running the thread in the near future. More...
 
void terminate (void)
 Kill a thread unsafely. More...
 
void quit (void)
 calls exit(0) More...
 
bool wait (std::chrono::milliseconds time=std::chrono::milliseconds::max())
 Wait for the MThread to exit, with a maximum timeout. More...
 
- Public Member Functions inherited from MythObservable
 MythObservable ()
 
virtual ~MythObservable ()
 
void addListener (QObject *listener)
 Add a listener to the observable. More...
 
void removeListener (QObject *listener)
 Remove a listener to the observable. More...
 
void dispatch (const MythEvent &event)
 Dispatch an event to all listeners. More...
 
bool hasListeners (void)
 

Static Public Member Functions

static QStringList all ()
 
static bool supports (const QString &source)
 
static void registerFactory (DecoderFactory *fact)
 
static Decodercreate (const QString &source, AudioOutput *output, bool deletable=false)
 
- Static Public Member Functions inherited from MThread
static void ThreadSetup (const QString &name)
 This is to be called on startup in those few threads that haven't been ported to MThread. More...
 
static void ThreadCleanup (void)
 This is to be called on exit in those few threads that haven't been ported to MThread. More...
 
static void Cleanup (void)
 This will print out all the running threads, call exit(1) on each and then wait up to 5 seconds total for all the threads to exit. More...
 
static void GetAllThreadNames (QStringList &list)
 
static void GetAllRunningThreadNames (QStringList &list)
 

Protected Member Functions

 Decoder (DecoderFactory *d, AudioOutput *o)
 
QMutex * getMutex (void)
 
void error (const QString &e)
 
- Protected Member Functions inherited from MThread
virtual void run (void)
 Runs the Qt event loop unless we have a QRunnable, in which case we run the runnable run instead. More...
 
int exec (void)
 Enters the qt event loop. call exit or quit to exit thread. More...
 

Protected Attributes

QString m_url
 
- Protected Attributes inherited from MThread
MThreadInternalm_thread {nullptr}
 
QRunnable * m_runnable {nullptr}
 
bool m_prologExecuted {true}
 
bool m_epilogExecuted {true}
 
- Protected Attributes inherited from MythObservable
QMutex * m_lock {nullptr}
 
QSet< QObject * > m_listeners
 

Private Attributes

DecoderFactorym_fctry {nullptr}
 
AudioOutputm_out {nullptr}
 
QMutex m_mtx
 
QWaitCondition m_cnd
 

Additional Inherited Members

- Static Protected Member Functions inherited from MThread
static void setTerminationEnabled (bool enabled=true)
 
static void usleep (std::chrono::microseconds time)
 
template<typename R , typename P >
static std::enable_if_t< std::chrono::treat_as_floating_point< R >::value, void > usleep (std::chrono::duration< R, P > time)
 

Detailed Description

Definition at line 70 of file decoder.h.

Constructor & Destructor Documentation

◆ ~Decoder()

Decoder::~Decoder ( )
override

Definition at line 31 of file decoder.cpp.

◆ Decoder()

Decoder::Decoder ( DecoderFactory d,
AudioOutput o 
)
inlineprotected

Definition at line 100 of file decoder.h.

Member Function Documentation

◆ initialize()

virtual bool Decoder::initialize ( )
pure virtual

Implemented in CdDecoder, and avfDecoder.

Referenced by MusicPlayer::decoderHandlerReady().

◆ seek()

virtual void Decoder::seek ( double  )
pure virtual

Implemented in CdDecoder, and avfDecoder.

Referenced by MusicCommon::seek(), and MusicPlayer::seek().

◆ stop()

virtual void Decoder::stop ( )
pure virtual

◆ factory()

DecoderFactory* Decoder::factory ( ) const
inline

Definition at line 79 of file decoder.h.

Referenced by all(), create(), DecoderHandler::doConnectDecoder(), and supports().

◆ output()

AudioOutput* Decoder::output ( )
inline

◆ setOutput()

void Decoder::setOutput ( AudioOutput o)

◆ setURL()

void Decoder::setURL ( const QString &  url)
inline

◆ lock()

virtual void Decoder::lock ( void  )
inlinevirtual

◆ unlock()

virtual void Decoder::unlock ( void  )
inlinevirtual

Definition at line 86 of file decoder.h.

Referenced by MusicPlayer::pause(), MusicCommon::seek(), setOutput(), and DecoderHandler::stop().

◆ tryLock()

virtual bool Decoder::tryLock ( void  )
inlinevirtual

Definition at line 87 of file decoder.h.

◆ cond()

QWaitCondition* Decoder::cond ( )
inline

Definition at line 89 of file decoder.h.

Referenced by MusicPlayer::pause(), and DecoderHandler::stop().

◆ getURL()

QString Decoder::getURL ( void  ) const
inline

◆ all()

QStringList Decoder::all ( )
static

Definition at line 74 of file decoder.cpp.

◆ supports()

bool Decoder::supports ( const QString &  source)
static

Definition at line 84 of file decoder.cpp.

◆ registerFactory()

void Decoder::registerFactory ( DecoderFactory fact)
static

Definition at line 93 of file decoder.cpp.

Referenced by checkFactories().

◆ create()

Decoder * Decoder::create ( const QString &  source,
AudioOutput output,
bool  deletable = false 
)
static

Definition at line 98 of file decoder.cpp.

Referenced by DecoderHandler::doConnectDecoder().

◆ getMutex()

QMutex* Decoder::getMutex ( void  )
inlineprotected

Definition at line 102 of file decoder.h.

◆ error()

void Decoder::error ( const QString &  e)
protected

Definition at line 51 of file decoder.cpp.

Referenced by avfDecoder::initialize().

Member Data Documentation

◆ m_url

QString Decoder::m_url
protected

Definition at line 105 of file decoder.h.

Referenced by getURL(), avfDecoder::initialize(), avfDecoder::run(), and setURL().

◆ m_fctry

DecoderFactory* Decoder::m_fctry {nullptr}
private

Definition at line 108 of file decoder.h.

Referenced by factory(), and ~Decoder().

◆ m_out

AudioOutput* Decoder::m_out {nullptr}
private

Definition at line 110 of file decoder.h.

Referenced by output(), setOutput(), and ~Decoder().

◆ m_mtx

QMutex Decoder::m_mtx
private

Definition at line 112 of file decoder.h.

Referenced by getMutex(), lock(), tryLock(), and unlock().

◆ m_cnd

QWaitCondition Decoder::m_cnd
private

Definition at line 113 of file decoder.h.

Referenced by cond().


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