Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 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 #define _USE_MATH_DEFINES // For VC++ to get M_PI. This has to be first. | 5 #define _USE_MATH_DEFINES // For VC++ to get M_PI. This has to be first. |
| 6 | 6 |
| 7 #include <utility> | 7 #include <utility> |
| 8 | 8 |
| 9 #include "base/bind.h" | 9 #include "base/bind.h" |
| 10 #include "base/macros.h" | 10 #include "base/macros.h" |
| (...skipping 76 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 87 if (!first_frame_sent_) { | 87 if (!first_frame_sent_) { |
| 88 first_frame_sent_ = true; | 88 first_frame_sent_ = true; |
| 89 frame->mutable_updated_region()->SetRect( | 89 frame->mutable_updated_region()->SetRect( |
| 90 webrtc::DesktopRect::MakeSize(frame->size())); | 90 webrtc::DesktopRect::MakeSize(frame->size())); |
| 91 } | 91 } |
| 92 | 92 |
| 93 callback_->OnCaptureResult(webrtc::DesktopCapturer::Result::SUCCESS, | 93 callback_->OnCaptureResult(webrtc::DesktopCapturer::Result::SUCCESS, |
| 94 std::move(frame)); | 94 std::move(frame)); |
| 95 } | 95 } |
| 96 | 96 |
| 97 bool GetSourceList(SourceList* sources) override { | |
| 98 return true; | |
|
Sergey Ulanov
2016/11/05 00:16:26
Need to put something in sources if you return suc
Hzj_jie
2016/11/06 04:27:24
Done.
| |
| 99 } | |
| 100 | |
| 101 bool SelectSource(SourceId id) override { | |
| 102 return true; | |
| 103 } | |
| 104 | |
| 97 private: | 105 private: |
| 98 Callback* callback_ = nullptr; | 106 Callback* callback_ = nullptr; |
| 99 bool first_frame_sent_ = false; | 107 bool first_frame_sent_ = false; |
| 100 }; | 108 }; |
| 101 | 109 |
| 102 static const int kAudioSampleRate = AudioPacket::SAMPLING_RATE_48000; | 110 static const int kAudioSampleRate = AudioPacket::SAMPLING_RATE_48000; |
| 103 static const int kAudioPacketDurationMs = 50; | 111 static const int kAudioPacketDurationMs = 50; |
| 104 static constexpr int kSamplesPerAudioPacket = | 112 static constexpr int kSamplesPerAudioPacket = |
| 105 kAudioSampleRate * kAudioPacketDurationMs / | 113 kAudioSampleRate * kAudioPacketDurationMs / |
| 106 base::Time::kMillisecondsPerSecond; | 114 base::Time::kMillisecondsPerSecond; |
| (...skipping 477 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 584 std::unique_ptr<AudioStream> audio_stream = | 592 std::unique_ptr<AudioStream> audio_stream = |
| 585 host_connection_->StartAudioStream(base::MakeUnique<TestAudioSource>()); | 593 host_connection_->StartAudioStream(base::MakeUnique<TestAudioSource>()); |
| 586 | 594 |
| 587 // Wait for 1 second worth of audio samples. | 595 // Wait for 1 second worth of audio samples. |
| 588 client_audio_player_.WaitForSamples(kAudioSampleRate * 2); | 596 client_audio_player_.WaitForSamples(kAudioSampleRate * 2); |
| 589 client_audio_player_.Verify(); | 597 client_audio_player_.Verify(); |
| 590 } | 598 } |
| 591 | 599 |
| 592 } // namespace protocol | 600 } // namespace protocol |
| 593 } // namespace remoting | 601 } // namespace remoting |
| OLD | NEW |