| OLD | NEW |
| 1 // Copyright (c) 2012 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 #include "media/base/android/webaudio_media_codec_bridge.h" | 5 #include "media/base/android/webaudio_media_codec_bridge.h" |
| 6 | 6 |
| 7 #include <errno.h> | 7 #include <errno.h> |
| 8 #include <fcntl.h> | 8 #include <fcntl.h> |
| 9 #include <sys/stat.h> | 9 #include <sys/stat.h> |
| 10 #include <sys/types.h> | 10 #include <sys/types.h> |
| (...skipping 12 matching lines...) Expand all Loading... |
| 23 #include "media/base/android/webaudio_media_codec_info.h" | 23 #include "media/base/android/webaudio_media_codec_info.h" |
| 24 | 24 |
| 25 | 25 |
| 26 using base::android::AttachCurrentThread; | 26 using base::android::AttachCurrentThread; |
| 27 | 27 |
| 28 namespace media { | 28 namespace media { |
| 29 | 29 |
| 30 void WebAudioMediaCodecBridge::RunWebAudioMediaCodec( | 30 void WebAudioMediaCodecBridge::RunWebAudioMediaCodec( |
| 31 base::SharedMemoryHandle encoded_audio_handle, | 31 base::SharedMemoryHandle encoded_audio_handle, |
| 32 base::FileDescriptor pcm_output, | 32 base::FileDescriptor pcm_output, |
| 33 uint32_t data_size) { | 33 uint32_t data_size, |
| 34 WebAudioMediaCodecBridge bridge(encoded_audio_handle, pcm_output, data_size); | 34 base::Closure on_decode_finished_cb) { |
| 35 WebAudioMediaCodecBridge bridge( |
| 36 encoded_audio_handle, pcm_output, data_size); |
| 35 | 37 |
| 36 bridge.DecodeInMemoryAudioFile(); | 38 bridge.DecodeInMemoryAudioFile(); |
| 39 on_decode_finished_cb.Run(); |
| 37 } | 40 } |
| 38 | 41 |
| 39 WebAudioMediaCodecBridge::WebAudioMediaCodecBridge( | 42 WebAudioMediaCodecBridge::WebAudioMediaCodecBridge( |
| 40 base::SharedMemoryHandle encoded_audio_handle, | 43 base::SharedMemoryHandle encoded_audio_handle, |
| 41 base::FileDescriptor pcm_output, | 44 base::FileDescriptor pcm_output, |
| 42 uint32_t data_size) | 45 uint32_t data_size) |
| 43 : encoded_audio_handle_(encoded_audio_handle), | 46 : encoded_audio_handle_(encoded_audio_handle), |
| 44 pcm_output_(pcm_output.fd), | 47 pcm_output_(pcm_output.fd), |
| 45 data_size_(data_size) { | 48 data_size_(data_size) { |
| 46 DVLOG(1) << "WebAudioMediaCodecBridge start **********************" | 49 DVLOG(1) << "WebAudioMediaCodecBridge start **********************" |
| (...skipping 144 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 191 count -= bytes_written; | 194 count -= bytes_written; |
| 192 buffer += bytes_written; | 195 buffer += bytes_written; |
| 193 } | 196 } |
| 194 } | 197 } |
| 195 | 198 |
| 196 bool WebAudioMediaCodecBridge::RegisterWebAudioMediaCodecBridge(JNIEnv* env) { | 199 bool WebAudioMediaCodecBridge::RegisterWebAudioMediaCodecBridge(JNIEnv* env) { |
| 197 return RegisterNativesImpl(env); | 200 return RegisterNativesImpl(env); |
| 198 } | 201 } |
| 199 | 202 |
| 200 } // namespace | 203 } // namespace |
| OLD | NEW |