3 #include "edlsession.h"
6 #include "pluginserver.h"
7 #include "preferences.h"
8 #include "recordablevtracks.h"
9 #include "mainsession.h"
12 #include "vpluginarray.h"
15 VPluginArray::VPluginArray()
21 VPluginArray::~VPluginArray()
23 file->stop_video_thread();
24 for(int i = 0; i < total_tracks(); i++)
31 void VPluginArray::get_recordable_tracks()
33 tracks = new RecordableVTracks(mwindow->edl->tracks);
36 int64_t VPluginArray::get_bufsize()
41 void VPluginArray::create_buffers()
43 file->start_video_thread(buffer_size,
44 mwindow->edl->session->color_model,
47 // if(!plugin_server->realtime) realtime_buffers = file->get_video_buffer();
50 void VPluginArray::create_modules()
52 modules = new Module*[total_tracks()];
53 for(int i = 0; i < total_tracks(); i++)
55 modules[i] = new VModule(0, 0, this, tracks->values[i]);
56 modules[i]->cache = cache;
57 modules[i]->edl = edl;
58 modules[i]->create_objects();
59 modules[i]->render_init();
63 void VPluginArray::load_module(int module, int64_t input_position, int64_t len)
65 //printf("VPluginArray::load_module 1 %d\n", module);
66 if(module == 0) realtime_buffers = file->get_video_buffer();
67 //printf("VPluginArray::load_module 1 %d\n", module);
68 ((VModule*)modules[module])->render(realtime_buffers[module][0],
71 //printf("VPluginArray::load_module 2\n");
74 void VPluginArray::process_realtime(int module, int64_t input_position, int64_t len)
76 // Convert from array of frames to array of tracks
78 temp_buffer = new VFrame*[total_tracks()];
79 for(int i = 0; i < total_tracks(); i++)
81 temp_buffer[i] = realtime_buffers[i][0];
83 values[module]->process_realtime(&temp_buffer[module],
84 realtime_buffers[module],
87 delete [] temp_buffer;
90 int VPluginArray::process_loop(int module, int64_t &write_length)
92 if(!realtime_buffers) realtime_buffers = file->get_video_buffer();
94 // Convert from array of frames to array of tracks
96 temp_buffer = new VFrame*[total_tracks()];
97 for(int i = 0; i < total_tracks(); i++)
99 temp_buffer[i] = realtime_buffers[i][0];
102 int result = values[module]->process_loop(realtime_buffers[module], write_length);
103 delete [] temp_buffer;
107 int VPluginArray::write_buffers(int64_t len)
109 int result = file->write_video_buffer(len);
110 realtime_buffers = 0;
112 // if(!plugin_server->realtime && !done && !result) realtime_buffers = file->get_video_buffer();
117 int VPluginArray::total_tracks()
119 return tracks->total;
122 Track* VPluginArray::track_number(int number)
124 return (Track*)tracks->values[number];