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

Side by Side Diff: remoting/protocol/fake_desktop_capturer.h

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/fake_datagram_socket.cc ('k') | remoting/protocol/fake_desktop_capturer.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 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 #ifndef REMOTING_PROTOCOL_FAKE_DESKTOP_CAPTURER_H_ 5 #ifndef REMOTING_PROTOCOL_FAKE_DESKTOP_CAPTURER_H_
6 #define REMOTING_PROTOCOL_FAKE_DESKTOP_CAPTURER_H_ 6 #define REMOTING_PROTOCOL_FAKE_DESKTOP_CAPTURER_H_
7 7
8 #include <memory>
9
8 #include "base/callback.h" 10 #include "base/callback.h"
9 #include "base/macros.h" 11 #include "base/macros.h"
10 #include "base/memory/scoped_ptr.h"
11 #include "third_party/webrtc/modules/desktop_capture/desktop_capturer.h" 12 #include "third_party/webrtc/modules/desktop_capture/desktop_capturer.h"
12 #include "third_party/webrtc/modules/desktop_capture/desktop_geometry.h" 13 #include "third_party/webrtc/modules/desktop_capture/desktop_geometry.h"
13 #include "third_party/webrtc/modules/desktop_capture/screen_capture_frame_queue. h" 14 #include "third_party/webrtc/modules/desktop_capture/screen_capture_frame_queue. h"
14 15
15 namespace remoting { 16 namespace remoting {
16 namespace protocol { 17 namespace protocol {
17 18
18 // A FakeDesktopCapturer generates artificial image for testing purpose. 19 // A FakeDesktopCapturer generates artificial image for testing purpose.
19 // 20 //
20 // FakeDesktopCapturer is double-buffered as required by DesktopCapturer. 21 // FakeDesktopCapturer is double-buffered as required by DesktopCapturer.
21 class FakeDesktopCapturer : public webrtc::DesktopCapturer { 22 class FakeDesktopCapturer : public webrtc::DesktopCapturer {
22 public: 23 public:
23 // By default FakeDesktopCapturer generates frames of size kWidth x kHeight, 24 // By default FakeDesktopCapturer generates frames of size kWidth x kHeight,
24 // but custom frame generator set using set_frame_generator() may generate 25 // but custom frame generator set using set_frame_generator() may generate
25 // frames of different size. 26 // frames of different size.
26 static const int kWidth = 800; 27 static const int kWidth = 800;
27 static const int kHeight = 600; 28 static const int kHeight = 600;
28 29
29 typedef base::Callback<scoped_ptr<webrtc::DesktopFrame>( 30 typedef base::Callback<std::unique_ptr<webrtc::DesktopFrame>(
30 webrtc::SharedMemoryFactory* shared_memory_factory)> 31 webrtc::SharedMemoryFactory* shared_memory_factory)>
31 FrameGenerator; 32 FrameGenerator;
32 33
33 FakeDesktopCapturer(); 34 FakeDesktopCapturer();
34 ~FakeDesktopCapturer() override; 35 ~FakeDesktopCapturer() override;
35 36
36 void set_frame_generator(const FrameGenerator& frame_generator); 37 void set_frame_generator(const FrameGenerator& frame_generator);
37 38
38 // webrtc::DesktopCapturer interface. 39 // webrtc::DesktopCapturer interface.
39 void Start(Callback* callback) override; 40 void Start(Callback* callback) override;
40 void SetSharedMemoryFactory(rtc::scoped_ptr<webrtc::SharedMemoryFactory> 41 void SetSharedMemoryFactory(rtc::scoped_ptr<webrtc::SharedMemoryFactory>
41 shared_memory_factory) override; 42 shared_memory_factory) override;
42 void Capture(const webrtc::DesktopRegion& rect) override; 43 void Capture(const webrtc::DesktopRegion& rect) override;
43 44
44 private: 45 private:
45 FrameGenerator frame_generator_; 46 FrameGenerator frame_generator_;
46 47
47 Callback* callback_; 48 Callback* callback_;
48 49
49 scoped_ptr<webrtc::SharedMemoryFactory> shared_memory_factory_; 50 std::unique_ptr<webrtc::SharedMemoryFactory> shared_memory_factory_;
50 51
51 DISALLOW_COPY_AND_ASSIGN(FakeDesktopCapturer); 52 DISALLOW_COPY_AND_ASSIGN(FakeDesktopCapturer);
52 }; 53 };
53 54
54 } // namespace protocol 55 } // namespace protocol
55 } // namespace remoting 56 } // namespace remoting
56 57
57 #endif // REMOTING_PROTOCOL_FAKE_DESKTOP_CAPTURER_H_ 58 #endif // REMOTING_PROTOCOL_FAKE_DESKTOP_CAPTURER_H_
OLDNEW
« no previous file with comments | « remoting/protocol/fake_datagram_socket.cc ('k') | remoting/protocol/fake_desktop_capturer.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698