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

Side by Side Diff: webrtc/modules/audio_device/android/audio_manager.cc

Issue 2903253004: Reland of Removes usage of native base::android::GetApplicationContext() (Closed)
Patch Set: Deprecated comment. Created 3 years, 6 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
OLDNEW
1 /* 1 /*
2 * Copyright (c) 2015 The WebRTC project authors. All Rights Reserved. 2 * Copyright (c) 2015 The WebRTC project authors. All Rights Reserved.
3 * 3 *
4 * Use of this source code is governed by a BSD-style license 4 * Use of this source code is governed by a BSD-style license
5 * that can be found in the LICENSE file in the root of the source 5 * that can be found in the LICENSE file in the root of the source
6 * tree. An additional intellectual property rights grant can be found 6 * tree. An additional intellectual property rights grant can be found
7 * in the file PATENTS. All contributing project authors may 7 * in the file PATENTS. All contributing project authors may
8 * be found in the AUTHORS file in the root of the source tree. 8 * be found in the AUTHORS file in the root of the source tree.
9 */ 9 */
10 10
(...skipping 65 matching lines...) Expand 10 before | Expand all | Expand 10 after
76 low_latency_record_(false), 76 low_latency_record_(false),
77 delay_estimate_in_milliseconds_(0) { 77 delay_estimate_in_milliseconds_(0) {
78 ALOGD("ctor%s", GetThreadInfo().c_str()); 78 ALOGD("ctor%s", GetThreadInfo().c_str());
79 RTC_CHECK(j_environment_); 79 RTC_CHECK(j_environment_);
80 JNINativeMethod native_methods[] = { 80 JNINativeMethod native_methods[] = {
81 {"nativeCacheAudioParameters", "(IIIZZZZZZIIJ)V", 81 {"nativeCacheAudioParameters", "(IIIZZZZZZIIJ)V",
82 reinterpret_cast<void*>(&webrtc::AudioManager::CacheAudioParameters)}}; 82 reinterpret_cast<void*>(&webrtc::AudioManager::CacheAudioParameters)}};
83 j_native_registration_ = j_environment_->RegisterNatives( 83 j_native_registration_ = j_environment_->RegisterNatives(
84 "org/webrtc/voiceengine/WebRtcAudioManager", native_methods, 84 "org/webrtc/voiceengine/WebRtcAudioManager", native_methods,
85 arraysize(native_methods)); 85 arraysize(native_methods));
86 j_audio_manager_.reset(new JavaAudioManager( 86 j_audio_manager_.reset(
87 j_native_registration_.get(), 87 new JavaAudioManager(j_native_registration_.get(),
88 j_native_registration_->NewObject( 88 j_native_registration_->NewObject(
89 "<init>", "(Landroid/content/Context;J)V", 89 "<init>", "(J)V", PointerTojlong(this))));
90 JVM::GetInstance()->context(), PointerTojlong(this))));
91 } 90 }
92 91
93 AudioManager::~AudioManager() { 92 AudioManager::~AudioManager() {
94 ALOGD("~dtor%s", GetThreadInfo().c_str()); 93 ALOGD("~dtor%s", GetThreadInfo().c_str());
95 RTC_DCHECK(thread_checker_.CalledOnValidThread()); 94 RTC_DCHECK(thread_checker_.CalledOnValidThread());
96 Close(); 95 Close();
97 } 96 }
98 97
99 void AudioManager::SetActiveAudioLayer( 98 void AudioManager::SetActiveAudioLayer(
100 AudioDeviceModule::AudioLayer audio_layer) { 99 AudioDeviceModule::AudioLayer audio_layer) {
(...skipping 189 matching lines...) Expand 10 before | Expand all | Expand 10 after
290 return playout_parameters_; 289 return playout_parameters_;
291 } 290 }
292 291
293 const AudioParameters& AudioManager::GetRecordAudioParameters() { 292 const AudioParameters& AudioManager::GetRecordAudioParameters() {
294 RTC_CHECK(record_parameters_.is_valid()); 293 RTC_CHECK(record_parameters_.is_valid());
295 RTC_DCHECK(thread_checker_.CalledOnValidThread()); 294 RTC_DCHECK(thread_checker_.CalledOnValidThread());
296 return record_parameters_; 295 return record_parameters_;
297 } 296 }
298 297
299 } // namespace webrtc 298 } // namespace webrtc
OLDNEW
« no previous file with comments | « webrtc/base/java/src/org/webrtc/ContextUtils.java ('k') | webrtc/modules/audio_device/android/audio_record_jni.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698