#include <movit/init.h>
#include <movit/util.h>
#include <movit/effect_chain.h>
+#include <movit/resource_pool.h>
#include "mlt_movit_input.h"
#include "mlt_flip_effect.h"
#include <mlt++/MltEvent.h>
GlslManager::GlslManager()
: Mlt::Filter( mlt_filter_new() )
+ , resource_pool(new ResourcePool())
, pbo(0)
, initEvent(0)
, closeEvent(0)
GLsync sync = (GLsync) syncs_to_delete.pop_front();
glDeleteSync( sync );
}
+ delete resource_pool;
}
void GlslManager::add_ref(mlt_properties properties)
class Effect;
class EffectChain;
class MltInput;
+class ResourcePool;
struct GlslChain
{
glsl_pbo get_pbo(int size);
void cleanupContext();
+ ResourcePool* get_resource_pool() { return resource_pool; }
+
static void set_chain(mlt_service, GlslChain*);
static GlslChain* get_chain(mlt_service);
static void onClose( mlt_properties owner, GlslManager* filter );
static void onServiceChanged( mlt_properties owner, mlt_service service );
static void onPropertyChanged( mlt_properties owner, mlt_service service, const char* property );
+ ResourcePool* resource_pool;
Mlt::Deque fbo_list;
Mlt::Deque texture_list;
Mlt::Deque syncs_to_delete;
mlt_log_debug( leaf_service, "=== CREATING NEW CHAIN (old chain=%p, leaf=%p, fingerprint=%s) ===\n", chain, leaf_service, new_fingerprint.c_str() );
mlt_profile profile = mlt_service_profile( leaf_service );
chain = new GlslChain;
- chain->effect_chain = new EffectChain( profile->display_aspect_num, profile->display_aspect_den );
+ chain->effect_chain = new EffectChain(
+ profile->display_aspect_num,
+ profile->display_aspect_den,
+ GlslManager::get_instance()->get_resource_pool()
+ );
chain->fingerprint = new_fingerprint;
build_movit_chain( leaf_service, frame, chain );
, needs_mipmaps(false)
, input(0)
, isRGB(true)
+ , m_chain(NULL)
{
register_int("output_linear_gamma", &output_linear_gamma);
register_int("needs_mipmaps", &needs_mipmaps);
bool ok = input->set_int("output_linear_gamma", output_linear_gamma);
ok |= input->set_int("needs_mipmaps", needs_mipmaps);
assert(ok);
+ input->inform_added(m_chain);
input->finalize();
}
Effect::AlphaHandling alpha_handling() const;
std::string output_fragment_shader();
void set_gl_state(GLuint glsl_program_num, const std::string& prefix, unsigned *sampler_num);
+ void inform_added(EffectChain *chain) { m_chain = chain; }
// Input ovverrides
void finalize();
Input *input;
bool isRGB;
YCbCrFormat m_ycbcr_format;
+ EffectChain *m_chain;
};
#endif // MLT_MOVIT_INPUT_H