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

Unified Diff: content/browser/renderer_host/media/video_capture_controller.cc

Issue 2766343002: Revert of [Mojo Video Capture] Add test coverage for accelerated jpeg decoding (Closed)
Patch Set: Created 3 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/renderer_host/media/video_capture_controller.cc
diff --git a/content/browser/renderer_host/media/video_capture_controller.cc b/content/browser/renderer_host/media/video_capture_controller.cc
index 557828cb9ce3ec0ffce046f9c106593f5a54b62b..267d85a40753dac7b501a7463a01ab26367e391c 100644
--- a/content/browser/renderer_host/media/video_capture_controller.cc
+++ b/content/browser/renderer_host/media/video_capture_controller.cc
@@ -46,21 +46,6 @@
UMA_HISTOGRAM_SPARSE_SLOWLY( \
name, (height) ? ((width)*100) / (height) : kInfiniteRatio);
-void CallOnError(VideoCaptureControllerEventHandler* client,
- VideoCaptureControllerID id) {
- client->OnError(id);
-}
-
-void CallOnStarted(VideoCaptureControllerEventHandler* client,
- VideoCaptureControllerID id) {
- client->OnStarted(id);
-}
-
-void CallOnStartedUsingGpuDecode(VideoCaptureControllerEventHandler* client,
- VideoCaptureControllerID id) {
- client->OnStartedUsingGpuDecode(id);
-}
-
} // anonymous namespace
struct VideoCaptureController::ControllerClient {
@@ -466,7 +451,12 @@
void VideoCaptureController::OnError() {
DCHECK_CURRENTLY_ON(BrowserThread::IO);
state_ = VIDEO_CAPTURE_STATE_ERROR;
- PerformForClientsWithOpenSession(base::Bind(&CallOnError));
+
+ for (const auto& client : controller_clients_) {
+ if (client->session_closed)
+ continue;
+ client->event_handler->OnError(client->controller_id);
+ }
}
void VideoCaptureController::OnLog(const std::string& message) {
@@ -477,11 +467,12 @@
void VideoCaptureController::OnStarted() {
DCHECK_CURRENTLY_ON(BrowserThread::IO);
state_ = VIDEO_CAPTURE_STATE_STARTED;
- PerformForClientsWithOpenSession(base::Bind(&CallOnStarted));
-}
-
-void VideoCaptureController::OnStartedUsingGpuDecode() {
- PerformForClientsWithOpenSession(base::Bind(&CallOnStartedUsingGpuDecode));
+
+ for (const auto& client : controller_clients_) {
+ if (client->session_closed)
+ continue;
+ client->event_handler->OnStarted(client->controller_id);
+ }
}
VideoCaptureController::ControllerClient* VideoCaptureController::FindClient(
@@ -556,14 +547,4 @@
buffer_contexts_.erase(buffer_context_iter);
}
-void VideoCaptureController::PerformForClientsWithOpenSession(
- EventHandlerAction action) {
- DCHECK_CURRENTLY_ON(BrowserThread::IO);
- for (const auto& client : controller_clients_) {
- if (client->session_closed)
- continue;
- action.Run(client->event_handler, client->controller_id);
- }
-}
-
} // namespace content

Powered by Google App Engine
This is Rietveld 408576698