| 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 #include "remoting/test/test_video_renderer.h" | 5 #include "remoting/test/test_video_renderer.h" |
| 6 | 6 |
| 7 #include <stdint.h> | 7 #include <stdint.h> |
| 8 | 8 |
| 9 #include "base/bind.h" | 9 #include "base/bind.h" |
| 10 #include "base/callback_helpers.h" | 10 #include "base/callback_helpers.h" |
| (...skipping 159 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 170 packet->format().has_screen_height()) { | 170 packet->format().has_screen_height()) { |
| 171 webrtc::DesktopSize source_size(packet->format().screen_width(), | 171 webrtc::DesktopSize source_size(packet->format().screen_width(), |
| 172 packet->format().screen_height()); | 172 packet->format().screen_height()); |
| 173 if (!frame_ || !frame_->size().equals(source_size)) { | 173 if (!frame_ || !frame_->size().equals(source_size)) { |
| 174 base::AutoLock auto_lock(lock_); | 174 base::AutoLock auto_lock(lock_); |
| 175 frame_.reset(webrtc::SharedDesktopFrame::Wrap( | 175 frame_.reset(webrtc::SharedDesktopFrame::Wrap( |
| 176 new webrtc::BasicDesktopFrame(source_size))); | 176 new webrtc::BasicDesktopFrame(source_size))); |
| 177 } | 177 } |
| 178 } | 178 } |
| 179 | 179 |
| 180 // To make life easier, assume that the desktop shape is a single rectangle. | |
| 181 packet->clear_use_desktop_shape(); | |
| 182 | |
| 183 // Render the result into a new DesktopFrame instance that shares buffer with | 180 // Render the result into a new DesktopFrame instance that shares buffer with |
| 184 // |frame_|. updated_region() will be updated for |new_frame|, but not for | 181 // |frame_|. updated_region() will be updated for |new_frame|, but not for |
| 185 // |frame_|. | 182 // |frame_|. |
| 186 scoped_ptr<webrtc::DesktopFrame> new_frame(frame_->Share()); | 183 scoped_ptr<webrtc::DesktopFrame> new_frame(frame_->Share()); |
| 187 | 184 |
| 188 { | 185 { |
| 189 base::AutoLock auto_lock(lock_); | 186 base::AutoLock auto_lock(lock_); |
| 190 if (!decoder_->DecodePacket(*packet, new_frame.get())) { | 187 if (!decoder_->DecodePacket(*packet, new_frame.get())) { |
| 191 LOG(ERROR) << "Decoder::DecodePacket() failed."; | 188 LOG(ERROR) << "Decoder::DecodePacket() failed."; |
| 192 return; | 189 return; |
| (...skipping 181 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 374 DCHECK(thread_checker_.CalledOnValidThread()); | 371 DCHECK(thread_checker_.CalledOnValidThread()); |
| 375 | 372 |
| 376 video_decode_task_runner_->PostTask( | 373 video_decode_task_runner_->PostTask( |
| 377 FROM_HERE, | 374 FROM_HERE, |
| 378 base::Bind(&Core::save_frame_data_to_disk, base::Unretained(core_.get()), | 375 base::Bind(&Core::save_frame_data_to_disk, base::Unretained(core_.get()), |
| 379 save_frame_data_to_disk)); | 376 save_frame_data_to_disk)); |
| 380 } | 377 } |
| 381 | 378 |
| 382 } // namespace test | 379 } // namespace test |
| 383 } // namespace remoting | 380 } // namespace remoting |
| OLD | NEW |