build fixes/upgrades, bd/ffmpeg/dialog tweaks
authorGood Guy <[email protected]>
Sat, 24 Dec 2016 23:23:35 +0000 (16:23 -0700)
committerGood Guy <[email protected]>
Sat, 24 Dec 2016 23:23:35 +0000 (16:23 -0700)
14 files changed:
cinelerra-5.1/bld_scripts/bld_prepare.sh
cinelerra-5.1/cinelerra/bdcreate.C
cinelerra-5.1/cinelerra/ffmpeg.C
cinelerra-5.1/cinelerra/interfaceprefs.C
cinelerra-5.1/cinelerra/interfaceprefs.h
cinelerra-5.1/cinelerra/new.C
cinelerra-5.1/cinelerra/preferences.C
cinelerra-5.1/cinelerra/preferences.h
cinelerra-5.1/configure.ac
cinelerra-5.1/db/utils/framediff.C
cinelerra-5.1/guicast/bcsignals.C
cinelerra-5.1/plugins/interpolatevideo/opticflow.C
cinelerra-5.1/thirdparty/Makefile
cinelerra-5.1/thirdparty/src/mjpegtools.patch2 [new file with mode: 0644]

index 399fe30da512c894e7cb902c2913cba07c006abe..5d751adc14fcbfc6567943e96d15baf98d1d30da 100755 (executable)
@@ -24,7 +24,7 @@ case "$dir" in
     libavc1394 festival-devel libiec61883-devel flac-devel inkscape \
     libsndfile-devel libtheora-devel linux-firmware ivtv-firmware \
     libvorbis-devel texinfo xz-devel lzma-devel cmake udftools git \
-    autoconf automake
+    autoconf automake rpm-build
     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
@@ -44,7 +44,7 @@ case "$dir" in
     festival-devel libdc1394-devel libiec61883-devel esound-devel \
     flac-devel libsndfile-devel libtheora-devel linux-firmware \
     ivtv-firmware libvorbis-devel texinfo xz-devel lzma-devel cmake git \
-    autoconf automake
+    autoconf automake rpm-build
 #   ctags patch gcc-c++ perl::XML_Parser libtiff-devel python dvdauthor
   ;;
 "suse" | "leap")
@@ -56,11 +56,13 @@ case "$dir" in
     libdvdnav-devel libdvdread-devel libiec61883-devel libuuid-devel \
     ilmbase-devel fftw3-devel libsndfile-devel libtheora-devel flac-devel \
     libtiff-devel inkscape cmake patch libnuma-devel lzma-devel udftools git \
-    autoconf automake
+    yasm autoconf automake rpm-build
     if [ ! -f /usr/lib64/libtermcap.so ]; then
       ln -s libtermcap.so.2 /usr/lib64/libtermcap.so
     fi
   ;;
+#"ub16-10")
+#  apt-get -y install libx264-dev libx265-dev libvpx-dev libmjpegtools-dev
 "ubuntu" | "mint" | "ub14" | "ub15" | "ub16" | "debian")
   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 \
@@ -69,7 +71,7 @@ case "$dir" in
     fonts-dejavu libopenexr-dev libavc1394-dev festival-dev fftw3-dev gdb \
     libdc1394-22-dev libiec61883-dev libesd0-dev libflac-dev inkscape \
     libsndfile1-dev libtheora-dev cmake udftools libxml2-utils git \
-    autoconf automake
+    autoconf automake debhelper
   ;;
  *)
   echo "unknown os: $dir"
index f8e424dce5d4b3433f477ebdfa6b36c78e2852e3..de8042b3e9b6d772b89eb6775ecdaf646ab16aa2 100644 (file)
@@ -17,6 +17,7 @@
 #include "mwindowgui.h"
 #include "plugin.h"
 #include "pluginset.h"
+#include "preferences.h"
 #include "rescale.h"
 #include "track.h"
 #include "tracks.h"
@@ -426,6 +427,12 @@ BC_Window* CreateBD_Thread::new_gui()
 
        gui = new CreateBD_GUI(this, x, y, w, h);
        gui->create_objects();
+
+       if( getuid() != 0 ) {
+               mwindow->show_warning(
+                       &mwindow->preferences->bd_warn_root,
+                       _("Must be root to mount UDFS images\n"));
+       }
        return gui;
 }
 
