Guest User

Untitled

a guest
Jan 21st, 2019
57
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.11 KB | None | 0 0
  1. void CameraApp::MainPage::InitCaptureSettings()
  2. {
  3. log.OutputLog(L"MainPage::InitCaptureSettings");
  4. m_CaptureInitSettings = ref new MediaCaptureInitializationSettings();
  5. m_CaptureInitSettings->AudioDeviceId = "";
  6. m_CaptureInitSettings->VideoDeviceId = "";
  7. m_CaptureInitSettings->StreamingCaptureMode = StreamingCaptureMode::AudioAndVideo;
  8. m_CaptureInitSettings->PhotoCaptureSource = PhotoCaptureSource::VideoPreview;
  9.  
  10. if(m_DeviceVector.size() > 0)
  11. m_CaptureInitSettings->VideoDeviceId = m_DeviceVector[0]->Id;
  12. }
  13.  
  14. void CameraApp::MainPage::InitMediaCapture()
  15. {
  16. log.OutputLog(L"MainPage::InitMediaCapture");
  17.  
  18.  
  19. auto _this = this;
  20. m_MediaCaptureMgr = ref new MediaCapture();
  21.  
  22. task<void> stratPreview(m_MediaCaptureMgr->InitializeAsync(m_CaptureInitSettings)); /// fails here
  23. stratPreview.then([_this]
  24. {
  25. _this->log.OutputLog(L"MainPage::InitializeAsync");
  26. _this->previewElement->Source = _this->m_MediaCaptureMgr;
  27. task<void> startPrev(_this->m_MediaCaptureMgr->StartPreviewAsync());
  28. startPrev.then([=]
  29. {
  30. _this->log.OutputLog(L"MainPage::StartPreviewAsync");
  31. return _this->GetCameraSettings();
  32. });
  33. });
  34. }
Add Comment
Please, Sign In to add comment