locked
__fastfail(FAST_FAIL_INVALID_ARG); error in Camera App

    Question

  •  This is code is from Camera App.It works most of the time but sometime it fails with following error.I have set capabilities for

    1.Webcam

    2.Microphone.

    Error:" Unhandled exception at 0x537C8AE3 (msvcr110d.dll) in CameraApp.exe: An invalid parameter was passed to a function that                  considers invalid parameters fatal.If there is a handler for this exception, the program may be safely continued."

    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();

    });
    });
    }



    • Edited by chris_vr Monday, September 24, 2012 11:21 AM
    Monday, September 24, 2012 11:20 AM

All replies

  • Hello,

    Can you please clarify by posting the exact HRESULT (hex code) and the exact API that is returning the error?

    Thanks,

    James


    Windows Media SDK Technologies - Microsoft Developer Services - http://blogs.msdn.com/mediasdkstuff/

    Monday, September 24, 2012 11:52 PM
    Moderator
  • m_MediaCaptureMgr->InitializeAsync(m_CaptureInitSettings) this api is failing.It doesn't return HRESULT.
    Tuesday, September 25, 2012 11:13 AM