外部 USB カメラ (C#、Windows 8) からストリームをキャプチャしようとしています。次のコード:
DeviceInformationCollection devInfoCollection = await DeviceInformation.FindAllAsync(DeviceClass.VideoCapture);
MediaCaptureInitializationSettings settings = new Windows.Media.Capture.MediaCaptureInitializationSettings();
settings.VideoDeviceId = devInfoCollection[0].Id;
mediaCaptureMgr = new MediaCapture();
await mediaCaptureMgr.InitializeAsync(settings);
最後の行 (await mediaCaptureMgr.InitializeAsync(settings)) で、例外がトリガーされます。変数の設定が null ではありません。設定:
(VideoDeviceId ="\\?\USB#VID_05E3&PID_0510&MI_00#7&2D043328&0&0000#{e5323777-f976-4f5b-9b55-b94699c46e44}\GLOBAL")
例外テキスト:
Exception from HRESULT: 0xC00DABE8
Source "mscorlib"
Ok。私は次のようにしようとしました:
try
{
mediaCaptureMgr = new MediaCapture();
await mediaCaptureMgr.InitializeAsync();
myCaptureElement.Source = mediaCaptureMgr;
await mediaCaptureMgr.StartPreviewAsync();
}
catch (Exception ee)
{
String s = ee.ToString();
}
とにかくエラーが行で発生します (mediaCaptureMgr.InitializeAsync()) この場合: s="System.Exception: Exception from HRESULT: 0xC00DABE8\r\n at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)\r\ n at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)\r\n at System.Runtime.CompilerServices.TaskAwaiter.GetResult()\r\n at TestVideo.MainPage.d__0.MoveNext() c:\Users \Admin\Documents\Visual Studio 2012\Projects\TestVideo\TestVideo\MainPage.xaml.cs: 53 行目"
そして例外は同じです:「HRESULTからの例外:0xC00DABE8」