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

Side by Side Diff: media/capture/video/win/video_capture_device_win.cc

Issue 2428263004: 16 bpp video stream capture, render and createImageBitmap(video) using (CPU) shared memory buffers (Closed)
Patch Set: Review #33 and #34 fixes. Removed WebGL part of code. Thanks danakj@ and mcasas@. Created 4 years, 1 month 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 "media/capture/video/win/video_capture_device_win.h" 5 #include "media/capture/video/win/video_capture_device_win.h"
6 6
7 #include <ks.h> 7 #include <ks.h>
8 #include <ksmedia.h> 8 #include <ksmedia.h>
9 9
10 #include <algorithm> 10 #include <algorithm>
(...skipping 152 matching lines...) Expand 10 before | Expand all | Expand 10 after
163 VideoPixelFormat format; 163 VideoPixelFormat format;
164 } const kMediaSubtypeToPixelFormatCorrespondence[] = { 164 } const kMediaSubtypeToPixelFormatCorrespondence[] = {
165 {kMediaSubTypeI420, PIXEL_FORMAT_I420}, 165 {kMediaSubTypeI420, PIXEL_FORMAT_I420},
166 {MEDIASUBTYPE_IYUV, PIXEL_FORMAT_I420}, 166 {MEDIASUBTYPE_IYUV, PIXEL_FORMAT_I420},
167 {MEDIASUBTYPE_RGB24, PIXEL_FORMAT_RGB24}, 167 {MEDIASUBTYPE_RGB24, PIXEL_FORMAT_RGB24},
168 {MEDIASUBTYPE_YUY2, PIXEL_FORMAT_YUY2}, 168 {MEDIASUBTYPE_YUY2, PIXEL_FORMAT_YUY2},
169 {MEDIASUBTYPE_MJPG, PIXEL_FORMAT_MJPEG}, 169 {MEDIASUBTYPE_MJPG, PIXEL_FORMAT_MJPEG},
170 {MEDIASUBTYPE_UYVY, PIXEL_FORMAT_UYVY}, 170 {MEDIASUBTYPE_UYVY, PIXEL_FORMAT_UYVY},
171 {MEDIASUBTYPE_ARGB32, PIXEL_FORMAT_ARGB}, 171 {MEDIASUBTYPE_ARGB32, PIXEL_FORMAT_ARGB},
172 {kMediaSubTypeHDYC, PIXEL_FORMAT_UYVY}, 172 {kMediaSubTypeHDYC, PIXEL_FORMAT_UYVY},
173 {kMediaSubTypeY16, PIXEL_FORMAT_Y16},
174 {kMediaSubTypeZ16, PIXEL_FORMAT_Y16},
175 {kMediaSubTypeINVZ, PIXEL_FORMAT_Y16},
173 }; 176 };
174 for (const auto& pixel_format : kMediaSubtypeToPixelFormatCorrespondence) { 177 for (const auto& pixel_format : kMediaSubtypeToPixelFormatCorrespondence) {
175 if (sub_type == pixel_format.sub_type) 178 if (sub_type == pixel_format.sub_type)
176 return pixel_format.format; 179 return pixel_format.format;
177 } 180 }
178 #ifndef NDEBUG 181 #ifndef NDEBUG
179 WCHAR guid_str[128]; 182 WCHAR guid_str[128];
180 StringFromGUID2(sub_type, guid_str, arraysize(guid_str)); 183 StringFromGUID2(sub_type, guid_str, arraysize(guid_str));
181 DVLOG(2) << "Device (also) supports an unknown media type " << guid_str; 184 DVLOG(2) << "Device (also) supports an unknown media type " << guid_str;
182 #endif 185 #endif
(...skipping 403 matching lines...) Expand 10 before | Expand all | Expand 10 after
586 void VideoCaptureDeviceWin::SetErrorState( 589 void VideoCaptureDeviceWin::SetErrorState(
587 const tracked_objects::Location& from_here, 590 const tracked_objects::Location& from_here,
588 const std::string& reason, 591 const std::string& reason,
589 HRESULT hr) { 592 HRESULT hr) {
590 DCHECK(thread_checker_.CalledOnValidThread()); 593 DCHECK(thread_checker_.CalledOnValidThread());
591 DLOG_IF_FAILED_WITH_HRESULT(reason, hr); 594 DLOG_IF_FAILED_WITH_HRESULT(reason, hr);
592 state_ = kError; 595 state_ = kError;
593 client_->OnError(from_here, reason); 596 client_->OnError(from_here, reason);
594 } 597 }
595 } // namespace media 598 } // namespace media
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698