| 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 f518cda72cf6bdcb20acd6b2d82d8d2f8955b17f..cf7e3be82601d484aba2148c17333a0b935b88e4 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();
|
| @@ -238,8 +227,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
|
| @@ -319,6 +308,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_;
|
| @@ -348,7 +340,8 @@ 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);
|
| + if (!capture_frame_cb.is_null())
|
| + *deliver_frame_cb = base::Bind(capture_frame_cb, *storage);
|
| if (oracle_decision)
|
| delivery_log_->ChronicleFrameDelivery(present_time);
|
| return oracle_decision;
|
| @@ -578,12 +571,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()) {
|
|
|