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

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

Issue 2894593002: Revert of Removes usage of native base::android::GetApplicationContext() (Closed)
Patch Set: Created 3 years, 7 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( 86 j_audio_manager_.reset(new JavaAudioManager(
87 new JavaAudioManager(j_native_registration_.get(), 87 j_native_registration_.get(),
88 j_native_registration_->NewObject( 88 j_native_registration_->NewObject(
89 "<init>", "(J)V", PointerTojlong(this)))); 89 "<init>", "(Landroid/content/Context;J)V",
90 JVM::GetInstance()->context(), PointerTojlong(this))));
90 } 91 }
91 92
92 AudioManager::~AudioManager() { 93 AudioManager::~AudioManager() {
93 ALOGD("~dtor%s", GetThreadInfo().c_str()); 94 ALOGD("~dtor%s", GetThreadInfo().c_str());
94 RTC_DCHECK(thread_checker_.CalledOnValidThread()); 95 RTC_DCHECK(thread_checker_.CalledOnValidThread());
95 Close(); 96 Close();
96 } 97 }
97 98
98 void AudioManager::SetActiveAudioLayer( 99 void AudioManager::SetActiveAudioLayer(
99 AudioDeviceModule::AudioLayer audio_layer) { 100 AudioDeviceModule::AudioLayer audio_layer) {
(...skipping 189 matching lines...) Expand 10 before | Expand all | Expand 10 after
289 return playout_parameters_; 290 return playout_parameters_;
290 } 291 }
291 292
292 const AudioParameters& AudioManager::GetRecordAudioParameters() { 293 const AudioParameters& AudioManager::GetRecordAudioParameters() {
293 RTC_CHECK(record_parameters_.is_valid()); 294 RTC_CHECK(record_parameters_.is_valid());
294 RTC_DCHECK(thread_checker_.CalledOnValidThread()); 295 RTC_DCHECK(thread_checker_.CalledOnValidThread());
295 return record_parameters_; 296 return record_parameters_;
296 } 297 }
297 298
298 } // namespace webrtc 299 } // 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