| OLD | NEW |
| 1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 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 // From ppb_audio_encoder.idl modified Mon Sep 7 10:17:53 2015. | 5 // From ppb_audio_encoder.idl modified Wed Jan 27 17:39:22 2016. |
| 6 | 6 |
| 7 #include <stdint.h> | 7 #include <stdint.h> |
| 8 | 8 |
| 9 #include "ppapi/c/pp_completion_callback.h" | 9 #include "ppapi/c/pp_completion_callback.h" |
| 10 #include "ppapi/c/pp_errors.h" | 10 #include "ppapi/c/pp_errors.h" |
| 11 #include "ppapi/c/ppb_audio_encoder.h" | 11 #include "ppapi/c/ppb_audio_encoder.h" |
| 12 #include "ppapi/shared_impl/tracked_callback.h" | 12 #include "ppapi/shared_impl/tracked_callback.h" |
| 13 #include "ppapi/thunk/enter.h" | 13 #include "ppapi/thunk/enter.h" |
| 14 #include "ppapi/thunk/ppapi_thunk_export.h" | 14 #include "ppapi/thunk/ppapi_thunk_export.h" |
| 15 #include "ppapi/thunk/ppb_audio_encoder_api.h" | 15 #include "ppapi/thunk/ppb_audio_encoder_api.h" |
| (...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 49 PP_AudioBuffer_SampleRate input_sample_rate, | 49 PP_AudioBuffer_SampleRate input_sample_rate, |
| 50 PP_AudioBuffer_SampleSize input_sample_size, | 50 PP_AudioBuffer_SampleSize input_sample_size, |
| 51 PP_AudioProfile output_profile, | 51 PP_AudioProfile output_profile, |
| 52 uint32_t initial_bitrate, | 52 uint32_t initial_bitrate, |
| 53 PP_HardwareAcceleration acceleration, | 53 PP_HardwareAcceleration acceleration, |
| 54 struct PP_CompletionCallback callback) { | 54 struct PP_CompletionCallback callback) { |
| 55 VLOG(4) << "PPB_AudioEncoder::Initialize()"; | 55 VLOG(4) << "PPB_AudioEncoder::Initialize()"; |
| 56 EnterResource<PPB_AudioEncoder_API> enter(audio_encoder, callback, true); | 56 EnterResource<PPB_AudioEncoder_API> enter(audio_encoder, callback, true); |
| 57 if (enter.failed()) | 57 if (enter.failed()) |
| 58 return enter.retval(); | 58 return enter.retval(); |
| 59 return enter.SetResult(enter.object()->Initialize(channels, | 59 return enter.SetResult(enter.object()->Initialize( |
| 60 input_sample_rate, | 60 channels, input_sample_rate, input_sample_size, output_profile, |
| 61 input_sample_size, | 61 initial_bitrate, acceleration, enter.callback())); |
| 62 output_profile, | |
| 63 initial_bitrate, | |
| 64 acceleration, | |
| 65 enter.callback())); | |
| 66 } | 62 } |
| 67 | 63 |
| 68 int32_t GetNumberOfSamples(PP_Resource audio_encoder) { | 64 int32_t GetNumberOfSamples(PP_Resource audio_encoder) { |
| 69 VLOG(4) << "PPB_AudioEncoder::GetNumberOfSamples()"; | 65 VLOG(4) << "PPB_AudioEncoder::GetNumberOfSamples()"; |
| 70 EnterResource<PPB_AudioEncoder_API> enter(audio_encoder, true); | 66 EnterResource<PPB_AudioEncoder_API> enter(audio_encoder, true); |
| 71 if (enter.failed()) | 67 if (enter.failed()) |
| 72 return enter.retval(); | 68 return enter.retval(); |
| 73 return enter.object()->GetNumberOfSamples(); | 69 return enter.object()->GetNumberOfSamples(); |
| 74 } | 70 } |
| 75 | 71 |
| (...skipping 70 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 146 &Close}; | 142 &Close}; |
| 147 | 143 |
| 148 } // namespace | 144 } // namespace |
| 149 | 145 |
| 150 PPAPI_THUNK_EXPORT const PPB_AudioEncoder_0_1* GetPPB_AudioEncoder_0_1_Thunk() { | 146 PPAPI_THUNK_EXPORT const PPB_AudioEncoder_0_1* GetPPB_AudioEncoder_0_1_Thunk() { |
| 151 return &g_ppb_audioencoder_thunk_0_1; | 147 return &g_ppb_audioencoder_thunk_0_1; |
| 152 } | 148 } |
| 153 | 149 |
| 154 } // namespace thunk | 150 } // namespace thunk |
| 155 } // namespace ppapi | 151 } // namespace ppapi |
| OLD | NEW |