| Index: remoting/protocol/rtp_video_reader.cc
 | 
| diff --git a/remoting/protocol/rtp_video_reader.cc b/remoting/protocol/rtp_video_reader.cc
 | 
| new file mode 100644
 | 
| index 0000000000000000000000000000000000000000..8de6d9164da0ac637fc3bd1c5a6d11aed9917b2d
 | 
| --- /dev/null
 | 
| +++ b/remoting/protocol/rtp_video_reader.cc
 | 
| @@ -0,0 +1,41 @@
 | 
| +// Copyright (c) 2010 The Chromium Authors. All rights reserved.
 | 
| +// Use of this source code is governed by a BSD-style license that can be
 | 
| +// found in the LICENSE file.
 | 
| +
 | 
| +#include "remoting/protocol/rtp_video_reader.h"
 | 
| +
 | 
| +#include "base/task.h"
 | 
| +#include "remoting/protocol/chromotocol_connection.h"
 | 
| +
 | 
| +namespace remoting {
 | 
| +
 | 
| +RtpVideoReader::RtpVideoReader() { }
 | 
| +RtpVideoReader::~RtpVideoReader() { }
 | 
| +
 | 
| +void RtpVideoReader::Init(ChromotocolConnection* connection,
 | 
| +                          VideoStub* video_stub) {
 | 
| +  rtp_reader_.Init(connection->video_rtp_channel(),
 | 
| +                   NewCallback(this, &RtpVideoReader::OnRtpPacket));
 | 
| +  video_stub_ = video_stub;
 | 
| +}
 | 
| +
 | 
| +void RtpVideoReader::Close() {
 | 
| +  rtp_reader_.Close();
 | 
| +}
 | 
| +
 | 
| +void RtpVideoReader::OnRtpPacket(const RtpPacket& rtp_packet) {
 | 
| +  VideoPacket* packet = new VideoPacket();
 | 
| +  packet->set_data(rtp_packet.payload, rtp_packet.payload_size);
 | 
| +
 | 
| +  packet->mutable_format()->set_encoding(VideoPacketFormat::ENCODING_VP8);
 | 
| +  packet->set_flags(rtp_packet.header.marker ? VideoPacket::LAST_PACKET : 0);
 | 
| +  packet->mutable_format()->set_pixel_format(PIXEL_FORMAT_RGB32);
 | 
| +  packet->mutable_format()->set_x(0);
 | 
| +  packet->mutable_format()->set_y(0);
 | 
| +  packet->mutable_format()->set_width(800);
 | 
| +  packet->mutable_format()->set_height(600);
 | 
| +
 | 
| +  video_stub_->ProcessVideoPacket(packet, new DeleteTask<VideoPacket>(packet));
 | 
| +}
 | 
| +
 | 
| +}  // namespace remoting
 | 
| 
 |