adjust file locations to be more portable

This commit is contained in:
jp9000
2013-11-01 14:33:00 -07:00
parent a6a6118c04
commit 8847d11e8e
30 changed files with 340 additions and 53 deletions

View File

@@ -1,12 +1,21 @@
INCLUDES = -iquote$(top_srcdir)/libobs
lib_LTLIBRARIES = libtest-input.la
if OS_WIN
if ARCH_X86
libtestdir = ../../build/plugins/32bit
else
libtestdir = ../../build/plugins/64bit
endif
else
libtestdir = $(libdir)/obs-plugins
endif
pkglib_LTLIBRARIES = libtest-input.la
libtest_input_la_LDFLAGS = -no-undefined
if OS_WIN
libtest_input_la_LDFLAGS += -avoid-version
endif
libtest_input_la_LIBADD = $(top_srcdir)/libobs/libobs.la
libtest_input_la_SOURCES = test-filter.c \
test-input.c \

View File

@@ -3,12 +3,16 @@
struct test_filter *test_create(const char *settings, obs_source_t source)
{
struct test_filter *tf = bmalloc(sizeof(struct test_filter));
char *effect_file;
memset(tf, 0, sizeof(struct test_filter));
gs_entercontext(obs_graphics());
effect_file = obs_find_plugin_file("test-input/test.effect");
tf->source = source;
tf->whatever = gs_create_effect_from_file("test.effect", NULL);
tf->whatever = gs_create_effect_from_file(effect_file, NULL);
bfree(effect_file);
if (!tf->whatever) {
test_destroy(tf);
return NULL;

View File

@@ -5,6 +5,7 @@ struct random_tex *random_create(const char *settings, obs_source_t source)
{
struct random_tex *rt = bmalloc(sizeof(struct random_tex));
uint32_t *pixels = bmalloc(20*20*4);
char *effect_file;
size_t x, y;
memset(rt, 0, sizeof(struct random_tex));
@@ -31,7 +32,10 @@ struct random_tex *random_create(const char *settings, obs_source_t source)
return NULL;
}
rt->whatever = gs_create_effect_from_file("draw.effect", NULL);
effect_file = obs_find_plugin_file("test-input/draw.effect");
rt->whatever = gs_create_effect_from_file(effect_file, NULL);
bfree(effect_file);
if (!rt->whatever) {
random_destroy(rt);
return NULL;