Code Monkey home page Code Monkey logo

Comments (1)

jamiehayes avatar jamiehayes commented on August 26, 2024

I changed EncoderMain::checkGraphicsCardCapability with what I think is more proper code and it seems to have fixed this particular issue:

FBCAPTURE_STATUS EncoderMain::checkGraphicsCardCapability() {
    FBCAPTURE_STATUS status = FBCAPTURE_STATUS_OK;

    const int nvidiaVenderID = 4318;  // NVIDIA Vendor ID: 0x10DE
    const int amdVenderID1 = 4098;  // AMD Vendor ID: 0x1002
    const int amdVenderID2 = 4130;  // AMD Vendor ID: 0x1022

    if(device_ == nullptr) {
        DEBUG_ERROR("You must call setGraphicsDeviceD3D11 before you can call checkGraphicsCardCapability");
        return FBCAPTURE_STATUS_SYSTEM_INITIALIZE_FAILED;
    }

    // check the device given for the adapter
    ScopedCOMPtr<IDXGIDevice> dxgidevice;
    ScopedCOMPtr<IDXGIAdapter> adapter;
    DXGI_ADAPTER_DESC adapterDescription;
    HRESULT hr = device_->QueryInterface(IID_PPV_ARGS(&dxgidevice));
    if(FAILED(hr))
        return FBCAPTURE_STATUS_DXGI_CREATING_FAILED;

    dxgidevice->GetAdapter(&adapter);
    if(adapter != nullptr) {
        adapter->GetDesc(&adapterDescription);

        wstring wDeviceName(adapterDescription.Description);
        string sDeviceName(wDeviceName.begin(), wDeviceName.end());
        DEBUG_LOG_VAR("Graphics Card Info: ", sDeviceName);

        if(adapterDescription.VendorId == nvidiaVenderID)
            this->nvidiaDevice = true;
        else if(adapterDescription.VendorId == amdVenderID1 || adapterDescription.VendorId == amdVenderID2)
            this->amdDevice = true;
    }

    if (!this->nvidiaDevice && !this->amdDevice) {
        DEBUG_ERROR("Unsupported graphics card. The SDK supports only nVidia and AMD GPUs");
        return FBCAPTURE_STATUS_UNSUPPORTED_GRAPHICS_CARD;
    }

    return status;
}

from 360-capture-sdk.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.