2 #include "edlsession.h"
3 #include "pluginserver.h"
4 #include "pluginvclient.h"
9 PluginVClient::PluginVClient(PluginServer *server)
10 : PluginClient(server)
17 project_frame_rate = server->edl->session->frame_rate;
20 PluginVClient::~PluginVClient()
24 int PluginVClient::is_video()
30 // Run before every realtime buffer is to be rendered.
31 int PluginVClient::get_render_ptrs()
33 int i, j, double_buffer, fragment_position;
35 for(i = 0; i < total_in_buffers; i++)
37 double_buffer = double_buffer_in_render.values[i];
38 fragment_position = offset_in_render.values[i];
39 input_ptr_render[i] = &input_ptr_master.values[i][double_buffer][fragment_position];
42 for(i = 0; i < total_out_buffers; i++)
44 double_buffer = double_buffer_out_render.values[i];
45 fragment_position = offset_out_render.values[i];
46 output_ptr_render[i] = &output_ptr_master.values[i][double_buffer][fragment_position];
51 // Run after the non realtime plugin is run.
52 int PluginVClient::delete_nonrealtime_parameters()
56 for(i = 0; i < total_in_buffers; i++)
58 for(j = 0; j < in_buffer_size; j++)
60 delete video_in[i][j];
64 for(i = 0; i < total_out_buffers; i++)
66 for(j = 0; j < out_buffer_size; j++)
68 delete video_out[i][j];
77 int PluginVClient::init_realtime_parameters()
79 project_frame_rate = server->edl->session->frame_rate;
80 project_color_model = server->edl->session->color_model;
81 aspect_w = server->edl->session->aspect_w;
82 aspect_h = server->edl->session->aspect_h;
87 void PluginVClient::plugin_process_realtime(VFrame **input,
89 int64_t current_position,
92 this->source_position = current_position;
93 this->total_len = total_len;
95 //printf("PluginVClient::plugin_process_realtime 1\n");
97 process_realtime(input, output);
99 process_realtime(input[0], output[0]);
100 //printf("PluginVClient::plugin_process_realtime 2\n");
103 void PluginVClient::plugin_render_gui(void *data)
108 void PluginVClient::send_render_gui(void *data)
110 //printf("PluginVClient::send_render_gui 1\n");
111 server->send_render_gui(data);
114 int PluginVClient::plugin_process_loop(VFrame **buffers, int64_t &write_length)
118 if(is_multichannel())
119 result = process_loop(buffers);
121 result = process_loop(buffers[0]);
130 int PluginVClient::read_frame(VFrame *buffer, int channel, int64_t start_position)
132 return server->read_frame(buffer, channel, start_position);
135 int PluginVClient::read_frame(VFrame *buffer, int64_t start_position)
137 return server->read_frame(buffer, 0, start_position);