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 #include "content/browser/renderer_host/media/video_capture_controller.h" | 5 #include "content/browser/renderer_host/media/video_capture_controller.h" |
6 | 6 |
7 #include <stddef.h> | 7 #include <stddef.h> |
8 #include <stdint.h> | 8 #include <stdint.h> |
9 | 9 |
10 #include <map> | 10 #include <map> |
(...skipping 453 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
464 continue; | 464 continue; |
465 client->event_handler->OnError(client->controller_id); | 465 client->event_handler->OnError(client->controller_id); |
466 } | 466 } |
467 } | 467 } |
468 | 468 |
469 void VideoCaptureController::OnLog(const std::string& message) { | 469 void VideoCaptureController::OnLog(const std::string& message) { |
470 DCHECK_CURRENTLY_ON(BrowserThread::IO); | 470 DCHECK_CURRENTLY_ON(BrowserThread::IO); |
471 MediaStreamManager::SendMessageToNativeLog("Video capture: " + message); | 471 MediaStreamManager::SendMessageToNativeLog("Video capture: " + message); |
472 } | 472 } |
473 | 473 |
| 474 void VideoCaptureController::OnStarted() { |
| 475 DCHECK_CURRENTLY_ON(BrowserThread::IO); |
| 476 |
| 477 for (const auto& client : controller_clients_) { |
| 478 if (client->session_closed) |
| 479 continue; |
| 480 client->event_handler->OnStarted(client->controller_id); |
| 481 } |
| 482 } |
| 483 |
474 void VideoCaptureController::OnBufferRetired(int buffer_id) { | 484 void VideoCaptureController::OnBufferRetired(int buffer_id) { |
475 DCHECK_CURRENTLY_ON(BrowserThread::IO); | 485 DCHECK_CURRENTLY_ON(BrowserThread::IO); |
476 | 486 |
477 auto buffer_context_iter = FindUnretiredBufferContextFromBufferId(buffer_id); | 487 auto buffer_context_iter = FindUnretiredBufferContextFromBufferId(buffer_id); |
478 DCHECK(buffer_context_iter != buffer_contexts_.end()); | 488 DCHECK(buffer_context_iter != buffer_contexts_.end()); |
479 | 489 |
480 // If there are any clients still using the buffer, we need to allow them | 490 // If there are any clients still using the buffer, we need to allow them |
481 // to finish up. We need to hold on to the BufferContext entry until then, | 491 // to finish up. We need to hold on to the BufferContext entry until then, |
482 // because it contains the consumer hold. | 492 // because it contains the consumer hold. |
483 if (buffer_context_iter->HasZeroConsumerHoldCount()) | 493 if (buffer_context_iter->HasZeroConsumerHoldCount()) |
(...skipping 68 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
552 if (entry_iter != std::end(client->known_buffer_context_ids)) { | 562 if (entry_iter != std::end(client->known_buffer_context_ids)) { |
553 client->known_buffer_context_ids.erase(entry_iter); | 563 client->known_buffer_context_ids.erase(entry_iter); |
554 client->event_handler->OnBufferDestroyed( | 564 client->event_handler->OnBufferDestroyed( |
555 client->controller_id, buffer_context_iter->buffer_context_id()); | 565 client->controller_id, buffer_context_iter->buffer_context_id()); |
556 } | 566 } |
557 } | 567 } |
558 buffer_contexts_.erase(buffer_context_iter); | 568 buffer_contexts_.erase(buffer_context_iter); |
559 } | 569 } |
560 | 570 |
561 } // namespace content | 571 } // namespace content |
OLD | NEW |