2010-11-17 07:14:19 +03: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 15:12:37 +04: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-17 07:14:19 +03:00
|
|
|
|
|
|
|
#ifndef mozilla_dom_AudioChild_h
|
|
|
|
#define mozilla_dom_AudioChild_h
|
|
|
|
|
|
|
|
#include "mozilla/dom/PAudioChild.h"
|
2011-04-29 23:21:57 +04:00
|
|
|
#include "mozilla/ReentrantMonitor.h"
|
2010-11-17 07:14:19 +03:00
|
|
|
|
|
|
|
namespace mozilla {
|
|
|
|
namespace dom {
|
|
|
|
|
|
|
|
class AudioChild : public PAudioChild
|
|
|
|
{
|
|
|
|
public:
|
2010-11-26 07:13:54 +03:00
|
|
|
NS_IMETHOD_(nsrefcnt) AddRef();
|
|
|
|
NS_IMETHOD_(nsrefcnt) Release();
|
|
|
|
|
2010-11-17 07:14:19 +03:00
|
|
|
AudioChild();
|
|
|
|
virtual ~AudioChild();
|
2011-09-27 07:31:18 +04:00
|
|
|
virtual bool RecvPositionInFramesUpdate(const PRInt64&, const PRInt64&);
|
2010-11-30 08:37:32 +03:00
|
|
|
virtual bool RecvDrainDone();
|
2011-09-27 07:31:18 +04:00
|
|
|
virtual PRInt32 WaitForMinWriteSize();
|
|
|
|
virtual bool RecvMinWriteSizeDone(const PRInt32& frameCount);
|
2010-11-30 08:37:32 +03:00
|
|
|
virtual void WaitForDrain();
|
2012-07-02 08:59:43 +04:00
|
|
|
virtual bool RecvWriteDone();
|
|
|
|
virtual void WaitForWrite();
|
2010-11-26 07:13:54 +03:00
|
|
|
virtual void ActorDestroy(ActorDestroyReason);
|
2011-05-15 14:53:55 +04:00
|
|
|
|
2011-09-27 07:31:18 +04:00
|
|
|
PRInt64 GetLastKnownPosition();
|
|
|
|
PRInt64 GetLastKnownPositionTimestamp();
|
2010-11-26 07:13:54 +03:00
|
|
|
|
2011-09-29 10:19:26 +04:00
|
|
|
bool IsIPCOpen() { return mIPCOpen; };
|
2010-11-17 07:14:19 +03:00
|
|
|
private:
|
2010-11-26 07:13:54 +03:00
|
|
|
nsAutoRefCnt mRefCnt;
|
|
|
|
NS_DECL_OWNINGTHREAD
|
2011-09-27 07:31:18 +04:00
|
|
|
PRInt64 mLastPosition;
|
|
|
|
PRInt64 mLastPositionTimestamp;
|
2012-07-02 08:59:43 +04:00
|
|
|
PRUint64 mWriteCounter;
|
2011-09-27 07:31:18 +04:00
|
|
|
PRInt32 mMinWriteSize;
|
2011-04-29 23:21:57 +04:00
|
|
|
mozilla::ReentrantMonitor mAudioReentrantMonitor;
|
2011-09-29 10:19:26 +04:00
|
|
|
bool mIPCOpen;
|
|
|
|
bool mDrained;
|
2010-11-17 07:14:19 +03:00
|
|
|
};
|
|
|
|
|
|
|
|
} // namespace dom
|
|
|
|
} // namespace mozilla
|
|
|
|
|
|
|
|
#endif
|