#include "samples.h"
#include "vframe.h"
+//static int temp_debug = 0;
//suppress noref warning
void *vorbis0_ov_callbacks[] = {
&OV_CALLBACKS_DEFAULT, &OV_CALLBACKS_NOCLOSE,
format_completion->unlock();
}
- if( temp_frame ) delete temp_frame;
-
+ if( temp_frame ) {
+//printf("File::~File %d temp_debug=%d\n", __LINE__, --temp_debug);
+ delete temp_frame;
+ }
close_file(0);
this->white_balance_raw = value;
}
-
void File::set_cache_frames(int value)
{
// caching only done locally
int File::delete_oldest()
{
-// caching only done locally
+// return the number of bytes freed
return frame_cache->delete_oldest();
}
this->wr = wr;
file = 0;
- if( debug ) printf("File::open_file %d\n", __LINE__);
-
if( debug ) printf("File::open_file %p %d\n", this, __LINE__);
switch( this->asset->format ) {
const int debug = 0;
//printf("File::read_frame pos=%jd cache=%d 1frame=%d\n",
// current_frame, use_cache, asset->single_frame);
- if( debug ) PRINT_TRACE
-
-//printf("File::read_frame %d\n", __LINE__);
-
if( video_thread && !is_thread ) return video_thread->read_frame(frame);
-
-//printf("File::read_frame %d\n", __LINE__);
- if( debug ) PRINT_TRACE
if( !file ) return 1;
if( debug ) PRINT_TRACE
int result = 0;
int advance_position = 1;
int cache_active = use_cache || asset->single_frame ? 1 : 0;
int64_t cache_position = !asset->single_frame ? current_frame : -1;
+
// Test cache
if( cache_active && frame_cache->get_frame(frame, cache_position,
current_layer, asset->frame_rate) ) {
// Need temp
else if( frame->get_color_model() != BC_COMPRESSED &&
(supported_colormodel != frame->get_color_model() ||
- frame->get_w() != asset->width ||
- frame->get_h() != asset->height) ) {
+ (!file->can_scale_input() &&
+ (frame->get_w() != asset->width ||
+ frame->get_h() != asset->height))) ) {
// printf("File::read_frame %d\n", __LINE__);
// Can't advance position here because it needs to be added to cache
}
}
-// printf("File::read_frame %d\n", __LINE__);
if( !temp_frame ) {
- temp_frame = new VFrame(0,
- -1,
- asset->width,
- asset->height,
- supported_colormodel,
- -1);
+ temp_frame = new VFrame(asset->width, asset->height, supported_colormodel, 0);
}
// printf("File::read_frame %d\n", __LINE__);
return 0;
}
-int File::can_copy_from(Asset *asset,
- int64_t position,
- int output_w,
- int output_h)
+int File::can_copy_from(Asset *asset, int64_t position, int output_w, int output_h)
{
if( asset && file ) {
return asset->width == output_w &&