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

Side by Side Diff: webrtc/modules/audio_device/android/audio_track_jni.h

Issue 1858213002: Improves error handling for playout initialization on Android (Closed) Base URL: https://chromium.googlesource.com/external/webrtc.git@master
Patch Set: Created 4 years, 8 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 | « no previous file | webrtc/modules/audio_device/android/audio_track_jni.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 /* 1 /*
2 * Copyright (c) 2013 The WebRTC project authors. All Rights Reserved. 2 * Copyright (c) 2013 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 29 matching lines...) Expand all
40 // guarantees that no other (possibly non attached) thread is used. 40 // guarantees that no other (possibly non attached) thread is used.
41 class AudioTrackJni { 41 class AudioTrackJni {
42 public: 42 public:
43 // Wraps the Java specific parts of the AudioTrackJni into one helper class. 43 // Wraps the Java specific parts of the AudioTrackJni into one helper class.
44 class JavaAudioTrack { 44 class JavaAudioTrack {
45 public: 45 public:
46 JavaAudioTrack(NativeRegistration* native_registration, 46 JavaAudioTrack(NativeRegistration* native_registration,
47 std::unique_ptr<GlobalRef> audio_track); 47 std::unique_ptr<GlobalRef> audio_track);
48 ~JavaAudioTrack(); 48 ~JavaAudioTrack();
49 49
50 void InitPlayout(int sample_rate, int channels); 50 bool InitPlayout(int sample_rate, int channels);
51 bool StartPlayout(); 51 bool StartPlayout();
52 bool StopPlayout(); 52 bool StopPlayout();
53 bool SetStreamVolume(int volume); 53 bool SetStreamVolume(int volume);
54 int GetStreamMaxVolume(); 54 int GetStreamMaxVolume();
55 int GetStreamVolume(); 55 int GetStreamVolume();
56 56
57 private: 57 private:
58 std::unique_ptr<GlobalRef> audio_track_; 58 std::unique_ptr<GlobalRef> audio_track_;
59 jmethodID init_playout_; 59 jmethodID init_playout_;
60 jmethodID start_playout_; 60 jmethodID start_playout_;
(...skipping 85 matching lines...) Expand 10 before | Expand all | Expand 10 after
146 // Raw pointer handle provided to us in AttachAudioBuffer(). Owned by the 146 // Raw pointer handle provided to us in AttachAudioBuffer(). Owned by the
147 // AudioDeviceModuleImpl class and called by AudioDeviceModuleImpl::Create(). 147 // AudioDeviceModuleImpl class and called by AudioDeviceModuleImpl::Create().
148 // The AudioDeviceBuffer is a member of the AudioDeviceModuleImpl instance 148 // The AudioDeviceBuffer is a member of the AudioDeviceModuleImpl instance
149 // and therefore outlives this object. 149 // and therefore outlives this object.
150 AudioDeviceBuffer* audio_device_buffer_; 150 AudioDeviceBuffer* audio_device_buffer_;
151 }; 151 };
152 152
153 } // namespace webrtc 153 } // namespace webrtc
154 154
155 #endif // WEBRTC_MODULES_AUDIO_DEVICE_ANDROID_AUDIO_TRACK_JNI_H_ 155 #endif // WEBRTC_MODULES_AUDIO_DEVICE_ANDROID_AUDIO_TRACK_JNI_H_
OLDNEW
« no previous file with comments | « no previous file | webrtc/modules/audio_device/android/audio_track_jni.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698