MythTV  master
Public Member Functions | Protected Slots | Private Member Functions | Private Attributes | List of all members
avfDecoder Class Reference

#include <avfdecoder.h>

Inheritance diagram for avfDecoder:
Inheritance graph
[legend]
Collaboration diagram for avfDecoder:
Collaboration graph
[legend]

Public Member Functions

 avfDecoder (const QString &file, DecoderFactory *, AudioOutput *)
 
virtual ~avfDecoder (void)
 
bool initialize () override
 
double lengthInSeconds ()
 
void seek (double) override
 
void stop () override
 
- Public Member Functions inherited from Decoder
virtual ~Decoder ()
 
DecoderFactoryfactory () const
 
AudioOutputoutput ()
 
void setOutput (AudioOutput *)
 
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 ()
 
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=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 (unsigned long time=ULONG_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)
 

Protected Slots

void checkMetatdata (void)
 

Private Member Functions

void run () override
 Runs the Qt event loop unless we have a QRunnable, in which case we run the runnable run instead. More...
 
void deinit ()
 

Private Attributes

bool m_inited {false}
 
bool m_userStop {false}
 
int m_stat {0}
 
uint8_t * m_outputBuffer {nullptr}
 
bool m_finish {false}
 
long m_freq {0}
 
long m_bitrate {0}
 
int m_channels {0}
 
double m_seekTime {-1.0}
 
QString m_devicename
 
AVInputFormat * m_inputFormat {nullptr}
 
RemoteAVFormatContextm_inputContext {nullptr}
 
AVCodecContext * m_audioDec {nullptr}
 
bool m_inputIsFile {false}
 
QTimer * m_mdataTimer {nullptr}
 
QString m_lastMetadata
 
int m_errCode {0}
 

Additional Inherited Members

- Static Public Member Functions inherited from Decoder
static QStringList all ()
 
static bool supports (const QString &)
 
static void registerFactory (DecoderFactory *)
 
static Decodercreate (const QString &, AudioOutput *, bool=false)
 
- Static Public Member Functions inherited from MThread
static void ThreadSetup (const QString &)
 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)
 
- Static Public Attributes inherited from MThread
static const int kDefaultStartTimeout
 
- Protected Member Functions inherited from Decoder
 Decoder (DecoderFactory *d, AudioOutput *o)
 
QMutex * getMutex (void)
 
void error (const QString &)
 
- Protected Member Functions inherited from MThread
int exec (void)
 Enters the qt event loop. call exit or quit to exit thread. More...
 
- Static Protected Member Functions inherited from MThread
static void setTerminationEnabled (bool enabled=true)
 
static void sleep (unsigned long time)
 
static void msleep (unsigned long time)
 
static void usleep (unsigned long time)
 
- Protected Attributes inherited from Decoder
QString m_url
 
- Protected Attributes inherited from MThread
MThreadInternalm_thread {nullptr}
 
QRunnable * m_runnable {nullptr}
 
bool m_prolog_executed {true}
 
bool m_epilog_executed {true}
 
- Protected Attributes inherited from MythObservable
QMutex * m_lock {nullptr}
 
QSet< QObject * > m_listeners
 

Detailed Description

Definition at line 15 of file avfdecoder.h.

Constructor & Destructor Documentation

◆ avfDecoder()

avfDecoder::avfDecoder ( const QString &  file,
DecoderFactory d,
AudioOutput o 
)

Definition at line 237 of file avfdecoder.cpp.

◆ ~avfDecoder()

avfDecoder::~avfDecoder ( void  )
virtual

Definition at line 251 of file avfdecoder.cpp.

Member Function Documentation

◆ initialize()

bool avfDecoder::initialize ( )
overridevirtual

Implements Decoder.

Definition at line 269 of file avfdecoder.cpp.

◆ lengthInSeconds()

double avfDecoder::lengthInSeconds ( )

◆ seek()

void avfDecoder::seek ( double  pos)
overridevirtual

Implements Decoder.

