OBS-扩展模块DLL
+ -

OBS扩展模块DLL-模块使用

2024-06-20 17 0

整体只找到这几个获取模块的使用

obs_module_t *mod = obs_get_module("win-wasapi");
obs_module_t *mod = obs_get_module("win-dshow")
obs_module_t *mod = obs_get_module("win-capture");
obs_module_t *mod = obs_get_module("image-source");

win-wasapi-音频输入采集、音频输音频出采集

配置路径:”C:\Program Files\obs-studio\data\obs-plugins\win-wasapi\locale\zh-CN.ini”

void ApplicationAudioCaptureToolbar::Init()
{
    delete ui->activateButton;
    ui->activateButton = nullptr;

    obs_module_t *mod = obs_get_module("win-wasapi");
    const char *device_str = obs_module_get_locale_text(mod, "Window");
    ui->deviceLabel->setText(device_str);

    prop_name = "window";

    ComboSelectToolbar::Init();
}

win-dshow-虚拟相机

配置路径:”C:\Program Files\obs-studio\data\obs-plugins\win-dshow\locale\zh-CN.ini”

DeviceCaptureToolbar::DeviceCaptureToolbar(QWidget *parent, OBSSource source)
    : QWidget(parent),
      weakSource(OBSGetWeakRef(source)),
      ui(new Ui_DeviceSelectToolbar)
{
    ui->setupUi(this);

    delete ui->deviceLabel;
    delete ui->device;
    ui->deviceLabel = nullptr;
    ui->device = nullptr;

    OBSDataAutoRelease settings = obs_source_get_settings(source);
    active = obs_data_get_bool(settings, "active");

    obs_module_t *mod = obs_get_module("win-dshow");
    if (!mod)
        return;

    activateText = obs_module_get_locale_text(mod, "Activate");
    deactivateText = obs_module_get_locale_text(mod, "Deactivate");

    ui->activateButton->setText(active ? deactivateText : activateText);
}

win-capture-显示器采集、窗口采集、游戏源

配置文件路径:”C:\Program Files\obs-studio\data\obs-plugins\win-capture\locale\zh-CN.ini”

GameCaptureToolbar::GameCaptureToolbar(QWidget *parent, OBSSource source)
    : SourceToolbar(parent, source),
      ui(new Ui_GameCaptureToolbar)
{
    obs_property_t *p;
    int cur_idx;

    ui->setupUi(this);

    obs_module_t *mod = obs_get_module("win-capture");
    if (!mod)
        return;

    ui->modeLabel->setText(obs_module_get_locale_text(mod, "Mode"));
    ui->windowLabel->setText(
        obs_module_get_locale_text(mod, "WindowCapture.Window"));

    OBSDataAutoRelease settings = obs_source_get_settings(source);
    std::string cur_mode = obs_data_get_string(settings, "capture_mode");
    std::string cur_window = obs_data_get_string(settings, "window");

    ui->mode->blockSignals(true);
    p = obs_properties_get(props.get(), "capture_mode");
    cur_idx = FillPropertyCombo(ui->mode, p, cur_mode);
    ui->mode->setCurrentIndex(cur_idx);
    ui->mode->blockSignals(false);

    ui->window->blockSignals(true);
    p = obs_properties_get(props.get(), "window");
    cur_idx = FillPropertyCombo(ui->window, p, cur_window);
    ui->window->setCurrentIndex(cur_idx);
    ui->window->blockSignals(false);

    if (cur_idx != -1 && obs_property_list_item_disabled(p, cur_idx)) {
        SetComboItemEnabled(ui->window, cur_idx, false);
    }

    UpdateWindowVisibility();
}

image-source - 色源(颜色)、图片和图片幻灯片

关于image-source的详细信息可见:https://www.pnpon.com/article/detail-689.html
配置文件路径:”C:\Program Files\obs-studio\data\obs-plugins\image-source\locale\zh-CN.ini”

ImageSourceToolbar::ImageSourceToolbar(QWidget *parent, OBSSource source)
    : SourceToolbar(parent, source),
      ui(new Ui_ImageSourceToolbar)
{
    ui->setupUi(this);

    obs_module_t *mod = obs_get_module("image-source");
    ui->pathLabel->setText(obs_module_get_locale_text(mod, "File"));

    OBSDataAutoRelease settings = obs_source_get_settings(source);
    std::string file = obs_data_get_string(settings, "file");

    ui->path->setText(file.c_str());
}

0 篇笔记 写笔记

作者信息
我爱内核
Windows驱动开发,网站开发
好好学习,天天向上。
取消
感谢您的支持,我会继续努力的!
扫码支持
扫码打赏,你说多少就多少

打开支付宝扫一扫,即可进行扫码打赏哦

您的支持,是我们前进的动力!