| OLD | NEW |
| 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/codec/video_encoder_verbatim.h" | 5 #include "remoting/codec/video_encoder_verbatim.h" |
| 6 | 6 |
| 7 #include "base/logging.h" | 7 #include "base/logging.h" |
| 8 #include "base/stl_util.h" | 8 #include "base/stl_util.h" |
| 9 #include "base/time/time.h" | 9 #include "base/time/time.h" |
| 10 #include "remoting/base/util.h" | 10 #include "remoting/base/util.h" |
| 11 #include "remoting/proto/video.pb.h" | 11 #include "remoting/proto/video.pb.h" |
| 12 #include "third_party/webrtc/modules/desktop_capture/desktop_frame.h" | 12 #include "third_party/webrtc/modules/desktop_capture/desktop_frame.h" |
| 13 | 13 |
| 14 namespace remoting { | 14 namespace remoting { |
| 15 | 15 |
| 16 static const int kPacketSize = 1024 * 1024; | |
| 17 | |
| 18 VideoEncoderVerbatim::VideoEncoderVerbatim() {} | 16 VideoEncoderVerbatim::VideoEncoderVerbatim() {} |
| 19 VideoEncoderVerbatim::~VideoEncoderVerbatim() {} | 17 VideoEncoderVerbatim::~VideoEncoderVerbatim() {} |
| 20 | 18 |
| 21 scoped_ptr<VideoPacket> VideoEncoderVerbatim::Encode( | 19 scoped_ptr<VideoPacket> VideoEncoderVerbatim::Encode( |
| 22 const webrtc::DesktopFrame& frame) { | 20 const webrtc::DesktopFrame& frame) { |
| 23 CHECK(frame.data()); | 21 CHECK(frame.data()); |
| 24 | 22 |
| 25 base::Time encode_start_time = base::Time::Now(); | 23 base::Time encode_start_time = base::Time::Now(); |
| 26 scoped_ptr<VideoPacket> packet(new VideoPacket()); | 24 scoped_ptr<VideoPacket> packet(new VideoPacket()); |
| 27 | 25 |
| (...skipping 48 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 76 return packet.Pass(); | 74 return packet.Pass(); |
| 77 } | 75 } |
| 78 | 76 |
| 79 uint8_t* VideoEncoderVerbatim::GetOutputBuffer(VideoPacket* packet, | 77 uint8_t* VideoEncoderVerbatim::GetOutputBuffer(VideoPacket* packet, |
| 80 size_t size) { | 78 size_t size) { |
| 81 packet->mutable_data()->resize(size); | 79 packet->mutable_data()->resize(size); |
| 82 return reinterpret_cast<uint8_t*>(string_as_array(packet->mutable_data())); | 80 return reinterpret_cast<uint8_t*>(string_as_array(packet->mutable_data())); |
| 83 } | 81 } |
| 84 | 82 |
| 85 } // namespace remoting | 83 } // namespace remoting |
| OLD | NEW |