--- /dev/null
+#!/bin/bash
+
+dir="$1"
+shift
+path="/home"
+bld="git-repo"
+proj="cinelerra"
+base="cinelerra-5.0"
+
+if [ ! -d "$path/$dir/$bld" ]; then
+ echo "$bld missing in /$path/$dir"
+ exit 1
+fi
+
+cd "$path/$dir/$bld"
+rm -rf "$proj"
+git clone "http://cinelerra.org/git-repo/$proj"
+if [ $? -ne 0 ]; then
+ echo "git clone $bld/$proj/ failed"
+ exit 1
+fi
+
+cd "$proj/$base"
+if [ "$dir" = "ubuntu" ]; then
+ echo "CFLAGS += -DPNG_SKIP_SETJMP_CHECK=1" >> global_config
+fi
+if [ "$dir" = "centos" ]; then
+ echo "EXTRA_LIBS += -lnuma" >> global_config
+ echo "CFLAGS += -D__STDC_CONSTANT_MACROS -D__STDC_LIMIT_MACROS" >> global_config
+fi
+if [ "$dir" = "suse" ]; then
+ echo "EXTRA_LIBS += -lnuma" >> global_config
+fi
+
+STATIC_LIBRARIES=0 ./configure >& log
+make >> log 2>&1 $@
+make install >> log 2>&1
+
+echo "finished: scanning log for ***"
+grep -a "\*\*\*" log
+
--- /dev/null
+#!/bin/bash
+
+dir="$1"
+path="/home"
+bld="git-repo"
+proj="cinelerra"
+base="cinelerra-5.0"
+
+if [ ! -d "$path/$dir/$bld/$proj" ]; then
+ echo "$bld/$proj missing in $path/$dir"
+ exit 1
+fi
+
+cd "$path/$dir/$bld/$proj"
+git pull
+if [ $? -ne 0 ]; then
+ echo "git pull $bld/$proj failed"
+ exit 1
+fi
+
+cd "$base"
+make rebuild_all >& log1
+
+echo "finished: scanning log for ***"
+grep -a "\*\*\*" log1
+
--- /dev/null
+#!/bin/bash
+
+if [ $# -ne 2 ]; then
+ echo "usage: $0 <os> <typ>"
+ echo " os = centos | ubuntu | suse"
+ echo " typ = static | dynamic"
+ exit 1
+fi
+
+dir="$1"
+path="/home"
+bld="git-repo"
+proj="cinelerra"
+base="cinelerra-5.0"
+
+centos="centos-7.0-1406"
+suse="opensuse-13.2"
+ubuntu="ubuntu-14.04.1"
+
+eval os="\${$dir}"
+if [ -z "$os" ]; then
+ echo "unknown os: $dir"
+fi
+
+if [ ! -d "$path/$dir/$bld/$proj/$base" ]; then
+ echo "missing $bld/$proj/$base in $path/$dir"
+ exit 1
+fi
+
+typ=$2
+sfx=`uname -m`-`date +"%Y%m%d"`
+if [ "$typ" = "static" ]; then
+ sfx="$sfx-static"
+elif [ "$typ" != "dynamic" ]; then
+ echo "err: suffix must be [static | dynamic]"
+ exit 1
+fi
+
+cd "$path/$dir/$bld/$proj/$base"
+tar -C bin -cJf "../$base-$os-$sfx.txz" .
+rm -f "$path/$dir/$base-$os-$sfx.txz"
+mv "../$base-$os-$sfx.txz" "$path/$dir/."
+
--- /dev/null
+#!/bin/bash
+
+if [ `id -u` -ne 0 ]; then
+ echo "you must be root"
+fi
+
+if [ $# -ne 1 ]; then
+ echo "usage: $0 <os>"
+ echo " <os> = [centos | suse | ubuntu]"
+fi
+
+dir="$1"
+
+case "$dir" in
+"centos")
+ yum -y install nasm libavc1394-devel libusb-devel flac-devel \
+ libjpeg-devel libdv-devel libdvdnav-devel libdvdread-devel \
+ libtheora-devel libiec61883-devel uuid-devel giflib-devel \
+ ncurses-devel ilmbase-devel fftw-devel OpenEXR-devel \
+ libsndfile-devel libXft-devel libXinerama-devel libXv-devel \
+ xorg-x11-fonts-misc xorg-x11-fonts-cyrillic xorg-x11-fonts-Type1 \
+ xorg-x11-fonts-ISO8859-1-100dpi xorg-x11-fonts-ISO8859-1-75dpi \
+ libpng-devel bzip2-devel zlib-devel kernel-headers \
+ libavc1394 festival-devel libiec61883-devel flac-devel \
+ libsndfile-devel libtheora-devel linux-firmware ivtv-firmware \
+ libvorbis-devel texinfo xz-devel lzma-devel cmake udftools
+ yasm=yasm-1.2.0-7.fc21.x86_64.rpm
+ release=http://archives.fedoraproject.org/pub/fedora/linux/releases/21
+ url=$release/Everything/x86_64/os/Packages/y/$yasm
+ wget -P /tmp $url
+ yum -y install /tmp/$yasm
+ rm -f /tmp/$yasm
+ ;;
+"suse")
+ zypper -n install nasm gcc gcc-c++ zlib-devel texinfo libpng16-devel \
+ freeglut-devel libXv-devel alsa-devel libbz2-devel ncurses-devel \
+ libXinerama-devel freetype-devel libXft-devel giblib-devel ctags \
+ bitstream-vera-fonts xorg-x11-fonts-core xorg-x11-fonts dejavu-fonts \
+ openexr-devel libavc1394-devel festival-devel libjpeg8-devel libdv-devel \
+ libdvdnav-devel libdvdread-devel libiec61883-devel libuuid-devel \
+ ilmbase-devel fftw3-devel libsndfile-devel libtheora-devel flac-devel \
+ cmake patch libnuma-devel lzma-devel udftools
+ if [ ! -f /usr/lib64/libtermcap.so ]; then
+ ln -s libtermcap.so.2 /usr/lib64/libtermcap.so
+ fi
+ ;;
+"ubuntu")
+ apt-get -y install apt-file sox nasm yasm g++ build-essential libz-dev texinfo \
+ libpng-dev freeglut3-dev libxv-dev libasound2-dev libbz2-dev \
+ libncurses5-dev libxinerama-dev libfreetype6-dev libxft-dev giblib-dev \
+ exuberant-ctags ttf-bitstream-vera xfonts-75dpi xfonts-100dpi \
+ fonts-dejavu libopenexr-dev libavc1394-dev festival-dev fftw3-dev \
+ libdc1394-22-dev libiec61883-dev libesd0-dev libflac-dev \
+ libsndfile1-dev libtheora-dev git cmake udftools libxml2-utils
+ ;;
+ *)
+ echo "unknown os: $dir"
+ exit 1;
+ ;;
+esac
+
+rm -rf "/home/$dir"
+mkdir -p "/home/$dir"
+chmod a+rwx -R "/home/$dir"
+
--- /dev/null
+#!/bin/bash
+
+dir="$1"
+shift
+path="/home"
+bld="git-repo"
+proj="cinelerra"
+base="cinelerra-5.0"
+
+if [ ! -d "$path/$dir/$bld" ]; then
+ echo "$bld missing in $path/$dir"
+ exit 1
+fi
+
+cd "$path/$dir/$bld"
+rm -rf "$proj"
+git clone "http://cinelerra.org/git-repo/$proj"
+if [ $? -ne 0 ]; then
+ echo "git clone $bld/$proj/ failed"
+ exit 1
+fi
+
+cd "$proj/$base"
+if [ "$dir" = "ubuntu" ]; then
+ echo "CFLAGS += -DPNG_SKIP_SETJMP_CHECK=1" >> global_config
+fi
+if [ "$dir" = "centos" ]; then
+ echo "EXTRA_LIBS += -lnuma" >> global_config
+ echo "CFLAGS += -D__STDC_CONSTANT_MACROS -D__STDC_LIMIT_MACROS" >> global_config
+fi
+if [ "$dir" = "suse" ]; then
+ echo "EXTRA_LIBS += -lnuma" >> global_config
+fi
+
+STATIC_LIBRARIES=1 ./configure >& log
+make >> log 2>&1 $@
+make install >> log 2>&1
+
+echo "finished: scanning log for ***"
+grep -a "\*\*\*" log
+
void CLASS sony_decrypt (unsigned *data, int len, int start, int key)
{
- static unsigned pad[128], p;
+ static unsigned pad[128], p = 0;
if (start) {
for (p=0; p < 4; p++)
for (p=0; p < 127; p++)
pad[p] = htonl(pad[p]);
}
- while (len--)
- *data++ ^= pad[p++ & 127] = pad[(p+1) & 127] ^ pad[(p+65) & 127];
+ while (len--) {
+ *data++ ^= pad[p & 127] = pad[(p+1) & 127] ^ pad[(p+65) & 127];
+ p++;
+ }
}
void CLASS sony_load_raw()
struct v4l2_tuner tuner;
memset(&tuner, 0, sizeof(tuner));
tuner.index = dev_tuner;
- if(!vioctl(VIDIOC_G_TUNER, &tuner) < 0)
+ if(!vioctl(VIDIOC_G_TUNER, &tuner))
{
// printf("DeviceV4L2Base::v4l2_open audmode=%d rxsubchans=%d\n",
// tuner.audmode, tuner.rxsubchans);
// printf("File::read_frame %d\n", __LINE__);
temp_frame->copy_stacks(frame);
- file->read_frame(temp_frame);
+ int result = file->read_frame(temp_frame);
+ if( result && frame->get_status() > 0 )
+ frame->set_status(-1);
//for(int i = 0; i < 1000 * 1000; i++) ((float*)temp_frame->get_rows()[0])[i] = 1.0;
// printf("File::read_frame %d %d %d %d %d %d\n",
// temp_frame->get_color_model(),
{
// Can't advance position here because it needs to be added to cache
//printf("File::read_frame %d\n", __LINE__);
- file->read_frame(frame);
+ int result = file->read_frame(frame);
+ if( result && frame->get_status() > 0 )
+ frame->set_status(-1);
//for(int i = 0; i < 100 * 1000; i++) ((float*)frame->get_rows()[0])[i] = 1.0;
}
if( !ff || len < 0 ) return -1;
int ch = file->current_channel;
int64_t pos = file->current_sample;
- ff->decode(ch, pos, buffer, len);
- return 0;
+ int ret = ff->decode(ch, pos, buffer, len);
+ if( ret > 0 ) return 0;
+ memset(buffer,0,len*sizeof(*buffer));
+ return -1;
}
int FileFFMPEG::read_frame(VFrame *frame)
if( !ff ) return -1;
int layer = file->current_layer;
int64_t pos = file->current_frame;
- ff->decode(layer, pos, frame);
- return 0;
+ int ret = ff->decode(layer, pos, frame);
+ frame->set_status(ret);
+ if( ret > 0 ) return 0;
+ frame->clear_frame();
+ return -1;
}
// This would have copied the color matrix for interpolate, but
// required the same plugin stack as the reader.
// frame->copy_stacks(result->data);
+ frame->copy_params(result->data);
}
result->age = get_age();
}
HAVE_ESOUND := y
HAVE_FIREWIRE := y
HAVE_OSS := y
-STATIC_LIBRARIES := n
+STATIC_LIBRARIES := y
OBJDIR := $(shell uname --machine)
int VFrame::reset_parameters(int do_opengl)
{
+ status = 1;
scene = 0;
field2_offset = -1;
memory_type = VFrame::PRIVATE;
next_effects.remove_all_objects();
prev_effects.remove_all_objects();
params->clear();
+ status = 1;
}
void VFrame::copy_params(VFrame *src)
{
+ status = src->status;
params->copy_from(src->params);
}
int VFrame::filefork_size()
{
- return sizeof(int) * 12 + sizeof(long);
+ return sizeof(int) * 13 + sizeof(long);
}
*(int*)(buffer + 32) = compressed_allocated;
*(int*)(buffer + 36) = compressed_size;
*(int*)(buffer + 40) = is_keyframe;
- *(long*)(buffer + 44) = sequence_number;
+ *(int*)(buffer + 44) = status;
+ *(long*)(buffer + 48) = sequence_number;
//printf("VFrame::to_filefork %d %lld\n", __LINE__, sequence_number);
}
is_keyframe = *(int*)(buffer + 40);
- sequence_number = *(long*)(buffer + 44);
+ status = *(int*)(buffer + 44);
+ sequence_number = *(long*)(buffer + 48);
//printf("VFrame::from_filefork %d %lld\n", __LINE__, sequence_number);
}
// Relevant configuration parameters must be passed on.
BC_Hash* get_params();
+// get/set read status -1/err, 0/noxfer, 1/ok
+ int get_status() { return status; }
+ void set_status(int v) { status = v; }
+
// Compare stacks and params from 2 images and return 1 if equal.
int equal_stacks(VFrame *src);
// For writing discontinuous frames in background rendering
long sequence_number;
double timestamp;
-
+// read status of input frame -1/err, 0/noxfr, 1/ok
+ int status;
// OpenGL support
int is_keyframe;
// State of the current texture
invertvideo := video_tools
linearblur := video_tools
loopvideo := video_tools
+lof := video_tools
motion2 := video_tools
motionblur := video_tools
motion := video_tools
linearblur \
liveaudio \
livevideo \
+ lof \
loopaudio \
loopvideo \
motion \
--- /dev/null
+include ../../global_config
+
+OBJS = $(OBJDIR)/lof.o $(OBJDIR)/lofwindow.o
+
+PLUGIN = lof
+
+include ../../plugin_config
+
+
+$(OBJDIR)/lof.o: lof.C
+$(OBJDIR)/lofwindow.o: lofwindow.C
--- /dev/null
+
+#include "lofwindow.h"
+
+// repeat last output frame on read_frame error
+// uses vframe.status as read status
+
+REGISTER_PLUGIN(LofEffect)
+
+LofConfig::LofConfig()
+{
+ errs = 0;
+ miss = 1;
+ mark = 1;
+}
+
+void LofConfig::copy_from(LofConfig &src)
+{
+ errs = src.errs;
+ miss = src.miss;
+ mark = src.mark;
+}
+
+int LofConfig::equivalent(LofConfig &src)
+{
+ if( errs != src.errs ) return 0;
+ if( miss != src.miss ) return 0;
+ if( mark != src.mark ) return 0;
+ return 1;
+}
+
+void LofConfig::interpolate(LofConfig &prev, LofConfig &next,
+ long prev_frame, long next_frame, long current_frame)
+{
+ copy_from(prev);
+}
+
+LofEffect::LofEffect(PluginServer *server)
+ : PluginVClient(server)
+{
+ frm = 0;
+}
+LofEffect::~LofEffect()
+{
+ delete frm;
+}
+
+const char* LofEffect::plugin_title() { return _("Last Frame"); }
+int LofEffect::is_realtime() { return 1; }
+
+NEW_WINDOW_MACRO(LofEffect, LofWindow)
+LOAD_CONFIGURATION_MACRO(LofEffect, LofConfig)
+
+void LofEffect::update_gui()
+{
+ if(thread) {
+ thread->window->lock_window();
+ load_configuration();
+ ((LofWindow*)thread->window)->update();
+ thread->window->unlock_window();
+ }
+}
+
+
+void LofEffect::save_data(KeyFrame *keyframe)
+{
+ FileXML output;
+ output.set_shared_output(keyframe->get_data(), MESSAGESIZE);
+ output.tag.set_title("LOF");
+ output.tag.set_property("ERRS", config.errs);
+ output.tag.set_property("MISS", config.miss);
+ output.tag.set_property("MARK", config.mark);
+ output.append_tag();
+ output.terminate_string();
+}
+
+void LofEffect::read_data(KeyFrame *keyframe)
+{
+ FileXML input;
+ input.set_shared_input(keyframe->get_data(), strlen(keyframe->get_data()));
+ while(!input.read_tag()) {
+ if(input.tag.title_is("LOF")) {
+ config.errs = input.tag.get_property("ERRS", config.errs);
+ config.miss = input.tag.get_property("MISS", config.miss);
+ config.mark = input.tag.get_property("MARK", config.mark);
+ }
+ }
+}
+
+
+int LofEffect::process_buffer(VFrame *frame, int64_t start_position, double frame_rate)
+{
+ load_configuration();
+ int w = frame->get_w(), h = frame->get_h();
+ int colormodel = frame->get_color_model();
+ if( frm && (frm->get_w() != w || frm->get_h() != h ||
+ frm->get_color_model() != colormodel ) ) {
+ delete frm; frm = 0;
+ }
+ int ret = read_frame(frame, 0, start_position, frame_rate, get_use_opengl());
+ if( ret >= 0 ) ret = frame->get_status();
+ if( ret > 0 ) {
+ if( !frm )
+ frm = new VFrame(w, h, colormodel, -1);
+ frm->copy_from(frame);
+ }
+ else if( !frm )
+ frame->clear_frame();
+ else if( (ret < 0 && config.errs) || (!ret && config.miss) ) {
+ frame->copy_from(frm);
+ if( config.mark ) {
+ VFrame dot(1, 1, BC_RGBA8888, -1);
+ *(uint32_t*)dot.get_rows()[0] = 0xff0000ff;
+ int scl = 48, sz = 3, ww = w/scl, hh = h/scl;
+ if( ww < sz ) ww = w > sz ? sz : w;
+ if( hh < sz ) hh = h > sz ? sz : h;
+ BC_CModels::transfer(
+ frame->get_rows(), dot.get_rows(),
+ frame->get_y(), frame->get_u(), frame->get_v(),
+ dot.get_y(), dot.get_u(), dot.get_v(),
+ 0, 0, 1, 1, 0, 0, ww, hh,
+ dot.get_color_model(), frame->get_color_model(),
+ 0, dot.get_w(), frame->get_w());
+ }
+ }
+ return 0;
+}
+
+
--- /dev/null
+#ifndef LOF_H
+#define LOF_H
+
+#include "filexml.h"
+#include "bchash.h"
+#include "language.h"
+#include "pluginvclient.h"
+#include "vframe.h"
+
+class LofConfig;
+class LofEffect;
+class LofWindow;
+
+class LofConfig {
+public:
+ int errs;
+ int miss;
+ int mark;
+
+ LofConfig();
+
+ void copy_from(LofConfig &src);
+ int equivalent(LofConfig &src);
+ void interpolate(LofConfig &prev, LofConfig &next,
+ long prev_frame, long next_frame, long current_frame);
+};
+
+class LofEffect : public PluginVClient {
+public:
+ LofEffect(PluginServer *server);
+ ~LofEffect();
+
+ PLUGIN_CLASS_MEMBERS(LofConfig)
+ int process_buffer(VFrame *frame, int64_t start_position, double frame_rate);
+ int is_realtime();
+ void save_data(KeyFrame *keyframe);
+ void read_data(KeyFrame *keyframe);
+ void update_gui();
+
+ VFrame *frm;
+};
+
+
+#endif
--- /dev/null
+#include "lofwindow.h"
+#include "language.h"
+
+LofWindow::LofWindow(LofEffect *plugin)
+ : PluginClientWindow(plugin, 260, 160, 260, 160, 0)
+{
+ this->plugin = plugin;
+}
+
+void LofWindow::create_objects()
+{
+ int x = 10, y = 10;
+ BC_Title *title = new BC_Title(x, y, _("Show last good output frame"));
+ add_subwindow(title); y += title->get_h() + 5;
+ title = new BC_Title(x+20, y, _("(you should fix the input)"));
+ add_subwindow(title); y += title->get_h() + 20;
+ add_tool(errfrms = new LofToggle(this, &plugin->config.errs, x, y, _("errant frames")));
+ y += errfrms->get_h() + 5;
+ add_tool(misfrms = new LofToggle(this, &plugin->config.miss, x, y, _("missed frames")));
+ y += misfrms->get_h() + 5;
+ add_tool(mrkfrms = new LofToggle(this, &plugin->config.mark, x, y, _("mark fixed frames")));
+ show_window();
+ flush();
+}
+
+void LofWindow::update()
+{
+ errfrms->update(plugin->config.errs);
+ misfrms->update(plugin->config.miss);
+ mrkfrms->update(plugin->config.mark);
+}
+
+LofToggle::LofToggle(LofWindow *lofwin, int *output, int x, int y, const char *lbl)
+ : BC_CheckBox(x, y, *output, lbl)
+{
+ this->lofwin = lofwin;
+ this->output = output;
+}
+
+LofToggle::~LofToggle()
+{
+}
+
+int LofToggle::handle_event()
+{
+ *output = get_value();
+ lofwin->plugin->send_configure_change();
+ return 1;
+}
+
--- /dev/null
+#ifndef __LOFWINDOW_H__
+#define __LOFWINDOW_H__
+
+#include "lof.h"
+#include "pluginvclient.h"
+
+class LofToggle;
+class LofWindow;
+
+class LofToggle : public BC_CheckBox
+{
+public:
+ LofToggle(LofWindow *lofwin, int *output, int x, int y, const char *lbl);
+ ~LofToggle();
+ int handle_event();
+
+ LofWindow *lofwin;
+ int *output;
+};
+
+class LofWindow : public PluginClientWindow {
+public:
+ LofWindow(LofEffect *plugin);
+ void create_objects();
+ void update();
+ LofEffect *plugin;
+
+ LofToggle *errfrms;
+ LofToggle *misfrms;
+ LofToggle *mrkfrms;
+};
+
+
+#endif
--- /dev/null
+diff -urN a/sifter_1210.xml b/sifter_1210.xml
+--- a/sifter_1210.xml 2015-11-04 15:13:54.195120748 -0500
++++ b/sifter_1210.xml 2015-11-04 15:14:11.319176863 -0500
+@@ -11,12 +11,12 @@
+
+ #define MAX_BSIZE 1000
+
+-inline int partition(LADSPA_Data array[], int left, int right);
++int partition(LADSPA_Data array[], int left, int right);
+
+ #ifdef __clang__
+ void q_sort(LADSPA_Data array[], int left, int right) {
+ #else
+-inline void q_sort(LADSPA_Data array[], int left, int right) {
++void q_sort(LADSPA_Data array[], int left, int right) {
+ #endif
+ float pivot = partition(array, left, right);
+
+@@ -28,7 +28,7 @@
+ }
+ }
+
+-inline int partition(LADSPA_Data array[], int left, int right) {
++int partition(LADSPA_Data array[], int left, int right) {
+ float pivot = array[left];
+
+ while (left < right) {