| 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_decoder_verbatim.h" | 5 #include "remoting/codec/video_decoder_verbatim.h" |
| 6 | 6 |
| 7 #include <stdint.h> | 7 #include <stdint.h> |
| 8 | 8 |
| 9 #include "base/logging.h" | 9 #include "base/logging.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 #include "third_party/webrtc/modules/desktop_capture/desktop_geometry.h" | 13 #include "third_party/webrtc/modules/desktop_capture/desktop_geometry.h" |
| 14 #include "third_party/webrtc/modules/desktop_capture/desktop_region.h" | 14 #include "third_party/webrtc/modules/desktop_capture/desktop_region.h" |
| 15 | 15 |
| 16 namespace remoting { | 16 namespace remoting { |
| 17 | 17 |
| 18 static const int kBytesPerPixel = 4; | 18 static const int kBytesPerPixel = 4; |
| 19 | 19 |
| 20 VideoDecoderVerbatim::VideoDecoderVerbatim() {} | 20 VideoDecoderVerbatim::VideoDecoderVerbatim() {} |
| 21 VideoDecoderVerbatim::~VideoDecoderVerbatim() {} | 21 VideoDecoderVerbatim::~VideoDecoderVerbatim() {} |
| 22 | 22 |
| 23 void VideoDecoderVerbatim::SetPixelFormat( |
| 24 VideoDecoder::PixelFormat pixel_format) { |
| 25 NOTIMPLEMENTED(); |
| 26 } |
| 27 |
| 23 bool VideoDecoderVerbatim::DecodePacket(const VideoPacket& packet, | 28 bool VideoDecoderVerbatim::DecodePacket(const VideoPacket& packet, |
| 24 webrtc::DesktopFrame* frame) { | 29 webrtc::DesktopFrame* frame) { |
| 25 webrtc::DesktopRegion* region = frame->mutable_updated_region(); | 30 webrtc::DesktopRegion* region = frame->mutable_updated_region(); |
| 26 region->Clear(); | 31 region->Clear(); |
| 27 const char* current_data_pos = packet.data().data(); | 32 const char* current_data_pos = packet.data().data(); |
| 28 for (int i = 0; i < packet.dirty_rects_size(); ++i) { | 33 for (int i = 0; i < packet.dirty_rects_size(); ++i) { |
| 29 Rect proto_rect = packet.dirty_rects(i); | 34 Rect proto_rect = packet.dirty_rects(i); |
| 30 webrtc::DesktopRect rect = | 35 webrtc::DesktopRect rect = |
| 31 webrtc::DesktopRect::MakeXYWH(proto_rect.x(), proto_rect.y(), | 36 webrtc::DesktopRect::MakeXYWH(proto_rect.x(), proto_rect.y(), |
| 32 proto_rect.width(), proto_rect.height()); | 37 proto_rect.width(), proto_rect.height()); |
| (...skipping 20 matching lines...) Expand all Loading... |
| 53 | 58 |
| 54 if (current_data_pos != packet.data().data() + packet.data().size()) { | 59 if (current_data_pos != packet.data().data() + packet.data().size()) { |
| 55 LOG(ERROR) << "Invalid packet received."; | 60 LOG(ERROR) << "Invalid packet received."; |
| 56 return false; | 61 return false; |
| 57 } | 62 } |
| 58 | 63 |
| 59 return true; | 64 return true; |
| 60 } | 65 } |
| 61 | 66 |
| 62 } // namespace remoting | 67 } // namespace remoting |
| OLD | NEW |