Avi Drissman | db497b3 | 2022-09-15 19:47:28 | [diff] [blame] | 1 | // Copyright 2014 The Chromium Authors |
[email protected] | 2b7a6d3 | 2014-02-06 02:50:23 | [diff] [blame] | 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] | 6667e568 | 2014-02-11 18:59:05 | [diff] [blame] | 5 | #ifndef PPAPI_PROXY_AUDIO_BUFFER_RESOURCE_H_ |
6 | #define PPAPI_PROXY_AUDIO_BUFFER_RESOURCE_H_ | ||||
[email protected] | 2b7a6d3 | 2014-02-06 02:50:23 | [diff] [blame] | 7 | |
avi | e029c413 | 2015-12-23 06:45:22 | [diff] [blame] | 8 | #include <stdint.h> |
9 | |||||
[email protected] | 2b7a6d3 | 2014-02-06 02:50:23 | [diff] [blame] | 10 | #include "base/compiler_specific.h" |
11 | #include "ppapi/proxy/ppapi_proxy_export.h" | ||||
[email protected] | 2b7a6d3 | 2014-02-06 02:50:23 | [diff] [blame] | 12 | #include "ppapi/shared_impl/resource.h" |
[email protected] | 6667e568 | 2014-02-11 18:59:05 | [diff] [blame] | 13 | #include "ppapi/thunk/ppb_audio_buffer_api.h" |
[email protected] | 2b7a6d3 | 2014-02-06 02:50:23 | [diff] [blame] | 14 | |
15 | namespace ppapi { | ||||
[email protected] | a2c5dcd | 2014-02-08 03:20:15 | [diff] [blame] | 16 | |
17 | union MediaStreamBuffer; | ||||
18 | |||||
[email protected] | 2b7a6d3 | 2014-02-06 02:50:23 | [diff] [blame] | 19 | namespace proxy { |
20 | |||||
[email protected] | 6667e568 | 2014-02-11 18:59:05 | [diff] [blame] | 21 | class PPAPI_PROXY_EXPORT AudioBufferResource |
22 | : public Resource, | ||||
23 | public thunk::PPB_AudioBuffer_API { | ||||
[email protected] | 2b7a6d3 | 2014-02-06 02:50:23 | [diff] [blame] | 24 | public: |
[email protected] | 6667e568 | 2014-02-11 18:59:05 | [diff] [blame] | 25 | AudioBufferResource(PP_Instance instance, |
[email protected] | 2b7a6d3 | 2014-02-06 02:50:23 | [diff] [blame] | 26 | int32_t index, |
[email protected] | a2c5dcd | 2014-02-08 03:20:15 | [diff] [blame] | 27 | MediaStreamBuffer* buffer); |
[email protected] | 2b7a6d3 | 2014-02-06 02:50:23 | [diff] [blame] | 28 | |
Peter Boström | 3d5b3cb | 2021-09-23 21:35:45 | [diff] [blame] | 29 | AudioBufferResource(const AudioBufferResource&) = delete; |
30 | AudioBufferResource& operator=(const AudioBufferResource&) = delete; | ||||
31 | |||||
nick | e478443 | 2015-04-23 14:01:48 | [diff] [blame] | 32 | ~AudioBufferResource() override; |
[email protected] | 2b7a6d3 | 2014-02-06 02:50:23 | [diff] [blame] | 33 | |
34 | // PluginResource overrides: | ||||
nick | e478443 | 2015-04-23 14:01:48 | [diff] [blame] | 35 | thunk::PPB_AudioBuffer_API* AsPPB_AudioBuffer_API() override; |
[email protected] | 2b7a6d3 | 2014-02-06 02:50:23 | [diff] [blame] | 36 | |
[email protected] | 6667e568 | 2014-02-11 18:59:05 | [diff] [blame] | 37 | // PPB_AudioBuffer_API overrides: |
nick | e478443 | 2015-04-23 14:01:48 | [diff] [blame] | 38 | 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] | 2b7a6d3 | 2014-02-06 02:50:23 | [diff] [blame] | 49 | |
[email protected] | 6667e568 | 2014-02-11 18:59:05 | [diff] [blame] | 50 | // Buffer index |
[email protected] | 2b7a6d3 | 2014-02-06 02:50:23 | [diff] [blame] | 51 | int32_t index_; |
52 | |||||
[email protected] | a2c5dcd | 2014-02-08 03:20:15 | [diff] [blame] | 53 | MediaStreamBuffer* buffer_; |
[email protected] | 2b7a6d3 | 2014-02-06 02:50:23 | [diff] [blame] | 54 | }; |
55 | |||||
56 | } // namespace proxy | ||||
57 | } // namespace ppapi | ||||
58 | |||||
[email protected] | 6667e568 | 2014-02-11 18:59:05 | [diff] [blame] | 59 | #endif // PPAPI_PROXY_AUDIO_BUFFER_RESOURCE_H_ |