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

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

Issue 907113002: Reland:Refactored pixel format resize operations in media/video/capture into a function called Vide… (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fixed size for VCC unittest. 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
« no previous file with comments | « no previous file | content/browser/renderer_host/media/video_capture_controller_unittest.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 477 matching lines...) Expand 10 before | Expand all | Expand 10 after
488 case media::PIXEL_FORMAT_ARGB: 488 case media::PIXEL_FORMAT_ARGB:
489 origin_colorspace = libyuv::FOURCC_ARGB; 489 origin_colorspace = libyuv::FOURCC_ARGB;
490 break; 490 break;
491 case media::PIXEL_FORMAT_MJPEG: 491 case media::PIXEL_FORMAT_MJPEG:
492 origin_colorspace = libyuv::FOURCC_MJPG; 492 origin_colorspace = libyuv::FOURCC_MJPG;
493 break; 493 break;
494 default: 494 default:
495 NOTREACHED(); 495 NOTREACHED();
496 } 496 }
497 497
498 // The input |length| can be greater than the required buffer size because of
499 // paddings and/or alignments, but it cannot be less.
500 DCHECK_GE(static_cast<size_t>(length), frame_format.ImageAllocationSize());
501
498 if (libyuv::ConvertToI420(data, 502 if (libyuv::ConvertToI420(data,
499 length, 503 length,
500 yplane, 504 yplane,
501 yplane_stride, 505 yplane_stride,
502 uplane, 506 uplane,
503 uv_plane_stride, 507 uv_plane_stride,
504 vplane, 508 vplane,
505 uv_plane_stride, 509 uv_plane_stride,
506 crop_x, 510 crop_x,
507 crop_y, 511 crop_y,
(...skipping 209 matching lines...) Expand 10 before | Expand all | Expand 10 after
717 DCHECK_CURRENTLY_ON(BrowserThread::IO); 721 DCHECK_CURRENTLY_ON(BrowserThread::IO);
718 int active_client_count = 0; 722 int active_client_count = 0;
719 for (ControllerClient* client : controller_clients_) { 723 for (ControllerClient* client : controller_clients_) {
720 if (!client->paused) 724 if (!client->paused)
721 ++active_client_count; 725 ++active_client_count;
722 } 726 }
723 return active_client_count; 727 return active_client_count;
724 } 728 }
725 729
726 } // namespace content 730 } // namespace content
OLDNEW
« no previous file with comments | « no previous file | content/browser/renderer_host/media/video_capture_controller_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698