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

Side by Side Diff: remoting/protocol/webrtc_video_stream.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/protocol/webrtc_video_stream.h ('k') | remoting/signaling/fake_signal_strategy.h » ('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 2015 The Chromium Authors. All rights reserved. 1 // Copyright 2015 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/protocol/webrtc_video_stream.h" 5 #include "remoting/protocol/webrtc_video_stream.h"
6 6
7 #include "base/logging.h" 7 #include "base/logging.h"
8 #include "remoting/protocol/webrtc_video_capturer_adapter.h" 8 #include "remoting/protocol/webrtc_video_capturer_adapter.h"
9 #include "third_party/webrtc/api/mediastreaminterface.h" 9 #include "third_party/webrtc/api/mediastreaminterface.h"
10 #include "third_party/webrtc/api/peerconnectioninterface.h" 10 #include "third_party/webrtc/api/peerconnectioninterface.h"
(...skipping 16 matching lines...) Expand all
27 connection_->RemoveStream(stream_.get()); 27 connection_->RemoveStream(stream_.get());
28 } 28 }
29 29
30 // MediaStream may still outlive WebrtcVideoStream because it's 30 // MediaStream may still outlive WebrtcVideoStream because it's
31 // ref-counted. Reset SizeCallback to make sure it won't be called again. 31 // ref-counted. Reset SizeCallback to make sure it won't be called again.
32 if (capturer_adapter_) 32 if (capturer_adapter_)
33 capturer_adapter_->SetSizeCallback(SizeCallback()); 33 capturer_adapter_->SetSizeCallback(SizeCallback());
34 } 34 }
35 35
36 bool WebrtcVideoStream::Start( 36 bool WebrtcVideoStream::Start(
37 scoped_ptr<webrtc::DesktopCapturer> desktop_capturer, 37 std::unique_ptr<webrtc::DesktopCapturer> desktop_capturer,
38 scoped_refptr<webrtc::PeerConnectionInterface> connection, 38 scoped_refptr<webrtc::PeerConnectionInterface> connection,
39 scoped_refptr<webrtc::PeerConnectionFactoryInterface> 39 scoped_refptr<webrtc::PeerConnectionFactoryInterface>
40 peer_connection_factory) { 40 peer_connection_factory) {
41 scoped_ptr<WebrtcVideoCapturerAdapter> capturer_adapter( 41 std::unique_ptr<WebrtcVideoCapturerAdapter> capturer_adapter(
42 new WebrtcVideoCapturerAdapter(std::move(desktop_capturer))); 42 new WebrtcVideoCapturerAdapter(std::move(desktop_capturer)));
43 capturer_adapter_ = capturer_adapter->GetWeakPtr(); 43 capturer_adapter_ = capturer_adapter->GetWeakPtr();
44 44
45 connection_ = connection; 45 connection_ = connection;
46 46
47 // Set video stream constraints. 47 // Set video stream constraints.
48 webrtc::FakeConstraints video_constraints; 48 webrtc::FakeConstraints video_constraints;
49 video_constraints.AddMandatory( 49 video_constraints.AddMandatory(
50 webrtc::MediaConstraintsInterface::kMinFrameRate, 5); 50 webrtc::MediaConstraintsInterface::kMinFrameRate, 5);
51 51
(...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after
83 NOTIMPLEMENTED(); 83 NOTIMPLEMENTED();
84 } 84 }
85 85
86 void WebrtcVideoStream::SetSizeCallback(const SizeCallback& size_callback) { 86 void WebrtcVideoStream::SetSizeCallback(const SizeCallback& size_callback) {
87 if (capturer_adapter_) 87 if (capturer_adapter_)
88 capturer_adapter_->SetSizeCallback(size_callback); 88 capturer_adapter_->SetSizeCallback(size_callback);
89 } 89 }
90 90
91 } // namespace protocol 91 } // namespace protocol
92 } // namespace remoting 92 } // namespace remoting
OLDNEW
« no previous file with comments | « remoting/protocol/webrtc_video_stream.h ('k') | remoting/signaling/fake_signal_strategy.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698