2014-08-03 01:29:26 +04:00
|
|
|
/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
|
|
|
|
/* 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/. */
|
|
|
|
|
|
|
|
#ifndef GMPAudioDecoderParent_h_
|
|
|
|
#define GMPAudioDecoderParent_h_
|
|
|
|
|
|
|
|
#include "mozilla/RefPtr.h"
|
|
|
|
#include "gmp-audio-decode.h"
|
|
|
|
#include "gmp-audio-codec.h"
|
|
|
|
#include "mozilla/gmp/PGMPAudioDecoderParent.h"
|
|
|
|
#include "GMPMessageUtils.h"
|
|
|
|
#include "GMPAudioDecoderProxy.h"
|
|
|
|
|
|
|
|
namespace mozilla {
|
|
|
|
namespace gmp {
|
|
|
|
|
2015-02-10 13:48:42 +03:00
|
|
|
class GMPContentParent;
|
2014-08-03 01:29:26 +04:00
|
|
|
|
2015-03-21 19:28:04 +03:00
|
|
|
class GMPAudioDecoderParent final : public GMPAudioDecoderProxy
|
2015-03-27 21:52:19 +03:00
|
|
|
, public PGMPAudioDecoderParent
|
2014-08-03 01:29:26 +04:00
|
|
|
{
|
|
|
|
public:
|
|
|
|
NS_INLINE_DECL_REFCOUNTING(GMPAudioDecoderParent)
|
|
|
|
|
2015-02-10 13:48:42 +03:00
|
|
|
explicit GMPAudioDecoderParent(GMPContentParent *aPlugin);
|
2014-08-03 01:29:26 +04:00
|
|
|
|
|
|
|
nsresult Shutdown();
|
|
|
|
|
|
|
|
// GMPAudioDecoderProxy
|
|
|
|
virtual nsresult InitDecode(GMPAudioCodecType aCodecType,
|
|
|
|
uint32_t aChannelCount,
|
|
|
|
uint32_t aBitsPerChannel,
|
|
|
|
uint32_t aSamplesPerSecond,
|
|
|
|
nsTArray<uint8_t>& aExtraData,
|
2015-03-21 19:28:04 +03:00
|
|
|
GMPAudioDecoderCallbackProxy* aCallback) override;
|
|
|
|
virtual nsresult Decode(GMPAudioSamplesImpl& aInput) override;
|
|
|
|
virtual nsresult Reset() override;
|
|
|
|
virtual nsresult Drain() override;
|
|
|
|
virtual nsresult Close() override;
|
2014-08-03 01:29:26 +04:00
|
|
|
|
|
|
|
private:
|
|
|
|
~GMPAudioDecoderParent();
|
|
|
|
|
|
|
|
// PGMPAudioDecoderParent
|
2015-03-21 19:28:04 +03:00
|
|
|
virtual void ActorDestroy(ActorDestroyReason aWhy) override;
|
|
|
|
virtual bool RecvDecoded(const GMPAudioDecodedSampleData& aDecoded) override;
|
|
|
|
virtual bool RecvInputDataExhausted() override;
|
|
|
|
virtual bool RecvDrainComplete() override;
|
|
|
|
virtual bool RecvResetComplete() override;
|
|
|
|
virtual bool RecvError(const GMPErr& aError) override;
|
2015-02-10 13:48:42 +03:00
|
|
|
virtual bool RecvShutdown() override;
|
2015-03-21 19:28:04 +03:00
|
|
|
virtual bool Recv__delete__() override;
|
2014-08-03 01:29:26 +04:00
|
|
|
|
|
|
|
bool mIsOpen;
|
2014-10-14 02:04:59 +04:00
|
|
|
bool mShuttingDown;
|
2015-02-10 13:48:42 +03:00
|
|
|
nsRefPtr<GMPContentParent> mPlugin;
|
2015-01-20 08:39:00 +03:00
|
|
|
GMPAudioDecoderCallbackProxy* mCallback;
|
2014-08-03 01:29:26 +04:00
|
|
|
};
|
|
|
|
|
|
|
|
} // namespace gmp
|
|
|
|
} // namespace mozilla
|
|
|
|
|
|
|
|
#endif // GMPAudioDecoderParent_h_
|