X-Git-Url: https://git.sesse.net/?a=blobdiff_plain;f=nageru%2Ftheme.cpp;h=a88c6f61c70034bcf1c104804852b1e5364aaeca;hb=f34a3e1bbc207541842e0b54d5418d95bafc8e5b;hp=bb7613c9871e71df19db23feb39baccabf6ae993;hpb=ecaec75dd52d076ba53cafa1fed716ebc0d93da6;p=nageru diff --git a/nageru/theme.cpp b/nageru/theme.cpp index bb7613c..a88c6f6 100644 --- a/nageru/theme.cpp +++ b/nageru/theme.cpp @@ -260,9 +260,9 @@ void add_outputs_and_finalize(EffectChain *chain, bool is_main_chain) } output_ycbcr_format.full_range = false; - output_ycbcr_format.num_levels = 1 << global_flags.x264_bit_depth; + output_ycbcr_format.num_levels = 1 << global_flags.bit_depth; - GLenum type = global_flags.x264_bit_depth > 8 ? GL_UNSIGNED_SHORT : GL_UNSIGNED_BYTE; + GLenum type = global_flags.bit_depth > 8 ? GL_UNSIGNED_SHORT : GL_UNSIGNED_BYTE; chain->add_ycbcr_output(inout_format, OUTPUT_ALPHA_FORMAT_POSTMULTIPLIED, output_ycbcr_format, YCBCR_OUTPUT_SPLIT_Y_AND_CBCR, type); @@ -272,7 +272,7 @@ void add_outputs_and_finalize(EffectChain *chain, bool is_main_chain) if (global_flags.use_zerocopy) { chain->add_ycbcr_output(inout_format, OUTPUT_ALPHA_FORMAT_POSTMULTIPLIED, output_ycbcr_format, YCBCR_OUTPUT_INTERLEAVED, type); // Add a copy where we'll only be using the Y component. } - chain->set_dither_bits(global_flags.x264_bit_depth > 8 ? 16 : 8); + chain->set_dither_bits(global_flags.bit_depth > 8 ? 16 : 8); chain->set_output_origin(OUTPUT_ORIGIN_TOP_LEFT); } else { chain->add_output(inout_format, OUTPUT_ALPHA_FORMAT_POSTMULTIPLIED); @@ -308,7 +308,7 @@ int EffectChain_add_live_input(lua_State* L) EffectChain *chain = (EffectChain *)luaL_checkudata(L, 1, "EffectChain"); bool override_bounce = checkbool(L, 2); bool deinterlace = checkbool(L, 3); - bmusb::PixelFormat pixel_format = global_flags.ten_bit_input ? bmusb::PixelFormat_10BitYCbCr : bmusb::PixelFormat_8BitYCbCr; + bmusb::PixelFormat pixel_format = global_flags.bit_depth > 8 ? bmusb::PixelFormat_10BitYCbCr : bmusb::PixelFormat_8BitYCbCr; // Needs to be nonowned to match add_video_input (see below). return wrap_lua_object_nonowned(L, "LiveInputWrapper", theme, chain, pixel_format, override_bounce, deinterlace, /*user_connectable=*/true); @@ -2128,3 +2128,15 @@ string Theme::format_status_line(const string &disk_space_left_text, double file assert(lua_gettop(L) == 0); return text; } + +void Theme::remove_card(unsigned card_index) +{ + lock_guard lock(map_m); + for (auto it = signal_to_card_mapping.begin(); it != signal_to_card_mapping.end(); ) { + if (it->second == int(card_index)) { + it = signal_to_card_mapping.erase(it); + } else { + ++it; + } + } +}