luaL_testudata(L, idx, "MixEffect")) {
return (Effect *)lua_touserdata(L, idx);
}
luaL_testudata(L, idx, "MixEffect")) {
return (Effect *)lua_touserdata(L, idx);
}
Theme *theme = get_theme_updata(L);
EffectChain *chain = (EffectChain *)luaL_checkudata(L, 1, "EffectChain");
Theme *theme = get_theme_updata(L);
EffectChain *chain = (EffectChain *)luaL_checkudata(L, 1, "EffectChain");
- return wrap_lua_object<LiveInputWrapper>(L, "LiveInputWrapper", theme, chain);
+ bool override_bounce = checkbool(L, 2);
+ return wrap_lua_object<LiveInputWrapper>(L, "LiveInputWrapper", theme, chain, override_bounce);
bool is_main_chain = checkbool(L, 2);
// Add outputs as needed.
bool is_main_chain = checkbool(L, 2);
// Add outputs as needed.
output_ycbcr_format.chroma_subsampling_x = 1;
output_ycbcr_format.chroma_subsampling_y = 1;
output_ycbcr_format.luma_coefficients = YCBCR_REC_709;
output_ycbcr_format.full_range = false;
output_ycbcr_format.chroma_subsampling_x = 1;
output_ycbcr_format.chroma_subsampling_y = 1;
output_ycbcr_format.luma_coefficients = YCBCR_REC_709;
output_ycbcr_format.full_range = false;
chain->add_ycbcr_output(inout_format, OUTPUT_ALPHA_FORMAT_POSTMULTIPLIED, output_ycbcr_format, YCBCR_OUTPUT_SPLIT_Y_AND_CBCR);
chain->set_dither_bits(8);
chain->add_ycbcr_output(inout_format, OUTPUT_ALPHA_FORMAT_POSTMULTIPLIED, output_ycbcr_format, YCBCR_OUTPUT_SPLIT_Y_AND_CBCR);
chain->set_dither_bits(8);
const char* cstr = lua_tolstring(L, 2, &len);
std::string key(cstr, len);
float value = luaL_checknumber(L, 3);
const char* cstr = lua_tolstring(L, 2, &len);
std::string key(cstr, len);
float value = luaL_checknumber(L, 3);
- (void)effect->set_float(key, value);
+ if (!effect->set_float(key, value)) {
+ luaL_error(L, "Effect refused set_float(\"%s\", %d) (invalid key?)", cstr, int(value));
+ }
const char* cstr = lua_tolstring(L, 2, &len);
std::string key(cstr, len);
float value = luaL_checknumber(L, 3);
const char* cstr = lua_tolstring(L, 2, &len);
std::string key(cstr, len);
float value = luaL_checknumber(L, 3);
- (void)effect->set_int(key, value);
+ if (!effect->set_int(key, value)) {
+ luaL_error(L, "Effect refused set_int(\"%s\", %d) (invalid key?)", cstr, int(value));
+ }
v[1] = luaL_checknumber(L, 4);
v[2] = luaL_checknumber(L, 5);
v[3] = luaL_checknumber(L, 6);
v[1] = luaL_checknumber(L, 4);
v[2] = luaL_checknumber(L, 5);
v[3] = luaL_checknumber(L, 6);
- (void)effect->set_vec4(key, v);
+ if (!effect->set_vec4(key, v)) {
+ luaL_error(L, "Effect refused set_vec4(\"%s\", %f, %f, %f, %f) (invalid key?)", cstr,
+ v[0], v[1], v[2], v[3]);
+ }
: theme(theme)
{
ImageFormat inout_format;
inout_format.color_space = COLORSPACE_sRGB;
inout_format.gamma_curve = GAMMA_sRGB;
: theme(theme)
{
ImageFormat inout_format;
inout_format.color_space = COLORSPACE_sRGB;
inout_format.gamma_curve = GAMMA_sRGB;
+ // The Blackmagic driver docs claim that the device outputs Y'CbCr
+ // according to Rec. 601, but practical testing indicates it definitely
+ // is Rec. 709 (at least up to errors attributable to rounding errors).
+ // Perhaps 601 was only to indicate the subsampling positions, not the
+ // colorspace itself? Tested with a Lenovo X1 gen 3 as input.
YCbCrFormat input_ycbcr_format;
input_ycbcr_format.chroma_subsampling_x = 2;
input_ycbcr_format.chroma_subsampling_y = 1;
YCbCrFormat input_ycbcr_format;
input_ycbcr_format.chroma_subsampling_x = 2;
input_ycbcr_format.chroma_subsampling_y = 1;
input_ycbcr_format.cr_x_position = 0.0;
input_ycbcr_format.cb_y_position = 0.5;
input_ycbcr_format.cr_y_position = 0.5;
input_ycbcr_format.cr_x_position = 0.0;
input_ycbcr_format.cb_y_position = 0.5;
input_ycbcr_format.cr_y_position = 0.5;
- input = new YCbCrInput(inout_format, input_ycbcr_format, WIDTH, HEIGHT, YCBCR_INPUT_SPLIT_Y_AND_CBCR);
+ if (override_bounce) {
+ input = new NonBouncingYCbCrInput(inout_format, input_ycbcr_format, WIDTH, HEIGHT, YCBCR_INPUT_SPLIT_Y_AND_CBCR);
+ } else {
+ input = new YCbCrInput(inout_format, input_ycbcr_format, WIDTH, HEIGHT, YCBCR_INPUT_SPLIT_Y_AND_CBCR);
+ }
register_class("EffectChain", EffectChain_funcs);
register_class("LiveInputWrapper", LiveInputWrapper_funcs);
register_class("WhiteBalanceEffect", WhiteBalanceEffect_funcs);
register_class("EffectChain", EffectChain_funcs);
register_class("LiveInputWrapper", LiveInputWrapper_funcs);
register_class("WhiteBalanceEffect", WhiteBalanceEffect_funcs);
luaL_newmetatable(L, class_name);
lua_pushlightuserdata(L, this);
luaL_setfuncs(L, funcs, 1);
lua_pushvalue(L, -1);
lua_setfield(L, -2, "__index");
lua_setglobal(L, class_name);
luaL_newmetatable(L, class_name);
lua_pushlightuserdata(L, this);
luaL_setfuncs(L, funcs, 1);
lua_pushvalue(L, -1);
lua_setfield(L, -2, "__index");
lua_setglobal(L, class_name);
}
pair<EffectChain *, function<void()>>
Theme::get_chain(unsigned num, float t, unsigned width, unsigned height)
{
unique_lock<mutex> lock(m);
}
pair<EffectChain *, function<void()>>
Theme::get_chain(unsigned num, float t, unsigned width, unsigned height)
{
unique_lock<mutex> lock(m);
return make_pair(chain, [this, funcref]{
unique_lock<mutex> lock(m);
return make_pair(chain, [this, funcref]{
unique_lock<mutex> lock(m);
fprintf(stderr, "error running chain setup callback: %s\n", lua_tostring(L, -1));
exit(1);
}
fprintf(stderr, "error running chain setup callback: %s\n", lua_tostring(L, -1));
exit(1);
}
fprintf(stderr, "error running function `transition_clicked': %s\n", lua_tostring(L, -1));
exit(1);
}
fprintf(stderr, "error running function `transition_clicked': %s\n", lua_tostring(L, -1));
exit(1);
}
fprintf(stderr, "error running function `channel_clicked': %s\n", lua_tostring(L, -1));
exit(1);
}
fprintf(stderr, "error running function `channel_clicked': %s\n", lua_tostring(L, -1));
exit(1);
}