X-Git-Url: http://git.cinelerra-gg.org/git/?p=goodguy%2Fhistory.git;a=blobdiff_plain;f=cinelerra-5.1%2Fcinelerra%2Fvattachmentpoint.C;h=9ee8fe35b814b4873dc1dee5368b210d9a26b753;hp=062db5bb826567ff27ff2d9f1782c8253a1529f6;hb=48c313de28fe6d39d9431dbe2dca6ffb176541ff;hpb=30bdb85eb33a8ee7ba675038a86c6be59c43d7bd diff --git a/cinelerra-5.1/cinelerra/vattachmentpoint.C b/cinelerra-5.1/cinelerra/vattachmentpoint.C index 062db5bb..9ee8fe35 100644 --- a/cinelerra-5.1/cinelerra/vattachmentpoint.C +++ b/cinelerra-5.1/cinelerra/vattachmentpoint.C @@ -2,21 +2,21 @@ /* * CINELERRA * Copyright (C) 2008 Adam Williams - * + * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. - * + * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. - * + * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - * + * */ #include "bcsignals.h" @@ -46,7 +46,8 @@ VAttachmentPoint::~VAttachmentPoint() void VAttachmentPoint::delete_buffer_vector() { - if(!this) printf("VAttachmentPoint::delete_buffer_vector NULL\n"); + void *This = this; + if(!This) printf("VAttachmentPoint::delete_buffer_vector NULL\n"); if(buffer_vector) { for(int i = 0; i < virtual_plugins.total; i++) @@ -58,7 +59,8 @@ void VAttachmentPoint::delete_buffer_vector() void VAttachmentPoint::new_buffer_vector(int width, int height, int colormodel) { - if(!this) printf("VAttachmentPoint::new_buffer_vector NULL\n"); + void *This = this; + if(!This) printf("VAttachmentPoint::new_buffer_vector NULL\n"); if(buffer_vector && (width != buffer_vector[0]->get_w() || height != buffer_vector[0]->get_h() || @@ -72,12 +74,7 @@ void VAttachmentPoint::new_buffer_vector(int width, int height, int colormodel) buffer_vector = new VFrame*[virtual_plugins.total]; for(int i = 0; i < virtual_plugins.total; i++) { - buffer_vector[i] = new VFrame(0, - -1, - width, - height, - colormodel, - -1); + buffer_vector[i] = new VFrame(width, height, colormodel); } } } @@ -87,18 +84,19 @@ int VAttachmentPoint::get_buffer_size() return 1; } -void VAttachmentPoint::render(VFrame *output, +void VAttachmentPoint::render(VFrame *output, int buffer_number, int64_t start_position, double frame_rate, int debug_render, int use_opengl) { - if(!this) printf("VAttachmentPoint::render NULL\n"); + void *This = this; + if(!This) printf("VAttachmentPoint::render NULL\n"); if(!plugin_server || !plugin->on) return; if(debug_render) - printf(" VAttachmentPoint::render \"%s\" multi=%d opengl=%d\n", + printf(" VAttachmentPoint::render \"%s\" multi=%d opengl=%d\n", plugin_server->title, plugin_server->multichannel, use_opengl); @@ -113,7 +111,7 @@ void VAttachmentPoint::render(VFrame *output, this->frame_rate = frame_rate; // Allocate buffer vector for subsequent render calls - new_buffer_vector(output->get_w(), output->get_h(), + new_buffer_vector(output->get_w(), output->get_h(), output->get_color_model()); // Process plugin //printf("VAttachmentPoint::render 1 %d\n", buffer_number); @@ -122,7 +120,7 @@ void VAttachmentPoint::render(VFrame *output, renderengine->video); plugin_servers.values[0]->process_buffer(buffer_vector, start_position, frame_rate, - (int64_t)Units::round(plugin->length * frame_rate / + (int64_t)Units::round(plugin->length * frame_rate / renderengine->get_edl()->session->frame_rate), renderengine->command->get_direction()); } @@ -134,7 +132,7 @@ void VAttachmentPoint::render(VFrame *output, } else if(renderengine && renderengine->video) { // Need to copy PBuffer to texture -// printf("VAttachmentPoint::render temp=%p output=%p\n", +// printf("VAttachmentPoint::render temp=%p output=%p\n", // buffer_vector[buffer_number], // output); VDeviceX11 *x11_device = (VDeviceX11*)renderengine->video->get_output_base(); @@ -152,8 +150,8 @@ void VAttachmentPoint::render(VFrame *output, plugin_servers.values[buffer_number]->process_buffer(output_temp, start_position, frame_rate, - (int64_t)Units::round(plugin->length * - frame_rate / + (int64_t)Units::round(plugin->length * + frame_rate / renderengine->get_edl()->session->frame_rate), renderengine->command->get_direction()); }