From 5c1bc79d6c26c96cb8d2195ae8ef457c30ed364a Mon Sep 17 00:00:00 2001 From: "Steinar H. Gunderson" Date: Mon, 10 Dec 2018 22:06:27 +0100 Subject: [PATCH] Fix a 1280x720 hardcoding, replacing it by another one. --- futatabi/video_stream.cpp | 2 +- futatabi/ycbcr_converter.cpp | 6 +++--- futatabi/ycbcr_converter.h | 2 +- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/futatabi/video_stream.cpp b/futatabi/video_stream.cpp index 1957d84..87e843a 100644 --- a/futatabi/video_stream.cpp +++ b/futatabi/video_stream.cpp @@ -447,7 +447,7 @@ void VideoStream::schedule_interpolated_frame(steady_clock::time_point local_pts shared_ptr frame2 = decode_jpeg_with_cache(secondary_frame, DECODE_IF_NOT_IN_CACHE, &frame_reader, &did_decode); // Then fade against it, putting it into the fade Y' and CbCr textures. - ycbcr_semiplanar_converter->prepare_chain_for_fade_from_texture(qf.output_tex, frame2, fade_alpha)->render_to_fbo(resources->fade_fbo, 1280, 720); + ycbcr_semiplanar_converter->prepare_chain_for_fade_from_texture(qf.output_tex, 1280, 720, frame2, fade_alpha)->render_to_fbo(resources->fade_fbo, 1280, 720); // Subsample and split Cb/Cr. chroma_subsampler->subsample_chroma(resources->fade_cbcr_output_tex, 1280, 720, resources->cb_tex, resources->cr_tex); diff --git a/futatabi/ycbcr_converter.cpp b/futatabi/ycbcr_converter.cpp index 694ba97..a8a40b1 100644 --- a/futatabi/ycbcr_converter.cpp +++ b/futatabi/ycbcr_converter.cpp @@ -141,7 +141,7 @@ EffectChain *YCbCrConverter::prepare_chain_for_fade(shared_ptr frame, sha return fade_chain.chain.get(); } -EffectChain *YCbCrConverter::prepare_chain_for_fade_from_texture(GLuint tex, std::shared_ptr secondary_frame, float fade_alpha) +EffectChain *YCbCrConverter::prepare_chain_for_fade_from_texture(GLuint tex, unsigned width, unsigned height, std::shared_ptr secondary_frame, float fade_alpha) { const FadeChain &fade_chain = interleaved_fade_chains[secondary_frame->is_semiplanar]; { @@ -150,8 +150,8 @@ EffectChain *YCbCrConverter::prepare_chain_for_fade_from_texture(GLuint tex, std format_copy.chroma_subsampling_y = 1; fade_chain.input[0]->change_ycbcr_format(format_copy); - fade_chain.input[0]->set_width(1280); // FIXME - fade_chain.input[0]->set_height(720); + fade_chain.input[0]->set_width(width); // Doesn't really matter. + fade_chain.input[0]->set_height(height); fade_chain.input[0]->set_texture_num(0, tex); glTextureParameteri(tex, GL_TEXTURE_MIN_FILTER, GL_LINEAR); diff --git a/futatabi/ycbcr_converter.h b/futatabi/ycbcr_converter.h index 459377c..4618f1e 100644 --- a/futatabi/ycbcr_converter.h +++ b/futatabi/ycbcr_converter.h @@ -30,7 +30,7 @@ public: movit::EffectChain *prepare_chain_for_fade(std::shared_ptr frame, std::shared_ptr secondary_frame, float fade_alpha); // must be interleaved Y'CbCr. - movit::EffectChain *prepare_chain_for_fade_from_texture(GLuint tex, std::shared_ptr secondary_frame, float fade_alpha); + movit::EffectChain *prepare_chain_for_fade_from_texture(GLuint tex, unsigned width, unsigned height, std::shared_ptr secondary_frame, float fade_alpha); private: movit::YCbCrFormat ycbcr_format; -- 2.39.2