]> git.sesse.net Git - nageru/commitdiff
Make the Mixer own the resource pool, as we will be getting more chains.
authorSteinar H. Gunderson <sgunderson@bigfoot.com>
Sun, 4 Oct 2015 23:09:27 +0000 (01:09 +0200)
committerSteinar H. Gunderson <sgunderson@bigfoot.com>
Sun, 4 Oct 2015 23:09:27 +0000 (01:09 +0200)
mixer.cpp
mixer.h

index a68114b767d781d96f3bf4be164134532a0e8fdf..544e00bbf4c7ceb096be33739361c159fb9ba86a 100644 (file)
--- a/mixer.cpp
+++ b/mixer.cpp
@@ -57,7 +57,8 @@ Mixer::Mixer(const QSurfaceFormat &format)
        CHECK(init_movit(MOVIT_SHADER_DIR, MOVIT_DEBUG_OFF));
        check_error();
 
-       chain.reset(new EffectChain(WIDTH, HEIGHT));
+       resource_pool.reset(new ResourcePool);
+       chain.reset(new EffectChain(WIDTH, HEIGHT, resource_pool.get()));
        check_error();
 
        ImageFormat inout_format;
@@ -133,7 +134,6 @@ Mixer::Mixer(const QSurfaceFormat &format)
        //chain->enable_phase_timing(true);
 
        // Set up stuff for NV12 conversion.
-       resource_pool = chain->get_resource_pool();
 
        // Cb/Cr shader.
        string cbcr_vert_shader = read_file("vs-cbcr.130.vert");
diff --git a/mixer.h b/mixer.h
index a04bafe6e2753559f2f483e6f9750d0d9a0d5445..ff029a976459958a325dd2e35e9d28a8464fdabc 100644 (file)
--- a/mixer.h
+++ b/mixer.h
@@ -55,8 +55,8 @@ private:
        void subsample_chroma(GLuint src_tex, GLuint dst_dst);
 
        QSurface *mixer_surface, *h264_encoder_surface;
+       std::unique_ptr<movit::ResourcePool> resource_pool;
        std::unique_ptr<movit::EffectChain> chain;
-       movit::ResourcePool *resource_pool;  // Owned by <chain>.
        GLuint cbcr_program_num;  // Owned by <resource_pool>.
        std::unique_ptr<H264Encoder> h264_encoder;