From: Good Guy Date: Sat, 11 Nov 2017 18:30:25 +0000 (-0700) Subject: fix mask vframe setup, add unshared vframe constructor X-Git-Url: https://git.cinelerra-gg.org/git/?a=commitdiff_plain;h=48c313de28fe6d39d9431dbe2dca6ffb176541ff;p=goodguy%2Fhistory.git fix mask vframe setup, add unshared vframe constructor --- diff --git a/cinelerra-5.1/cinelerra/awindowgui.C b/cinelerra-5.1/cinelerra/awindowgui.C index 763f62fe..d2777c93 100644 --- a/cinelerra-5.1/cinelerra/awindowgui.C +++ b/cinelerra-5.1/cinelerra/awindowgui.C @@ -106,7 +106,7 @@ VFrame *AssetVIcon::frame() delete temp; temp = 0; } if( !temp ) - temp = new VFrame(asset->width, asset->height, BC_RGB888); + temp = new VFrame(asset->width, asset->height, BC_RGB888, 0); int ww = picon->gui->vicon_thread->view_w; int hh = picon->gui->vicon_thread->view_h; while( seq_no >= images.size() ) { diff --git a/cinelerra-5.1/cinelerra/colorpicker.C b/cinelerra-5.1/cinelerra/colorpicker.C index a99896dd..b9db0c76 100644 --- a/cinelerra-5.1/cinelerra/colorpicker.C +++ b/cinelerra-5.1/cinelerra/colorpicker.C @@ -578,7 +578,7 @@ PaletteWheelValue::~PaletteWheelValue() void PaletteWheelValue::create_objects() { - frame = new VFrame(0, -1, get_w(), get_h(), BC_RGB888, -1); + frame = new VFrame(get_w(), get_h(), BC_RGB888); draw(window->hsv.h, window->hsv.s, window->hsv.v); flash(); } diff --git a/cinelerra-5.1/cinelerra/device1394output.C b/cinelerra-5.1/cinelerra/device1394output.C index 6aa493e2..7cda574b 100644 --- a/cinelerra-5.1/cinelerra/device1394output.C +++ b/cinelerra-5.1/cinelerra/device1394output.C @@ -644,13 +644,7 @@ void Device1394Output::write_frame(VFrame *input) int h = input->get_h(); // Default to NTSC if unknown if(h != 480 && h != 576) h = 480; - - temp_frame2 = new VFrame(0, - -1, - 720, - h, - BC_YUV422, - -1); + temp_frame2 = new VFrame(720, h, BC_YUV422, 0); } diff --git a/cinelerra-5.1/cinelerra/file.C b/cinelerra-5.1/cinelerra/file.C index 4b9c1be8..bd1a0c6d 100644 --- a/cinelerra-5.1/cinelerra/file.C +++ b/cinelerra-5.1/cinelerra/file.C @@ -1146,7 +1146,7 @@ int File::read_frame(VFrame *frame, int is_thread) } if( !temp_frame ) { - temp_frame = new VFrame(asset->width, asset->height, supported_colormodel); + temp_frame = new VFrame(asset->width, asset->height, supported_colormodel, 0); } // printf("File::read_frame %d\n", __LINE__); diff --git a/cinelerra-5.1/cinelerra/filedb.C b/cinelerra-5.1/cinelerra/filedb.C index e8e683dd..301dcb61 100644 --- a/cinelerra-5.1/cinelerra/filedb.C +++ b/cinelerra-5.1/cinelerra/filedb.C @@ -157,7 +157,7 @@ int FileDB::read_frame(VFrame *frame) } VFrame *fp = frame->get_w() == swidth && frame->get_h() == sheight && frame->get_color_model() == BC_YUV420P ? frame : - !vframe ? (vframe = new VFrame(swidth,sheight,BC_YUV420P)) : + !vframe ? (vframe = new VFrame(swidth,sheight,BC_YUV420P,0)) : vframe; if( !result ) { if( frame_id < 0 ) diff --git a/cinelerra-5.1/cinelerra/fileexr.C b/cinelerra-5.1/cinelerra/fileexr.C index ca0c879f..33b1bdd2 100644 --- a/cinelerra-5.1/cinelerra/fileexr.C +++ b/cinelerra-5.1/cinelerra/fileexr.C @@ -468,12 +468,8 @@ int FileEXR::write_frame(VFrame *frame, VFrame *data, FrameWriterUnit *unit) if(frame->get_color_model() != native_cmodel) { - if(!exr_unit->temp_frame) exr_unit->temp_frame = new VFrame(0, - -1, - asset->width, - asset->height, - native_cmodel, - -1); + if(!exr_unit->temp_frame) exr_unit->temp_frame = + new VFrame(asset->width, asset->height, native_cmodel, 0); BC_CModels::transfer(exr_unit->temp_frame->get_rows(), /* Leave NULL if non existent */ frame->get_rows(), exr_unit->temp_frame->get_y(), /* Leave NULL if non existent */ diff --git a/cinelerra-5.1/cinelerra/filelist.C b/cinelerra-5.1/cinelerra/filelist.C index 4614f3f8..f44d11a8 100644 --- a/cinelerra-5.1/cinelerra/filelist.C +++ b/cinelerra-5.1/cinelerra/filelist.C @@ -368,12 +368,8 @@ int FileList::read_frame(VFrame *frame) data->allocate_compressed_data(ostat.st_size); data->set_compressed_size(ostat.st_size); (void)fread(data->get_data(), ostat.st_size, 1, fd); - temp = new VFrame(0, - -1, - asset->width, - asset->height, - frame->get_color_model(), - -1); + temp = new VFrame(asset->width, asset->height, + frame->get_color_model(), 0); read_frame(temp, data); break; } @@ -388,12 +384,7 @@ int FileList::read_frame(VFrame *frame) } else { - temp = new VFrame(0, - -1, - asset->width, - asset->height, - frame->get_color_model(), - -1); + temp = new VFrame(asset->width, asset->height, frame->get_color_model(), 0); read_frame(temp, asset->path); } } diff --git a/cinelerra-5.1/cinelerra/filempeg.C b/cinelerra-5.1/cinelerra/filempeg.C index 8310942c..4617fe3f 100644 --- a/cinelerra-5.1/cinelerra/filempeg.C +++ b/cinelerra-5.1/cinelerra/filempeg.C @@ -1325,12 +1325,8 @@ int FileMPEG::write_frames(VFrame ***frames, int len) if(!temp_frame) { - temp_frame = new VFrame(0, - -1, - temp_w, - temp_h, - output_cmodel, - -1); + temp_frame = new VFrame(temp_w, temp_h, + output_cmodel, 0); } BC_CModels::transfer(temp_frame->get_rows(), @@ -1376,12 +1372,8 @@ int FileMPEG::write_frames(VFrame ***frames, int len) //printf("FileMPEG::write_frames %d\n", __LINE__);sleep(1); if(!temp_frame) { - temp_frame = new VFrame(0, - -1, - asset->width, - asset->height, - output_cmodel, - -1); + temp_frame = new VFrame(asset->width, asset->height, + output_cmodel, 0); } // printf("FileMPEG::write_frames %d temp_frame=%p %p %p %p frame=%p %p %p %p color_model=%p %p\n", diff --git a/cinelerra-5.1/cinelerra/fileogg.C b/cinelerra-5.1/cinelerra/fileogg.C index 0c718fba..a7612a4f 100644 --- a/cinelerra-5.1/cinelerra/fileogg.C +++ b/cinelerra-5.1/cinelerra/fileogg.C @@ -1501,15 +1501,9 @@ int FileOGG::read_frame(VFrame *frame) yuv.v += yuv.uv_stride * (yuv.uv_height - 1); yuv.y_stride = - yuv.y_stride; yuv.uv_stride = - yuv.uv_stride;*/ - VFrame *temp_frame = new VFrame(yuv.y, - -1, - 0, - yuv.u - yuv.y, - yuv.v - yuv.y, - - yuv.y_stride, - yuv.y_height, - BC_YUV420P, - - yuv.y_stride); + VFrame *temp_frame = new VFrame(yuv.y, -1, 0, + yuv.u - yuv.y, yuv.v - yuv.y, - yuv.y_stride, + yuv.y_height, BC_YUV420P, - yuv.y_stride); // copy into temp frame... BC_CModels::transfer(frame->get_rows(), @@ -1959,12 +1953,7 @@ int FileOGG::write_frames_theora(VFrame ***frames, int len, int e_o_s) if (!temp_frame) { - temp_frame = new VFrame (0, - -1, - tf->ti.width, - tf->ti.height, - BC_YUV420P, - -1); + temp_frame = new VFrame ( tf->ti.width, tf->ti.height, BC_YUV420P, 0); } VFrame *frame = frames[0][j]; int in_color_model = frame->get_color_model(); diff --git a/cinelerra-5.1/cinelerra/filepng.C b/cinelerra-5.1/cinelerra/filepng.C index 0cb6445b..d6fd3796 100644 --- a/cinelerra-5.1/cinelerra/filepng.C +++ b/cinelerra-5.1/cinelerra/filepng.C @@ -216,8 +216,8 @@ int FilePNG::write_frame(VFrame *frame, VFrame *data, FrameWriterUnit *unit) native_cmodel = asset->png_use_alpha ? BC_RGBA8888 : BC_RGB888; if(frame->get_color_model() != native_cmodel) { - if(!png_unit->temp_frame) png_unit->temp_frame = new VFrame(0, - -1, asset->width, asset->height, native_cmodel, -1); + if(!png_unit->temp_frame) png_unit->temp_frame = + new VFrame(asset->width, asset->height, native_cmodel, 0); png_unit->temp_frame->transfer_from(frame); output_frame = png_unit->temp_frame; diff --git a/cinelerra-5.1/cinelerra/filetga.C b/cinelerra-5.1/cinelerra/filetga.C index 0ec8a73b..e970c1c8 100644 --- a/cinelerra-5.1/cinelerra/filetga.C +++ b/cinelerra-5.1/cinelerra/filetga.C @@ -357,7 +357,7 @@ void FileTGA::read_tga(Asset *asset, VFrame *frame, VFrame *data, VFrame* &temp) if(!temp) { - temp = new VFrame(0, -1, width, height, source_cmodel, -1); + temp = new VFrame(width, height, source_cmodel, 0); } output_frame = temp; } diff --git a/cinelerra-5.1/cinelerra/filethread.C b/cinelerra-5.1/cinelerra/filethread.C index c5b28785..338176e6 100644 --- a/cinelerra-5.1/cinelerra/filethread.C +++ b/cinelerra-5.1/cinelerra/filethread.C @@ -214,12 +214,9 @@ void FileThread::run() //printf("FileThread::run %d\n", __LINE__); if(!local_frame->frame) { - local_frame->frame = new VFrame(0, - -1, - file->asset->width, - file->asset->height, - supported_colormodel, - -1); + local_frame->frame = + new VFrame(file->asset->width, file->asset->height, + supported_colormodel, 0); } // Read it @@ -454,12 +451,8 @@ int FileThread::start_writing(long buffer_size, else { video_buffer[buffer][layer][frame] = - new VFrame(0, - -1, - file->asset->width, - file->asset->height, - color_model, - -1); + new VFrame( file->asset->width, file->asset->height, + color_model, -1); // printf("FileThread::start_writing %d %d %d %d %p\n", // __LINE__, // buffer, diff --git a/cinelerra-5.1/cinelerra/filetiff.C b/cinelerra-5.1/cinelerra/filetiff.C index b7891ac7..994fd6d0 100644 --- a/cinelerra-5.1/cinelerra/filetiff.C +++ b/cinelerra-5.1/cinelerra/filetiff.C @@ -512,12 +512,8 @@ int FileTIFF::write_frame(VFrame *frame, VFrame *data, FrameWriterUnit *unit) } if(!tiff_unit->temp) { - tiff_unit->temp = new VFrame(0, - -1, - asset->width, - asset->height, - color_model, - -1); + tiff_unit->temp = + new VFrame(asset->width, asset->height, color_model, 0); } BC_CModels::transfer(tiff_unit->temp->get_rows(), diff --git a/cinelerra-5.1/cinelerra/gwindowgui.C b/cinelerra-5.1/cinelerra/gwindowgui.C index b1892034..aaea761e 100644 --- a/cinelerra-5.1/cinelerra/gwindowgui.C +++ b/cinelerra-5.1/cinelerra/gwindowgui.C @@ -191,7 +191,7 @@ GWindowColorButton::GWindowColorButton(GWindowToggle *auto_toggle, int x, int y, this->auto_toggle = auto_toggle; this->color = 0; for( int i=0; i<3; ++i ) { - vframes[i] = new VFrame(w, w, BC_RGBA8888, -1); + vframes[i] = new VFrame(w, w, BC_RGBA8888); vframes[i]->clear_frame(); } } diff --git a/cinelerra-5.1/cinelerra/iec61883output.C b/cinelerra-5.1/cinelerra/iec61883output.C index 8997266f..9a54a115 100644 --- a/cinelerra-5.1/cinelerra/iec61883output.C +++ b/cinelerra-5.1/cinelerra/iec61883output.C @@ -370,14 +370,7 @@ void IEC61883Output::write_frame(VFrame *input) int h = input->get_h(); // Default to NTSC if unknown if(h != 480 && h != 576) h = 480; - - temp_frame2 = new VFrame(0, - -1, - 720, - h, - BC_YUV422, - -1); - + temp_frame2 = new VFrame(720, h, BC_YUV422, 0); } int norm = is_pal ? DV_PAL : DV_NTSC; diff --git a/cinelerra-5.1/cinelerra/maskengine.C b/cinelerra-5.1/cinelerra/maskengine.C index 7f791766..ed7cbaae 100644 --- a/cinelerra-5.1/cinelerra/maskengine.C +++ b/cinelerra-5.1/cinelerra/maskengine.C @@ -370,22 +370,14 @@ SET_TRACE SET_TRACE if(temp && (temp->get_w() != oversampled_package_w || - temp->get_h() != oversampled_package_h)) - { - delete temp; - temp = 0; + temp->get_h() != oversampled_package_h)) { + delete temp; temp = 0; } //printf("MaskUnit::process_package 1\n"); SET_TRACE - if(!temp) - { - temp = new VFrame(0, - -1, - oversampled_package_w, - oversampled_package_h, - BC_A8, - -1); + if(!temp) { + temp = new VFrame(oversampled_package_w, oversampled_package_h, BC_A8, 0); } SET_TRACE @@ -868,18 +860,10 @@ SET_TRACE recalculate = 1; if(!mask) { - mask = new VFrame(0, - -1, - output->get_w(), - output->get_h(), - new_color_model, - -1); - temp_mask = new VFrame(0, - -1, - output->get_w(), - output->get_h(), - new_color_model, - -1); + mask = new VFrame(output->get_w(), output->get_h(), + new_color_model, 0); + temp_mask = new VFrame(output->get_w(), output->get_h(), + new_color_model, 0); } if(new_feather > 0) temp_mask->clear_frame(); @@ -934,19 +918,15 @@ void MaskEngine::init_packages() { SET_TRACE //printf("MaskEngine::init_packages 1\n"); - int division = (int)((float)output->get_h() / (get_total_packages() / 2) + 0.5); - if(division < 1) division = 1; - + int x0 = 0, y0 = 0, i = 0, n = get_total_packages(); + int out_w = output->get_w(), out_h = output->get_h(); SET_TRACE - for(int i = 0; i < get_total_packages(); i++) - { - MaskPackage *ptr = (MaskPackage*)get_package(i); - - ptr->start_y = output->get_h() * i / get_total_packages(); - ptr->end_y = output->get_h() * (i + 1) / get_total_packages(); - - ptr->start_x = output->get_w() * i / get_total_packages(); - ptr->end_x = output->get_w() * (i + 1) / get_total_packages(); + while( i < n ) { + MaskPackage *ptr = (MaskPackage*)get_package(i++); + int x1 = (out_w * i) / n, y1 = (out_h * i) / n; + ptr->start_x = x0; ptr->end_x = x1; + ptr->start_y = y0; ptr->end_y = y1; + x0 = x1; y0 = y1; } SET_TRACE //printf("MaskEngine::init_packages 2\n"); diff --git a/cinelerra-5.1/cinelerra/overlayframe.C b/cinelerra-5.1/cinelerra/overlayframe.C index d637827d..c8690339 100644 --- a/cinelerra-5.1/cinelerra/overlayframe.C +++ b/cinelerra-5.1/cinelerra/overlayframe.C @@ -313,8 +313,8 @@ int OverlayFrame::overlay(VFrame *output, VFrame *input, } if(!temp_frame) { - temp_frame = new VFrame(0, -1, temp_w, temp_h, - input->get_color_model(), -1); + temp_frame = + new VFrame(temp_w, temp_h, input->get_color_model(), 0); } temp_frame->clear_frame(); diff --git a/cinelerra-5.1/cinelerra/pluginvclient.C b/cinelerra-5.1/cinelerra/pluginvclient.C index 02de1392..4ce953f7 100644 --- a/cinelerra-5.1/cinelerra/pluginvclient.C +++ b/cinelerra-5.1/cinelerra/pluginvclient.C @@ -71,7 +71,7 @@ VFrame* PluginVClient::new_temp(int w, int h, int color_model) if(!temp) { - temp = new VFrame(0, -1, w, h, color_model, -1); + temp = new VFrame(w, h, color_model, 0); } return temp; diff --git a/cinelerra-5.1/cinelerra/resourcethread.C b/cinelerra-5.1/cinelerra/resourcethread.C index 430678cc..62aee466 100644 --- a/cinelerra-5.1/cinelerra/resourcethread.C +++ b/cinelerra-5.1/cinelerra/resourcethread.C @@ -452,12 +452,7 @@ void ResourceThread::do_video(VResourceThreadItem *item) if(!temp_picon) { - temp_picon = new VFrame(0, - -1, - source_w, - source_h, - source_cmodel, - -1); + temp_picon = new VFrame(source_w, source_h, source_cmodel, 0); } // Get temporary to copy cached frame to @@ -471,12 +466,7 @@ void ResourceThread::do_video(VResourceThreadItem *item) if(!temp_picon2) { - temp_picon2 = new VFrame(0, - -1, - item->picon_w, - item->picon_h, - BC_RGB888, - -1); + temp_picon2 = new VFrame( item->picon_w, item->picon_h, BC_RGB888, 0); } @@ -489,17 +479,12 @@ void ResourceThread::do_video(VResourceThreadItem *item) Asset *asset = 0; picon_frame = mwindow->frame_cache->get_frame_ptr(item->position, - item->layer, - item->frame_rate, - BC_RGB888, - item->picon_w, - item->picon_h, - source_id); + item->layer, item->frame_rate, BC_RGB888, + item->picon_w, item->picon_h, source_id); //printf("search cache %ld,%d,%f,%dx%d,%d = %p\n", // item->position, item->layer, item->frame_rate, // item->picon_w, item->picon_h, source_id, picon_frame); - if( picon_frame ) - { + if( picon_frame ) { temp_picon2->copy_from(picon_frame); // Unlock the get_frame_ptr command mwindow->frame_cache->unlock(); @@ -542,48 +527,22 @@ void ResourceThread::do_video(VResourceThreadItem *item) if(need_conversion) { - picon_frame = new VFrame(0, - -1, - item->picon_w, - item->picon_h, - BC_RGB888, - -1); - BC_CModels::transfer(picon_frame->get_rows(), - temp_picon->get_rows(), - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - temp_picon->get_w(), - temp_picon->get_h(), - 0, - 0, - picon_frame->get_w(), - picon_frame->get_h(), - source_cmodel, - BC_RGB888, - 0, + picon_frame = new VFrame(item->picon_w, item->picon_h, BC_RGB888, 0); + BC_CModels::transfer(picon_frame->get_rows(), temp_picon->get_rows(), + 0, 0, 0, 0, 0, 0, + 0, 0, temp_picon->get_w(), temp_picon->get_h(), + 0, 0, picon_frame->get_w(), picon_frame->get_h(), + source_cmodel, BC_RGB888, 0, temp_picon->get_bytes_per_line(), picon_frame->get_bytes_per_line()); temp_picon2->copy_from(picon_frame); - mwindow->frame_cache->put_frame(picon_frame, - item->position, - item->layer, - mwindow->edl->session->frame_rate, - 0, - item->indexable); + mwindow->frame_cache->put_frame(picon_frame, item->position, item->layer, + mwindow->edl->session->frame_rate, 0, item->indexable); } // Allow escape here if(interrupted) - { return; - } - // Draw the picon mwindow->gui->lock_window("ResourceThread::do_video"); diff --git a/cinelerra-5.1/cinelerra/scenegraph.C b/cinelerra-5.1/cinelerra/scenegraph.C index a8098e12..70513d88 100644 --- a/cinelerra-5.1/cinelerra/scenegraph.C +++ b/cinelerra-5.1/cinelerra/scenegraph.C @@ -146,9 +146,7 @@ void SceneNode::render(VFrame *frame, int do_camera) // Render everything into a temporary, then overlay the temporary // if(!EQUIV(ry, 0) || get_flip()) // { - temp = new VFrame(image->get_w(), - image->get_h(), - image->get_color_model()); + temp = new VFrame(image->get_w(), image->get_h(), image->get_color_model(), 0); // } if(debug) printf("SceneNode::render %d\n", __LINE__); @@ -169,14 +167,9 @@ void SceneNode::render(VFrame *frame, int do_camera) VFrame *src = temp; if(!EQUIV(ry, 0)) { - src = temp2 = new VFrame(image->get_w(), - image->get_h(), - image->get_color_model()); - if(!scene->affine) scene->affine = - new AffineEngine(scene->cpus, scene->cpus); - scene->affine->rotate(temp2, - temp, - ry); + src = temp2 = new VFrame(image->get_w(), image->get_h(), image->get_color_model(), 0); + if(!scene->affine) scene->affine = new AffineEngine(scene->cpus, scene->cpus); + scene->affine->rotate(temp2, temp, ry); if(debug) printf("SceneNode::render %d ry=%f\n", __LINE__, ry); } @@ -185,13 +178,7 @@ void SceneNode::render(VFrame *frame, int do_camera) src->flip_horiz(); if(debug) printf("SceneNode::render %d src=%p x=%f y=%f sx=%f sy=%f\n", - __LINE__, - src, - x, - y, - sx, - sy); - + __LINE__, src, x, y, sx, sy); // Overlay on the output frame if(!scene->overlayer) scene->overlayer = new OverlayFrame(scene->cpus); diff --git a/cinelerra-5.1/cinelerra/setformat.C b/cinelerra-5.1/cinelerra/setformat.C index af834397..1ca51112 100644 --- a/cinelerra-5.1/cinelerra/setformat.C +++ b/cinelerra-5.1/cinelerra/setformat.C @@ -621,12 +621,11 @@ SetChannelsCanvas::SetChannelsCanvas(MWindow *mwindow, this->mwindow = mwindow; active_channel = -1; box_r = mwindow->theme->channel_position_data->get_w() / 2; - temp_picon = new VFrame(0, - -1, + temp_picon = new VFrame( mwindow->theme->channel_position_data->get_w(), mwindow->theme->channel_position_data->get_h(), mwindow->theme->channel_position_data->get_color_model(), - -1); + 0); rotater = new RotateFrame(mwindow->preferences->processors, mwindow->theme->channel_position_data->get_w(), mwindow->theme->channel_position_data->get_h()); diff --git a/cinelerra-5.1/cinelerra/theme.C b/cinelerra-5.1/cinelerra/theme.C index be8aac82..a04d01fe 100644 --- a/cinelerra-5.1/cinelerra/theme.C +++ b/cinelerra-5.1/cinelerra/theme.C @@ -57,7 +57,7 @@ #include #define NEW_VFRAME \ -new VFrame(0, -1, default_data.get_w(), default_data.get_h(), BC_RGBA8888, -1) +new VFrame(default_data.get_w(), default_data.get_h(), BC_RGBA8888) Theme::Theme() : BC_Theme() diff --git a/cinelerra-5.1/cinelerra/vattachmentpoint.C b/cinelerra-5.1/cinelerra/vattachmentpoint.C index 0a04d117..9ee8fe35 100644 --- a/cinelerra-5.1/cinelerra/vattachmentpoint.C +++ b/cinelerra-5.1/cinelerra/vattachmentpoint.C @@ -74,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); } } } diff --git a/cinelerra-5.1/cinelerra/vdevice1394.C b/cinelerra-5.1/cinelerra/vdevice1394.C index 8f3872e7..839e64eb 100644 --- a/cinelerra-5.1/cinelerra/vdevice1394.C +++ b/cinelerra-5.1/cinelerra/vdevice1394.C @@ -254,12 +254,7 @@ void VDevice1394::new_output_buffer(VFrame **output, user_frame = new VFrame; break; default: - user_frame = new VFrame(0, - -1, - device->out_w, - device->out_h, - colormodel, - -1); + user_frame = new VFrame(device->out_w, device->out_h, colormodel); break; } } diff --git a/cinelerra-5.1/cinelerra/virtualvconsole.C b/cinelerra-5.1/cinelerra/virtualvconsole.C index 094400e0..14488944 100644 --- a/cinelerra-5.1/cinelerra/virtualvconsole.C +++ b/cinelerra-5.1/cinelerra/virtualvconsole.C @@ -156,12 +156,8 @@ int VirtualVConsole::process_buffer(int64_t input_position, if(!output_temp) { // Texture is created on demand - output_temp = new VFrame(0, - -1, - track->track_w, - track->track_h, - renderengine->get_edl()->session->color_model, - -1); + output_temp = new VFrame( track->track_w, track->track_h, + renderengine->get_edl()->session->color_model); } // Reset OpenGL state diff --git a/cinelerra-5.1/cinelerra/vmodule.C b/cinelerra-5.1/cinelerra/vmodule.C index 28f5a6d3..5019c86b 100644 --- a/cinelerra-5.1/cinelerra/vmodule.C +++ b/cinelerra-5.1/cinelerra/vmodule.C @@ -478,12 +478,9 @@ int VModule::import_frame(VFrame *output, VEdit *current_edit, if(!(*input)) { - (*input) = new VFrame(0, - -1, - asset_w, - asset_h, - get_edl()->session->color_model, - -1); + (*input) = + new VFrame(asset_w, asset_h, + get_edl()->session->color_model); } @@ -989,12 +986,9 @@ int VModule::render(VFrame *output, // Load incoming frame if(!(*transition_input)) { - (*transition_input) = new VFrame(0, - -1, - track->track_w, - track->track_h, - get_edl()->session->color_model, - -1); + (*transition_input) = + new VFrame(track->track_w, track->track_h, + get_edl()->session->color_model); } (*transition_input)->copy_stacks(output); diff --git a/cinelerra-5.1/guicast/bcdragwindow.C b/cinelerra-5.1/guicast/bcdragwindow.C index 82ac5762..54814a29 100644 --- a/cinelerra-5.1/guicast/bcdragwindow.C +++ b/cinelerra-5.1/guicast/bcdragwindow.C @@ -109,7 +109,7 @@ BC_Pixmap *BC_DragWindow::prepare_frame(VFrame *frame, BC_WindowBase *parent_win int tw = frame->get_w(), th = frame->get_h(); if( frame->get_color_model() != BC_RGBA8888 ) { - temp_frame = new VFrame(tw, th, BC_RGBA8888); + temp_frame = new VFrame(tw, th, BC_RGBA8888, 0); temp_frame->transfer_from(frame); } diff --git a/cinelerra-5.1/guicast/vframe.C b/cinelerra-5.1/guicast/vframe.C index d05ff849..1cfeb58b 100644 --- a/cinelerra-5.1/guicast/vframe.C +++ b/cinelerra-5.1/guicast/vframe.C @@ -139,6 +139,8 @@ VFrame::VFrame(VFrame &frame) VFrame::VFrame(int w, int h, int color_model, long bytes_per_line) { reset_parameters(1); +// use bytes_per_line == 0 to allocate default unshared + if( !bytes_per_line ) { bytes_per_line = -1; use_shm = 0; } params = new BC_Hash; allocate_data(data, -1, 0, 0, 0, w, h, color_model, bytes_per_line); @@ -836,7 +838,7 @@ int VFrame::write_png(const char *path) bc_cmodel = BC_RGBA8888; png_cmodel = PNG_COLOR_TYPE_RGB_ALPHA; } - vframe = new VFrame(get_w(), get_h(), bc_cmodel, -1); + vframe = new VFrame(get_w(), get_h(), bc_cmodel, 0); vframe->transfer_from(this); break; } diff --git a/cinelerra-5.1/plugins/1080to480/1080to480.C b/cinelerra-5.1/plugins/1080to480/1080to480.C index fc18c5b1..24bfa698 100644 --- a/cinelerra-5.1/plugins/1080to480/1080to480.C +++ b/cinelerra-5.1/plugins/1080to480/1080to480.C @@ -237,7 +237,7 @@ int _1080to480Main::process_realtime(VFrame *input, VFrame *output) load_configuration(); if(!temp) { - temp = new VFrame(input->get_w(), input->get_h(), input->get_color_model()); + temp = new VFrame(input->get_w(), input->get_h(), input->get_color_model(), 0); temp->clear_frame(); } diff --git a/cinelerra-5.1/plugins/1080to540/1080to540.C b/cinelerra-5.1/plugins/1080to540/1080to540.C index 21306b55..8e44c87c 100644 --- a/cinelerra-5.1/plugins/1080to540/1080to540.C +++ b/cinelerra-5.1/plugins/1080to540/1080to540.C @@ -241,12 +241,8 @@ int _1080to540Main::process_realtime(VFrame *input, VFrame *output) load_configuration(); if(!temp) { - temp = new VFrame(0, - -1, - input->get_w(), - input->get_h(), - input->get_color_model(), - -1); + temp = new VFrame(input->get_w(), input->get_h(), + input->get_color_model(), 0); temp->clear_frame(); } diff --git a/cinelerra-5.1/plugins/720to480/720to480.C b/cinelerra-5.1/plugins/720to480/720to480.C index fcc1a47d..e0b5d216 100644 --- a/cinelerra-5.1/plugins/720to480/720to480.C +++ b/cinelerra-5.1/plugins/720to480/720to480.C @@ -330,12 +330,8 @@ int _720to480Main::process_loop(VFrame *output) int result = 0; if(!temp) - temp = new VFrame(0, - -1, - output->get_w(), - output->get_h(), - output->get_color_model(), - -1); + temp = new VFrame(output->get_w(), output->get_h(), + output->get_color_model(), 0); if(config.direction == FORWARD) { diff --git a/cinelerra-5.1/plugins/crikey/crikey.C b/cinelerra-5.1/plugins/crikey/crikey.C index b3e7592b..17373ef5 100644 --- a/cinelerra-5.1/plugins/crikey/crikey.C +++ b/cinelerra-5.1/plugins/crikey/crikey.C @@ -558,7 +558,7 @@ int CriKey::process_buffer(VFrame *frame, int64_t start_position, double frame_r delete dst; dst = 0; } if( !dst ) - dst = new VFrame(w, h, BC_A8); + dst = new VFrame(w, h, BC_A8, 0); dst->clear_frame(); if( !engine ) @@ -578,7 +578,7 @@ int CriKey::process_buffer(VFrame *frame, int64_t start_position, double frame_r delete msk; msk = 0; } if( !msk ) - msk = new VFrame(w, h, BC_A8); + msk = new VFrame(w, h, BC_A8, 0); memset(msk->get_data(), 0xff, msk->get_data_size()); FillRegion fill_region(dst, msk); diff --git a/cinelerra-5.1/plugins/decimate/decimate.C b/cinelerra-5.1/plugins/decimate/decimate.C index e7d0d6d3..f2d4d6bb 100644 --- a/cinelerra-5.1/plugins/decimate/decimate.C +++ b/cinelerra-5.1/plugins/decimate/decimate.C @@ -708,14 +708,9 @@ int Decimate::process_buffer(VFrame *frame, if(!frames[0]) { - for(int i = 0; i < TOTAL_FRAMES; i++) - { - frames[i] = new VFrame(0, - -1, - frame->get_w(), - frame->get_h(), - frame->get_color_model(), - -1); + for(int i = 0; i < TOTAL_FRAMES; i++) { + frames[i] = new VFrame(frame->get_w(), frame->get_h(), + frame->get_color_model(), 0); } } diff --git a/cinelerra-5.1/plugins/deinterlace-cv/deinterlace-cv.C b/cinelerra-5.1/plugins/deinterlace-cv/deinterlace-cv.C index db378044..b7cc0dc1 100644 --- a/cinelerra-5.1/plugins/deinterlace-cv/deinterlace-cv.C +++ b/cinelerra-5.1/plugins/deinterlace-cv/deinterlace-cv.C @@ -537,15 +537,11 @@ int DeInterlaceMain::process_buffer(VFrame *frame, temp = frame; // if(!temp) -// temp = new VFrame( -// frame->get_w(), -// frame->get_h(), -// frame->get_color_model()); +// temp = new VFrame(frame->get_w(), frame->get_h(), +// frame->get_color_model(), 0); if(!temp_prevframe) - temp_prevframe = new VFrame( - frame->get_w(), - frame->get_h(), - frame->get_color_model()); + temp_prevframe = new VFrame(frame->get_w(), frame->get_h(), + frame->get_color_model(), 0); switch(config.mode) { diff --git a/cinelerra-5.1/plugins/deinterlace/deinterlace.C b/cinelerra-5.1/plugins/deinterlace/deinterlace.C index 7d1d41d7..850959e3 100644 --- a/cinelerra-5.1/plugins/deinterlace/deinterlace.C +++ b/cinelerra-5.1/plugins/deinterlace/deinterlace.C @@ -378,10 +378,8 @@ int DeInterlaceMain::process_buffer(VFrame *frame, temp = frame; // if(!temp) -// temp = new VFrame(0, -// frame->get_w(), -// frame->get_h(), -// frame->get_color_model()); +// temp = new VFrame(frame->get_w(), frame->get_h(), +// frame->get_color_model(), 0); switch(config.mode) { diff --git a/cinelerra-5.1/plugins/delayvideo/delayvideo.C b/cinelerra-5.1/plugins/delayvideo/delayvideo.C index a3f7db6b..55ea5d4e 100644 --- a/cinelerra-5.1/plugins/delayvideo/delayvideo.C +++ b/cinelerra-5.1/plugins/delayvideo/delayvideo.C @@ -195,12 +195,8 @@ void DelayVideo::reconfigure() for(int i = reuse; i < new_allocation; i++) { - new_buffer[i] = new VFrame(0, - -1, - input->get_w(), - input->get_h(), - PluginVClient::project_color_model, - -1); + new_buffer[i] = new VFrame(input->get_w(), input->get_h(), + PluginVClient::project_color_model, 0); } for(int i = reuse; i < allocation; i++) diff --git a/cinelerra-5.1/plugins/denoiseseltempavg/seltempavg.C b/cinelerra-5.1/plugins/denoiseseltempavg/seltempavg.C index 23fdf915..b5738981 100644 --- a/cinelerra-5.1/plugins/denoiseseltempavg/seltempavg.C +++ b/cinelerra-5.1/plugins/denoiseseltempavg/seltempavg.C @@ -184,7 +184,7 @@ int SelTempAvgMain::process_buffer(VFrame *frame, // Create new frames for( ; i < config.frames; i++) { - history2[i] = new VFrame(w, h, color_model); + history2[i] = new VFrame(w, h, color_model, 0); history_frame2[i] = -0x7fffffff; history_valid2[i] = 0; } @@ -201,7 +201,7 @@ int SelTempAvgMain::process_buffer(VFrame *frame, { history = new VFrame*[config.frames]; for(int i = 0; i < config.frames; i++) - history[i] = new VFrame(w, h, color_model); + history[i] = new VFrame(w, h, color_model, 0); history_size = config.frames; history_frame = new int64_t[config.frames]; bzero(history_frame, sizeof(int64_t) * config.frames); diff --git a/cinelerra-5.1/plugins/edge/edge.C b/cinelerra-5.1/plugins/edge/edge.C index b0c14ea9..b8541927 100644 --- a/cinelerra-5.1/plugins/edge/edge.C +++ b/cinelerra-5.1/plugins/edge/edge.C @@ -135,7 +135,7 @@ int Edge::process_buffer(VFrame *frame, int64_t start_position, double frame_rat delete dst; dst = 0; } if( !dst ) - dst = new VFrame(0, -1, w, h, color_model, -1); + dst = new VFrame(w, h, color_model, 0); if( !engine ) engine = new EdgeEngine(this, diff --git a/cinelerra-5.1/plugins/fieldframe/fieldframe.C b/cinelerra-5.1/plugins/fieldframe/fieldframe.C index f2e17a15..0a39eb1b 100644 --- a/cinelerra-5.1/plugins/fieldframe/fieldframe.C +++ b/cinelerra-5.1/plugins/fieldframe/fieldframe.C @@ -416,12 +416,8 @@ int FieldFrame::process_buffer(VFrame *frame, if(!input) { - input = new VFrame(0, - -1, - frame->get_w(), - frame->get_h(), - frame->get_color_model(), - -1); + input = new VFrame(frame->get_w(), frame->get_h(), + frame->get_color_model(), 0); } // Get input frames diff --git a/cinelerra-5.1/plugins/flowobj/flowobj.C b/cinelerra-5.1/plugins/flowobj/flowobj.C index 32d3760d..9ebeb4f9 100644 --- a/cinelerra-5.1/plugins/flowobj/flowobj.C +++ b/cinelerra-5.1/plugins/flowobj/flowobj.C @@ -301,7 +301,7 @@ int FlowObj::process_buffer(VFrame *frame, int64_t start_position, double frame_ delete accum; accum = 0; } if( !accum ) { - accum = new VFrame(width, height, color_model); + accum = new VFrame(width, height, color_model, 0); accum->clear_frame(); } if( !overlay ) diff --git a/cinelerra-5.1/plugins/framefield/framefield.C b/cinelerra-5.1/plugins/framefield/framefield.C index 7f070658..68312aea 100644 --- a/cinelerra-5.1/plugins/framefield/framefield.C +++ b/cinelerra-5.1/plugins/framefield/framefield.C @@ -351,12 +351,8 @@ int FrameField::process_buffer(VFrame *frame, if(!src_frame) { - src_frame = new VFrame(0, - -1, - frame->get_w(), - frame->get_h(), - frame->get_color_model(), - -1); + src_frame = new VFrame(frame->get_w(), frame->get_h(), + frame->get_color_model(), 0); } ptr = src_frame; } diff --git a/cinelerra-5.1/plugins/freezeframe/freezeframe.C b/cinelerra-5.1/plugins/freezeframe/freezeframe.C index 6dda2d71..67904ed6 100644 --- a/cinelerra-5.1/plugins/freezeframe/freezeframe.C +++ b/cinelerra-5.1/plugins/freezeframe/freezeframe.C @@ -258,12 +258,8 @@ int FreezeFrameMain::process_buffer(VFrame *frame, if(!first_frame && config.enabled) { if(!first_frame) - first_frame = new VFrame(0, - -1, - frame->get_w(), - frame->get_h(), - frame->get_color_model(), - -1); + first_frame = new VFrame(frame->get_w(), frame->get_h(), + frame->get_color_model(), 0); //printf("FreezeFrameMain::process_buffer 1 %jd\n", first_frame_position); read_frame(first_frame, 0, diff --git a/cinelerra-5.1/plugins/gradient/gradient.C b/cinelerra-5.1/plugins/gradient/gradient.C index 66cf7bb9..9d456d4f 100644 --- a/cinelerra-5.1/plugins/gradient/gradient.C +++ b/cinelerra-5.1/plugins/gradient/gradient.C @@ -689,12 +689,9 @@ int GradientMain::process_buffer(VFrame *frame, gradient = 0; } - if(!gradient) gradient = new VFrame(0, - -1, - input->get_w(), - input->get_h(), - gradient_cmodel, - -1); + if(!gradient) + gradient = new VFrame(input->get_w(), input->get_h(), + gradient_cmodel, 0); if(!engine) engine = new GradientServer(this, get_project_smp() + 1, diff --git a/cinelerra-5.1/plugins/holo/holo.C b/cinelerra-5.1/plugins/holo/holo.C index 61a8c0d2..7a111923 100644 --- a/cinelerra-5.1/plugins/holo/holo.C +++ b/cinelerra-5.1/plugins/holo/holo.C @@ -195,10 +195,8 @@ total = 0; { case 0: /* step 1: grab frame-1 to buffer-1 */ -// tmp = new VFrame(0, -// input_ptr->get_w(), -// input_ptr->get_h(), -// project_color_model); +// tmp = new VFrame(input_ptr->get_w(),input_ptr->get_h(), +// project_color_model, 0); bgimage->copy_from(input_ptr); break; @@ -247,12 +245,8 @@ int HoloMain::process_realtime(VFrame *input_ptr, VFrame *output_ptr) if(!effecttv) { effecttv = new EffectTV(input_ptr->get_w(), input_ptr->get_h()); - bgimage = new VFrame(0, - -1, - input_ptr->get_w(), - input_ptr->get_h(), - input_ptr->get_color_model(), - -1); + bgimage = new VFrame(input_ptr->get_w(), input_ptr->get_h(), + input_ptr->get_color_model(), 0); for(int i = 0; i < 256; i++) { diff --git a/cinelerra-5.1/plugins/interpolate/interpolate.C b/cinelerra-5.1/plugins/interpolate/interpolate.C index 64fa589b..cbb8fa7c 100644 --- a/cinelerra-5.1/plugins/interpolate/interpolate.C +++ b/cinelerra-5.1/plugins/interpolate/interpolate.C @@ -278,7 +278,7 @@ int InterpolatePixelsMain::process_buffer(VFrame *frame, delete out_temp; out_temp = 0; } if( !out_temp ) - out_temp = new VFrame(0, -1, w, h, active_model, -1); + out_temp = new VFrame(w, h, active_model, 0); out_frame = out_temp; } diff --git a/cinelerra-5.1/plugins/interpolatevideo/interpolatevideo.C b/cinelerra-5.1/plugins/interpolatevideo/interpolatevideo.C index 6eab87b3..83ff93b6 100644 --- a/cinelerra-5.1/plugins/interpolatevideo/interpolatevideo.C +++ b/cinelerra-5.1/plugins/interpolatevideo/interpolatevideo.C @@ -777,12 +777,8 @@ int InterpolateVideo::process_buffer(VFrame *frame, { for(int i = 0; i < 2; i++) { - frames[i] = new VFrame(0, - -1, - frame->get_w(), - frame->get_h(), - frame->get_color_model(), - -1); + frames[i] = new VFrame(frame->get_w(), frame->get_h(), + frame->get_color_model(), 0); } } //printf("InterpolateVideo::process_buffer 1 %lld %lld\n", range_start, range_end); diff --git a/cinelerra-5.1/plugins/ivtc/ivtc.C b/cinelerra-5.1/plugins/ivtc/ivtc.C index 57a47cca..8966ea51 100644 --- a/cinelerra-5.1/plugins/ivtc/ivtc.C +++ b/cinelerra-5.1/plugins/ivtc/ivtc.C @@ -165,18 +165,12 @@ int IVTCMain::process_realtime(VFrame *input_ptr, VFrame *output_ptr) int pattern_position = (PluginClient::source_position + config.frame_offset) % 5; //printf("IVTCMain::process_realtime %d %d\n", pattern_position, config.first_field); - if(!temp_frame[0]) temp_frame[0] = new VFrame(0, - -1, - input_ptr->get_w(), - input_ptr->get_h(), - input_ptr->get_color_model(), - -1); - if(!temp_frame[1]) temp_frame[1] = new VFrame(0, - -1, - input_ptr->get_w(), - input_ptr->get_h(), - input_ptr->get_color_model(), - -1); + if(!temp_frame[0]) + temp_frame[0] = new VFrame(input_ptr->get_w(), input_ptr->get_h(), + input_ptr->get_color_model(), 0); + if(!temp_frame[1]) + temp_frame[1] = new VFrame(input_ptr->get_w(), input_ptr->get_h(), + input_ptr->get_color_model(), 0); int row_size = VFrame::calculate_bytes_per_pixel(input_ptr->get_color_model()) * input_ptr->get_w(); this->input = input_ptr; diff --git a/cinelerra-5.1/plugins/linearblur/linearblur.C b/cinelerra-5.1/plugins/linearblur/linearblur.C index 8f6cab2f..2557f9d1 100644 --- a/cinelerra-5.1/plugins/linearblur/linearblur.C +++ b/cinelerra-5.1/plugins/linearblur/linearblur.C @@ -518,12 +518,9 @@ int LinearBlurMain::process_buffer(VFrame *frame, this->output = frame; - if(!temp) temp = new VFrame(0, - -1, - frame->get_w(), - frame->get_h(), - frame->get_color_model(), - -1); + if(!temp) + temp = new VFrame(frame->get_w(), frame->get_h(), + frame->get_color_model(), 0); temp->copy_from(frame); this->input = temp; diff --git a/cinelerra-5.1/plugins/livevideo/livevideo.C b/cinelerra-5.1/plugins/livevideo/livevideo.C index 6b512028..23edbc73 100644 --- a/cinelerra-5.1/plugins/livevideo/livevideo.C +++ b/cinelerra-5.1/plugins/livevideo/livevideo.C @@ -454,12 +454,8 @@ int LiveVideo::process_buffer(VFrame *frame, { if(!temp) { - temp = new VFrame(0, - -1, - session->vconfig_in->w, - session->vconfig_in->h, - input_cmodel, - -1); + temp = new VFrame(session->vconfig_in->w, session->vconfig_in->h, + input_cmodel, 0); } input = temp; } diff --git a/cinelerra-5.1/plugins/motion-cv/motion-cv.C b/cinelerra-5.1/plugins/motion-cv/motion-cv.C index b434e42a..fbbef54c 100644 --- a/cinelerra-5.1/plugins/motion-cv/motion-cv.C +++ b/cinelerra-5.1/plugins/motion-cv/motion-cv.C @@ -342,7 +342,7 @@ void MotionCVMain::allocate_temp(int w, int h, int color_model) temp_frame = 0; } if( !temp_frame ) - temp_frame = new VFrame(w, h, color_model); + temp_frame = new VFrame(w, h, color_model, 0); } void MotionCVMain::process_global() diff --git a/cinelerra-5.1/plugins/motion-hv/motioncache-hv.C b/cinelerra-5.1/plugins/motion-hv/motioncache-hv.C index 98722ded..e9c74573 100644 --- a/cinelerra-5.1/plugins/motion-hv/motioncache-hv.C +++ b/cinelerra-5.1/plugins/motion-hv/motioncache-hv.C @@ -186,21 +186,9 @@ VFrame* MotionHVCache::get_image(int ratio, //PRINT_TRACE - VFrame *result = new VFrame(); - result->set_use_shm(0); - result->reallocate(0, - -1, - 0, - 0, - 0, - downsampled_w + 1, - downsampled_h + 1, - src->get_color_model(), - -1); - downsample_frame(result, - src, - ratio); - + VFrame *result = + new VFrame(downsampled_w+1, downsampled_h+1, src->get_color_model(), 0); + downsample_frame(result, src, ratio); MotionHVCacheItem *item = new MotionHVCacheItem(); item->image = result; diff --git a/cinelerra-5.1/plugins/motion-hv/motionscan-hv.C b/cinelerra-5.1/plugins/motion-hv/motionscan-hv.C index 6c4d6e07..0bded66c 100644 --- a/cinelerra-5.1/plugins/motion-hv/motionscan-hv.C +++ b/cinelerra-5.1/plugins/motion-hv/motionscan-hv.C @@ -602,17 +602,9 @@ printf("MotionHVScan::pixel_search %d range fail range2=%f\n", __LINE__, range2) // rotated_current[i]); if(!rotated_current[i]) { - rotated_current[i] = new VFrame(); - rotated_current[i]->set_use_shm(0); - rotated_current[i]->reallocate(0, - -1, - 0, - 0, - 0, - downsampled_current_w + 1, - downsampled_current_h + 1, - current_frame_arg->get_color_model(), - -1); + rotated_current[i] = + new VFrame(downsampled_current_w+1, downsampled_current_h+1, + current_frame_arg->get_color_model(), 0); //printf("MotionHVScan::pixel_search %d\n", __LINE__); } diff --git a/cinelerra-5.1/plugins/motion/motion.C b/cinelerra-5.1/plugins/motion/motion.C index db9235ec..4661b144 100644 --- a/cinelerra-5.1/plugins/motion/motion.C +++ b/cinelerra-5.1/plugins/motion/motion.C @@ -364,7 +364,7 @@ void MotionMain::allocate_temp(int w, int h, int color_model) temp_frame = 0; } if( !temp_frame ) - temp_frame = new VFrame(w, h, color_model); + temp_frame = new VFrame(w, h, color_model, 0); } void MotionMain::process_global() @@ -733,16 +733,16 @@ printf("MotionMain::process_buffer 2 rename tracking file: %s to %s\n", // The center of the search area is fixed in compensate mode or // the user value + the accumulation vector in track mode. if( !prev_global_ref ) - prev_global_ref = new VFrame(w, h, color_model); + prev_global_ref = new VFrame(w, h, color_model, 0); if( !current_global_ref ) - current_global_ref = new VFrame(w, h, color_model); + current_global_ref = new VFrame(w, h, color_model, 0); // Global loads the current target frame into the src and // writes it to the dst frame with desired translation. if( !global_target_src ) - global_target_src = new VFrame(w, h, color_model); + global_target_src = new VFrame(w, h, color_model, 0); if( !global_target_dst ) - global_target_dst = new VFrame(w, h, color_model); + global_target_dst = new VFrame(w, h, color_model, 0); // Load the global frames if( need_reload ) { @@ -762,10 +762,10 @@ printf("MotionMain::process_buffer 2 rename tracking file: %s to %s\n", // The center of the search area is always the user value + the accumulation // vector. if( !prev_rotate_ref ) - prev_rotate_ref = new VFrame(w, h, color_model); + prev_rotate_ref = new VFrame(w, h, color_model, 0); // The current global reference is the current rotation reference. if( !current_rotate_ref ) - current_rotate_ref = new VFrame(w, h, color_model); + current_rotate_ref = new VFrame(w, h, color_model, 0); current_rotate_ref->copy_from(current_global_ref); // The global target destination is copied to the rotation target source @@ -774,9 +774,9 @@ printf("MotionMain::process_buffer 2 rename tracking file: %s to %s\n", // if we're tracking. // The pivot is fixed to the user position if we're compensating. if( !rotate_target_src ) - rotate_target_src = new VFrame(w, h, color_model); + rotate_target_src = new VFrame(w, h, color_model, 0); if( !rotate_target_dst ) - rotate_target_dst = new VFrame(w, h, color_model); + rotate_target_dst = new VFrame(w, h, color_model, 0); } } // Rotation only @@ -784,16 +784,16 @@ printf("MotionMain::process_buffer 2 rename tracking file: %s to %s\n", // Rotation reads the previous reference frame and compares it with current // reference frame. if( !prev_rotate_ref ) - prev_rotate_ref = new VFrame(w, h, color_model); + prev_rotate_ref = new VFrame(w, h, color_model, 0); if( !current_rotate_ref ) - current_rotate_ref = new VFrame(w, h, color_model); + current_rotate_ref = new VFrame(w, h, color_model, 0); // Rotation loads target frame to temporary, rotates it, and writes it to the // target frame. The pivot is always fixed. if( !rotate_target_src ) - rotate_target_src = new VFrame(w, h, color_model); + rotate_target_src = new VFrame(w, h, color_model, 0); if( !rotate_target_dst ) - rotate_target_dst = new VFrame(w, h, color_model); + rotate_target_dst = new VFrame(w, h, color_model, 0); // Load the rotate frames @@ -1255,12 +1255,11 @@ void RotateScanUnit::process_package(LoadPackage *package) if( !rotater ) rotater = new AffineEngine(1, 1); - if( !temp ) temp = new VFrame(0, - -1, - server->previous_frame->get_w(), - server->previous_frame->get_h(), - color_model, - -1); + if( !temp ) + temp = new VFrame( + server->previous_frame->get_w(), + server->previous_frame->get_h(), + color_model, 0); //printf("RotateScanUnit::process_package %d\n", __LINE__); diff --git a/cinelerra-5.1/plugins/motion2point/motion.C b/cinelerra-5.1/plugins/motion2point/motion.C index ad745c4f..5897ae0e 100644 --- a/cinelerra-5.1/plugins/motion2point/motion.C +++ b/cinelerra-5.1/plugins/motion2point/motion.C @@ -438,7 +438,7 @@ void MotionMain2::allocate_temp(int w, int h, int color_model) temp_frame = 0; } if(!temp_frame) - temp_frame = new VFrame(w, h, color_model); + temp_frame = new VFrame(w, h, color_model, 0); } @@ -833,16 +833,16 @@ printf("MotionMain2::process_buffer 1 start_position=%jd\n", start_position); // The center of the search area is fixed in compensate mode or // the user value + the accumulation vector in track mode. if(!prev_global_ref) - prev_global_ref = new VFrame(w, h, color_model); + prev_global_ref = new VFrame(w, h, color_model, 0); if(!current_global_ref) - current_global_ref = new VFrame(w, h, color_model); + current_global_ref = new VFrame(w, h, color_model, 0); // Global loads the current target frame into the src and // writes it to the dst frame with desired translation. if(!global_target_src) - global_target_src = new VFrame(w, h, color_model); + global_target_src = new VFrame(w, h, color_model, 0); if(!global_target_dst) - global_target_dst = new VFrame(w, h, color_model); + global_target_dst = new VFrame(w, h, color_model, 0); // Load the global frames diff --git a/cinelerra-5.1/plugins/motion51/motion51.C b/cinelerra-5.1/plugins/motion51/motion51.C index 483c6e5f..cac4ed3a 100644 --- a/cinelerra-5.1/plugins/motion51/motion51.C +++ b/cinelerra-5.1/plugins/motion51/motion51.C @@ -502,7 +502,7 @@ VFrame* Motion51Main::new_temp(VFrame *&tmp, VFrame *ref) delete tmp; tmp = 0; } if( !tmp ) - tmp = new VFrame(0, -1, ref->get_w(), ref->get_h(), ref->get_color_model(), -1); + tmp = new VFrame(ref->get_w(), ref->get_h(), ref->get_color_model(), 0); return tmp; } diff --git a/cinelerra-5.1/plugins/motionblur/motionblur.C b/cinelerra-5.1/plugins/motionblur/motionblur.C index 37df852f..a5bc3be5 100644 --- a/cinelerra-5.1/plugins/motionblur/motionblur.C +++ b/cinelerra-5.1/plugins/motionblur/motionblur.C @@ -371,12 +371,8 @@ int MotionBlurMain::process_realtime(VFrame *input_ptr, VFrame *output_ptr) if(input_ptr->get_rows()[0] == output_ptr->get_rows()[0]) { - if(!temp) temp = new VFrame(0, - -1, - input_ptr->get_w(), - input_ptr->get_h(), - input_ptr->get_color_model(), - -1); + if(!temp) temp = new VFrame(input_ptr->get_w(), input_ptr->get_h(), + input_ptr->get_color_model(), 0); temp->copy_from(input_ptr); this->input = temp; } diff --git a/cinelerra-5.1/plugins/oilpainting/oil.C b/cinelerra-5.1/plugins/oilpainting/oil.C index 3822ef1b..0b782ab5 100644 --- a/cinelerra-5.1/plugins/oilpainting/oil.C +++ b/cinelerra-5.1/plugins/oilpainting/oil.C @@ -383,12 +383,9 @@ int OilEffect::process_realtime(VFrame *input, VFrame *output) { if(input->get_rows()[0] == output->get_rows()[0]) { - if(!temp_frame) temp_frame = new VFrame(0, - -1, - input->get_w(), - input->get_h(), - input->get_color_model(), - -1); + if(!temp_frame) + temp_frame = new VFrame(input->get_w(), input->get_h(), + input->get_color_model(), 0); temp_frame->copy_from(input); this->input = temp_frame; } diff --git a/cinelerra-5.1/plugins/overlay/overlay.C b/cinelerra-5.1/plugins/overlay/overlay.C index a041a10f..5f0ea80f 100644 --- a/cinelerra-5.1/plugins/overlay/overlay.C +++ b/cinelerra-5.1/plugins/overlay/overlay.C @@ -408,8 +408,8 @@ int Overlay::process_buffer(VFrame **frame, if( --layers > 0 ) { // need 2 layers to do overlay if( !temp ) - temp = new VFrame(0, -1, frame[0]->get_w(), frame[0]->get_h(), - frame[0]->get_color_model(), -1); + temp = new VFrame(frame[0]->get_w(), frame[0]->get_h(), + frame[0]->get_color_model(), 0); while( --layers >= 0 ) { current_layer += step; diff --git a/cinelerra-5.1/plugins/perspective/perspective.C b/cinelerra-5.1/plugins/perspective/perspective.C index ea1aa4d7..a9e2adf3 100644 --- a/cinelerra-5.1/plugins/perspective/perspective.C +++ b/cinelerra-5.1/plugins/perspective/perspective.C @@ -836,7 +836,7 @@ int PerspectiveMain::process_buffer(VFrame *frame, } } if( !temp ) - temp = new VFrame(need_w, need_h, color_model); + temp = new VFrame(need_w, need_h, color_model, 0); break; } switch( config.mode ) { diff --git a/cinelerra-5.1/plugins/polar/polar.C b/cinelerra-5.1/plugins/polar/polar.C index 68e378bd..f226720a 100644 --- a/cinelerra-5.1/plugins/polar/polar.C +++ b/cinelerra-5.1/plugins/polar/polar.C @@ -354,12 +354,9 @@ int PolarEffect::process_realtime(VFrame *input, VFrame *output) { if(input->get_rows()[0] == output->get_rows()[0]) { - if(!temp_frame) temp_frame = new VFrame(0, - -1, - input->get_w(), - input->get_h(), - input->get_color_model(), - -1); + if(!temp_frame) + temp_frame = new VFrame(input->get_w(), input->get_h(), + input->get_color_model(), 0); temp_frame->copy_from(input); this->input = temp_frame; } diff --git a/cinelerra-5.1/plugins/radialblur/radialblur.C b/cinelerra-5.1/plugins/radialblur/radialblur.C index 7f141409..969b8694 100644 --- a/cinelerra-5.1/plugins/radialblur/radialblur.C +++ b/cinelerra-5.1/plugins/radialblur/radialblur.C @@ -413,12 +413,9 @@ int RadialBlurMain::process_buffer(VFrame *frame, this->output = frame; - if(!temp) temp = new VFrame(0, - -1, - frame->get_w(), - frame->get_h(), - frame->get_color_model(), - -1); + if(!temp) + temp = new VFrame(frame->get_w(), frame->get_h(), + frame->get_color_model(), 0); temp->copy_from(frame); this->input = temp; diff --git a/cinelerra-5.1/plugins/rgbshift/rgbshift.C b/cinelerra-5.1/plugins/rgbshift/rgbshift.C index 21dd4274..165680a2 100644 --- a/cinelerra-5.1/plugins/rgbshift/rgbshift.C +++ b/cinelerra-5.1/plugins/rgbshift/rgbshift.C @@ -342,7 +342,7 @@ int RGBShiftEffect::process_realtime(VFrame *input, VFrame *output) delete temp_frame; temp_frame = 0; } if( !temp_frame ) - temp_frame = new VFrame(w, h, color_model); + temp_frame = new VFrame(w, h, color_model, 0); frame = temp_frame; if( color_model != input->get_color_model() ) BC_CModels::transfer(frame->get_rows(), input->get_rows(), diff --git a/cinelerra-5.1/plugins/scaleratio/scaleratio.C b/cinelerra-5.1/plugins/scaleratio/scaleratio.C index 5c5944a7..52073c10 100644 --- a/cinelerra-5.1/plugins/scaleratio/scaleratio.C +++ b/cinelerra-5.1/plugins/scaleratio/scaleratio.C @@ -181,9 +181,8 @@ int ScaleRatioMain::process_realtime(VFrame *input_ptr, VFrame *output_ptr) temp_frame = 0; } if(!temp_frame) - temp_frame = new VFrame(0, -1, - input_ptr->get_w(), input_ptr->get_h(), - input->get_color_model(), -1); + temp_frame = new VFrame(input_ptr->get_w(), input_ptr->get_h(), + input->get_color_model(), 0); temp_frame->copy_from(input); input = temp_frame; } diff --git a/cinelerra-5.1/plugins/svg/svg.C b/cinelerra-5.1/plugins/svg/svg.C index af4a79d4..9a7f7744 100644 --- a/cinelerra-5.1/plugins/svg/svg.C +++ b/cinelerra-5.1/plugins/svg/svg.C @@ -194,7 +194,7 @@ int SvgMain::process_realtime(VFrame *input, VFrame *output) close(fd); if( ofrm && ofrm->get_color_model() != output->get_color_model() ) { VFrame *vfrm = new VFrame(ofrm->get_w(), ofrm->get_h(), - output->get_color_model()); + output->get_color_model(), 0); vfrm->transfer_from(ofrm); delete ofrm; ofrm = vfrm; } diff --git a/cinelerra-5.1/plugins/swapframes/swapframes.C b/cinelerra-5.1/plugins/swapframes/swapframes.C index 8284b6fa..e9c24ea7 100644 --- a/cinelerra-5.1/plugins/swapframes/swapframes.C +++ b/cinelerra-5.1/plugins/swapframes/swapframes.C @@ -301,12 +301,9 @@ int SwapFrames::process_buffer(VFrame *frame, if(new_position > prev_frame + 1) { //printf("SwapFrames::process_buffer %d\n", __LINE__); - if(!buffer) buffer = new VFrame(0, - -1, - frame->get_w(), - frame->get_h(), - frame->get_color_model(), - -1); + if(!buffer) + buffer = new VFrame(frame->get_w(), frame->get_h(), + frame->get_color_model(), 0); buffer_position = new_position - 1; read_frame(buffer, 0, diff --git a/cinelerra-5.1/plugins/timeavg/timeavg.C b/cinelerra-5.1/plugins/timeavg/timeavg.C index fa055c3f..02ce4f5d 100644 --- a/cinelerra-5.1/plugins/timeavg/timeavg.C +++ b/cinelerra-5.1/plugins/timeavg/timeavg.C @@ -214,7 +214,7 @@ int TimeAvgMain::process_buffer(VFrame *frame, // Create new frames for( ; i < config.frames; i++) { - history2[i] = new VFrame(w, h, color_model); + history2[i] = new VFrame(w, h, color_model, 0); history_frame2[i] = -0x7fffffff; history_valid2[i] = 0; } @@ -231,7 +231,7 @@ int TimeAvgMain::process_buffer(VFrame *frame, { history = new VFrame*[config.frames]; for(int i = 0; i < config.frames; i++) - history[i] = new VFrame(w, h, color_model); + history[i] = new VFrame(w, h, color_model, 0); history_size = config.frames; history_frame = new int64_t[config.frames]; bzero(history_frame, sizeof(int64_t) * config.frames); diff --git a/cinelerra-5.1/plugins/timefront/timefront.C b/cinelerra-5.1/plugins/timefront/timefront.C index 76cdcd44..82dbd59a 100644 --- a/cinelerra-5.1/plugins/timefront/timefront.C +++ b/cinelerra-5.1/plugins/timefront/timefront.C @@ -765,10 +765,8 @@ int TimeFrontMain::process_buffer(VFrame **frame, { VFrame **outframes = frame; VFrame *(framelist[1024]); - framelist[0] = new VFrame ( - outframes[0]->get_w(), - outframes[0]->get_h(), - outframes[0]->get_color_model()); + framelist[0] = new VFrame (outframes[0]->get_w(), outframes[0]->get_h(), + outframes[0]->get_color_model(), 0); read_frame(framelist[0], 0, start_position, @@ -798,11 +796,8 @@ int TimeFrontMain::process_buffer(VFrame **frame, { need_reconfigure = 0; - if(!gradient) gradient = new VFrame( - outframes[0]->get_w(), - outframes[0]->get_h(), - BC_A8); - + if(!gradient) + gradient = new VFrame( outframes[0]->get_w(), outframes[0]->get_h(), BC_A8, 0); if (config.shape != TimeFrontConfig::OTHERTRACK && config.shape != TimeFrontConfig::ALPHA) @@ -816,10 +811,8 @@ int TimeFrontMain::process_buffer(VFrame **frame, } if (config.shape == TimeFrontConfig::ALPHA) { - if(!gradient) gradient = new VFrame( - outframes[0]->get_w(), - outframes[0]->get_h(), - BC_A8); + if(!gradient) + gradient = new VFrame(outframes[0]->get_w(), outframes[0]->get_h(), BC_A8, 0); VFrame *tfframe = framelist[0]; switch (tfframe->get_color_model()) { @@ -844,10 +837,8 @@ int TimeFrontMain::process_buffer(VFrame **frame, } else if (config.shape == TimeFrontConfig::OTHERTRACK) { - if(!gradient) gradient = new VFrame( - outframes[0]->get_w(), - outframes[0]->get_h(), - BC_A8); + if(!gradient) + gradient = new VFrame(outframes[0]->get_w(), outframes[0]->get_h(), BC_A8, 0); VFrame *tfframe = outframes[1]; read_frame(tfframe, 1, @@ -912,10 +903,8 @@ int TimeFrontMain::process_buffer(VFrame **frame, { for (int i = 1; i <= config.frame_range; i++) { - framelist[i] = new VFrame ( - outframes[0]->get_w(), - outframes[0]->get_h(), - outframes[0]->get_color_model()); + framelist[i] = new VFrame (outframes[0]->get_w(), outframes[0]->get_h(), + outframes[0]->get_color_model(), 0); read_frame(framelist[i], 0, diff --git a/cinelerra-5.1/plugins/titler/titler.C b/cinelerra-5.1/plugins/titler/titler.C index e52da6db..060e3eb9 100644 --- a/cinelerra-5.1/plugins/titler/titler.C +++ b/cinelerra-5.1/plugins/titler/titler.C @@ -1464,7 +1464,7 @@ void TitleMain::draw_background() delete bg_frame; bg_frame = 0; } if( !bg_frame ) - bg_frame = new VFrame(0, -1, bw, bh, output_model, -1); + bg_frame = new VFrame(bw, bh, output_model); int64_t position = get_source_position() - get_source_start(); if( !read_background(bg_frame, position, output_model) ) { if( !overlay_frame ) @@ -1607,7 +1607,8 @@ VFrame *TitleMain::add_image(const char *path) VFrame *vframe = get_image(path); if( !vframe && (vframe=VFramePng::vframe_png(path)) != 0 ) { if( vframe->get_color_model() != text_model ) { - VFrame *frame = new VFrame(vframe->get_w(), vframe->get_h(), text_model); + VFrame *frame = new VFrame(vframe->get_w(), vframe->get_h(), + text_model, 0); frame->transfer_from(vframe); delete vframe; vframe = frame; } diff --git a/cinelerra-5.1/plugins/translate/translate.C b/cinelerra-5.1/plugins/translate/translate.C index 7d00ee28..ce112b04 100644 --- a/cinelerra-5.1/plugins/translate/translate.C +++ b/cinelerra-5.1/plugins/translate/translate.C @@ -193,12 +193,8 @@ int TranslateMain::process_realtime(VFrame *input_ptr, VFrame *output_ptr) temp_frame = 0; } if(!temp_frame) - temp_frame = new VFrame(0, - -1, - input_ptr->get_w(), - input_ptr->get_h(), - input->get_color_model(), - -1); + temp_frame = new VFrame(input_ptr->get_w(), input_ptr->get_h(), + input->get_color_model(), 0); temp_frame->copy_from(input); input = temp_frame; } diff --git a/cinelerra-5.1/plugins/wave/wave.C b/cinelerra-5.1/plugins/wave/wave.C index 9193e52a..82b750ce 100644 --- a/cinelerra-5.1/plugins/wave/wave.C +++ b/cinelerra-5.1/plugins/wave/wave.C @@ -526,12 +526,8 @@ int WaveEffect::process_realtime(VFrame *input, VFrame *output) { if(input->get_rows()[0] == output->get_rows()[0]) { - if(!temp_frame) temp_frame = new VFrame(0, - -1, - input->get_w(), - input->get_h(), - input->get_color_model(), - -1); + if(!temp_frame) temp_frame = new VFrame(input->get_w(), input->get_h(), + input->get_color_model(), 0); temp_frame->copy_from(input); this->input = temp_frame; } diff --git a/cinelerra-5.1/plugins/whirl/whirl.C b/cinelerra-5.1/plugins/whirl/whirl.C index 6c920dfc..3b034490 100644 --- a/cinelerra-5.1/plugins/whirl/whirl.C +++ b/cinelerra-5.1/plugins/whirl/whirl.C @@ -448,12 +448,8 @@ int WhirlEffect::process_realtime(VFrame *input, VFrame *output) { if(input->get_rows()[0] == output->get_rows()[0]) { - if(!temp_frame) temp_frame = new VFrame(0, - -1, - input->get_w(), - input->get_h(), - input->get_color_model(), - -1); + if(!temp_frame) temp_frame = new VFrame(input->get_w(), input->get_h(), + input->get_color_model(), 0); temp_frame->copy_from(input); this->input = temp_frame; } diff --git a/cinelerra-5.1/plugins/yuv411/yuv411.C b/cinelerra-5.1/plugins/yuv411/yuv411.C index 6b3900b5..84ead782 100644 --- a/cinelerra-5.1/plugins/yuv411/yuv411.C +++ b/cinelerra-5.1/plugins/yuv411/yuv411.C @@ -166,7 +166,7 @@ int yuv411Main::process_realtime(VFrame *input_ptr, VFrame *output_ptr) temp_frame = 0; } if( !temp_frame ) - temp_frame = new VFrame(w, h, colormodel); + temp_frame = new VFrame(w, h, colormodel, 0); if( input_ptr == output_ptr ) { temp_frame->copy_from(input_ptr); input_ptr = temp_frame; diff --git a/cinelerra-5.1/plugins/yuvshift/yuvshift.C b/cinelerra-5.1/plugins/yuvshift/yuvshift.C index e16364a2..558c4804 100644 --- a/cinelerra-5.1/plugins/yuvshift/yuvshift.C +++ b/cinelerra-5.1/plugins/yuvshift/yuvshift.C @@ -343,7 +343,7 @@ int YUVShiftEffect::process_realtime(VFrame *input, VFrame *output) delete temp_frame; temp_frame = 0; } if( !temp_frame ) - temp_frame = new VFrame(w, h, color_model); + temp_frame = new VFrame(w, h, color_model, 0); frame = temp_frame; if( color_model != input->get_color_model() ) BC_CModels::transfer(frame->get_rows(), input->get_rows(), diff --git a/cinelerra-5.1/plugins/zoom/zoom.C b/cinelerra-5.1/plugins/zoom/zoom.C index 1ab1a7e3..b5c74d03 100644 --- a/cinelerra-5.1/plugins/zoom/zoom.C +++ b/cinelerra-5.1/plugins/zoom/zoom.C @@ -253,41 +253,22 @@ int ZoomMain::process_realtime(VFrame *incoming, VFrame *outgoing) if(is_before) { - if(!temp) temp = new VFrame(outgoing->get_w(), - outgoing->get_h(), - outgoing->get_color_model()); + if(!temp) temp = new VFrame(outgoing->get_w(), outgoing->get_h(), + outgoing->get_color_model(), 0); temp->clear_frame(); - overlayer->overlay(temp, - outgoing, - in_x, - in_y, - in_x + in_w, - in_y + in_h, - 0, - 0, - temp->get_w(), - temp->get_h(), - 1.0, - TRANSFER_REPLACE, - CUBIC_LINEAR); + overlayer->overlay(temp, outgoing, + in_x, in_y, in_x + in_w, in_y + in_h, + 0, 0, temp->get_w(), temp->get_h(), + 1.0, TRANSFER_REPLACE, CUBIC_LINEAR); outgoing->copy_from(temp); } else { outgoing->clear_frame(); - overlayer->overlay(outgoing, - incoming, - in_x, - in_y, - in_x + in_w, - in_y + in_h, - 0, - 0, - temp->get_w(), - temp->get_h(), - 1.0, - TRANSFER_REPLACE, - CUBIC_LINEAR); + overlayer->overlay(outgoing, incoming, + in_x, in_y, in_x + in_w, in_y + in_h, + 0, 0, temp->get_w(), temp->get_h(), + 1.0, TRANSFER_REPLACE, CUBIC_LINEAR); } return 0; diff --git a/cinelerra-5.1/plugins/zoomblur/zoomblur.C b/cinelerra-5.1/plugins/zoomblur/zoomblur.C index d26928e5..aa7e87b1 100644 --- a/cinelerra-5.1/plugins/zoomblur/zoomblur.C +++ b/cinelerra-5.1/plugins/zoomblur/zoomblur.C @@ -566,12 +566,8 @@ SET_TRACE this->output = frame; - if(!temp) temp = new VFrame(0, - -1, - frame->get_w(), - frame->get_h(), - frame->get_color_model(), - -1); + if(!temp) temp = new VFrame(frame->get_w(), frame->get_h(), + frame->get_color_model(), 0); temp->copy_from(frame); this->input = temp;