]> git.sesse.net Git - nageru/commitdiff
Fix a 1280x720 hardcoding, replacing it by another one.
authorSteinar H. Gunderson <sgunderson@bigfoot.com>
Mon, 10 Dec 2018 21:06:27 +0000 (22:06 +0100)
committerSteinar H. Gunderson <sgunderson@bigfoot.com>
Mon, 10 Dec 2018 21:06:27 +0000 (22:06 +0100)
futatabi/video_stream.cpp
futatabi/ycbcr_converter.cpp
futatabi/ycbcr_converter.h

index 1957d8410d7a514618a9e51ad345ee933724d9ee..87e843ae1e8d61ea7bdd8ae5e9c6822fe304e22b 100644 (file)
@@ -447,7 +447,7 @@ void VideoStream::schedule_interpolated_frame(steady_clock::time_point local_pts
                shared_ptr<Frame> 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);
index 694ba97eb06531fc4b6d882df93f9aa06d4b4c0f..a8a40b123c805b83db0bafa28a013f255f9a2693 100644 (file)
@@ -141,7 +141,7 @@ EffectChain *YCbCrConverter::prepare_chain_for_fade(shared_ptr<Frame> frame, sha
        return fade_chain.chain.get();
 }
 
-EffectChain *YCbCrConverter::prepare_chain_for_fade_from_texture(GLuint tex, std::shared_ptr<Frame> secondary_frame, float fade_alpha)
+EffectChain *YCbCrConverter::prepare_chain_for_fade_from_texture(GLuint tex, unsigned width, unsigned height, std::shared_ptr<Frame> 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);
index 459377c3f19103134db8145ed65d049b0f28e496..4618f1e9d51bee6fb0e41b4f63b75f3a6ad05567 100644 (file)
@@ -30,7 +30,7 @@ public:
        movit::EffectChain *prepare_chain_for_fade(std::shared_ptr<Frame> frame, std::shared_ptr<Frame> secondary_frame, float fade_alpha);
 
        // <tex> must be interleaved Y'CbCr.
-       movit::EffectChain *prepare_chain_for_fade_from_texture(GLuint tex, std::shared_ptr<Frame> secondary_frame, float fade_alpha);
+       movit::EffectChain *prepare_chain_for_fade_from_texture(GLuint tex, unsigned width, unsigned height, std::shared_ptr<Frame> secondary_frame, float fade_alpha);
 
 private:
        movit::YCbCrFormat ycbcr_format;