cin="$1"
THIRDPARTY=`pwd`/thirdparty
unset LIBS LDFLAGS CFLAGS CPPFLAGS CXXFLAGS
-
+export ac_cv_header_xmmintrin_h=no
+for f in ./quicktime/Makefile.am ./libmpeg3/Makefile.am; do
+ sed -e 's/-Wl,--no-undefined//' -i $f
+done
rm -rf thirdparty; cp -a $cin/thirdparty .
for f in configure.ac Makefile.am autogen.sh; do mv $f $f.cv; cp -a $cin/$f .; done
mv m4 m4.cv
echo LIBS=$LIBS
echo CFLAGS=$CFLAGS
-export ac_cv_header_xmmintrin_h=no
# -lmxxxxx dies, feed it a -lm early to prevent misformed parameters
export LIBS="-la52 -ldjbfft -lfaac -lfaad -lHalf -lIex -lIexMath -lIlmThread -lImath -llavfile -llavjpeg -lm -lmjpegutils -lmmxsse -lmp3lame -lmp4ff -lmpeg2encpp -lmpgdecoder -lmplex2 -logg -lvorbis -lvorbisenc -lvorbisfile -lx264 -lyuvfilters -lpthread -ldl"
# po Makefile construction error: skip it
./configure
+echo "Run:"
+echo "export ac_cv_header_xmmintrin_h=no"
+echo "export THIRDPARTY=\"$THIRDPARTY\""
exit
# have to rebuild these by hand
-# cd plugins/libeffecttv/.libs/; rm libeffectv.a; ar r libeffecttv.a effecttv.o
-# cd quicktime/encore50/.libs/; rm libencore.a; ar r libencore.a *.o
+# have to get rid of -Wl,--no-undefined"
+# cd plugins/libeffecttv/.libs/; \rm -f libeffecttv.a; ar r libeffecttv.a effecttv.o
+# cd quicktime/encore50/.libs/; \rm -f libencore.a; ar r libencore.a *.o
# cd quicktime; vi Makefile; remove -Wl,--no-undefined from:, make
# libquicktimecv_la_LDFLAGS = -version-info 1:0:0 -release 1.6.0
mwindow->plugindb->remove(plugin);
remove(plugin_path);
char index_path[BCTEXTLEN];
- sprintf(index_path, "%s/%s", mwindow->preferences->plugin_dir, PLUGIN_FILE);
+ snprintf(index_path, sizeof(index_path), "%s/%s",
+ mwindow->preferences->plugin_dir, PLUGIN_FILE);
remove(index_path);
char png_path[BCTEXTLEN];
if( plugin->get_theme_png_path(png_path, mwindow->preferences->theme) )
}
char asset_dir[BCTEXTLEN], jobs_path[BCTEXTLEN];
- sprintf(asset_dir, "%s/%s", tmp_path, asset_title);
- sprintf(jobs_path, "%s/bd.jobs", asset_dir);
+ snprintf(asset_dir, sizeof(asset_dir), "%s/%s", tmp_path, asset_title);
+ snprintf(jobs_path, sizeof(jobs_path), "%s/bd.jobs", asset_dir);
mwindow->batch_render->reset(jobs_path);
int ret = create_bd_jobs(&mwindow->batch_render->jobs, asset_dir);
mwindow->undo->update_undo_after(_("create bd"), LOAD_ALL);
#include "dcraw.h"
+//const static data
+const double DCRaw_data::xyz_rgb[3][3] = { /* XYZ from RGB */
+ { 0.412453, 0.357580, 0.180423 },
+ { 0.212671, 0.715160, 0.072169 },
+ { 0.019334, 0.119193, 0.950227 } };
+const float DCRaw_data::d65_white[3] = {
+ 0.950456, 1.000000, 1.088754 };
+
/*
All global variables are defined here, and all functions that
access them are prefixed with "CLASS". Note that a thread-safe
if (!filt) filt = 0.8;
size = 4*M_PI*max / filt;
- if (size == UINT_MAX) size--;
+ if (size > INT_MAX-1) size = INT_MAX-1;
curve = (short *) calloc (size+1, sizeof *curve);
merror (curve, "foveon_make_curve()");
curve[0] = size;
{
static const short hood[] = { -1,-1, -1,0, -1,1, 0,-1, 0,1, 1,-1, 1,0, 1,1 };
short *pix, prev[3], *curve[8], (*shrink)[3];
- float cfilt=0, ddft[3][3][2], ppm[3][3][3];
+ float cfilt, ddft[3][3][2], ppm[3][3][3];
float cam_xyz[3][3], correct[3][3], last[3][3], trans[3][3];
float chroma_dq[3], color_dq[3], diag[3][3], div[3];
float (*black)[3], (*sgain)[3], (*sgrow)[3];
float fsum[3], val, frow, num;
int row, col, c, i, j, diff, sgx, irow, sum, min, max, limit;
int dscr[2][2], dstb[4], (*smrow[7])[3], total[4], ipix[3];
- int work[3][3], smlast, smred, smred_p=0, dev[3];
+ int work[3][3], smlast, smred, smred_p, dev[3];
int satlev[3], keep[4], active[4];
unsigned dim[3], *badpix;
- double dsum=0, trsum[3];
+ double dsum, trsum[3];
char str[128];
const char* cp;
+// clear local storage
+ pix = 0; ZERO(prev); ZERO(curve); ZERO(shrink);
+ cfilt = 0; ZERO(ddft); ZERO(ppm);
+ ZERO(cam_xyz); ZERO(correct); ZERO(last); ZERO(trans);
+ ZERO(chroma_dq); ZERO(color_dq); ZERO(diag); ZERO(div);
+ ZERO(black); ZERO(sgain); ZERO(sgrow);
+ ZERO(fsum); val = frow = num = 0;
+ row = col = c = i = j = diff = sgx = irow = sum = min = max = limit = 0;
+ ZERO(dscr); ZERO(dstb); ZERO(smrow); ZERO(total); ZERO(ipix);
+ ZERO(work); ZERO(smlast); ZERO(smred); smred_p=0; ZERO(dev);
+ ZERO(satlev); ZERO(keep); ZERO(active);
+ ZERO(dim); badpix = 0;
+ dsum = 0; ZERO(trsum);
+ ZERO(str);
+ cp = 0;
if (verbose)
fprintf (stderr,_("Foveon interpolation...\n"));
case 61450:
cblack[4] = cblack[5] = MIN(sqrt(len),64);
case 50714: /* BlackLevel */
- if (!(cblack[4] * cblack[5]))
+ if ((cblack[4] * cblack[5])==0)
cblack[4] = cblack[5] = 1;
FORC (cblack[4] * cblack[5])
cblack[6+c] = getreal(type);
unsigned fov_huff[1024];
float clb_cbrt[0x10000], clb_xyz_cam[3][4];
uchar pana_buf[0x4000]; int pana_vbits;
+// const static data
+ static const double xyz_rgb[3][3];
+ static const float d65_white[3];
+
};
class DCRaw : public DCRaw_data {
void write_ppm_tiff(void);
void write_cinelerra(void);
void reset();
-//const data
- const double xyz_rgb[3][3] = { /* XYZ from RGB */
- { 0.412453, 0.357580, 0.180423 },
- { 0.212671, 0.715160, 0.072169 },
- { 0.019334, 0.119193, 0.950227 } };
- const float d65_white[3] = { 0.950456, 1, 1.088754 };
-
public:
DCRaw();
~DCRaw();
insert_video_plugin("Histogram", &keyframe);
}
char asset_dir[BCTEXTLEN], jobs_path[BCTEXTLEN];
- sprintf(asset_dir, "%s/%s", tmp_path, asset_title);
- sprintf(jobs_path, "%s/dvd.jobs", asset_dir);
+ snprintf(asset_dir, sizeof(asset_dir), "%s/%s", tmp_path, asset_title);
+ snprintf(jobs_path, sizeof(jobs_path), "%s/dvd.jobs", asset_dir);
mwindow->batch_render->reset(jobs_path);
int ret = create_dvd_jobs(&mwindow->batch_render->jobs, asset_dir);
mwindow->undo->update_undo_after(_("create dvd"), LOAD_ALL);
void ExportEDLWindow::create_objects()
{
int x = 5, y = 5;
- add_subwindow(new BC_Title(x,
- y,
+ add_subwindow(new BC_Title(x, y,
_("Select a file to export to:")));
y += 25;
track = track->next)
{
- char tmp[10];
+ char tmp[16];
sprintf(tmp, "%i\n", serial+1);
BC_ListBoxItem *listitem = new BC_ListBoxItem(tmp);
}
}
if( ret < 0 ) {
-printf("** seek fail %ld, %ld\n", pos, tstmp);
+printf("** seek fail %jd, %jd\n", pos, tstmp);
seeked = need_packet = 0;
st_eof(flushed=1);
return -1;
if(!result)
{
const char *exec_path = File::get_cinlib_path();
- sprintf(mjpeg_command, "%s/%s", exec_path, HVPEG_EXE);
+ snprintf(mjpeg_command, sizeof(mjpeg_command),
+ "%s/%s", exec_path, HVPEG_EXE);
append_vcommand_line(mjpeg_command);
if(asset->aspect_ratio > 0)
// this one is cinelerra-x.x.x/thirdparty/mjpegtools/mpeg2enc
{
const char *exec_path = File::get_cinlib_path();
- sprintf(mjpeg_command, "%s/%s -v 0 ", exec_path, MJPEG_EXE);
+ snprintf(mjpeg_command, sizeof(mjpeg_command),
+ "%s/%s -v 0 ", exec_path, MJPEG_EXE);
// Must disable interlacing if MPEG-1
switch (asset->vmpeg_preset)
// quantization of 1 when bitrate is fixed. Perfectly intuitive.
if(asset->vmpeg_fix_bitrate)
{
- sprintf(string, " -b %d -q 1", asset->vmpeg_bitrate / 1000);
+ snprintf(string, sizeof(string),
+ " -b %d -q 1", asset->vmpeg_bitrate / 1000);
}
else
{
- sprintf(string, " -b 0 -q %d", asset->vmpeg_quantization);
+ snprintf(string, sizeof(string),
+ " -b 0 -q %d", asset->vmpeg_quantization);
}
- strcat(mjpeg_command, string);
-
-
-
-
-
+ strncat(mjpeg_command, string, sizeof(mjpeg_command));
// Aspect ratio
int aspect_ratio_code = -1;
aspect_ratio_code = 2;
}
sprintf(string, " -a %d", aspect_ratio_code);
- strcat(mjpeg_command, string);
+ strncat(mjpeg_command, string, sizeof(mjpeg_command));
eprintf(_("Unsupported frame rate %f\n"), asset->frame_rate);
}
sprintf(string, " -F %d", frame_rate_code);
- strcat(mjpeg_command, string);
+ strncat(mjpeg_command, string, sizeof(mjpeg_command));
- strcat(mjpeg_command,
- asset->vmpeg_progressive ? " -I 0" : " -I 1");
+ strncat(mjpeg_command,
+ asset->vmpeg_progressive ? " -I 0" : " -I 1",
+ sizeof(mjpeg_command));
sprintf(string, " -M %d", file->cpus);
- strcat(mjpeg_command, string);
+ strncat(mjpeg_command, string, sizeof(mjpeg_command));
if(!asset->vmpeg_progressive)
{
- strcat(mjpeg_command, asset->vmpeg_field_order ? " -z b" : " -z t");
+ strncat(mjpeg_command,
+ asset->vmpeg_field_order ? " -z b" : " -z t",
+ sizeof(mjpeg_command));
}
- sprintf(string, " -f %d", asset->vmpeg_preset);
- strcat(mjpeg_command, string);
+ snprintf(string, sizeof(string), " -f %d", asset->vmpeg_preset);
+ strncat(mjpeg_command, string, sizeof(mjpeg_command));
- sprintf(string, " -g %d -G %d", asset->vmpeg_iframe_distance, asset->vmpeg_iframe_distance);
- strcat(mjpeg_command, string);
+ snprintf(string, sizeof(string),
+ " -g %d -G %d", asset->vmpeg_iframe_distance, asset->vmpeg_iframe_distance);
+ strncat(mjpeg_command, string, sizeof(mjpeg_command));
- if(asset->vmpeg_seq_codes) strcat(mjpeg_command, " -s");
+ if(asset->vmpeg_seq_codes)
+ strncat(mjpeg_command, " -s", sizeof(mjpeg_command));
- sprintf(string, " -R %d", CLAMP(asset->vmpeg_pframe_distance, 0, 2));
- strcat(mjpeg_command, string);
+ snprintf(string, sizeof(string),
+ " -R %d", CLAMP(asset->vmpeg_pframe_distance, 0, 2));
+ strncat(mjpeg_command, string, sizeof(mjpeg_command));
- sprintf(string, " -o '%s'", asset->path);
- strcat(mjpeg_command, string);
+ snprintf(string, sizeof(string), " -o '%s'", asset->path);
+ strncat(mjpeg_command, string, sizeof(mjpeg_command));
if (default_asset->audio_data)
{
packages[local_current_package] = new RenderPackage;
- sprintf(packages[current_package]->path, "%s.audio", default_asset->path);
+ snprintf(packages[current_package]->path,
+ sizeof(packages[current_package]->path),
+ "%s.audio", default_asset->path);
local_current_package++;
}
asset = new Asset(*default_asset);
if(!get_master() && preferences->renderfarm_vfs && preferences->use_renderfarm)
- sprintf(asset->path, RENDERFARM_FS_PREFIX "%s", package->path);
+ snprintf(asset->path, sizeof(asset->path),
+ RENDERFARM_FS_PREFIX "%s", package->path);
else
- strcpy(asset->path, package->path);
+ strncpy(asset->path, package->path, sizeof(asset->path));
file = new File;
{
// open failed
char string[BCTEXTLEN];
- sprintf(string, _("Couldn't open %s"), asset->path);
+ snprintf(string, sizeof(string), _("Couldn't open %s"), asset->path);
ErrorBox error(_(PROGRAM_NAME ": Error"),
mwindow->gui->get_abs_cursor_x(1),
mwindow->gui->get_abs_cursor_y(1));
char *plugin_title = plugin->title;
char string[BCTEXTLEN];
- sprintf(string, "%s: %s", track_title, _(plugin_title));
+ snprintf(string, sizeof(string), "%s: %s", track_title, _(plugin_title));
shared_data.append(new BC_ListBoxItem(string));
}
for(int i = 0; i < module_locations.total; i++)
libtheora/libogg libtheora/libvorbis ; do
lib=`dirname $dep`; needs=`basename $dep`
eval pkg_lib="\$PKG_$lib"; eval needs_lib="\$HAVE_$needs";
- echo "dep lib=$lib, needs=$needs, pkg_lib=$pkg_lib, needs_lib=$needs_lib" > /dev/tty
if test "x$pkg_lib" != "xno"; then
eval "PKG_$needs=yes"
fi
PKG_PROVIDE([libuuid])
PKG_PROVIDE([libvorbis])
PKG_PROVIDE([mjpegtools])
-echo "WANT_OPENEXR = $WANT_OPENEXR" > /dev/tty
PKG_PROVIDE([openexr], [$WANT_OPENEXR])
-echo "PKG_openexr = $PKG_openexr" > /dev/tty
PKG_PROVIDE([openjpeg])
PKG_PROVIDE([tiff])
PKG_PROVIDE([twolame])
strcpy(string, new_dir);
}
else
- if(!is_root_dir(current_dir))
{
-// current directory is not root
- if(current_dir[strlen(current_dir) - 1] == '/')
-// current_dir already has ending /
- sprintf(string, "%s%s", current_dir, new_dir);
- else
-// need ending /
- sprintf(string, "%s/%s", current_dir, new_dir);
+ snprintf(string, sizeof(string),
+ is_root_dir(current_dir) ||
+ current_dir[strlen(current_dir)-1] == '/' ?
+// current directory is root or already has ending /
+ "%s%s" : "%s/%s",
+ current_dir, new_dir);
}
- else
- sprintf(string, "%s%s", current_dir, new_dir);
//printf("FileSystem::parse_directories 3 %s %s\n", new_dir, string);
strcpy(new_dir, string);
}
static inline void complete_path(char *full_path, char *path) {
- char dir[zmpeg3_t::STRLEN];
+ char dir[STRLEN];
if( path[0] != '/' && getcwd(dir, sizeof(dir)) )
- sprintf(full_path, "%s/%s", dir, path);
+ snprintf(full_path, STRLEN, "%s/%s", dir, path);
else
strcpy(full_path, path);
}
}
static inline void joinpath(char *path, char *dir, char *filename) {
- sprintf(path, "%s/%s", dir, filename);
+ snprintf(path, STRLEN, "%s/%s", dir, filename);
}
static inline int64_t path_total_bytes(char *path) {
config.mode2 == MotionCVConfig::SAVE ) {
reset_cache_file();
char save_file[BCTEXTLEN];
- sprintf(save_file, "%s.sav", config.tracking_file);
+ snprintf(save_file, sizeof(save_file), "%s.sav", config.tracking_file);
#ifdef DEBUG
printf("MotionCVMain::process_buffer 2 rename tracking file: %s to %s\n",
config.tracking_file, save_file);
if( key == active_key ) return 1;
if( !active_fp ) {
close_cache_file();
- sprintf(cache_file, "%s.bak", config.tracking_file);
+ snprintf(cache_file, sizeof(cache_file), "%s.bak", config.tracking_file);
::rename(config.tracking_file, cache_file);
if( !(active_fp = fopen(config.tracking_file, "w")) ) {
perror(config.tracking_file);
config.tracking_type == MotionScan::SAVE ) {
reset_cache_file();
char save_file[BCTEXTLEN];
- sprintf(save_file,"%s.bak", config.tracking_file);
+ snprintf(save_file, sizeof(save_file), "%s.bak", config.tracking_file);
#ifdef DEBUG
printf("MotionMain::process_buffer 2 rename tracking file: %s to %s\n",
config.tracking_file, save_file);
if( key == active_key ) return 1;
if( !active_fp ) {
close_cache_file();
- sprintf(cache_file, "%s.bak", config.tracking_file);
+ snprintf(cache_file, sizeof(cache_file), "%s.bak", config.tracking_file);
::rename(config.tracking_file, cache_file);
if( !(active_fp = fopen(config.tracking_file, "w")) ) {
perror(config.tracking_file);
if( key == active_key ) return 1;
if( !active_fp ) {
close_cache_file();
- sprintf(cache_file, "%s.bak", config.tracking_file);
+ snprintf(cache_file, sizeof(cache_file), "%s.bak", config.tracking_file);
::rename(config.tracking_file, cache_file);
if( !(active_fp = fopen(config.tracking_file, "w")) ) {
perror(config.tracking_file);
int fd = ms_time < config.ms_time ? -1 : open(filename_png, O_RDWR);
if( fd < 0 ) { // file does not exist, export it
char command[BCTEXTLEN];
- sprintf(command,
+ snprintf(command, sizeof(command),
"inkscape --without-gui --export-background=0x000000 "
"--export-background-opacity=0 -d %f %s --export-png=%s",
config.dpi, config.svg_file, filename_png);
{
// Runs the inkscape
char command[1024];
- sprintf(command, "inkscape --with-gui %s", edit->client->config.svg_file);
+ snprintf(command, sizeof(command),
+ "inkscape --with-gui %s", edit->client->config.svg_file);
printf(_("Running external SVG editor: %s\n"), command);
enable_cancel();
return 1;
}
-void TitleCurSubMenu::add_subitem(int popup_type, va_list ap, const char *fmt)
+void TitleCurSubMenu::add_subitemx(int popup_type, va_list ap, const char *fmt)
{
char item[BCSTRLEN];
vsnprintf(item, sizeof(item)-1, fmt, ap);
public:
TitleCurSubMenu(TitleCurItem *cur_item);
~TitleCurSubMenu();
- void add_subitem(int popup_type, va_list ap, const char *fmt);
+ void add_subitemx(int popup_type, va_list ap, const char *fmt);
void add_subitem(int popup_type, const char *fmt,...) { va_list ap;
- va_start(ap, fmt); add_subitem(popup_type, ap, fmt); va_end(ap);
+ va_start(ap, fmt); add_subitemx(popup_type, ap, fmt); va_end(ap);
}
void add_subitem(const char *fmt,...) { va_list ap;
- va_start(ap, fmt); add_subitem(POPUP_NONE, ap, fmt); va_end(ap);
+ va_start(ap, fmt); add_subitemx(POPUP_NONE, ap, fmt); va_end(ap);
}
TitleCurItem *cur_item;
};