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

Unified Diff: content/browser/media/capture/web_contents_video_capture_device.cc

Issue 213253005: Use texture-backed VideoFrane pipeline for Aura desktop capturing. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: 51d44e02 Initial. Created 6 years, 9 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 side-by-side diff with in-line comments
Download patch
Index: content/browser/media/capture/web_contents_video_capture_device.cc
diff --git a/content/browser/media/capture/web_contents_video_capture_device.cc b/content/browser/media/capture/web_contents_video_capture_device.cc
index b25d316728001be8544187e287df484baa02113b..2065b502a6d9cfba52a43841419bd99e34572fd6 100644
--- a/content/browser/media/capture/web_contents_video_capture_device.cc
+++ b/content/browser/media/capture/web_contents_video_capture_device.cc
@@ -94,21 +94,10 @@ gfx::Rect ComputeYV12LetterboxRegion(const gfx::Size& frame_size,
result.set_x(MakeEven(result.x()));
result.set_y(MakeEven(result.y()));
- result.set_width(std::max(kMinFrameWidth, MakeEven(result.width())));
- result.set_height(std::max(kMinFrameHeight, MakeEven(result.height())));
return result;
}
-// Wrapper function to invoke ThreadSafeCaptureOracle::CaptureFrameCallback, is
-// compatible with RenderWidgetHostViewFrameSubscriber::DeliverFrameCallback.
-void InvokeCaptureFrameCallback(
- const ThreadSafeCaptureOracle::CaptureFrameCallback& capture_frame_cb,
- base::TimeTicks timestamp,
- bool frame_captured) {
- capture_frame_cb.Run(timestamp, frame_captured);
-}
-
void DeleteOnWorkerThread(scoped_ptr<base::Thread> render_thread,
const base::Closure& callback) {
render_thread.reset();
@@ -217,8 +206,8 @@ class WebContentsCaptureMachine
virtual ~WebContentsCaptureMachine();
// VideoCaptureMachine overrides.
- virtual bool Start(
- const scoped_refptr<ThreadSafeCaptureOracle>& oracle_proxy) OVERRIDE;
+ virtual bool Start(const scoped_refptr<ThreadSafeCaptureOracle>& oracle_proxy,
+ const media::VideoCaptureParams& params) OVERRIDE;
virtual void Stop(const base::Closure& callback) OVERRIDE;
// Starts a copy from the backing store or the composited surface. Must be run
@@ -298,6 +287,9 @@ class WebContentsCaptureMachine
// Makes all the decisions about which frames to copy, and how.
scoped_refptr<ThreadSafeCaptureOracle> oracle_proxy_;
+ // Video capture parameters that this machine is started with.
+ media::VideoCaptureParams capture_params_;
+
// Routing ID of any active fullscreen render widget or MSG_ROUTING_NONE
// otherwise.
int fullscreen_widget_id_;
@@ -347,7 +339,7 @@ bool FrameSubscriber::ShouldCaptureFrame(
bool oracle_decision = oracle_proxy_->ObserveEventAndDecideCapture(
event_type_, present_time, storage, &capture_frame_cb);
- *deliver_frame_cb = base::Bind(&InvokeCaptureFrameCallback, capture_frame_cb);
+ *deliver_frame_cb = base::Bind(capture_frame_cb, *storage);
return oracle_decision;
}
@@ -574,12 +566,14 @@ WebContentsCaptureMachine::~WebContentsCaptureMachine() {
}
bool WebContentsCaptureMachine::Start(
- const scoped_refptr<ThreadSafeCaptureOracle>& oracle_proxy) {
+ const scoped_refptr<ThreadSafeCaptureOracle>& oracle_proxy,
+ const media::VideoCaptureParams& params) {
DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI));
DCHECK(!started_);
DCHECK(oracle_proxy.get());
oracle_proxy_ = oracle_proxy;
+ capture_params_ = params;
render_thread_.reset(new base::Thread("WebContentsVideo_RenderThread"));
if (!render_thread_->Start()) {

Powered by Google App Engine
This is Rietveld 408576698