| 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 CONTENT_RENDERER_PEPPER_PEPPER_PLATFORM_VIDEO_CAPTURE_H_ | 5 #ifndef CONTENT_RENDERER_PEPPER_PEPPER_PLATFORM_VIDEO_CAPTURE_H_ |
| 6 #define CONTENT_RENDERER_PEPPER_PEPPER_PLATFORM_VIDEO_CAPTURE_H_ | 6 #define CONTENT_RENDERER_PEPPER_PEPPER_PLATFORM_VIDEO_CAPTURE_H_ |
| 7 | 7 |
| 8 #include <string> | 8 #include <string> |
| 9 | 9 |
| 10 #include "base/basictypes.h" | 10 #include "base/basictypes.h" |
| 11 #include "base/compiler_specific.h" | 11 #include "base/compiler_specific.h" |
| 12 #include "base/memory/scoped_ptr.h" | 12 #include "base/memory/scoped_ptr.h" |
| 13 #include "base/memory/weak_ptr.h" | 13 #include "base/memory/weak_ptr.h" |
| 14 #include "media/video/capture/video_capture.h" | 14 #include "media/video/capture/video_capture.h" |
| 15 #include "media/video/capture/video_capture_types.h" | 15 #include "media/video/capture/video_capture_types.h" |
| 16 | 16 |
| 17 class GURL; | 17 class GURL; |
| 18 | 18 |
| 19 namespace media { | 19 namespace media { |
| 20 class VideoCaptureHandlerProxy; | 20 class VideoCaptureHandlerProxy; |
| 21 } | 21 } |
| 22 | 22 |
| 23 namespace content { | 23 namespace content { |
| 24 class PepperMediaDeviceManager; | 24 class PepperMediaDeviceManager; |
| 25 class PepperVideoCaptureHost; | 25 class PepperVideoCaptureHost; |
| 26 class RenderViewImpl; | 26 class RenderViewImpl; |
| 27 class VideoCaptureHandle; |
| 27 | 28 |
| 28 class PepperPlatformVideoCapture | 29 class PepperPlatformVideoCapture |
| 29 : public media::VideoCapture, | 30 : public media::VideoCapture, |
| 30 public base::RefCounted<PepperPlatformVideoCapture>, | 31 public base::RefCounted<PepperPlatformVideoCapture>, |
| 31 public media::VideoCapture::EventHandler { | 32 public media::VideoCapture::EventHandler { |
| 32 public: | 33 public: |
| 33 PepperPlatformVideoCapture( | 34 PepperPlatformVideoCapture( |
| 34 const base::WeakPtr<RenderViewImpl>& render_view, | 35 const base::WeakPtr<RenderViewImpl>& render_view, |
| 35 const std::string& device_id, | 36 const std::string& device_id, |
| 36 const GURL& document_url, | 37 const GURL& document_url, |
| (...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 73 base::WeakPtr<RenderViewImpl> render_view_; | 74 base::WeakPtr<RenderViewImpl> render_view_; |
| 74 | 75 |
| 75 std::string device_id_; | 76 std::string device_id_; |
| 76 std::string label_; | 77 std::string label_; |
| 77 int session_id_; | 78 int session_id_; |
| 78 | 79 |
| 79 scoped_ptr<media::VideoCaptureHandlerProxy> handler_proxy_; | 80 scoped_ptr<media::VideoCaptureHandlerProxy> handler_proxy_; |
| 80 | 81 |
| 81 PepperVideoCaptureHost* handler_; | 82 PepperVideoCaptureHost* handler_; |
| 82 | 83 |
| 83 media::VideoCapture* video_capture_; | 84 scoped_ptr<VideoCaptureHandle> video_capture_; |
| 84 | 85 |
| 85 // StartCapture() must be balanced by StopCapture(), otherwise this object | 86 // StartCapture() must be balanced by StopCapture(), otherwise this object |
| 86 // will leak. | 87 // will leak. |
| 87 bool unbalanced_start_; | 88 bool unbalanced_start_; |
| 88 | 89 |
| 89 // Whether we have a pending request to open a device. We have to make sure | 90 // Whether we have a pending request to open a device. We have to make sure |
| 90 // there isn't any pending request before this object goes away. | 91 // there isn't any pending request before this object goes away. |
| 91 bool pending_open_device_; | 92 bool pending_open_device_; |
| 92 int pending_open_device_id_; | 93 int pending_open_device_id_; |
| 93 | 94 |
| 94 DISALLOW_COPY_AND_ASSIGN(PepperPlatformVideoCapture); | 95 DISALLOW_COPY_AND_ASSIGN(PepperPlatformVideoCapture); |
| 95 }; | 96 }; |
| 96 | 97 |
| 97 } // namespace content | 98 } // namespace content |
| 98 | 99 |
| 99 #endif // CONTENT_RENDERER_PEPPER_PEPPER_PLATFORM_VIDEO_CAPTURE_H_ | 100 #endif // CONTENT_RENDERER_PEPPER_PEPPER_PLATFORM_VIDEO_CAPTURE_H_ |
| OLD | NEW |