Made renderer structure private, update Makefile, closes #130
This commit is contained in:
21
Makefile
21
Makefile
@@ -1,4 +1,4 @@
|
||||
.PHONY: all install clean ninja build
|
||||
.PHONY: all install clean ninja
|
||||
|
||||
# In case these were specified explicitly as options instead of environment variables, export them to child processes
|
||||
export DESTDIR
|
||||
@@ -11,17 +11,17 @@ MESON_CONF = $(BUILD_DIR) -Ddisable_obs=true --prefix /usr
|
||||
# Support assigning standalone/debug builds as the old Makefile did, otherwise complain
|
||||
|
||||
ifneq ($(BUILD),debug)
|
||||
MESON_CONF += --buildtype=release
|
||||
MESON_CONF += --buildtype=release
|
||||
ifdef BUILD
|
||||
@echo "WARNING: ignoring build option '$(BUILD)' in compatibility Makefile"
|
||||
$(warning WARNING: ignoring build option '$(BUILD)' in compatibility Makefile)
|
||||
endif
|
||||
endif
|
||||
|
||||
ifeq ($(INSTALL),standalone)
|
||||
MESON_CONF += -Dstandalone=true
|
||||
MESON_CONF += -Dstandalone=true
|
||||
else
|
||||
ifdef INSTALL
|
||||
@echo "WARNING: ignoring install option '$(INSTALL)' in compatibility Makefile"
|
||||
$(warning WARNING: ignoring install option '$(INSTALL)' in compatibility Makefile)
|
||||
endif
|
||||
endif
|
||||
|
||||
@@ -31,18 +31,13 @@ STATE = $(BUILD),$(INSTALL),$(PYTHON),$(CC),$(CFLAGS),$(DESTDIR)
|
||||
$(shell if [[ ! -e build_state ]]; then touch build_state; fi)
|
||||
$(shell if [ '$(STATE)' != "`cat build_state`" ]; then echo '$(STATE)' > build_state; fi)
|
||||
|
||||
ifndef BUILD
|
||||
@echo ""
|
||||
@echo "PACKAGE MAINTAINER NOTICE: Configuring release build for compatibility with old makefile."
|
||||
@echo " Some new features may be missing."
|
||||
@echo " If you are a package maintainer consider using meson directly!"
|
||||
@echo ""
|
||||
endif
|
||||
|
||||
all: ninja
|
||||
|
||||
# Rebuild if the makefile state changes to maintain old behaviour and smooth rebuilds with altered parameters
|
||||
build: build_state
|
||||
$(warning !!PACKAGE MAINTAINER NOTICE!!)
|
||||
$(warning Configuring build for compatibility with old makefile. Some new features may be missing.)
|
||||
$(warning If you are a package maintainer consider using meson directly!)
|
||||
@rm -rf $(BUILD_DIR)
|
||||
meson $(BUILD_DIR)
|
||||
meson configure $(MESON_CONF)
|
||||
|
||||
@@ -4,7 +4,9 @@
|
||||
#include <util/threading.h>
|
||||
#include <util/platform.h>
|
||||
|
||||
#pragma GCC visibility push(default)
|
||||
OBS_DECLARE_MODULE();
|
||||
#pragma GCC visibility pop
|
||||
|
||||
struct mod_state {
|
||||
obs_source_t* source;
|
||||
@@ -52,7 +54,7 @@ static void* create(obs_data_t* settings, obs_source_t* source) {
|
||||
return s;
|
||||
}
|
||||
|
||||
struct obs_source_info glava_src = {
|
||||
static struct obs_source_info glava_src = {
|
||||
.id = "glava",
|
||||
.type = OBS_SOURCE_TYPE_INPUT,
|
||||
.output_flags = OBS_SOURCE_ASYNC_VIDEO,
|
||||
@@ -61,7 +63,7 @@ struct obs_source_info glava_src = {
|
||||
.destroy = destroy
|
||||
};
|
||||
|
||||
bool obs_module_load(void) {
|
||||
__attribute__((visibility("default"))) bool obs_module_load(void) {
|
||||
obs_register_source(&glava_src);
|
||||
return true;
|
||||
}
|
||||
|
||||
@@ -234,8 +234,6 @@ static struct option p_opts[] = {
|
||||
{0, 0, 0, 0 }
|
||||
};
|
||||
|
||||
static glava_renderer* rd = NULL;
|
||||
|
||||
#define append_buf(buf, sz_store, ...) \
|
||||
({ \
|
||||
buf = realloc(buf, ++(*sz_store) * sizeof(*buf)); \
|
||||
@@ -256,6 +254,10 @@ __attribute__((visibility("default"))) void glava_wait(glava_handle* ref) {
|
||||
pthread_mutex_unlock(&(*ref)->lock);
|
||||
}
|
||||
|
||||
__attribute__((visibility("default"))) int glava_tex(glava_handle r) {
|
||||
return r->off_tex;
|
||||
}
|
||||
|
||||
/* Atomic size request */
|
||||
__attribute__((visibility("default"))) void glava_sizereq(glava_handle r, int x, int y, int w, int h) {
|
||||
r->sizereq = (typeof(r->sizereq)) { .x = x, .y = y, .w = w, .h = h };
|
||||
@@ -468,7 +470,7 @@ __attribute__((visibility("default"))) void glava_entry(int argc, char** argv, g
|
||||
}
|
||||
|
||||
instantiate: {}
|
||||
rd = rd_new(system_shader_paths, entry, (const char**) requests,
|
||||
glava_renderer* rd = rd_new(system_shader_paths, entry, (const char**) requests,
|
||||
backend, binds, stdin_type, desktop, verbose, test);
|
||||
if (ret)
|
||||
__atomic_store_n(ret, rd, __ATOMIC_SEQ_CST);
|
||||
|
||||
@@ -9,21 +9,7 @@
|
||||
#define GLAVA_REQ_RESIZE 1
|
||||
|
||||
struct gl_data;
|
||||
|
||||
typedef struct glava_renderer {
|
||||
volatile bool alive;
|
||||
bool mirror_input;
|
||||
size_t bufsize_request, rate_request, samplesize_request;
|
||||
char* audio_source_request;
|
||||
int off_tex; /* final GL texture for offscreen rendering */
|
||||
pthread_mutex_t lock; /* lock for reading from offscreen texture */
|
||||
pthread_cond_t cond; /* cond for reading from offscreen texture */
|
||||
volatile struct {
|
||||
int x, y, w, h;
|
||||
} sizereq;
|
||||
volatile int sizereq_flag;
|
||||
struct gl_data* gl;
|
||||
} glava_renderer;
|
||||
struct glava_renderer;
|
||||
|
||||
/* External API */
|
||||
|
||||
@@ -36,5 +22,6 @@ __attribute__((visibility("default"))) void glava_terminate
|
||||
__attribute__((visibility("default"))) void glava_reload (glava_handle* ref);
|
||||
__attribute__((visibility("default"))) void glava_sizereq (glava_handle r, int x, int y, int w, int h);
|
||||
__attribute__((visibility("default"))) void glava_wait (glava_handle* ref);
|
||||
__attribute__((visibility("default"))) int glava_tex (glava_handle r);
|
||||
|
||||
#endif /* _GLAVA_H */
|
||||
|
||||
@@ -7,6 +7,21 @@
|
||||
#include <pthread.h>
|
||||
#include "glava.h"
|
||||
|
||||
typedef struct glava_renderer {
|
||||
volatile bool alive;
|
||||
bool mirror_input;
|
||||
size_t bufsize_request, rate_request, samplesize_request;
|
||||
char* audio_source_request;
|
||||
int off_tex; /* final GL texture for offscreen rendering */
|
||||
pthread_mutex_t lock; /* lock for reading from offscreen texture */
|
||||
pthread_cond_t cond; /* cond for reading from offscreen texture */
|
||||
volatile struct {
|
||||
int x, y, w, h;
|
||||
} sizereq;
|
||||
volatile int sizereq_flag;
|
||||
struct gl_data* gl;
|
||||
} glava_renderer;
|
||||
|
||||
extern const struct {
|
||||
const char* n;
|
||||
int i;
|
||||
|
||||
Reference in New Issue
Block a user