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

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

Issue 2735783002: Stop assuming anything about result of MFStartup() (Closed)
Patch Set: Mention "N" edition Created 3 years, 9 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
« no previous file with comments | « media/base/win/mf_initializer.cc ('k') | media/gpu/dxva_video_decode_accelerator_win.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 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_factory_win.h" 5 #include "media/capture/video/win/video_capture_device_factory_win.h"
6 6
7 #include <mfapi.h> 7 #include <mfapi.h>
8 #include <mferror.h> 8 #include <mferror.h>
9 #include <stddef.h> 9 #include <stddef.h>
10 10
(...skipping 61 matching lines...) Expand 10 before | Expand all | Expand 10 after
72 ExpandEnvironmentStringsW(kMfDLL, path, arraysize(path)); 72 ExpandEnvironmentStringsW(kMfDLL, path, arraysize(path));
73 if (!LoadLibraryExW(path, NULL, LOAD_WITH_ALTERED_SEARCH_PATH)) 73 if (!LoadLibraryExW(path, NULL, LOAD_WITH_ALTERED_SEARCH_PATH))
74 return false; 74 return false;
75 } 75 }
76 return true; 76 return true;
77 } 77 }
78 78
79 static bool PrepareVideoCaptureAttributesMediaFoundation( 79 static bool PrepareVideoCaptureAttributesMediaFoundation(
80 IMFAttributes** attributes, 80 IMFAttributes** attributes,
81 int count) { 81 int count) {
82 InitializeMediaFoundation(); 82 if (!InitializeMediaFoundation())
83 return false;
83 84
84 if (FAILED(MFCreateAttributes(attributes, count))) 85 if (FAILED(MFCreateAttributes(attributes, count)))
85 return false; 86 return false;
86 87
87 return SUCCEEDED( 88 return SUCCEEDED(
88 (*attributes) 89 (*attributes)
89 ->SetGUID(MF_DEVSOURCE_ATTRIBUTE_SOURCE_TYPE, 90 ->SetGUID(MF_DEVSOURCE_ATTRIBUTE_SOURCE_TYPE,
90 MF_DEVSOURCE_ATTRIBUTE_SOURCE_TYPE_VIDCAP_GUID)); 91 MF_DEVSOURCE_ATTRIBUTE_SOURCE_TYPE_VIDCAP_GUID));
91 } 92 }
92 93
(...skipping 366 matching lines...) Expand 10 before | Expand all | Expand 10 after
459 } 460 }
460 461
461 // static 462 // static
462 VideoCaptureDeviceFactory* 463 VideoCaptureDeviceFactory*
463 VideoCaptureDeviceFactory::CreateVideoCaptureDeviceFactory( 464 VideoCaptureDeviceFactory::CreateVideoCaptureDeviceFactory(
464 scoped_refptr<base::SingleThreadTaskRunner> ui_task_runner) { 465 scoped_refptr<base::SingleThreadTaskRunner> ui_task_runner) {
465 return new VideoCaptureDeviceFactoryWin(); 466 return new VideoCaptureDeviceFactoryWin();
466 } 467 }
467 468
468 } // namespace media 469 } // namespace media
OLDNEW
« no previous file with comments | « media/base/win/mf_initializer.cc ('k') | media/gpu/dxva_video_decode_accelerator_win.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698