blob: b4ef3eb760cde45e1aa3da2407c7c456d6a8eca4 [file] [log] [blame]
[email protected]2b7a6d32014-02-06 02:50:231// Copyright 2014 The Chromium Authors. All rights reserved.
2// Use of this source code is governed by a BSD-style license that can be
3// found in the LICENSE file.
4
[email protected]6667e5682014-02-11 18:59:055#ifndef PPAPI_PROXY_AUDIO_BUFFER_RESOURCE_H_
6#define PPAPI_PROXY_AUDIO_BUFFER_RESOURCE_H_
[email protected]2b7a6d32014-02-06 02:50:237
8#include "base/basictypes.h"
9#include "base/compiler_specific.h"
10#include "ppapi/proxy/ppapi_proxy_export.h"
[email protected]2b7a6d32014-02-06 02:50:2311#include "ppapi/shared_impl/resource.h"
[email protected]6667e5682014-02-11 18:59:0512#include "ppapi/thunk/ppb_audio_buffer_api.h"
[email protected]2b7a6d32014-02-06 02:50:2313
14namespace ppapi {
[email protected]a2c5dcd2014-02-08 03:20:1515
16union MediaStreamBuffer;
17
[email protected]2b7a6d32014-02-06 02:50:2318namespace proxy {
19
[email protected]6667e5682014-02-11 18:59:0520class PPAPI_PROXY_EXPORT AudioBufferResource
21 : public Resource,
22 public thunk::PPB_AudioBuffer_API {
[email protected]2b7a6d32014-02-06 02:50:2323 public:
[email protected]6667e5682014-02-11 18:59:0524 AudioBufferResource(PP_Instance instance,
[email protected]2b7a6d32014-02-06 02:50:2325 int32_t index,
[email protected]a2c5dcd2014-02-08 03:20:1526 MediaStreamBuffer* buffer);
[email protected]2b7a6d32014-02-06 02:50:2327
[email protected]6667e5682014-02-11 18:59:0528 virtual ~AudioBufferResource();
[email protected]2b7a6d32014-02-06 02:50:2329
30 // PluginResource overrides:
[email protected]6667e5682014-02-11 18:59:0531 virtual thunk::PPB_AudioBuffer_API* AsPPB_AudioBuffer_API() OVERRIDE;
[email protected]2b7a6d32014-02-06 02:50:2332
[email protected]6667e5682014-02-11 18:59:0533 // PPB_AudioBuffer_API overrides:
[email protected]2b7a6d32014-02-06 02:50:2334 virtual PP_TimeDelta GetTimestamp() OVERRIDE;
35 virtual void SetTimestamp(PP_TimeDelta timestamp) OVERRIDE;
[email protected]6667e5682014-02-11 18:59:0536 virtual PP_AudioBuffer_SampleRate GetSampleRate() OVERRIDE;
37 virtual PP_AudioBuffer_SampleSize GetSampleSize() OVERRIDE;
[email protected]2b7a6d32014-02-06 02:50:2338 virtual uint32_t GetNumberOfChannels() OVERRIDE;
39 virtual uint32_t GetNumberOfSamples() OVERRIDE;
40 virtual void* GetDataBuffer() OVERRIDE;
41 virtual uint32_t GetDataBufferSize() OVERRIDE;
[email protected]a2c5dcd2014-02-08 03:20:1542 virtual MediaStreamBuffer* GetBuffer() OVERRIDE;
43 virtual int32_t GetBufferIndex() OVERRIDE;
44 virtual void Invalidate() OVERRIDE;
[email protected]2b7a6d32014-02-06 02:50:2345
[email protected]6667e5682014-02-11 18:59:0546 // Buffer index
[email protected]2b7a6d32014-02-06 02:50:2347 int32_t index_;
48
[email protected]a2c5dcd2014-02-08 03:20:1549 MediaStreamBuffer* buffer_;
[email protected]2b7a6d32014-02-06 02:50:2350
[email protected]6667e5682014-02-11 18:59:0551 DISALLOW_COPY_AND_ASSIGN(AudioBufferResource);
[email protected]2b7a6d32014-02-06 02:50:2352};
53
54} // namespace proxy
55} // namespace ppapi
56
[email protected]6667e5682014-02-11 18:59:0557#endif // PPAPI_PROXY_AUDIO_BUFFER_RESOURCE_H_