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

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

Issue 17402002: Reconnect support for DirectShow video capture devices in parallel to MediaFoundation ones. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: CaptureApiType wrapped into a CaptureApiClass for default value. Created 7 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 "media/video/capture/win/video_capture_device_mf_win.h" 5 #include "media/video/capture/win/video_capture_device_mf_win.h"
6 6
7 #include <mfapi.h> 7 #include <mfapi.h>
8 #include <mferror.h> 8 #include <mferror.h>
9 9
10 #include "base/lazy_instance.h" 10 #include "base/lazy_instance.h"
(...skipping 250 matching lines...) Expand 10 before | Expand all | Expand 10 after
261 HRESULT hr; 261 HRESULT hr;
262 for (UINT32 i = 0; i < count; ++i) { 262 for (UINT32 i = 0; i < count; ++i) {
263 UINT32 name_size, id_size; 263 UINT32 name_size, id_size;
264 ScopedCoMem<wchar_t> name, id; 264 ScopedCoMem<wchar_t> name, id;
265 if (SUCCEEDED(hr = devices[i]->GetAllocatedString( 265 if (SUCCEEDED(hr = devices[i]->GetAllocatedString(
266 MF_DEVSOURCE_ATTRIBUTE_FRIENDLY_NAME, &name, &name_size)) && 266 MF_DEVSOURCE_ATTRIBUTE_FRIENDLY_NAME, &name, &name_size)) &&
267 SUCCEEDED(hr = devices[i]->GetAllocatedString( 267 SUCCEEDED(hr = devices[i]->GetAllocatedString(
268 MF_DEVSOURCE_ATTRIBUTE_SOURCE_TYPE_VIDCAP_SYMBOLIC_LINK, &id, 268 MF_DEVSOURCE_ATTRIBUTE_SOURCE_TYPE_VIDCAP_SYMBOLIC_LINK, &id,
269 &id_size))) { 269 &id_size))) {
270 std::wstring name_w(name, name_size), id_w(id, id_size); 270 std::wstring name_w(name, name_size), id_w(id, id_size);
271 Name device(base::SysWideToUTF8(name_w), base::SysWideToUTF8(id_w)); 271 Name device(base::SysWideToUTF8(name_w), base::SysWideToUTF8(id_w),
272 Name::MEDIA_FOUNDATION);
272 device_names->push_back(device); 273 device_names->push_back(device);
273 } else { 274 } else {
274 DLOG(WARNING) << "GetAllocatedString failed: " << std::hex << hr; 275 DLOG(WARNING) << "GetAllocatedString failed: " << std::hex << hr;
275 } 276 }
276 devices[i]->Release(); 277 devices[i]->Release();
277 } 278 }
278 } 279 }
279 280
280 VideoCaptureDeviceMFWin::VideoCaptureDeviceMFWin(const Name& device_name) 281 VideoCaptureDeviceMFWin::VideoCaptureDeviceMFWin(const Name& device_name)
281 : name_(device_name), observer_(NULL), capture_(0) { 282 : name_(device_name), observer_(NULL), capture_(0) {
(...skipping 146 matching lines...) Expand 10 before | Expand all | Expand 10 after
428 } 429 }
429 } 430 }
430 431
431 void VideoCaptureDeviceMFWin::OnError(HRESULT hr) { 432 void VideoCaptureDeviceMFWin::OnError(HRESULT hr) {
432 DLOG(ERROR) << "VideoCaptureDeviceMFWin: " << std::hex << hr; 433 DLOG(ERROR) << "VideoCaptureDeviceMFWin: " << std::hex << hr;
433 if (observer_) 434 if (observer_)
434 observer_->OnError(); 435 observer_->OnError();
435 } 436 }
436 437
437 } // namespace media 438 } // namespace media
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698