Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(18)

Side by Side Diff: content/browser/renderer_host/media/video_capture_controller.h

Issue 418283003: "Buttery Smooth" Tab Capture. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Now pixel-weighted. Lots of add'l unit tests. (rebased against ToT) Created 6 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
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 // VideoCaptureController is the glue between a VideoCaptureDevice and all 5 // VideoCaptureController is the glue between a VideoCaptureDevice and all
6 // VideoCaptureHosts that have connected to it. A controller exists on behalf of 6 // VideoCaptureHosts that have connected to it. A controller exists on behalf of
7 // one (and only one) VideoCaptureDevice; both are owned by the 7 // one (and only one) VideoCaptureDevice; both are owned by the
8 // VideoCaptureManager. 8 // VideoCaptureManager.
9 // 9 //
10 // The VideoCaptureController is responsible for: 10 // The VideoCaptureController is responsible for:
(...skipping 48 matching lines...) Expand 10 before | Expand all | Expand 10 after
59 #include "content/common/content_export.h" 59 #include "content/common/content_export.h"
60 #include "content/common/media/video_capture.h" 60 #include "content/common/media/video_capture.h"
61 #include "media/video/capture/video_capture_device.h" 61 #include "media/video/capture/video_capture_device.h"
62 #include "media/video/capture/video_capture_types.h" 62 #include "media/video/capture/video_capture_types.h"
63 63
64 namespace content { 64 namespace content {
65 class VideoCaptureBufferPool; 65 class VideoCaptureBufferPool;
66 66
67 class CONTENT_EXPORT VideoCaptureController { 67 class CONTENT_EXPORT VideoCaptureController {
68 public: 68 public:
69 VideoCaptureController(); 69 // |max_buffers| is the maximum number of video frame buffers in-flight at any
70 // one time. This value should be based on the logical capacity of the
71 // capture pipeline, and not on hardware performance. For example, tab
72 // capture requires more buffers than webcam capture because the pipeline is
73 // longer (it includes read-backs pending in the GPU pipeline).
74 explicit VideoCaptureController(int max_buffers);
70 virtual ~VideoCaptureController(); 75 virtual ~VideoCaptureController();
71 76
72 base::WeakPtr<VideoCaptureController> GetWeakPtr(); 77 base::WeakPtr<VideoCaptureController> GetWeakPtr();
73 78
74 // Return a new VideoCaptureDeviceClient to forward capture events to this 79 // Return a new VideoCaptureDeviceClient to forward capture events to this
75 // instance. 80 // instance.
76 scoped_ptr<media::VideoCaptureDevice::Client> NewDeviceClient(); 81 scoped_ptr<media::VideoCaptureDevice::Client> NewDeviceClient();
77 82
78 // Start video capturing and try to use the resolution specified in |params|. 83 // Start video capturing and try to use the resolution specified in |params|.
79 // Buffers will be shared to the client as necessary. The client will continue 84 // Buffers will be shared to the client as necessary. The client will continue
(...skipping 69 matching lines...) Expand 10 before | Expand all | Expand 10 after
149 media::VideoCaptureFormat video_capture_format_; 154 media::VideoCaptureFormat video_capture_format_;
150 155
151 base::WeakPtrFactory<VideoCaptureController> weak_ptr_factory_; 156 base::WeakPtrFactory<VideoCaptureController> weak_ptr_factory_;
152 157
153 DISALLOW_COPY_AND_ASSIGN(VideoCaptureController); 158 DISALLOW_COPY_AND_ASSIGN(VideoCaptureController);
154 }; 159 };
155 160
156 } // namespace content 161 } // namespace content
157 162
158 #endif // CONTENT_BROWSER_RENDERER_HOST_MEDIA_VIDEO_CAPTURE_CONTROLLER_H_ 163 #endif // CONTENT_BROWSER_RENDERER_HOST_MEDIA_VIDEO_CAPTURE_CONTROLLER_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698