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();
|
2011-09-26 20:31:18 -07:00
|
|
|
virtual bool RecvPositionInFramesUpdate(const PRInt64&, const PRInt64&);
|
2010-11-29 21:37:32 -08:00
|
|
|
virtual bool RecvDrainDone();
|
2011-09-26 20:31:18 -07:00
|
|
|
virtual PRInt32 WaitForMinWriteSize();
|
|
|
|
virtual bool RecvMinWriteSizeDone(const PRInt32& 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
|
|
|
|
2011-09-26 20:31:18 -07:00
|
|
|
PRInt64 GetLastKnownPosition();
|
|
|
|
PRInt64 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
|
2011-09-26 20:31:18 -07:00
|
|
|
PRInt64 mLastPosition;
|
|
|
|
PRInt64 mLastPositionTimestamp;
|
2012-07-01 21:59:43 -07:00
|
|
|
PRUint64 mWriteCounter;
|
2011-09-26 20:31:18 -07:00
|
|
|
PRInt32 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
|