}
}
-static void dispose_pixel_pointers( mlt_service service, mlt_frame frame )
+static void dispose_pixel_pointers( GlslChain *chain, mlt_service service, mlt_frame frame )
{
if ( service == (mlt_service) -1 ) {
mlt_producer producer = mlt_producer_cut_parent( mlt_frame_get_original_producer( frame ) );
+ MltInput* input = (MltInput *) chain->effects[ MLT_PRODUCER_SERVICE( producer ) ];
+ input->invalidate_pixel_data();
mlt_pool_release( GlslManager::get_input_pixel_pointer( producer, frame ) );
return;
}
mlt_service input_a = GlslManager::get_effect_input( service, frame );
- dispose_pixel_pointers( input_a, frame );
+ dispose_pixel_pointers( chain, input_a, frame );
mlt_service input_b;
mlt_frame frame_b;
GlslManager::get_effect_secondary_input( service, frame, &input_b, &frame_b );
if ( input_b ) {
- dispose_pixel_pointers( input_b, frame_b );
+ dispose_pixel_pointers( chain, input_b, frame_b );
}
}
error = movit_render( chain->effect_chain, frame, format, output_format, width, height, image );
- dispose_pixel_pointers( leaf_service, frame );
+ dispose_pixel_pointers( chain, leaf_service, frame );
}
// If we've been asked to render some frame directly to a texture (without any
ycbcr->set_pixel_data(2, &data[m_width * m_height + (m_width / m_ycbcr_format.chroma_subsampling_x * m_height / m_ycbcr_format.chroma_subsampling_y)]);
}
}
+
+void MltInput::invalidate_pixel_data()
+{
+ assert(input);
+ if (isRGB) {
+ FlatInput* flat = (FlatInput*) input;
+ flat->invalidate_pixel_data();
+ } else {
+ YCbCrInput* ycbcr = (YCbCrInput*) input;
+ ycbcr->invalidate_pixel_data();
+ }
+}
void useFlatInput(MovitPixelFormat pix_fmt, unsigned width, unsigned height);
void useYCbCrInput(const ImageFormat& image_format, const YCbCrFormat& ycbcr_format, unsigned width, unsigned height);
void set_pixel_data(const unsigned char* data);
+ void invalidate_pixel_data();
private:
unsigned m_width, m_height;