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++)
{
stop();
delete draw_lock;
-// delete interrupted_lock;
delete item_lock;
delete temp_picon;
delete temp_picon2;
{
draw_lock->lock("ResourceThread::run");
-
while(!interrupted)
{
// Pull off item
command.change_type = CHANGE_ALL;
command.realtime = 0;
render_engine = new RenderEngine(0,
- mwindow->preferences, 0, 0, 0);
+ mwindow->preferences, 0, 0);
render_engine_id = nested_edl->id;
render_engine->set_vcache(mwindow->video_cache);
render_engine->set_acache(mwindow->audio_cache);
File *ResourceThread::get_audio_source(Asset *asset)
{
+ if( interrupted ) asset = 0;
+
if( audio_asset && audio_asset != asset && (!asset ||
strcmp(audio_asset->path, asset->path)) )
{
File *ResourceThread::get_video_source(Asset *asset)
{
+ if( interrupted ) asset = 0;
+
if( video_asset && video_asset != asset && (!asset ||
strcmp(video_asset->path, asset->path)) )
{
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
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);
}
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();
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");