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

Side by Side Diff: remoting/host/ipc_video_frame_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/host/ipc_util_win.cc ('k') | remoting/host/ipc_video_frame_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 (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 #ifndef REMOTING_HOST_IPC_VIDEO_FRAME_CAPTURER_H_ 5 #ifndef REMOTING_HOST_IPC_VIDEO_FRAME_CAPTURER_H_
6 #define REMOTING_HOST_IPC_VIDEO_FRAME_CAPTURER_H_ 6 #define REMOTING_HOST_IPC_VIDEO_FRAME_CAPTURER_H_
7 7
8 #include <memory>
9
8 #include "base/macros.h" 10 #include "base/macros.h"
9 #include "base/memory/ref_counted.h" 11 #include "base/memory/ref_counted.h"
10 #include "base/memory/scoped_ptr.h"
11 #include "base/memory/weak_ptr.h" 12 #include "base/memory/weak_ptr.h"
12 #include "third_party/webrtc/modules/desktop_capture/desktop_capturer.h" 13 #include "third_party/webrtc/modules/desktop_capture/desktop_capturer.h"
13 14
14 namespace remoting { 15 namespace remoting {
15 16
16 class DesktopSessionProxy; 17 class DesktopSessionProxy;
17 18
18 // Routes webrtc::DesktopCapturer calls though the IPC channel to the desktop 19 // Routes webrtc::DesktopCapturer calls though the IPC channel to the desktop
19 // session agent running in the desktop integration process. 20 // session agent running in the desktop integration process.
20 class IpcVideoFrameCapturer : public webrtc::DesktopCapturer { 21 class IpcVideoFrameCapturer : public webrtc::DesktopCapturer {
21 public: 22 public:
22 explicit IpcVideoFrameCapturer( 23 explicit IpcVideoFrameCapturer(
23 scoped_refptr<DesktopSessionProxy> desktop_session_proxy); 24 scoped_refptr<DesktopSessionProxy> desktop_session_proxy);
24 ~IpcVideoFrameCapturer() override; 25 ~IpcVideoFrameCapturer() override;
25 26
26 // webrtc::DesktopCapturer interface. 27 // webrtc::DesktopCapturer interface.
27 void Start(Callback* callback) override; 28 void Start(Callback* callback) override;
28 void Capture(const webrtc::DesktopRegion& region) override; 29 void Capture(const webrtc::DesktopRegion& region) override;
29 30
30 // Called when a video |frame| has been captured. 31 // Called when a video |frame| has been captured.
31 void OnCaptureCompleted(scoped_ptr<webrtc::DesktopFrame> frame); 32 void OnCaptureCompleted(std::unique_ptr<webrtc::DesktopFrame> frame);
32 33
33 private: 34 private:
34 // Points to the callback passed to webrtc::DesktopCapturer::Start(). 35 // Points to the callback passed to webrtc::DesktopCapturer::Start().
35 webrtc::DesktopCapturer::Callback* callback_; 36 webrtc::DesktopCapturer::Callback* callback_;
36 37
37 // Wraps the IPC channel to the desktop session agent. 38 // Wraps the IPC channel to the desktop session agent.
38 scoped_refptr<DesktopSessionProxy> desktop_session_proxy_; 39 scoped_refptr<DesktopSessionProxy> desktop_session_proxy_;
39 40
40 // Set to true when a frame is being captured. 41 // Set to true when a frame is being captured.
41 bool capture_pending_; 42 bool capture_pending_;
42 43
43 // Used to cancel tasks pending on the capturer when it is stopped. 44 // Used to cancel tasks pending on the capturer when it is stopped.
44 base::WeakPtrFactory<IpcVideoFrameCapturer> weak_factory_; 45 base::WeakPtrFactory<IpcVideoFrameCapturer> weak_factory_;
45 46
46 DISALLOW_COPY_AND_ASSIGN(IpcVideoFrameCapturer); 47 DISALLOW_COPY_AND_ASSIGN(IpcVideoFrameCapturer);
47 }; 48 };
48 49
49 } // namespace remoting 50 } // namespace remoting
50 51
51 #endif // REMOTING_HOST_IPC_VIDEO_FRAME_CAPTURER_H_ 52 #endif // REMOTING_HOST_IPC_VIDEO_FRAME_CAPTURER_H_
OLDNEW
« no previous file with comments | « remoting/host/ipc_util_win.cc ('k') | remoting/host/ipc_video_frame_capturer.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698