Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(301)

Side by Side Diff: remoting/base/encoder_vp8.cc

Issue 10736046: Add DPI information to video packets. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Reviewer comments. Created 8 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « remoting/base/encoder_row_based.cc ('k') | remoting/base/encoder_vp8_unittest.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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/base/encoder_vp8.h" 5 #include "remoting/base/encoder_vp8.h"
6 6
7 #include "base/logging.h" 7 #include "base/logging.h"
8 #include "base/sys_info.h" 8 #include "base/sys_info.h"
9 #include "media/base/yuv_convert.h" 9 #include "media/base/yuv_convert.h"
10 #include "remoting/base/capture_data.h" 10 #include "remoting/base/capture_data.h"
(...skipping 275 matching lines...) Expand 10 before | Expand all | Expand 10 after
286 } 286 }
287 287
288 // Construct the VideoPacket message. 288 // Construct the VideoPacket message.
289 packet->mutable_format()->set_encoding(VideoPacketFormat::ENCODING_VP8); 289 packet->mutable_format()->set_encoding(VideoPacketFormat::ENCODING_VP8);
290 packet->set_flags(VideoPacket::FIRST_PACKET | VideoPacket::LAST_PACKET | 290 packet->set_flags(VideoPacket::FIRST_PACKET | VideoPacket::LAST_PACKET |
291 VideoPacket::LAST_PARTITION); 291 VideoPacket::LAST_PARTITION);
292 packet->mutable_format()->set_screen_width(capture_data->size().width()); 292 packet->mutable_format()->set_screen_width(capture_data->size().width());
293 packet->mutable_format()->set_screen_height(capture_data->size().height()); 293 packet->mutable_format()->set_screen_height(capture_data->size().height());
294 packet->set_capture_time_ms(capture_data->capture_time_ms()); 294 packet->set_capture_time_ms(capture_data->capture_time_ms());
295 packet->set_client_sequence_number(capture_data->client_sequence_number()); 295 packet->set_client_sequence_number(capture_data->client_sequence_number());
296 SkIPoint dpi(capture_data->dpi());
297 if (dpi.x())
298 packet->mutable_format()->set_x_dpi(dpi.x());
299 if (dpi.y())
300 packet->mutable_format()->set_y_dpi(dpi.y());
296 for (SkRegion::Iterator r(updated_region); !r.done(); r.next()) { 301 for (SkRegion::Iterator r(updated_region); !r.done(); r.next()) {
297 Rect* rect = packet->add_dirty_rects(); 302 Rect* rect = packet->add_dirty_rects();
298 rect->set_x(r.rect().x()); 303 rect->set_x(r.rect().x());
299 rect->set_y(r.rect().y()); 304 rect->set_y(r.rect().y());
300 rect->set_width(r.rect().width()); 305 rect->set_width(r.rect().width());
301 rect->set_height(r.rect().height()); 306 rect->set_height(r.rect().height());
302 } 307 }
303 308
304 data_available_callback.Run(packet.Pass()); 309 data_available_callback.Run(packet.Pass());
305 } 310 }
306 311
307 } // namespace remoting 312 } // namespace remoting
OLDNEW
« no previous file with comments | « remoting/base/encoder_row_based.cc ('k') | remoting/base/encoder_vp8_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698