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

Side by Side Diff: remoting/base/encoder_row_based.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_row_based.h" 5 #include "remoting/base/encoder_row_based.h"
6 6
7 #include "base/logging.h" 7 #include "base/logging.h"
8 #include "remoting/base/capture_data.h" 8 #include "remoting/base/capture_data.h"
9 #include "remoting/base/compressor_verbatim.h" 9 #include "remoting/base/compressor_verbatim.h"
10 #include "remoting/base/compressor_zlib.h" 10 #include "remoting/base/compressor_zlib.h"
(...skipping 106 matching lines...) Expand 10 before | Expand all | Expand 10 after
117 flush, &consumed, &written); 117 flush, &consumed, &written);
118 row_pos += consumed; 118 row_pos += consumed;
119 filled += written; 119 filled += written;
120 120
121 // We have reached the end of stream. 121 // We have reached the end of stream.
122 if (!compress_again) { 122 if (!compress_again) {
123 packet->set_flags(packet->flags() | VideoPacket::LAST_PACKET); 123 packet->set_flags(packet->flags() | VideoPacket::LAST_PACKET);
124 packet->set_capture_time_ms(capture_data_->capture_time_ms()); 124 packet->set_capture_time_ms(capture_data_->capture_time_ms());
125 packet->set_client_sequence_number( 125 packet->set_client_sequence_number(
126 capture_data_->client_sequence_number()); 126 capture_data_->client_sequence_number());
127 SkIPoint dpi(capture_data_->dpi());
128 packet->mutable_format()->set_horizontal_dpi(dpi.x());
Wez 2012/07/13 21:49:02 Only set of dpi() is non-zero.
Jamie 2012/07/13 22:17:13 Done.
129 packet->mutable_format()->set_vertical_dpi(dpi.y());
127 if (last) 130 if (last)
128 packet->set_flags(packet->flags() | VideoPacket::LAST_PARTITION); 131 packet->set_flags(packet->flags() | VideoPacket::LAST_PARTITION);
129 DCHECK(row_pos == row_size); 132 DCHECK(row_pos == row_size);
130 DCHECK(row_y == rect.height() - 1); 133 DCHECK(row_y == rect.height() - 1);
131 } 134 }
132 135
133 // If we have filled the message or we have reached the end of stream. 136 // If we have filled the message or we have reached the end of stream.
134 if (filled == packet_size_ || !compress_again) { 137 if (filled == packet_size_ || !compress_again) {
135 packet->mutable_data()->resize(filled); 138 packet->mutable_data()->resize(filled);
136 callback_.Run(packet.Pass()); 139 callback_.Run(packet.Pass());
(...skipping 26 matching lines...) Expand all
163 } 166 }
164 167
165 uint8* EncoderRowBased::GetOutputBuffer(VideoPacket* packet, size_t size) { 168 uint8* EncoderRowBased::GetOutputBuffer(VideoPacket* packet, size_t size) {
166 packet->mutable_data()->resize(size); 169 packet->mutable_data()->resize(size);
167 // TODO(ajwong): Is there a better way to do this at all??? 170 // TODO(ajwong): Is there a better way to do this at all???
168 return const_cast<uint8*>(reinterpret_cast<const uint8*>( 171 return const_cast<uint8*>(reinterpret_cast<const uint8*>(
169 packet->mutable_data()->data())); 172 packet->mutable_data()->data()));
170 } 173 }
171 174
172 } // namespace remoting 175 } // namespace remoting
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698