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

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: Use different test values for x and y DPI. 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
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 packet->mutable_format()->set_horizontal_dpi(dpi.x());
Wez 2012/07/13 21:49:02 Only set these if dpi() is non-zero, otherwise the
Jamie 2012/07/13 22:17:13 Done. On a related note, since both encoders shar
Wez 2012/07/14 00:55:11 In principle that's a layering violation since Cap
298 packet->mutable_format()->set_vertical_dpi(dpi.y());
296 for (SkRegion::Iterator r(updated_region); !r.done(); r.next()) { 299 for (SkRegion::Iterator r(updated_region); !r.done(); r.next()) {
297 Rect* rect = packet->add_dirty_rects(); 300 Rect* rect = packet->add_dirty_rects();
298 rect->set_x(r.rect().x()); 301 rect->set_x(r.rect().x());
299 rect->set_y(r.rect().y()); 302 rect->set_y(r.rect().y());
300 rect->set_width(r.rect().width()); 303 rect->set_width(r.rect().width());
301 rect->set_height(r.rect().height()); 304 rect->set_height(r.rect().height());
302 } 305 }
303 306
304 data_available_callback.Run(packet.Pass()); 307 data_available_callback.Run(packet.Pass());
305 } 308 }
306 309
307 } // namespace remoting 310 } // namespace remoting
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698