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