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

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: 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 packet->set_dpi(capture_data_->dpi());
127 if (last) 128 if (last)
128 packet->set_flags(packet->flags() | VideoPacket::LAST_PARTITION); 129 packet->set_flags(packet->flags() | VideoPacket::LAST_PARTITION);
129 DCHECK(row_pos == row_size); 130 DCHECK(row_pos == row_size);
130 DCHECK(row_y == rect.height() - 1); 131 DCHECK(row_y == rect.height() - 1);
131 } 132 }
132 133
133 // If we have filled the message or we have reached the end of stream. 134 // If we have filled the message or we have reached the end of stream.
134 if (filled == packet_size_ || !compress_again) { 135 if (filled == packet_size_ || !compress_again) {
135 packet->mutable_data()->resize(filled); 136 packet->mutable_data()->resize(filled);
136 callback_.Run(packet.Pass()); 137 callback_.Run(packet.Pass());
(...skipping 26 matching lines...) Expand all
163 } 164 }
164 165
165 uint8* EncoderRowBased::GetOutputBuffer(VideoPacket* packet, size_t size) { 166 uint8* EncoderRowBased::GetOutputBuffer(VideoPacket* packet, size_t size) {
166 packet->mutable_data()->resize(size); 167 packet->mutable_data()->resize(size);
167 // TODO(ajwong): Is there a better way to do this at all??? 168 // TODO(ajwong): Is there a better way to do this at all???
168 return const_cast<uint8*>(reinterpret_cast<const uint8*>( 169 return const_cast<uint8*>(reinterpret_cast<const uint8*>(
169 packet->mutable_data()->data())); 170 packet->mutable_data()->data()));
170 } 171 }
171 172
172 } // namespace remoting 173 } // namespace remoting
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698