| 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_manager.h" | 5 #include "content/browser/renderer_host/media/video_capture_manager.h" |
| 6 | 6 |
| 7 #include <algorithm> | 7 #include <algorithm> |
| 8 #include <set> | 8 #include <set> |
| 9 #include <utility> | 9 #include <utility> |
| 10 | 10 |
| (...skipping 71 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 82 if (formats->empty()) | 82 if (formats->empty()) |
| 83 return; | 83 return; |
| 84 std::sort(formats->begin(), formats->end(), IsCaptureFormatSmaller); | 84 std::sort(formats->begin(), formats->end(), IsCaptureFormatSmaller); |
| 85 // Due to the ordering imposed, the largest frame_rate is kept while removing | 85 // Due to the ordering imposed, the largest frame_rate is kept while removing |
| 86 // duplicated resolutions. | 86 // duplicated resolutions. |
| 87 media::VideoCaptureFormats::iterator last = | 87 media::VideoCaptureFormats::iterator last = |
| 88 std::unique(formats->begin(), formats->end(), IsCaptureFormatSizeEqual); | 88 std::unique(formats->begin(), formats->end(), IsCaptureFormatSizeEqual); |
| 89 formats->erase(last, formats->end()); | 89 formats->erase(last, formats->end()); |
| 90 // Mark all formats as I420, since this is what the renderer side will get | 90 // Mark all formats as I420, since this is what the renderer side will get |
| 91 // anyhow: the actual pixel format is decided at the device level. | 91 // anyhow: the actual pixel format is decided at the device level. |
| 92 for (media::VideoCaptureFormats::iterator it = formats->begin(); | 92 // Don't do this for Y16 format as it is handled separatelly. |
| 93 it != formats->end(); ++it) { | 93 for (auto& format : *formats) { |
| 94 it->pixel_format = media::PIXEL_FORMAT_I420; | 94 if (format.pixel_format != media::PIXEL_FORMAT_Y16) |
| 95 format.pixel_format = media::PIXEL_FORMAT_I420; |
| 95 } | 96 } |
| 96 } | 97 } |
| 97 | 98 |
| 98 // The maximum number of buffers in the capture pipeline. See | 99 // The maximum number of buffers in the capture pipeline. See |
| 99 // VideoCaptureController ctor comments for more details. | 100 // VideoCaptureController ctor comments for more details. |
| 100 const int kMaxNumberOfBuffers = 3; | 101 const int kMaxNumberOfBuffers = 3; |
| 101 // TODO(miu): The value for tab capture should be determined programmatically. | 102 // TODO(miu): The value for tab capture should be determined programmatically. |
| 102 // http://crbug.com/460318 | 103 // http://crbug.com/460318 |
| 103 const int kMaxNumberOfBuffersForTabCapture = 10; | 104 const int kMaxNumberOfBuffersForTabCapture = 10; |
| 104 | 105 |
| (...skipping 1180 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1285 if (!device_in_queue) { | 1286 if (!device_in_queue) { |
| 1286 // Session ID is only valid for Screen capture. So we can fake it to | 1287 // Session ID is only valid for Screen capture. So we can fake it to |
| 1287 // resume video capture devices here. | 1288 // resume video capture devices here. |
| 1288 QueueStartDevice(kFakeSessionId, entry.get(), entry->parameters); | 1289 QueueStartDevice(kFakeSessionId, entry.get(), entry->parameters); |
| 1289 } | 1290 } |
| 1290 } | 1291 } |
| 1291 } | 1292 } |
| 1292 #endif // defined(OS_ANDROID) | 1293 #endif // defined(OS_ANDROID) |
| 1293 | 1294 |
| 1294 } // namespace content | 1295 } // namespace content |
| OLD | NEW |