r753: Add raise_window() commands when making various windows
[cinelerra_cv/mob.git] / cinelerra / pluginvclient.h
blob775e20b4e1376875b3f967b51f5cf35a96ceb695
1 #ifndef PLUGINVCLIENT_H
2 #define PLUGINVCLIENT_H
5 #include "maxbuffers.h"
6 #include "pluginclient.h"
7 #include "vframe.inc"
10 // Maximum dimensions for a temporary frame a plugin should retain between
11 // process_buffer calls. This allows memory conservation.
12 #define PLUGIN_MAX_W 2000
13 #define PLUGIN_MAX_H 1000
17 class PluginVClient : public PluginClient
19 public:
20 PluginVClient(PluginServer *server);
21 virtual ~PluginVClient();
23 int get_render_ptrs();
24 int init_realtime_parameters();
25 int delete_nonrealtime_parameters();
26 int is_video();
27 // Replaced by pull method
29 * void plugin_process_realtime(VFrame **input,
30 * VFrame **output,
31 * int64_t current_position,
32 * int64_t total_len);
34 // Multichannel buffer process for backwards compatibility
35 virtual int process_realtime(VFrame **input,
36 VFrame **output);
37 // Single channel buffer process for backwards compatibility and transitions
38 virtual int process_realtime(VFrame *input,
39 VFrame *output);
41 // Process buffer using pull method. By default this loads the input into *frame
42 // and calls process_realtime with input and output pointing to frame.
43 // start_position - requested position relative to frame rate. Relative
44 // to start of EDL. End of buffer if reverse.
45 // sample_rate - scale of start_position.
46 // These should return 1 if error or 0 if success.
47 virtual int process_buffer(VFrame **frame,
48 int64_t start_position,
49 double frame_rate);
50 virtual int process_buffer(VFrame *frame,
51 int64_t start_position,
52 double frame_rate);
54 // Called by plugin server to render the GUI with rendered data.
55 void plugin_render_gui(void *data);
56 virtual void render_gui(void *data) { };
57 // Called by client to cause GUI to be rendered with data.
58 void send_render_gui(void *data);
59 virtual int process_loop(VFrame **buffers) { return 1; };
60 virtual int process_loop(VFrame *buffer) { return 1; };
61 int plugin_process_loop(VFrame **buffers, int64_t &write_length);
63 int plugin_start_loop(int64_t start,
64 int64_t end,
65 int64_t buffer_size,
66 int total_buffers);
67 int plugin_get_parameters();
69 // Called by non-realtime client to read frame for processing.
70 // buffer - output frame
71 // channel - channel of the plugin input for a multichannel plugin
72 // start_position - start of frame in forward. end of frame in reverse.
73 // Relative to start of EDL.
74 int read_frame(VFrame *buffer,
75 int channel,
76 int64_t start_position);
77 int read_frame(VFrame *buffer,
78 int64_t start_position);
80 // Called by realtime plugin to read frame from previous entity
81 // framerate - framerate start_position is relative to. Used by preceeding plugiun
82 // to calculate output frame number. Provided so the client can get data
83 // at a higher fidelity than provided by the EDL.
84 // start_position - start of frame in forward. end of frame in reverse.
85 // Relative to start of EDL.
86 // frame_rate - frame rate position is scaled to
87 int read_frame(VFrame *buffer,
88 int channel,
89 int64_t start_position,
90 double frame_rate);
92 // Called by user to allocate the temporary for the current process_buffer.
93 // It may be deleted after the process_buffer to conserve memory.
94 VFrame* new_temp(int w, int h, int color_model);
95 // Called by PluginServer after process_buffer to delete the temp if it's too
96 // large.
97 void age_temp();
99 // Frame rate relative to EDL
100 double get_project_framerate();
101 // Frame rate requested
102 double get_framerate();
104 int64_t local_to_edl(int64_t position);
105 int64_t edl_to_local(int64_t position);
107 // Non realtime buffer pointers
108 // Channels of arrays of frames that the client uses.
109 VFrame ***video_in, ***video_out;
111 // point to the start of the buffers
112 ArrayList<VFrame***> input_ptr_master;
113 ArrayList<VFrame***> output_ptr_master;
114 // Pointers to the regions for a single render.
115 // Arrays are channels of arrays of frames.
116 VFrame ***input_ptr_render;
117 VFrame ***output_ptr_render;
119 // Frame rate of EDL
120 double project_frame_rate;
121 // Local parameters set by non realtime plugin about the file to be generated.
122 // Retrieved by server to set output file format.
123 // In realtime plugins, these are set before every process_buffer as the
124 // requested rates.
125 double frame_rate;
126 int project_color_model;
127 int use_float; // Whether user wants floating point calculations.
128 int use_alpha; // Whether user wants alpha calculations.
129 int use_interpolation; // Whether user wants pixel interpolation.
130 float aspect_w, aspect_h; // Aspect ratio
132 // Tempo
133 VFrame *temp;
138 #endif