From 14c59195960203265f308a703e834e7c5f59f6d2 Mon Sep 17 00:00:00 2001 From: Good Guy Date: Sat, 24 Dec 2016 16:23:35 -0700 Subject: [PATCH] build fixes/upgrades, bd/ffmpeg/dialog tweaks --- cinelerra-5.1/bld_scripts/bld_prepare.sh | 10 +++++---- cinelerra-5.1/cinelerra/bdcreate.C | 7 ++++++ cinelerra-5.1/cinelerra/ffmpeg.C | 5 ++++- cinelerra-5.1/cinelerra/interfaceprefs.C | 16 ++++++++++++++ cinelerra-5.1/cinelerra/interfaceprefs.h | 8 +++++++ cinelerra-5.1/cinelerra/new.C | 4 ++-- cinelerra-5.1/cinelerra/preferences.C | 4 ++++ cinelerra-5.1/cinelerra/preferences.h | 1 + cinelerra-5.1/configure.ac | 20 ++++++++++------- cinelerra-5.1/db/utils/framediff.C | 12 ++++++---- cinelerra-5.1/guicast/bcsignals.C | 2 +- .../plugins/interpolatevideo/opticflow.C | 4 ++-- cinelerra-5.1/thirdparty/Makefile | 6 +++-- .../thirdparty/src/mjpegtools.patch2 | 22 +++++++++++++++++++ 14 files changed, 97 insertions(+), 24 deletions(-) create mode 100644 cinelerra-5.1/thirdparty/src/mjpegtools.patch2 diff --git a/cinelerra-5.1/bld_scripts/bld_prepare.sh b/cinelerra-5.1/bld_scripts/bld_prepare.sh index 399fe30d..5d751adc 100755 --- a/cinelerra-5.1/bld_scripts/bld_prepare.sh +++ b/cinelerra-5.1/bld_scripts/bld_prepare.sh @@ -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" diff --git a/cinelerra-5.1/cinelerra/bdcreate.C b/cinelerra-5.1/cinelerra/bdcreate.C index f8e424dc..de8042b3 100644 --- a/cinelerra-5.1/cinelerra/bdcreate.C +++ b/cinelerra-5.1/cinelerra/bdcreate.C @@ -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; } diff --git a/cinelerra-5.1/cinelerra/ffmpeg.C b/cinelerra-5.1/cinelerra/ffmpeg.C index 31a0d229..172252f6 100644 --- a/cinelerra-5.1/cinelerra/ffmpeg.C +++ b/cinelerra-5.1/cinelerra/ffmpeg.C @@ -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; } diff --git a/cinelerra-5.1/cinelerra/interfaceprefs.C b/cinelerra-5.1/cinelerra/interfaceprefs.C index 58aef497..e25b1fd9 100644 --- a/cinelerra-5.1/cinelerra/interfaceprefs.C +++ b/cinelerra-5.1/cinelerra/interfaceprefs.C @@ -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")) diff --git a/cinelerra-5.1/cinelerra/interfaceprefs.h b/cinelerra-5.1/cinelerra/interfaceprefs.h index 15be9d2e..3005d446 100644 --- a/cinelerra-5.1/cinelerra/interfaceprefs.h +++ b/cinelerra-5.1/cinelerra/interfaceprefs.h @@ -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: diff --git a/cinelerra-5.1/cinelerra/new.C b/cinelerra-5.1/cinelerra/new.C index fbc049e6..fce4c09f 100644 --- a/cinelerra-5.1/cinelerra/new.C +++ b/cinelerra-5.1/cinelerra/new.C @@ -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; } diff --git a/cinelerra-5.1/cinelerra/preferences.C b/cinelerra-5.1/cinelerra/preferences.C index e7fa696e..97efba93 100644 --- a/cinelerra-5.1/cinelerra/preferences.C +++ b/cinelerra-5.1/cinelerra/preferences.C @@ -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, diff --git a/cinelerra-5.1/cinelerra/preferences.h b/cinelerra-5.1/cinelerra/preferences.h index d6f1821d..3b2b221b 100644 --- a/cinelerra-5.1/cinelerra/preferences.h +++ b/cinelerra-5.1/cinelerra/preferences.h @@ -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 diff --git a/cinelerra-5.1/configure.ac b/cinelerra-5.1/configure.ac index e0301ee8..a665849d 100644 --- a/cinelerra-5.1/configure.ac +++ b/cinelerra-5.1/configure.ac @@ -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 diff --git a/cinelerra-5.1/db/utils/framediff.C b/cinelerra-5.1/db/utils/framediff.C index cac4372a..bedbcec9 100644 --- a/cinelerra-5.1/db/utils/framediff.C +++ b/cinelerra-5.1/db/utils/framediff.C @@ -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); diff --git a/cinelerra-5.1/guicast/bcsignals.C b/cinelerra-5.1/guicast/bcsignals.C index 2a6c8943..ddb2c864 100644 --- a/cinelerra-5.1/guicast/bcsignals.C +++ b/cinelerra-5.1/guicast/bcsignals.C @@ -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", diff --git a/cinelerra-5.1/plugins/interpolatevideo/opticflow.C b/cinelerra-5.1/plugins/interpolatevideo/opticflow.C index 9f94d6be..bf8a6762 100644 --- a/cinelerra-5.1/plugins/interpolatevideo/opticflow.C +++ b/cinelerra-5.1/plugins/interpolatevideo/opticflow.C @@ -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); diff --git a/cinelerra-5.1/thirdparty/Makefile b/cinelerra-5.1/thirdparty/Makefile index c7cc7f3c..aae252b0 100644 --- a/cinelerra-5.1/thirdparty/Makefile +++ b/cinelerra-5.1/thirdparty/Makefile @@ -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 index 00000000..88561838 --- /dev/null +++ b/cinelerra-5.1/thirdparty/src/mjpegtools.patch2 @@ -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 -- 2.26.2