X-Git-Url: https://git.cinelerra-gg.org/git/?a=blobdiff_plain;f=cinelerra-5.1%2Fcinelerra%2Fpluginclient.h;h=50d50608f27ab584f75520243fc72b634a28d284;hb=83b70dd60863377cb281e6be5206304e10373e30;hp=67a1148f6de91ce04c3bcf1abbab3e785bc37f69;hpb=0e6cf5b52d1ebce9272270144bcf43df4683507e;p=goodguy%2Fcinelerra.git diff --git a/cinelerra-5.1/cinelerra/pluginclient.h b/cinelerra-5.1/cinelerra/pluginclient.h index 67a1148f..50d50608 100644 --- a/cinelerra-5.1/cinelerra/pluginclient.h +++ b/cinelerra-5.1/cinelerra/pluginclient.h @@ -24,7 +24,7 @@ // Base class inherited by all the different types of plugins. -#define MAX_FRAME_BUFFER 1024 +#define MAX_FRAME_BUFFER 8192 class PluginClient; @@ -107,34 +107,26 @@ PluginClientWindow* plugin_class::new_window() \ #define LOAD_CONFIGURATION_MACRO(plugin_class, config_class) \ int plugin_class::load_configuration() \ { \ - KeyFrame *prev_keyframe, *next_keyframe; \ - prev_keyframe = get_prev_keyframe(get_source_position()); \ - next_keyframe = get_next_keyframe(get_source_position()); \ - \ - int64_t next_position = edl_to_local(next_keyframe->position); \ + KeyFrame * prev_keyframe = get_prev_keyframe(get_source_position()); \ int64_t prev_position = edl_to_local(prev_keyframe->position); \ - \ config_class old_config, prev_config, next_config; \ old_config.copy_from(config); \ read_data(prev_keyframe); \ prev_config.copy_from(config); \ - read_data(next_keyframe); \ - next_config.copy_from(config); \ - \ - config.interpolate(prev_config, \ - next_config, \ - (next_position == prev_position) ? \ - get_source_position() : \ - prev_position, \ - (next_position == prev_position) ? \ - get_source_position() + 1 : \ - next_position, \ - get_source_position()); \ + KeyFrame * next_keyframe = get_next_keyframe(get_source_position()); \ + if( next_keyframe ) { \ + int64_t next_position = edl_to_local(next_keyframe->position); \ + read_data(next_keyframe); \ + next_config.copy_from(config); \ \ - if(!config.equivalent(old_config)) \ - return 1; \ - else \ - return 0; \ + config.interpolate(prev_config, next_config, \ + (next_position == prev_position) ? \ + get_source_position() : prev_position, \ + (next_position == prev_position) ? \ + get_source_position() + 1 : next_position, \ + get_source_position()); \ + } \ + return !config.equivalent(old_config) ? 1 : 0; \ } @@ -381,7 +373,7 @@ public: // console. This gets a keyframe from the EDL, with the position set to the // EDL tracking position. int send_configure_change(); - + virtual void span_keyframes(KeyFrame *src, int64_t start, int64_t end); // Called from process_buffer // Returns 1 if a GUI is open so OpenGL routines can determine if @@ -426,6 +418,7 @@ public: // Plugin must call this before performing OpenGL operations. // Returns 1 if the user supports opengl buffers. int get_use_opengl(); + int to_ram(VFrame *vframe); // Get total tracks to process int get_total_buffers(); @@ -486,6 +479,7 @@ public: // GUI updating wrappers for realtime plugins // Append frame to queue for next send_frame_buffer void add_gui_frame(PluginClientFrame *frame); + int get_gui_frames(); virtual void render_gui(void *data); virtual void render_gui(void *data, int size); @@ -499,7 +493,8 @@ public: void reset_plugin_gui_frames(); void plugin_reset_gui_frames(); void plugin_render_gui_frames(PluginClientFrames *frames); - int get_gui_frames(); +// first frame ready + int pending_gui_frame(); // Called by client to get the total number of frames to draw in update_gui int pending_gui_frames(); // pop frames until buffer passes position=pos(-1 or seconds) in direction=dir(-1,0,1) @@ -577,7 +572,7 @@ public: PluginClientThread *thread; // Frames for updating GUI - PluginClientFrames frame_buffer; + PluginClientFrames client_frames; // Time of last GUI update Timer *update_timer;