1.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000 1.2 +++ b/content/media/wave/WaveDecoder.h Wed Dec 31 06:09:35 2014 +0100 1.3 @@ -0,0 +1,38 @@ 1.4 +/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ 1.5 +/* vim:set ts=2 sw=2 sts=2 et cindent: */ 1.6 +/* This Source Code Form is subject to the terms of the Mozilla Public 1.7 + * License, v. 2.0. If a copy of the MPL was not distributed with this 1.8 + * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ 1.9 +#if !defined(WaveDecoder_h_) 1.10 +#define WaveDecoder_h_ 1.11 + 1.12 +#include "MediaDecoder.h" 1.13 + 1.14 +/** 1.15 + * The decoder implementation is currently limited to Linear PCM encoded 1.16 + * audio data with one or two channels of 8- or 16-bit samples at sample 1.17 + * rates from 100 Hz to 96 kHz. The number of channels is limited by what 1.18 + * the audio backend (via AudioStream) currently supports. The supported 1.19 + * sample rate is artificially limited to arbitrarily selected sane values. 1.20 + * Support for additional channels (and other new features) would 1.21 + * require extending WaveDecoder to support parsing the newer 1.22 + * WAVE_FORMAT_EXTENSIBLE chunk format. 1.23 +**/ 1.24 + 1.25 +namespace mozilla { 1.26 + 1.27 +class WaveDecoder : public MediaDecoder 1.28 +{ 1.29 +public: 1.30 + virtual MediaDecoder* Clone() { 1.31 + if (!IsWaveEnabled()) { 1.32 + return nullptr; 1.33 + } 1.34 + return new WaveDecoder(); 1.35 + } 1.36 + virtual MediaDecoderStateMachine* CreateStateMachine(); 1.37 +}; 1.38 + 1.39 +} // namespace mozilla 1.40 + 1.41 +#endif