Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- void CameraApp::MainPage::InitCaptureSettings()
- {
- log.OutputLog(L"MainPage::InitCaptureSettings");
- m_CaptureInitSettings = ref new MediaCaptureInitializationSettings();
- m_CaptureInitSettings->AudioDeviceId = "";
- m_CaptureInitSettings->VideoDeviceId = "";
- m_CaptureInitSettings->StreamingCaptureMode = StreamingCaptureMode::AudioAndVideo;
- m_CaptureInitSettings->PhotoCaptureSource = PhotoCaptureSource::VideoPreview;
- if(m_DeviceVector.size() > 0)
- m_CaptureInitSettings->VideoDeviceId = m_DeviceVector[0]->Id;
- }
- void CameraApp::MainPage::InitMediaCapture()
- {
- log.OutputLog(L"MainPage::InitMediaCapture");
- auto _this = this;
- m_MediaCaptureMgr = ref new MediaCapture();
- task<void> stratPreview(m_MediaCaptureMgr->InitializeAsync(m_CaptureInitSettings)); /// fails here
- stratPreview.then([_this]
- {
- _this->log.OutputLog(L"MainPage::InitializeAsync");
- _this->previewElement->Source = _this->m_MediaCaptureMgr;
- task<void> startPrev(_this->m_MediaCaptureMgr->StartPreviewAsync());
- startPrev.then([=]
- {
- _this->log.OutputLog(L"MainPage::StartPreviewAsync");
- return _this->GetCameraSettings();
- });
- });
- }
Add Comment
Please, Sign In to add comment