OLD | NEW |
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 Loading... |
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 Loading... |
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 |
OLD | NEW |