diff options
author | Thomas Reufer <thomas@reufer.ch> | 2014-01-07 16:31:12 +0100 |
---|---|---|
committer | Thomas Reufer <thomas@reufer.ch> | 2014-01-07 16:31:12 +0100 |
commit | 9512123c95324f1679d748993662bd9f08f6f763 (patch) | |
tree | d532e2af4d30847eeaaf69faf427c6f77fc5afb8 /audio.h | |
parent | 66cb725c2146b4fdeeed1dd201dd58be42104bab (diff) | |
download | vdr-plugin-rpihddevice-0.0.4.tar.gz vdr-plugin-rpihddevice-0.0.4.tar.bz2 |
2013-10-14: Version 0.0.40.0.4
-------------------------
- new:
- changed to libav for audio decoding
- added support multi-channel audio codecs
- added audio format/output options
- fixed:
- removed drawing of black box in front of console which lead to malfunction
due to memory bandwidth problem. console blank out will be handled with
video format/output options in future versions.
- missing
- trick modes
- deinterlacer
- video format/output options
- much more...
Diffstat (limited to 'audio.h')
-rw-r--r-- | audio.h | 85 |
1 files changed, 85 insertions, 0 deletions
@@ -0,0 +1,85 @@ +/* + * See the README file for copyright information and how to reach the author. + * + * $Id$ + */ + +#ifndef AUDIO_H +#define AUDIO_H + +extern "C" +{ +#include <libavcodec/avcodec.h> +} + +class cMutex; + +class cAudioDecoder +{ + +public: + + enum eCodec { + ePCM, + eMPG, + eAC3, + eEAC3, + eAAC, + eDTS, + eNumCodecs + }; + + enum ePort { + eLocal, + eHDMI + }; + + static const char* CodecStr(eCodec codec) + { + return (codec == ePCM) ? "PCM" : + (codec == eMPG) ? "MPG" : + (codec == eAC3) ? "AC3" : + (codec == eEAC3) ? "E-AC3" : + (codec == eAAC) ? "AAC" : + (codec == eDTS) ? "DTS" : "unknown"; + } + + cAudioDecoder(); + virtual ~cAudioDecoder(); + + virtual int Init(void); + virtual int DeInit(void); + + virtual bool SetupAudioCodec(const unsigned char *data, int length); + + virtual eCodec GetCodec(void) { return m_codec; } + virtual eCodec GetOutputFormat(void) { return m_outputFormat; } + virtual ePort GetOutputPort(void) { return m_outputPort; } + virtual int GetChannels(void) { return m_channels; } + virtual int GetSamplingrate(void) { return m_samplingRate; } + + virtual unsigned int DecodeAudio(const unsigned char *data, int length, + unsigned char *outbuf, int bufsize); + +private: + + struct Codec + { + AVCodec *codec; + AVCodecContext *context; + }; + + Codec m_codecs[eNumCodecs]; + eCodec m_codec; + eCodec m_outputFormat; + ePort m_outputPort; + int m_channels; + int m_samplingRate; + + bool m_passthrough; + + AVFrame *m_frame; + cMutex *m_mutex; +}; + +#endif |