index 31a0d22963afe40587d2871b162267cb9ac00293..172252f694416953d027ac4921987a65b33ca0ef 100644 (file)
@@ -427,6 +427,8 @@ int FFStream::write_packet(FFPacket &pkt)
 
 int FFStream::flush()
 {
+       if( writing < 0 )
+               return -1;
        int ret = 0;
        while( ret >= 0 ) {
                FFPacket pkt;
@@ -1839,9 +1841,10 @@ int FFMPEG::open_encoder(const char *type, const char *spec)
                        fst->add_bsfilter(bsfilter, !bsargs[0] ? 0 : bsargs);
        }
 
-       ff_unlock();
        if( !ret )
                start_muxer();
+
+       ff_unlock();
        av_dict_free(&sopts);
        return ret;
 }
index 58aef4973aad16fc6daf2e54bef188257c921289..e25b1fd90f6a014a46bae8ec3a2da42dc0bfd6a0 100644 (file)
@@ -140,6 +140,9 @@ void InterfacePrefs::create_objects()
        UseWarnVersion *ver_win = new UseWarnVersion(pwindow, x1, y1);
        add_subwindow(ver_win);
        y1 += ver_win->get_h() + 5;
+       BD_WarnRoot *bdwr_win = new BD_WarnRoot(pwindow, x1, y1);
+       add_subwindow(bdwr_win);
+       y1 += bdwr_win->get_h() + 5;
        PopupMenuBtnup *pop_win = new PopupMenuBtnup(pwindow, x1, y1);
        add_subwindow(pop_win);
        y1 += pop_win->get_h() + 25;
@@ -711,6 +714,19 @@ int UseWarnVersion::handle_event()
        return 1;
 }
 
+BD_WarnRoot::BD_WarnRoot(PreferencesWindow *pwindow, int x, int y)
+ : BC_CheckBox(x, y, pwindow->thread->preferences->bd_warn_root,
+       _("Create Bluray warns if not root"))
+{
+       this->pwindow = pwindow;
+}
+
+int BD_WarnRoot::handle_event()
+{
+       pwindow->thread->preferences->bd_warn_root = get_value();
+       return 1;
+}
+
 PopupMenuBtnup::PopupMenuBtnup(PreferencesWindow *pwindow, int x, int y)
  : BC_CheckBox(x, y, pwindow->thread->preferences->popupmenu_btnup,
        _("Popups activate on button up"))
index 15be9d2e34867a60a20a5d11caf99d6fd1646407..3005d4461d1a9867e9ae9e24e658fc61593675dd 100644 (file)
@@ -303,6 +303,14 @@ public:
        PreferencesWindow *pwindow;
 };
 
