OLD | NEW |
| (Empty) |
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 | |
5 #ifndef PPAPI_PROXY_AUDIO_FRAME_RESOURCE_H_ | |
6 #define PPAPI_PROXY_AUDIO_FRAME_RESOURCE_H_ | |
7 | |
8 #include "base/basictypes.h" | |
9 #include "base/compiler_specific.h" | |
10 #include "ppapi/proxy/ppapi_proxy_export.h" | |
11 #include "ppapi/shared_impl/resource.h" | |
12 #include "ppapi/thunk/ppb_audio_frame_api.h" | |
13 | |
14 namespace ppapi { | |
15 | |
16 union MediaStreamBuffer; | |
17 | |
18 namespace proxy { | |
19 | |
20 class PPAPI_PROXY_EXPORT AudioFrameResource : public Resource, | |
21 public thunk::PPB_AudioFrame_API { | |
22 public: | |
23 AudioFrameResource(PP_Instance instance, | |
24 int32_t index, | |
25 MediaStreamBuffer* buffer); | |
26 | |
27 virtual ~AudioFrameResource(); | |
28 | |
29 // PluginResource overrides: | |
30 virtual thunk::PPB_AudioFrame_API* AsPPB_AudioFrame_API() OVERRIDE; | |
31 | |
32 // PPB_AudioFrame_API overrides: | |
33 virtual PP_TimeDelta GetTimestamp() OVERRIDE; | |
34 virtual void SetTimestamp(PP_TimeDelta timestamp) OVERRIDE; | |
35 virtual PP_AudioFrame_SampleRate GetSampleRate() OVERRIDE; | |
36 virtual PP_AudioFrame_SampleSize GetSampleSize() OVERRIDE; | |
37 virtual uint32_t GetNumberOfChannels() OVERRIDE; | |
38 virtual uint32_t GetNumberOfSamples() OVERRIDE; | |
39 virtual void* GetDataBuffer() OVERRIDE; | |
40 virtual uint32_t GetDataBufferSize() OVERRIDE; | |
41 virtual MediaStreamBuffer* GetBuffer() OVERRIDE; | |
42 virtual int32_t GetBufferIndex() OVERRIDE; | |
43 virtual void Invalidate() OVERRIDE; | |
44 | |
45 // Frame index | |
46 int32_t index_; | |
47 | |
48 MediaStreamBuffer* buffer_; | |
49 | |
50 DISALLOW_COPY_AND_ASSIGN(AudioFrameResource); | |
51 }; | |
52 | |
53 } // namespace proxy | |
54 } // namespace ppapi | |
55 | |
56 #endif // PPAPI_PROXY_AUDIO_FRAME_RESOURCE_H_ | |
OLD | NEW |