X-Git-Url: https://git.cinelerra-gg.org/git/?a=blobdiff_plain;f=cinelerra-5.1%2Fplugins%2Fcrikey%2Fcrikey.C;h=2cfa5dc4029df825e2052c90aa8897dd9aadc9aa;hb=3d5faf45a6c261bb3e9973b42cf682415a1fde2e;hp=2f22fed98adf620db3442ef8221a76c8e42b2bb9;hpb=7fd85fb66168f6b518c5f2d73e04036e87faa0e1;p=goodguy%2Fcinelerra.git diff --git a/cinelerra-5.1/plugins/crikey/crikey.C b/cinelerra-5.1/plugins/crikey/crikey.C index 2f22fed9..2cfa5dc4 100644 --- a/cinelerra-5.1/plugins/crikey/crikey.C +++ b/cinelerra-5.1/plugins/crikey/crikey.C @@ -27,6 +27,7 @@ #include "bccmodels.h" #include "bccolors.h" #include "clip.h" +#include "edl.h" #include "edlsession.h" #include "filexml.h" #include "crikey.h" @@ -212,7 +213,7 @@ void FillRegion::run() if( edge_pixel(lofs) ) break; } int rofs = ofs; - for( int i=rt; ++i< w; rt=i,msk[rofs]=0 ) { + for( int i=rt; ++i< w; ) { if( !msk[++rofs] ) break; msk[rofs] = 0; rt = i; if( edge_pixel(rofs) ) break; @@ -263,7 +264,7 @@ LOAD_CONFIGURATION_MACRO(CriKey, CriKeyConfig) int CriKey::new_point() { - EDLSession *session = get_edlsession(); + EDLSession *session = get_edl()->session; float x = !session ? 0.f : session->output_w / 2.f; float y = !session ? 0.f : session->output_h / 2.f; return config.add_point(-1, 0, x, y, 0.5f); @@ -334,11 +335,12 @@ void CriKey::read_data(KeyFrame *keyframe) void CriKey::update_gui() { if( !thread ) return; - if( !load_configuration() ) return; thread->window->lock_window("CriKey::update_gui"); CriKeyWindow *window = (CriKeyWindow*)thread->window; - window->update_gui(); - window->flush(); + if( load_configuration() ) { + window->update_gui(); + window->flush(); + } thread->window->unlock_window(); } @@ -569,14 +571,6 @@ void CriKey::draw_point(VFrame *src, CriKeyPoint *pt) } -static void get_vframe(VFrame *&vfrm, int w, int h, int color_model) -{ - if( vfrm && ( vfrm->get_w() != w || vfrm->get_h() != h ) ) { - delete vfrm; vfrm = 0; - } - if( !vfrm ) vfrm = new VFrame(w, h, color_model, 0); -} - static void fill_edge(VFrame *vfrm, int w, int h) { int w1 = w-1, h1 = h-1; @@ -598,14 +592,14 @@ int CriKey::process_buffer(VFrame *frame, int64_t start_position, double frame_r if( comp > 3 ) comp = 3; read_frame(src, 0, start_position, frame_rate, 0); - get_vframe(edg, w, h, BC_A_FLOAT); + VFrame::get_temp(edg, w, h, BC_A_FLOAT); if( !engine ) engine = new CriKeyEngine(this, PluginClient::get_project_smp() + 1, PluginClient::get_project_smp() + 1); - get_vframe(msk, w, h, BC_A8); + VFrame::get_temp(msk, w, h, BC_A8); memset(msk->get_data(), 0xff, msk->get_data_size()); for( int i=0, n=config.points.size(); i