Revamp API and start using doxygen
The API used to be designed in such a way to where it would expect exports for each individual source/output/encoder/etc. You would export functions for each and it would automatically load those functions based on a specific naming scheme from the module. The idea behind this was that I wanted to limit the usage of structures in the API so only functions could be used. It was an interesting idea in theory, but this idea turned out to be flawed in a number of ways: 1.) Requiring exports to create sources/outputs/encoders/etc meant that you could not create them by any other means, which meant that things like faruton's .net plugin would become difficult. 2.) Export function declarations could not be checked, therefore if you created a function with the wrong parameters and parameter types, the compiler wouldn't know how to check for that. 3.) Required overly complex load functions in libobs just to handle it. It makes much more sense to just have a load function that you call manually. Complexity is the bane of all good programs. 4.) It required that you have functions of specific names, which looked and felt somewhat unsightly. So, to fix these issues, I replaced it with a more commonly used API scheme, seen commonly in places like kernels and typical C libraries with abstraction. You simply create a structure that contains the callback definitions, and you pass it to a function to register that definition (such as obs_register_source), which you call in the obs_module_load of the module. It will also automatically check the structure size and ensure that it only loads the required values if the structure happened to add new values in an API change. The "main" source file for each module must include obs-module.h, and must use OBS_DECLARE_MODULE() within that source file. Also, started writing some doxygen documentation in to the main library headers. Will add more detailed documentation as I go.
This commit is contained in:
@@ -148,14 +148,14 @@ static void test()
|
||||
|
||||
/* ------------------------------------------------------ */
|
||||
/* create source */
|
||||
SourceContext source{obs_source_create(SOURCE_INPUT,
|
||||
SourceContext source{obs_source_create(OBS_SOURCE_INPUT,
|
||||
"random", "a test source", NULL)};
|
||||
if (!source)
|
||||
throw "Couldn't create random test source";
|
||||
|
||||
/* ------------------------------------------------------ */
|
||||
/* create filter */
|
||||
SourceContext filter{obs_source_create(SOURCE_FILTER,
|
||||
SourceContext filter{obs_source_create(OBS_SOURCE_FILTER,
|
||||
"test", "a test filter", NULL)};
|
||||
if (!filter)
|
||||
throw "Couldn't create test filter";
|
||||
|
@@ -30,15 +30,8 @@ set(test-input_SOURCES
|
||||
test-sinewave.c
|
||||
test-random.c)
|
||||
|
||||
set(test-input_HEADERS
|
||||
test-filter.h
|
||||
test-input-exports.h
|
||||
test-random.h
|
||||
test-sinewave.h)
|
||||
|
||||
add_library(test-input MODULE
|
||||
${test-input_SOURCES}
|
||||
${test-input_HEADERS})
|
||||
${test-input_SOURCES})
|
||||
|
||||
target_link_libraries(test-input
|
||||
${test-input_PLATFORM_DEPS}
|
||||
|
@@ -1,41 +0,0 @@
|
||||
#pragma once
|
||||
|
||||
#include "obs.h"
|
||||
#import <CoreGraphics/CGDisplayStream.h>
|
||||
|
||||
#include <util/darray.h>
|
||||
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
struct desktop_tex {
|
||||
samplerstate_t sampler;
|
||||
effect_t whatever;
|
||||
|
||||
CGDisplayStreamRef disp;
|
||||
uint32_t width, height;
|
||||
|
||||
texture_t tex;
|
||||
pthread_mutex_t mutex;
|
||||
IOSurfaceRef current, prev;
|
||||
};
|
||||
|
||||
EXPORT const char *osx_desktop_test_getname(const char *locale);
|
||||
|
||||
EXPORT struct desktop_tex *osx_desktop_test_create(const char *settings,
|
||||
obs_source_t source);
|
||||
EXPORT void osx_desktop_test_destroy(struct desktop_tex *rt);
|
||||
EXPORT uint32_t osx_desktop_test_get_output_flags(struct desktop_tex *rt);
|
||||
EXPORT void osx_desktop_test_video_tick(struct desktop_tex *rt, float dt);
|
||||
|
||||
EXPORT void osx_desktop_test_video_render(struct desktop_tex *rt,
|
||||
obs_source_t filter_target);
|
||||
|
||||
EXPORT uint32_t osx_desktop_test_getwidth(struct desktop_tex *rt);
|
||||
EXPORT uint32_t osx_desktop_test_getheight(struct desktop_tex *rt);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
@@ -1,25 +1,60 @@
|
||||
#include <stdlib.h>
|
||||
#include "test-desktop.h"
|
||||
#include <obs.h>
|
||||
#include <pthread.h>
|
||||
|
||||
#import <CoreGraphics/CGDisplayStream.h>
|
||||
#import <Cocoa/Cocoa.h>
|
||||
#import <AppKit/AppKit.h>
|
||||
#import <OpenGL/OpenGL.h>
|
||||
#import <OpenGL/CGLIOSurface.h>
|
||||
#import <OpenGL/CGLMacro.h>
|
||||
#import <CoreGraphics/CGDisplayStream.h>
|
||||
#include <pthread.h>
|
||||
|
||||
struct desktop_tex {
|
||||
samplerstate_t sampler;
|
||||
effect_t whatever;
|
||||
|
||||
const char *osx_desktop_test_getname(const char *locale)
|
||||
{
|
||||
return "OSX Monitor Capture";
|
||||
}
|
||||
CGDisplayStreamRef disp;
|
||||
uint32_t width, height;
|
||||
|
||||
texture_t tex;
|
||||
pthread_mutex_t mutex;
|
||||
IOSurfaceRef current, prev;
|
||||
};
|
||||
|
||||
static IOSurfaceRef current = NULL,
|
||||
prev = NULL;
|
||||
static pthread_mutex_t c_mutex;
|
||||
|
||||
struct desktop_tex *osx_desktop_test_create(const char *settings,
|
||||
static const char *osx_desktop_test_getname(const char *locale)
|
||||
{
|
||||
return "OSX Monitor Capture";
|
||||
}
|
||||
|
||||
static void osx_desktop_test_destroy(struct desktop_tex *rt)
|
||||
{
|
||||
if (rt) {
|
||||
pthread_mutex_lock(&rt->mutex);
|
||||
gs_entercontext(obs_graphics());
|
||||
|
||||
if (current) {
|
||||
IOSurfaceDecrementUseCount(rt->current);
|
||||
CFRelease(rt->current);
|
||||
}
|
||||
if (rt->sampler)
|
||||
samplerstate_destroy(rt->sampler);
|
||||
if (rt->tex)
|
||||
texture_destroy(rt->tex);
|
||||
CGDisplayStreamStop(rt->disp);
|
||||
effect_destroy(rt->whatever);
|
||||
bfree(rt);
|
||||
|
||||
gs_leavecontext();
|
||||
pthread_mutex_unlock(&rt->mutex);
|
||||
}
|
||||
}
|
||||
|
||||
static struct desktop_tex *osx_desktop_test_create(const char *settings,
|
||||
obs_source_t source)
|
||||
{
|
||||
struct desktop_tex *rt = bzalloc(sizeof(struct desktop_tex));
|
||||
@@ -101,35 +136,7 @@ struct desktop_tex *osx_desktop_test_create(const char *settings,
|
||||
return rt;
|
||||
}
|
||||
|
||||
void osx_desktop_test_destroy(struct desktop_tex *rt)
|
||||
{
|
||||
if (rt) {
|
||||
pthread_mutex_lock(&rt->mutex);
|
||||
gs_entercontext(obs_graphics());
|
||||
|
||||
if (current) {
|
||||
IOSurfaceDecrementUseCount(rt->current);
|
||||
CFRelease(rt->current);
|
||||
}
|
||||
if (rt->sampler)
|
||||
samplerstate_destroy(rt->sampler);
|
||||
if (rt->tex)
|
||||
texture_destroy(rt->tex);
|
||||
CGDisplayStreamStop(rt->disp);
|
||||
effect_destroy(rt->whatever);
|
||||
bfree(rt);
|
||||
|
||||
gs_leavecontext();
|
||||
pthread_mutex_unlock(&rt->mutex);
|
||||
}
|
||||
}
|
||||
|
||||
uint32_t osx_desktop_test_get_output_flags(struct desktop_tex *rt)
|
||||
{
|
||||
return SOURCE_VIDEO;
|
||||
}
|
||||
|
||||
void osx_desktop_test_video_render(struct desktop_tex *rt,
|
||||
static void osx_desktop_test_video_render(struct desktop_tex *rt,
|
||||
obs_source_t filter_target)
|
||||
{
|
||||
pthread_mutex_lock(&rt->mutex);
|
||||
@@ -161,12 +168,24 @@ fail:
|
||||
pthread_mutex_unlock(&rt->mutex);
|
||||
}
|
||||
|
||||
uint32_t osx_desktop_test_getwidth(struct desktop_tex *rt)
|
||||
static uint32_t osx_desktop_test_getwidth(struct desktop_tex *rt)
|
||||
{
|
||||
return rt->width;
|
||||
}
|
||||
|
||||
uint32_t osx_desktop_test_getheight(struct desktop_tex *rt)
|
||||
static uint32_t osx_desktop_test_getheight(struct desktop_tex *rt)
|
||||
{
|
||||
return rt->height;
|
||||
}
|
||||
|
||||
struct obs_source_info osx_desktop = {
|
||||
.id = "osx_desktop",
|
||||
.type = OBS_SOURCE_TYPE_INPUT,
|
||||
.output_flags = OBS_SOURCE_VIDEO | OBS_SOURCE_CUSTOM_DRAW,
|
||||
.getname = osx_desktop_test_getname,
|
||||
.create = osx_desktop_test_create,
|
||||
.destroy = osx_desktop_test_destroy,
|
||||
.video_render = osx_desktop_video_render,
|
||||
.getwidth = osx_desktop_test_getwidth,
|
||||
.getheight = osx_desktop_test_getheight,
|
||||
};
|
||||
|
@@ -1,11 +1,29 @@
|
||||
#include "test-filter.h"
|
||||
#include <obs.h>
|
||||
|
||||
const char *test_getname(const char *locale)
|
||||
struct test_filter {
|
||||
obs_source_t source;
|
||||
effect_t whatever;
|
||||
};
|
||||
|
||||
static const char *filter_getname(const char *locale)
|
||||
{
|
||||
return "Test";
|
||||
}
|
||||
|
||||
struct test_filter *test_create(const char *settings, obs_source_t source)
|
||||
static void filter_destroy(struct test_filter *tf)
|
||||
{
|
||||
if (tf) {
|
||||
gs_entercontext(obs_graphics());
|
||||
|
||||
effect_destroy(tf->whatever);
|
||||
bfree(tf);
|
||||
|
||||
gs_leavecontext();
|
||||
}
|
||||
}
|
||||
|
||||
static struct test_filter *filter_create(obs_data_t settings,
|
||||
obs_source_t source)
|
||||
{
|
||||
struct test_filter *tf = bzalloc(sizeof(struct test_filter));
|
||||
char *effect_file;
|
||||
@@ -18,42 +36,27 @@ struct test_filter *test_create(const char *settings, obs_source_t source)
|
||||
tf->whatever = gs_create_effect_from_file(effect_file, NULL);
|
||||
bfree(effect_file);
|
||||
if (!tf->whatever) {
|
||||
test_destroy(tf);
|
||||
filter_destroy(tf);
|
||||
return NULL;
|
||||
}
|
||||
|
||||
tf->texrender = texrender_create(GS_RGBA, GS_ZS_NONE);
|
||||
|
||||
gs_leavecontext();
|
||||
|
||||
return tf;
|
||||
}
|
||||
|
||||
void test_destroy(struct test_filter *tf)
|
||||
static void filter_render(struct test_filter *tf, effect_t effect)
|
||||
{
|
||||
if (tf) {
|
||||
gs_entercontext(obs_graphics());
|
||||
|
||||
effect_destroy(tf->whatever);
|
||||
texrender_destroy(tf->texrender);
|
||||
bfree(tf);
|
||||
|
||||
gs_leavecontext();
|
||||
}
|
||||
obs_source_process_filter(tf->source, tf->whatever, 0, 0, GS_RGBA,
|
||||
ALLOW_DIRECT_RENDERING);
|
||||
}
|
||||
|
||||
uint32_t test_get_output_flags(struct test_filter *tf)
|
||||
{
|
||||
return SOURCE_VIDEO;
|
||||
}
|
||||
|
||||
void test_video_tick(struct test_filter *tf, float seconds)
|
||||
{
|
||||
texrender_reset(tf->texrender);
|
||||
}
|
||||
|
||||
void test_video_render(struct test_filter *tf)
|
||||
{
|
||||
obs_source_process_filter(tf->source, tf->texrender, tf->whatever,
|
||||
0, 0, ALLOW_DIRECT_RENDERING);
|
||||
}
|
||||
struct obs_source_info test_filter = {
|
||||
.id = "test_filter",
|
||||
.type = OBS_SOURCE_TYPE_FILTER,
|
||||
.output_flags = OBS_SOURCE_VIDEO,
|
||||
.getname = filter_getname,
|
||||
.create = filter_create,
|
||||
.destroy = filter_destroy,
|
||||
.video_render = filter_render
|
||||
};
|
||||
|
@@ -1,26 +0,0 @@
|
||||
#pragma once
|
||||
|
||||
#include <obs.h>
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
struct test_filter {
|
||||
obs_source_t source;
|
||||
effect_t whatever;
|
||||
texrender_t texrender;
|
||||
};
|
||||
|
||||
EXPORT const char *test_getname(const char *locale);
|
||||
|
||||
EXPORT struct test_filter *test_create(const char *settings, obs_source_t source);
|
||||
EXPORT void test_destroy(struct test_filter *rt);
|
||||
EXPORT uint32_t test_get_output_flags(struct test_filter *rt);
|
||||
|
||||
EXPORT void test_video_tick(struct test_filter *rt, float seconds);
|
||||
EXPORT void test_video_render(struct test_filter *rt);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
@@ -1,15 +0,0 @@
|
||||
#pragma once
|
||||
|
||||
#include <util/c99defs.h>
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
EXPORT uint32_t module_version(uint32_t in_version);
|
||||
EXPORT bool enum_inputs(size_t idx, const char **name);
|
||||
EXPORT bool enum_filters(size_t idx, const char **name);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
@@ -1,35 +1,24 @@
|
||||
#include <obs.h>
|
||||
#include "test-input-exports.h"
|
||||
#include <obs-module.h>
|
||||
|
||||
OBS_DECLARE_MODULE()
|
||||
|
||||
extern struct obs_source_info test_random;
|
||||
extern struct obs_source_info test_sinewave;
|
||||
extern struct obs_source_info test_filter;
|
||||
|
||||
const char *inputs[] = {
|
||||
#ifdef __APPLE__
|
||||
"osx_desktop_test",
|
||||
extern struct obs_source_info osx_desktop;
|
||||
#endif
|
||||
"random",
|
||||
"sinewave"
|
||||
};
|
||||
|
||||
const char *filters[] = {"test"};
|
||||
|
||||
uint32_t module_version(uint32_t in_version)
|
||||
bool obs_module_load(uint32_t libobs_version)
|
||||
{
|
||||
return LIBOBS_API_VER;
|
||||
}
|
||||
obs_register_source(&test_random);
|
||||
obs_register_source(&test_sinewave);
|
||||
obs_register_source(&test_filter);
|
||||
|
||||
bool enum_inputs(size_t idx, const char **name)
|
||||
{
|
||||
if (idx >= (sizeof(inputs)/sizeof(const char*)))
|
||||
return false;
|
||||
#ifdef __APPLE__
|
||||
obs_register_source(&osx_desktop);
|
||||
#endif
|
||||
|
||||
*name = inputs[idx];
|
||||
return true;
|
||||
}
|
||||
|
||||
bool enum_filters(size_t idx, const char **name)
|
||||
{
|
||||
if (idx >= (sizeof(filters)/sizeof(const char*)))
|
||||
return false;
|
||||
|
||||
*name = filters[idx];
|
||||
return true;
|
||||
}
|
||||
|
@@ -1,12 +1,29 @@
|
||||
#include <stdlib.h>
|
||||
#include "test-random.h"
|
||||
#include <obs.h>
|
||||
|
||||
const char *random_getname(const char *locale)
|
||||
struct random_tex {
|
||||
texture_t texture;
|
||||
};
|
||||
|
||||
static const char *random_getname(const char *locale)
|
||||
{
|
||||
return "20x20 Random Pixel Texture Source (Test)";
|
||||
}
|
||||
|
||||
struct random_tex *random_create(const char *settings, obs_source_t source)
|
||||
static void random_destroy(struct random_tex *rt)
|
||||
{
|
||||
if (rt) {
|
||||
gs_entercontext(obs_graphics());
|
||||
|
||||
texture_destroy(rt->texture);
|
||||
bfree(rt);
|
||||
|
||||
gs_leavecontext();
|
||||
}
|
||||
}
|
||||
|
||||
static struct random_tex *random_create(obs_data_t settings,
|
||||
obs_source_t source)
|
||||
{
|
||||
struct random_tex *rt = bzalloc(sizeof(struct random_tex));
|
||||
uint32_t *pixels = bmalloc(20*20*4);
|
||||
@@ -39,38 +56,31 @@ struct random_tex *random_create(const char *settings, obs_source_t source)
|
||||
return rt;
|
||||
}
|
||||
|
||||
void random_destroy(struct random_tex *rt)
|
||||
static void random_video_render(struct random_tex *rt, effect_t effect)
|
||||
{
|
||||
if (rt) {
|
||||
gs_entercontext(obs_graphics());
|
||||
|
||||
texture_destroy(rt->texture);
|
||||
bfree(rt);
|
||||
|
||||
gs_leavecontext();
|
||||
}
|
||||
}
|
||||
|
||||
uint32_t random_get_output_flags(struct random_tex *rt)
|
||||
{
|
||||
return SOURCE_VIDEO | SOURCE_DEFAULT_EFFECT;
|
||||
}
|
||||
|
||||
void random_video_render(struct random_tex *rt, obs_source_t filter_target)
|
||||
{
|
||||
effect_t effect = gs_geteffect();
|
||||
eparam_t diffuse = effect_getparambyname(effect, "diffuse");
|
||||
|
||||
effect_settexture(effect, diffuse, rt->texture);
|
||||
eparam_t image = effect_getparambyname(effect, "image");
|
||||
effect_settexture(effect, image, rt->texture);
|
||||
gs_draw_sprite(rt->texture, 0, 0, 0);
|
||||
}
|
||||
|
||||
uint32_t random_getwidth(struct random_tex *rt)
|
||||
static uint32_t random_getwidth(struct random_tex *rt)
|
||||
{
|
||||
return texture_getwidth(rt->texture);
|
||||
}
|
||||
|
||||
uint32_t random_getheight(struct random_tex *rt)
|
||||
static uint32_t random_getheight(struct random_tex *rt)
|
||||
{
|
||||
return texture_getheight(rt->texture);
|
||||
}
|
||||
|
||||
struct obs_source_info test_random = {
|
||||
.id = "random",
|
||||
.type = OBS_SOURCE_TYPE_INPUT,
|
||||
.output_flags = OBS_SOURCE_VIDEO,
|
||||
.getname = random_getname,
|
||||
.create = random_create,
|
||||
.destroy = random_destroy,
|
||||
.video_render = random_video_render,
|
||||
.getwidth = random_getwidth,
|
||||
.getheight = random_getheight
|
||||
};
|
||||
|
@@ -1,28 +0,0 @@
|
||||
#pragma once
|
||||
|
||||
#include <obs.h>
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
struct random_tex {
|
||||
texture_t texture;
|
||||
};
|
||||
|
||||
EXPORT const char *random_getname(const char *locale);
|
||||
|
||||
EXPORT struct random_tex *random_create(const char *settings,
|
||||
obs_source_t source);
|
||||
EXPORT void random_destroy(struct random_tex *rt);
|
||||
EXPORT uint32_t random_get_output_flags(struct random_tex *rt);
|
||||
|
||||
EXPORT void random_video_render(struct random_tex *rt,
|
||||
obs_source_t filter_target);
|
||||
|
||||
EXPORT uint32_t random_getwidth(struct random_tex *rt);
|
||||
EXPORT uint32_t random_getheight(struct random_tex *rt);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
@@ -1,8 +1,18 @@
|
||||
#include <math.h>
|
||||
#include "test-sinewave.h"
|
||||
#include <util/bmem.h>
|
||||
#include <util/threading.h>
|
||||
#include <util/platform.h>
|
||||
#include <obs.h>
|
||||
|
||||
struct sinewave_data {
|
||||
bool initialized_thread;
|
||||
pthread_t thread;
|
||||
event_t event;
|
||||
obs_source_t source;
|
||||
};
|
||||
|
||||
/* middle C */
|
||||
const double rate = 261.63/48000.0;
|
||||
static const double rate = 261.63/48000.0;
|
||||
|
||||
#define M_PI 3.1415926535897932384626433832795
|
||||
#define M_PI_X2 M_PI*2
|
||||
@@ -45,12 +55,27 @@ static void *sinewave_thread(void *pdata)
|
||||
|
||||
/* ------------------------------------------------------------------------- */
|
||||
|
||||
const char *sinewave_getname(const char *locale)
|
||||
static const char *sinewave_getname(const char *locale)
|
||||
{
|
||||
return "Sinewave Sound Source (Test)";
|
||||
}
|
||||
|
||||
struct sinewave_data *sinewave_create(const char *settings, obs_source_t source)
|
||||
static void sinewave_destroy(struct sinewave_data *swd)
|
||||
{
|
||||
if (swd) {
|
||||
if (swd->initialized_thread) {
|
||||
void *ret;
|
||||
event_signal(&swd->event);
|
||||
pthread_join(swd->thread, &ret);
|
||||
}
|
||||
|
||||
event_destroy(&swd->event);
|
||||
bfree(swd);
|
||||
}
|
||||
}
|
||||
|
||||
static struct sinewave_data *sinewave_create(obs_data_t settings,
|
||||
obs_source_t source)
|
||||
{
|
||||
struct sinewave_data *swd = bzalloc(sizeof(struct sinewave_data));
|
||||
swd->source = source;
|
||||
@@ -68,21 +93,11 @@ fail:
|
||||
return NULL;
|
||||
}
|
||||
|
||||
void sinewave_destroy(struct sinewave_data *swd)
|
||||
{
|
||||
if (swd) {
|
||||
if (swd->initialized_thread) {
|
||||
void *ret;
|
||||
event_signal(&swd->event);
|
||||
pthread_join(swd->thread, &ret);
|
||||
}
|
||||
|
||||
event_destroy(&swd->event);
|
||||
bfree(swd);
|
||||
}
|
||||
}
|
||||
|
||||
uint32_t sinewave_get_output_flags(struct sinewave_data *swd)
|
||||
{
|
||||
return SOURCE_AUDIO;
|
||||
}
|
||||
struct obs_source_info test_sinewave = {
|
||||
.id = "test_sinewave",
|
||||
.type = OBS_SOURCE_TYPE_INPUT,
|
||||
.output_flags = OBS_SOURCE_AUDIO,
|
||||
.getname = sinewave_getname,
|
||||
.create = sinewave_create,
|
||||
.destroy = sinewave_destroy,
|
||||
};
|
||||
|
@@ -1,28 +0,0 @@
|
||||
#pragma once
|
||||
|
||||
#include <util/bmem.h>
|
||||
#include <util/threading.h>
|
||||
#include <util/platform.h>
|
||||
#include <obs.h>
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
struct sinewave_data {
|
||||
bool initialized_thread;
|
||||
pthread_t thread;
|
||||
event_t event;
|
||||
obs_source_t source;
|
||||
};
|
||||
|
||||
EXPORT const char *sinewave_getname(const char *locale);
|
||||
|
||||
EXPORT struct sinewave_data *sinewave_create(const char *settings,
|
||||
obs_source_t source);
|
||||
EXPORT void sinewave_destroy(struct sinewave_data *swd);
|
||||
EXPORT uint32_t sinewave_get_output_flags(struct sinewave_data *swd);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
@@ -110,7 +110,8 @@ static HWND CreateTestWindow(HINSTANCE instance)
|
||||
if (!RegisterClass(&wc))
|
||||
return 0;
|
||||
|
||||
return CreateWindow(TEXT("bla"), TEXT("bla"), WS_OVERLAPPEDWINDOW|WS_VISIBLE,
|
||||
return CreateWindow(TEXT("bla"), TEXT("bla"),
|
||||
WS_OVERLAPPEDWINDOW|WS_VISIBLE,
|
||||
1920/2 - cx/2, 1080/2 - cy/2, cx, cy,
|
||||
NULL, NULL, instance, NULL);
|
||||
}
|
||||
@@ -139,14 +140,14 @@ int WINAPI WinMain(HINSTANCE instance, HINSTANCE prevInstance, LPSTR cmdLine,
|
||||
|
||||
/* ------------------------------------------------------ */
|
||||
/* create source */
|
||||
SourceContext source = obs_source_create(SOURCE_INPUT,
|
||||
SourceContext source = obs_source_create(OBS_SOURCE_TYPE_INPUT,
|
||||
"random", "some randon source", NULL);
|
||||
if (!source)
|
||||
throw "Couldn't create random test source";
|
||||
|
||||
/* ------------------------------------------------------ */
|
||||
/* create filter */
|
||||
SourceContext filter = obs_source_create(SOURCE_FILTER,
|
||||
SourceContext filter = obs_source_create(OBS_SOURCE_TYPE_FILTER,
|
||||
"test", "a nice little green filter", NULL);
|
||||
if (!filter)
|
||||
throw "Couldn't create test filter";
|
||||
|
Reference in New Issue
Block a user