X-Git-Url: http://git.cinelerra-gg.org/git/?p=goodguy%2Fhistory.git;a=blobdiff_plain;f=cinelerra-5.1%2Fcinelerra%2Fresourcethread.C;h=70138be063718066ce11e5474bbb1849ca1e21ac;hp=853ae0245119c231d41f2976f618b831bc0c926c;hb=a19a685a46ddc630010788707d9e5b9d2342af46;hpb=49f85559268fc040fe7ba5611cc0520793cf728b diff --git a/cinelerra-5.1/cinelerra/resourcethread.C b/cinelerra-5.1/cinelerra/resourcethread.C index 853ae024..70138be0 100644 --- a/cinelerra-5.1/cinelerra/resourcethread.C +++ b/cinelerra-5.1/cinelerra/resourcethread.C @@ -164,7 +164,6 @@ ResourceThread::ResourceThread(MWindow *mwindow, MWindowGUI *gui) temp_picon = 0; temp_picon2 = 0; draw_lock = new Condition(0, "ResourceThread::draw_lock", 0); -// interrupted_lock = new Condition(0, "ResourceThread::interrupted_lock", 0); item_lock = new Mutex("ResourceThread::item_lock"); audio_buffer = 0; for(int i = 0; i < MAXCHANNELS; i++) @@ -186,7 +185,6 @@ ResourceThread::~ResourceThread() { stop(); delete draw_lock; -// delete interrupted_lock; delete item_lock; delete temp_picon; delete temp_picon2; @@ -298,7 +296,6 @@ void ResourceThread::run() { draw_lock->lock("ResourceThread::run"); - while(!interrupted) { // Pull off item @@ -451,12 +448,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(0, -1, source_w, source_h, source_cmodel, -1); } // Get temporary to copy cached frame to @@ -470,12 +462,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); } @@ -488,17 +475,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(); @@ -541,48 +523,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");