![](/img/trans.png)
[英]getting “Exception from HRESULT: 0xC00DABE0” in MediaCapture sample of c#/xaml metro style app
[英]Exception from HRESULT: 0xC00DABE8 when initializing MediaCapture
我正在嘗試從外部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);
在最后一行(等待mediaCaptureMgr.InitializeAsync(settings))被觸發異常。 變量設置不為空。 設置:
(VideoDeviceId =“ \\\\?\\ USB#VID_05E3&PID_0510&MI_00#7&2D043328&0&0000#{e5323777-f976-4f5b-9b55-b94699c46e44} \\ GLOBAL”)
例外文字:
Exception from HRESULT: 0xC00DABE8
Source "mscorlib"
好。 我嘗試這樣做,例如:
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:來自HRESULT的異常:0xC00DABE8 \\ r \\ n在System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(任務任務)\\ r \\ n在System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(任務任務)\\ r \\ n在System.Runtime.CompilerServices.TaskAwaiter.GetResult()\\ r \\ n在TestVideo.MainPage.d__0.MoveNext()在c:\\ Users \\ Admin \\ Documents \\ Visual Studio 2012 \\ Projects \\ TestVideo \\ TestVideo \\ MainPage.xaml.cs:第53行“
和異常相同:“來自HRESULT的異常:0xC00DABE8”
請根據要求將MediaCaptureInitializationSettings
StreamingCaptureMode
設置為視頻或音頻
settings.StreamingCaptureMode = settings.StreamingCaptureMode.Video;
我希望這能幫到您
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.