Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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 CONTENT_BROWSER_MEDIA_CAPTURE_DESKTOP_CAPTURE_DEVICE_AURA_H_ | 5 #ifndef CONTENT_BROWSER_MEDIA_CAPTURE_DESKTOP_CAPTURE_DEVICE_AURA_H_ |
| 6 #define CONTENT_BROWSER_MEDIA_CAPTURE_DESKTOP_CAPTURE_DEVICE_AURA_H_ | 6 #define CONTENT_BROWSER_MEDIA_CAPTURE_DESKTOP_CAPTURE_DEVICE_AURA_H_ |
| 7 | 7 |
| 8 #include <string> | 8 #include <string> |
| 9 | 9 |
| 10 #include "base/memory/scoped_ptr.h" | 10 #include "base/memory/scoped_ptr.h" |
| 11 #include "base/memory/weak_ptr.h" | |
| 11 #include "content/common/content_export.h" | 12 #include "content/common/content_export.h" |
| 12 #include "content/public/browser/desktop_media_id.h" | 13 #include "content/public/browser/desktop_media_id.h" |
| 13 #include "media/video/capture/video_capture_device.h" | 14 #include "media/video/capture/video_capture_device.h" |
| 14 | 15 |
| 15 namespace aura { | 16 namespace aura { |
| 16 class Window; | 17 class Window; |
| 17 } // namespace aura | 18 } // namespace aura |
| 18 | 19 |
| 19 namespace content { | 20 namespace content { |
| 20 | 21 |
| 21 class ContentVideoCaptureDeviceCore; | 22 class ContentVideoCaptureDeviceCore; |
| 23 class AuraWindowCaptureMachine; | |
| 22 | 24 |
| 23 // An implementation of VideoCaptureDevice that mirrors an Aura window. | 25 // An implementation of VideoCaptureDevice that mirrors an Aura window. |
| 24 class CONTENT_EXPORT DesktopCaptureDeviceAura | 26 class CONTENT_EXPORT DesktopCaptureDeviceAura |
| 25 : public media::VideoCaptureDevice { | 27 : public media::VideoCaptureDevice, |
| 28 public base::SupportsWeakPtr<DesktopCaptureDeviceAura> { | |
|
Sergey Ulanov
2015/03/04 01:54:03
Please use WeakPtrFactory<> as a member instead of
| |
| 26 public: | 29 public: |
| 27 // Creates a VideoCaptureDevice for the Aura desktop. | 30 // Creates a VideoCaptureDevice for the Aura desktop. |
| 28 static media::VideoCaptureDevice* Create(const DesktopMediaID& source); | 31 static media::VideoCaptureDevice* Create(const DesktopMediaID& source); |
| 29 | 32 |
| 30 ~DesktopCaptureDeviceAura() override; | 33 ~DesktopCaptureDeviceAura() override; |
| 31 | 34 |
| 32 // VideoCaptureDevice implementation. | 35 // VideoCaptureDevice implementation. |
| 33 void AllocateAndStart(const media::VideoCaptureParams& params, | 36 void AllocateAndStart(const media::VideoCaptureParams& params, |
| 34 scoped_ptr<Client> client) override; | 37 scoped_ptr<Client> client) override; |
| 35 void StopAndDeAllocate() override; | 38 void StopAndDeAllocate() override; |
| 36 | 39 |
| 37 private: | 40 private: |
| 38 DesktopCaptureDeviceAura(const DesktopMediaID& source); | 41 DesktopCaptureDeviceAura(); |
| 42 void SetWindow(const DesktopMediaID& source); | |
| 39 | 43 |
| 44 // machine_ is owned by core_. | |
| 45 AuraWindowCaptureMachine* machine_; | |
| 40 const scoped_ptr<class ContentVideoCaptureDeviceCore> core_; | 46 const scoped_ptr<class ContentVideoCaptureDeviceCore> core_; |
| 41 | 47 |
| 42 DISALLOW_COPY_AND_ASSIGN(DesktopCaptureDeviceAura); | 48 DISALLOW_COPY_AND_ASSIGN(DesktopCaptureDeviceAura); |
| 43 }; | 49 }; |
| 44 | 50 |
| 45 | 51 |
| 46 } // namespace content | 52 } // namespace content |
| 47 | 53 |
| 48 #endif // CONTENT_BROWSER_MEDIA_CAPTURE_DESKTOP_CAPTURE_DEVICE_AURA_H_ | 54 #endif // CONTENT_BROWSER_MEDIA_CAPTURE_DESKTOP_CAPTURE_DEVICE_AURA_H_ |
| OLD | NEW |