Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(164)

Side by Side Diff: remoting/codec/video_encoder_helper.cc

Issue 1864213002: Convert //remoting to use std::unique_ptr (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Mac IWYU Created 4 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « remoting/codec/video_encoder_helper.h ('k') | remoting/codec/video_encoder_helper_unittest.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 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_helper.h" 5 #include "remoting/codec/video_encoder_helper.h"
6 6
7 #include "remoting/proto/video.pb.h" 7 #include "remoting/proto/video.pb.h"
8 #include "third_party/webrtc/modules/desktop_capture/desktop_frame.h" 8 #include "third_party/webrtc/modules/desktop_capture/desktop_frame.h"
9 #include "third_party/webrtc/modules/desktop_capture/desktop_geometry.h" 9 #include "third_party/webrtc/modules/desktop_capture/desktop_geometry.h"
10 #include "third_party/webrtc/modules/desktop_capture/desktop_region.h" 10 #include "third_party/webrtc/modules/desktop_capture/desktop_region.h"
11 11
12 namespace remoting { 12 namespace remoting {
13 13
14 VideoEncoderHelper::VideoEncoderHelper() {} 14 VideoEncoderHelper::VideoEncoderHelper() {}
15 15
16 scoped_ptr<VideoPacket> VideoEncoderHelper::CreateVideoPacket( 16 std::unique_ptr<VideoPacket> VideoEncoderHelper::CreateVideoPacket(
17 const webrtc::DesktopFrame& frame) { 17 const webrtc::DesktopFrame& frame) {
18 return CreateVideoPacketWithUpdatedRegion(frame, frame.updated_region()); 18 return CreateVideoPacketWithUpdatedRegion(frame, frame.updated_region());
19 } 19 }
20 20
21 scoped_ptr<VideoPacket> 21 std::unique_ptr<VideoPacket>
22 VideoEncoderHelper::CreateVideoPacketWithUpdatedRegion( 22 VideoEncoderHelper::CreateVideoPacketWithUpdatedRegion(
23 const webrtc::DesktopFrame& frame, 23 const webrtc::DesktopFrame& frame,
24 const webrtc::DesktopRegion& updated_region) { 24 const webrtc::DesktopRegion& updated_region) {
25 scoped_ptr<VideoPacket> packet(new VideoPacket()); 25 std::unique_ptr<VideoPacket> packet(new VideoPacket());
26 26
27 // Set |screen_width| and |screen_height| iff they have changed. 27 // Set |screen_width| and |screen_height| iff they have changed.
28 if (!frame.size().equals(screen_size_)) { 28 if (!frame.size().equals(screen_size_)) {
29 screen_size_ = frame.size(); 29 screen_size_ = frame.size();
30 30
31 VideoPacketFormat* format = packet->mutable_format(); 31 VideoPacketFormat* format = packet->mutable_format();
32 format->set_screen_width(screen_size_.width()); 32 format->set_screen_width(screen_size_.width());
33 format->set_screen_height(screen_size_.height()); 33 format->set_screen_height(screen_size_.height());
34 } 34 }
35 35
(...skipping 11 matching lines...) Expand all
47 // Store frame DPI. 47 // Store frame DPI.
48 if (!frame.dpi().is_zero()) { 48 if (!frame.dpi().is_zero()) {
49 packet->mutable_format()->set_x_dpi(frame.dpi().x()); 49 packet->mutable_format()->set_x_dpi(frame.dpi().x());
50 packet->mutable_format()->set_y_dpi(frame.dpi().y()); 50 packet->mutable_format()->set_y_dpi(frame.dpi().y());
51 } 51 }
52 52
53 return packet; 53 return packet;
54 } 54 }
55 55
56 } // namespace remoting 56 } // namespace remoting
OLDNEW
« no previous file with comments | « remoting/codec/video_encoder_helper.h ('k') | remoting/codec/video_encoder_helper_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698