| Index: content/browser/renderer_host/media/video_capture_host.cc
|
| diff --git a/content/browser/renderer_host/media/video_capture_host.cc b/content/browser/renderer_host/media/video_capture_host.cc
|
| index 4c458f5d0da72417407e3eefd565bb9d37e7cc44..16e96bc03849cb6e907dc8ef9e1163c55249ac8f 100644
|
| --- a/content/browser/renderer_host/media/video_capture_host.cc
|
| +++ b/content/browser/renderer_host/media/video_capture_host.cc
|
| @@ -118,6 +118,15 @@ void VideoCaptureHost::OnEnded(VideoCaptureControllerID controller_id) {
|
| controller_id));
|
| }
|
|
|
| +void VideoCaptureHost::OnStarted(VideoCaptureControllerID controller_id) {
|
| + DVLOG(1) << __func__;
|
| + DCHECK_CURRENTLY_ON(BrowserThread::IO);
|
| + BrowserThread::PostTask(
|
| + BrowserThread::IO, FROM_HERE,
|
| + base::Bind(&VideoCaptureHost::DoStarted, weak_factory_.GetWeakPtr(),
|
| + controller_id));
|
| +}
|
| +
|
| void VideoCaptureHost::Start(int32_t device_id,
|
| int32_t session_id,
|
| const media::VideoCaptureParams& params,
|
| @@ -283,6 +292,18 @@ void VideoCaptureHost::DoEnded(VideoCaptureControllerID controller_id) {
|
| DeleteVideoCaptureController(controller_id, false);
|
| }
|
|
|
| +void VideoCaptureHost::DoStarted(VideoCaptureControllerID controller_id) {
|
| + DVLOG(1) << __func__;
|
| + DCHECK_CURRENTLY_ON(BrowserThread::IO);
|
| + if (controllers_.find(controller_id) == controllers_.end())
|
| + return;
|
| +
|
| + if (base::ContainsKey(device_id_to_observer_map_, controller_id)) {
|
| + device_id_to_observer_map_[controller_id]->OnStateChanged(
|
| + mojom::VideoCaptureState::STARTED);
|
| + }
|
| +}
|
| +
|
| void VideoCaptureHost::OnControllerAdded(
|
| int device_id,
|
| const base::WeakPtr<VideoCaptureController>& controller) {
|
| @@ -306,11 +327,6 @@ void VideoCaptureHost::OnControllerAdded(
|
| return;
|
| }
|
|
|
| - if (base::ContainsKey(device_id_to_observer_map_, controller_id)) {
|
| - device_id_to_observer_map_[device_id]->OnStateChanged(
|
| - mojom::VideoCaptureState::STARTED);
|
| - }
|
| -
|
| DCHECK(!it->second);
|
| it->second = controller;
|
| }
|
|
|