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

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

Issue 2121043002: 16 bpp video stream capture, render and WebGL usage - Realsense R200 & SR300 support. Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 5 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
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_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 69 matching lines...) Expand 10 before | Expand all | Expand 10 after
80 std::sort(formats->begin(), formats->end(), IsCaptureFormatSmaller); 80 std::sort(formats->begin(), formats->end(), IsCaptureFormatSmaller);
81 // Due to the ordering imposed, the largest frame_rate is kept while removing 81 // Due to the ordering imposed, the largest frame_rate is kept while removing
82 // duplicated resolutions. 82 // duplicated resolutions.
83 media::VideoCaptureFormats::iterator last = 83 media::VideoCaptureFormats::iterator last =
84 std::unique(formats->begin(), formats->end(), IsCaptureFormatSizeEqual); 84 std::unique(formats->begin(), formats->end(), IsCaptureFormatSizeEqual);
85 formats->erase(last, formats->end()); 85 formats->erase(last, formats->end());
86 // Mark all formats as I420, since this is what the renderer side will get 86 // Mark all formats as I420, since this is what the renderer side will get
87 // anyhow: the actual pixel format is decided at the device level. 87 // anyhow: the actual pixel format is decided at the device level.
88 for (media::VideoCaptureFormats::iterator it = formats->begin(); 88 for (media::VideoCaptureFormats::iterator it = formats->begin();
89 it != formats->end(); ++it) { 89 it != formats->end(); ++it) {
90 it->pixel_format = media::PIXEL_FORMAT_I420; 90 // TODO(astojilj) Force I420 for all except D16 in all
91 // video_capture_device_factory_->GetDeviceSupportedFormats instead of
92 // doing it here?
93 if (it->pixel_format != media::PIXEL_FORMAT_Y16)
94 it->pixel_format = media::PIXEL_FORMAT_I420;
91 } 95 }
92 } 96 }
93 97
94 // The maximum number of buffers in the capture pipeline. See 98 // The maximum number of buffers in the capture pipeline. See
95 // VideoCaptureController ctor comments for more details. 99 // VideoCaptureController ctor comments for more details.
96 const int kMaxNumberOfBuffers = 3; 100 const int kMaxNumberOfBuffers = 3;
97 // TODO(miu): The value for tab capture should be determined programmatically. 101 // TODO(miu): The value for tab capture should be determined programmatically.
98 // http://crbug.com/460318 102 // http://crbug.com/460318
99 const int kMaxNumberOfBuffersForTabCapture = 10; 103 const int kMaxNumberOfBuffersForTabCapture = 10;
100 104
(...skipping 1025 matching lines...) Expand 10 before | Expand all | Expand 10 after
1126 if (!device_in_queue) { 1130 if (!device_in_queue) {
1127 // Session ID is only valid for Screen capture. So we can fake it to 1131 // Session ID is only valid for Screen capture. So we can fake it to
1128 // resume video capture devices here. 1132 // resume video capture devices here.
1129 QueueStartDevice(kFakeSessionId, entry, entry->parameters); 1133 QueueStartDevice(kFakeSessionId, entry, entry->parameters);
1130 } 1134 }
1131 } 1135 }
1132 } 1136 }
1133 #endif // defined(OS_ANDROID) 1137 #endif // defined(OS_ANDROID)
1134 1138
1135 } // namespace content 1139 } // namespace content
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698