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

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

Issue 898803004: Revert of 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: 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 | media/video/capture/file_video_capture_device.h » ('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 451 matching lines...) Expand 10 before | Expand all | Expand 10 after
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
472 // The input |length| can be greater than the required buffer size because of
473 // paddings and/or alignments, but it cannot be less.
474 DCHECK_GE(static_cast<size_t>(length), frame_format.ImageAllocationSize());
475
476 if (libyuv::ConvertToI420(data, 472 if (libyuv::ConvertToI420(data,
477 length, 473 length,
478 yplane, 474 yplane,
479 yplane_stride, 475 yplane_stride,
480 uplane, 476 uplane,
481 uv_plane_stride, 477 uv_plane_stride,
482 vplane, 478 vplane,
483 uv_plane_stride, 479 uv_plane_stride,
484 crop_x, 480 crop_x,
485 crop_y, 481 crop_y,
(...skipping 247 matching lines...) Expand 10 before | Expand all | Expand 10 after
733 DCHECK_CURRENTLY_ON(BrowserThread::IO); 729 DCHECK_CURRENTLY_ON(BrowserThread::IO);
734 int active_client_count = 0; 730 int active_client_count = 0;
735 for (ControllerClient* client : controller_clients_) { 731 for (ControllerClient* client : controller_clients_) {
736 if (!client->paused) 732 if (!client->paused)
737 ++active_client_count; 733 ++active_client_count;
738 } 734 }
739 return active_client_count; 735 return active_client_count;
740 } 736 }
741 737
742 } // namespace content 738 } // namespace content
OLDNEW
« no previous file with comments | « no previous file | media/video/capture/file_video_capture_device.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698