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

Side by Side Diff: media/base/android/webaudio_media_codec_bridge.cc

Issue 1372203002: Throttle media decoding after excessive Android media server crashes (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: new infobar text per UI review Created 5 years, 2 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
« no previous file with comments | « media/base/android/webaudio_media_codec_bridge.h ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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
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
OLDNEW
« no previous file with comments | « media/base/android/webaudio_media_codec_bridge.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698