[email protected] | 2b7a6d3 | 2014-02-06 02:50:23 | [diff] [blame] | 1 | // 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] | 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 | |
8 | #include "base/basictypes.h" | ||||
9 | #include "base/compiler_specific.h" | ||||
10 | #include "ppapi/proxy/ppapi_proxy_export.h" | ||||
[email protected] | 2b7a6d3 | 2014-02-06 02:50:23 | [diff] [blame] | 11 | #include "ppapi/shared_impl/resource.h" |
[email protected] | 6667e568 | 2014-02-11 18:59:05 | [diff] [blame^] | 12 | #include "ppapi/thunk/ppb_audio_buffer_api.h" |
[email protected] | 2b7a6d3 | 2014-02-06 02:50:23 | [diff] [blame] | 13 | |
14 | namespace ppapi { | ||||
[email protected] | a2c5dcd | 2014-02-08 03:20:15 | [diff] [blame] | 15 | |
16 | union MediaStreamBuffer; | ||||
17 | |||||
[email protected] | 2b7a6d3 | 2014-02-06 02:50:23 | [diff] [blame] | 18 | namespace proxy { |
19 | |||||
[email protected] | 6667e568 | 2014-02-11 18:59:05 | [diff] [blame^] | 20 | class PPAPI_PROXY_EXPORT AudioBufferResource |
21 | : public Resource, | ||||
22 | public thunk::PPB_AudioBuffer_API { | ||||
[email protected] | 2b7a6d3 | 2014-02-06 02:50:23 | [diff] [blame] | 23 | public: |
[email protected] | 6667e568 | 2014-02-11 18:59:05 | [diff] [blame^] | 24 | AudioBufferResource(PP_Instance instance, |
[email protected] | 2b7a6d3 | 2014-02-06 02:50:23 | [diff] [blame] | 25 | int32_t index, |
[email protected] | a2c5dcd | 2014-02-08 03:20:15 | [diff] [blame] | 26 | MediaStreamBuffer* buffer); |
[email protected] | 2b7a6d3 | 2014-02-06 02:50:23 | [diff] [blame] | 27 | |
[email protected] | 6667e568 | 2014-02-11 18:59:05 | [diff] [blame^] | 28 | virtual ~AudioBufferResource(); |
[email protected] | 2b7a6d3 | 2014-02-06 02:50:23 | [diff] [blame] | 29 | |
30 | // PluginResource overrides: | ||||
[email protected] | 6667e568 | 2014-02-11 18:59:05 | [diff] [blame^] | 31 | virtual thunk::PPB_AudioBuffer_API* AsPPB_AudioBuffer_API() OVERRIDE; |
[email protected] | 2b7a6d3 | 2014-02-06 02:50:23 | [diff] [blame] | 32 | |
[email protected] | 6667e568 | 2014-02-11 18:59:05 | [diff] [blame^] | 33 | // PPB_AudioBuffer_API overrides: |
[email protected] | 2b7a6d3 | 2014-02-06 02:50:23 | [diff] [blame] | 34 | virtual PP_TimeDelta GetTimestamp() OVERRIDE; |
35 | virtual void SetTimestamp(PP_TimeDelta timestamp) OVERRIDE; | ||||
[email protected] | 6667e568 | 2014-02-11 18:59:05 | [diff] [blame^] | 36 | virtual PP_AudioBuffer_SampleRate GetSampleRate() OVERRIDE; |
37 | virtual PP_AudioBuffer_SampleSize GetSampleSize() OVERRIDE; | ||||
[email protected] | 2b7a6d3 | 2014-02-06 02:50:23 | [diff] [blame] | 38 | virtual uint32_t GetNumberOfChannels() OVERRIDE; |
39 | virtual uint32_t GetNumberOfSamples() OVERRIDE; | ||||
40 | virtual void* GetDataBuffer() OVERRIDE; | ||||
41 | virtual uint32_t GetDataBufferSize() OVERRIDE; | ||||
[email protected] | a2c5dcd | 2014-02-08 03:20:15 | [diff] [blame] | 42 | virtual MediaStreamBuffer* GetBuffer() OVERRIDE; |
43 | virtual int32_t GetBufferIndex() OVERRIDE; | ||||
44 | virtual void Invalidate() OVERRIDE; | ||||
[email protected] | 2b7a6d3 | 2014-02-06 02:50:23 | [diff] [blame] | 45 | |
[email protected] | 6667e568 | 2014-02-11 18:59:05 | [diff] [blame^] | 46 | // Buffer index |
[email protected] | 2b7a6d3 | 2014-02-06 02:50:23 | [diff] [blame] | 47 | int32_t index_; |
48 | |||||
[email protected] | a2c5dcd | 2014-02-08 03:20:15 | [diff] [blame] | 49 | MediaStreamBuffer* buffer_; |
[email protected] | 2b7a6d3 | 2014-02-06 02:50:23 | [diff] [blame] | 50 | |
[email protected] | 6667e568 | 2014-02-11 18:59:05 | [diff] [blame^] | 51 | DISALLOW_COPY_AND_ASSIGN(AudioBufferResource); |
[email protected] | 2b7a6d3 | 2014-02-06 02:50:23 | [diff] [blame] | 52 | }; |
53 | |||||
54 | } // namespace proxy | ||||
55 | } // namespace ppapi | ||||
56 | |||||
[email protected] | 6667e568 | 2014-02-11 18:59:05 | [diff] [blame^] | 57 | #endif // PPAPI_PROXY_AUDIO_BUFFER_RESOURCE_H_ |