blob: 8f1e22ff6ef4b97863bb2f888fbdd4a8811d26ab [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
nicke4784432015-04-23 14:01:4828 ~AudioBufferResource() override;
[email protected]2b7a6d32014-02-06 02:50:2329
30 // PluginResource overrides:
nicke4784432015-04-23 14:01:4831 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:
nicke4784432015-04-23 14:01:4834 PP_TimeDelta GetTimestamp() override;
35 void SetTimestamp(PP_TimeDelta timestamp) override;
36 PP_AudioBuffer_SampleRate GetSampleRate() override;
37 PP_AudioBuffer_SampleSize GetSampleSize() override;
38 uint32_t GetNumberOfChannels() override;
39 uint32_t GetNumberOfSamples() override;
40 void* GetDataBuffer() override;
41 uint32_t GetDataBufferSize() override;
42 MediaStreamBuffer* GetBuffer() override;
43 int32_t GetBufferIndex() override;
44 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_