X-Git-Url: http://git.cinelerra-gg.org/git/?a=blobdiff_plain;f=cinelerra-5.1%2Fcinelerra%2Fvmodule.C;h=1958ef78222efb1959728f87c265e46d223ba714;hb=c279e21fc2394a7908bbd1ba8c79b116fe9fb14a;hp=e8016e1b5e3bc5e8f084dca2252f8000347ad33b;hpb=e9a3c57c8d3bb4d79e76a4c3942f86a66d3c267e;p=goodguy%2Fhistory.git diff --git a/cinelerra-5.1/cinelerra/vmodule.C b/cinelerra-5.1/cinelerra/vmodule.C index e8016e1b..1958ef78 100644 --- a/cinelerra-5.1/cinelerra/vmodule.C +++ b/cinelerra-5.1/cinelerra/vmodule.C @@ -159,9 +159,10 @@ int VModule::import_frame(VFrame *output, VEdit *current_edit, __LINE__, nested_edl, current_edit->nested_edl); // Convert requested direction to command - if(renderengine->command->command == CURRENT_FRAME) + if( renderengine->command->command == CURRENT_FRAME || + renderengine->command->command == LAST_FRAME ) { - command = CURRENT_FRAME; + command = renderengine->command->command; } else if(direction == PLAY_REVERSE) @@ -230,11 +231,8 @@ int VModule::import_frame(VFrame *output, VEdit *current_edit, { File *file = 0; - if(debug) printf("VModule::import_frame %d cache=%p\n", - __LINE__, - get_cache()); - if(current_edit->asset) - { +//printf("VModule::import_frame %d cache=%p\n", __LINE__, get_cache()); + if( current_edit->asset ) { get_cache()->age(); file = get_cache()->check_out(current_edit->asset, get_edl()); @@ -266,17 +264,9 @@ int VModule::import_frame(VFrame *output, VEdit *current_edit, { // integrate position from start of edit. double speed_position = edit_startsource; - FloatAuto *previous = 0; - FloatAuto *next = 0; FloatAutos *speed_autos = (FloatAutos*)track->automation->autos[AUTOMATION_SPEED]; - for(int64_t i = edit_startproject; i < direction_position; i++) - { - double speed = speed_autos->get_value(i, - PLAY_FORWARD, - previous, - next); - speed_position += speed; - } + speed_position += speed_autos->automation_integral(edit_startproject, + direction_position-edit_startproject, PLAY_FORWARD); //printf("VModule::import_frame %d %lld %lld\n", __LINE__, position, (int64_t)speed_position); position = (int64_t)speed_position; } @@ -304,7 +294,7 @@ int VModule::import_frame(VFrame *output, VEdit *current_edit, } else { - max_position = Units::to_int64(nested_edl->tracks->total_playable_length() * + max_position = Units::to_int64(nested_edl->tracks->total_length() * frame_rate - 1); } @@ -315,18 +305,19 @@ int VModule::import_frame(VFrame *output, VEdit *current_edit, int use_cache = renderengine && renderengine->command->single_frame(); - int use_asynchronous = !use_cache && renderengine && +// int use_asynchronous = !use_cache && +// renderengine && // Try to make rendering go faster. // But converts some formats to YUV420, which may degrade input format. -// renderengine->command->realtime && - renderengine->get_edl()->session->video_asynchronous; +//// renderengine->command->realtime && +// renderengine->get_edl()->session->video_asynchronous; if(file) { if(debug) printf("VModule::import_frame %d\n", __LINE__); - if(use_asynchronous) - file->start_video_decode_thread(); - else +// if(use_asynchronous) +// file->start_video_decode_thread(); +// else file->stop_video_thread(); int64_t normalized_position = Units::to_int64(position * @@ -453,7 +444,7 @@ int VModule::import_frame(VFrame *output, VEdit *current_edit, !EQUIV(in_w, asset_w) || !EQUIV(in_h, asset_h)) { - if(debug) printf("VModule::import_frame %d file -> temp -> output\n", __LINE__); +//printf("VModule::import_frame %d file -> temp -> output\n", __LINE__); @@ -488,12 +479,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); } @@ -733,7 +721,13 @@ output->get_opengl_state(), get_edl()->session->interpolation_type); } result = 1; + output->copy_stacks((*input)); + + +//printf("VModule::import_frame %d\n", __LINE__); +//(*input)->dump_params(); +//output->dump_params(); } else // file -> output @@ -888,6 +882,11 @@ current_cmodel); } result = 1; } + +// printf("VModule::import_frame %d cache=%p\n", +// __LINE__, +// get_cache()); + } else // Source is silence @@ -988,12 +987,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);