| 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 #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 "base/memory/ref_counted.h" | 8 #include "base/memory/ref_counted.h" |
| 9 #include "base/memory/weak_ptr.h" | 9 #include "base/memory/weak_ptr.h" |
| 10 #include "media/video/capture/screen/screen_capturer.h" | 10 #include "media/video/capture/screen/screen_capturer.h" |
| (...skipping 13 matching lines...) Expand all Loading... |
| 24 // Routes media::ScreenCapturer calls though the IPC channel to the desktop | 24 // Routes media::ScreenCapturer calls though the IPC channel to the desktop |
| 25 // session agent running in the desktop integration process. | 25 // session agent running in the desktop integration process. |
| 26 class IpcVideoFrameCapturer : public media::ScreenCapturer { | 26 class IpcVideoFrameCapturer : public media::ScreenCapturer { |
| 27 public: | 27 public: |
| 28 explicit IpcVideoFrameCapturer( | 28 explicit IpcVideoFrameCapturer( |
| 29 scoped_refptr<DesktopSessionProxy> desktop_session_proxy); | 29 scoped_refptr<DesktopSessionProxy> desktop_session_proxy); |
| 30 virtual ~IpcVideoFrameCapturer(); | 30 virtual ~IpcVideoFrameCapturer(); |
| 31 | 31 |
| 32 // media::ScreenCapturer interface. | 32 // media::ScreenCapturer interface. |
| 33 virtual void Start(Delegate* delegate) OVERRIDE; | 33 virtual void Start(Delegate* delegate) OVERRIDE; |
| 34 virtual void Stop() OVERRIDE; | |
| 35 virtual void InvalidateRegion(const SkRegion& invalid_region) OVERRIDE; | |
| 36 virtual void CaptureFrame() OVERRIDE; | 34 virtual void CaptureFrame() OVERRIDE; |
| 37 | 35 |
| 38 // Called when a video frame has been captured. |capture_data| describes | 36 // Called when a video frame has been captured. |capture_data| describes |
| 39 // a captured frame. | 37 // a captured frame. |
| 40 void OnCaptureCompleted(scoped_refptr<media::ScreenCaptureData> capture_data); | 38 void OnCaptureCompleted(scoped_refptr<media::ScreenCaptureData> capture_data); |
| 41 | 39 |
| 42 // Called when the cursor shape has changed. | 40 // Called when the cursor shape has changed. |
| 43 void OnCursorShapeChanged(scoped_ptr<media::MouseCursorShape> cursor_shape); | 41 void OnCursorShapeChanged(scoped_ptr<media::MouseCursorShape> cursor_shape); |
| 44 | 42 |
| 45 private: | 43 private: |
| 46 // Points to the delegate passed to media::ScreenCapturer::Start(). | 44 // Points to the delegate passed to media::ScreenCapturer::Start(). |
| 47 media::ScreenCapturer::Delegate* delegate_; | 45 media::ScreenCapturer::Delegate* delegate_; |
| 48 | 46 |
| 49 // Wraps the IPC channel to the desktop session agent. | 47 // Wraps the IPC channel to the desktop session agent. |
| 50 scoped_refptr<DesktopSessionProxy> desktop_session_proxy_; | 48 scoped_refptr<DesktopSessionProxy> desktop_session_proxy_; |
| 51 | 49 |
| 52 // Used to cancel tasks pending on the capturer when it is stopped. | 50 // Used to cancel tasks pending on the capturer when it is stopped. |
| 53 base::WeakPtrFactory<IpcVideoFrameCapturer> weak_factory_; | 51 base::WeakPtrFactory<IpcVideoFrameCapturer> weak_factory_; |
| 54 | 52 |
| 55 DISALLOW_COPY_AND_ASSIGN(IpcVideoFrameCapturer); | 53 DISALLOW_COPY_AND_ASSIGN(IpcVideoFrameCapturer); |
| 56 }; | 54 }; |
| 57 | 55 |
| 58 } // namespace remoting | 56 } // namespace remoting |
| 59 | 57 |
| 60 #endif // REMOTING_HOST_IPC_VIDEO_FRAME_CAPTURER_H_ | 58 #endif // REMOTING_HOST_IPC_VIDEO_FRAME_CAPTURER_H_ |
| OLD | NEW |