OBS中给了一个简单的test应用,创建一个场景,并将场景显示在windows中:
int WINAPI WinMain(HINSTANCE instance, HINSTANCE prevInstance, LPSTR cmdLine,
int numCmd)
{
HWND hwnd = NULL;
base_set_log_handler(do_log, nullptr);
try {
hwnd = CreateTestWindow(instance);
if (!hwnd)
throw "Couldn't create main window";
/* ------------------------------------------------------ */
/* create OBS */
CreateOBS(hwnd);
/* ------------------------------------------------------ */
/* load modules */
obs_load_all_modules();
/* ------------------------------------------------------ */
/* create source */
SourceContext source = obs_source_create("random",
"some randon source", NULL, nullptr);
if (!source)
throw "Couldn't create random test source";
/* ------------------------------------------------------ */
/* create filter */
SourceContext filter = obs_source_create(