OLD | NEW |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 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 | 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 #include "ppapi/cpp/audio_frame.h" | 5 #include "ppapi/cpp/audio_frame.h" |
6 | 6 |
7 #include "ppapi/cpp/module.h" | 7 #include "ppapi/cpp/module.h" |
8 #include "ppapi/cpp/module_impl.h" | 8 #include "ppapi/cpp/module_impl.h" |
9 | 9 |
10 namespace pp { | 10 namespace pp { |
(...skipping 26 matching lines...) Expand all Loading... |
37 if (has_interface<PPB_AudioFrame_0_1>()) | 37 if (has_interface<PPB_AudioFrame_0_1>()) |
38 return get_interface<PPB_AudioFrame_0_1>()->GetTimestamp(pp_resource()); | 38 return get_interface<PPB_AudioFrame_0_1>()->GetTimestamp(pp_resource()); |
39 return 0.0; | 39 return 0.0; |
40 } | 40 } |
41 | 41 |
42 void AudioFrame::SetTimestamp(PP_TimeDelta timestamp) { | 42 void AudioFrame::SetTimestamp(PP_TimeDelta timestamp) { |
43 if (has_interface<PPB_AudioFrame_0_1>()) | 43 if (has_interface<PPB_AudioFrame_0_1>()) |
44 get_interface<PPB_AudioFrame_0_1>()->SetTimestamp(pp_resource(), timestamp); | 44 get_interface<PPB_AudioFrame_0_1>()->SetTimestamp(pp_resource(), timestamp); |
45 } | 45 } |
46 | 46 |
47 uint32_t AudioFrame::GetSampleSize() const { | 47 PP_AudioFrame_SampleRate AudioFrame::GetSampleRate() const { |
| 48 if (has_interface<PPB_AudioFrame_0_1>()) |
| 49 return get_interface<PPB_AudioFrame_0_1>()->GetSampleRate(pp_resource()); |
| 50 return PP_AUDIOFRAME_SAMPLERATE_UNKNOWN; |
| 51 } |
| 52 |
| 53 PP_AudioFrame_SampleSize AudioFrame::GetSampleSize() const { |
48 if (has_interface<PPB_AudioFrame_0_1>()) | 54 if (has_interface<PPB_AudioFrame_0_1>()) |
49 return get_interface<PPB_AudioFrame_0_1>()->GetSampleSize(pp_resource()); | 55 return get_interface<PPB_AudioFrame_0_1>()->GetSampleSize(pp_resource()); |
50 return 0; | 56 return PP_AUDIOFRAME_SAMPLESIZE_UNKNOWN; |
51 } | 57 } |
52 | 58 |
53 uint32_t AudioFrame::GetNumberOfChannels() const { | 59 uint32_t AudioFrame::GetNumberOfChannels() const { |
54 if (has_interface<PPB_AudioFrame_0_1>()) { | 60 if (has_interface<PPB_AudioFrame_0_1>()) { |
55 return get_interface<PPB_AudioFrame_0_1>()->GetNumberOfChannels( | 61 return get_interface<PPB_AudioFrame_0_1>()->GetNumberOfChannels( |
56 pp_resource()); | 62 pp_resource()); |
57 } | 63 } |
58 return 0; | 64 return 0; |
59 } | 65 } |
60 | 66 |
(...skipping 13 matching lines...) Expand all Loading... |
74 | 80 |
75 uint32_t AudioFrame::GetDataBufferSize() const { | 81 uint32_t AudioFrame::GetDataBufferSize() const { |
76 if (has_interface<PPB_AudioFrame_0_1>()) { | 82 if (has_interface<PPB_AudioFrame_0_1>()) { |
77 return get_interface<PPB_AudioFrame_0_1>()->GetDataBufferSize( | 83 return get_interface<PPB_AudioFrame_0_1>()->GetDataBufferSize( |
78 pp_resource()); | 84 pp_resource()); |
79 } | 85 } |
80 return 0; | 86 return 0; |
81 } | 87 } |
82 | 88 |
83 } // namespace pp | 89 } // namespace pp |
OLD | NEW |