| 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 <stddef.h> | 7 #include <stddef.h> |
| 8 #include <stdint.h> | 8 #include <stdint.h> |
| 9 | 9 |
| 10 #include "base/logging.h" | 10 #include "base/logging.h" |
| 11 #include "base/stl_util.h" | 11 #include "base/stl_util.h" |
| 12 #include "remoting/base/util.h" | 12 #include "remoting/base/util.h" |
| 13 #include "remoting/proto/video.pb.h" | 13 #include "remoting/proto/video.pb.h" |
| 14 #include "third_party/webrtc/modules/desktop_capture/desktop_frame.h" | 14 #include "third_party/webrtc/modules/desktop_capture/desktop_frame.h" |
| 15 #include "third_party/webrtc/modules/desktop_capture/desktop_geometry.h" | 15 #include "third_party/webrtc/modules/desktop_capture/desktop_geometry.h" |
| 16 #include "third_party/webrtc/modules/desktop_capture/desktop_region.h" | 16 #include "third_party/webrtc/modules/desktop_capture/desktop_region.h" |
| 17 | 17 |
| 18 namespace remoting { | 18 namespace remoting { |
| 19 | 19 |
| 20 static uint8_t* GetPacketOutputBuffer(VideoPacket* packet, size_t size) { | 20 static uint8_t* GetPacketOutputBuffer(VideoPacket* packet, size_t size) { |
| 21 packet->mutable_data()->resize(size); | 21 packet->mutable_data()->resize(size); |
| 22 return reinterpret_cast<uint8_t*>(string_as_array(packet->mutable_data())); | 22 return reinterpret_cast<uint8_t*>( |
| 23 base::string_as_array(packet->mutable_data())); |
| 23 } | 24 } |
| 24 | 25 |
| 25 VideoEncoderVerbatim::VideoEncoderVerbatim() {} | 26 VideoEncoderVerbatim::VideoEncoderVerbatim() {} |
| 26 VideoEncoderVerbatim::~VideoEncoderVerbatim() {} | 27 VideoEncoderVerbatim::~VideoEncoderVerbatim() {} |
| 27 | 28 |
| 28 std::unique_ptr<VideoPacket> VideoEncoderVerbatim::Encode( | 29 std::unique_ptr<VideoPacket> VideoEncoderVerbatim::Encode( |
| 29 const webrtc::DesktopFrame& frame, | 30 const webrtc::DesktopFrame& frame, |
| 30 uint32_t flags) { | 31 uint32_t flags) { |
| 31 DCHECK(frame.data()); | 32 DCHECK(frame.data()); |
| 32 | 33 |
| (...skipping 29 matching lines...) Expand all Loading... |
| 62 memcpy(out, in, row_size); | 63 memcpy(out, in, row_size); |
| 63 out += row_size; | 64 out += row_size; |
| 64 in += in_stride; | 65 in += in_stride; |
| 65 } | 66 } |
| 66 } | 67 } |
| 67 | 68 |
| 68 return packet; | 69 return packet; |
| 69 } | 70 } |
| 70 | 71 |
| 71 } // namespace remoting | 72 } // namespace remoting |
| OLD | NEW |