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

Side by Side Diff: content/browser/renderer_host/media/video_capture_controller.cc

Issue 2735083002: [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 unified diff | Download patch
OLDNEW
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
464 void VideoCaptureController::OnStarted() { 464 void VideoCaptureController::OnStarted() {
465 DCHECK_CURRENTLY_ON(BrowserThread::IO); 465 DCHECK_CURRENTLY_ON(BrowserThread::IO);
466 466
467 for (const auto& client : controller_clients_) { 467 for (const auto& client : controller_clients_) {
468 if (client->session_closed) 468 if (client->session_closed)
469 continue; 469 continue;
470 client->event_handler->OnStarted(client->controller_id); 470 client->event_handler->OnStarted(client->controller_id);
471 } 471 }
472 } 472 }
473 473
474 void VideoCaptureController::OnStartedUsingGpuDecode() {
475 DCHECK_CURRENTLY_ON(BrowserThread::IO);
476 for (const auto& client : controller_clients_) {
477 if (client->session_closed)
478 continue;
479 client->event_handler->OnStartedUsingGpuDecode(client->controller_id);
480 }
481 }
482
483 void VideoCaptureController::OnStoppedUsingGpuDecode() {
484 DCHECK_CURRENTLY_ON(BrowserThread::IO);
485 for (const auto& client : controller_clients_) {
486 if (client->session_closed)
487 continue;
488 client->event_handler->OnStoppedUsingGpuDecode(client->controller_id);
489 }
490 }
491
474 VideoCaptureController::ControllerClient* VideoCaptureController::FindClient( 492 VideoCaptureController::ControllerClient* VideoCaptureController::FindClient(
475 VideoCaptureControllerID id, 493 VideoCaptureControllerID id,
476 VideoCaptureControllerEventHandler* handler, 494 VideoCaptureControllerEventHandler* handler,
477 const ControllerClients& clients) { 495 const ControllerClients& clients) {
478 for (const auto& client : clients) { 496 for (const auto& client : clients) {
479 if (client->controller_id == id && client->event_handler == handler) 497 if (client->controller_id == id && client->event_handler == handler)
480 return client.get(); 498 return client.get();
481 } 499 }
482 return nullptr; 500 return nullptr;
483 } 501 }
(...skipping 53 matching lines...) Expand 10 before | Expand all | Expand 10 after
537 if (entry_iter != std::end(client->known_buffer_context_ids)) { 555 if (entry_iter != std::end(client->known_buffer_context_ids)) {
538 client->known_buffer_context_ids.erase(entry_iter); 556 client->known_buffer_context_ids.erase(entry_iter);
539 client->event_handler->OnBufferDestroyed( 557 client->event_handler->OnBufferDestroyed(
540 client->controller_id, buffer_context_iter->buffer_context_id()); 558 client->controller_id, buffer_context_iter->buffer_context_id());
541 } 559 }
542 } 560 }
543 buffer_contexts_.erase(buffer_context_iter); 561 buffer_contexts_.erase(buffer_context_iter);
544 } 562 }
545 563
546 } // namespace content 564 } // namespace content
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698