#include "bchash.h"
#include "bcsignals.h"
#include "clip.h"
+#include "cstrdup.h"
#include "edl.h"
#include "file.h"
#include "filesystem.h"
ff_video_options[0] = 0;
ff_audio_bitrate = 0;
ff_video_bitrate = 0;
- ff_video_quality = 0;
+ ff_video_quality = -1;
jpeg_quality = 80;
aspect_ratio = -1;
ac3_bitrate = 128;
png_use_alpha = 0;
+
exr_use_alpha = 0;
exr_compression = 0;
tiff_cmodel = 0;
tiff_compression = 0;
+ mov_sphere = 0;
+ jpeg_sphere = 0;
use_header = 1;
id = EDL::next_id();
- reset_timecode();
return 0;
}
//printf("Asset::boundaries %d %d %f\n", __LINE__, sample_rate, frame_rate);
}
-int Asset::reset_timecode()
-{
- strcpy(reel_name, "cin0000");
- reel_number = 0;
- tcstart = 0;
- tcend = 0;
- tcformat = 0;
-
- return 0;
-}
-
void Asset::copy_from(Asset *asset, int do_index)
{
copy_location(asset);
tiff_cmodel = asset->tiff_cmodel;
tiff_compression = asset->tiff_compression;
-
- strcpy(reel_name, asset->reel_name);
- reel_number = asset->reel_number;
- tcstart = asset->tcstart;
- tcend = asset->tcend;
- tcformat = asset->tcformat;
+
+
+ mov_sphere = asset->mov_sphere;
+ jpeg_sphere = asset->jpeg_sphere;
}
int64_t Asset::get_index_offset(int channel)
return 0;
}
-Asset& Asset::operator=(Asset &asset)
-{
-printf("Asset::operator=\n");
- copy_location(&asset);
- copy_format(&asset, 1);
- return *this;
-}
-
-
-int Asset::equivalent(Asset &asset,
- int test_audio,
- int test_video)
+int Asset::equivalent(Asset &asset, int test_audio, int test_video, EDL *edl)
{
- int result = (!strcmp(asset.path, path) &&
- format == asset.format);
+ int result = format == asset.format ? 1 : 0;
+ if( result && strcmp(asset.path, path) ) {
+ char *out_path = edl ? FileSystem::basepath(edl->path) : 0;
+ char *sp = out_path ? strrchr(out_path,'/') : 0;
+ if( sp ) *++sp = 0;
+ char *apath = FileSystem::basepath(asset.path);
+ char *tpath = FileSystem::basepath(this->path);
+ if( out_path ) {
+ if( *apath != '/' ) {
+ char *cp = cstrcat(2, out_path, apath);
+ delete [] apath; apath = FileSystem::basepath(cp);
+ delete [] cp;
+ }
+ if( *tpath != '/' ) {
+ char *cp = cstrcat(2, out_path, tpath);
+ delete [] tpath; tpath = FileSystem::basepath(cp);
+ delete [] cp;
+ }
+ }
+ if( strcmp(apath, tpath) ) result = 0;
+ delete [] apath;
+ delete [] tpath;
+ delete [] out_path;
+ }
- if(result && format == FILE_FFMPEG)
- result = !strcmp(fformat, asset.fformat);
+ if(result && format == FILE_FFMPEG && strcmp(fformat, asset.fformat) )
+ result = 0;
if(test_audio && result)
{
width == asset.width &&
height == asset.height &&
!strcmp(vcodec, asset.vcodec) &&
- strcmp(reel_name, asset.reel_name) == 0 &&
- reel_number == asset.reel_number &&
- tcstart == asset.tcstart &&
- tcend == asset.tcend &&
- tcformat == asset.tcformat);
+ mov_sphere == asset.mov_sphere &&
+ jpeg_sphere == asset.jpeg_sphere);
if(result && format == FILE_FFMPEG)
result = !strcmp(ff_video_options, asset.ff_video_options) &&
ff_video_bitrate == asset.ff_video_bitrate &&
return result;
}
-int Asset::operator==(Asset &asset)
-{
-
- return equivalent(asset,
- 1,
- 1);
-}
-
-int Asset::operator!=(Asset &asset)
-{
- return !(*this == asset);
-}
-
int Asset::test_path(const char *path)
{
if(!strcasecmp(this->path, path))
audio_length = file->tag.get_property("AUDIO_LENGTH", (int64_t)0);
acodec[0] = 0;
file->tag.get_property("ACODEC", acodec);
-
- if(!video_data)
- {
- tcstart = 0;
- tcend = audio_length;
- tcformat = 0;
- }
return 0;
}
file->tag.get_property("VCODEC", vcodec);
video_length = file->tag.get_property("VIDEO_LENGTH", (int64_t)0);
+ mov_sphere = file->tag.get_property("MOV_SPHERE", 0);
+ jpeg_sphere = file->tag.get_property("JPEG_SPHERE", 0);
single_frame = file->tag.get_property("SINGLE_FRAME", (int64_t)0);
interlace_autofixoption = file->tag.get_property("INTERLACE_AUTOFIX",0);
ilacefixmethod_to_xmltext(string, ILACE_FIXMETHOD_NONE);
interlace_fixmethod = ilacefixmethod_from_xmltext(file->tag.get_property("INTERLACE_FIXMETHOD",string), ILACE_FIXMETHOD_NONE);
- file->tag.get_property("REEL_NAME", reel_name);
- reel_number = file->tag.get_property("REEL_NUMBER", reel_number);
- tcstart = file->tag.get_property("TCSTART", tcstart);
- tcend = file->tag.get_property("TCEND", tcend);
- tcformat = file->tag.get_property("TCFORMAT", tcformat);
-
return 0;
}
file->tag.set_property("VCODEC", vcodec);
file->tag.set_property("VIDEO_LENGTH", video_length);
+ file->tag.set_property("MOV_SPHERE", mov_sphere);
+ file->tag.set_property("JPEG_SPHERE", jpeg_sphere);
file->tag.set_property("SINGLE_FRAME", single_frame);
file->tag.set_property("INTERLACE_AUTOFIX", interlace_autofixoption);
ilacefixmethod_to_xmltext(string, interlace_fixmethod);
file->tag.set_property("INTERLACE_FIXMETHOD", string);
-
- file->tag.set_property("REEL_NAME", reel_name);
- file->tag.set_property("REEL_NUMBER", reel_number);
- file->tag.set_property("TCSTART", tcstart);
- file->tag.set_property("TCEND", tcend);
- file->tag.set_property("TCFORMAT", tcformat);
-
file->append_tag();
if(video_data)
file->tag.set_title("/VIDEO");
tiff_cmodel = GET_DEFAULT("TIFF_CMODEL", tiff_cmodel);
tiff_compression = GET_DEFAULT("TIFF_COMPRESSION", tiff_compression);
- GET_DEFAULT("REEL_NAME", reel_name);
- reel_number = GET_DEFAULT("REEL_NUMBER", reel_number);
- tcstart = GET_DEFAULT("TCSTART", tcstart);
- tcend = GET_DEFAULT("TCEND", tcend);
- tcformat = GET_DEFAULT("TCFORMAT", tcformat);
-
+ mov_sphere = GET_DEFAULT("MOV_SPHERE", mov_sphere);
+ jpeg_sphere = GET_DEFAULT("JPEG_SPHERE", jpeg_sphere);
boundaries();
}
UPDATE_DEFAULT("EXR_COMPRESSION", exr_compression);
UPDATE_DEFAULT("TIFF_CMODEL", tiff_cmodel);
UPDATE_DEFAULT("TIFF_COMPRESSION", tiff_compression);
+
+
+
+ UPDATE_DEFAULT("MOV_SPHERE", mov_sphere);
+ UPDATE_DEFAULT("JPEG_SPHERE", jpeg_sphere);
}
+
+
+
if(do_bits)
{
UPDATE_DEFAULT("BITS", bits);
UPDATE_DEFAULT("SINGLE_FRAME", single_frame);
}
-
- UPDATE_DEFAULT("REEL_NAME", reel_name);
- UPDATE_DEFAULT("REEL_NUMBER", reel_number);
- UPDATE_DEFAULT("TCSTART", tcstart);
- UPDATE_DEFAULT("TCEND", tcend);
- UPDATE_DEFAULT("TCFORMAT", tcformat);
}
" height %d vcodec %4.4s aspect_ratio %f ilace_mode %s\n",
video_data, layers, program, frame_rate, width, height,
vcodec, aspect_ratio,string);
- fprintf(fp," reel_name %s reel_number %i tcstart %jd tcend %jd tcf %d\n",
- reel_name, reel_number, tcstart, tcend, tcformat);
fprintf(fp," video_length %jd repeat %d\n", video_length, single_frame);
-
-
+ printf(" mov_sphere=%d jpeg_sphere=%d\n", mov_sphere, jpeg_sphere);
return 0;
}
return 0;
}
-int Asset::set_timecode(char *tc, int format, int end)
-{
- int hr, min, sec;
-
- hr = ((int) tc[0] - 48) * 10 + (int) tc[1] - 48;
- min = ((int) tc[3] - 48) * 10 + (int) tc[4] - 48;
- sec = ((int) tc[6] - 48) * 10 + (int) tc[7] - 48;
-
- // This needs to be modified to handle drop-frame
-
- if(end)
- tcend = (int64_t) (((hr * 3600) + (min * 60) + sec) * frame_rate);
- else
- tcstart = (int64_t) (((hr * 3600) + (min * 60) + sec) * frame_rate);
-
- tcformat = format;
- return 0;
-}
-
-