Definition at line 401 of file avfdecoder.cpp.

◆ stop()

void avfDecoder::stop ( void  )
overridevirtual

Implements Decoder.

Definition at line 264 of file avfdecoder.cpp.

◆ checkMetatdata

void avfDecoder::checkMetatdata ( void  )
protectedslot

Definition at line 549 of file avfdecoder.cpp.

Referenced by initialize().

◆ run()

void avfDecoder::run ( void  )
overrideprivatevirtual

Runs the Qt event loop unless we have a QRunnable, in which case we run the runnable run instead.

Note
If you override this method you must call RunProlog before you do any work and RunEpilog before you exit the run method.

Reimplemented from MThread.

Definition at line 431 of file avfdecoder.cpp.

◆ deinit()

void avfDecoder::deinit ( )
private

Definition at line 410 of file avfdecoder.cpp.

Referenced by initialize(), run(), and ~avfDecoder().

Member Data Documentation

◆ m_inited

bool avfDecoder::m_inited {false}
private

Definition at line 36 of file avfdecoder.h.

Referenced by deinit(), initialize(), run(), and ~avfDecoder().

◆ m_userStop

bool avfDecoder::m_userStop {false}
private

Definition at line 37 of file avfdecoder.h.

Referenced by deinit(), initialize(), run(), and stop().

◆ m_stat

int avfDecoder::m_stat {0}
private

Definition at line 38 of file avfdecoder.h.

Referenced by deinit(), initialize(), and run().

◆ m_outputBuffer

uint8_t* avfDecoder::m_outputBuffer {nullptr}
private

Definition at line 39 of file avfdecoder.h.

Referenced by avfDecoder(), initialize(), run(), and ~avfDecoder().

◆ m_finish

bool avfDecoder::m_finish {false}
private

Definition at line 41 of file avfdecoder.h.

Referenced by deinit(), initialize(), and run().

◆ m_freq

long avfDecoder::m_freq {0}
private

Definition at line 42 of file avfdecoder.h.

Referenced by deinit(), and initialize().

◆ m_bitrate

long avfDecoder::m_bitrate {0}
private

Definition at line 43 of file avfdecoder.h.

Referenced by deinit(), and initialize().

◆ m_channels

int avfDecoder::m_channels {0}
private

Definition at line 44 of file avfdecoder.h.

Referenced by deinit(), and initialize().

◆ m_seekTime

double avfDecoder::m_seekTime {-1.0}
private

Definition at line 45 of file avfdecoder.h.

Referenced by initialize(), run(), and seek().

◆ m_devicename

QString avfDecoder::m_devicename
private

Definition at line 47 of file avfdecoder.h.

◆ m_inputFormat

AVInputFormat* avfDecoder::m_inputFormat {nullptr}
private

Definition at line 49 of file avfdecoder.h.

Referenced by deinit(), and initialize().

◆ m_inputContext

RemoteAVFormatContext* avfDecoder::m_inputContext {nullptr}
private

Definition at line 50 of file avfdecoder.h.

Referenced by checkMetatdata(), deinit(), initialize(), run(), seek(), and ~avfDecoder().

◆ m_audioDec

AVCodecContext* avfDecoder::m_audioDec {nullptr}
private

Definition at line 51 of file avfdecoder.h.

Referenced by deinit(), initialize(), and run().

◆ m_inputIsFile

bool avfDecoder::m_inputIsFile {false}
private

Definition at line 53 of file avfdecoder.h.

◆ m_mdataTimer

QTimer* avfDecoder::m_mdataTimer {nullptr}
private

Definition at line 55 of file avfdecoder.h.

Referenced by initialize(), and ~avfDecoder().

◆ m_lastMetadata

QString avfDecoder::m_lastMetadata
private

Definition at line 56 of file avfdecoder.h.

Referenced by checkMetatdata().

◆ m_errCode

int avfDecoder::m_errCode {0}
private

Definition at line 58 of file avfdecoder.h.


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