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_MEDIA_CAPTURE_WEB_CONTENTS_VIDEO_CAPTURE_DEVICE_H_ | 5 #ifndef CONTENT_BROWSER_MEDIA_CAPTURE_WEB_CONTENTS_VIDEO_CAPTURE_DEVICE_H_ |
6 #define CONTENT_BROWSER_MEDIA_CAPTURE_WEB_CONTENTS_VIDEO_CAPTURE_DEVICE_H_ | 6 #define CONTENT_BROWSER_MEDIA_CAPTURE_WEB_CONTENTS_VIDEO_CAPTURE_DEVICE_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" |
(...skipping 17 matching lines...) Expand all Loading... |
28 // crashes/reloads), without any interruption in capturing. | 28 // crashes/reloads), without any interruption in capturing. |
29 class CONTENT_EXPORT WebContentsVideoCaptureDevice | 29 class CONTENT_EXPORT WebContentsVideoCaptureDevice |
30 : public media::VideoCaptureDevice { | 30 : public media::VideoCaptureDevice { |
31 public: | 31 public: |
32 // Construct from a |device_id| string of the form: | 32 // Construct from a |device_id| string of the form: |
33 // "virtual-media-stream://render_process_id:render_view_id", where | 33 // "virtual-media-stream://render_process_id:render_view_id", where |
34 // |render_process_id| and |render_view_id| are decimal integers. | 34 // |render_process_id| and |render_view_id| are decimal integers. |
35 // |destroy_cb| is invoked on an outside thread once all outstanding objects | 35 // |destroy_cb| is invoked on an outside thread once all outstanding objects |
36 // are completely destroyed -- this will be some time after the | 36 // are completely destroyed -- this will be some time after the |
37 // WebContentsVideoCaptureDevice is itself deleted. | 37 // WebContentsVideoCaptureDevice is itself deleted. |
38 // TODO(miu): Passing a destroy callback suggests needing to revisit the | |
39 // design philosophy of an asynchronous DeAllocate(). http://crbug.com/158641 | |
40 static media::VideoCaptureDevice* Create(const std::string& device_id); | 38 static media::VideoCaptureDevice* Create(const std::string& device_id); |
41 | 39 |
42 virtual ~WebContentsVideoCaptureDevice(); | 40 virtual ~WebContentsVideoCaptureDevice(); |
43 | 41 |
44 // VideoCaptureDevice implementation. | 42 // VideoCaptureDevice implementation. |
45 virtual void AllocateAndStart(const media::VideoCaptureParams& params, | 43 virtual void AllocateAndStart(const media::VideoCaptureParams& params, |
46 scoped_ptr<Client> client) OVERRIDE; | 44 scoped_ptr<Client> client) OVERRIDE; |
47 virtual void StopAndDeAllocate() OVERRIDE; | 45 virtual void StopAndDeAllocate() OVERRIDE; |
48 | 46 |
49 private: | 47 private: |
50 WebContentsVideoCaptureDevice(int render_process_id, int render_view_id); | 48 WebContentsVideoCaptureDevice(int render_process_id, int render_view_id); |
51 | 49 |
52 const scoped_ptr<ContentVideoCaptureDeviceCore> core_; | 50 const scoped_ptr<ContentVideoCaptureDeviceCore> core_; |
53 | 51 |
54 DISALLOW_COPY_AND_ASSIGN(WebContentsVideoCaptureDevice); | 52 DISALLOW_COPY_AND_ASSIGN(WebContentsVideoCaptureDevice); |
55 }; | 53 }; |
56 | 54 |
57 | 55 |
58 } // namespace content | 56 } // namespace content |
59 | 57 |
60 #endif // CONTENT_BROWSER_MEDIA_CAPTURE_WEB_CONTENTS_VIDEO_CAPTURE_DEVICE_H_ | 58 #endif // CONTENT_BROWSER_MEDIA_CAPTURE_WEB_CONTENTS_VIDEO_CAPTURE_DEVICE_H_ |
OLD | NEW |