X-Git-Url: https://git.cinelerra-gg.org/git/?p=goodguy%2Fcinelerra.git;a=blobdiff_plain;f=cinelerra-5.1%2Fcinelerra%2Fpluginserver.C;h=8ea9140d10e8930c5fadea849e1c4b67185a0502;hp=cf40152a86e6da4312b1b596422c4439ea1394db;hb=68769997ebe94917d42cf5b6d45e1c2a83292d25;hpb=2d6e0243914af46dbc07eb91aeb951630d71adf4 diff --git a/cinelerra-5.1/cinelerra/pluginserver.C b/cinelerra-5.1/cinelerra/pluginserver.C index cf40152a..8ea9140d 100644 --- a/cinelerra-5.1/cinelerra/pluginserver.C +++ b/cinelerra-5.1/cinelerra/pluginserver.C @@ -508,7 +508,10 @@ void PluginServer::process_transition(VFrame *input, int64_t total_len) { if( !plugin_open ) return; + if (total_len == 0) return; PluginVClient *vclient = (PluginVClient*)client; + to_ram(input); + to_ram(output); vclient->source_position = current_position; vclient->source_start = 0; @@ -659,7 +662,6 @@ void PluginServer::render_gui(void *data, int size) PluginGUIs::PluginGUIs(MWindow *mwindow) { this->mwindow = mwindow; - this->next_id = 0; } PluginGUIs::~PluginGUIs() { @@ -667,7 +669,7 @@ PluginGUIs::~PluginGUIs() void PluginGUIs::append(PluginServer *server) { - server->gui_id = next_id++; + server->gui_id = EDL::next_id(); ArrayList::append(server); } @@ -1002,6 +1004,15 @@ int PluginServer::get_use_opengl() return use_opengl; } +int PluginServer::to_ram(VFrame *vframe) +{ + if( vframe->get_opengl_state() == VFrame::RAM ) return 0; + if( !vdevice ) return -1; + VDeviceX11 *vdevice_x11 = (VDeviceX11*) vdevice->get_output_base(); + int vw = vframe->get_w(), vh = vframe->get_h(); + vdevice_x11->do_camera(vframe, vframe, 0,0,vw,vh, 0,0,vw,vh); // copy to ram + return 1; +} void PluginServer::run_opengl(PluginClient *plugin_client) { @@ -1017,7 +1028,7 @@ void PluginServer::get_defaults_path(char *path) switch( plugin_type ) { case PLUGIN_TYPE_FFMPEG: case PLUGIN_TYPE_LV2: - strcpy(string2, client->plugin_title()); + strcpy(string2, title); break; case PLUGIN_TYPE_BUILTIN: case PLUGIN_TYPE_LADSPA: @@ -1163,16 +1174,28 @@ KeyFrame* PluginServer::get_keyframe() } -void PluginServer::apply_keyframe(KeyFrame *src) -{ - Plugin *plugin = edl->tracks->plugin_exists(plugin_id); - if( !plugin ) - keyframe->copy_data(src); - else if( plugin->is_transition() ) - plugin->get_keyframe()->copy_data(src); - else -// Span keyframes - plugin->keyframes->update_parameter(src); +void PluginServer::apply_keyframe(Plugin *plugin, KeyFrame *src) +{ + KeyFrame* dst = !plugin ? keyframe : + plugin->is_transition() ? plugin->get_keyframe() : 0; + if( !dst ) { + if( edl->session->span_keyframes ) { + double selection_start = edl->local_session->get_selectionstart(0); + double selection_end = edl->local_session->get_selectionend(0); + selection_start = edl->align_to_frame(selection_start, 0); + selection_end = edl->align_to_frame(selection_end, 0); + Track *track = plugin->track; + int64_t start = track->to_units(selection_start, 1); + int64_t end = track->to_units(selection_end, 1); + if( start != end ) { + client->span_keyframes(src, start, end); + return; + } + } + dst = get_keyframe(); + } + if( dst ) + dst->copy_data(src); }