+class BD_WarnRoot : public BC_CheckBox
+{
+public:
+       BD_WarnRoot(PreferencesWindow *pwindow, int x, int y);
+       int handle_event();
+       PreferencesWindow *pwindow;
+};
+
 class ScanCommercials : public BC_CheckBox
 {
 public:
index fbc049e6ff77c6c1d15024d105efa29f896cc55f..fce4c09fd5833787fddf7459850de228e9fb2f8b 100644 (file)
@@ -54,7 +54,7 @@
 
 
 New::New(MWindow *mwindow)
- : BC_MenuItem(_("New"), "n", 'n')
+ : BC_MenuItem(_("New Project..."), "n", 'n')
 {
        this->mwindow = mwindow;
        script = 0;
@@ -136,7 +136,7 @@ int New::create_new_project()
 // Load file sequence
        mwindow->update_project(LOADMODE_REPLACE);
        mwindow->session->changes_made = 0;
-       mwindow->undo->update_undo_after(_("New"), LOAD_ALL);
+       mwindow->undo->update_undo_after(_("New Project"), LOAD_ALL);
        mwindow->gui->unlock_window();
        return 0;
 }
index e7fa696e893c9bc10a685df8d1b5804df31e1ad8..97efba935a3eb743fa7ab846307226e187db8d9b 100644 (file)
@@ -81,6 +81,7 @@ Preferences::Preferences()
        ffmpeg_marker_indexes = 1;
        warn_indexes = 1;
        warn_version = 1;
+       bd_warn_root = 1;
        popupmenu_btnup = 1;
        dvd_yuv420p_interlace = 0;
 
@@ -189,6 +190,7 @@ void Preferences::copy_from(Preferences *that)
        ffmpeg_marker_indexes = that->ffmpeg_marker_indexes;
        warn_indexes = that->warn_indexes;
        warn_version = that->warn_version;
+       bd_warn_root = that->bd_warn_root;
        popupmenu_btnup = that->popupmenu_btnup;
        dvd_yuv420p_interlace = that->dvd_yuv420p_interlace;
        renderfarm_nodes.remove_all_objects();
@@ -339,6 +341,7 @@ int Preferences::load_defaults(BC_Hash *defaults)
        ffmpeg_marker_indexes = defaults->get("FFMPEG_MARKER_INDEXES", ffmpeg_marker_indexes);
        warn_indexes = defaults->get("WARN_INDEXES", warn_indexes);
        warn_version = defaults->get("WARN_VERSION", warn_version);
+       bd_warn_root = defaults->get("BD_WARN_ROOT", bd_warn_root);
        popupmenu_btnup = defaults->get("POPUPMENU_BTNUP", popupmenu_btnup);
        dvd_yuv420p_interlace = defaults->get("DVD_YUV420P_INTERLACE", dvd_yuv420p_interlace);
        use_brender = defaults->get("USE_BRENDER", use_brender);
@@ -443,6 +446,7 @@ int Preferences::save_defaults(BC_Hash *defaults)
        defaults->update("FFMPEG_MARKER_INDEXES", ffmpeg_marker_indexes);
        defaults->update("WARN_INDEXES", warn_indexes);
        defaults->update("WARN_VERSION", warn_version);
+       defaults->update("BD_WARN_ROOT", bd_warn_root);
        defaults->update("POPUPMENU_BTNUP", popupmenu_btnup);
        defaults->update("DVD_YUV420P_INTERLACE", dvd_yuv420p_interlace);
        brender_asset->save_defaults(defaults,
index d6f1821d57a27f8ecaeb50ea4f595d7e77ea300d..3b2b221b9522dd3fdc2306b29021bba848e2bb41 100644 (file)
@@ -106,6 +106,7 @@ public:
 // warning
        int warn_indexes;
        int warn_version;
+       int bd_warn_root;
 // popup menus activate on button release
        int popupmenu_btnup;
 // use dvd yuv420p interlace format
index e0301ee8d6129879c82cc2cf363a606dbbab97da..a665849d79e317f25a8a6a9770233bb91e679c74 100644 (file)
@@ -13,8 +13,8 @@ CFG_CFLAGS+=" -pthread -Wall -Wno-unused-result"
 CFG_CFLAGS+=" -D__STDC_CONSTANT_MACROS"
 CFG_CFLAGS+=" -D__STDC_LIMIT_MACROS"
 CFG_CFLAGS+=" -DPNG_SKIP_SETJMP_CHECK=1"
-CFG_CFLAGS+=" -I/usr/include/freetype2"
 CFG_CFLAGS+=" -D_LARGEFILE_SOURCE -D_LARGEFILE64_SOURCE -D_FILE_OFFSET_BITS=64"
+CFG_CFLAGS+=" -I/usr/include/freetype2"
 
 AC_DEFUN([CHECK_WITH], [
 AC_ARG_WITH([$1],
@@ -303,12 +303,12 @@ PKG_3RD([twolame],[auto],
   [ libtwolame/.libs/libtwolame.a ],
   [  libtwolame ])
 
-PKG_3RD([x264],[yes],
+PKG_3RD([x264],[auto],
   [x264-snapshot-20160220-2245-stable],
   [ libx264.a ],
   [ . ])
 
-PKG_3RD([x265],[yes],
+PKG_3RD([x265],[auto],
   [x265_2.1],
   [ libx265.a ],
   [ . source ])
@@ -437,6 +437,8 @@ CHECK_LIB([libvorbis], [vorbisfile], [ov_open])
 CHECK_HEADERS([libvorbis], [vorbis file headers], [vorbis/vorbisfile.h])
 CHECK_LIB([libvpx], [vpx], [vpx_codec_decode])
 CHECK_HEADERS([libvpx], [vpx headers], [vpx/vpx_decoder.h])
+CHECK_LIB([mjpegtools], [mjpegutils], [mjpeg_info])
+CHECK_HEADERS([mjpegtools], [mjpegtools headers], [mjpegtools/mjpeg_types.h])
 CHECK_LIB([tiff], [tiff], [TIFFOpen])
 CHECK_HEADERS([tiff], [tiff headers], [tiff.h tiffio.h])
 CHECK_LIB([twolame], [twolame], [twolame_encode_buffer_float32_interleaved])
@@ -458,6 +460,9 @@ CHECK_HEADERS([giflib], [gif lib headers], [gif_lib.h])
 CHECK_LIB([fdk], [fdk-aac], [faacDecInit])
 CHECK_HEADERS([fdk], [fdk headers], [fdk-aac/genericStds.h])
 
+#if test "x$HAVE_mjpegtools" = "xyes"; then
+#CFG_CFLAGS+=" -I/usr/include/mjpegtools"
+#fi
 
 AC_DEFUN([CHECK_WANT], [
 RESULT=yes
@@ -591,14 +596,13 @@ AC_DEFUN([PKG_FORCED],[PKG_STATIC([$1],[forced])])
 # order matters
 for dep in \
         ffmpeg/faac ffmpeg/faad2 ffmpeg/twolame ffmpeg/lame ffmpeg/openjpeg \
-        ffmpeg/libvorbis ffmpeg/libtheora ffmpeg/x264 ffmpeg/fdk \
+        ffmpeg/libvorbis ffmpeg/libtheora ffmpeg/x264 ffmpeg/x265 ffmpeg/fdk \
         libiec61883/libraw1394 libavc1394/librom1394 \
         openexr/ilmbase ilmbase/libogg \
         libtheora/libogg libtheora/libvorbis ; do
-  lib=`dirname $dep`
-  eval pkg_lib="\$PKG_$lib"; eval have_lib="\$HAVE_$lib";
-  if test "x$pkg_lib" != "xno" ; then
-    needs=`basename $dep`
+  lib=`dirname $dep`;  needs=`basename $dep`
+  eval pkg_lib="\$PKG_$lib"; eval needs_lib="\$HAVE_$needs";
+  if test "x$pkg_lib" != "xno" -a "x$needs_lib" != "xyes" ; then
     eval "PKG_$needs=yes"
   fi
 done
index cac4372ac9ad7a6a12f0f82acda7939486c3a9c7..bedbcec9ea0218c5f9ab1f2dcbe7e9db6d816064 100644 (file)
@@ -45,8 +45,10 @@ int main(int ac, char **av)
       fprintf(fp,"P5\n%d %d\n255\n",w,h);
       uint8_t *ap = adat, *bp = bdat;
       for( int i=w*h; --i>=0; ++ap, ++bp ) {
-        int d = *ap-*bp;      m += d;
-        if( d < 0 ) d = -d;   n += d;
+        int d = *ap-*bp;
+        m += d;
+        if( d < 0 ) d = -d;
+        n += d;
         putc(clip(*ap-*bp+128), fp);
       }
       if( fp != stdout ) fclose(fp);
@@ -60,8 +62,10 @@ int main(int ac, char **av)
     uint8_t *ap = adat, *bp = bdat;
     int n = 0, m = 0;
     for( int i=w*h; --i>=0; ++ap, ++bp ) {
-      int d = *ap-*bp;      m += d;
-      if( d < 0 ) d = -d;   n += d;
+      int d = *ap-*bp;
+      m += d;
+      if( d < 0 ) d = -d;
+      n += d;
     }
   }
   fprintf(sfp, "%d %d\n",n,m);
index 2a6c8943315ab7cd1d220aef7ec4d34c5f8d60ca..ddb2c864b0a438b2084f215c8044c0201dc8bb80 100644 (file)
@@ -175,7 +175,7 @@ void BC_Signals::kill_subs()
                        if( fgetc(fd) == ' ' ) --sp;
 // Read in parent process
                for( ptr=string; !feof(fd) && (*ptr=fgetc(fd))!=' '; ++ptr );
-                       if( (*ptr=fgetc(fd)) == ' ' ) break;
+               if( (*ptr=fgetc(fd)) == ' ' ) break;
                *ptr = 0;
 
 // printf("kill_subs %d process=%d getpid=%d parent_process=%d\n",
index 9f94d6be6a7c872876391e5a02b6ca729d53974e..bf8a6762f1c50bff78b7e4421e9bf333459939ea 100644 (file)
@@ -87,8 +87,8 @@ void OpticFlowUnit::process_package(LoadPackage *package)
 {
        OpticFlowPackage *pkg = (OpticFlowPackage*)package;
        InterpolateVideo *plugin = server->plugin;
-       int w = plugin->frames[0]->get_w();
-       int h = plugin->frames[0]->get_h();
+       //int w = plugin->frames[0]->get_w();
+       //int h = plugin->frames[0]->get_h();
        struct timeval start_time;
        gettimeofday(&start_time, 0);
 
index c7cc7f3ca1aa0a45c8d9184217cbabcd131cfd66..aae252b0616990f739c013ebee3281803e7bf98b 100644 (file)
@@ -105,7 +105,7 @@ esound.mak_vars+= CFLAGS=""
 esound.ldflags=" -lm -lstdc++"
 faac.cfg_params= --enable-shared=no --without-mp4v2
 faad2.cfg_params= --enable-shared=no
-fdk.cfg_vars= ./autogen.sh ;
+fdk.cfg_vars= ./autogen.sh ; CFLAGS+=" -Wno-narrowing" CXXFLAGS+=" -Wno-narrowing"
 fdk.cfg_params= --enable-shared=no
 fdk.mak_params= ; for f in $(call bld_path,fdk,/lib*/include); do ln -s . $$$$f/fdk-aac; done
 fftw.cfg_params= --disable-fortran --enable-shared=no
@@ -168,6 +168,7 @@ audiofile.mak_params?=LIBS="-lm -lstdc++"
 flac.cfg_params?= --enable-shared=no
 flac.cflags?="$(call inc_path,libogg,include) $(call ld_path,libogg,src/.libs)"
 giflib.cfg_params?=--enable-shared=no
+ilmbase.cfg_vars= CFLAGS+=" -Wno-narrowing" CXXFLAGS+=" -Wno-narrowing"
 ilmbase.cfg_params?=--prefix=$(call bld_path,ilmbase,usr)
 ilmbase.mak_params?=; $(MAKE) -C ilmbase* install; cd $(call bld_path,ilmbase); ln -sf lib64 usr/lib
 lame.cfg_vars?= CFLAGS+=" -O"
@@ -207,9 +208,10 @@ openexr.cfg_vars?=LD_LIBRARY_PATH=$(call bld_path,ilmbase,usr/lib)
 openexr.cfg_params?=--enable-shared=no --with-ilmbase-prefix=$(call bld_path,ilmbase,usr)
 speech_tools.mak_params?=-j1
 twolame.cfg_params?=--enable-shared=no
-x264.cfg_params?= --enable-static
+x264.cfg_params?= --enable-static --enable-pic
 x265.cfg_vars?=$(call cmake_config,source)
 x265.cfg_params?= -DENABLE_SHARED=no
+libvpx.cfg_params?= --enable-pic
 
 # compile flag vars
 $(foreach tgt,$(TARGETS), \
diff --git a/cinelerra-5.1/thirdparty/src/mjpegtools.patch2 b/cinelerra-5.1/thirdparty/src/mjpegtools.patch2
new file mode 100644 (file)
index 0000000..8856183
--- /dev/null
@@ -0,0 +1,22 @@
+diff -ur a/configure.ac b/configure.ac
+--- a/configure.ac     2016-12-24 08:32:29.025598527 -0700
++++ b/configure.ac     2016-12-24 08:33:15.857611555 -0700
+@@ -382,6 +382,7 @@
+ dnl programs such as yuvdenoise and y4mspatialfilter can use this flag by
+ dnl simply adding programname_CFLAGS=@PROGRAM_NOPIC@ to the Makefile.am
++PROGRAM_NOPIC=""
+ AC_SUBST(PROGRAM_NOPIC)
+ if test "$enable_simd_accel" != "false" -a "$enable_simd_accel" != "no"
+diff -ur a/configure b/configure
+--- a/configure        2016-12-24 08:59:51.019865977 -0700
++++ b/configure        2016-12-24 08:59:28.814032493 -0700
+@@ -19069,6 +19069,7 @@
+ esac
++PROGRAM_NOPIC=""
+ if test "$enable_simd_accel" != "false" -a "$enable_simd_accel" != "no"
+ then