diff options
| author | Błażej Szczygieł <spaz16@wp.pl> | 2016-10-17 17:13:34 +0200 |
|---|---|---|
| committer | Błażej Szczygieł <spaz16@wp.pl> | 2016-10-17 19:22:33 +0200 |
| commit | 2d77a6f5d3beae3b341e4a7f331202bd1a010508 (patch) | |
| tree | b66b2e2745e6b7ee11905cb6881643604c1e3830 /thirdparty/libsimplewebm/OpusVorbisDecoder.hpp | |
| parent | c4b7c7d81bf3d4750aa5a824ec108ba121565c48 (diff) | |
| download | redot-engine-2d77a6f5d3beae3b341e4a7f331202bd1a010508.tar.gz | |
Add libsimplewebm and libwebm thirdparty libraries
Diffstat (limited to 'thirdparty/libsimplewebm/OpusVorbisDecoder.hpp')
| -rw-r--r-- | thirdparty/libsimplewebm/OpusVorbisDecoder.hpp | 63 |
1 files changed, 63 insertions, 0 deletions
diff --git a/thirdparty/libsimplewebm/OpusVorbisDecoder.hpp b/thirdparty/libsimplewebm/OpusVorbisDecoder.hpp new file mode 100644 index 0000000000..bcdca731ee --- /dev/null +++ b/thirdparty/libsimplewebm/OpusVorbisDecoder.hpp @@ -0,0 +1,63 @@ +/* + MIT License + + Copyright (c) 2016 Błażej Szczygieł + + Permission is hereby granted, free of charge, to any person obtaining a copy + of this software and associated documentation files (the "Software"), to deal + in the Software without restriction, including without limitation the rights + to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + copies of the Software, and to permit persons to whom the Software is + furnished to do so, subject to the following conditions: + + The above copyright notice and this permission notice shall be included in all + copies or substantial portions of the Software. + + THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + SOFTWARE. +*/ + +#ifndef OPUSVORBISDECODER_HPP +#define OPUSVORBISDECODER_HPP + +#include "WebMDemuxer.hpp" + +struct VorbisDecoder; +struct OpusDecoder; + +class OpusVorbisDecoder +{ + OpusVorbisDecoder(const OpusVorbisDecoder &); + void operator =(const OpusVorbisDecoder &); +public: + OpusVorbisDecoder(const WebMDemuxer &demuxer); + ~OpusVorbisDecoder(); + + bool isOpen() const; + + inline int getBufferSamples() const + { + return m_numSamples; + } + + bool getPCMS16(WebMFrame &frame, short *buffer, int &numOutSamples); + +private: + bool openVorbis(const WebMDemuxer &demuxer); + bool openOpus(const WebMDemuxer &demuxer); + + void close(); + + VorbisDecoder *m_vorbis; + OpusDecoder *m_opus; + int m_numSamples; + int m_channels; + +}; + +#endif // OPUSVORBISDECODER_HPP |
