Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(361)

Side by Side Diff: ppapi/shared_impl/ppb_audio_config_shared.h

Issue 9129007: Work on improving PpbAudioConfig:RecommendSampleFrameCount (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: '' Created 8 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #ifndef PPAPI_SHARED_IMPL_PPB_AUDIO_CONFIG_SHARED_H_ 5 #ifndef PPAPI_SHARED_IMPL_PPB_AUDIO_CONFIG_SHARED_H_
6 #define PPAPI_SHARED_IMPL_PPB_AUDIO_CONFIG_SHARED_H_ 6 #define PPAPI_SHARED_IMPL_PPB_AUDIO_CONFIG_SHARED_H_
7 7
8 #include "base/basictypes.h" 8 #include "base/basictypes.h"
9 #include "base/compiler_specific.h" 9 #include "base/compiler_specific.h"
10 #include "ppapi/shared_impl/resource.h" 10 #include "ppapi/shared_impl/resource.h"
11 #include "ppapi/thunk/ppb_audio_config_api.h" 11 #include "ppapi/thunk/ppb_audio_config_api.h"
12 12
13 namespace ppapi { 13 namespace ppapi {
14 14
15 class PPAPI_SHARED_EXPORT PPB_AudioConfig_Shared 15 class PPAPI_SHARED_EXPORT PPB_AudioConfig_Shared
16 : public Resource, 16 : public Resource,
17 public thunk::PPB_AudioConfig_API { 17 public thunk::PPB_AudioConfig_API {
18 public: 18 public:
19 virtual ~PPB_AudioConfig_Shared(); 19 virtual ~PPB_AudioConfig_Shared();
20 20
21 static PP_Resource CreateAsImpl(PP_Instance instance, 21 static PP_Resource CreateAsImpl(PP_Instance instance,
22 PP_AudioSampleRate sample_rate, 22 PP_AudioSampleRate sample_rate,
23 uint32_t sample_frame_count); 23 uint32_t sample_frame_count);
24 static PP_Resource CreateAsProxy(PP_Instance instance, 24 static PP_Resource CreateAsProxy(PP_Instance instance,
25 PP_AudioSampleRate sample_rate, 25 PP_AudioSampleRate sample_rate,
26 uint32_t sample_frame_count); 26 uint32_t sample_frame_count);
27 27
28 static uint32_t
brettw 2012/02/10 19:01:33 Wrap args to 4 spaces, put the function name on th
nfullagar 2012/02/14 00:42:37 Done.
29 RecommendSampleFrameCount(PP_AudioSampleRate sample_rate,
30 uint32_t request_sample_frame_count,
31 PP_AudioSampleRate hardware_sample_rate,
32 uint32_t hardware_sample_frame_count);
33
28 // Resource overrides. 34 // Resource overrides.
29 virtual thunk::PPB_AudioConfig_API* AsPPB_AudioConfig_API() OVERRIDE; 35 virtual thunk::PPB_AudioConfig_API* AsPPB_AudioConfig_API() OVERRIDE;
30 36
31 // PPB_AudioConfig_API implementation. 37 // PPB_AudioConfig_API implementation.
32 virtual PP_AudioSampleRate GetSampleRate() OVERRIDE; 38 virtual PP_AudioSampleRate GetSampleRate() OVERRIDE;
33 virtual uint32_t GetSampleFrameCount() OVERRIDE; 39 virtual uint32_t GetSampleFrameCount() OVERRIDE;
34 40
35 private: 41 private:
36 // You must call Init before using this object. 42 // You must call Init before using this object.
37 // Construct as implementation. 43 // Construct as implementation.
38 explicit PPB_AudioConfig_Shared(PP_Instance instance); 44 explicit PPB_AudioConfig_Shared(PP_Instance instance);
39 // Construct as proxy. 45 // Construct as proxy.
40 explicit PPB_AudioConfig_Shared(const HostResource& host_resource); 46 explicit PPB_AudioConfig_Shared(const HostResource& host_resource);
41 47
42 // Returns false if the arguments are invalid, the object should not be 48 // Returns false if the arguments are invalid, the object should not be
43 // used in this case. 49 // used in this case.
44 bool Init(PP_AudioSampleRate sample_rate, uint32_t sample_frame_count); 50 bool Init(PP_AudioSampleRate sample_rate, uint32_t sample_frame_count);
45 51
46 PP_AudioSampleRate sample_rate_; 52 PP_AudioSampleRate sample_rate_;
47 uint32_t sample_frame_count_; 53 uint32_t sample_frame_count_;
48 54
49 DISALLOW_COPY_AND_ASSIGN(PPB_AudioConfig_Shared); 55 DISALLOW_COPY_AND_ASSIGN(PPB_AudioConfig_Shared);
50 }; 56 };
51 57
52 } // namespace ppapi 58 } // namespace ppapi
53 59
54 #endif // PPAPI_SHARED_IMPL_PPB_AUDIO_CONFIG_SHARED_H_ 60 #endif // PPAPI_SHARED_IMPL_PPB_AUDIO_CONFIG_SHARED_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698