diff options
author | hclam@chromium.org <hclam@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-07-15 22:56:04 +0000 |
---|---|---|
committer | hclam@chromium.org <hclam@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-07-15 22:56:04 +0000 |
commit | e295ff0698eda75aa7e2b887362310df59ff559e (patch) | |
tree | 371a61e5da9e5c572ef40045937d6548fbcae6e3 /remoting/client/decoder_verbatim_unittest.cc | |
parent | 0a33b90c45a0b1a139e3a655666ba337ecb600b0 (diff) | |
download | chromium_src-e295ff0698eda75aa7e2b887362310df59ff559e.zip chromium_src-e295ff0698eda75aa7e2b887362310df59ff559e.tar.gz chromium_src-e295ff0698eda75aa7e2b887362310df59ff559e.tar.bz2 |
Changing UpdateStreamPacket protobuf definition for chromoting
This code also changes the API for encoder and ClientConnection to eliminate
one less copy.
Review URL: http://codereview.chromium.org/2963003
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@52561 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'remoting/client/decoder_verbatim_unittest.cc')
-rw-r--r-- | remoting/client/decoder_verbatim_unittest.cc | 23 |
1 files changed, 16 insertions, 7 deletions
diff --git a/remoting/client/decoder_verbatim_unittest.cc b/remoting/client/decoder_verbatim_unittest.cc index ca2c6f7..d541d22 100644 --- a/remoting/client/decoder_verbatim_unittest.cc +++ b/remoting/client/decoder_verbatim_unittest.cc @@ -20,13 +20,22 @@ TEST(DecoderVerbatimTest, SimpleDecode) { const size_t kHeight = 1; const char kData[] = "ABCDEFGHIJ"; scoped_ptr<HostMessage> msg(new HostMessage()); - msg->mutable_update_stream_packet()->mutable_header()->set_width(kWidth); - msg->mutable_update_stream_packet()->mutable_header()->set_height(kHeight); - msg->mutable_update_stream_packet()->mutable_header()->set_x(0); - msg->mutable_update_stream_packet()->mutable_header()->set_y(0); - msg->mutable_update_stream_packet()->mutable_header()->set_pixel_format( - PixelFormatAscii); - msg->mutable_update_stream_packet()->set_data(kData, sizeof(kData)); + + // Prepare the begin rect message. + UpdateStreamBeginRect* begin_rect = + msg->mutable_update_stream_packet()->mutable_begin_rect(); + begin_rect->set_width(kWidth); + begin_rect->set_height(kHeight); + begin_rect->set_x(0); + begin_rect->set_y(0); + begin_rect->set_pixel_format(PixelFormatAscii); + + // Prepare the rect data. + msg->mutable_update_stream_packet()->mutable_rect_data()->set_data( + kData, sizeof(kData)); + + // Prepare the end rect. + msg->mutable_update_stream_packet()->mutable_end_rect(); scoped_refptr<media::VideoFrame> frame; media::VideoFrame::CreateFrame(media::VideoFrame::ASCII, kWidth, kHeight, |