author JW Wang <>
Mon, 06 Jun 2016 16:17:15 +0800
changeset 375982 c305c4627f13211a1c718fa1f4f2ed69773fb14e
parent 368847 364b23a7463447bc3758ac30e32777848f39868c
child 380721 c2f3674be1f575f407ae0d065ee188c8b8c46857
permissions -rw-r--r--
Bug 1274466 - per discussion move some functions back to public. r?jya. MozReview-Commit-ID: BoTB5IKjuDD

/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
/* vim:set ts=2 sw=2 sts=2 et cindent: */
/* 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 */

#if !defined(WaveDecoder_h_)
#define WaveDecoder_h_

#include "PlatformDecoderModule.h"
#include "mp4_demuxer/ByteReader.h"

namespace mozilla {

class WaveDataDecoder : public MediaDataDecoder
  WaveDataDecoder(const AudioInfo& aConfig,
                  MediaDataDecoderCallback* aCallback);

  // Return true if mimetype is Wave
  static bool IsWave(const nsACString& aMimeType);

  RefPtr<InitPromise> Init() override;
  nsresult Input(MediaRawData* aSample) override;
  nsresult Flush() override;
  nsresult Drain() override;
  nsresult Shutdown() override;
  const char* GetDescriptionName() const override
    return "wave audio decoder";

  bool DoDecode(MediaRawData* aSample);

  const AudioInfo& mInfo;
  MediaDataDecoderCallback* mCallback;

} // namespace mozilla