Chromium Code Reviews| 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_BROWSER_RENDERER_HOST_MEDIA_WEB_CONTENTS_VIDEO_CAPTURE_DEVICE_H_ | 5 #ifndef CONTENT_BROWSER_RENDERER_HOST_MEDIA_WEB_CONTENTS_VIDEO_CAPTURE_DEVICE_H_ |
| 6 #define CONTENT_BROWSER_RENDERER_HOST_MEDIA_WEB_CONTENTS_VIDEO_CAPTURE_DEVICE_H_ | 6 #define CONTENT_BROWSER_RENDERER_HOST_MEDIA_WEB_CONTENTS_VIDEO_CAPTURE_DEVICE_H_ |
| 7 | 7 |
| 8 #include <string> | 8 #include <string> |
| 9 | 9 |
| 10 #include "base/memory/ref_counted.h" | 10 #include "base/memory/ref_counted.h" |
| (...skipping 19 matching lines...) Expand all Loading... | |
| 30 class CONTENT_EXPORT WebContentsVideoCaptureDevice | 30 class CONTENT_EXPORT WebContentsVideoCaptureDevice |
| 31 : public media::VideoCaptureDevice { | 31 : public media::VideoCaptureDevice { |
| 32 public: | 32 public: |
| 33 // Construct from the a |device_id| string of the form: | 33 // Construct from the a |device_id| string of the form: |
| 34 // "render_process_id:render_view_id" | 34 // "render_process_id:render_view_id" |
| 35 static media::VideoCaptureDevice* Create(const std::string& device_id); | 35 static media::VideoCaptureDevice* Create(const std::string& device_id); |
| 36 | 36 |
| 37 // Construct an instance with the following |test_source| injected for testing | 37 // Construct an instance with the following |test_source| injected for testing |
| 38 // purposes. | 38 // purposes. |
| 39 static media::VideoCaptureDevice* CreateForTesting( | 39 static media::VideoCaptureDevice* CreateForTesting( |
| 40 content::RenderWidgetHost* test_source); | 40 RenderWidgetHost* test_source); |
| 41 | 41 |
| 42 virtual ~WebContentsVideoCaptureDevice(); | 42 virtual ~WebContentsVideoCaptureDevice(); |
| 43 | 43 |
| 44 // VideoCaptureDevice implementation. | 44 // VideoCaptureDevice implementation. |
| 45 virtual void Allocate(int width, | 45 virtual void Allocate(int width, |
| 46 int height, | 46 int height, |
| 47 int frame_rate, | 47 int frame_rate, |
| 48 VideoCaptureDevice::EventHandler* consumer) OVERRIDE; | 48 VideoCaptureDevice::EventHandler* consumer) OVERRIDE; |
| 49 virtual void Start() OVERRIDE; | 49 virtual void Start() OVERRIDE; |
| 50 virtual void Stop() OVERRIDE; | 50 virtual void Stop() OVERRIDE; |
| 51 virtual void DeAllocate() OVERRIDE; | 51 virtual void DeAllocate() OVERRIDE; |
| 52 | 52 |
| 53 // Note: The following is just a pass-through of the device_id provided to the | 53 // Note: The following is just a pass-through of the device_id provided to the |
| 54 // constructor. It does not change when the content of the page changes | 54 // constructor. It does not change when the content of the page changes |
| 55 // (e.g., due to navigation), or when the underlying RenderView is | 55 // (e.g., due to navigation), or when the underlying RenderView is |
| 56 // swapped-out. | 56 // swapped-out. |
| 57 virtual const Name& device_name() OVERRIDE; | 57 virtual const Name& device_name() OVERRIDE; |
| 58 | 58 |
| 59 private: | 59 private: |
| 60 // Constructors. The latter is used for testing. | 60 // Constructors. The latter is used for testing. |
| 61 WebContentsVideoCaptureDevice( | 61 WebContentsVideoCaptureDevice( |
| 62 const Name& name, int render_process_id, int render_view_id); | 62 const Name& name, int render_process_id, int render_view_id); |
| 63 explicit WebContentsVideoCaptureDevice( | 63 explicit WebContentsVideoCaptureDevice( |
| 64 content::RenderWidgetHost* test_source); | 64 RenderWidgetHost* test_source); |
|
tfarina
2012/10/29 17:41:34
fits above now.
jam
2012/10/29 18:14:45
Done.
| |
| 65 | 65 |
| 66 | 66 |
| 67 Name device_name_; | 67 Name device_name_; |
| 68 scoped_refptr<CaptureMachine> capturer_; | 68 scoped_refptr<CaptureMachine> capturer_; |
| 69 | 69 |
| 70 DISALLOW_COPY_AND_ASSIGN(WebContentsVideoCaptureDevice); | 70 DISALLOW_COPY_AND_ASSIGN(WebContentsVideoCaptureDevice); |
| 71 }; | 71 }; |
| 72 | 72 |
| 73 } // namespace content | 73 } // namespace content |
| 74 | 74 |
| 75 #endif // CONTENT_BROWSER_RENDERER_HOST_MEDIA_WEB_CONTENTS_VIDEO_CAPTURE_DEVICE _H_ | 75 #endif // CONTENT_BROWSER_RENDERER_HOST_MEDIA_WEB_CONTENTS_VIDEO_CAPTURE_DEVICE _H_ |
| OLD | NEW |