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 "base/bind.h" | 7 #include "base/bind.h" |
8 #include "base/callback_helpers.h" | 8 #include "base/callback_helpers.h" |
9 #include "base/logging.h" | 9 #include "base/logging.h" |
10 #include "base/synchronization/lock.h" | 10 #include "base/synchronization/lock.h" |
(...skipping 156 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
167 VLOG(2) << "TestVideoRenderer::Core::ProcessVideoPacket() Called"; | 167 VLOG(2) << "TestVideoRenderer::Core::ProcessVideoPacket() Called"; |
168 | 168 |
169 // Screen size is attached on the first packet as well as when the | 169 // Screen size is attached on the first packet as well as when the |
170 // host screen is resized. | 170 // host screen is resized. |
171 if (packet->format().has_screen_width() && | 171 if (packet->format().has_screen_width() && |
172 packet->format().has_screen_height()) { | 172 packet->format().has_screen_height()) { |
173 webrtc::DesktopSize source_size(packet->format().screen_width(), | 173 webrtc::DesktopSize source_size(packet->format().screen_width(), |
174 packet->format().screen_height()); | 174 packet->format().screen_height()); |
175 if (!screen_size_.equals(source_size)) { | 175 if (!screen_size_.equals(source_size)) { |
176 screen_size_ = source_size; | 176 screen_size_ = source_size; |
177 decoder_->Initialize(screen_size_); | |
178 frame_.reset(new webrtc::BasicDesktopFrame(screen_size_)); | 177 frame_.reset(new webrtc::BasicDesktopFrame(screen_size_)); |
179 } | 178 } |
180 } | 179 } |
181 | 180 |
182 // To make life easier, assume that the desktop shape is a single rectangle. | 181 // To make life easier, assume that the desktop shape is a single rectangle. |
183 packet->clear_use_desktop_shape(); | 182 packet->clear_use_desktop_shape(); |
184 if (!decoder_->DecodePacket(*packet.get())) { | 183 if (!decoder_->DecodePacket(*packet.get())) { |
185 LOG(ERROR) << "Decoder::DecodePacket() failed."; | 184 LOG(ERROR) << "Decoder::DecodePacket() failed."; |
186 return; | 185 return; |
187 } | 186 } |
(...skipping 192 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
380 DCHECK(thread_checker_.CalledOnValidThread()); | 379 DCHECK(thread_checker_.CalledOnValidThread()); |
381 | 380 |
382 video_decode_task_runner_->PostTask( | 381 video_decode_task_runner_->PostTask( |
383 FROM_HERE, | 382 FROM_HERE, |
384 base::Bind(&Core::save_frame_data_to_disk, base::Unretained(core_.get()), | 383 base::Bind(&Core::save_frame_data_to_disk, base::Unretained(core_.get()), |
385 save_frame_data_to_disk)); | 384 save_frame_data_to_disk)); |
386 } | 385 } |
387 | 386 |
388 } // namespace test | 387 } // namespace test |
389 } // namespace remoting | 388 } // namespace remoting |
OLD | NEW |