2010-11-16 20:14:19 -08:00
|
|
|
/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
|
|
|
|
/* vim: set sw=4 ts=8 et tw=80 : */
|
2012-05-21 04:12:37 -07: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/. */
|
2010-11-16 20:14:19 -08:00
|
|
|
|
|
|
|
#ifndef mozilla_dom_AudioChild_h
|
|
|
|
#define mozilla_dom_AudioChild_h
|
|
|
|
|
|
|
|
#include "mozilla/dom/PAudioChild.h"
|
2011-04-29 12:21:57 -07:00
|
|
|
#include "mozilla/ReentrantMonitor.h"
|
2010-11-16 20:14:19 -08:00
|
|
|
|
|
|
|
namespace mozilla {
|
|
|
|
namespace dom {
|
|
|
|
|
|
|
|
class AudioChild : public PAudioChild
|
|
|
|
{
|
|
|
|
public:
|
2010-11-25 20:13:54 -08:00
|
|
|
NS_IMETHOD_(nsrefcnt) AddRef();
|
|
|
|
NS_IMETHOD_(nsrefcnt) Release();
|
|
|
|
|
2010-11-16 20:14:19 -08:00
|
|
|
AudioChild();
|
|
|
|
virtual ~AudioChild();
|
2012-08-22 08:56:38 -07:00
|
|
|
virtual bool RecvPositionInFramesUpdate(const int64_t&, const int64_t&);
|
2010-11-29 21:37:32 -08:00
|
|
|
virtual bool RecvDrainDone();
|
2012-08-22 08:56:38 -07:00
|
|
|
virtual int32_t WaitForMinWriteSize();
|
|
|
|
virtual bool RecvMinWriteSizeDone(const int32_t& frameCount);
|
2010-11-29 21:37:32 -08:00
|
|
|
virtual void WaitForDrain();
|
2012-07-01 21:59:43 -07:00
|
|
|
virtual bool RecvWriteDone();
|
|
|
|
virtual void WaitForWrite();
|
2010-11-25 20:13:54 -08:00
|
|
|
virtual void ActorDestroy(ActorDestroyReason);
|
2011-05-15 03:53:55 -07:00
|
|
|
|
2012-08-22 08:56:38 -07:00
|
|
|
int64_t GetLastKnownPosition();
|
|
|
|
int64_t GetLastKnownPositionTimestamp();
|
2010-11-25 20:13:54 -08:00
|
|
|
|
2011-09-28 23:19:26 -07:00
|
|
|
bool IsIPCOpen() { return mIPCOpen; };
|
2010-11-16 20:14:19 -08:00
|
|
|
private:
|
2010-11-25 20:13:54 -08:00
|
|
|
nsAutoRefCnt mRefCnt;
|
|
|
|
NS_DECL_OWNINGTHREAD
|
2012-08-22 08:56:38 -07:00
|
|
|
int64_t mLastPosition;
|
|
|
|
int64_t mLastPositionTimestamp;
|
|
|
|
uint64_t mWriteCounter;
|
|
|
|
int32_t mMinWriteSize;
|
2011-04-29 12:21:57 -07:00
|
|
|
mozilla::ReentrantMonitor mAudioReentrantMonitor;
|
2011-09-28 23:19:26 -07:00
|
|
|
bool mIPCOpen;
|
|
|
|
bool mDrained;
|
2010-11-16 20:14:19 -08:00
|
|
|
};
|
|
|
|
|
|
|
|
} // namespace dom
|
|
|
|
} // namespace mozilla
|
|
|
|
|
|
|
|
#endif
|