4 Star 14 Fork 24

zentel/libobs

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
该仓库未声明开源许可证文件(LICENSE),使用请关注具体项目描述及其代码上游依赖。
克隆/下载
test.cpp 1.25 KB
一键复制 编辑 原始数据 按行查看 历史
zentel 提交于 2019-05-20 16:23 . 添加duilib界面库
#include <stdio.h>
#include <time.h>
#include <windows.h>
#include "api/ObsMain.h"
#include "api/ObsWindow.h"
#include "api/ObsUtils.h"
int WINAPI WinMain(HINSTANCE instance, HINSTANCE prevInstance, LPSTR cmdLine,
int numCmd)
{
ObsMain* obsMain = ObsMain::Instance();
obsMain->InitGlobalConfig();
obsMain->InitObs();
EnumDevice(NULL,NULL);
try {
ObsWindow * obsWindow = ObsWindow::Create();
ObsRect rc = {100,200,800,600};
window_handle_t hwnd = obsWindow->CreateWnd(NULL,rc);
if (!hwnd)
throw "Couldn't create main window";
obsWindow->CreateDisplay();
//ʼ
RtmpServer addr;
addr.server = "rtmp://192.168.1.10/live";
addr.key = "livestream";
obsMain->SetRtmpServer(addr);
//obsMain->StartStreaming();
MSG msg;
while (GetMessage(&msg, NULL, 0, 0)) {
TranslateMessage(&msg);
DispatchMessage(&msg);
}
//obsMain->StopStreaming();
obsMain->SaveProject();
delete obsWindow;
} catch (char *error) {
MessageBoxA(NULL, error, NULL, 0);
}
delete obsMain;
blog(LOG_INFO, "Number of memory leaks: %ld", bnum_allocs());
UNUSED_PARAMETER(prevInstance);
UNUSED_PARAMETER(cmdLine);
UNUSED_PARAMETER(numCmd);
return 0;
}
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
C++
1
https://gitee.com/zentel/libobs.git
git@gitee.com:zentel/libobs.git
zentel
libobs
libobs
master

搜索帮助

D67c1975 1850385 1daf7b77 1850385