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

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

Issue 897483002: Refactored pixel format resize operations in media/video/capture into a function called VideoCaptu… (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fixed operator spacing. Created 5 years, 10 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 <map> 7 #include <map>
8 #include <set> 8 #include <set>
9 9
10 #include "base/bind.h" 10 #include "base/bind.h"
(...skipping 450 matching lines...) Expand 10 before | Expand all | Expand 10 after
461 break; 461 break;
462 case media::PIXEL_FORMAT_ARGB: 462 case media::PIXEL_FORMAT_ARGB:
463 origin_colorspace = libyuv::FOURCC_ARGB; 463 origin_colorspace = libyuv::FOURCC_ARGB;
464 break; 464 break;
465 case media::PIXEL_FORMAT_MJPEG: 465 case media::PIXEL_FORMAT_MJPEG:
466 origin_colorspace = libyuv::FOURCC_MJPG; 466 origin_colorspace = libyuv::FOURCC_MJPG;
467 break; 467 break;
468 default: 468 default:
469 NOTREACHED(); 469 NOTREACHED();
470 } 470 }
471 471
mcasas 2015/02/04 17:00:02 Add a comment as to why _GE.
472 DCHECK_GE(static_cast<size_t>(length), frame_format.ImageAllocationSize());
473
472 libyuv::ConvertToI420(data, 474 libyuv::ConvertToI420(data,
473 length, 475 length,
474 yplane, 476 yplane,
475 yplane_stride, 477 yplane_stride,
476 uplane, 478 uplane,
477 uv_plane_stride, 479 uv_plane_stride,
478 vplane, 480 vplane,
479 uv_plane_stride, 481 uv_plane_stride,
480 crop_x, 482 crop_x,
481 crop_y, 483 crop_y,
(...skipping 241 matching lines...) Expand 10 before | Expand all | Expand 10 after
723 DCHECK_CURRENTLY_ON(BrowserThread::IO); 725 DCHECK_CURRENTLY_ON(BrowserThread::IO);
724 int active_client_count = 0; 726 int active_client_count = 0;
725 for (ControllerClient* client : controller_clients_) { 727 for (ControllerClient* client : controller_clients_) {
726 if (!client->paused) 728 if (!client->paused)
727 ++active_client_count; 729 ++active_client_count;
728 } 730 }
729 return active_client_count; 731 return active_client_count;
730 } 732 }
731 733
732 } // namespace content 734 } // namespace content
OLDNEW
« no previous file with comments | « no previous file | media/video/capture/file_video_capture_device.h » ('j') | media/video/capture/video_capture_types.h » ('J')

Powered by Google App Engine
This is Rietveld 408576698