Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 /* | 1 /* |
| 2 * Copyright (c) 2012 The WebRTC project authors. All Rights Reserved. | 2 * Copyright (c) 2012 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 28 matching lines...) Expand all Loading... | |
| 39 const char* GetFilename(const char* filename) { | 39 const char* GetFilename(const char* filename) { |
| 40 std::string full_path_filename = webrtc::test::OutputPath() + filename; | 40 std::string full_path_filename = webrtc::test::OutputPath() + filename; |
| 41 return full_path_filename.c_str(); | 41 return full_path_filename.c_str(); |
| 42 } | 42 } |
| 43 #endif | 43 #endif |
| 44 | 44 |
| 45 using namespace webrtc; | 45 using namespace webrtc; |
| 46 | 46 |
| 47 class AudioEventObserverAPI: public AudioDeviceObserver { | 47 class AudioEventObserverAPI: public AudioDeviceObserver { |
| 48 public: | 48 public: |
| 49 AudioEventObserverAPI(AudioDeviceModule* audioDevice) | 49 AudioEventObserverAPI(rtc::scoped_refptr<AudioDeviceModule> audioDevice) |
|
tommi
2016/01/07 16:41:40
const& otherwise we're adding calls to AddRef/Rel
pbos-webrtc
2016/01/07 17:23:16
Done.
| |
| 50 : error_(kRecordingError), | 50 : error_(kRecordingError), |
| 51 warning_(kRecordingWarning), | 51 warning_(kRecordingWarning), |
| 52 audio_device_(audioDevice) { | 52 audio_device_(audioDevice) { |
| 53 } | 53 } |
| 54 | 54 |
| 55 ~AudioEventObserverAPI() {} | 55 ~AudioEventObserverAPI() {} |
| 56 | 56 |
| 57 virtual void OnErrorIsReported(const ErrorCode error) { | 57 virtual void OnErrorIsReported(const ErrorCode error) { |
| 58 TEST_LOG("\n[*** ERROR ***] => OnErrorIsReported(%d)\n\n", error); | 58 TEST_LOG("\n[*** ERROR ***] => OnErrorIsReported(%d)\n\n", error); |
| 59 error_ = error; | 59 error_ = error; |
| 60 } | 60 } |
| 61 | 61 |
| 62 virtual void OnWarningIsReported(const WarningCode warning) { | 62 virtual void OnWarningIsReported(const WarningCode warning) { |
| 63 TEST_LOG("\n[*** WARNING ***] => OnWarningIsReported(%d)\n\n", warning); | 63 TEST_LOG("\n[*** WARNING ***] => OnWarningIsReported(%d)\n\n", warning); |
| 64 warning_ = warning; | 64 warning_ = warning; |
| 65 EXPECT_EQ(0, audio_device_->StopRecording()); | 65 EXPECT_EQ(0, audio_device_->StopRecording()); |
| 66 EXPECT_EQ(0, audio_device_->StopPlayout()); | 66 EXPECT_EQ(0, audio_device_->StopPlayout()); |
| 67 } | 67 } |
| 68 | 68 |
| 69 public: | 69 public: |
| 70 ErrorCode error_; | 70 ErrorCode error_; |
| 71 WarningCode warning_; | 71 WarningCode warning_; |
| 72 private: | 72 private: |
| 73 AudioDeviceModule* audio_device_; | 73 rtc::scoped_refptr<AudioDeviceModule> audio_device_; |
| 74 }; | 74 }; |
| 75 | 75 |
| 76 class AudioTransportAPI: public AudioTransport { | 76 class AudioTransportAPI: public AudioTransport { |
| 77 public: | 77 public: |
| 78 AudioTransportAPI(AudioDeviceModule* audioDevice) | 78 AudioTransportAPI(AudioDeviceModule* audioDevice) |
| 79 : rec_count_(0), | 79 : rec_count_(0), |
| 80 play_count_(0) { | 80 play_count_(0) { |
| 81 } | 81 } |
| 82 | 82 |
| 83 ~AudioTransportAPI() {} | 83 ~AudioTransportAPI() {} |
| (...skipping 1738 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 1822 // TODO(kjellander): Fix so these tests pass on Mac. | 1822 // TODO(kjellander): Fix so these tests pass on Mac. |
| 1823 #if !defined(WEBRTC_MAC) | 1823 #if !defined(WEBRTC_MAC) |
| 1824 EXPECT_EQ(0, audio_device_->InitPlayout()); | 1824 EXPECT_EQ(0, audio_device_->InitPlayout()); |
| 1825 EXPECT_EQ(0, audio_device_->StartPlayout()); | 1825 EXPECT_EQ(0, audio_device_->StartPlayout()); |
| 1826 #endif | 1826 #endif |
| 1827 | 1827 |
| 1828 EXPECT_EQ(-1, audio_device_->GetLoudspeakerStatus(&loudspeakerOn)); | 1828 EXPECT_EQ(-1, audio_device_->GetLoudspeakerStatus(&loudspeakerOn)); |
| 1829 #endif | 1829 #endif |
| 1830 EXPECT_EQ(0, audio_device_->StopPlayout()); | 1830 EXPECT_EQ(0, audio_device_->StopPlayout()); |
| 1831 } | 1831 } |
| OLD | NEW |