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 // Given length can be greater than the required buffer size when paddings are | |
mcasas
2015/02/04 23:02:39
s/when paddings are applied or alignments are chan
| |
473 // applied or alignments are changed, but it cannot be less. | |
474 DCHECK_GE(static_cast<size_t>(length), frame_format.ImageAllocationSize()); | |
475 | |
472 if (libyuv::ConvertToI420(data, | 476 if (libyuv::ConvertToI420(data, |
473 length, | 477 length, |
474 yplane, | 478 yplane, |
475 yplane_stride, | 479 yplane_stride, |
476 uplane, | 480 uplane, |
477 uv_plane_stride, | 481 uv_plane_stride, |
478 vplane, | 482 vplane, |
479 uv_plane_stride, | 483 uv_plane_stride, |
480 crop_x, | 484 crop_x, |
481 crop_y, | 485 crop_y, |
(...skipping 247 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
729 DCHECK_CURRENTLY_ON(BrowserThread::IO); | 733 DCHECK_CURRENTLY_ON(BrowserThread::IO); |
730 int active_client_count = 0; | 734 int active_client_count = 0; |
731 for (ControllerClient* client : controller_clients_) { | 735 for (ControllerClient* client : controller_clients_) { |
732 if (!client->paused) | 736 if (!client->paused) |
733 ++active_client_count; | 737 ++active_client_count; |
734 } | 738 } |
735 return active_client_count; | 739 return active_client_count; |
736 } | 740 } |
737 | 741 |
738 } // namespace content | 742 } // namespace content |
OLD | NEW |