alievk / avatarify-desktop

Successor of Avatarify Python
Creative Commons Zero v1.0 Universal
1.17k stars 270 forks source link

7>D:\avatarify-desktop\avatarify\src\vcam\AkVCamBridge.cpp(22,17): error C2039: "connectService": is not"AkVCam::IpcBridge" member #3

Closed zhangpu1987 closed 3 years ago

zhangpu1987 commented 3 years ago

bool AkVCamBridge::allocateDevice() { m_ipcBridge.connectService(false); m_ipcBridge.setDriverPaths({QDir::currentPath().toStdWString()}); auto devices = m_ipcBridge.listDevices(); std::cout << "List of devices:" << std::endl; for (const auto &d : devices) { std::cout << "\t" << d << std::endl; }

bool isStarted{false};
if (devices.empty()) {
    qDebug() << "No available devices. Need to create one..." << supportedFormats.size();
    m_ipcBridge.deviceCreate(description, supportedFormats);
    devices = m_ipcBridge.listDevices();
    qDebug() << devices.size();
    if (!devices.empty()) {
        m_device = devices[0];
        qDebug() << m_device.c_str();
        for (int i = 1; i < 4; ++i) {
            QThread::sleep(4 * i);
            if ((isStarted = m_ipcBridge.deviceStart(m_device, format))) {
                break;
            }
        }
        if (!isStarted) {
            return false;
        }
    }
    //m_device = m_ipcBridge.deviceCreate(description, supportedFormats);
    //if (m_device.empty()) { // error during creating the device
    //    std::wstring_convert<std::codecvt_utf8<wchar_t>, wchar_t> converter;
    //    std::cout << "ipcBridge: " << converter.to_bytes(m_ipcBridge.errorMessage()) << std::endl;
    //    return false;
    //}
} else {
    qDebug() << "There are " << devices.size() << " devices. Choose 0...";
    m_device = devices[0];
    //m_ipcBridge.deviceEdit(m_device, L"Avatarify Camera", supportedFormats);
}
if (!isStarted) {
    isStarted = m_ipcBridge.deviceStart(m_device, format);
}
if (isStarted) {
    AmplitudeLogger::log("vcam_ok");
    std::cout << "Success initializing " << m_device << std::endl;
    return true;
} else {
    AmplitudeLogger::log("vcam_fail");
    std::cout << "Error initializing " << m_device << std::endl;
    std::wstring_convert<std::codecvt_utf8<wchar_t>, wchar_t> converter;
    std::cout << "ipcBridge: " << converter.to_bytes(m_ipcBridge.errorMessage()) << std::endl;
    return false;
}

}

zhangpu1987 commented 3 years ago

which commit you used in akvirtualcamera??

staddy commented 3 years ago

dd38c54 You can see it here: image

staddy commented 3 years ago

https://github.com/vlivashkin/akvirtualcamera/blob/40482cb4842671baaa76a5d4285939bc226ac3eb/VCamUtils/src/ipcbridge.h#L114 The proper way to pull all dependencies:

git clone https://github.com/alievk/avatarify-desktop
cd avatarify-desktop
git submodule update --init --recursive