summaryrefslogtreecommitdiff
path: root/remoting/host
diff options
context:
space:
mode:
authorTorne (Richard Coles) <torne@google.com>2013-09-19 22:36:51 +0100
committerTorne (Richard Coles) <torne@google.com>2013-09-19 22:36:51 +0100
commitd0247b1b59f9c528cb6df88b4f2b9afaf80d181e (patch)
tree5c397fadc190cc71bffe2ffad1efc27a5b95309d /remoting/host
parentf7571f5f07547e2f3e0addf48d1f2a7ec3632957 (diff)
downloadchromium_org-d0247b1b59f9c528cb6df88b4f2b9afaf80d181e.tar.gz
Merge from Chromium at DEPS revision 224184
This commit was generated by merge_to_master.py. Change-Id: Ia3424df5abed9bea642c522b9e2358dceabd8423
Diffstat (limited to 'remoting/host')
-rw-r--r--remoting/host/DEPS2
-rw-r--r--remoting/host/audio_silence_detector.h2
-rw-r--r--remoting/host/client_session.cc11
-rw-r--r--remoting/host/mouse_clamping_filter.cc5
-rw-r--r--remoting/host/plugin/host_plugin.cc2
-rw-r--r--remoting/host/video_scheduler.cc31
-rw-r--r--remoting/host/video_scheduler_unittest.cc14
7 files changed, 26 insertions, 41 deletions
diff --git a/remoting/host/DEPS b/remoting/host/DEPS
index 90d75cab0f..6a826365ae 100644
--- a/remoting/host/DEPS
+++ b/remoting/host/DEPS
@@ -4,9 +4,11 @@ include_rules = [
"+remoting/codec",
"+remoting/jingle_glue",
"+remoting/protocol",
+ "+skia/ext",
"+third_party/jsoncpp",
"+third_party/modp_b64",
"+third_party/npapi",
+ "+third_party/skia/include/core",
"+third_party/webrtc",
"+ui",
]
diff --git a/remoting/host/audio_silence_detector.h b/remoting/host/audio_silence_detector.h
index 4bc686e8a6..83beec36a9 100644
--- a/remoting/host/audio_silence_detector.h
+++ b/remoting/host/audio_silence_detector.h
@@ -39,4 +39,4 @@ class AudioSilenceDetector {
} // namespace remoting
-#endif // REMOTING_HOST_AUDIO_SILENCE_DETECTOR_H_ \ No newline at end of file
+#endif // REMOTING_HOST_AUDIO_SILENCE_DETECTOR_H_
diff --git a/remoting/host/client_session.cc b/remoting/host/client_session.cc
index 45439f490c..67f4a952b7 100644
--- a/remoting/host/client_session.cc
+++ b/remoting/host/client_session.cc
@@ -10,7 +10,6 @@
#include "remoting/base/capabilities.h"
#include "remoting/codec/audio_encoder.h"
#include "remoting/codec/audio_encoder_opus.h"
-#include "remoting/codec/audio_encoder_speex.h"
#include "remoting/codec/audio_encoder_verbatim.h"
#include "remoting/codec/video_encoder.h"
#include "remoting/codec/video_encoder_verbatim.h"
@@ -427,13 +426,11 @@ scoped_ptr<VideoEncoder> ClientSession::CreateVideoEncoder(
const protocol::SessionConfig& config) {
const protocol::ChannelConfig& video_config = config.video_config();
- if (video_config.codec == protocol::ChannelConfig::CODEC_VERBATIM) {
- return scoped_ptr<VideoEncoder>(new remoting::VideoEncoderVerbatim());
- } else if (video_config.codec == protocol::ChannelConfig::CODEC_VP8) {
+ if (video_config.codec == protocol::ChannelConfig::CODEC_VP8) {
return scoped_ptr<VideoEncoder>(new remoting::VideoEncoderVp8());
}
- NOTIMPLEMENTED();
+ NOTREACHED();
return scoped_ptr<VideoEncoder>();
}
@@ -444,13 +441,11 @@ scoped_ptr<AudioEncoder> ClientSession::CreateAudioEncoder(
if (audio_config.codec == protocol::ChannelConfig::CODEC_VERBATIM) {
return scoped_ptr<AudioEncoder>(new AudioEncoderVerbatim());
- } else if (audio_config.codec == protocol::ChannelConfig::CODEC_SPEEX) {
- return scoped_ptr<AudioEncoder>(new AudioEncoderSpeex());
} else if (audio_config.codec == protocol::ChannelConfig::CODEC_OPUS) {
return scoped_ptr<AudioEncoder>(new AudioEncoderOpus());
}
- NOTIMPLEMENTED();
+ NOTREACHED();
return scoped_ptr<AudioEncoder>();
}
diff --git a/remoting/host/mouse_clamping_filter.cc b/remoting/host/mouse_clamping_filter.cc
index db01c103b2..91462fa307 100644
--- a/remoting/host/mouse_clamping_filter.cc
+++ b/remoting/host/mouse_clamping_filter.cc
@@ -24,8 +24,9 @@ void MouseClampingFilter::ProcessVideoPacket(
// Configure the MouseInputFilter to clamp to the video dimensions.
if (video_packet->format().has_screen_width() &&
video_packet->format().has_screen_height()) {
- SkISize screen_size = SkISize::Make(video_packet->format().screen_width(),
- video_packet->format().screen_height());
+ webrtc::DesktopSize screen_size =
+ webrtc::DesktopSize(video_packet->format().screen_width(),
+ video_packet->format().screen_height());
input_filter_.set_input_size(screen_size);
input_filter_.set_output_size(screen_size);
}
diff --git a/remoting/host/plugin/host_plugin.cc b/remoting/host/plugin/host_plugin.cc
index b8e2b13f68..f281bd1200 100644
--- a/remoting/host/plugin/host_plugin.cc
+++ b/remoting/host/plugin/host_plugin.cc
@@ -21,7 +21,7 @@
#include "remoting/host/plugin/host_plugin_utils.h"
#include "remoting/host/plugin/host_script_object.h"
#if defined(OS_WIN)
-#include "ui/gfx/dpi_win.h"
+#include "ui/gfx/win/dpi.h"
#endif
#include "third_party/npapi/bindings/npapi.h"
#include "third_party/npapi/bindings/npfunctions.h"
diff --git a/remoting/host/video_scheduler.cc b/remoting/host/video_scheduler.cc
index 883166b39c..5c95c7a938 100644
--- a/remoting/host/video_scheduler.cc
+++ b/remoting/host/video_scheduler.cc
@@ -249,11 +249,8 @@ void VideoScheduler::SendVideoPacket(scoped_ptr<VideoPacket> packet) {
if (!video_stub_)
return;
- base::Closure callback;
- if ((packet->flags() & VideoPacket::LAST_PARTITION) != 0)
- callback = base::Bind(&VideoScheduler::VideoFrameSentCallback, this);
-
- video_stub_->ProcessVideoPacket(packet.Pass(), callback);
+ video_stub_->ProcessVideoPacket(
+ packet.Pass(), base::Bind(&VideoScheduler::VideoFrameSentCallback, this));
}
void VideoScheduler::VideoFrameSentCallback() {
@@ -286,7 +283,6 @@ void VideoScheduler::EncodeFrame(
// If there is nothing to encode then send an empty keep-alive packet.
if (!frame || frame->updated_region().is_empty()) {
scoped_ptr<VideoPacket> packet(new VideoPacket());
- packet->set_flags(VideoPacket::LAST_PARTITION);
packet->set_client_sequence_number(sequence_number);
network_task_runner_->PostTask(
FROM_HERE, base::Bind(&VideoScheduler::SendVideoPacket, this,
@@ -295,25 +291,16 @@ void VideoScheduler::EncodeFrame(
return;
}
- encoder_->Encode(
- frame.get(), base::Bind(&VideoScheduler::EncodedDataAvailableCallback,
- this, sequence_number));
- capture_task_runner_->DeleteSoon(FROM_HERE, frame.release());
-}
-
-void VideoScheduler::EncodedDataAvailableCallback(
- int64 sequence_number,
- scoped_ptr<VideoPacket> packet) {
- DCHECK(encode_task_runner_->BelongsToCurrentThread());
-
+ scoped_ptr<VideoPacket> packet = encoder_->Encode(*frame);
packet->set_client_sequence_number(sequence_number);
- bool last = (packet->flags() & VideoPacket::LAST_PACKET) != 0;
- if (last) {
- scheduler_.RecordEncodeTime(
- base::TimeDelta::FromMilliseconds(packet->encode_time_ms()));
- }
+ // Destroy the frame before sending |packet| because SendVideoPacket() may
+ // trigger another frame to be captured, and the screen capturer expects the
+ // old frame to be freed by then.
+ frame.reset();
+ scheduler_.RecordEncodeTime(
+ base::TimeDelta::FromMilliseconds(packet->encode_time_ms()));
network_task_runner_->PostTask(
FROM_HERE, base::Bind(&VideoScheduler::SendVideoPacket, this,
base::Passed(&packet)));
diff --git a/remoting/host/video_scheduler_unittest.cc b/remoting/host/video_scheduler_unittest.cc
index 2dd7afbf19..25567d27ba 100644
--- a/remoting/host/video_scheduler_unittest.cc
+++ b/remoting/host/video_scheduler_unittest.cc
@@ -37,8 +37,7 @@ namespace {
ACTION(FinishEncode) {
scoped_ptr<VideoPacket> packet(new VideoPacket());
- packet->set_flags(VideoPacket::LAST_PACKET | VideoPacket::LAST_PARTITION);
- arg1.Run(packet.Pass());
+ return packet.release();
}
ACTION(FinishSend) {
@@ -55,9 +54,11 @@ class MockVideoEncoder : public VideoEncoder {
MockVideoEncoder();
virtual ~MockVideoEncoder();
- MOCK_METHOD2(Encode, void(
- const webrtc::DesktopFrame* frame,
- const DataAvailableCallback& data_available_callback));
+ scoped_ptr<VideoPacket> Encode(
+ const webrtc::DesktopFrame& frame) {
+ return scoped_ptr<VideoPacket>(EncodePtr(frame));
+ }
+ MOCK_METHOD1(EncodePtr, VideoPacket*(const webrtc::DesktopFrame& frame));
private:
DISALLOW_COPY_AND_ASSIGN(MockVideoEncoder);
@@ -158,7 +159,6 @@ TEST_F(VideoSchedulerTest, StartAndStop) {
frame_.reset(new webrtc::BasicDesktopFrame(
webrtc::DesktopSize(kWidth, kHeight)));
- webrtc::DesktopFrame* frame_ptr = frame_.get();
// First the capturer is called.
Expectation capturer_capture = EXPECT_CALL(*capturer, Capture(_))
@@ -166,7 +166,7 @@ TEST_F(VideoSchedulerTest, StartAndStop) {
.WillRepeatedly(Invoke(this, &VideoSchedulerTest::OnCaptureFrame));
// Expect the encoder be called.
- EXPECT_CALL(*encoder_, Encode(frame_ptr, _))
+ EXPECT_CALL(*encoder_, EncodePtr(_))
.WillRepeatedly(FinishEncode());
// By default delete the arguments when ProcessVideoPacket is received.