OLD | NEW |
1 /* | 1 /* |
2 * Copyright 2010 The Native Client Authors. All rights reserved. | 2 * Copyright 2010 The Native Client Authors. All rights reserved. |
3 * Use of this source code is governed by a BSD-style license that can | 3 * Use of this source code is governed by a BSD-style license that can |
4 * be found in the LICENSE file. | 4 * be found in the LICENSE file. |
5 */ | 5 */ |
6 | 6 |
7 #include "native_client/src/shared/ppapi_proxy/plugin_audio_config.h" | 7 #include "native_client/src/shared/ppapi_proxy/plugin_audio_config.h" |
8 | 8 |
9 #include <stdio.h> | 9 #include <stdio.h> |
10 #include <string.h> | 10 #include <string.h> |
(...skipping 14 matching lines...) Expand all Loading... |
25 UNREFERENCED_PARAMETER(sample_rate); | 25 UNREFERENCED_PARAMETER(sample_rate); |
26 UNREFERENCED_PARAMETER(sample_frame_count); | 26 UNREFERENCED_PARAMETER(sample_frame_count); |
27 return kInvalidResourceId; | 27 return kInvalidResourceId; |
28 } | 28 } |
29 | 29 |
30 uint32_t RecommendSampleFrameCount(uint32_t request_sample_frame_count) { | 30 uint32_t RecommendSampleFrameCount(uint32_t request_sample_frame_count) { |
31 UNREFERENCED_PARAMETER(request_sample_frame_count); | 31 UNREFERENCED_PARAMETER(request_sample_frame_count); |
32 return 0; | 32 return 0; |
33 } | 33 } |
34 | 34 |
35 PP_Bool IsAudioConfig(PP_Resource config) { | 35 PP_Bool IsAudioConfig(PP_Resource resource) { |
36 UNREFERENCED_PARAMETER(config); | 36 return PluginResource::GetAs<PluginAudioConfig>(resource).get() |
37 return PP_FALSE; | 37 ? PP_TRUE : PP_FALSE; |
38 } | 38 } |
39 | 39 |
40 PP_AudioSampleRate_Dev GetSampleRate(PP_Resource config) { | 40 PP_AudioSampleRate_Dev GetSampleRate(PP_Resource config) { |
41 UNREFERENCED_PARAMETER(config); | 41 UNREFERENCED_PARAMETER(config); |
42 return PP_AUDIOSAMPLERATE_NONE; | 42 return PP_AUDIOSAMPLERATE_NONE; |
43 } | 43 } |
44 | 44 |
45 uint32_t GetSampleFrameCount(PP_Resource config) { | 45 uint32_t GetSampleFrameCount(PP_Resource config) { |
46 UNREFERENCED_PARAMETER(config); | 46 UNREFERENCED_PARAMETER(config); |
47 return PP_AUDIOMINSAMPLEFRAMECOUNT; | 47 return PP_AUDIOMINSAMPLEFRAMECOUNT; |
48 } | 48 } |
49 } // namespace | 49 } // namespace |
50 | 50 |
51 const PPB_AudioConfig_Dev* PluginAudioConfig::GetInterface() { | 51 const PPB_AudioConfig_Dev* PluginAudioConfig::GetInterface() { |
52 static const PPB_AudioConfig_Dev intf = { | 52 static const PPB_AudioConfig_Dev intf = { |
53 CreateStereo16Bit, | 53 CreateStereo16Bit, |
54 RecommendSampleFrameCount, | 54 RecommendSampleFrameCount, |
55 IsAudioConfig, | 55 IsAudioConfig, |
56 GetSampleRate, | 56 GetSampleRate, |
57 GetSampleFrameCount, | 57 GetSampleFrameCount, |
58 }; | 58 }; |
59 return &intf; | 59 return &intf; |
60 } | 60 } |
61 | 61 |
62 } // namespace ppapi_proxy | 62 } // namespace ppapi_proxy |
OLD | NEW |