2008-11-06 20:53:20 +00:00
|
|
|
/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
|
|
|
|
/* vim:set ts=2 sw=2 sts=2 et cindent: */
|
2012-05-21 11:12:37 +00:00
|
|
|
/* This Source Code Form is subject to the terms of the Mozilla Public
|
|
|
|
* License, v. 2.0. If a copy of the MPL was not distributed with this
|
|
|
|
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
|
2012-11-14 19:46:40 +00:00
|
|
|
#if !defined(WaveDecoder_h_)
|
|
|
|
#define WaveDecoder_h_
|
2008-11-06 20:53:20 +00:00
|
|
|
|
2012-11-14 19:46:40 +00:00
|
|
|
#include "MediaDecoder.h"
|
2008-11-06 20:53:20 +00:00
|
|
|
|
2011-03-30 05:37:42 +00:00
|
|
|
/**
|
|
|
|
* The decoder implementation is currently limited to Linear PCM encoded
|
|
|
|
* audio data with one or two channels of 8- or 16-bit samples at sample
|
|
|
|
* rates from 100 Hz to 96 kHz. The number of channels is limited by what
|
2013-03-19 04:12:36 +00:00
|
|
|
* the audio backend (via AudioStream) currently supports. The supported
|
|
|
|
* sample rate is artificially limited to arbitrarily selected sane values.
|
|
|
|
* Support for additional channels (and other new features) would
|
2012-11-14 19:46:40 +00:00
|
|
|
* require extending WaveDecoder to support parsing the newer
|
2011-03-30 05:37:42 +00:00
|
|
|
* WAVE_FORMAT_EXTENSIBLE chunk format.
|
|
|
|
**/
|
2008-11-06 20:53:20 +00:00
|
|
|
|
2012-11-14 19:45:33 +00:00
|
|
|
namespace mozilla {
|
2008-11-06 20:53:20 +00:00
|
|
|
|
2012-11-14 19:46:40 +00:00
|
|
|
class WaveDecoder : public MediaDecoder
|
2008-11-06 20:53:20 +00:00
|
|
|
{
|
2011-03-30 05:37:42 +00:00
|
|
|
public:
|
2012-11-14 19:46:40 +00:00
|
|
|
virtual MediaDecoder* Clone() {
|
2012-11-09 02:46:10 +00:00
|
|
|
if (!IsWaveEnabled()) {
|
2012-07-30 14:20:58 +00:00
|
|
|
return nullptr;
|
2012-03-31 00:52:07 +00:00
|
|
|
}
|
2012-11-14 19:46:40 +00:00
|
|
|
return new WaveDecoder();
|
2012-03-31 00:52:07 +00:00
|
|
|
}
|
2012-11-14 19:46:40 +00:00
|
|
|
virtual MediaDecoderStateMachine* CreateStateMachine();
|
2008-11-06 20:53:20 +00:00
|
|
|
};
|
|
|
|
|
2012-11-14 19:45:33 +00:00
|
|
|
} // namespace mozilla
|
|
|
|
|
2008-11-06 20:53:20 +00:00
|
|
|
#endif
|