CXXFLAGS ?= -O2 -g -Wall # Will be overridden by environment.
CXXFLAGS += -std=gnu++11 -fPIC $(shell pkg-config --cflags $(PKG_MODULES)) -pthread -DMOVIT_SHADER_DIR=\"$(shell pkg-config --variable=shaderdir movit)\" -Idecklink/
-CEF_DIR=/home/sesse/nmu/cef_binary_3.3282.1734.g8f26fe0_linux64
+# Override CEF_DIR on the command line to build with CEF.
+# E.g.: make CEF_DIR=/home/sesse/cef_binary_3.3282.1734.g8f26fe0_linux64
+CEF_DIR=
CEF_BUILD_TYPE=Release
-CEF_LIBS=$(CEF_DIR)/$(CEF_BUILD_TYPE)/libcef.so $(CEF_DIR)/libcef_dll_wrapper/libcef_dll_wrapper.a
-CPPFLAGS += -DHAVE_CEF=1 -I$(CEF_DIR) -I$(CEF_DIR)/include
-LDFLAGS += -L$(CEF_DIR)/$(CEF_BUILD_TYPE) -Wl,-rpath $(CEF_DIR)/$(CEF_BUILD_TYPE)
+ifneq ($(CEF_DIR),)
+ CEF_LIBS=$(CEF_DIR)/$(CEF_BUILD_TYPE)/libcef.so $(CEF_DIR)/libcef_dll_wrapper/libcef_dll_wrapper.a
+ CPPFLAGS += -DHAVE_CEF=1 -I$(CEF_DIR) -I$(CEF_DIR)/include
+ LDFLAGS += -L$(CEF_DIR)/$(CEF_BUILD_TYPE) -Wl,-rpath $(CEF_DIR)/$(CEF_BUILD_TYPE)
+endif
ifeq ($(EMBEDDED_BMUSB),yes)
CPPFLAGS += -Ibmusb/
# FFmpeg input
OBJS += ffmpeg_capture.o
-# CEF input
-OBJS += nageru_cef_app.o cef_capture.o
+ifneq ($(CEF_DIR),)
+ # CEF input
+ OBJS += nageru_cef_app.o cef_capture.o
+endif
# Benchmark program.
BM_OBJS = benchmark_audio_mixer.o $(AUDIO_MIXER_OBJS) flags.o metrics.o
midi_mapping_dialog.o: ui_midi_mapping.h midi_mapping.pb.h
mixer.o: json.pb.h
+# CEF wrapper library; typically not built as part of the binary distribution.
$(CEF_DIR)/libcef_dll_wrapper/libcef_dll_wrapper.a: $(CEF_DIR)/Makefile
cd $(CEF_DIR) && $(MAKE) libcef_dll_wrapper
#include <QSurfaceFormat>
#include <string>
+#ifdef HAVE_CEF
#include <cef_app.h>
#include <cef_browser.h>
#include <cef_client.h>
#include <cef_version.h>
+#endif
#include "basic_stats.h"
+#ifdef HAVE_CEF
#include "nageru_cef_app.h"
+#endif
#include "context.h"
#include "flags.h"
#include "image_input.h"
#include "mainwindow.h"
#include "mixer.h"
+#ifdef HAVE_CEF
CefRefPtr<NageruCefApp> cef_app;
+#endif
int main(int argc, char *argv[])
{
#include "basic_stats.h"
#include "bmusb/bmusb.h"
#include "bmusb/fake_capture.h"
+#ifdef HAVE_CEF
#include "cef_capture.h"
+#endif
#include "chroma_subsampler.h"
#include "context.h"
#include "decklink_capture.h"
}
num_video_inputs = video_inputs.size();
+#ifdef HAVE_CEF
// Same, for HTML inputs.
std::vector<CEFCapture *> html_inputs = theme->get_html_inputs();
for (unsigned html_card_index = 0; html_card_index < html_inputs.size(); ++card_index, ++html_card_index) {
html_inputs[html_card_index]->set_card_index(card_index);
}
num_html_inputs = html_inputs.size();
+#endif
BMUSBCapture::set_card_connected_callback(bind(&Mixer::bm_hotplug_add, this, _1));
BMUSBCapture::start_bm_thread();
for (const pair<LiveInputWrapper *, FFmpegCapture *> &conn : theme->get_video_signal_connections()) {
conn.first->connect_signal_raw(conn.second->get_card_index(), input_state);
}
+#ifdef HAVE_CEF
for (const pair<LiveInputWrapper *, CEFCapture *> &conn : theme->get_html_signal_connections()) {
conn.first->connect_signal_raw(conn.second->get_card_index(), input_state);
}
+#endif
// If HDMI/SDI output is active and the user has requested auto mode,
// its mode overrides the existing Y'CbCr setting for the chain.
#include <utility>
#include "defs.h"
+#ifdef HAVE_CEF
#include "cef_capture.h"
+#endif
#include "ffmpeg_capture.h"
#include "flags.h"
#include "image_input.h"
return ret;
}
+#ifdef HAVE_CEF
int EffectChain_add_html_input(lua_State* L)
{
assert(lua_gettop(L) == 2);
}
return ret;
}
+#endif
int EffectChain_add_effect(lua_State* L)
{
int HTMLInput_new(lua_State* L)
{
+#ifdef HAVE_CEF
assert(lua_gettop(L) == 1);
string url = checkstdstring(L, 1);
int ret = wrap_lua_object_nonowned<CEFCapture>(L, "HTMLInput", url, global_flags.width, global_flags.height);
theme->register_html_input(*capture);
}
return ret;
+#else
+ fprintf(stderr, "This version of Nageru has been compiled without CEF support.\n");
+ fprintf(stderr, "HTMLInput is not available.\n");
+ exit(1);
+#endif
}
+#ifdef HAVE_CEF
int HTMLInput_set_url(lua_State* L)
{
assert(lua_gettop(L) == 2);
lua_pushnumber(L, -1 - (*video_input)->get_card_index());
return 1;
}
+#endif
int WhiteBalanceEffect_new(lua_State* L)
{
{ "__gc", EffectChain_gc },
{ "add_live_input", EffectChain_add_live_input },
{ "add_video_input", EffectChain_add_video_input },
+#ifdef HAVE_CEF
{ "add_html_input", EffectChain_add_html_input },
+#endif
{ "add_effect", EffectChain_add_effect },
{ "finalize", EffectChain_finalize },
{ NULL, NULL }
const luaL_Reg HTMLInput_funcs[] = {
{ "new", HTMLInput_new },
+#ifdef HAVE_CEF
{ "set_url", HTMLInput_set_url },
{ "reload", HTMLInput_reload },
{ "set_max_fps", HTMLInput_set_max_fps },
{ "execute_javascript_async", HTMLInput_execute_javascript_async },
{ "get_signal_num", HTMLInput_get_signal_num },
+#endif
{ NULL, NULL }
};
return video_inputs;
}
+#ifdef HAVE_CEF
// Should be called as part of HTMLInput.new() only.
void register_html_input(CEFCapture *capture)
{
{
return html_inputs;
}
+#endif
void register_video_signal_connection(LiveInputWrapper *live_input, FFmpegCapture *capture)
{
return video_signal_connections;
}
+#ifdef HAVE_CEF
void register_html_signal_connection(LiveInputWrapper *live_input, CEFCapture *capture)
{
html_signal_connections.emplace_back(live_input, capture);
{
return html_signal_connections;
}
+#endif
private:
void register_constants();
std::vector<FFmpegCapture *> video_inputs;
std::vector<std::pair<LiveInputWrapper *, FFmpegCapture *>> video_signal_connections;
+#ifdef HAVE_CEF
std::vector<CEFCapture *> html_inputs;
std::vector<std::pair<LiveInputWrapper *, CEFCapture *>> html_signal_connections;
+#endif
friend class LiveInputWrapper;
};