blob: 81e528f6e71ccfd289dc6b6230a1b7755a168753 [file] [log] [blame]
Avi Drissmandb497b32022-09-15 19:47:281// Copyright 2014 The Chromium Authors
[email protected]2b7a6d32014-02-06 02:50:232// 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
avie029c4132015-12-23 06:45:228#include <stdint.h>
9
[email protected]2b7a6d32014-02-06 02:50:2310#include "base/compiler_specific.h"
11#include "ppapi/proxy/ppapi_proxy_export.h"
[email protected]2b7a6d32014-02-06 02:50:2312#include "ppapi/shared_impl/resource.h"
[email protected]6667e5682014-02-11 18:59:0513#include "ppapi/thunk/ppb_audio_buffer_api.h"
[email protected]2b7a6d32014-02-06 02:50:2314
15namespace ppapi {
[email protected]a2c5dcd2014-02-08 03:20:1516
17union MediaStreamBuffer;
18
[email protected]2b7a6d32014-02-06 02:50:2319namespace proxy {
20
[email protected]6667e5682014-02-11 18:59:0521class PPAPI_PROXY_EXPORT AudioBufferResource
22 : public Resource,
23 public thunk::PPB_AudioBuffer_API {
[email protected]2b7a6d32014-02-06 02:50:2324 public:
[email protected]6667e5682014-02-11 18:59:0525 AudioBufferResource(PP_Instance instance,
[email protected]2b7a6d32014-02-06 02:50:2326 int32_t index,
[email protected]a2c5dcd2014-02-08 03:20:1527 MediaStreamBuffer* buffer);
[email protected]2b7a6d32014-02-06 02:50:2328
Peter Boström3d5b3cb2021-09-23 21:35:4529 AudioBufferResource(const AudioBufferResource&) = delete;
30 AudioBufferResource& operator=(const AudioBufferResource&) = delete;
31
nicke4784432015-04-23 14:01:4832 ~AudioBufferResource() override;
[email protected]2b7a6d32014-02-06 02:50:2333
34 // PluginResource overrides:
nicke4784432015-04-23 14:01:4835 thunk::PPB_AudioBuffer_API* AsPPB_AudioBuffer_API() override;
[email protected]2b7a6d32014-02-06 02:50:2336
[email protected]6667e5682014-02-11 18:59:0537 // PPB_AudioBuffer_API overrides:
nicke4784432015-04-23 14:01:4838 PP_TimeDelta GetTimestamp() override;
39 void SetTimestamp(PP_TimeDelta timestamp) override;
40 PP_AudioBuffer_SampleRate GetSampleRate() override;
41 PP_AudioBuffer_SampleSize GetSampleSize() override;
42 uint32_t GetNumberOfChannels() override;
43 uint32_t GetNumberOfSamples() override;
44 void* GetDataBuffer() override;
45 uint32_t GetDataBufferSize() override;
46 MediaStreamBuffer* GetBuffer() override;
47 int32_t GetBufferIndex() override;
48 void Invalidate() override;
[email protected]2b7a6d32014-02-06 02:50:2349
[email protected]6667e5682014-02-11 18:59:0550 // Buffer index
[email protected]2b7a6d32014-02-06 02:50:2351 int32_t index_;
52
[email protected]a2c5dcd2014-02-08 03:20:1553 MediaStreamBuffer* buffer_;
[email protected]2b7a6d32014-02-06 02:50:2354};
55
56} // namespace proxy
57} // namespace ppapi
58
[email protected]6667e5682014-02-11 18:59:0559#endif // PPAPI_PROXY_AUDIO_BUFFER_RESOURCE_H_