From: <pa...@us...> - 2013-05-16 20:56:36
|
Revision: 4945 http://sourceforge.net/p/fuse-emulator/code/4945 Author: pak21 Date: 2013-05-16 20:56:33 +0000 (Thu, 16 May 2013) Log Message: ----------- Update date in main changelog. Modified Paths: -------------- trunk/fuse-utils/ChangeLog trunk/fuse-utils/hacking/ChangeLog Modified: trunk/fuse-utils/ChangeLog =================================================================== --- trunk/fuse-utils/ChangeLog 2013-05-16 20:55:22 UTC (rev 4944) +++ trunk/fuse-utils/ChangeLog 2013-05-16 20:56:33 UTC (rev 4945) @@ -1,4 +1,4 @@ -201?-??-?? Philip Kendall <phi...@sh...> +2013-05-18 Philip Kendall <phi...@sh...> * Version 1.1.0 released Modified: trunk/fuse-utils/hacking/ChangeLog =================================================================== --- trunk/fuse-utils/hacking/ChangeLog 2013-05-16 20:55:22 UTC (rev 4944) +++ trunk/fuse-utils/hacking/ChangeLog 2013-05-16 20:56:33 UTC (rev 4945) @@ -412,4 +412,5 @@ 20130407 converter/{romloader.cc,romloader.h}: include read and computed checksum (thanks, Ivan Shmakov) (Fred). 20130407 converter/romloader.cc: print flag byte (thanks, Ivan Shmakov) (Fred). -20130514 man/*.1: update date and revision for 1.1 release. +20130516 man/*.1: update date and revision for 1.1 release. +20130516 ChangeLog: update date in main changelog. This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <pa...@us...> - 2013-05-17 18:49:54
|
Revision: 4952 http://sourceforge.net/p/fuse-emulator/code/4952 Author: pak21 Date: 2013-05-17 18:49:51 +0000 (Fri, 17 May 2013) Log Message: ----------- Update date for 1.1 release. Modified Paths: -------------- trunk/fuse-utils/README trunk/fuse-utils/hacking/ChangeLog Modified: trunk/fuse-utils/README =================================================================== --- trunk/fuse-utils/README 2013-05-17 18:48:41 UTC (rev 4951) +++ trunk/fuse-utils/README 2013-05-17 18:49:51 UTC (rev 4952) @@ -61,6 +61,6 @@ running 'configure' for the first time. Philip Kendall <phi...@sh...> -?? ????? 201? +18th May, 2013 $Id$ Modified: trunk/fuse-utils/hacking/ChangeLog =================================================================== --- trunk/fuse-utils/hacking/ChangeLog 2013-05-17 18:48:41 UTC (rev 4951) +++ trunk/fuse-utils/hacking/ChangeLog 2013-05-17 18:49:51 UTC (rev 4952) @@ -414,3 +414,4 @@ 20130407 converter/romloader.cc: print flag byte (thanks, Ivan Shmakov) (Fred). 20130516 man/*.1: update date and revision for 1.1 release. 20130516 ChangeLog: update date in main changelog. +20130517 README: update date for 1.1 release. This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <sba...@us...> - 2013-05-17 22:11:55
|
Revision: 4956 http://sourceforge.net/p/fuse-emulator/code/4956 Author: sbaldovi Date: 2013-05-17 22:11:51 +0000 (Fri, 17 May 2013) Log Message: ----------- Update date for 1.1 release. Modified Paths: -------------- trunk/fuse-utils/hacking/ChangeLog trunk/fuse-utils/man/fmfconv.1 Modified: trunk/fuse-utils/hacking/ChangeLog =================================================================== --- trunk/fuse-utils/hacking/ChangeLog 2013-05-17 18:53:43 UTC (rev 4955) +++ trunk/fuse-utils/hacking/ChangeLog 2013-05-17 22:11:51 UTC (rev 4956) @@ -415,3 +415,4 @@ 20130516 man/*.1: update date and revision for 1.1 release. 20130516 ChangeLog: update date in main changelog. 20130517 README: update date for 1.1 release. +20130518 man/fmfconv.1: update date for 1.1 release (Sergio). Modified: trunk/fuse-utils/man/fmfconv.1 =================================================================== --- trunk/fuse-utils/man/fmfconv.1 2013-05-17 18:53:43 UTC (rev 4955) +++ trunk/fuse-utils/man/fmfconv.1 2013-05-17 22:11:51 UTC (rev 4956) @@ -22,7 +22,7 @@ .\" E-mail: sz...@hu... .\" .\" -.TH fmfconv 1 "??th ?????, 201?" "Version 1.1.0" "Emulators" +.TH fmfconv 1 "18th May, 2013" "Version 1.1.0" "Emulators" .\" .\"------------------------------------------------------------------ .\" This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <fr...@us...> - 2013-05-20 13:52:14
|
Revision: 4976 http://sourceforge.net/p/fuse-emulator/code/4976 Author: fredm Date: 2013-05-20 13:52:11 +0000 (Mon, 20 May 2013) Log Message: ----------- Fix typo in the CPPFLAGS variable name (patch #310) (Alberto). Modified Paths: -------------- trunk/fuse-utils/configure.ac trunk/fuse-utils/hacking/ChangeLog Modified: trunk/fuse-utils/configure.ac =================================================================== --- trunk/fuse-utils/configure.ac 2013-05-19 22:14:47 UTC (rev 4975) +++ trunk/fuse-utils/configure.ac 2013-05-20 13:52:11 UTC (rev 4976) @@ -70,7 +70,7 @@ CXXFLAGS="$CXXFLAGS -I$withval/include"; LDFLAGS="$LDFLAGS -L$withval/lib", if test "$prefix" != "NONE"; then - CPPFLAGS="$CPPLAGS -I$prefix/include"; + CPPFLAGS="$CPPFLAGS -I$prefix/include"; CXXFLAGS="$CXXFLAGS -I$prefix/include"; LDFLAGS="$LDFLAGS -L$prefix/lib" fi) Modified: trunk/fuse-utils/hacking/ChangeLog =================================================================== --- trunk/fuse-utils/hacking/ChangeLog 2013-05-19 22:14:47 UTC (rev 4975) +++ trunk/fuse-utils/hacking/ChangeLog 2013-05-20 13:52:11 UTC (rev 4976) @@ -416,3 +416,5 @@ 20130516 ChangeLog: update date in main changelog. 20130517 README: update date for 1.1 release. 20130518 man/fmfconv.1: update date for 1.1 release (Sergio). +20130520 configure.ac: fix typo in the CPPFLAGS variable name (patch #310) + (Alberto). This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <fr...@us...> - 2013-05-20 13:57:41
|
Revision: 4977 http://sourceforge.net/p/fuse-emulator/code/4977 Author: fredm Date: 2013-05-20 13:57:39 +0000 (Mon, 20 May 2013) Log Message: ----------- Fix syntax error (patch #311) (Alberto). Modified Paths: -------------- trunk/fuse-utils/hacking/ChangeLog trunk/fuse-utils/man/fmfconv.1 Modified: trunk/fuse-utils/hacking/ChangeLog =================================================================== --- trunk/fuse-utils/hacking/ChangeLog 2013-05-20 13:52:11 UTC (rev 4976) +++ trunk/fuse-utils/hacking/ChangeLog 2013-05-20 13:57:39 UTC (rev 4977) @@ -418,3 +418,4 @@ 20130518 man/fmfconv.1: update date for 1.1 release (Sergio). 20130520 configure.ac: fix typo in the CPPFLAGS variable name (patch #310) (Alberto). +20130520 man/fmfconv.1: fix syntax error (patch #311) (Alberto). Modified: trunk/fuse-utils/man/fmfconv.1 =================================================================== --- trunk/fuse-utils/man/fmfconv.1 2013-05-20 13:52:11 UTC (rev 4976) +++ trunk/fuse-utils/man/fmfconv.1 2013-05-20 13:57:39 UTC (rev 4977) @@ -43,7 +43,6 @@ .SH DESCRIPTION fmfconv is a Fuse movie file converter. It can convert .fmf files to any video file format known by FFMPEG. -... .\" .\"------------------------------------------------------------------ .\" This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <sba...@us...> - 2013-05-26 15:04:06
|
Revision: 4997 http://sourceforge.net/p/fuse-emulator/code/4997 Author: sbaldovi Date: 2013-05-26 15:04:04 +0000 (Sun, 26 May 2013) Log Message: ----------- Distribute ChangeLog in Windows packages. Modified Paths: -------------- trunk/fuse-utils/Makefile.am trunk/fuse-utils/hacking/ChangeLog Modified: trunk/fuse-utils/Makefile.am =================================================================== --- trunk/fuse-utils/Makefile.am 2013-05-26 14:57:49 UTC (rev 4996) +++ trunk/fuse-utils/Makefile.am 2013-05-26 15:04:04 UTC (rev 4997) @@ -150,7 +150,7 @@ fi; \ done # Get text files - for file in AUTHORS COPYING README; \ + for file in AUTHORS ChangeLog COPYING README; \ do cp "$(top_srcdir)/$$file" "$(DESTDIR)/$$file.txt"; \ done # Get manuals Modified: trunk/fuse-utils/hacking/ChangeLog =================================================================== --- trunk/fuse-utils/hacking/ChangeLog 2013-05-26 14:57:49 UTC (rev 4996) +++ trunk/fuse-utils/hacking/ChangeLog 2013-05-26 15:04:04 UTC (rev 4997) @@ -419,3 +419,4 @@ 20130520 configure.ac: fix typo in the CPPFLAGS variable name (patch #310) (Alberto). 20130520 man/fmfconv.1: fix syntax error (patch #311) (Alberto). +20130526 Makefile.am: distribute ChangeLog in Windows packages (Sergio). This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <sba...@us...> - 2013-05-26 15:07:35
|
Revision: 4998 http://sourceforge.net/p/fuse-emulator/code/4998 Author: sbaldovi Date: 2013-05-26 15:07:32 +0000 (Sun, 26 May 2013) Log Message: ----------- Add compat/getopt.h into the dist tarball. Modified Paths: -------------- trunk/fuse-utils/Makefile.am trunk/fuse-utils/hacking/ChangeLog Modified: trunk/fuse-utils/Makefile.am =================================================================== --- trunk/fuse-utils/Makefile.am 2013-05-26 15:04:04 UTC (rev 4997) +++ trunk/fuse-utils/Makefile.am 2013-05-26 15:07:32 UTC (rev 4998) @@ -126,7 +126,7 @@ converter/findsync1.h converter/getpulse1.h \ converter/getpulse2.h converter/getsync2.h \ converter/romloader.h converter/romloaderstate.h \ - fmfconv.h movie_tables.h + compat/getopt.h fmfconv.h movie_tables.h EXTRA_DIST = m4/audiofile.m4 \ m4/glib-1.0.m4 \ Modified: trunk/fuse-utils/hacking/ChangeLog =================================================================== --- trunk/fuse-utils/hacking/ChangeLog 2013-05-26 15:04:04 UTC (rev 4997) +++ trunk/fuse-utils/hacking/ChangeLog 2013-05-26 15:07:32 UTC (rev 4998) @@ -420,3 +420,4 @@ (Alberto). 20130520 man/fmfconv.1: fix syntax error (patch #311) (Alberto). 20130526 Makefile.am: distribute ChangeLog in Windows packages (Sergio). +20130526 Makefile.am: add compat/getopt.h into the dist tarball (Sergio). This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <sba...@us...> - 2013-09-28 14:19:35
|
Revision: 5048 http://sourceforge.net/p/fuse-emulator/code/5048 Author: sbaldovi Date: 2013-09-28 14:19:32 +0000 (Sat, 28 Sep 2013) Log Message: ----------- Take Windows distribution rules out of main Makefile.am file. Modified Paths: -------------- trunk/fuse-utils/Makefile.am trunk/fuse-utils/hacking/ChangeLog Added Paths: ----------- trunk/fuse-utils/compat/win32/distribution.mk Modified: trunk/fuse-utils/Makefile.am =================================================================== --- trunk/fuse-utils/Makefile.am 2013-09-28 14:14:06 UTC (rev 5047) +++ trunk/fuse-utils/Makefile.am 2013-09-28 14:19:32 UTC (rev 5048) @@ -134,82 +134,5 @@ m4/iconv.m4 if COMPAT_WIN32 -package_win32=$(PACKAGE)-$(PACKAGE_VERSION)-win32 -top_win32dir=$(top_builddir)/$(package_win32) - -install-win32: all - test -n "$(DESTDIR)" || { echo "ERROR: set DESTDIR path"; exit 1; } - $(MKDIR_P) $(DESTDIR)/ || exit 1 -# Copy executables (we should manually copy the required libraries) - list='$(bin_PROGRAMS)'; \ - for file in $$list; do \ - if test -f "$(top_builddir)/.libs/$$file"; then \ - cp "$(top_builddir)/.libs/$$file" $(DESTDIR); \ - else \ - cp "$(top_builddir)/$$file" $(DESTDIR); \ - fi; \ - done -# Get text files - for file in AUTHORS ChangeLog COPYING README; \ - do cp "$(top_srcdir)/$$file" "$(DESTDIR)/$$file.txt"; \ - done -# Get manuals - topsrcdirstrip=`echo "$(top_srcdir)/man" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ - man_files=`for file in $(top_srcdir)/man/*.1; do echo "$$file"; done | \ - sed -e "s|^$$topsrcdirstrip/||" -e "s|.1$$||"`; \ - for file in $$man_files; do \ - if test -n "$(MAN2HTML)"; then \ - $(MAN2HTML) -r "$(top_srcdir)/man/$$file.1" | sed '1d' > "$(DESTDIR)/$$file.html"; \ - else \ - test -z "$(GROFF)" || $(GROFF) -Thtml -man "$(top_srcdir)/man/$$file.1" > "$(DESTDIR)/$$file.html"; \ - fi; \ - done -# Convert to DOS line endings - test -z "$(UNIX2DOS)" || find $(DESTDIR) -type f \( -name "*txt" -or -name "*html" \) -exec $(UNIX2DOS) -q {} \; - -install-win32-strip: install-win32 - test -z "$(STRIP)" || { list='$(bin_PROGRAMS)'; \ - for file in $$list; do \ - test -z "$(STRIP)" || $(STRIP) "$(DESTDIR)/$$file"; \ - done } - -dist-win32-dir: - $(MAKE) DESTDIR="$(top_win32dir)" install-win32-strip - -dist-win32-zip: dist-win32-dir - rm -f -- $(top_builddir)/$(package_win32).zip - rm -f -- $(top_builddir)/$(package_win32).zip.sha1 - test -n "$(top_win32dir)" || exit 1 - @test `find $(top_win32dir) -type f -name \*.dll -print | wc -l` -ne 0 || \ - { echo "ERROR: external libraries not found in $(top_win32dir). Please, manually copy them."; exit 1; } - cd $(top_win32dir) && \ - zip -q -9 -r $(abs_top_builddir)/$(package_win32).zip . - -sha1sum $(top_builddir)/$(package_win32).zip > $(top_builddir)/$(package_win32).zip.sha1 && \ - { test -z "$(UNIX2DOS)" || $(UNIX2DOS) $(top_builddir)/$(package_win32).zip.sha1; } - -dist-win32-7z: dist-win32-dir - rm -f -- $(top_builddir)/$(package_win32).7z - rm -f -- $(top_builddir)/$(package_win32).7z.sha1 - test -n "$(top_win32dir)" || exit 1 - @test `find $(top_win32dir) -type f -name \*.dll -print | wc -l` -ne 0 || \ - { echo "ERROR: external libraries not found in $(top_win32dir). Please, manually copy them."; exit 1; } - cd $(top_win32dir) && \ - 7z a -t7z -m0=lzma -mx=9 -mfb=64 -md=32m -ms=on -bd $(abs_top_builddir)/$(package_win32).7z . - -sha1sum $(top_builddir)/$(package_win32).7z > $(top_builddir)/$(package_win32).7z.sha1 && \ - { test -z "$(UNIX2DOS)" || $(UNIX2DOS) $(top_builddir)/$(package_win32).7z.sha1; } - -dist-win32: dist-win32-zip dist-win32-7z - -distclean-win32: - if test -d "$(top_builddir)/$(package_win32)"; then \ - rm -rf -- "$(top_builddir)/$(package_win32)"; \ - fi - rm -f -- $(top_builddir)/$(package_win32).zip - rm -f -- $(top_builddir)/$(package_win32).zip.sha1 - rm -f -- $(top_builddir)/$(package_win32).7z - rm -f -- $(top_builddir)/$(package_win32).7z.sha1 - -.PHONY: install-win32 install-win32-strip \ - dist-win32 dist-win32-dir dist-win32-zip dist-win32-7z distclean-win32 - +include compat/win32/distribution.mk endif Added: trunk/fuse-utils/compat/win32/distribution.mk =================================================================== --- trunk/fuse-utils/compat/win32/distribution.mk (rev 0) +++ trunk/fuse-utils/compat/win32/distribution.mk 2013-09-28 14:19:32 UTC (rev 5048) @@ -0,0 +1,100 @@ +## This file does not need automake. Include in the final Makefile. +## Copyright (c) 2013 Sergio Baldoví + +## $Id$ + +## This program is free software; you can redistribute it and/or modify +## it under the terms of the GNU General Public License as published by +## the Free Software Foundation; either version 2 of the License, or +## (at your option) any later version. +## +## This program is distributed in the hope that it will be useful, +## but WITHOUT ANY WARRANTY; without even the implied warranty of +## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +## GNU General Public License for more details. +## +## You should have received a copy of the GNU General Public License along +## with this program; if not, write to the Free Software Foundation, Inc., +## 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. +## +## Author contact information: +## +## E-mail: ser...@gm... + +package_win32=$(PACKAGE)-$(PACKAGE_VERSION)-win32 +top_win32dir=$(top_builddir)/$(package_win32) + +install-win32: all + test -n "$(DESTDIR)" || { echo "ERROR: set DESTDIR path"; exit 1; } + $(MKDIR_P) $(DESTDIR)/ || exit 1 +# Copy executables (we should manually copy the required libraries) + list='$(bin_PROGRAMS)'; \ + for file in $$list; do \ + if test -f "$(top_builddir)/.libs/$$file"; then \ + cp "$(top_builddir)/.libs/$$file" $(DESTDIR); \ + else \ + cp "$(top_builddir)/$$file" $(DESTDIR); \ + fi; \ + done +# Get text files + for file in AUTHORS ChangeLog COPYING README; \ + do cp "$(top_srcdir)/$$file" "$(DESTDIR)/$$file.txt"; \ + done +# Get manuals + topsrcdirstrip=`echo "$(top_srcdir)/man" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ + man_files=`for file in $(top_srcdir)/man/*.1; do echo "$$file"; done | \ + sed -e "s|^$$topsrcdirstrip/||" -e "s|.1$$||"`; \ + for file in $$man_files; do \ + if test -n "$(MAN2HTML)"; then \ + $(MAN2HTML) -r "$(top_srcdir)/man/$$file.1" | sed '1d' > "$(DESTDIR)/$$file.html"; \ + else \ + test -z "$(GROFF)" || $(GROFF) -Thtml -man "$(top_srcdir)/man/$$file.1" > "$(DESTDIR)/$$file.html"; \ + fi; \ + done +# Convert to DOS line endings + test -z "$(UNIX2DOS)" || find $(DESTDIR) -type f \( -name "*txt" -or -name "*html" \) -exec $(UNIX2DOS) -q {} \; + +install-win32-strip: install-win32 + test -z "$(STRIP)" || { list='$(bin_PROGRAMS)'; \ + for file in $$list; do \ + test -z "$(STRIP)" || $(STRIP) "$(DESTDIR)/$$file"; \ + done } + +dist-win32-dir: + $(MAKE) DESTDIR="$(top_win32dir)" install-win32-strip + +dist-win32-zip: dist-win32-dir + rm -f -- $(top_builddir)/$(package_win32).zip + rm -f -- $(top_builddir)/$(package_win32).zip.sha1 + test -n "$(top_win32dir)" || exit 1 + @test `find $(top_win32dir) -type f -name \*.dll -print | wc -l` -ne 0 || \ + { echo "ERROR: external libraries not found in $(top_win32dir). Please, manually copy them."; exit 1; } + cd $(top_win32dir) && \ + zip -q -9 -r $(abs_top_builddir)/$(package_win32).zip . + -sha1sum $(top_builddir)/$(package_win32).zip > $(top_builddir)/$(package_win32).zip.sha1 && \ + { test -z "$(UNIX2DOS)" || $(UNIX2DOS) $(top_builddir)/$(package_win32).zip.sha1; } + +dist-win32-7z: dist-win32-dir + rm -f -- $(top_builddir)/$(package_win32).7z + rm -f -- $(top_builddir)/$(package_win32).7z.sha1 + test -n "$(top_win32dir)" || exit 1 + @test `find $(top_win32dir) -type f -name \*.dll -print | wc -l` -ne 0 || \ + { echo "ERROR: external libraries not found in $(top_win32dir). Please, manually copy them."; exit 1; } + cd $(top_win32dir) && \ + 7z a -t7z -m0=lzma -mx=9 -mfb=64 -md=32m -ms=on -bd $(abs_top_builddir)/$(package_win32).7z . + -sha1sum $(top_builddir)/$(package_win32).7z > $(top_builddir)/$(package_win32).7z.sha1 && \ + { test -z "$(UNIX2DOS)" || $(UNIX2DOS) $(top_builddir)/$(package_win32).7z.sha1; } + +dist-win32: dist-win32-zip dist-win32-7z + +distclean-win32: + if test -d "$(top_builddir)/$(package_win32)"; then \ + rm -rf -- "$(top_builddir)/$(package_win32)"; \ + fi + rm -f -- $(top_builddir)/$(package_win32).zip + rm -f -- $(top_builddir)/$(package_win32).zip.sha1 + rm -f -- $(top_builddir)/$(package_win32).7z + rm -f -- $(top_builddir)/$(package_win32).7z.sha1 + +.PHONY: install-win32 install-win32-strip \ + dist-win32 dist-win32-dir dist-win32-zip dist-win32-7z distclean-win32 Property changes on: trunk/fuse-utils/compat/win32/distribution.mk ___________________________________________________________________ Added: svn:keywords ## -0,0 +1 ## +Author Date Id Revision \ No newline at end of property Added: svn:eol-style ## -0,0 +1 ## +native \ No newline at end of property Modified: trunk/fuse-utils/hacking/ChangeLog =================================================================== --- trunk/fuse-utils/hacking/ChangeLog 2013-09-28 14:14:06 UTC (rev 5047) +++ trunk/fuse-utils/hacking/ChangeLog 2013-09-28 14:19:32 UTC (rev 5048) @@ -421,3 +421,5 @@ 20130520 man/fmfconv.1: fix syntax error (patch #311) (Alberto). 20130526 Makefile.am: distribute ChangeLog in Windows packages (Sergio). 20130526 Makefile.am: add compat/getopt.h into the dist tarball (Sergio). +20130928 Makefile.am,compat/win32/distribution.mk: take Windows distribution + rules out of main Makefile.am (Sergio). This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <sba...@us...> - 2013-10-13 07:52:55
|
Revision: 5055 http://sourceforge.net/p/fuse-emulator/code/5055 Author: sbaldovi Date: 2013-10-13 07:52:50 +0000 (Sun, 13 Oct 2013) Log Message: ----------- Use 'subdir-objects' option as advised by automake 1.14 to place object files in subdirectories. Modified Paths: -------------- trunk/fuse-utils/Makefile.am trunk/fuse-utils/configure.ac trunk/fuse-utils/hacking/ChangeLog trunk/fuse-utils/hacking/Makefile.am trunk/fuse-utils/man/Makefile.am Added Paths: ----------- trunk/fuse-utils/compat/Makefile.am trunk/fuse-utils/m4/Makefile.am Removed Paths: ------------- trunk/fuse-utils/compat/amiga/Makefile.am trunk/fuse-utils/compat/unix/Makefile.am trunk/fuse-utils/compat/win32/Makefile.am Property Changed: ---------------- trunk/fuse-utils/ trunk/fuse-utils/compat/ trunk/fuse-utils/compat/amiga/ trunk/fuse-utils/compat/unix/ trunk/fuse-utils/compat/win32/ trunk/fuse-utils/converter/ trunk/fuse-utils/hacking/ trunk/fuse-utils/importer/ trunk/fuse-utils/man/ Index: trunk/fuse-utils =================================================================== --- trunk/fuse-utils 2013-10-06 23:03:20 UTC (rev 5054) +++ trunk/fuse-utils 2013-10-13 07:52:50 UTC (rev 5055) Property changes on: trunk/fuse-utils ___________________________________________________________________ Modified: svn:ignore ## -5,6 +5,7 ## aclocal.m4 audio2tape autom4te.cache +compile config.cache config.guess config.h Modified: trunk/fuse-utils/Makefile.am =================================================================== --- trunk/fuse-utils/Makefile.am 2013-10-06 23:03:20 UTC (rev 5054) +++ trunk/fuse-utils/Makefile.am 2013-10-13 07:52:50 UTC (rev 5055) @@ -25,16 +25,6 @@ ACLOCAL_AMFLAGS = -I m4 -SUBDIRS = @COMPAT_SUBDIR@ \ - hacking \ - man - -DIST_SUBDIRS = compat/amiga \ - compat/unix \ - compat/win32 \ - hacking \ - man - bin_PROGRAMS = createhdf \ fmfconv \ listbasic \ @@ -75,38 +65,38 @@ fmfconv_SOURCES += compat/getopt.c compat/getopt1.c endif -fmfconv_LDADD = @FFMPEG_LIBS@ compat/@COMPAT_OSNAME@/libcompatos.a +fmfconv_LDADD = @FFMPEG_LIBS@ compat/libcompatos.a listbasic_SOURCES = listbasic.c utils.c -listbasic_LDADD = @LIBSPEC_LIBS@ compat/@COMPAT_OSNAME@/libcompatos.a +listbasic_LDADD = @LIBSPEC_LIBS@ compat/libcompatos.a profile2map_SOURCES = profile2map.c utils.c -profile2map_LDADD = @LIBSPEC_LIBS@ compat/@COMPAT_OSNAME@/libcompatos.a +profile2map_LDADD = @LIBSPEC_LIBS@ compat/libcompatos.a raw2hdf_SOURCES = ide.c raw2hdf.c rzxcheck_SOURCES = rzxcheck.c keys.c utils.c -rzxcheck_LDADD = @LIBSPEC_LIBS@ compat/@COMPAT_OSNAME@/libcompatos.a +rzxcheck_LDADD = @LIBSPEC_LIBS@ compat/libcompatos.a rzxdump_SOURCES = rzxdump.c utils.c -rzxdump_LDADD = @LIBSPEC_LIBS@ compat/@COMPAT_OSNAME@/libcompatos.a +rzxdump_LDADD = @LIBSPEC_LIBS@ compat/libcompatos.a rzxtool_SOURCES = rzxtool.c utils.c -rzxtool_LDADD = @LIBSPEC_LIBS@ compat/@COMPAT_OSNAME@/libcompatos.a +rzxtool_LDADD = @LIBSPEC_LIBS@ compat/libcompatos.a scl2trd_SOURCES = scl2trd.c snap2tzx_SOURCES = snap2tzx.c utils.c -snap2tzx_LDADD = @LIBSPEC_LIBS@ compat/@COMPAT_OSNAME@/libcompatos.a +snap2tzx_LDADD = @LIBSPEC_LIBS@ compat/libcompatos.a snapconv_SOURCES = snapconv.c utils.c -snapconv_LDADD = @LIBSPEC_LIBS@ compat/@COMPAT_OSNAME@/libcompatos.a +snapconv_LDADD = @LIBSPEC_LIBS@ compat/libcompatos.a tapeconv_SOURCES = tapeconv.c utils.c -tapeconv_LDADD = @LIBSPEC_LIBS@ compat/@COMPAT_OSNAME@/libcompatos.a +tapeconv_LDADD = @LIBSPEC_LIBS@ compat/libcompatos.a tzxlist_SOURCES = tzxlist.c utils.c -tzxlist_LDADD = @LIBSPEC_LIBS@ @LTLIBICONV@ compat/@COMPAT_OSNAME@/libcompatos.a +tzxlist_LDADD = @LIBSPEC_LIBS@ @LTLIBICONV@ compat/libcompatos.a audio2tape_SOURCES = audio2tape.cc importer/soundfile.cc importer/trigger.cc \ converter/findpilot.cc converter/findsync1.cc \ @@ -114,11 +104,11 @@ converter/getsync2.cc converter/romloader.cc \ converter/romloaderstate.cc utils.c audio2tape_LDADD = @LIBSPEC_LIBS@ @AUDIOFILE_LIBS@ \ - compat/@COMPAT_OSNAME@/libcompatos.a + compat/libcompatos.a tape2wav_SOURCES = tape2wav.c utils.c tape2wav_LDADD = @LIBSPEC_LIBS@ @AUDIOFILE_LIBS@ \ - compat/@COMPAT_OSNAME@/libcompatos.a + compat/libcompatos.a noinst_HEADERS = compat.h ide.h utils.h audio2tape.h importer/interpolator.h \ importer/schmitt.h importer/simple.h importer/soundfile.h \ @@ -128,11 +118,11 @@ converter/romloader.h converter/romloaderstate.h \ compat/getopt.h fmfconv.h movie_tables.h -EXTRA_DIST = m4/audiofile.m4 \ - m4/glib-1.0.m4 \ - m4/glib-2.0.m4 \ - m4/iconv.m4 +noinst_LIBRARIES = -if COMPAT_WIN32 -include compat/win32/distribution.mk -endif +EXTRA_DIST = + +include compat/Makefile.am +include hacking/Makefile.am +include m4/Makefile.am +include man/Makefile.am Index: trunk/fuse-utils/compat =================================================================== --- trunk/fuse-utils/compat 2013-10-06 23:03:20 UTC (rev 5054) +++ trunk/fuse-utils/compat 2013-10-13 07:52:50 UTC (rev 5055) Property changes on: trunk/fuse-utils/compat ___________________________________________________________________ Added: svn:ignore ## -0,0 +1,2 ## +.deps +.dirstamp Added: trunk/fuse-utils/compat/Makefile.am =================================================================== --- trunk/fuse-utils/compat/Makefile.am (rev 0) +++ trunk/fuse-utils/compat/Makefile.am 2013-10-13 07:52:50 UTC (rev 5055) @@ -0,0 +1,48 @@ +## Process this file with automake to produce Makefile.in +## Copyright (c) 2013 Philip Kendall + +## $Id$ + +## This program is free software; you can redistribute it and/or modify +## it under the terms of the GNU General Public License as published by +## the Free Software Foundation; either version 2 of the License, or +## (at your option) any later version. +## +## This program is distributed in the hope that it will be useful, +## but WITHOUT ANY WARRANTY; without even the implied warranty of +## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +## GNU General Public License for more details. +## +## You should have received a copy of the GNU General Public License along +## with this program; if not, write to the Free Software Foundation, Inc., +## 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. +## +## Author contact information: +## +## E-mail: phi...@sh... + +noinst_LIBRARIES += compat/libcompatos.a + +compat_libcompatos_a_SOURCES = + +if COMPAT_AMIGA +compat_libcompatos_a_SOURCES += \ + compat/amiga/basename.c \ + compat/amiga/osname.c +endif + +if COMPAT_UNIX +compat_libcompatos_a_SOURCES += \ + compat/unix/basename.c \ + compat/unix/osname.c +endif + +if COMPAT_WIN32 +compat_libcompatos_a_SOURCES += \ + compat/unix/basename.c \ + compat/win32/osname.c +endif + +if COMPAT_WIN32 +include compat/win32/distribution.mk +endif Property changes on: trunk/fuse-utils/compat/Makefile.am ___________________________________________________________________ Added: svn:keywords ## -0,0 +1 ## +Author Date Id Revision \ No newline at end of property Added: svn:eol-style ## -0,0 +1 ## +native \ No newline at end of property Index: trunk/fuse-utils/compat/amiga =================================================================== --- trunk/fuse-utils/compat/amiga 2013-10-06 23:03:20 UTC (rev 5054) +++ trunk/fuse-utils/compat/amiga 2013-10-13 07:52:50 UTC (rev 5055) Property changes on: trunk/fuse-utils/compat/amiga ___________________________________________________________________ Modified: svn:ignore ## -1,3 +1,2 ## .deps -Makefile -Makefile.in +.dirstamp Deleted: trunk/fuse-utils/compat/amiga/Makefile.am =================================================================== --- trunk/fuse-utils/compat/amiga/Makefile.am 2013-10-06 23:03:20 UTC (rev 5054) +++ trunk/fuse-utils/compat/amiga/Makefile.am 2013-10-13 07:52:50 UTC (rev 5055) @@ -1,33 +0,0 @@ -## Process this file with automake to produce Makefile.in -## Copyright (c) 2007-2008 Philip Kendall - -## $Id$ - -## This program is free software; you can redistribute it and/or modify -## it under the terms of the GNU General Public License as published by -## the Free Software Foundation; either version 2 of the License, or -## (at your option) any later version. -## -## This program is distributed in the hope that it will be useful, -## but WITHOUT ANY WARRANTY; without even the implied warranty of -## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -## GNU General Public License for more details. -## -## You should have received a copy of the GNU General Public License along -## with this program; if not, write to the Free Software Foundation, Inc., -## 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. -## -## Author contact information: -## -## E-mail: phi...@sh... - -AUTOMAKE_OPTIONS = foreign - -AM_CPPFLAGS = -I$(srcdir)/../.. - -noinst_LIBRARIES = libcompatos.a - -libcompatos_a_SOURCES = basename.c \ - osname.c - -AM_CPPFLAGS += @LIBSPEC_CFLAGS@ Index: trunk/fuse-utils/compat/unix =================================================================== --- trunk/fuse-utils/compat/unix 2013-10-06 23:03:20 UTC (rev 5054) +++ trunk/fuse-utils/compat/unix 2013-10-13 07:52:50 UTC (rev 5055) Property changes on: trunk/fuse-utils/compat/unix ___________________________________________________________________ Modified: svn:ignore ## -1,3 +1,2 ## .deps -Makefile -Makefile.in +.dirstamp Deleted: trunk/fuse-utils/compat/unix/Makefile.am =================================================================== --- trunk/fuse-utils/compat/unix/Makefile.am 2013-10-06 23:03:20 UTC (rev 5054) +++ trunk/fuse-utils/compat/unix/Makefile.am 2013-10-13 07:52:50 UTC (rev 5055) @@ -1,33 +0,0 @@ -## Process this file with automake to produce Makefile.in -## Copyright (c) 2007-2008 Philip Kendall - -## $Id$ - -## This program is free software; you can redistribute it and/or modify -## it under the terms of the GNU General Public License as published by -## the Free Software Foundation; either version 2 of the License, or -## (at your option) any later version. -## -## This program is distributed in the hope that it will be useful, -## but WITHOUT ANY WARRANTY; without even the implied warranty of -## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -## GNU General Public License for more details. -## -## You should have received a copy of the GNU General Public License along -## with this program; if not, write to the Free Software Foundation, Inc., -## 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. -## -## Author contact information: -## -## E-mail: phi...@sh... - -AUTOMAKE_OPTIONS = foreign - -AM_CPPFLAGS = -I$(srcdir)/../.. - -noinst_LIBRARIES = libcompatos.a - -libcompatos_a_SOURCES = basename.c \ - osname.c - -AM_CPPFLAGS += @LIBSPEC_CFLAGS@ Index: trunk/fuse-utils/compat/win32 =================================================================== --- trunk/fuse-utils/compat/win32 2013-10-06 23:03:20 UTC (rev 5054) +++ trunk/fuse-utils/compat/win32 2013-10-13 07:52:50 UTC (rev 5055) Property changes on: trunk/fuse-utils/compat/win32 ___________________________________________________________________ Modified: svn:ignore ## -1,3 +1,2 ## .deps -Makefile -Makefile.in +.dirstamp Deleted: trunk/fuse-utils/compat/win32/Makefile.am =================================================================== --- trunk/fuse-utils/compat/win32/Makefile.am 2013-10-06 23:03:20 UTC (rev 5054) +++ trunk/fuse-utils/compat/win32/Makefile.am 2013-10-13 07:52:50 UTC (rev 5055) @@ -1,33 +0,0 @@ -## Process this file with automake to produce Makefile.in -## Copyright (c) 2011 Philip Kendall - -## $Id$ - -## This program is free software; you can redistribute it and/or modify -## it under the terms of the GNU General Public License as published by -## the Free Software Foundation; either version 2 of the License, or -## (at your option) any later version. -## -## This program is distributed in the hope that it will be useful, -## but WITHOUT ANY WARRANTY; without even the implied warranty of -## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -## GNU General Public License for more details. -## -## You should have received a copy of the GNU General Public License along -## with this program; if not, write to the Free Software Foundation, Inc., -## 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. -## -## Author contact information: -## -## E-mail: phi...@sh... - -AUTOMAKE_OPTIONS = foreign - -AM_CPPFLAGS = -I$(srcdir)/../.. - -noinst_LIBRARIES = libcompatos.a - -libcompatos_a_SOURCES = ../unix/basename.c \ - osname.c - -AM_CPPFLAGS += @LIBSPEC_CFLAGS@ Modified: trunk/fuse-utils/configure.ac =================================================================== --- trunk/fuse-utils/configure.ac 2013-10-06 23:03:20 UTC (rev 5054) +++ trunk/fuse-utils/configure.ac 2013-10-13 07:52:50 UTC (rev 5055) @@ -26,7 +26,7 @@ AC_CANONICAL_HOST dnl Use automake to produce `Makefile.in' -AM_INIT_AUTOMAKE +AM_INIT_AUTOMAKE([subdir-objects]) dnl Checks for programs. AC_PROG_CC @@ -249,9 +249,8 @@ ;; esac AC_MSG_RESULT($COMPAT_OSNAME) -COMPAT_SUBDIR="compat/$COMPAT_OSNAME" -AC_SUBST(COMPAT_SUBDIR) -AC_SUBST(COMPAT_OSNAME) +AM_CONDITIONAL(COMPAT_AMIGA, test "$COMPAT_OSNAME" = 'amiga') +AM_CONDITIONAL(COMPAT_UNIX, test "$COMPAT_OSNAME" = 'unix') AM_CONDITIONAL(COMPAT_WIN32, test "$COMPAT_OSNAME" = 'win32') if test "$ac_cv_func_getopt_long" = no; then @@ -272,12 +271,7 @@ AC_CONFIG_FILES([ Makefile - compat/amiga/Makefile - compat/unix/Makefile - compat/win32/Makefile fuse-utils.qpg - hacking/Makefile - man/Makefile ]) AC_OUTPUT Index: trunk/fuse-utils/converter =================================================================== --- trunk/fuse-utils/converter 2013-10-06 23:03:20 UTC (rev 5054) +++ trunk/fuse-utils/converter 2013-10-13 07:52:50 UTC (rev 5055) Property changes on: trunk/fuse-utils/converter ___________________________________________________________________ Added: svn:ignore ## -0,0 +1,2 ## +.deps +.dirstamp Index: trunk/fuse-utils/hacking =================================================================== --- trunk/fuse-utils/hacking 2013-10-06 23:03:20 UTC (rev 5054) +++ trunk/fuse-utils/hacking 2013-10-13 07:52:50 UTC (rev 5055) Property changes on: trunk/fuse-utils/hacking ___________________________________________________________________ Deleted: svn:ignore ## -1,2 +0,0 ## -Makefile -Makefile.in \ No newline at end of property Modified: trunk/fuse-utils/hacking/ChangeLog =================================================================== --- trunk/fuse-utils/hacking/ChangeLog 2013-10-06 23:03:20 UTC (rev 5054) +++ trunk/fuse-utils/hacking/ChangeLog 2013-10-13 07:52:50 UTC (rev 5055) @@ -423,3 +423,7 @@ 20130526 Makefile.am: add compat/getopt.h into the dist tarball (Sergio). 20130928 Makefile.am,compat/win32/distribution.mk: take Windows distribution rules out of main Makefile.am (Sergio). +20131013 configure.ac,Makefile.am,compat/{Makefile.am,amiga/Makefile.am, + unix/Makefile.am,win32/Makefile.am},hacking/Makefile.am,m4/Makefile.am, + man/Makefile.am: use 'subdir-objects' option as advised by automake + 1.14 to place object files in subdirectories (Sergio). Modified: trunk/fuse-utils/hacking/Makefile.am =================================================================== --- trunk/fuse-utils/hacking/Makefile.am 2013-10-06 23:03:20 UTC (rev 5054) +++ trunk/fuse-utils/hacking/Makefile.am 2013-10-13 07:52:50 UTC (rev 5055) @@ -21,7 +21,6 @@ ## ## E-mail: phi...@sh... -AUTOMAKE_OPTIONS = foreign - -EXTRA_DIST = ChangeLog \ - cvs-tags +EXTRA_DIST += \ + hacking/ChangeLog \ + hacking/cvs-tags Index: trunk/fuse-utils/importer =================================================================== --- trunk/fuse-utils/importer 2013-10-06 23:03:20 UTC (rev 5054) +++ trunk/fuse-utils/importer 2013-10-13 07:52:50 UTC (rev 5055) Property changes on: trunk/fuse-utils/importer ___________________________________________________________________ Added: svn:ignore ## -0,0 +1,2 ## +.deps +.dirstamp Added: trunk/fuse-utils/m4/Makefile.am =================================================================== --- trunk/fuse-utils/m4/Makefile.am (rev 0) +++ trunk/fuse-utils/m4/Makefile.am 2013-10-13 07:52:50 UTC (rev 5055) @@ -0,0 +1,28 @@ +## Process this file with automake to produce Makefile.in +## Copyright (c) 2013 Philip Kendall + +## $Id$ + +## This program is free software; you can redistribute it and/or modify +## it under the terms of the GNU General Public License as published by +## the Free Software Foundation; either version 2 of the License, or +## (at your option) any later version. +## +## This program is distributed in the hope that it will be useful, +## but WITHOUT ANY WARRANTY; without even the implied warranty of +## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +## GNU General Public License for more details. +## +## You should have received a copy of the GNU General Public License along +## with this program; if not, write to the Free Software Foundation, Inc., +## 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. +## +## Author contact information: +## +## E-mail: phi...@sh... + +EXTRA_DIST += \ + m4/audiofile.m4 \ + m4/glib-1.0.m4 \ + m4/glib-2.0.m4 \ + m4/iconv.m4 Property changes on: trunk/fuse-utils/m4/Makefile.am ___________________________________________________________________ Added: svn:keywords ## -0,0 +1 ## +Author Date Id Revision \ No newline at end of property Added: svn:eol-style ## -0,0 +1 ## +native \ No newline at end of property Index: trunk/fuse-utils/man =================================================================== --- trunk/fuse-utils/man 2013-10-06 23:03:20 UTC (rev 5054) +++ trunk/fuse-utils/man 2013-10-13 07:52:50 UTC (rev 5055) Property changes on: trunk/fuse-utils/man ___________________________________________________________________ Deleted: svn:ignore ## -1,2 +0,0 ## -Makefile -Makefile.in \ No newline at end of property Modified: trunk/fuse-utils/man/Makefile.am =================================================================== --- trunk/fuse-utils/man/Makefile.am 2013-10-06 23:03:20 UTC (rev 5054) +++ trunk/fuse-utils/man/Makefile.am 2013-10-13 07:52:50 UTC (rev 5055) @@ -21,23 +21,22 @@ ## ## E-mail: phi...@sh... -AUTOMAKE_OPTIONS = foreign +man_MANS = \ + man/audio2tape.1 \ + man/createhdf.1 \ + man/fmfconv.1 \ + man/fuse-utils.1 \ + man/listbasic.1 \ + man/profile2map.1 \ + man/raw2hdf.1 \ + man/rzxcheck.1 \ + man/rzxdump.1 \ + man/rzxtool.1 \ + man/scl2trd.1 \ + man/snap2tzx.1 \ + man/snapconv.1 \ + man/tape2wav.1 \ + man/tapeconv.1 \ + man/tzxlist.1 -man_MANS = audio2tape.1 \ - createhdf.1 \ - fmfconv.1 \ - fuse-utils.1 \ - listbasic.1 \ - profile2map.1 \ - raw2hdf.1 \ - rzxcheck.1 \ - rzxdump.1 \ - rzxtool.1 \ - scl2trd.1 \ - snap2tzx.1 \ - snapconv.1 \ - tape2wav.1 \ - tapeconv.1 \ - tzxlist.1 - -EXTRA_DIST = $(man_MANS) +EXTRA_DIST += $(man_MANS) This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <sba...@us...> - 2014-01-12 23:53:02
|
Revision: 5064 http://sourceforge.net/p/fuse-emulator/code/5064 Author: sbaldovi Date: 2014-01-12 23:52:57 +0000 (Sun, 12 Jan 2014) Log Message: ----------- Add option for finalising rzx recordings (part of bug #305). Modified Paths: -------------- trunk/fuse-utils/hacking/ChangeLog trunk/fuse-utils/man/rzxtool.1 trunk/fuse-utils/rzxtool.c Modified: trunk/fuse-utils/hacking/ChangeLog =================================================================== --- trunk/fuse-utils/hacking/ChangeLog 2014-01-12 23:50:31 UTC (rev 5063) +++ trunk/fuse-utils/hacking/ChangeLog 2014-01-12 23:52:57 UTC (rev 5064) @@ -431,3 +431,5 @@ 20131013 configure.ac: replace obsolete ac_cv_prog_gcc with ac_cv_c_compiler_gnu (Sergio). 20131215 rzxtool.c: fix snapshot insertion in rzx recordings (Sergio). +20140113 man/rzxtool.1,rzxtool.c: add option for finalising rzx recordings + (part of bug #305) (Sergio). Modified: trunk/fuse-utils/man/rzxtool.1 =================================================================== --- trunk/fuse-utils/man/rzxtool.1 2014-01-12 23:50:31 UTC (rev 5063) +++ trunk/fuse-utils/man/rzxtool.1 2014-01-12 23:52:57 UTC (rev 5064) @@ -36,6 +36,7 @@ .RI [\-d "block number" ] .RI [\-e "block number" , filename ] .RI [\-i "block number" , filename ] +[\-f] [\-u] .I rzxfile .RI [ outfile ] @@ -75,6 +76,14 @@ .IR "block number" . .RE .PP +\-f +.RS +Finalise the RZX file. Any embedded snapshot (except the first one) will +be deleted. Fuse can add interspersed snapshots to RZX files to allow +rollbacking to a previous time. Action replays submitted to the RZX Archive +should not have these snapshots. +.RE +.PP \-u .RS When outputting an RZX file, this option causes the input recording Modified: trunk/fuse-utils/rzxtool.c =================================================================== --- trunk/fuse-utils/rzxtool.c 2014-01-12 23:50:31 UTC (rev 5063) +++ trunk/fuse-utils/rzxtool.c 2014-01-12 23:52:57 UTC (rev 5064) @@ -1,5 +1,5 @@ /* rzxtool.c: Simple modifications to RZX files - Copyright (c) 2007 Philip Kendall + Copyright (c) 2007-2014 Philip Kendall $Id$ @@ -44,6 +44,7 @@ ACTION_DELETE_BLOCK, ACTION_EXTRACT_SNAP, ACTION_INSERT_SNAP, + ACTION_FINALISE_RZX, } action_type_t; @@ -235,6 +236,9 @@ case ACTION_INSERT_SNAP: insert_snap( rzx, where, action->filename ); break; + case ACTION_FINALISE_RZX: + libspectrum_rzx_finalise( rzx ); + break; default: fprintf( stderr, "%s: unknown action type %d\n", progname, action->type ); } @@ -292,6 +296,9 @@ if( type == ACTION_DELETE_BLOCK ) { action->where = atoi( argument ); action->filename = NULL; + } else if( type == ACTION_FINALISE_RZX ) { + action->where = 0; + action->filename = NULL; } else { error = parse_argument( argument, &where, &filename ); @@ -321,7 +328,7 @@ options->uncompressed = 0; - while( ( c = getopt( argc, argv, "d:e:i:u" ) ) != EOF ) { + while( ( c = getopt( argc, argv, "d:e:i:uf" ) ) != EOF ) { switch( c ) { case 'd': error = add_action( actions, ACTION_DELETE_BLOCK, optarg ); @@ -334,6 +341,10 @@ error = add_action( actions, ACTION_INSERT_SNAP, optarg ); output_needed = 1; break; + case 'f': + error = add_action( actions, ACTION_FINALISE_RZX, optarg ); + output_needed = 1; + break; case 'u': options->uncompressed = 1; output_needed = 1; This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <sba...@us...> - 2014-01-13 00:06:22
|
Revision: 5066 http://sourceforge.net/p/fuse-emulator/code/5066 Author: sbaldovi Date: 2014-01-13 00:06:14 +0000 (Mon, 13 Jan 2014) Log Message: ----------- Fix snapshot insertion in rzx recordings. Modified Paths: -------------- trunk/fuse-utils/hacking/ChangeLog trunk/fuse-utils/rzxdump.c Modified: trunk/fuse-utils/hacking/ChangeLog =================================================================== --- trunk/fuse-utils/hacking/ChangeLog 2014-01-12 23:58:05 UTC (rev 5065) +++ trunk/fuse-utils/hacking/ChangeLog 2014-01-13 00:06:14 UTC (rev 5066) @@ -433,3 +433,5 @@ 20131215 rzxtool.c: fix snapshot insertion in rzx recordings (Sergio). 20140113 man/rzxtool.1,rzxtool.c: add option for finalising rzx recordings (part of bug #305) (Sergio). +20140113 rzxdump.c: show block number as is needed for some operations with + rzxtool (Sergio). Modified: trunk/fuse-utils/rzxdump.c =================================================================== --- trunk/fuse-utils/rzxdump.c 2014-01-12 23:58:05 UTC (rev 5065) +++ trunk/fuse-utils/rzxdump.c 2014-01-13 00:06:14 UTC (rev 5066) @@ -1,5 +1,5 @@ /* rzxdump.c: get info on an RZX file - Copyright (c) 2002-2003 Philip Kendall + Copyright (c) 2002-2014 Philip Kendall $Id$ @@ -46,6 +46,8 @@ const char *rzx_signature = "RZX!"; +size_t block_number; + libspectrum_word read_word( unsigned char **ptr ); libspectrum_dword read_dword( unsigned char **ptr ); @@ -130,6 +132,7 @@ printf( "Found RZX signature\n" ); ptr += strlen( rzx_signature ); + block_number = 0; printf( " Major version: %d\n", (int)*ptr++ ); printf( " Minor version: %d\n", (int)*ptr++ ); @@ -202,6 +205,8 @@ printf( "Found a snapshot block\n" ); + printf( " Block: %lu\n", (unsigned long)block_number ); block_number++; + block_length = read_dword( ptr ); printf( " Length: %lu bytes\n", (unsigned long)block_length ); @@ -230,6 +235,8 @@ } printf( "Found an input recording block\n" ); + + printf( " Block: %lu\n", (unsigned long)block_number ); block_number++; length = read_dword( ptr ); printf( " Length: %ld bytes\n", (unsigned long)length ); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <sba...@us...> - 2014-02-16 22:45:45
|
Revision: 5071 http://sourceforge.net/p/fuse-emulator/code/5071 Author: sbaldovi Date: 2014-02-16 22:45:42 +0000 (Sun, 16 Feb 2014) Log Message: ----------- Fix leaks and possible null pointer dereferences (thanks, cppcheck). Modified Paths: -------------- trunk/fuse-utils/fmfconv.c trunk/fuse-utils/hacking/ChangeLog trunk/fuse-utils/raw2hdf.c trunk/fuse-utils/rzxtool.c trunk/fuse-utils/scl2trd.c trunk/fuse-utils/snap2tzx.c trunk/fuse-utils/snapconv.c trunk/fuse-utils/tape2wav.c Modified: trunk/fuse-utils/fmfconv.c =================================================================== --- trunk/fuse-utils/fmfconv.c 2014-02-09 23:15:25 UTC (rev 5070) +++ trunk/fuse-utils/fmfconv.c 2014-02-16 22:45:42 UTC (rev 5071) @@ -334,16 +334,20 @@ int alloc_sound_buff( size_t len ) { + libspectrum_signed_byte *ptr = NULL; + if( sound_buf_len < len ) { len = ( ( len * 3 / 2 ) / SOUND_CHUNK_LEN + 1 ) * SOUND_CHUNK_LEN; if( sound_buf_len == 0 ) { sound8 = malloc( len ); } else { + ptr = sound8; sound8 = realloc( sound8, len ); } if( sound8 == NULL ) { printe( "\n\nMemory (re)allocation error.\n" ); + free( ptr ); return ERR_OUTOFMEM; } sound16 = (void *)sound8; Modified: trunk/fuse-utils/hacking/ChangeLog =================================================================== --- trunk/fuse-utils/hacking/ChangeLog 2014-02-09 23:15:25 UTC (rev 5070) +++ trunk/fuse-utils/hacking/ChangeLog 2014-02-16 22:45:42 UTC (rev 5071) @@ -435,3 +435,6 @@ (part of bug #305) (Sergio). 20140113 rzxdump.c: show block number as is needed for some operations with rzxtool (Sergio). +20140216 fmfconv.c,raw2hdf.c,rzxtool.c,scl2trd.c,snap2tzx.c,snapconv.c, + tape2wav.c: fix leaks and possible null pointer dereferences (thanks, + cppcheck) (Sergio). Modified: trunk/fuse-utils/raw2hdf.c =================================================================== --- trunk/fuse-utils/raw2hdf.c 2014-02-09 23:15:25 UTC (rev 5070) +++ trunk/fuse-utils/raw2hdf.c 2014-02-16 22:45:42 UTC (rev 5071) @@ -219,17 +219,25 @@ if( !hdf ) { fprintf( stderr, "%s: error opening '%s': %s\n", progname, hdf_filename, strerror( errno ) ); + fclose( raw ); return 1; } error = copy_data( raw, hdf, &byte_count, raw_filename, hdf_filename, version ); - if( error ) return error; + if( error ) { + fclose( hdf ); + fclose( raw ); + return error; + } fclose( raw ); error = write_header( hdf, byte_count, hdf_filename, version ); - if( error ) return error; + if( error ) { + fclose( hdf ); + return error; + } fclose( hdf ); Modified: trunk/fuse-utils/rzxtool.c =================================================================== --- trunk/fuse-utils/rzxtool.c 2014-02-09 23:15:25 UTC (rev 5070) +++ trunk/fuse-utils/rzxtool.c 2014-02-16 22:45:42 UTC (rev 5071) @@ -111,6 +111,7 @@ if( bytes != length ) { fprintf( stderr, "%s: wrote only %lu of %lu bytes to `%s'\n", progname, (unsigned long)bytes, (unsigned long)length, filename ); + fclose( f ); return 1; } @@ -263,6 +264,7 @@ if( !comma ) { fprintf( stderr, "%s: no comma found in argument `%s'\n", progname, argument ); + free( buffer ); return 1; } Modified: trunk/fuse-utils/scl2trd.c =================================================================== --- trunk/fuse-utils/scl2trd.c 2014-02-09 23:15:25 UTC (rev 5070) +++ trunk/fuse-utils/scl2trd.c 2014-02-16 22:45:42 UTC (rev 5071) @@ -124,9 +124,9 @@ fh = fopen(newname, "wb"); if (fh) { mem = (unsigned char *) malloc(BLOCKSIZE); - memset(mem, 0, BLOCKSIZE); if (mem) { + memset(mem, 0, BLOCKSIZE); memcpy(&mem[TRD_DIRSTART], template, TRD_DIRLEN); strncpy((char*)&mem[TRD_NAMEOFFSET], "Fuse", TRD_MAXNAMELENGTH); fwrite((void *) mem, 1, BLOCKSIZE, fh); @@ -136,8 +136,8 @@ fwrite((void *) mem, 1, BLOCKSIZE, fh); free(mem); - fclose(fh); } + fclose(fh); } if ((TRD = open(newname, O_RDWR | O_BINARY)) == -1) { Modified: trunk/fuse-utils/snap2tzx.c =================================================================== --- trunk/fuse-utils/snap2tzx.c 2014-02-09 23:15:25 UTC (rev 5070) +++ trunk/fuse-utils/snap2tzx.c 2014-02-16 22:45:42 UTC (rev 5071) @@ -1165,6 +1165,7 @@ print_error( "could read only %lu bytes from '%s'", (unsigned long)count, filename ); } + fclose( f ); return 1; } @@ -1465,6 +1466,7 @@ (unsigned long)written, (unsigned long)length, filename ); } free( buffer ); + fclose( f ); return 1; } Modified: trunk/fuse-utils/snapconv.c =================================================================== --- trunk/fuse-utils/snapconv.c 2014-02-09 23:15:25 UTC (rev 5070) +++ trunk/fuse-utils/snapconv.c 2014-02-16 22:45:42 UTC (rev 5071) @@ -159,10 +159,12 @@ if( fwrite( buffer, 1, length, f ) != length ) { fprintf( stderr, "%s: error writing to '%s'\n", progname, argv[1] ); free( buffer ); + fclose( f ); return 1; } free( buffer ); - + fclose( f ); + return 0; } Modified: trunk/fuse-utils/tape2wav.c =================================================================== --- trunk/fuse-utils/tape2wav.c 2014-02-09 23:15:25 UTC (rev 5070) +++ trunk/fuse-utils/tape2wav.c 2014-02-16 22:45:42 UTC (rev 5071) @@ -109,7 +109,7 @@ static int write_tape( char *filename, libspectrum_tape *tape ) { - libspectrum_byte *buffer; size_t length; + libspectrum_byte *buffer, *ptr; size_t length; size_t tape_length = 0; libspectrum_error error; short level = 0; /* The last level output to this block */ @@ -176,8 +176,10 @@ while( tape_length + pulse_length > length ) { length *= 2; + ptr = buffer; buffer = realloc( buffer, length ); if( !buffer ) { + free( ptr ); fprintf( stderr, "%s: unable to allocate memory for conversion buffer\n", progname ); return 1; This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <sba...@us...> - 2014-02-16 22:52:39
|
Revision: 5072 http://sourceforge.net/p/fuse-emulator/code/5072 Author: sbaldovi Date: 2014-02-16 22:52:36 +0000 (Sun, 16 Feb 2014) Log Message: ----------- FFmpeg no longer provides backward compatible CodecID as alias for AVCodecID. Modified Paths: -------------- trunk/fuse-utils/fmfconv_ff.c trunk/fuse-utils/hacking/ChangeLog Modified: trunk/fuse-utils/fmfconv_ff.c =================================================================== --- trunk/fuse-utils/fmfconv_ff.c 2014-02-16 22:45:42 UTC (rev 5071) +++ trunk/fuse-utils/fmfconv_ff.c 2014-02-16 22:52:36 UTC (rev 5072) @@ -113,6 +113,14 @@ static void setup_x264_dict( AVDictionary ** pm ); #endif +#if LIBAVCODEC_BUILD >= AV_VERSION_INT(54,25,0) +#define FMF_CODEC_ID AVCodecID +#define FMF_CODEC(name) AV_##name +#else +#define FMF_CODEC_ID CodecID +#define FMF_CODEC(name) name +#endif + /* check that a given sample format is supported by the encoder */ static int check_sample_fmt( AVCodec *codec, enum AVSampleFormat sample_fmt ) @@ -224,7 +232,7 @@ */ static int -add_audio_stream( enum CodecID codec_id, int freq, int stereo ) +add_audio_stream( enum FMF_CODEC_ID codec_id, int freq, int stereo ) { AVCodecContext *c; @@ -440,7 +448,7 @@ /* add a video output stream */ static int -add_video_stream( enum CodecID codec_id, int w, int h, int timing ) +add_video_stream( enum FMF_CODEC_ID codec_id, int w, int h, int timing ) { AVCodecContext *c; @@ -674,7 +682,7 @@ { AVCodec *ac, *vc; - enum CodecID acodec, vcodec; + enum FMF_CODEC_ID acodec, vcodec; ff_picture = NULL; ff_tmp_picture = NULL; @@ -725,7 +733,7 @@ vcodec = fmt->video_codec; acodec = fmt->audio_codec; - if( out_t == TYPE_FFMPEG && vcodec != CODEC_ID_NONE ) { + if( out_t == TYPE_FFMPEG && vcodec != FMF_CODEC( CODEC_ID_NONE ) ) { /* Find the video encoder requested by user selection */ if( ffmpeg_vcodec != NULL && *ffmpeg_vcodec != 0 ) { @@ -758,7 +766,7 @@ return 1; } - if( snd_t == TYPE_FFMPEG && acodec != CODEC_ID_NONE ) { + if( snd_t == TYPE_FFMPEG && acodec != FMF_CODEC( CODEC_ID_NONE ) ) { /* Find the audio encoder requested by user selection */ if( ffmpeg_acodec != NULL && *ffmpeg_acodec != 0 ) { Modified: trunk/fuse-utils/hacking/ChangeLog =================================================================== --- trunk/fuse-utils/hacking/ChangeLog 2014-02-16 22:45:42 UTC (rev 5071) +++ trunk/fuse-utils/hacking/ChangeLog 2014-02-16 22:52:36 UTC (rev 5072) @@ -438,3 +438,5 @@ 20140216 fmfconv.c,raw2hdf.c,rzxtool.c,scl2trd.c,snap2tzx.c,snapconv.c, tape2wav.c: fix leaks and possible null pointer dereferences (thanks, cppcheck) (Sergio). +20140216 fmfconv_ff.c: FFmpeg no longer provides backward compatible CodecID as + alias for AVCodecID (Sergio). This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <fr...@us...> - 2014-04-14 12:24:23
|
Revision: 5077 http://sourceforge.net/p/fuse-emulator/code/5077 Author: fredm Date: 2014-04-14 12:24:20 +0000 (Mon, 14 Apr 2014) Log Message: ----------- Correct default WAV sample rate (thanks, Alberto Garcia) (patch #324) (Santiago Vila). Modified Paths: -------------- trunk/fuse-utils/hacking/ChangeLog trunk/fuse-utils/man/tape2wav.1 trunk/fuse-utils/tape2wav.c Modified: trunk/fuse-utils/hacking/ChangeLog =================================================================== --- trunk/fuse-utils/hacking/ChangeLog 2014-03-22 11:50:50 UTC (rev 5076) +++ trunk/fuse-utils/hacking/ChangeLog 2014-04-14 12:24:20 UTC (rev 5077) @@ -440,3 +440,5 @@ cppcheck) (Sergio). 20140216 fmfconv_ff.c: FFmpeg no longer provides backward compatible CodecID as alias for AVCodecID (Sergio). +20140414 tape2wav.c: correct default WAV sample rate (thanks, Alberto Garcia) + (patch #324) (Santiago Vila). Modified: trunk/fuse-utils/man/tape2wav.1 =================================================================== --- trunk/fuse-utils/man/tape2wav.1 2014-03-22 11:50:50 UTC (rev 5076) +++ trunk/fuse-utils/man/tape2wav.1 2014-04-14 12:24:20 UTC (rev 5077) @@ -48,7 +48,8 @@ .RI "\-r " "sample rate" causes .I sample rate -to be used as the sample rate for the target wav file. +to be used as the sample rate for the target wav file. The default rate is +44100 Hz. .TP .I infile specifies the tape file to be converted. This file can be in any of the Modified: trunk/fuse-utils/tape2wav.c =================================================================== --- trunk/fuse-utils/tape2wav.c 2014-03-22 11:50:50 UTC (rev 5076) +++ trunk/fuse-utils/tape2wav.c 2014-04-14 12:24:20 UTC (rev 5077) @@ -41,7 +41,7 @@ static int write_tape( char *filename, libspectrum_tape *tape ); char *progname; -int sample_rate = 41000; +int sample_rate = 44100; int main( int argc, char **argv ) This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <sba...@us...> - 2014-04-23 22:58:55
|
Revision: 5078 http://sourceforge.net/p/fuse-emulator/code/5078 Author: sbaldovi Date: 2014-04-23 22:58:51 +0000 (Wed, 23 Apr 2014) Log Message: ----------- Correct vga resolution. Modified Paths: -------------- trunk/fuse-utils/fmfconv.c trunk/fuse-utils/hacking/ChangeLog Modified: trunk/fuse-utils/fmfconv.c =================================================================== --- trunk/fuse-utils/fmfconv.c 2014-04-14 12:24:20 UTC (rev 5077) +++ trunk/fuse-utils/fmfconv.c 2014-04-23 22:58:51 UTC (rev 5078) @@ -1782,7 +1782,7 @@ case 'R': if( !strcmp( optarg, "vga" ) ) { ffmpeg_rescale = TYPE_RESCALE_WH; - out_w = 640; out_h = 320; + out_w = 640; out_h = 480; } else if( !strcmp( optarg, "hvga" ) ) { ffmpeg_rescale = TYPE_RESCALE_WH; out_w = 480; out_h = 360; Modified: trunk/fuse-utils/hacking/ChangeLog =================================================================== --- trunk/fuse-utils/hacking/ChangeLog 2014-04-14 12:24:20 UTC (rev 5077) +++ trunk/fuse-utils/hacking/ChangeLog 2014-04-23 22:58:51 UTC (rev 5078) @@ -442,3 +442,4 @@ alias for AVCodecID (Sergio). 20140414 tape2wav.c: correct default WAV sample rate (thanks, Alberto Garcia) (patch #324) (Santiago Vila). +20140424 fmfconv.c: correct vga resolution (Sergio). This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <fr...@us...> - 2014-05-07 12:24:24
|
Revision: 5082 http://sourceforge.net/p/fuse-emulator/code/5082 Author: fredm Date: 2014-05-07 12:24:20 +0000 (Wed, 07 May 2014) Log Message: ----------- Select glibtoolize where required. Modified Paths: -------------- trunk/fuse-utils/autogen.sh trunk/fuse-utils/hacking/ChangeLog Modified: trunk/fuse-utils/autogen.sh =================================================================== --- trunk/fuse-utils/autogen.sh 2014-05-07 12:21:35 UTC (rev 5081) +++ trunk/fuse-utils/autogen.sh 2014-05-07 12:24:20 UTC (rev 5082) @@ -27,7 +27,10 @@ set -e aclocal -I m4 -libtoolize --automake +# Mac OS X: Use glibtoolize instead +(glibtoolize --version) < /dev/null > /dev/null 2>&1 && LIBTOOLIZE=glibtoolize | +| LIBTOOLIZE=libtoolize +$LIBTOOLIZE --automake autoheader automake --add-missing autoconf Modified: trunk/fuse-utils/hacking/ChangeLog =================================================================== --- trunk/fuse-utils/hacking/ChangeLog 2014-05-07 12:21:35 UTC (rev 5081) +++ trunk/fuse-utils/hacking/ChangeLog 2014-05-07 12:24:20 UTC (rev 5082) @@ -444,3 +444,4 @@ (patch #324) (Santiago Vila). 20140424 fmfconv.c: correct vga resolution (Sergio). 20140507 m4/iconv.m4: update iconv to version from gettext-0.18.2 (Fred). +20140507 autogen.sh: select glibtoolize where required (Sergio). This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <fr...@us...> - 2014-05-11 11:35:03
|
Revision: 5084 http://sourceforge.net/p/fuse-emulator/code/5084 Author: fredm Date: 2014-05-11 11:34:59 +0000 (Sun, 11 May 2014) Log Message: ----------- Ensure definitions of AC_LIB_PREPARE_PREFIX, AC_LIB_RPATH, AC_LIB_LINKFLAGS_BODY and AC_LIB_APPENDTOVAR are always available (patch #325). Modified Paths: -------------- trunk/fuse-utils/hacking/ChangeLog trunk/fuse-utils/m4/Makefile.am Added Paths: ----------- trunk/fuse-utils/m4/lib-ld.m4 trunk/fuse-utils/m4/lib-link.m4 trunk/fuse-utils/m4/lib-prefix.m4 Modified: trunk/fuse-utils/hacking/ChangeLog =================================================================== --- trunk/fuse-utils/hacking/ChangeLog 2014-05-09 15:13:41 UTC (rev 5083) +++ trunk/fuse-utils/hacking/ChangeLog 2014-05-11 11:34:59 UTC (rev 5084) @@ -445,3 +445,7 @@ 20140424 fmfconv.c: correct vga resolution (Sergio). 20140507 m4/iconv.m4: update iconv to version from gettext-0.18.2 (Fred). 20140507 autogen.sh: select glibtoolize where required (Sergio). +20140511 m4/{Makefile.am,lib-ld.m4,lib-link.m4,lib-prefix.m4}: ensure + definitions of AC_LIB_PREPARE_PREFIX, AC_LIB_RPATH, + AC_LIB_LINKFLAGS_BODY and AC_LIB_APPENDTOVAR are always available + (patch #325) (Fred). Modified: trunk/fuse-utils/m4/Makefile.am =================================================================== --- trunk/fuse-utils/m4/Makefile.am 2014-05-09 15:13:41 UTC (rev 5083) +++ trunk/fuse-utils/m4/Makefile.am 2014-05-11 11:34:59 UTC (rev 5084) @@ -1,5 +1,5 @@ ## Process this file with automake to produce Makefile.in -## Copyright (c) 2013 Philip Kendall +## Copyright (c) 2013-2014 Philip Kendall ## $Id$ @@ -25,4 +25,7 @@ m4/audiofile.m4 \ m4/glib-1.0.m4 \ m4/glib-2.0.m4 \ - m4/iconv.m4 + m4/iconv.m4 \ + m4/lib-ld.m4 \ + m4/lib-link.m4 \ + m4/lib-prefix.m4 Added: trunk/fuse-utils/m4/lib-ld.m4 =================================================================== --- trunk/fuse-utils/m4/lib-ld.m4 (rev 0) +++ trunk/fuse-utils/m4/lib-ld.m4 2014-05-11 11:34:59 UTC (rev 5084) @@ -0,0 +1,110 @@ +# lib-ld.m4 serial 2 (gettext-0.12) +dnl Copyright (C) 1996-2003 Free Software Foundation, Inc. +dnl This file is free software, distributed under the terms of the GNU +dnl General Public License. As a special exception to the GNU General +dnl Public License, this file may be distributed as part of a program +dnl that contains a configuration script generated by Autoconf, under +dnl the same distribution terms as the rest of that program. + +dnl Subroutines of libtool.m4, +dnl with replacements s/AC_/AC_LIB/ and s/lt_cv/acl_cv/ to avoid collision +dnl with libtool.m4. + +dnl From libtool-1.4. Sets the variable with_gnu_ld to yes or no. +AC_DEFUN([AC_LIB_PROG_LD_GNU], +[AC_CACHE_CHECK([if the linker ($LD) is GNU ld], acl_cv_prog_gnu_ld, +[# I'd rather use --version here, but apparently some GNU ld's only accept -v. +if $LD -v 2>&1 </dev/null | egrep '(GNU|with BFD)' 1>&5; then + acl_cv_prog_gnu_ld=yes +else + acl_cv_prog_gnu_ld=no +fi]) +with_gnu_ld=$acl_cv_prog_gnu_ld +]) + +dnl From libtool-1.4. Sets the variable LD. +AC_DEFUN([AC_LIB_PROG_LD], +[AC_ARG_WITH(gnu-ld, +[ --with-gnu-ld assume the C compiler uses GNU ld [default=no]], +test "$withval" = no || with_gnu_ld=yes, with_gnu_ld=no) +AC_REQUIRE([AC_PROG_CC])dnl +AC_REQUIRE([AC_CANONICAL_HOST])dnl +# Prepare PATH_SEPARATOR. +# The user is always right. +if test "${PATH_SEPARATOR+set}" != set; then + echo "#! /bin/sh" >conf$$.sh + echo "exit 0" >>conf$$.sh + chmod +x conf$$.sh + if (PATH="/nonexistent;."; conf$$.sh) >/dev/null 2>&1; then + PATH_SEPARATOR=';' + else + PATH_SEPARATOR=: + fi + rm -f conf$$.sh +fi +ac_prog=ld +if test "$GCC" = yes; then + # Check if gcc -print-prog-name=ld gives a path. + AC_MSG_CHECKING([for ld used by GCC]) + case $host in + *-*-mingw*) + # gcc leaves a trailing carriage return which upsets mingw + ac_prog=`($CC -print-prog-name=ld) 2>&5 | tr -d '\015'` ;; + *) + ac_prog=`($CC -print-prog-name=ld) 2>&5` ;; + esac + case $ac_prog in + # Accept absolute paths. + [[\\/]* | [A-Za-z]:[\\/]*)] + [re_direlt='/[^/][^/]*/\.\./'] + # Canonicalize the path of ld + ac_prog=`echo $ac_prog| sed 's%\\\\%/%g'` + while echo $ac_prog | grep "$re_direlt" > /dev/null 2>&1; do + ac_prog=`echo $ac_prog| sed "s%$re_direlt%/%"` + done + test -z "$LD" && LD="$ac_prog" + ;; + "") + # If it fails, then pretend we aren't using GCC. + ac_prog=ld + ;; + *) + # If it is relative, then search for the first ld in PATH. + with_gnu_ld=unknown + ;; + esac +elif test "$with_gnu_ld" = yes; then + AC_MSG_CHECKING([for GNU ld]) +else + AC_MSG_CHECKING([for non-GNU ld]) +fi +AC_CACHE_VAL(acl_cv_path_LD, +[if test -z "$LD"; then + IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS="${IFS}${PATH_SEPARATOR-:}" + for ac_dir in $PATH; do + test -z "$ac_dir" && ac_dir=. + if test -f "$ac_dir/$ac_prog" || test -f "$ac_dir/$ac_prog$ac_exeext"; then + acl_cv_path_LD="$ac_dir/$ac_prog" + # Check to see if the program is GNU ld. I'd rather use --version, + # but apparently some GNU ld's only accept -v. + # Break only if it was the GNU/non-GNU ld that we prefer. + if "$acl_cv_path_LD" -v 2>&1 < /dev/null | egrep '(GNU|with BFD)' > /dev/null; then + test "$with_gnu_ld" != no && break + else + test "$with_gnu_ld" != yes && break + fi + fi + done + IFS="$ac_save_ifs" +else + acl_cv_path_LD="$LD" # Let the user override the test with a path. +fi]) +LD="$acl_cv_path_LD" +if test -n "$LD"; then + AC_MSG_RESULT($LD) +else + AC_MSG_RESULT(no) +fi +test -z "$LD" && AC_MSG_ERROR([no acceptable ld found in \$PATH]) +AC_LIB_PROG_LD_GNU +]) Added: trunk/fuse-utils/m4/lib-link.m4 =================================================================== --- trunk/fuse-utils/m4/lib-link.m4 (rev 0) +++ trunk/fuse-utils/m4/lib-link.m4 2014-05-11 11:34:59 UTC (rev 5084) @@ -0,0 +1,551 @@ +# lib-link.m4 serial 4 (gettext-0.12) +dnl Copyright (C) 2001-2003 Free Software Foundation, Inc. +dnl This file is free software, distributed under the terms of the GNU +dnl General Public License. As a special exception to the GNU General +dnl Public License, this file may be distributed as part of a program +dnl that contains a configuration script generated by Autoconf, under +dnl the same distribution terms as the rest of that program. + +dnl From Bruno Haible. + +dnl AC_LIB_LINKFLAGS(name [, dependencies]) searches for libname and +dnl the libraries corresponding to explicit and implicit dependencies. +dnl Sets and AC_SUBSTs the LIB${NAME} and LTLIB${NAME} variables and +dnl augments the CPPFLAGS variable. +AC_DEFUN([AC_LIB_LINKFLAGS], +[ + AC_REQUIRE([AC_LIB_PREPARE_PREFIX]) + AC_REQUIRE([AC_LIB_RPATH]) + define([Name],[translit([$1],[./-], [___])]) + define([NAME],[translit([$1],[abcdefghijklmnopqrstuvwxyz./-], + [ABCDEFGHIJKLMNOPQRSTUVWXYZ___])]) + AC_CACHE_CHECK([how to link with lib[]$1], [ac_cv_lib[]Name[]_libs], [ + AC_LIB_LINKFLAGS_BODY([$1], [$2]) + ac_cv_lib[]Name[]_libs="$LIB[]NAME" + ac_cv_lib[]Name[]_ltlibs="$LTLIB[]NAME" + ac_cv_lib[]Name[]_cppflags="$INC[]NAME" + ]) + LIB[]NAME="$ac_cv_lib[]Name[]_libs" + LTLIB[]NAME="$ac_cv_lib[]Name[]_ltlibs" + INC[]NAME="$ac_cv_lib[]Name[]_cppflags" + AC_LIB_APPENDTOVAR([CPPFLAGS], [$INC]NAME) + AC_SUBST([LIB]NAME) + AC_SUBST([LTLIB]NAME) + dnl Also set HAVE_LIB[]NAME so that AC_LIB_HAVE_LINKFLAGS can reuse the + dnl results of this search when this library appears as a dependency. + HAVE_LIB[]NAME=yes + undefine([Name]) + undefine([NAME]) +]) + +dnl AC_LIB_HAVE_LINKFLAGS(name, dependencies, includes, testcode) +dnl searches for libname and the libraries corresponding to explicit and +dnl implicit dependencies, together with the specified include files and +dnl the ability to compile and link the specified testcode. If found, it +dnl sets and AC_SUBSTs HAVE_LIB${NAME}=yes and the LIB${NAME} and +dnl LTLIB${NAME} variables and augments the CPPFLAGS variable, and +dnl #defines HAVE_LIB${NAME} to 1. Otherwise, it sets and AC_SUBSTs +dnl HAVE_LIB${NAME}=no and LIB${NAME} and LTLIB${NAME} to empty. +AC_DEFUN([AC_LIB_HAVE_LINKFLAGS], +[ + AC_REQUIRE([AC_LIB_PREPARE_PREFIX]) + AC_REQUIRE([AC_LIB_RPATH]) + define([Name],[translit([$1],[./-], [___])]) + define([NAME],[translit([$1],[abcdefghijklmnopqrstuvwxyz./-], + [ABCDEFGHIJKLMNOPQRSTUVWXYZ___])]) + + dnl Search for lib[]Name and define LIB[]NAME, LTLIB[]NAME and INC[]NAME + dnl accordingly. + AC_LIB_LINKFLAGS_BODY([$1], [$2]) + + dnl Add $INC[]NAME to CPPFLAGS before performing the following checks, + dnl because if the user has installed lib[]Name and not disabled its use + dnl via --without-lib[]Name-prefix, he wants to use it. + ac_save_CPPFLAGS="$CPPFLAGS" + AC_LIB_APPENDTOVAR([CPPFLAGS], [$INC]NAME) + + AC_CACHE_CHECK([for lib[]$1], [ac_cv_lib[]Name], [ + ac_save_LIBS="$LIBS" + LIBS="$LIBS $LIB[]NAME" + AC_TRY_LINK([$3], [$4], [ac_cv_lib[]Name=yes], [ac_cv_lib[]Name=no]) + LIBS="$ac_save_LIBS" + ]) + if test "$ac_cv_lib[]Name" = yes; then + HAVE_LIB[]NAME=yes + AC_DEFINE([HAVE_LIB]NAME, 1, [Define if you have the $1 library.]) + AC_MSG_CHECKING([how to link with lib[]$1]) + AC_MSG_RESULT([$LIB[]NAME]) + else + HAVE_LIB[]NAME=no + dnl If $LIB[]NAME didn't lead to a usable library, we don't need + dnl $INC[]NAME either. + CPPFLAGS="$ac_save_CPPFLAGS" + LIB[]NAME= + LTLIB[]NAME= + fi + AC_SUBST([HAVE_LIB]NAME) + AC_SUBST([LIB]NAME) + AC_SUBST([LTLIB]NAME) + undefine([Name]) + undefine([NAME]) +]) + +dnl Determine the platform dependent parameters needed to use rpath: +dnl libext, shlibext, hardcode_libdir_flag_spec, hardcode_libdir_separator, +dnl hardcode_direct, hardcode_minus_L. +AC_DEFUN([AC_LIB_RPATH], +[ + AC_REQUIRE([AC_PROG_CC]) dnl we use $CC, $GCC, $LDFLAGS + AC_REQUIRE([AC_LIB_PROG_LD]) dnl we use $LD, $with_gnu_ld + AC_REQUIRE([AC_CANONICAL_HOST]) dnl we use $host + AC_REQUIRE([AC_CONFIG_AUX_DIR_DEFAULT]) dnl we use $ac_aux_dir + AC_CACHE_CHECK([for shared library run path origin], acl_cv_rpath, [ + CC="$CC" GCC="$GCC" LDFLAGS="$LDFLAGS" LD="$LD" with_gnu_ld="$with_gnu_ld" \ + ${CONFIG_SHELL-/bin/sh} "$ac_aux_dir/config.rpath" "$host" > conftest.sh + . ./conftest.sh + rm -f ./conftest.sh + acl_cv_rpath=done + ]) + wl="$acl_cv_wl" + libext="$acl_cv_libext" + shlibext="$acl_cv_shlibext" + hardcode_libdir_flag_spec="$acl_cv_hardcode_libdir_flag_spec" + hardcode_libdir_separator="$acl_cv_hardcode_libdir_separator" + hardcode_direct="$acl_cv_hardcode_direct" + hardcode_minus_L="$acl_cv_hardcode_minus_L" + dnl Determine whether the user wants rpath handling at all. + AC_ARG_ENABLE(rpath, + [ --disable-rpath do not hardcode runtime library paths], + :, enable_rpath=yes) +]) + +dnl AC_LIB_LINKFLAGS_BODY(name [, dependencies]) searches for libname and +dnl the libraries corresponding to explicit and implicit dependencies. +dnl Sets the LIB${NAME}, LTLIB${NAME} and INC${NAME} variables. +AC_DEFUN([AC_LIB_LINKFLAGS_BODY], +[ + define([NAME],[translit([$1],[abcdefghijklmnopqrstuvwxyz./-], + [ABCDEFGHIJKLMNOPQRSTUVWXYZ___])]) + dnl By default, look in $includedir and $libdir. + use_additional=yes + AC_LIB_WITH_FINAL_PREFIX([ + eval additional_includedir=\"$includedir\" + eval additional_libdir=\"$libdir\" + ]) + AC_LIB_ARG_WITH([lib$1-prefix], +[ --with-lib$1-prefix[=DIR] search for lib$1 in DIR/include and DIR/lib + --without-lib$1-prefix don't search for lib$1 in includedir and libdir], +[ + if test "X$withval" = "Xno"; then + use_additional=no + else + if test "X$withval" = "X"; then + AC_LIB_WITH_FINAL_PREFIX([ + eval additional_includedir=\"$includedir\" + eval additional_libdir=\"$libdir\" + ]) + else + additional_includedir="$withval/include" + additional_libdir="$withval/lib" + fi + fi +]) + dnl Search the library and its dependencies in $additional_libdir and + dnl $LDFLAGS. Using breadth-first-seach. + LIB[]NAME= + LTLIB[]NAME= + INC[]NAME= + rpathdirs= + ltrpathdirs= + names_already_handled= + names_next_round='$1 $2' + while test -n "$names_next_round"; do + names_this_round="$names_next_round" + names_next_round= + for name in $names_this_round; do + already_handled= + for n in $names_already_handled; do + if test "$n" = "$name"; then + already_handled=yes + break + fi + done + if test -z "$already_handled"; then + names_already_handled="$names_already_handled $name" + dnl See if it was already located by an earlier AC_LIB_LINKFLAGS + dnl or AC_LIB_HAVE_LINKFLAGS call. + uppername=`echo "$name" | sed -e 'y|abcdefghijklmnopqrstuvwxyz./-|ABCDEFGHIJKLMNOPQRSTUVWXYZ___|'` + eval value=\"\$HAVE_LIB$uppername\" + if test -n "$value"; then + if test "$value" = yes; then + eval value=\"\$LIB$uppername\" + test -z "$value" || LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }$value" + eval value=\"\$LTLIB$uppername\" + test -z "$value" || LTLIB[]NAME="${LTLIB[]NAME}${LTLIB[]NAME:+ }$value" + else + dnl An earlier call to AC_LIB_HAVE_LINKFLAGS has determined + dnl that this library doesn't exist. So just drop it. + : + fi + else + dnl Search the library lib$name in $additional_libdir and $LDFLAGS + dnl and the already constructed $LIBNAME/$LTLIBNAME. + found_dir= + found_la= + found_so= + found_a= + if test $use_additional = yes; then + if test -n "$shlibext" && test -f "$additional_libdir/lib$name.$shlibext"; then + found_dir="$additional_libdir" + found_so="$additional_libdir/lib$name.$shlibext" + if test -f "$additional_libdir/lib$name.la"; then + found_la="$additional_libdir/lib$name.la" + fi + else + if test -f "$additional_libdir/lib$name.$libext"; then + found_dir="$additional_libdir" + found_a="$additional_libdir/lib$name.$libext" + if test -f "$additional_libdir/lib$name.la"; then + found_la="$additional_libdir/lib$name.la" + fi + fi + fi + fi + if test "X$found_dir" = "X"; then + for x in $LDFLAGS $LTLIB[]NAME; do + AC_LIB_WITH_FINAL_PREFIX([eval x=\"$x\"]) + case "$x" in + -L*) + dir=`echo "X$x" | sed -e 's/^X-L//'` + if test -n "$shlibext" && test -f "$dir/lib$name.$shlibext"; then + found_dir="$dir" + found_so="$dir/lib$name.$shlibext" + if test -f "$dir/lib$name.la"; then + found_la="$dir/lib$name.la" + fi + else + if test -f "$dir/lib$name.$libext"; then + found_dir="$dir" + found_a="$dir/lib$name.$libext" + if test -f "$dir/lib$name.la"; then + found_la="$dir/lib$name.la" + fi + fi + fi + ;; + esac + if test "X$found_dir" != "X"; then + break + fi + done + fi + if test "X$found_dir" != "X"; then + dnl Found the library. + LTLIB[]NAME="${LTLIB[]NAME}${LTLIB[]NAME:+ }-L$found_dir -l$name" + if test "X$found_so" != "X"; then + dnl Linking with a shared library. We attempt to hardcode its + dnl directory into the executable's runpath, unless it's the + dnl standard /usr/lib. + if test "$enable_rpath" = no || test "X$found_dir" = "X/usr/lib"; then + dnl No hardcoding is needed. + LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }$found_so" + else + dnl Use an explicit option to hardcode DIR into the resulting + dnl binary. + dnl Potentially add DIR to ltrpathdirs. + dnl The ltrpathdirs will be appended to $LTLIBNAME at the end. + haveit= + for x in $ltrpathdirs; do + if test "X$x" = "X$found_dir"; then + haveit=yes + break + fi + done + if test -z "$haveit"; then + ltrpathdirs="$ltrpathdirs $found_dir" + fi + dnl The hardcoding into $LIBNAME is system dependent. + if test "$hardcode_direct" = yes; then + dnl Using DIR/libNAME.so during linking hardcodes DIR into the + dnl resulting binary. + LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }$found_so" + else + if test -n "$hardcode_libdir_flag_spec" && test "$hardcode_minus_L" = no; then + dnl Use an explicit option to hardcode DIR into the resulting + dnl binary. + LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }$found_so" + dnl Potentially add DIR to rpathdirs. + dnl The rpathdirs will be appended to $LIBNAME at the end. + haveit= + for x in $rpathdirs; do + if test "X$x" = "X$found_dir"; then + haveit=yes + break + fi + done + if test -z "$haveit"; then + rpathdirs="$rpathdirs $found_dir" + fi + else + dnl Rely on "-L$found_dir". + dnl But don't add it if it's already contained in the LDFLAGS + dnl or the already constructed $LIBNAME + haveit= + for x in $LDFLAGS $LIB[]NAME; do + AC_LIB_WITH_FINAL_PREFIX([eval x=\"$x\"]) + if test "X$x" = "X-L$found_dir"; then + haveit=yes + break + fi + done + if test -z "$haveit"; then + LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }-L$found_dir" + fi + if test "$hardcode_minus_L" != no; then + dnl FIXME: Not sure whether we should use + dnl "-L$found_dir -l$name" or "-L$found_dir $found_so" + dnl here. + LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }$found_so" + else + dnl We cannot use $hardcode_runpath_var and LD_RUN_PATH + dnl here, because this doesn't fit in flags passed to the + dnl compiler. So give up. No hardcoding. This affects only + dnl very old systems. + dnl FIXME: Not sure whether we should use + dnl "-L$found_dir -l$name" or "-L$found_dir $found_so" + dnl here. + LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }-l$name" + fi + fi + fi + fi + else + if test "X$found_a" != "X"; then + dnl Linking with a static library. + LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }$found_a" + else + dnl We shouldn't come here, but anyway it's good to have a + dnl fallback. + LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }-L$found_dir -l$name" + fi + fi + dnl Assume the include files are nearby. + additional_includedir= + case "$found_dir" in + */lib | */lib/) + basedir=`echo "X$found_dir" | sed -e 's,^X,,' -e 's,/lib/*$,,'` + additional_includedir="$basedir/include" + ;; + esac + if test "X$additional_includedir" != "X"; then + dnl Potentially add $additional_includedir to $INCNAME. + dnl But don't add it + dnl 1. if it's the standard /usr/include, + dnl 2. if it's /usr/local/include and we are using GCC on Linux, + dnl 3. if it's already present in $CPPFLAGS or the already + dnl constructed $INCNAME, + dnl 4. if it doesn't exist as a directory. + if test "X$additional_includedir" != "X/usr/include"; then + haveit= + if test "X$additional_includedir" = "X/usr/local/include"; then + if test -n "$GCC"; then + case $host_os in + linux*) haveit=yes;; + esac + fi + fi + if test -z "$haveit"; then + for x in $CPPFLAGS $INC[]NAME; do + AC_LIB_WITH_FINAL_PREFIX([eval x=\"$x\"]) + if test "X$x" = "X-I$additional_includedir"; then + haveit=yes + break + fi + done + if test -z "$haveit"; then + if test -d "$additional_includedir"; then + dnl Really add $additional_includedir to $INCNAME. + INC[]NAME="${INC[]NAME}${INC[]NAME:+ }-I$additional_includedir" + fi + fi + fi + fi + fi + dnl Look for dependencies. + if test -n "$found_la"; then + dnl Read the .la file. It defines the variables + dnl dlname, library_names, old_library, dependency_libs, current, + dnl age, revision, installed, dlopen, dlpreopen, libdir. + save_libdir="$libdir" + case "$found_la" in + */* | *\\*) . "$found_la" ;; + *) . "./$found_la" ;; + esac + libdir="$save_libdir" + dnl We use only dependency_libs. + for dep in $dependency_libs; do + case "$dep" in + -L*) + additional_libdir=`echo "X$dep" | sed -e 's/^X-L//'` + dnl Potentially add $additional_libdir to $LIBNAME and $LTLIBNAME. + dnl But don't add it + dnl 1. if it's the standard /usr/lib, + dnl 2. if it's /usr/local/lib and we are using GCC on Linux, + dnl 3. if it's already present in $LDFLAGS or the already + dnl constructed $LIBNAME, + dnl 4. if it doesn't exist as a directory. + if test "X$additional_libdir" != "X/usr/lib"; then + haveit= + if test "X$additional_libdir" = "X/usr/local/lib"; then + if test -n "$GCC"; then + case $host_os in + linux*) haveit=yes;; + esac + fi + fi + if test -z "$haveit"; then + haveit= + for x in $LDFLAGS $LIB[]NAME; do + AC_LIB_WITH_FINAL_PREFIX([eval x=\"$x\"]) + if test "X$x" = "X-L$additional_libdir"; then + haveit=yes + break + fi + done + if test -z "$haveit"; then + if test -d "$additional_libdir"; then + dnl Really add $additional_libdir to $LIBNAME. + LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }-L$additional_libdir" + fi + fi + haveit= + for x in $LDFLAGS $LTLIB[]NAME; do + AC_LIB_WITH_FINAL_PREFIX([eval x=\"$x\"]) + if test "X$x" = "X-L$additional_libdir"; then + haveit=yes + break + fi + done + if test -z "$haveit"; then + if test -d "$additional_libdir"; then + dnl Really add $additional_libdir to $LTLIBNAME. + LTLIB[]NAME="${LTLIB[]NAME}${LTLIB[]NAME:+ }-L$additional_libdir" + fi + fi + fi + fi + ;; + -R*) + dir=`echo "X$dep" | sed -e 's/^X-R//'` + if test "$enable_rpath" != no; then + dnl Potentially add DIR to rpathdirs. + dnl The rpathdirs will be appended to $LIBNAME at the end. + haveit= + for x in $rpathdirs; do + if test "X$x" = "X$dir"; then + haveit=yes + break + fi + done + if test -z "$haveit"; then + rpathdirs="$rpathdirs $dir" + fi + dnl Potentially add DIR to ltrpathdirs. + dnl The ltrpathdirs will be appended to $LTLIBNAME at the end. + haveit= + for x in $ltrpathdirs; do + if test "X$x" = "X$dir"; then + haveit=yes + break + fi + done + if test -z "$haveit"; then + ltrpathdirs="$ltrpathdirs $dir" + fi + fi + ;; + -l*) + dnl Handle this in the next round. + names_next_round="$names_next_round "`echo "X$dep" | sed -e 's/^X-l//'` + ;; + *.la) + dnl Handle this in the next round. Throw away the .la's + dnl directory; it is already contained in a preceding -L + dnl option. + names_next_round="$names_next_round "`echo "X$dep" | sed -e 's,^X.*/,,' -e 's,^lib,,' -e 's,\.la$,,'` + ;; + *) + dnl Most likely an immediate library name. + LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }$dep" + LTLIB[]NAME="${LTLIB[]NAME}${LTLIB[]NAME:+ }$dep" + ;; + esac + done + fi + else + dnl Didn't find the library; assume it is in the system directories + dnl known to the linker and runtime loader. (All the system + dnl directories known to the linker should also be known to the + dnl runtime loader, otherwise the system is severely misconfigured.) + LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }-l$name" + LTLIB[]NAME="${LTLIB[]NAME}${LTLIB[]NAME:+ }-l$name" + fi + fi + fi + done + done + if test "X$rpathdirs" != "X"; then + if test -n "$hardcode_libdir_separator"; then + dnl Weird platform: only the last -rpath option counts, the user must + dnl pass all path elements in one option. We can arrange that for a + dnl single library, but not when more than one $LIBNAMEs are used. + alldirs= + for found_dir in $rpathdirs; do + alldirs="${alldirs}${alldirs:+$hardcode_libdir_separator}$found_dir" + done + dnl Note: hardcode_libdir_flag_spec uses $libdir and $wl. + acl_save_libdir="$libdir" + libdir="$alldirs" + eval flag=\"$hardcode_libdir_flag_spec\" + libdir="$acl_save_libdir" + LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }$flag" + else + dnl The -rpath options are cumulative. + for found_dir in $rpathdirs; do + acl_save_libdir="$libdir" + libdir="$found_dir" + eval flag=\"$hardcode_libdir_flag_spec\" + libdir="$acl_save_libdir" + LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }$flag" + done + fi + fi + if test "X$ltrpathdirs" != "X"; then + dnl When using libtool, the option that works for both libraries and + dnl executables is -R. The -R options are cumulative. + for found_dir in $ltrpathdirs; do + LTLIB[]NAME="${LTLIB[]NAME}${LTLIB[]NAME:+ }-R$found_dir" + done + fi +]) + +dnl AC_LIB_APPENDTOVAR(VAR, CONTENTS) appends the elements of CONTENTS to VAR, +dnl unless already present in VAR. +dnl Works only for CPPFLAGS, not for LIB* variables because that sometimes +dnl contains two or three consecutive elements that belong together. +AC_DEFUN([AC_LIB_APPENDTOVAR], +[ + for element in [$2]; do + haveit= + for x in $[$1]; do + AC_LIB_WITH_FINAL_PREFIX([eval x=\"$x\"]) + if test "X$x" = "X$element"; then + haveit=yes + break + fi + done + if test -z "$haveit"; then + [$1]="${[$1]}${[$1]:+ }$element" + fi + done +]) Added: trunk/fuse-utils/m4/lib-prefix.m4 =================================================================== --- trunk/fuse-utils/m4/lib-prefix.m4 (rev 0) +++ trunk/fuse-utils/m4/lib-prefix.m4 2014-05-11 11:34:59 UTC (rev 5084) @@ -0,0 +1,155 @@ +# lib-prefix.m4 serial 3 (gettext-0.12.2) +dnl Copyright (C) 2001-2003 Free Software Foundation, Inc. +dnl This file is free software, distributed under the terms of the GNU +dnl General Public License. As a special exception to the GNU General +dnl Public License, this file may be distributed as part of a program +dnl that contains a configuration script generated by Autoconf, under +dnl the same distribution terms as the rest of that program. + +dnl From Bruno Haible. + +dnl AC_LIB_ARG_WITH is synonymous to AC_ARG_WITH in autoconf-2.13, and +dnl similar to AC_ARG_WITH in autoconf 2.52...2.57 except that is doesn't +dnl require excessive bracketing. +ifdef([AC_HELP_STRING], +[AC_DEFUN([AC_LIB_ARG_WITH], [AC_ARG_WITH([$1],[[$2]],[$3],[$4])])], +[AC_DEFUN([AC_][LIB_ARG_WITH], [AC_ARG_WITH([$1],[$2],[$3],[$4])])]) + +dnl AC_LIB_PREFIX adds to the CPPFLAGS and LDFLAGS the flags that are needed +dnl to access previously installed libraries. The basic assumption is that +dnl a user will want packages to use other packages he previously installed +dnl with the same --prefix option. +dnl This macro is not needed if only AC_LIB_LINKFLAGS is used to locate +dnl libraries, but is otherwise very convenient. +AC_DEFUN([AC_LIB_PREFIX], +[ + AC_BEFORE([$0], [AC_LIB_LINKFLAGS]) + AC_REQUIRE([AC_PROG_CC]) + AC_REQUIRE([AC_CANONICAL_HOST]) + AC_REQUIRE([AC_LIB_PREPARE_PREFIX]) + dnl By default, look in $includedir and $libdir. + use_additional=yes + AC_LIB_WITH_FINAL_PREFIX([ + eval additional_includedir=\"$includedir\" + eval additional_libdir=\"$libdir\" + ]) + AC_LIB_ARG_WITH([lib-prefix], +[ --with-lib-prefix[=DIR] search for libraries in DIR/include and DIR/lib + --without-lib-prefix don't search for libraries in includedir and libdir], +[ + if test "X$withval" = "Xno"; then + use_additional=no + else + if test "X$withval" = "X"; then + AC_LIB_WITH_FINAL_PREFIX([ + eval additional_includedir=\"$includedir\" + eval additional_libdir=\"$libdir\" + ]) + else + additional_includedir="$withval/include" + additional_libdir="$withval/lib" + fi + fi +]) + if test $use_additional = yes; then + dnl Potentially add $additional_includedir to $CPPFLAGS. + dnl But don't add it + dnl 1. if it's the standard /usr/include, + dnl 2. if it's already present in $CPPFLAGS, + dnl 3. if it's /usr/local/include and we are using GCC on Linux, + dnl 4. if it doesn't exist as a directory. + if test "X$additional_includedir" != "X/usr/include"; then + haveit= + for x in $CPPFLAGS; do + AC_LIB_WITH_FINAL_PREFIX([eval x=\"$x\"]) + if test "X$x" = "X-I$additional_includedir"; then + haveit=yes + break + fi + done + if test -z "$haveit"; then + if test "X$additional_includedir" = "X/usr/local/include"; then + if test -n "$GCC"; then + case $host_os in + linux*) haveit=yes;; + esac + fi + fi + if test -z "$haveit"; then + if test -d "$additional_includedir"; then + dnl Really add $additional_includedir to $CPPFLAGS. + CPPFLAGS="${CPPFLAGS}${CPPFLAGS:+ }-I$additional_includedir" + fi + fi + fi + fi + dnl Potentially add $additional_libdir to $LDFLAGS. + dnl But don't add it + dnl 1. if it's the standard /usr/lib, + dnl 2. if it's already present in $LDFLAGS, + dnl 3. if it's /usr/local/lib and we are using GCC on Linux, + dnl 4. if it doesn't exist as a directory. + if test "X$additional_libdir" != "X/usr/lib"; then + haveit= + for x in $LDFLAGS; do + AC_LIB_WITH_FINAL_PREFIX([eval x=\"$x\"]) + if test "X$x" = "X-L$additional_libdir"; then + haveit=yes + break + fi + done + if test -z "$haveit"; then + if test "X$additional_libdir" = "X/usr/local/lib"; then + if test -n "$GCC"; then + case $host_os in + linux*) haveit=yes;; + esac + fi + fi + if test -z "$haveit"; then + if test -d "$additional_libdir"; then + dnl Really add $additional_libdir to $LDFLAGS. + LDFLAGS="${LDFLAGS}${LDFLAGS:+ }-L$additional_libdir" + fi + fi + fi + fi + fi +]) + +dnl AC_LIB_PREPARE_PREFIX creates variables acl_final_prefix, +dnl acl_final_exec_prefix, containing the values to which $prefix and +dnl $exec_prefix will expand at the end of the configure script. +AC_DEFUN([AC_LIB_PREPARE_PREFIX], +[ + dnl Unfortunately, prefix and exec_prefix get only finally determined + dnl at the end of configure. + if test "X$prefix" = "XNONE"; then + acl_final_prefix="$ac_default_prefix" + else + acl_final_prefix="$prefix" + fi + if test "X$exec_prefix" = "XNONE"; then + acl_final_exec_prefix='${prefix}' + else + acl_final_exec_prefix="$exec_prefix" + fi + acl_save_prefix="$prefix" + prefix="$acl_final_prefix" + eval acl_final_exec_prefix=\"$acl_final_exec_prefix\" + prefix="$acl_save_prefix" +]) + +dnl AC_LIB_WITH_FINAL_PREFIX([statement]) evaluates statement, with the +dnl variables prefix and exec_prefix bound to the values they will have +dnl at the end of the configure script. +AC_DEFUN([AC_LIB_WITH_FINAL_PREFIX], +[ + acl_save_prefix="$prefix" + prefix="$acl_final_prefix" + acl_save_exec_prefix="$exec_prefix" + exec_prefix="$acl_final_exec_prefix" + $1 + exec_prefix="$acl_save_exec_prefix" + prefix="$acl_save_prefix" +]) This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <sba...@us...> - 2014-05-11 22:52:57
|
Revision: 5085 http://sourceforge.net/p/fuse-emulator/code/5085 Author: sbaldovi Date: 2014-05-11 22:52:54 +0000 (Sun, 11 May 2014) Log Message: ----------- Fix line break. Modified Paths: -------------- trunk/fuse-utils/autogen.sh trunk/fuse-utils/hacking/ChangeLog Modified: trunk/fuse-utils/autogen.sh =================================================================== --- trunk/fuse-utils/autogen.sh 2014-05-11 11:34:59 UTC (rev 5084) +++ trunk/fuse-utils/autogen.sh 2014-05-11 22:52:54 UTC (rev 5085) @@ -28,8 +28,8 @@ aclocal -I m4 # Mac OS X: Use glibtoolize instead -(glibtoolize --version) < /dev/null > /dev/null 2>&1 && LIBTOOLIZE=glibtoolize | -| LIBTOOLIZE=libtoolize +(glibtoolize --version) < /dev/null > /dev/null 2>&1 && LIBTOOLIZE=glibtoolize \ + || LIBTOOLIZE=libtoolize $LIBTOOLIZE --automake autoheader automake --add-missing Modified: trunk/fuse-utils/hacking/ChangeLog =================================================================== --- trunk/fuse-utils/hacking/ChangeLog 2014-05-11 11:34:59 UTC (rev 5084) +++ trunk/fuse-utils/hacking/ChangeLog 2014-05-11 22:52:54 UTC (rev 5085) @@ -449,3 +449,4 @@ definitions of AC_LIB_PREPARE_PREFIX, AC_LIB_RPATH, AC_LIB_LINKFLAGS_BODY and AC_LIB_APPENDTOVAR are always available (patch #325) (Fred). +20140511 autogen.sh: fix line break (Sergio). This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <sba...@us...> - 2014-07-06 13:17:08
|
Revision: 5088 http://sourceforge.net/p/fuse-emulator/code/5088 Author: sbaldovi Date: 2014-07-06 13:16:59 +0000 (Sun, 06 Jul 2014) Log Message: ----------- Add libav10 support (thanks, Alberto Garcia) (Anton Khirnov and Sergio). Modified Paths: -------------- trunk/fuse-utils/configure.ac trunk/fuse-utils/fmfconv_ff.c trunk/fuse-utils/hacking/ChangeLog Modified: trunk/fuse-utils/configure.ac =================================================================== --- trunk/fuse-utils/configure.ac 2014-07-06 12:44:59 UTC (rev 5087) +++ trunk/fuse-utils/configure.ac 2014-07-06 13:16:59 UTC (rev 5088) @@ -89,6 +89,9 @@ FFMPEG_LIBS="-lavformat -lavcodec -lswscale -lavutil", FFMPEG_LIBS=''; break ) + AC_CHECK_HEADERS([libavresample/avresample.h], + [FFMPEG_LIBS="$FFMPEG_LIBS -lavresample"] + ) if test "x$FFMPEG_LIBS" != "x" then AC_SUBST(FFMPEG_LIBS) @@ -97,6 +100,12 @@ AC_DEFINE([HAVE_FFMPEG_AVDICTIONARY],1,[Defined if AVDictionary is available]), true ) + AC_CHECK_LIB(avutil, av_frame_alloc, + AC_DEFINE([HAVE_FFMPEG_AV_FRAME_ALLOC],1, + [Defined if av_frame_alloc is available] + ), + true + ) dnl AC_CHECK_LIB(avcore, av_get_bytes_per_sample, AC_CHECK_LIB(avutil, av_get_bytes_per_sample, AC_DEFINE([HAVE_FFMPEG_BYTES_SAMPLE],1,[Defined if av_get_bytes_per_sample available]), @@ -106,6 +115,24 @@ AC_DEFINE([HAVE_FFMPEG_SAMPLE_FMT],1,[Defined if av_get_bits_per_sample_fmt available]), true ) + AC_CHECK_LIB(avcodec, avcodec_encode_audio2, + AC_DEFINE([HAVE_FFMPEG_AVCODEC_ENCODE_AUDIO2],1, + [Defined if avcodec_encode_audio2 is available] + ), + true + ) + AC_CHECK_LIB(avcodec, avcodec_encode_video2, + AC_DEFINE([HAVE_FFMPEG_AVCODEC_ENCODE_VIDEO2],1, + [Defined if avcodec_encode_video2 is available] + ), + true + ) + AC_CHECK_LIB(avcodec, avcodec_free_frame, + AC_DEFINE([HAVE_FFMPEG_AVCODEC_FREE_FRAME],1, + [Defined if avcodec_free_frame is available] + ), + true + ) AC_CHECK_LIB(avcodec, avcodec_open2, AC_DEFINE([HAVE_FFMPEG_AVCODEC_OPEN2],1,[Defined if avcodec_open2 is available]), true Modified: trunk/fuse-utils/fmfconv_ff.c =================================================================== --- trunk/fuse-utils/fmfconv_ff.c 2014-07-06 12:44:59 UTC (rev 5087) +++ trunk/fuse-utils/fmfconv_ff.c 2014-07-06 13:16:59 UTC (rev 5088) @@ -60,6 +60,12 @@ #include <libavformat/avformat.h> #include <libavutil/mathematics.h> + +#if HAVE_LIBAVRESAMPLE_AVRESAMPLE_H +#include <libavutil/opt.h> +#include <libavresample/avresample.h> +#endif + #include <libswscale/swscale.h> #include "libspectrum.h" @@ -96,7 +102,14 @@ static AVFrame *ff_picture, *ff_tmp_picture, *ffmpeg_pict; static struct SwsContext *video_resize_ctx; +static AVFrame *audio_frame; + +#ifdef HAVE_LIBAVRESAMPLE_AVRESAMPLE_H +static AVAudioResampleContext *audio_resample_ctx; +#else static ReSampleContext *audio_resample_ctx; +#endif + static int16_t **ffmpeg_sound; static uint8_t *video_outbuf; @@ -121,6 +134,17 @@ #define FMF_CODEC(name) name #endif +#ifndef HAVE_FFMPEG_AV_FRAME_ALLOC +#define av_frame_alloc( X ) avcodec_alloc_frame( X ) + +#ifdef HAVE_FFMPEG_AVCODEC_FREE_FRAME +#define av_frame_free( X ) avcodec_free_frame( X ) +#else +#define av_frame_free( X ) av_free( *(X) ) +#endif + +#endif /* #ifndef HAVE_FFMPEG_AV_FRAME_ALLOC */ + /* check that a given sample format is supported by the encoder */ static int check_sample_fmt( AVCodec *codec, enum AVSampleFormat sample_fmt ) @@ -141,8 +165,14 @@ int len; if( audio_resample_ctx && res_rte != snd_rte ) { + +#ifdef HAVE_LIBAVRESAMPLE_AVRESAMPLE_H + avresample_free( &audio_resample_ctx ); +#else audio_resample_close( audio_resample_ctx ); audio_resample_ctx = NULL; +#endif + av_free( audio_tmp_inpbuf ); ffmpeg_sound = &sound16; printi( 2, "ffmpeg_resample_audio(): reinit resample %dHz -> %dHz\n", snd_rte, out_rte ); @@ -153,11 +183,32 @@ out_fsz = 2 * out_chn; } if( !audio_resample_ctx ) { + +#ifdef HAVE_LIBAVRESAMPLE_AVRESAMPLE_H + audio_resample_ctx = avresample_alloc_context(); + av_opt_set_int( audio_resample_ctx, "in_channel_layout", + av_get_default_channel_layout( snd_chn ), 0 ); + av_opt_set_int( audio_resample_ctx, "out_channel_layout", + av_get_default_channel_layout( out_chn ), 0 ); + av_opt_set_int( audio_resample_ctx, "in_sample_fmt", AV_SAMPLE_FMT_S16, 0 ); + av_opt_set_int( audio_resample_ctx, "out_sample_fmt", AV_SAMPLE_FMT_S16, 0 ); + av_opt_set_int( audio_resample_ctx, "in_sample_rate", snd_rte, 0 ); + av_opt_set_int( audio_resample_ctx, "out_sample_rate", out_rte, 0 ); + + int ret; + ret = avresample_open( audio_resample_ctx ); + if( ret < 0 ) { + printe( "Error opening the resample context\n" ); + return 1; + } +#else audio_resample_ctx = av_audio_resample_init( out_chn, snd_chn, - out_rte, snd_rte, - AV_SAMPLE_FMT_S16, + out_rte, snd_rte, AV_SAMPLE_FMT_S16, - 16, 8, 1, 1.0 ); + AV_SAMPLE_FMT_S16, + 16, 8, 1, 1.0 ); +#endif /* #ifdef HAVE_LIBAVRESAMPLE_AVRESAMPLE_H */ + audio_tmp_inpbuf_size = (float)audio_outbuf_size * out_rte / snd_rte * (float)out_chn / snd_chn + 1.0; audio_tmp_inpbuf = av_malloc( audio_tmp_inpbuf_size ); ffmpeg_sound = (void *)(&audio_tmp_inpbuf); @@ -168,9 +219,17 @@ return 1; } +#ifdef HAVE_LIBAVRESAMPLE_AVRESAMPLE_H + len = avresample_convert( audio_resample_ctx, (uint8_t**)&audio_tmp_inpbuf, + audio_tmp_inpbuf_size, + audio_tmp_inpbuf_size / out_fsz, + (uint8_t**)&sound16, snd_len, snd_len / snd_fsz ); +#else len = audio_resample( audio_resample_ctx, (short *)audio_tmp_inpbuf, (short *)sound16, snd_len / snd_fsz ); +#endif + if( !len ) { printe( "FFMPEG: Error during audio resampling\n" ); return 1; @@ -303,6 +362,10 @@ #endif audio_input_frames = c->frame_size; +#ifdef HAVE_FFMPEG_AVCODEC_ENCODE_AUDIO2 + audio_frame = av_frame_alloc(); +#endif + if( audio_input_frames <= 1 ) { audio_outbuf_size = out_rte * 1250 * audio_oframe_size / out_fps; } else { @@ -318,18 +381,16 @@ } /* add an audio frame to the stream */ -void +int ffmpeg_add_sound_ffmpeg( int len ) { AVCodecContext *c; - int coded_bps; int16_t *buf; - if( !audio_st ) return; + if( !audio_st ) return 0; buf = *ffmpeg_sound; c = audio_st->codec; - coded_bps = av_get_bits_per_sample( c->codec_id ); audio_iframe_size = snd_chn > 1 ? 4 : 2; if( audio_input_frames > 1 && audio_inpbuf_len + len < audio_input_frames ) { @@ -337,32 +398,58 @@ memcpy( (char *)audio_inpbuf + ( audio_inpbuf_len * audio_iframe_size ), buf, len * audio_iframe_size ); audio_inpbuf_len += len; printi( 3, "ffmpeg_add_sound_ffmpeg(): store %d samples (%d/%d)\n", len, audio_input_frames, audio_iframe_size ); - return; + return 0; } printi( 3, "ffmpeg_add_sound_ffmpeg(): %d -> %d\n", audio_iframe_size, audio_oframe_size ); if( audio_input_frames > 1 ) { while( audio_inpbuf_len + len >= audio_input_frames ) { int copy_len = ( audio_input_frames - audio_inpbuf_len ) * audio_iframe_size; - AVPacket pkt; - av_init_packet( &pkt ); memcpy( (char *)audio_inpbuf + ( audio_inpbuf_len * audio_iframe_size ), buf, copy_len ); len -= audio_input_frames - audio_inpbuf_len; buf = (void *)( (char *)buf + copy_len ); - pkt.size = avcodec_encode_audio( c, audio_outbuf, audio_outbuf_size, audio_inpbuf ); + AVPacket pkt; + av_init_packet( &pkt ); + pkt.data = NULL; + pkt.size = 0; - if( c->coded_frame && c->coded_frame->pts != AV_NOPTS_VALUE ) - pkt.pts= av_rescale_q( c->coded_frame->pts, c->time_base, audio_st->time_base ); +#ifdef HAVE_FFMPEG_AVCODEC_ENCODE_AUDIO2 + int ret, got_output; + + audio_frame->data[0] = (uint8_t*)audio_inpbuf; + audio_frame->linesize[0] = c->frame_size * audio_iframe_size; + audio_frame->nb_samples = c->frame_size; + + ret = avcodec_encode_audio2( c, &pkt, audio_frame, &got_output ); + + if( ret < 0 ) { + printe( "Error encoding audio frame\n" ); + return 1; + } + + if( !got_output ) + continue; +#else + pkt.size = avcodec_encode_audio( c, audio_outbuf, + audio_outbuf_size, + audio_inpbuf ); + pkt.flags |= AV_PKT_FLAG_KEY; - pkt.stream_index = audio_st->index; pkt.data = audio_outbuf; +#endif /* #ifdef HAVE_FFMPEG_AVCODEC_ENCODE_AUDIO2 */ - /* write the compressed frame in the media file */ + if( c->coded_frame && c->coded_frame->pts != AV_NOPTS_VALUE ) { + pkt.pts = av_rescale_q( c->coded_frame->pts, c->time_base, + audio_st->time_base ); + } + pkt.stream_index = audio_st->index; + + /* write the compressed frame in the media file */ if( av_interleaved_write_frame( oc, &pkt ) != 0 ) { fprintf( stderr, "Error while writing audio frame\n" ); - /* exit( 1 ); */ + return 1; } audio_inpbuf_len = 0; printi( 3, "ffmpeg_add_sound_ffmpeg(): write sound packet %d samples (remain: %d) pkt.size = %dbyte\n", audio_input_frames, len, pkt.size ); @@ -373,13 +460,50 @@ } else { /* with PCM output */ + AVPacket pkt; av_init_packet( &pkt ); + pkt.data = NULL; + pkt.size = 0; - pkt.size = avcodec_encode_audio( c, audio_outbuf, coded_bps ? len * out_chn * coded_bps / 8 : len * out_chn, buf ); +#ifdef HAVE_FFMPEG_AVCODEC_ENCODE_AUDIO2 + int ret, got_output; - if( c->coded_frame && c->coded_frame->pts != AV_NOPTS_VALUE ) - pkt.pts= av_rescale_q( c->coded_frame->pts, c->time_base, audio_st->time_base ); + audio_frame->data[0] = (uint8_t*)buf; + audio_frame->linesize[0] = c->frame_size * audio_iframe_size; + audio_frame->nb_samples = c->frame_size; + + ret = avcodec_encode_audio2( c, &pkt, audio_frame, &got_output ); + + if( ret < 0 ) { + printe( "Error encoding audio frame\n" ); + return 1; + } + + if( got_output ) { + if( c->coded_frame && c->coded_frame->pts != AV_NOPTS_VALUE ) { + pkt.pts = av_rescale_q( c->coded_frame->pts, c->time_base, + audio_st->time_base ); + } + pkt.stream_index = audio_st->index; + + /* write */ + if( av_interleaved_write_frame( oc, &pkt ) != 0 ) { + fprintf( stderr, "Error while writing audio frame\n" ); + return 1; + } + } +#else + int coded_bps; + coded_bps = av_get_bits_per_sample( c->codec_id ); + + pkt.size = avcodec_encode_audio( c, audio_outbuf, + coded_bps ? len * out_chn * coded_bps / 8 : len * out_chn, buf ); + + if( c->coded_frame && c->coded_frame->pts != AV_NOPTS_VALUE ) { + pkt.pts = av_rescale_q( c->coded_frame->pts, c->time_base, + audio_st->time_base ); + } pkt.flags |= AV_PKT_FLAG_KEY; pkt.stream_index = audio_st->index; pkt.data = audio_outbuf; @@ -387,15 +511,20 @@ /* write */ if( av_interleaved_write_frame( oc, &pkt ) != 0 ) { fprintf( stderr, "Error while writing audio frame\n" ); -/* exit( 1 ); */ + return 1; } +#endif /* #ifdef HAVE_FFMPEG_AVCODEC_ENCODE_AUDIO2 */ + printi( 3, "ffmpeg_add_sound_ffmpeg(): write sound packet %d samples pkt.size = %dbyte\n", len, pkt.size ); } + + return 0; } int snd_write_ffmpeg( void ) { + int ret; /* if( !snd_header_ok && ( err = snd_write_ffmpegheader() ) ) return err; */ if( !audio_st ) return 0; @@ -411,7 +540,9 @@ } if( snd_len > 0 && ( out_rte != snd_rte || out_chn != snd_chn ) ) { printi( 3, "snd_write_ffmpeg(): got %d samples sound\n", snd_len / snd_fsz ); - ffmpeg_resample_audio(); + ret = ffmpeg_resample_audio(); + if( ret ) return ret; + ffmpeg_add_sound_ffmpeg( out_len / out_fsz ); printi( 2, "snd_write_ffmpeg(): %d samples sound\n", out_len / out_fsz ); } else if( snd_len > 0 ) { @@ -427,6 +558,10 @@ { if( audio_st ) avcodec_close( audio_st->codec ); if( audio_outbuf ) av_free( audio_outbuf ); + +#ifdef HAVE_FFMPEG_AVCODEC_ENCODE_AUDIO2 + av_frame_free( &audio_frame ); +#endif } /**************************************************************/ @@ -607,18 +742,21 @@ void ffmpeg_add_frame_ffmpeg( void ) { - int out_size, ret; + int ret; AVCodecContext *c; if( !video_st ) return; c = video_st->codec; + AVPacket pkt; + av_init_packet( &pkt ); + pkt.data = NULL; + pkt.size = 0; + if( oc->oformat->flags & AVFMT_RAWPICTURE ) { /* raw video case. The API will change slightly in the near future for that */ - AVPacket pkt; - av_init_packet( &pkt ); pkt.flags |= AV_PKT_FLAG_KEY; pkt.stream_index= video_st->index; @@ -629,13 +767,31 @@ } else { ffmpeg_pict->pts = c->frame_number; +#ifdef HAVE_FFMPEG_AVCODEC_ENCODE_VIDEO2 + int got_output; + /* encode the image */ + ret = avcodec_encode_video2(c, &pkt, ffmpeg_pict, &got_output); + if( ret >= 0 && got_output) { + pkt.pts = av_rescale_q( pkt.pts, c->time_base, video_st->time_base ); + pkt.dts = av_rescale_q( pkt.dts, c->time_base, video_st->time_base ); + + pkt.stream_index= video_st->index; + + /* write the compressed frame in the media file */ + ret = av_interleaved_write_frame( oc, &pkt ); + } else { + ret = 0; + } + +#else /* #ifdef HAVE_FFMPEG_AVCODEC_ENCODE_VIDEO2 */ + + int out_size; + + /* encode the image */ out_size = avcodec_encode_video( c, video_outbuf, video_outbuf_size, ffmpeg_pict ); /* if zero size, it means the image was buffered */ if( out_size > 0 ) { - AVPacket pkt; - av_init_packet( &pkt ); - if( c->coded_frame->pts != AV_NOPTS_VALUE ) pkt.pts = av_rescale_q( c->coded_frame->pts, c->time_base, video_st->time_base ); if( c->coded_frame->key_frame ) @@ -649,7 +805,10 @@ } else { ret = 0; } +#endif /* #ifdef HAVE_FFMPEG_AVCODEC_ENCODE_VIDEO2 */ + } + if( ret != 0 ) { fprintf(stderr, "Error while writing video frame\n"); /* exit( 1 ); */ Modified: trunk/fuse-utils/hacking/ChangeLog =================================================================== --- trunk/fuse-utils/hacking/ChangeLog 2014-07-06 12:44:59 UTC (rev 5087) +++ trunk/fuse-utils/hacking/ChangeLog 2014-07-06 13:16:59 UTC (rev 5088) @@ -450,3 +450,5 @@ AC_LIB_LINKFLAGS_BODY and AC_LIB_APPENDTOVAR are always available (patch #325) (Fred). 20140511 autogen.sh: fix line break (Sergio). +20140706 configure.ac,fmfconv_ff.c: add libav10 support (thanks, Alberto Garcia) + (Anton Khirnov and Sergio). This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <sba...@us...> - 2015-04-11 14:18:57
|
Revision: 5198 http://sourceforge.net/p/fuse-emulator/code/5198 Author: sbaldovi Date: 2015-04-11 14:18:50 +0000 (Sat, 11 Apr 2015) Log Message: ----------- Prefer groff over man2html. Modified Paths: -------------- trunk/fuse-utils/compat/win32/distribution.mk trunk/fuse-utils/hacking/ChangeLog Modified: trunk/fuse-utils/compat/win32/distribution.mk =================================================================== --- trunk/fuse-utils/compat/win32/distribution.mk 2015-04-11 14:16:04 UTC (rev 5197) +++ trunk/fuse-utils/compat/win32/distribution.mk 2015-04-11 14:18:50 UTC (rev 5198) @@ -45,10 +45,11 @@ man_files=`for file in $(top_srcdir)/man/*.1; do echo "$$file"; done | \ sed -e "s|^$$topsrcdirstrip/||" -e "s|.1$$||"`; \ for file in $$man_files; do \ - if test -n "$(MAN2HTML)"; then \ - $(MAN2HTML) -r "$(top_srcdir)/man/$$file.1" | sed '1d' > "$(DESTDIR)/$$file.html"; \ - else \ - test -z "$(GROFF)" || $(GROFF) -Thtml -man "$(top_srcdir)/man/$$file.1" > "$(DESTDIR)/$$file.html"; \ + if test -n "$(GROFF)"; then \ + $(GROFF) -Thtml -man "$(top_srcdir)/man/$$file.1" > "$(DESTDIR)/$$file.html"; \ + elif test -n "$(MAN2HTML)"; then \ + $(MAN2HTML) -r "$(top_srcdir)/man/$$file.1" | \ + sed '1d' > "$(DESTDIR)/$$file.html"; \ fi; \ done # Convert to DOS line endings Modified: trunk/fuse-utils/hacking/ChangeLog =================================================================== --- trunk/fuse-utils/hacking/ChangeLog 2015-04-11 14:16:04 UTC (rev 5197) +++ trunk/fuse-utils/hacking/ChangeLog 2015-04-11 14:18:50 UTC (rev 5198) @@ -452,3 +452,4 @@ 20140511 autogen.sh: fix line break (Sergio). 20140706 configure.ac,fmfconv_ff.c: add libav10 support (thanks, Alberto Garcia) (Anton Khirnov and Sergio). +20150411 compat/win32/distribution.mk: prefer groff over man2html (Sergio). This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <sba...@us...> - 2015-04-12 22:07:20
|
Revision: 5199 http://sourceforge.net/p/fuse-emulator/code/5199 Author: sbaldovi Date: 2015-04-12 22:07:17 +0000 (Sun, 12 Apr 2015) Log Message: ----------- Support JPEG, PNG and AVI output formats. New internal sound resampling. Allow greyscale output (patch #329) (Gergely Szasz). Modified Paths: -------------- trunk/fuse-utils/Makefile.am trunk/fuse-utils/configure.ac trunk/fuse-utils/fmfconv.c trunk/fuse-utils/fmfconv.h trunk/fuse-utils/fmfconv_aiff.c trunk/fuse-utils/fmfconv_au.c trunk/fuse-utils/fmfconv_ff.c trunk/fuse-utils/fmfconv_ppm.c trunk/fuse-utils/fmfconv_wav.c trunk/fuse-utils/fmfconv_yuv.c trunk/fuse-utils/hacking/ChangeLog Added Paths: ----------- trunk/fuse-utils/fmfconv_avi.c trunk/fuse-utils/fmfconv_jpg.c trunk/fuse-utils/fmfconv_png.c Modified: trunk/fuse-utils/Makefile.am =================================================================== --- trunk/fuse-utils/Makefile.am 2015-04-11 14:18:50 UTC (rev 5198) +++ trunk/fuse-utils/Makefile.am 2015-04-12 22:07:17 UTC (rev 5199) @@ -53,6 +53,7 @@ createhdf_SOURCES = ide.c createhdf.c fmfconv_SOURCES = fmfconv.c \ + fmfconv_avi.c \ fmfconv_ff.c \ fmfconv_yuv.c \ fmfconv_scr.c \ @@ -65,8 +66,16 @@ fmfconv_SOURCES += compat/getopt.c compat/getopt1.c endif -fmfconv_LDADD = @FFMPEG_LIBS@ compat/libcompatos.a +if HAVE_LIBJPEG +fmfconv_SOURCES += fmfconv_jpg.c +endif +if HAVE_LIBPNG +fmfconv_SOURCES += fmfconv_png.c +endif + +fmfconv_LDADD = @JPEG_LIBS@ @PNG_LIBS@ @FFMPEG_LIBS@ compat/libcompatos.a + listbasic_SOURCES = listbasic.c utils.c listbasic_LDADD = @LIBSPEC_LIBS@ compat/libcompatos.a Modified: trunk/fuse-utils/configure.ac =================================================================== --- trunk/fuse-utils/configure.ac 2015-04-11 14:18:50 UTC (rev 5198) +++ trunk/fuse-utils/configure.ac 2015-04-12 22:07:17 UTC (rev 5199) @@ -42,6 +42,9 @@ ;; esac +dnl Check non C89 functions +AC_CHECK_FUNCS(fdopen signal) + dnl Check for big endianness AC_C_BIGENDIAN @@ -75,6 +78,53 @@ LDFLAGS="$LDFLAGS -L$prefix/lib" fi) +dnl Check if libjpeg is available and supports jpeg_write_scanlines +AC_MSG_CHECKING(whether to use libjpeg) +AC_ARG_WITH(libjpeg, + [ --without-libjpeg don't use libjpeg], + if test "$withval" = no; then libjpeg=no; else libjpeg=yes; fi, + libjpeg=yes +) +AC_MSG_RESULT($libjpeg) + +if test "$libjpeg" = yes; then + AC_CHECK_HEADER( + jpeglib.h, + [AC_CHECK_LIB( jpeg, jpeg_write_scanlines, + [AC_DEFINE([USE_LIBJPEG], 1, + [Defined if we're going to be using the installed libjpeg]) + JPEG_LIBS='-ljpeg'], + [AC_MSG_WARN(jpeg_write_scanlines not found - jpeg output not supported...)], + )], + [AC_MSG_WARN(jpeglib.h not found - jpeg output not supported...)] + ) +fi +AM_CONDITIONAL(HAVE_LIBJPEG, test x$JPEG_LIBS != x) +AC_SUBST(JPEG_LIBS) + +dnl Check if a version of libpng which supplies png_write_png is available +AC_MSG_CHECKING(whether to use libpng) +AC_ARG_WITH(libpng, + [ --without-libpng don't use libpng], + if test "$withval" = no; then libpng=no; else libpng=yes; fi, + libpng=yes +) +AC_MSG_RESULT($libpng) +if test "$libpng" = yes; then + AC_CHECK_HEADER( + png.h, + [AC_CHECK_LIB( png, png_write_png, + [AC_DEFINE([USE_LIBPNG], 1, + [Defined if we're going to be using the installed libpng]) + PNG_LIBS='-lpng'], + [AC_MSG_WARN(png_write_png not found - PNG output not supported...)], + )], + [AC_MSG_WARN(png.h not found - PNG output not supported...)] + ) +fi +AM_CONDITIONAL(HAVE_LIBPNG, test x$PNG_LIBS != x) +AC_SUBST(PNG_LIBS) + dnl Check for ffmpeg libs AC_MSG_CHECKING(whether ffmpeg movie recording requested) AC_ARG_WITH(ffmpeg, Modified: trunk/fuse-utils/fmfconv.c =================================================================== --- trunk/fuse-utils/fmfconv.c 2015-04-11 14:18:50 UTC (rev 5198) +++ trunk/fuse-utils/fmfconv.c 2015-04-12 22:07:17 UTC (rev 5199) @@ -31,36 +31,40 @@ #include <sys/stat.h> #include <unistd.h> #include <string.h> + +#ifdef HAVE_SIGNAL +#include <signal.h> +#endif /* #ifdef HAVE_SIGNAL */ + #ifdef HAVE_STRINGS_H #include <strings.h> /* Needed for strncasecmp() on QNX6 */ #endif /* #ifdef HAVE_STRINGS_H */ + #include <fcntl.h> - -#ifdef HAVE_INTTYPES_H -#include <inttypes.h> -#else -#define PRIu64 "llu" -#endif /* #ifdef HAVE_INTTYPES_H */ - -#include "libspectrum.h" -#include "movie_tables.h" - #include <getopt.h> #ifdef USE_FFMPEG #include <libavformat/avformat.h> #include <libswscale/swscale.h> +#ifndef USE_FFMPEG_VARS +#define USE_FFMPEG_VARS 1 #endif +#endif #ifdef HAVE_ZLIB_H -#define USE_ZLIB 1 -#endif - -#ifdef USE_ZLIB #include <zlib.h> +#else +#define Z_NO_COMPRESSION 0 +#define Z_BEST_SPEED 1 +#define Z_DEFAULT_COMPRESSION 6 +#define Z_BEST_COMPRESSION 9 #endif +#include <libspectrum.h> + +#include "compat.h" #include "fmfconv.h" +#include "movie_tables.h" #define VERBOSE_MAX 3 #define VERBOSE_MIN -1 @@ -74,6 +78,26 @@ int fmf_compr_feof = 0; #endif /* USE_ZLIB */ +#ifdef USE_LIBJPEG +extern int jpg_dctfloat; +extern int jpg_idctfast; +extern int jpg_optimize; +extern int jpg_smooth; +extern int jpg_quality; +#endif + +int png_palette = -1; +#ifdef USE_LIBPNG +extern int png_compress; +#endif + +#if defined USE_LIBJPEG || defined USE_LIBPNG +int progressive = 0; +#endif +int greyscale = 0; + +int avi_subtype = -1; /* fmfconv guess */ + typedef enum { DO_FILE = 0, /* open (next) file */ DO_HEAD, /* read and check file header (FMF) */ @@ -90,14 +114,17 @@ int verbose = 0; int do_info = 0; /* no output and verbose 2 */ do_t do_now = DO_FILE; +int fmfconv_stop = 0; FILE *inp_file = NULL, *out = NULL, *snd = NULL; +int out_to_stdout = 0; type_t inp_t = TYPE_UNSET, out_t = TYPE_UNSET, snd_t = TYPE_UNSET, scr_t = TYPE_UNSET, prg_t = TYPE_NONE; const char *inp_name = NULL; const char *out_name = NULL; const char *snd_name = NULL; +int overwr_out = 0; char out_tmpl[16]; /* multiple out filename number template */ const char *out_orig = NULL; /* multiple out original filename/template */ @@ -130,10 +157,11 @@ }; const char *machine_name[] = { - "ZX Spectrum 16K/48K, Timex TC2048/2068, Scorpion, Spectrum SE", - "ZX Spectrum 128K/+2/+2A/+3/+3E", - "Timex TS2068", "Pentagon 128K/256K/512K" - "ZX Spectrum 48K (NTSC)" + "ZX Spectrum 16K/48K, Timex TC2048/2068, Scorpion, Spectrum SE", /* A */ + "ZX Spectrum 128K/+2/+2A/+3/+3E/128Ke", /* B */ + "Timex TS2068", /* C */ + "Pentagon 128K/256K/512K" /* D */ + "ZX Spectrum 48K (NTSC)" /* E */ }; #define SCR_PITCH 40 @@ -176,13 +204,13 @@ int frm_scr = 0, frm_rte = 0, frm_mch = 0; /* screen type, frame rate, machine type (A/B/C/D) */ int frm_slice_x, frm_slice_y, frm_slice_w, frm_slice_h; int frm_w = -1, frm_h = -1; -int frm_fps = 0; int out_w, out_h; int out_fps = 0; /* desired output frame rate */ int out_header_ok = 0; /* output header ok? */ int out_chn = 2, out_rte = -1, out_fsz, out_len; /* by default convert sound to 2 channel (STEREO) */ +int no_sound_resample = -1; /* FFMPEG/AVCODEC do their own... */ /* fmf variables */ int fmf_compr = 0; /* fmf compressed or not */ @@ -195,6 +223,7 @@ #define SOUND_BUFF_MAX_SIZE 65536 /* soft max size of collected sound samples */ type_t snd_enc; /* sound type (pcm/alaw) */ int snd_rte, snd_chn, snd_fsz, snd_len; /* sound rate (Hz), sound channels (1/2), sound length in byte */ +int snd_frg = 0; /* sound fragment len from previous resample in bytes */ int snd_header_ok = 0; /* sound header ok? */ int sound_raw = 0; /* do not do law->PCM and channels conversion */ @@ -215,6 +244,28 @@ #define INTO_BUFF 0 #define FROM_BUFF 1 +FILE * +fopen_overwr( const char *path, const char *mode, int rw ) +{ + if( overwr_out ) + return fopen( path, mode ); + +#ifdef HAVE_FDOPEN + int fd; + fd = open( path, ( rw ? O_RDWR : O_WRONLY ) | O_EXCL | O_CREAT | O_BINARY, + S_IRUSR | S_IWUSR | S_IRGRP | S_IWGRP | S_IROTH ); + if( fd >= 0 ) + return fdopen( fd, mode ); + else + return NULL; +#else + if( access( path, F_OK ) == 0 ) + return NULL; + + return fopen( path, mode ); +#endif +} + size_t fread_buff( libspectrum_byte *ptr, size_t size, int how ) /* read from inp, how -> into buff or buff + file */ { @@ -366,12 +417,19 @@ if( snd_t == TYPE_NONE ) return 0; - if( ( err = alloc_sound_buff( snd_len * 2 ) ) ) return err; +/* we have to deal resample fragment space */ + if( ( err = alloc_sound_buff( snd_frg + snd_len * 2 ) ) ) return err; - for( s = sound8 + snd_len - 1, t = sound16 + snd_len - 1 ; - s >= sound8; s--, t-- ) { +/* we have to skip resample fragment space */ + sound8 += snd_frg; + sound16 = (void *)sound8; + for( s = sound8 + snd_len - 1, t = sound16 + snd_len - 1; + s >= sound8 + snd_frg; s--, t-- ) { *t = alaw_table[*(libspectrum_byte*)s]; } +/* restore pointers */ + sound8 -= snd_frg; + sound16 = (void *)sound8; #ifdef WORDS_BIGENDIAN snd_little_endian = 0; #else @@ -445,6 +503,9 @@ if( snd_t == TYPE_NONE ) return 0; +/* we have to skip resample fragment space */ + sound8 += snd_frg; + sound16 = (void *)sound8; if( snd_enc == TYPE_PCM ) { libspectrum_signed_word *s; libspectrum_signed_word *t; @@ -460,6 +521,9 @@ *t = *s; s++; *t = ( (libspectrum_signed_dword)*t + *s + 1 ) / 2; } } +/* restore pointers */ + sound8 -= snd_frg; + sound16 = (void *)sound8; snd_chn = 1; snd_fsz >>= 1; /* 1/2byte -> 2/4byte */ snd_len >>= 1; /* 1/2byte -> 2/4byte */ @@ -470,16 +534,134 @@ } /* - [-/^^^^\______/-] -> + [;;;;; /^^^^\______/] + ^ ^ ^ + | | | + sbuf snd_frg snd_r + fmf_rte + snd_rte + out_rte +*/ int resample_sound( void ) { + int err, nsamples; + static int fmf_rte = -1; + static int snd_cpy = 0; + static int last_l = 0, last_r = 0; + size_t new_len; + libspectrum_signed_byte *snd8_w, *snd8_r; + libspectrum_signed_word *snd16_w, *snd16_r; + + if( snd_t == TYPE_NONE || no_sound_resample ) return 0; + + + snd16_r = snd16_w = sound16; + snd8_r = snd8_w = sound8; + + if( out_rte > snd_rte ) { /* move samples to upper part */ + new_len = snd_len + snd_fsz; + new_len = new_len * out_rte / snd_rte + snd_frg; + if( ( err = alloc_sound_buff( new_len ) ) ) return err; + + snd8_r = snd8_r + new_len - snd_len; + memmove( snd8_r, sound8 + snd_frg, snd_len ); + snd16_r = (void *)snd8_r; + + if( snd_enc == TYPE_PCM ) + snd16_w += snd_cpy * snd_chn; + else + snd8_w += snd_cpy * snd_chn; + } + +/* rescale last copied samples (fragment) */ + fmf_rte -= out_rte - snd_rte; + nsamples = snd_len / snd_fsz; + while( nsamples-- ) { + if( snd_cpy ) { /* [---- ######] [lrlrlr] */ + int n = snd_cpy + 1; + + if( snd_enc == TYPE_PCM ) + snd16_w -= snd_cpy * snd_chn; + else + snd8_w -= snd_cpy * snd_chn; + + while( snd_cpy ) { + if( snd_enc == TYPE_PCM ) { + *snd16_w = last_l + (*snd16_r - last_l) * (n - snd_cpy) / n; + snd16_w++; + } else { + *snd8_w = last_l + (*snd8_r - last_l) * (n - snd_cpy) / n; + snd8_w++; + } + if( snd_chn == 2 ) { + if( snd_enc == TYPE_PCM ) { + *snd16_w = last_r + (*(snd16_r+1) - last_r) * (n - snd_cpy) / n; + snd16_w++; + } else { + *snd8_w = last_r + (*(snd8_r+1) - last_r) * (n - snd_cpy) / n; + snd8_w++; + } + } + snd_cpy--; + } + } + while( fmf_rte <= 0 ) { + if( snd_enc == TYPE_PCM ) { + if( snd16_w != snd16_r ) + *snd16_w = *snd16_r; /* really we do not need to store copies ... */ + snd16_w++; + } else { + if( snd8_w != snd8_r ) + *snd8_w = *snd8_r; + snd8_w++; + } + if( snd_chn == 2 ) { + if( snd_enc == TYPE_PCM ) { + if( snd16_w != snd16_r + 1 ) + *snd16_w = *(snd16_r + 1); + snd16_w++; + } else { + if( snd8_w != snd8_r + 1 ) + *snd8_w = *(snd8_r + 1); + snd8_w++; + } + } + fmf_rte += snd_rte; + snd_cpy++; + } + if( snd_enc == TYPE_PCM ) { + last_l = last_r = *snd16_r; + snd16_r++; + } else { + last_l = last_r = *snd8_r; + snd8_r++; + } + if( snd_chn == 2 ) { + if( snd_enc == TYPE_PCM ) { + last_r = *snd16_r; + snd16_r++; + } else { + last_r = *snd8_r; + snd8_r++; + } + } + fmf_rte -= out_rte; + if( snd_cpy ) snd_cpy--; + } + snd_frg = snd_cpy * snd_fsz; + new_len = ( snd_enc == TYPE_PCM ? (void *)snd16_w : (void *)snd8_w ) - + (void *)sound8; + new_len -= snd_frg; + printi( 3, "resample_sound(): %d sample converted to %d (%dHz -> %dHz)\n", + snd_len / snd_fsz, new_len / snd_fsz, snd_rte, out_rte ); + snd_len = new_len; + fmf_rte += out_rte - snd_rte; + return 0; } -*/ - char * find_filename_ext( const char *filename ) { @@ -630,13 +812,13 @@ } int -next_outname( void ) +next_outname( libspectrum_qword num ) { int err; if( !out_orig && ( err = parse_outname() ) ) return err; strcpy( out_next, out_orig ); - sprintf( out_nmbr, out_tmpl, output_no ); + sprintf( out_nmbr, out_tmpl, num ); if( out_pfix ) strcat( out_next, out_pfix ); out_name = out_next; @@ -656,24 +838,42 @@ int i, err; ext_t out_ext_tab[] = { + { TYPE_WAV, "wav" }, + { TYPE_AU, "au" }, + { TYPE_AU, "snd" }, + { TYPE_AIFF, "aif" }, + { TYPE_AIFF, "aiff" }, + { TYPE_YUV, "yuv" }, { TYPE_YUV, "y4m" }, { TYPE_SCR, "scr" }, { TYPE_PPM, "ppm" }, { TYPE_PPM, "pnm" }, - { TYPE_PNG, "png" }, - { TYPE_JPEG, "jpg" }, - { TYPE_JPEG, "jpeg" }, +#ifdef USE_FFMPEG { TYPE_FFMPEG,"mpeg" }, { TYPE_FFMPEG,"mpg" }, { TYPE_FFMPEG,"avi" }, { TYPE_FFMPEG,"mkv" }, + { TYPE_FFMPEG,"flv" }, + { TYPE_FFMPEG,"webm" }, +#endif +#ifdef USE_LIBPNG + { TYPE_PNG, "png" }, +#endif +#ifdef USE_LIBJPEG + { TYPE_JPEG, "jpg" }, + { TYPE_JPEG, "jpeg" }, + { TYPE_MJPEG,"mjpeg" }, +#endif + { TYPE_AVI, "avi" }, { 0, NULL } }; const char *out_tstr[] = { "SCR - ZX Spectrum screenshot file", "PPM - Portable PixMap", "PNG - Portable Network Graphics", "JPEG - Joint Photographic Experts Group file format", + "M-JPEG - Motion JPEG video file", + "AVI - Microsoft Audio Video Interleave format", "YUV4MPEG2 - uncompressed video stream format", "FFMPEG - ffmpeg file format" }; @@ -695,31 +895,49 @@ } } } + if( out_t >= TYPE_WAV && out_t <= TYPE_AIFF ) { + sound_only = 1; + out_t = TYPE_NONE; + snd_name = out_name; + out_name = NULL; + return 0; + } if( out_name && ( out_t >= TYPE_SCR && out_t <= TYPE_JPEG ) && - ( err = next_outname() ) > 0 ) return err; + ( err = next_outname( output_no ) ) > 0 ) return err; + /* default out fps PAL */ + if( out_t >= TYPE_MJPEG && out_t <= TYPE_FFMPEG && out_fps == 0 ) + out_fps = 25000; + if( out_name #ifdef USE_FFMPEG && out_t != TYPE_FFMPEG #endif ) { - if( ( out = fopen( out_name, "wb" ) ) == NULL ) { - printe( "Cannot open output file '%s'...\n", out_name ); + if( ( out = fopen_overwr( out_name, "wb", 0 ) ) == NULL ) { + printe( "Cannot open output file '%s' (%s)...\n", out_name, + strerror( errno ) ); return ERR_OPEN_SND; } - } else +#ifdef USE_LIBJPEG + if( avi_subtype == -1 ) avi_subtype = TYPE_AVI; +#endif + } else if( 1 #ifdef USE_FFMPEG - if( out_t != TYPE_FFMPEG ) + && out_t != TYPE_FFMPEG #endif - { + ) { if( isatty( fileno( stdout ) ) ) { out_t = TYPE_NONE; out = NULL; out_name = "(-=null=-)"; } else { - out_t = TYPE_YUV; /* default to YUV */ + if( out_t != TYPE_AVI && out_t != TYPE_MJPEG ) { + out_t = TYPE_YUV; /* default to YUV */ + } out = stdout; + out_to_stdout = 1; out_name = "(-=stdout=-)"; #ifdef WIN32 setmode( fileno( stdout ), O_BINARY ); @@ -727,6 +945,15 @@ } } +#ifdef USE_LIBPNG + if( out_t == TYPE_PNG && png_palette < 0 ) + png_palette = 1; +#endif +#ifdef USE_FFMPEG + if( out_t == TYPE_FFMPEG && no_sound_resample == -1 ) + no_sound_resample = 1; +#endif + if( out_t == TYPE_NONE ) { printi( 0, "open_out(): Output is a terminal, cannot dump binary data.\n" ); } else if( !( out_t >= TYPE_SCR && out_t <= TYPE_JPEG ) ) { @@ -739,6 +966,18 @@ printi( 2, "open_out(): Output file (%s) opened as %s file.\n", out_name, out_tstr[out_t - TYPE_SCR] ); } + + if( avi_subtype == -1 ) avi_subtype = TYPE_AVI_DIB; + /* convert rgb palette to bgr */ + if( out_t == TYPE_AVI && avi_subtype == TYPE_AVI_DIB && !greyscale ) { + libspectrum_byte r; + printi( 3, "Converting RGB palette to BGR for Microsoft AVI/DIB format.\n" ); + for( i = 0; i < 16; i ++ ) { + r = rgb_pal[ i * 3 ]; + rgb_pal[ i * 3 ] = rgb_pal[ i * 3 + 2 ]; + rgb_pal[ i * 3 + 2 ] = r; + } + } return 0; } @@ -758,29 +997,35 @@ { TYPE_AU, "snd" }, { TYPE_AIFF, "aif" }, { TYPE_AIFF, "aiff" }, +#ifdef FFMPEG { TYPE_FFMPEG, "mp2" }, { TYPE_FFMPEG, "mp3" }, { TYPE_FFMPEG, "ogg" }, { TYPE_FFMPEG, "aac" }, { TYPE_FFMPEG, "ac3" }, { TYPE_FFMPEG, "m4a" }, +#endif { 0, NULL } }; const char *snd_tstr[] = { "FFMPEG - ffmpeg file format", - "WAV - MS Wave format", + "WAV - MS Wave file format", "AU - SUN OS audio file format", - "AIF - MAC/OS audio file" + "AIF - MAC/OS audio file format" }; if( do_info ) return 0; if( snd_name ) { - if( ( snd = fopen( snd_name, "wb" ) ) == NULL ) { - printe( "Cannot open sound file '%s'...\n", snd_name ); + if( ( snd = fopen_overwr( snd_name, "wb", 0 ) ) == NULL ) { + printe( "Cannot open sound file '%s' (%s)...\n", snd_name, + strerror( errno ) ); return ERR_OPEN_SND; } + } else if( out_t == TYPE_AVI ) { /* AVI video and audio if nothing else specified */ + snd_t = TYPE_AVI; + return 0; } else if( out_t == TYPE_FFMPEG ) { /* FFMPEG video and audio if nothing else specified */ snd_t = TYPE_FFMPEG; return 0; @@ -822,6 +1067,9 @@ } else if( out_t == TYPE_FFMPEG ) { /* FFMPEG video and audio if nothing else specified */ snd_t = TYPE_FFMPEG; return 0; + } else if( out_t == TYPE_AVI ) { /* AVI video and audio */ + snd_t = TYPE_AVI; + return 0; } else { inp_file = stdin; inp_name = "(-=stdin=-)"; @@ -913,7 +1161,7 @@ frm_mch = fhead[6]; /* machine type */ inp_fps = machine_timing[frm_mch - 'A'] / frm_rte; /* real input fps * 1000 frame / 1000s */ - if( out_fps == 0 ) out_fps = inp_fps; /* later may change */ + if( out_fps <= 0 ) out_fps = inp_fps; /* later may change */ /* Check initial sound parameters */ if( fhead[7] != 'P' && fhead[7] != 'A' ) { @@ -935,8 +1183,8 @@ snd_fsz = ( snd_enc == TYPE_PCM ? 2 : 1 ) * snd_chn; if( snd_enc == TYPE_PCM ) snd_little_endian = fmf_little_endian; - if( out_rte == -1 ) out_rte = snd_rte; - if( out_chn == -1 ) out_chn = snd_chn; + if( sound_raw || out_rte == -1 ) out_rte = snd_rte; + if( sound_raw ) out_chn = snd_chn; do_now = DO_SLICE; printi( 1, "check_fmf_head(): file: FMF V1 %s endian %scompressed.\n", fmf_little_endian ? "little" : "big", fmf_compr ? "" : "un" ); @@ -982,7 +1230,7 @@ frm_rte = fhead[0]; /* frame rate (1:#) */ frm_mch = fhead[2]; /* machine type */ inp_fps = machine_timing[frm_mch - 'A'] / frm_rte; /* real input fps * 1000 frame / 1000s */ - if( out_fps == 0 ) out_fps = inp_fps; /* later may change */ + if( out_fps <= 0 ) out_fps = inp_fps; /* later may change */ } do_now = DO_SLICE; frame_no++; @@ -1069,8 +1317,8 @@ len = ( fhead[4] + ( fhead[5] << 8 ) + 1 ) * snd_fsz; if( sound_stereo == -1 ) out_chn = snd_chn; - if( ( err = alloc_sound_buff( snd_len + len ) ) ) return err; - if( fread_compr( (void *)( sound8 + snd_len ), len, 1, inp_file ) != 1 ) { + if( ( err = alloc_sound_buff( snd_len + snd_frg + len ) ) ) return err; + if( fread_compr( (void *)( sound8 + snd_frg + snd_len ), len, 1, inp_file ) != 1 ) { printe( "\n\nCorrupt input file (S) @0x%08lx.\n", (unsigned long)ftell( inp_file ) ); return ERR_CORRUPT_INP; } @@ -1093,9 +1341,11 @@ if( snd_len <= 0 ) return 0; + if( no_sound_resample ) out_rte = snd_rte; if( snd_enc != TYPE_PCM && sound_pcm && ( err = law_2_pcm() ) ) return err; + if( snd_chn == 2 && sound_stereo == 0 && ( err = stereo_2_mono() ) ) return err; + if( ( snd_rte != out_rte || snd_frg ) && ( err = resample_sound() ) ) return err; if( snd_chn == 1 && sound_stereo == 1 && ( err = mono_2_stereo() ) ) return err; - if( snd_chn == 2 && sound_stereo == 0 && ( err = stereo_2_mono() ) ) return err; if( snd_t == TYPE_WAV ) err = snd_write_wav(); @@ -1103,6 +1353,8 @@ err = snd_write_au(); else if( snd_t == TYPE_AIFF ) err = snd_write_aiff(); + else if( snd_t == TYPE_AVI ) + err = snd_write_avi(); #ifdef USE_FFMPEG else if( snd_t == TYPE_FFMPEG ) err = snd_write_ffmpeg(); @@ -1258,6 +1510,8 @@ inp_get_next_cut(); if( ( cut_f_t == TYPE_FRAME ? frame_no >= cut_frm : time_sec >= cut_frm ) && ( cut_cmd == TYPE_CUTFROM || ( cut_t_t == TYPE_FRAME ? frame_no <= cut__to : time_sec <= cut__to ) ) ) { + + if( cut_cmd == TYPE_CUTFROM ) fmfconv_stop = 1; drop_no++; cut_cut = 1; } @@ -1282,56 +1536,48 @@ return 0; } +/* store RGB/YUV/Paletted color/grayscale pixel*/ void -out_2_yuv( void ) +pix_pix( int *idx, int xx, int i ) { - - libspectrum_byte *bitmap, *attr; - int i, w, idx; - int Y, U, V; - int x = frm_slice_x, y = frm_slice_y, h = frm_slice_h; - int inv = ( frame_no * frm_rte % 32 ) > 15 ? 1 : 0; - - w = frm_slice_w; - for( h = frm_slice_h; h > 0; h--, y++, w = frm_slice_w ) { - if( scr_t != TYPE_HRE ) - idx = y * OUT_PITCH + x * 8 ; /* 8pixel/data */ - else - idx = y * OUT_PITCH * 2 + x * 16 ; /* 16 pixel/data*/ - bitmap = &zxscr[SCR_PITCH * y + x]; - attr = &attrs[SCR_PITCH * y + x]; - for( ; w > 0; w--, bitmap++, attr++ ) { - int px, fx, ix = *attr; - int bits = scr_t == TYPE_HRE ? ( *bitmap << 8 ) + *(bitmap + 9600) : *bitmap; - - fx = ( ix & 0x80 ) * inv; - px = ( ( ix & 0x38 ) >> 3 ) + ( ( ix & 0x40 ) ? 8 : 0 ); - ix = ( ix & 0x07 ) + ( ( ix & 0x40 ) ? 8 : 0 ); - for( i = ( scr_t == TYPE_HRE ? 16 : 8 ); i > 0; i-- ) { - if( ( bits ^ fx ) & 128 ) { /* ink */ - Y = yuv_pal[ ix * 3 + 0 ]; - U = yuv_pal[ ix * 3 + 1 ]; - V = yuv_pal[ ix * 3 + 2 ]; - } else { /* paper */ - Y = yuv_pal[ px * 3 + 0 ]; - U = yuv_pal[ px * 3 + 1 ]; - V = yuv_pal[ px * 3 + 2 ]; - } - pix_yuv[0][idx] = Y; - pix_yuv[1][idx] = U; - pix_yuv[2][idx++] = V; - bits <<= 1; + if( out_t >= TYPE_YUV ) { + pix_yuv[0][*idx] = yuv_pal[ xx * 3 + 0 ]; + if( !greyscale ) { + pix_yuv[1][*idx] = yuv_pal[ xx * 3 + 1 ]; + pix_yuv[2][*idx] = yuv_pal[ xx * 3 + 2 ]; + } + (*idx)++; + } else if( out_t >= TYPE_PPM ) { + if( png_palette > 0 ) { + if( i & 0x01 ) { + pix_rgb[*idx] &= 0xf0; + pix_rgb[*idx] |= xx; + (*idx)++; + } else { + pix_rgb[*idx] &= 0x0f; + pix_rgb[*idx] |= xx << 4; } + } else { + if( greyscale ) { + pix_rgb[*idx] = yuv_pal[ xx * 3 + 0 ]; + (*idx)++; + } else { + pix_rgb[*idx] = rgb_pal[ xx * 3 + 0 ]; + (*idx)++; + pix_rgb[*idx] = rgb_pal[ xx * 3 + 1 ]; + (*idx)++; + pix_rgb[*idx] = rgb_pal[ xx * 3 + 2 ]; + (*idx)++; + } } } } void -out_2_rgb( void ) +out_2_pix( void ) { libspectrum_byte *bitmap, *attr; int i, w, idx; - int R, G, B; int x = frm_slice_x, y = frm_slice_y, h = frm_slice_h; int inv = ( frame_no * frm_rte % 32 ) > 15 ? 1 : 0; @@ -1342,7 +1588,10 @@ else idx = y * OUT_PITCH * 2 + x * 16 ; /* 16 pixel/data*/ - idx *= 3; + if( png_palette > 0 ) + idx /= 2; + else if( out_t < TYPE_YUV && !greyscale ) + idx *= 3; bitmap = &zxscr[SCR_PITCH * y + x]; attr = &attrs[SCR_PITCH * y + x]; @@ -1354,18 +1603,7 @@ px = ( ( ix & 0x38 ) >> 3 ) + ( ( ix & 0x40 ) ? 8 : 0 ); ix = ( ix & 0x07 ) + ( ( ix & 0x40 ) ? 8 : 0 ); for( i = scr_t == TYPE_HRE ? 16 : 8; i > 0; i-- ) { - if( ( bits ^ fx ) & 128 ) { /* ink */ - R = rgb_pal[ ix * 3 + 0 ]; - G = rgb_pal[ ix * 3 + 1 ]; - B = rgb_pal[ ix * 3 + 2 ]; - } else { /* paper */ - R = rgb_pal[ px * 3 + 0 ]; - G = rgb_pal[ px * 3 + 1 ]; - B = rgb_pal[ px * 3 + 2 ]; - } - pix_rgb[idx++] = R; - pix_rgb[idx++] = G; - pix_rgb[idx++] = B; + pix_pix( &idx, ( bits ^ fx ) & 128 ? ix : px, i ); bits <<= 1; } } @@ -1375,22 +1613,22 @@ int out_write_frame( void ) { + static int fmf_fps = 0; + int err; int add_frame = 0; - int n = -frm_fps / inp_fps; + int n = -fmf_fps / inp_fps; - if( frm_fps > 0 ) { + if( fmf_fps > 0 ) { drop_no++; printi( 2, "out_write_frame(): drop this frame.\n" ); - } - - if( cut_cut ) { + } else if( cut_cut ) { drop_no++; printi( 2, "out_write_frame(): cut this frame.\n" ); return 0; } - while( frm_fps <= 0 ) { + while( fmf_fps <= 0 ) { if( n > 1 ) { /* we have to add sound in more part */ } else { snd_write_sound(); @@ -1412,15 +1650,27 @@ if( ( err = out_write_scr() ) ) return err; } else if( out_t == TYPE_PPM ) { if( ( err = out_write_ppm() ) ) return err; +#ifdef USE_LIBPNG + } else if( out_t == TYPE_PNG ) { + if( ( err = out_write_png() ) ) return err; +#endif + } else if( out_t == TYPE_AVI ) { + if( ( err = out_write_avi() ) ) return err; +#ifdef USE_LIBJPEG + } else if( out_t == TYPE_JPEG ) { + if( ( err = out_write_jpg() ) ) return err; + } else if( out_t == TYPE_MJPEG ) { + if( ( err = out_write_mjpeg() ) ) return err; +#endif } - frm_fps += inp_fps; + fmf_fps += inp_fps; output_no++; if( ( out_t >= TYPE_SCR && out_t <= TYPE_JPEG ) ) { close_out(); open_out(); } } - frm_fps -= out_fps; + fmf_fps -= out_fps; return 0; } @@ -1434,11 +1684,17 @@ #endif if( !out ) return; + +#ifdef USE_LIBJPEG + if( out_t == TYPE_MJPEG && out_header_ok ) + out_finalize_mjpeg(); + if( out_t == TYPE_AVI && out_header_ok ) + out_finalize_avi(); +#endif fclose( out ); out = NULL; } - int prepare_next_file( void ) /* multiple input file */ { @@ -1460,6 +1716,7 @@ " -i --input <filename> Input file.\n" " -o --output <filename> Output file.\n" " -s --sound <filename> Output sound file.\n" + " -y --overwrite Force overwrite output file(s).\n" " --sound-only Process only the sound from an `fmf' file.\n" " --mono Convert sound to mono (by default sound\n" " is converted to stereo).\n" @@ -1472,6 +1729,12 @@ " note: FFMPEG needs PCM audio without change\n" " the channel number too.\n" #endif /* USE_FFMPEG */ + " --force-resample FFMPEG output (see -X) disable the internal\n" + " sound resampling. You can force the internal\n" + " resampling of sound with this option.\n" + " -E --srate <rate> Resample audio to <rate> sampling rate where\n" + " <rate> is `cd' for 44100 or `dat' for 48000 or\n" + " a number (`cd' and `dat' set `stereo' as well)\n" " -w --wav Save sound to Microsoft audio (wav) file.\n" " -u --au Save sound to Sun Audio (au) file.\n" " -m --aiff Save sound to Apple Computer audio (aiff/aiff-c)\n" @@ -1483,10 +1746,47 @@ " `420j', `420m', `420' or `410'.\n" " -S --scr Save video as SCR screenshots.\n" " -P --ppm Save video as PPM screenshots.\n" - " -f --frate <timing> Set output frame rate. `timing' is `pal',\n" +#ifdef USE_LIBPNG + " -G --png Save video as PNG screenshots.\n" + " --png-compress <level> Set compression level, where <level> between 0\n" + " and 9, or `none', `fast', `best'.\n" + " --progressive Save progressive (interlaced) PNG file.\n" +#endif +#ifdef USE_LIBJPEG + " -J --jpg Save video as JPEG screenshots.\n" + " -Q --jpg-quality <q> Set jpeg quality, where <q> between 0 and 100.\n" + " --jpg-smooth <factor> Set jpeg smoothing factor, where <smooth>\n" + " between 0 and 100.\n" + " --jpg-optimize libjpeg optimize Huffman tables.\n" + " --jpg-float libjpeg use float DCT algorithm.\n" + " --jpg-fast libjpeg use fast DCT algorithm.\n" + " --progressive Save progressive (interlaced) JPEG file.\n" + " -M --mjpeg Save video as raw MJPEG file (abbreviated JPEG\n" + " stream).\n" + " --avi Save video as internal AVI encoder format.\n" + " Encode video as M-JPEG and audio as S16_LE PCM\n" + " If output is not a file (stdout or redirected)\n" + " then fmfconv encode video as uncompressed\n" + " BGR24 DIB frames.\n" + " --avi-uncompr Force uncompressed AVI frames.\n" + " --avi-mjpeg Force M-JPEG AVI frames.\n" +#else + " --avi Save video as internal AVI encoder format.\n" + " Encode video as uncompressed BGR24 DIB frames\n" + " and audio as S16_LE PCM.\n" +#endif +#if defined USE_FFMPEG && defined USE_LIBJPEG + " note: force internal AVI encoder over FFMPEG.\n" +#endif + " --greyscale Save greyscale image/video.\n" + " -f --frate <timing> Set output frame rate. `timing' is `raw', `pal',\n" " `ntsc', `movie' or a number with a maximum\n" " of 3 digits after the decimal point, or a #/#\n" " (e.g.: -f 29.97 or -f 30000/1001).\n" + " For video output formats (AVI/MJPEG/YUV4MPEG2)\n" + " fmfconv set framerate to 25fps (PAL timing).\n" + " If you want to keep the original framerate use\n" + " --frate raw.\n" " -g --progress <form> Show progress, where <form> is one of `%%', `bar'\n" " `frame' or `time'. frame and time are similar\n" " to bar and show movie seconds or frame number\n" @@ -1498,6 +1798,8 @@ " -f/--frate).\n" #ifdef USE_FFMPEG " -X --ffmpeg Save video and audio as FFMPEG file (default).\n" +#endif +#ifdef USE_FFMPEG_VARS " -p --profile <profile> Select the profile for FFMPEG output where\n" " <profile> is `youtube', `dvd', `svcd' or `ipod'\n" " -F --format <format> Select file format for FFMPEG output (by default\n" @@ -1516,15 +1818,14 @@ " 640x480, `hvga' for 480x360, `qvga' for\n" " 320x240, `pal' for 768x576 (this set frame\n" " rate to 25 also) or WxH, Sx, N/Mx or W.\n" - " -E --srate <rate> Resample audio to <rate> sampling rate where\n" - " <rate> is `cd' for 44100 or `dat' for 48000 or\n" - " a number (`cd' and `dat' set `stereo' as well).\n" +#endif /* USE_FFMPEG_VARS */ +#ifdef USE_FFMPEG " --formats List available FFMPEG formats (see -F/--format).\n" " --vcodecs List available FFMPEG video codecs (see\n" " -c/--vcodec).\n" " --acodecs List available FFMPEG audio codecs (see\n" " -a/--acodec).\n" -#endif +#endif /* USE_FFMPEG */ " --info Scan input file(s) and print information.\n" " -v --verbose Increase the verbosity level by one.\n" " -q --quiet Decrease the verbosity level by one.\n" @@ -1564,6 +1865,26 @@ last_perc = perc; } +#define ARG_YUV_FORMAT 0x101 +#define ARG_AIFC 0x102 +#define ARG_SOUND_ONLY 0x103 +#define ARG_FORCE_RESAMPLE 0x104 + +#define ARG_JPG_SMOOTH 0x105 +#define ARG_JPG_OPT 0x106 +#define ARG_JPG_FLOAT 0x107 +#define ARG_JPG_FAST 0x108 + +#define ARG_PNG_COMPRESS 0x109 +#define ARG_PNG_RGB 0x110 + +#define ARG_AVI 0x111 +#define ARG_AVI_DIB 0x112 +#define ARG_AVI_MJPEG 0x113 + +#define ARG_PROGRESSIVE 0x114 +#define ARG_GREYSCALE 0x115 + int parse_args( int argc, char *argv[] ) { @@ -1571,16 +1892,19 @@ {"input", 1, NULL, 'i'}, {"output", 1, NULL, 'o'}, {"sound", 1, NULL, 's'}, - {"sound-only", 0, NULL, 0x103}, + {"overwrite", 0, NULL, 'y'}, + {"sound-only", 0, NULL, ARG_SOUND_ONLY}, {"mono", 0, &sound_stereo, 0}, /* set mono */ {"raw-sound",0, &sound_raw, 1}, /* do not convert fmf sound to PCM_S16LE */ /* {"no-sound", 0, &video_only, 1}, */ + {"srate", 1, NULL, 'E'}, /* audio new samplerate cd/dat set 'stereo' also */ + {"force-resample", 0, NULL, ARG_FORCE_RESAMPLE}, /* force internal resampling even with FFMPEG */ {"wav", 0, NULL, 'w'}, /* save .wav sound */ {"au", 0, NULL, 'u'}, /* save .au sound */ {"aiff", 0, NULL, 'm'}, /* save .aiff sound */ - {"aifc", 0, NULL, 0x102}, /* force aifc */ + {"aifc", 0, NULL, ARG_AIFC}, /* force aifc */ /* {"simple-height", 0, &simple_height, 1}, {"no-aspect", 0, &simple_height, -1}, @@ -1588,12 +1912,40 @@ {"scr", 0, NULL, 'S'}, /* extract as SCR */ {"ppm", 0, NULL, 'P'}, /* extract as PPM */ {"yuv", 0, NULL, 'Y'}, /* YUV output */ - {"yuv-format", 1, NULL, 0x101}, + {"yuv-format", 1, NULL, ARG_YUV_FORMAT}, {"frate", 1, NULL, 'f'}, /* video frame rate */ {"progress",1,NULL, 'g'}, /* progress 'bar' */ - {"cut", 1, NULL, 'C'}, /*TODO cut */ + {"cut", 1, NULL, 'C'}, /* TODO cut */ +#ifdef USE_LIBJPEG + {"jpg", 0, NULL, 'J'}, /* jpeg */ + {"jpg-quality", 1, NULL, 'Q'}, /* jpeg quality */ + {"jpg-smooth", 1, NULL, ARG_JPG_SMOOTH}, /* jpeg smoothing */ + {"jpg-optimize", 0, NULL, ARG_JPG_OPT}, /* jpeg optimize */ + {"jpg-float", 0, NULL, ARG_JPG_FLOAT}, /* jpeg float DTC */ + {"jpg-fast", 0, NULL, ARG_JPG_FAST}, /* jpeg fast DCT */ + {"mjpeg", 0, NULL, 'M'}, /* M-JPEG */ +#endif + {"avi", 0, NULL, ARG_AVI}, /* select internal AVI output */ +#ifdef USE_LIBJPEG + {"avi-uncompr", 0, NULL, ARG_AVI_DIB}, /* force uncompressed AVI output */ + {"avi-mjpeg", 0, NULL, ARG_AVI_MJPEG}, /* force compressed AVI output */ +#endif +#ifdef USE_LIBPNG + {"png", 0, NULL, 'G'}, /* PNG */ + {"png-compress", 1, NULL, ARG_PNG_COMPRESS}, /* PNG compression */ + {"png-rgb", 0, NULL, ARG_PNG_RGB}, /* PNG RGB24 */ +#endif +#if defined USE_LIBJPEG || USE_LIBPNG + {"progressive", 0, NULL, ARG_PROGRESSIVE}, /* jpeg/png progressive */ +#endif + {"greyscale", 0, NULL, ARG_GREYSCALE}, /* convert to grescale */ #ifdef USE_FFMPEG {"ffmpeg", 0, NULL, 'X'}, /* select FFMPEG output */ + {"formats",0, &ffmpeg_list, 0}, /* list formats */ + {"acodecs",0, &ffmpeg_list, 1}, /* list formats */ + {"vcodecs",0, &ffmpeg_list, 2}, /* list formats */ +#endif +#ifdef USE_FFMPEG_VARS {"profile",1 ,NULL, 'p'}, /* output profile */ {"format", 1, NULL, 'F'}, /* file format */ {"acodec", 1, NULL, 'a'}, /* audio codec */ @@ -1601,10 +1953,6 @@ {"arate", 1, NULL, 'A'}, /* audio bitrate */ {"vrate", 1, NULL, 'r'}, /* video bitrate */ {"resize", 1, NULL, 'R'}, /* resize video */ - {"srate", 1, NULL, 'E'}, /* audio new samplerate cd/dat set 'stereo' also */ - {"formats",0, &ffmpeg_list, 0}, /* list formats */ - {"acodecs",0, &ffmpeg_list, 1}, /* list formats */ - {"vcodecs",0, &ffmpeg_list, 2}, /* list formats */ #endif {"info", 0, &do_info, 1}, @@ -1624,9 +1972,18 @@ char t; int i; - c = getopt_long (argc, argv, "i:o:s:f:g:C:wumSPY" + c = getopt_long (argc, argv, "i:o:s:f:g:C:wumSPYy" +#ifdef USE_LIBJPEG + "JQ:M" +#endif +#ifdef USE_LIBPNG + "G" +#endif +#ifdef USE_FFMPEG_VARS + "p:F:a:c:A:r:R:E:" +#endif #ifdef USE_FFMPEG - "p:F:a:c:A:r:R:E:X" + "X" #endif "hVvq", long_options, NULL); @@ -1645,6 +2002,9 @@ case 's': snd_name = optarg; /* strdup( optarg ); ?? */ break; + case 'y': + overwr_out = 1; /* force overwrite existing output files */ + break; case 'w': snd_t = TYPE_WAV; /* audio container WAV */ break; @@ -1654,10 +2014,10 @@ case 'm': snd_t = TYPE_AIFF; /* audio container AIFF */ break; - case 0x102: + case ARG_AIFC: force_aifc = 1; break; - case 0x103: + case ARG_SOUND_ONLY: sound_only = 1; out_t = TYPE_NONE; break; @@ -1667,10 +2027,75 @@ case 'P': /* PPM output */ out_t = TYPE_PPM; break; + case ARG_AVI: /* internal AVI encoder */ + out_t = TYPE_AVI; + snd_t = TYPE_AVI; + break; +#ifdef USE_LIBJPEG + case 'J': /* JPEG output */ + out_t = TYPE_JPEG; + break; + case 'Q': /* JPEG output */ + jpg_quality = atoi( optarg ); + break; + case ARG_JPG_SMOOTH: /* JPEG smooth */ + jpg_smooth = atoi( optarg ); + break; + case ARG_JPG_OPT: /* JPEG optimize */ + jpg_optimize = 1; + break; + case ARG_JPG_FLOAT: /* JPEG float */ + jpg_dctfloat = 1; + break; + case ARG_JPG_FAST: /* JPEG fast */ + jpg_idctfast = 1; + break; + case 'M': /* M-JPEG output */ + out_t = TYPE_MJPEG; + break; + case ARG_AVI_DIB: /* uncompressed AVI */ + out_t = TYPE_AVI; + snd_t = TYPE_AVI; + avi_subtype = TYPE_AVI_DIB; + break; + case ARG_AVI_MJPEG: /* compressed AVI */ + out_t = TYPE_AVI; + snd_t = TYPE_AVI; + avi_subtype = TYPE_AVI; + break; +#endif +#ifdef USE_LIBPNG + case 'G': /* PNG output */ + out_t = TYPE_PNG; + break; + case ARG_PNG_COMPRESS: /* PNG compression */ + if( !strcmp( optarg, "none" ) ) + png_compress = Z_NO_COMPRESSION; + else if( !strcmp( optarg, "fast" ) ) + png_compress = Z_BEST_SPEED; + else if( !strcmp( optarg, "default" ) ) + png_compress = Z_DEFAULT_COMPRESSION; + else if( !strcmp( optarg, "best" ) ) + png_compress = Z_BEST_COMPRESSION; + else + png_compress = atoi( optarg ); + break; + case ARG_PNG_RGB: /* PNG palette */ + png_palette = 0; + break; +#endif +#if defined USE_LIBJPEG || defined USE_LIBPNG + case ARG_PROGRESSIVE: /* JPEG/PNG progressive */ + progressive = 1; + break; + case ARG_GREYSCALE: /* Greyscale */ + greyscale = 1; + break; +#endif case 'Y': /* YUV output */ out_t = TYPE_YUV; break; - case 0x101: /* YUV FORMAT */ + case ARG_YUV_FORMAT: /* YUV FORMAT */ if( !strcmp( optarg, "444" ) ) yuv_t = TYPE_444; else if( !strcmp( optarg, "422" ) ) @@ -1693,7 +2118,9 @@ break; case 'f': /* output frame rate */ - if( !strcmp( optarg, "pal" ) ) + if( !strcmp( optarg, "raw" ) ) + out_fps = -1; + else if( !strcmp( optarg, "pal" ) ) out_fps = 25000; /* 25.000 1/s */ else if( !strcmp( optarg, "ntsc" ) ) out_fps = 29970; /* 29.970 1/s */ @@ -1713,7 +2140,7 @@ printe( "Unknow value for '-f/--frate' ...\n"); return ERR_BAD_PARAM; } - if( out_fps < 1 ) { + if( out_fps != -1 && out_fps < 1 ) { printe( "Bad value for '-f/--frate' ...\n"); return ERR_BAD_PARAM; } @@ -1727,6 +2154,8 @@ out_t = TYPE_FFMPEG; snd_t = TYPE_FFMPEG; break; +#endif +#ifdef USE_FFMPEG_VARS case 'p': /* profile */ if( !strcmp( optarg, "youtube" ) ) { ffmpeg_rescale = TYPE_RESCALE_WH; @@ -1750,7 +2179,10 @@ out_w = 320; out_h = 240; out_fps = 30000; ffmpeg_vcodec = "libx264"; ffmpeg_format = "ipod"; ffmpeg_arate = 128000;ffmpeg_vrate = 256000; - out_rte = 44100; sound_stereo = 1; ffmpeg_libx264 = 1; + out_rte = 44100; sound_stereo = 1; +#ifdef USE_FFMPEG + ffmpeg_libx264 = 1; +#endif } else { printe( "Unknow value for '-p/--profile' ...\n"); return ERR_BAD_PARAM; @@ -1806,6 +2238,9 @@ return ERR_BAD_PARAM; } break; + case ARG_FORCE_RESAMPLE: /* force internal resample */ + no_sound_resample = 0; + break; case 'E': if( !strcmp( optarg, "cd" ) ) out_rte = 44100, sound_stereo = 1; @@ -1819,7 +2254,7 @@ return ERR_BAD_PARAM; } break; -#endif +#endif /* USE_FFMPEG_VARS */ case 'h': print_help(); help_exit = 1; @@ -1887,6 +2322,13 @@ return 0; } +#ifdef HAVE_SIGNAL +void +fmfconv_exit( int signal ) +{ + fmfconv_stop = 1; +} +#endif int main( int argc, char *argv[] ) { @@ -1910,10 +2352,12 @@ } if( !sound_only && ( err = open_out() ) ) return err; if( ( err = open_snd() ) ) return err; + if( no_sound_resample == -1 ) no_sound_resample = 0; if( snd_t == TYPE_UNSET && out_t == TYPE_FFMPEG ) { snd_t = TYPE_FFMPEG; } + if( sound_raw ) { sound_pcm = 0; sound_stereo = -1; @@ -1931,7 +2375,12 @@ zstream.avail_out = ZBUF_SIZE; #endif /* USE_ZLIB */ +#ifdef HAVE_SIGNAL + signal( SIGINT, fmfconv_exit ); +#endif + while( !eop ) { + if( fmfconv_stop ) do_now = DO_EOP; switch ( do_now ) { case DO_FILE: if( ( err = prepare_next_file() ) ) eop = 1; /* if we read from multiple file... */ @@ -1953,10 +2402,7 @@ if( ( err = scr_read_scr() ) ) eop = 1; } if( out_t != TYPE_NONE ) { /* convert slice to RGB or YUV if needed */ - if( out_t >= TYPE_YUV ) - out_2_yuv(); - else if( out_t >= TYPE_PPM ) - out_2_rgb(); + if( out_t >= TYPE_PPM ) out_2_pix(); } break; case DO_SOUND: Modified: trunk/fuse-utils/fmfconv.h =================================================================== --- trunk/fuse-utils/fmfconv.h 2015-04-11 14:18:50 UTC (rev 5198) +++ trunk/fuse-utils/fmfconv.h 2015-04-12 22:07:17 UTC (rev 5199) @@ -23,6 +23,19 @@ */ +#ifndef FMFCONV_H +#define FMFCONV_H + +#ifdef HAVE_INTTYPES_H +#include <inttypes.h> +#else +#define PRIu64 "llu" +#endif /* #ifdef HAVE_INTTYPES_H */ + +#ifdef HAVE_ZLIB_H +#define USE_ZLIB +#endif + #ifdef USE_FFMPEG #include <libavformat/avformat.h> #include <libswscale/swscale.h> @@ -61,11 +74,13 @@ TYPE_FMF, /* i */ TYPE_SCR, /* io (no conv) */ - TYPE_PPM, /* o (conv to RGB) */ TYPE_PNG, TYPE_JPEG, + TYPE_MJPEG, /* o */ + TYPE_AVI, /* os */ + TYPE_YUV, /* o (conv to YUV) */ TYPE_FFMPEG, /* os */ @@ -79,7 +94,10 @@ TYPE_420M, TYPE_420, TYPE_410, + TYPE_mono, + TYPE_AVI_DIB, + TYPE_RESCALE_WH, TYPE_RESCALE_X, @@ -110,10 +128,12 @@ extern int verbose; extern FILE *out, *snd; +extern int out_to_stdout; extern int frm_slice_x, frm_slice_y, frm_slice_w, frm_slice_h; extern int frm_w, frm_h; extern int frm_fps, frm_mch; +extern libspectrum_qword output_no; /* output frame no */ extern type_t scr_t, yuv_t, out_t, snd_t; @@ -141,13 +161,31 @@ extern int force_aifc; /* record aifc file even PCM sound */ +FILE *fopen_overwr( const char *path, const char *mode, int rw ); libspectrum_dword swap_endian_dword( libspectrum_dword d ); void pcm_swap_endian( void ); /* buff == sound */ +int next_outname( libspectrum_qword num ); +void close_out( void ); +int open_out( void ); +int snd_write_avi( void ); +int out_write_avi( void ); +void out_finalize_avi( void ); + int out_write_yuv( void ); int out_write_scr( void ); int out_write_ppm( void ); +#ifdef USE_LIBPNG +int out_write_png( void ); +#endif +#ifdef USE_LIBJPEG +int out_write_jpg( void ); +int out_write_mjpeg( void ); +int out_build_avi_mjpeg_frame( char **frame_buff, + unsigned long int *frame_size ); +void out_finalize_mjpeg( void ); +#endif int snd_write_wav( void ); void snd_finalize_wav( void ); @@ -158,16 +196,19 @@ int snd_write_aiff( void ); void snd_finalize_aiff( void ); -#ifdef USE_FFMPEG +#ifdef USE_FFMPEG_VARS extern int ffmpeg_arate; /* audio bitrate */ extern int ffmpeg_vrate; /* video bitrate */ -extern AVRational ffmpeg_aspect; -extern int ffmpeg_libx264; +extern type_t ffmpeg_rescale; extern const char *ffmpeg_frate; extern const char *ffmpeg_format; extern const char *ffmpeg_vcodec; extern const char *ffmpeg_acodec; -extern type_t ffmpeg_rescale; +extern AVRational ffmpeg_aspect; +#endif + +#ifdef USE_FFMPEG +extern int ffmpeg_libx264; extern int ffmpeg_list; int snd_write_ffmpeg( void ); @@ -179,5 +220,7 @@ int ffmpeg_rescale_video( void ); void ffmpeg_list_ffmpeg( int what ); +#endif -#endif + +#endif /* FMFCONV_H */ Modified: trunk/fuse-utils/fmfconv_aiff.c =================================================================== --- trunk/fuse-utils/fmfconv_aiff.c 2015-04-11 14:18:50 UTC (rev 5198) +++ trunk/fuse-utils/fmfconv_aiff.c 2015-04-12 22:07:17 UTC (rev 5199) @@ -133,8 +133,8 @@ fwrite( "SSND\377\377\377\377\000\000\000\000\000\000\000\000", 16, 1, snd );/* data Chunk header */ snd_header_ok = 1; - printi( 1, "snd_write_aif%cheader(): %dHz %c encoded %s\n", aifc ? 'c' : 'f', snd_rte, snd_enc, - snd_chn == 2 ? "stereo" : "mono" ); + printi( 1, "snd_write_aif%cheader(): %dHz %c encoded %s\n", aifc ? 'c' : 'f', + out_rte, snd_enc, snd_chn == 2 ? "stereo" : "mono" ); return 0; } Modified: trunk/fuse-utils/fmfconv_au.c =================================================================== --- trunk/fuse-utils/fmfconv_au.c 2015-04-11 14:18:50 UTC (rev 5198) +++ trunk/fuse-utils/fmfconv_au.c 2015-04-12 22:07:17 UTC (rev 5199) @@ -45,14 +45,14 @@ buff[1] = 24 + 64; buff[2] = ~0U; buff[3] = snd_enc == TYPE_PCM ? 3 : ( snd_enc == TYPE_ULW ? 1 : 27 ); - buff[4] = snd_rte; + buff[4] = out_rte; buff[5] = snd_chn; #else buff[0] = swap_endian_dword( 0x2e736e64UL ); /* magic id */ buff[1] = swap_endian_dword( 24 + 64 ); buff[2] = swap_endian_dword( ~0U ); buff[3] = swap_endian_dword( snd_enc == TYPE_PCM ? 3 : ( snd_enc == TYPE_ULW ? 1 : 27 ) ); - buff[4] = swap_endian_dword( snd_rte ); + buff[4] = swap_endian_dword( out_rte ); buff[5] = swap_endian_dword( snd_chn ); #endif fwrite( buff, 24, 1, snd ); @@ -66,7 +66,7 @@ } snd_header_ok = 1; - printi( 1, "snd_write_auheader(): %dHz %c encoded %s\n", snd_rte, snd_enc, + printi( 1, "snd_write_auheader(): %dHz %c encoded %s\n", out_rte, snd_enc, snd_chn == 2 ? "stereo" : "mono" ); return 0; } Added: trunk/fuse-utils/fmfconv_avi.c =================================================================== --- trunk/fuse-utils/fmfconv_avi.c (rev 0) +++ trunk/fuse-utils/fmfconv_avi.c 2015-04-12 22:07:17 UTC (rev 5199) @@ -0,0 +1,393 @@ +/* fmfconv_avi.c: avi output with raw video/audio included into fmfconv.c + Copyright (c) 2015 Gergely Szasz + + $Id$ + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License along + with this program; if not, write to the Free Software Foundation, Inc., + 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + + Author contact information: + + E-mail: sz...@hu... + +*/ + +#include <config.h> + +#include <stdio.h> +#include <string.h> +#include <stdlib.h> +#include <errno.h> +#include <unistd.h> + +#include <libspectrum.h> + +#include "fmfconv.h" + +extern int progressive; +extern int greyscale; +extern char *out_orig; +extern int avi_subtype; +#ifdef USE_LIBJPEG +extern int jpeg_header_ok; +#endif + +static char *frame_buffer = NULL; +static unsigned long int frame_size = 0; + +static libspectrum_byte buffer[64]; +static int idx; + +static char *idx_name = NULL; +static FILE *ifile = NULL; /* index file */ +static libspectrum_qword vid_frames_no = 0; +static libspectrum_qword snd_frames_no = 0; +static libspectrum_dword vid_stream_id; + +/*-------------AVI/RAW---------------------*/ +/* +Byte order: Little-endian + +*/ + +#define WORD( x ) buffer[idx++] = (x) & 0xff; \ + buffer[idx++] = ( (x) & 0xff00 ) >> 8 + +#define DWORD( x ) buffer[idx++] = (x) & 0xff; \ + buffer[idx++] = ( (x) & 0xff00 ) >> 8; \ + buffer[idx++] = ( (x) & 0xff0000 ) >> 16; \ + buffer[idx++] = ( (x) & 0xff000000U ) >> 24 + +#define WSTRING( str ) fwrite( str, strlen( str ), 1, out ) + +#define WORD2( w1, w2 ) WORD( w1 ); DWORD( w2 ) +#define WORD4( w1, w2, w3, w4 ) WORD2( w1, w2 ); DWORD2( w3, w4 ) + +#define WWORD( w ) idx = 0; WORD( w ); fwrite( buffer, 2, 1, out ) +#define W2WORD( w1, w2 ) idx = 0; WORD2( w1, w2 ); fwrite( buffer, 4, 1, out ) +#define W4WORD( w1, w2, w3, w4 ) \ + idx = 0; WORD4( w1, w2, w3, w4 ); fwrite( buffer, 8, 1, out ) + +#define DWORD2( dw1, dw2 ) DWORD( dw1 ); DWORD( dw2 ) +#define DWORD4( dw1, dw2, dw3, dw4 ) DWORD2( dw1, dw2 ); DWORD2( dw3, dw4 ) + +#define WDWORD( dw ) idx = 0; DWORD( dw ); fwrite( buffer, 4, 1, out ) +#define W2DWORD( dw1, dw2 ) \ + idx = 0; DWORD2( dw1, dw2 ); fwrite( buffer, 8, 1, out ) +#define W4DWORD( dw1, dw2, dw3, dw4 ) \ + idx = 0; DWORD4( dw1, dw2, dw3, dw4 ); fwrite( buffer, 16, 1, out ) + +int +out_write_aviheader( void ) +{ + int diBitCount; + +#ifdef USE_LIBJPEG + if( avi_subtype != TYPE_AVI_DIB ) + diBitCount = 16, vid_stream_id = 0x63643030; + else +#endif + diBitCount = 8 * ( greyscale ? 1 : 3 ), vid_stream_id = 0x62643030; + + if( !out_to_stdout ) { + if( !( idx_name = malloc( strlen( out_name ) + 5 ) ) ) { + printe( "out_write_aviheader(): out of memory error.\n" ); + return ERR_WRITE_OUT; + } + sprintf( idx_name, "%s.idx", out_name ); + if( !( ifile = fopen_overwr( idx_name, "w+b", 1 ) ) ) { + printe( "out_write_aviheader(): cannot create temporary idx file: %s.\n", + strerror( errno ) ); + return ERR_WRITE_OUT; + } + unlink( idx_name ); + free( idx_name ); + } + +#define AVI_POS_FILELEN 0x04L +#define AVI_POS_HDRLEN 0x10L + WSTRING( "RIFF\177\377\377\377AVI LIST"); WDWORD( 0x170 ); WSTRING("hdrlavih" ); + +/* Length of the avih, dwMicroSecPerFrame, dwMaxBytesPerSec, dwPaddingGranularity */ + W4DWORD( 0x38, ( 1000000000L / out_fps ), + ( frm_w * frm_h * 3 * out_fps / 1000 + out_rte * snd_fsz ), 0 ); +#define AVI_POS_TOTALFRAMES 0x30L +/* dwFlags, ++dwTotalFrames++, dwInitialFrames, dwStreams */ + W4DWORD( 0x910, 0x8fffffffU, 0, 2 ); + +/* dwSuggestedBufferSize, dwWidth, dwHeight, dwReserved */ + WDWORD( 1000000 ); W2DWORD( frm_w, frm_h ); W4DWORD( 0, 0, 0, 0 ); + + WSTRING( "LIST" ); WDWORD( 0x0c0 ); WSTRING( "strl" ); + WSTRING( "strh" ); WDWORD( 0x038 ); +#ifdef USE_LIBJPEG + if( avi_subtype != TYPE_AVI_DIB ) + WSTRING( "vidsMJPG" ); + else +#endif + if( greyscale ) + WSTRING( "vidsYUV " ); + else + WSTRING( "vidsRGB " ); + +/* dwFlags, wPriority, wLanguage, dwInitialFrames */ + WDWORD( 0 ); W2WORD( 0, 0 ); WDWORD( 0 ); + +#define AVI_POS_VIDEOFRAMES 0x8cL +/* dwScale, dwRate, dwStart, ++dwLength++ */ + W4DWORD( 1000, out_fps, 0, 0x8fffffffU ); + +/* dwSuggestedBufferSize, dwQuality, dwSampleSize, rcFrame */ + W2DWORD( frm_w * frm_h * 3, -1 ); WDWORD( 0 ); W4WORD( 0, 0, frm_w, frm_h ); + +/* stream format (dw)biSize */ + WSTRING( "strf" ); WDWORD( 0x28 ); WDWORD( 0x028 ); + + /* (dw)biWidth, (dw)biHeight, (w)biPlanes, (w)biBitCount */ + W2DWORD( frm_w, frm_h * ( avi_subtype == TYPE_AVI_DIB ? -1 : 1 ) ); + W2WORD( 1, diBitCount ); + +/* (dw)biCompression, (dw)biSizeImage (dw)biXPelsPerMeter, (dw)biYPelsPerMeter */ +#ifdef USE_LIBJPEG + if( avi_subtype != TYPE_AVI_DIB ) + WSTRING( "MJPG" ); + else +#endif + if( greyscale ) { + WSTRING( "Y8 " ); + } else { + WDWORD( 0x0 ); /* BI_RGB */ + } + + WDWORD( frm_w * frm_h * ( greyscale ? 1 : 3 ) ); W2DWORD( 0, 0 ); + +/* (dw)biClrUsed, (dw)biClrImportant, (dw)biExtDataOffset???? */ + W2DWORD( 0, 0 ); + +/* video prop, (dw)biSize, (dw)VideoFormatToken, (dw)VideoStandard, dwVerticalRefreshRate */ + WSTRING( "JUNK" ); WDWORD( 0x44 ); W4DWORD( 0, 0, 50, frm_w ); +/* dwVerticalRefreshRate, dwHTotalInT, dwVTotalInLines, dwFrameAspectRatio */ + WDWORD( 15 ); /*WDWORD( frm_h );*/ W2WORD( 0x03, 0x04 ); W2DWORD( frm_w, 15 ); +/* dwFrameWidthInPixels, dwFrameHeightInLines, nbFieldPerFrame */ + W4DWORD( 1, 15, frm_w, 15 ); +/* (dw)CompressedBMHeight, (dw)CompressedBMWidth, (dw)ValidBMHeight, (dw)ValidBMWidth */ + W4DWORD( frm_w, 0, 0, 0 ); + WDWORD( 15 ); + + WSTRING( "LIST" ); WDWORD( 0x05c ); WSTRING( "strl" ); + WSTRING( "strh" ); WDWORD( 0x038 ); WSTRING( "auds" ); + +/* (dw)fccHandler */ + WDWORD( snd_enc == TYPE_PCM ? 1 : ( snd_enc == TYPE_ALW ? 0x06 : 0x07 ) ); +/* dwFlags, wPriority, wLanguage, dwInitialFrames */ + WDWORD( 0 ); W2WORD( 0, 0 ); WDWORD( 0 ); + +#define AVI_POS_AUDIOFRAMES 0x154L +/* dwScale, dwRate, dwStart, ++dwLength++ */ + W4DWORD( 1, out_rte, 0, 0 ); + +/* dwSuggestedBufferSize, dwQuality, dwSampleSize, rcFrame */ + W2DWORD( 1000, 0 ); WDWORD( snd_fsz ); + W4WORD( 0, 0, 0, 0 ); + +/* stream format (dw)biSize */ + WSTRING( "strf" ); WDWORD( 0x010 ); +/* wFormatTag, (w)nChannels, (dw)nSamplesPerSec, (dw)nAvgBytesPerSec */ + W2WORD( snd_enc == TYPE_PCM ? 1 : ( snd_enc == TYPE_ALW ? 0x06 : 0x07 ), out_chn ); + W2DWORD( out_rte, out_rte * snd_fsz / snd_chn ); + +/* (w)nBlockAlign, wBitsPerSample */ + W2WORD( snd_fsz, 8 * snd_fsz / snd_chn ); + + WSTRING( "LIST" ); WDWORD( 0x08c ); WSTRING( "INFOISFT" ); WDWORD( 0x02e ); + WSTRING( "fmfconv -- Fuse Movie File converting utility\n" ); + WSTRING( "ICMT" ); WDWORD( 0x04a ); + WSTRING( "ZX Spectrum movie created by fmfconv\n" ); + WSTRING( "http://fuse-emulator.sourceforge.net\n" ); +#define AVI_POS_MOVILEN 0x21cL +#define AVI_POS_MOVISTART ( AVI_POS_MOVILEN + 4L ) + WSTRING( "LIST" ); WDWORD( 0 ); WSTRING( "movi" ); /* 00dc .... ; 01wb .... */ + + if( avi_subtype == TYPE_AVI_DIB ) { + frame_buffer = (void *)pix_rgb; + frame_size = frm_w * frm_h * ( greyscale ? 1 : 3 ); + } + + out_header_ok = 1; + printi( 1, "out_write_aviheader(): W=%d H=%d\n", frm_w, frm_h ); + + return 0; +} + +int +out_write_avi( void ) +{ + int err; + FILE *tmp; + long pos1, pos2; + static int avi_seq_no = 1; + + if( !out_header_ok && ( err = out_write_aviheader() ) ) + return err; + + if( !out_to_stdout ) + pos1 = ftell( out ); + else + pos1 = 0; +#ifdef USE_LIBJPEG + if( avi_subtype != TYPE_AVI_DIB ) + err = out_build_avi_mjpeg_frame( &frame_buffer, &frame_size ); +#endif + + if( err ) return err; + W2DWORD( vid_stream_id, frame_size ); + if( fwrite( frame_buffer, frame_size, 1, out ) != 1 ) return ERR_WRITE_OUT; + + if( frame_size & 0x01 ) WSTRING( "P" ); /* pad to even byte boundary */ + + printi( 4, "out_write_avi(): %ld byte image\n", frame_size ); + + vid_frames_no++; + + if( !out_to_stdout ) { + tmp = out; + out = ifile; + + W4DWORD( vid_stream_id, 0x00010, pos1 - AVI_POS_MOVISTART, frame_size ); + pos2 = ftell( out ); + out = tmp; + } + + /* rename old file with serial and open a new */ + if( !out_to_stdout && pos1 + pos2 + frame_size >= 1024 * 1024 * 1024 ) { + + if( out_orig == NULL ) { + char *old_name; + old_name = strdup( out_name ); + next_outname( 0 ); + if( ( err = rename( old_name, out_name ) ) ) { + free( old_name ); + printe( "out_write_avi(): cannot rename avi file: `%s`\n", + strerror( errno ) ); + return ERR_WRITE_OUT; + } + printi( 0, "out_write_avi(): AVI file size limit reached, old file renamed to: %s.\n", + out_name ); + free( old_name ); + } + close_out(); + next_outname( avi_seq_no ); + avi_seq_no++; + printi( 0, "out_write_avi(): AVI file size limit reached, new file opened: %s.\n", + out_name ); + if( ( err = open_out() ) ) { + printe( "out_write_avi(): cannot open new file: `%s`\n", + strerror( errno ) ); + return err; + } +#ifdef USE_LIBJPEG + jpeg_header_ok = 0; +#endif + out_header_ok = 0; + } + printi( 2, "out_write_avi() frame no.: %"PRIu64"\n", vid_frames_no ); + return 0; +} + +int +snd_write_avi( void ) +{ + int err; + FILE *tmp; + long pos1; + + if( !out_header_ok && ( err = out_write_aviheader() ) ) + return err; + + /* we have to swap all samples */ + if( snd_enc == TYPE_PCM && !snd_little_endian ) { + pcm_swap_endian(); + } + + if( !out_to_stdout ) + pos1 = ftell( out ); + else + pos1 = 0; + W2DWORD( 0x62773130, snd_len ); + if( fwrite( sound8, snd_len, 1, out ) != 1 ) return ERR_WRITE_SND; + + if( snd_len & 0x01 ) WSTRING( "P" ); + printi( 2, "snd_write_avi(): %d samples sound\n", snd_len / snd_fsz ); + snd_frames_no++; + + if( !out_to_stdout ) { + tmp = out; + out = ifile; + + W4DWORD( 0x62773130, 0x00010, pos1 - AVI_POS_MOVISTART, snd_len ); + out = tmp; + } + printi( 2, "snd_write_avi() frame no.: %"PRIu64"\n", snd_frames_no ); + return 0; +} + +void +out_finalize_avi( void ) +{ + char buff[4096]; + long pos1, pos2; + + if( out_to_stdout ) { + printi( 1, "out_finalize_avi(): cannot finalize output on stdout.\n" ); + return; + } + fflush( ifile ); + pos1 = ftell( out ); + pos2 = ftell( ifile ); + WSTRING( "idx1" ); WDWORD( pos2 ); + + rewind( ifile ); + while( !feof( ifile ) ) { + size_t len; + len = fread( buff, 1, 4096, ifile ); + if( len > 0 ) { + if( len != fwrite( buff, 1, len, out ) ) { + return; + } + } + } + printi( 2, "out_finalize_avi(): Write idx1: %libyte\n", pos2 ); + fclose( ifile ); + fflush( out ); + + pos2 = ftell( out ); + if( fseek( out, AVI_POS_TOTALFRAMES, SEEK_SET ) == -1 ) { + printw( "out_finalize_avi(): cannot finalize output file (not seekable).\n" ); + return; + } + WDWORD( output_no ); + fseek( out, AVI_POS_VIDEOFRAMES, SEEK_SET ); + WDWORD( output_no ); + fseek( out, AVI_POS_AUDIOFRAMES, SEEK_SET ); + WDWORD( output_no ); + fseek( out, AVI_POS_MOVILEN, SEEK_SET ); + WDWORD( pos1 - AVI_POS_MOVISTART ); + + fseek( out, AVI_POS_FILELEN, SEEK_SET ); + WDWORD( pos2 - 8 ); + + printi( 2, "out_finalize_avi(): image chunks: %"PRIu64", sound chunks: %"PRIu64"\n", + vid_frames_no, snd_frames_no ); + printi( 1, "out_finalize_avi(): TotalFrames: %"PRIu64"\n", output_no ); +} Property changes on: trunk/fuse-utils/fmfconv_avi... [truncated message content] |
From: <sba...@us...> - 2015-04-19 21:30:16
|
Revision: 5201 http://sourceforge.net/p/fuse-emulator/code/5201 Author: sbaldovi Date: 2015-04-19 21:30:14 +0000 (Sun, 19 Apr 2015) Log Message: ----------- Add missing options and arrange options in categories. Modified Paths: -------------- trunk/fuse-utils/hacking/ChangeLog trunk/fuse-utils/man/fmfconv.1 Modified: trunk/fuse-utils/hacking/ChangeLog =================================================================== --- trunk/fuse-utils/hacking/ChangeLog 2015-04-18 12:23:47 UTC (rev 5200) +++ trunk/fuse-utils/hacking/ChangeLog 2015-04-19 21:30:14 UTC (rev 5201) @@ -457,3 +457,5 @@ fmfconv_[aiff|au|avi|ff|jpg|png|ppm|wav|yuv].c: support JPEG, PNG and AVI output formats. New internal sound resampling. Allow greyscale output (patch #329) (Gergely Szasz). +20150419 man/fmfconv.1: add missing options and arrange options in categories + (Sergio). Modified: trunk/fuse-utils/man/fmfconv.1 =================================================================== --- trunk/fuse-utils/man/fmfconv.1 2015-04-18 12:23:47 UTC (rev 5200) +++ trunk/fuse-utils/man/fmfconv.1 2015-04-19 21:30:14 UTC (rev 5201) @@ -47,39 +47,78 @@ .\"------------------------------------------------------------------ .\" .SH OPTIONS +.SS +General options: .PP -.RI "\-a "codec +.RI \-h .br -.RI "\-\-acodec "codec +.RI \-\-help .RS -Select audio codec for FFMPEG output (by default file format determine). +Give brief usage help, listing available options. .RE .PP -.RI \-\-acodecs +.RI \-\-info .RS -List available FFMPEG audio codecs (see \-a/\-\-acodec). +Scan input file(s) and print information. .RE .PP -.RI \-\-aifc +.RI "\-i "filename +.br +.RI "\-\-input "filename .RS -Force AIFF-C output if sound format is AIFF. +Input file. .RE .PP -.RI "\-A "rate +.RI "\-o "filename .br -.RI "\-\-arate "rate +.RI "\-\-output "filename .RS -Select audio bitrate for FFMPEG output (by default audio codec determine) -where `rate' is `default' or a number. +Output file. .RE .PP -.RI \-u +.RI \-y .br -.RI \-\-au +.RI \-\-overwrite .RS -Save sound to Sun Audio (au) file. +Force overwrite of existing output file(s). .RE .PP +.RI "\-g "form +.br +.RI "\-\-progress "form +.RS +Show progress, where `form' is one of `%', `bar', `frame' or `time'. frame +and time are similar to bar and show movie seconds or frame number as well. +.RE +.PP +.RI \-q +.br +.RI \-\-quiet +.RS +Decrease the verbosity level by one. +.RE +.PP +.RI \-v +.br +.RI \-\-verbose +.RS +Increase the verbosity level by one. +.RE +.PP +.RI \-V +.br +.RI \-\-version +.RS +Print the version number and exit. +.RE +.SS +Audio options: +.PP +.RI \-\-aifc +.RS +Force AIFF-C output if sound format is AIFF. +.RE +.PP .RI \-m .br .RI \-\-aiff @@ -87,66 +126,74 @@ Save sound to Apple Computer audio (aiff/aiff-c) file. .RE .PP -.RI "\-F "format +.RI \-u .br -.RI "\-\-format "format +.RI \-\-au .RS -Select file format for FFMPEG output (by default the filename extension -determines the format). +Save sound to Sun Audio (au) file. .RE .PP -.RI \-\-formats +.RI \-\-mono .RS -List available FFMPEG formats (see \-F/\-\-format). +Convert sound to mono (by default sound is converted to stereo). .RE .PP -.RI "\-f "timing -.br -.RI "\-\-frate "timing +.RI \-\-raw\-sound .RS -Set output frame rate. `timing' is `pal', `ntsc', `movie' or a -number with maximum 3 digit after decimal point, or a #/# (e.g.: -\-f 29.97 or \-f 30000/1001). +Do not convert sound to 16-bit signed PCM and STEREO or MONO. This is an +advanced option. If stereo/mono or audio encoding change through `fmf' file, +your sound will be crappy. .RE .PP -.RI \-h +.RI "\-s "filename .br -.RI \-\-help +.RI "\-\-sound "filename .RS -Give brief usage help, listing available options. +Output sound file. .RE .PP -.RI \-\-info +.RI \-\-sound\-only .RS -Scan input file(s) and print information. +Process only the sound from an `fmf' file. .RE .PP -.RI "\-i "filename +.RI \-w .br -.RI "\-\-input "filename +.RI \-\-wav .RS -Input file. +Save sound to Waveform Audio (wav) file. .RE +.SS +Video/image options: .PP -.RI \-\-mono +.RI \-\-avi .RS -Convert sound to mono (by default sound is converted to stereo). +Save video as AVI format with built-in AVI encoder. If fmfconv supports +jpeg files, encode video as M-JPEG and audio as S16_LE PCM. If output is +not a file (stdout or redirected) then fmfconv encode video as uncompressed +BGR24 DIB frames (see \-\-avi\-mjpeg and \-\-avi\-uncompr). .RE .PP -.RI "\-C "cut +.RI "\-f "timing .br -.RI "\-\-out\-cut "cut +.RI "\-\-frate "timing .RS -Leave out the comma delimited `cut' ranges e.g.: 100\-200,300,500,1:11\-2:22 -cut the frames 100\(en200, 300, 500 and frames from 1 min 11 sec to 2 min 22 sec -(in the given timing see: \-f/\-\-frate). +Set output frame rate. `timing' is `pal', `ntsc', `movie' or a +number with maximum 3 digit after decimal point, or a #/# (e.g.: +\-f 29.97 or \-f 30000/1001). +.br +For video output formats (AVI/MJPEG/YUV4MPEG2) fmfconv set frame rate +to 25 fps (PAL timing). If you want to keep the original frame rate +use `raw' timing. .RE .PP -.RI "\-o "filename +.RI "\-C "cut .br -.RI "\-\-output "filename +.RI "\-\-out\-cut "cut .RS -Output file. +Leave out the comma delimited `cut' ranges e.g.: 100\-200,300,500,1:11\-2:22 +cut the frames 100\(en200, 300, 500 and frames from 1 min 11 sec to +2 min 22 sec (in the given timing see: \-f/\-\-frate). .RE .PP .RI \-P @@ -156,79 +203,99 @@ Save video as PPM screenshots. .RE .PP -.RI "\-p "profile +.RI \-S .br -.RI "\-\-profile "profile +.RI \-\-scr .RS -Select the profile for FFMPEG output where <profile> is `youtube', `dvd', `svcd' -or `ipod'. +Save video as SCR screenshots. .RE .PP -.RI "\-g "form +.RI \-Y .br -.RI "\-\-progress "form +.RI \-\-yuv .RS -Show progress, where <form> is one of `%', `bar', `frame' or `time'. frame and -time are similar to bar and show movie seconds or frame number as well. +Save video as yuv4mpeg2. .RE .PP -.RI \-q +.RI "\-\-yuv\-format "frm +.RS +Set yuv4mpeg2 file frame format to `frm', where `frm' is one of `444', +`422', `420j', `420m', `420' or `410'. +.RE +.SS +The following options are available when ffmpeg codecs are supported: +.PP +.RI "\-a "codec .br -.RI \-\-quiet +.RI "\-\-acodec "codec .RS -Decrease the verbosity level by one. +Select audio codec for FFMPEG output (by default file format determine). .RE .PP -.RI \-\-raw\-sound +.RI \-\-acodecs .RS -Do not convert sound to 16-bit signed PCM and STEREO or MONO. This is an -advanced option. If stereo/mono or audio encoding change through `fmf' file, -your sound will be crappy. +List available FFMPEG audio codecs (see \-a/\-\-acodec). .RE .PP -.RI "\-R "res +.RI "\-A "rate .br -.RI "\-\-resize "res +.RI "\-\-arate "rate .RS -Resize video frame where `res' is `vga' for 640x480, `hvga' for 480x360, `qvga' -for 320x240, `pal' for 768x576 (this set frame rate to 25 also) or WxH, Sx, -N/Mx or W. +Select audio bitrate for FFMPEG output (by default audio codec determine) +where `rate' is `default' or a number. .RE .PP -.RI \-S +.RI \-X .br -.RI \-\-scr +.RI \-\-ffmpeg .RS -Save video as SCR screenshots. +Save video and audio as FFMPEG file (default if FFMPEG is available). .RE .PP -.RI "\-s "filename +.RI "\-\-force\-resample +.RS +FFMPEG output (see -X) disable the built-in sound resampling. You can +force the built-in resampling of sound with this option. +.RE +.PP +.RI "\-F "format .br -.RI "\-\-sound "filename +.RI "\-\-format "format .RS -Output sound file. +Select file format for FFMPEG output (by default the filename extension +determines the format). .RE .PP -.RI \-\-sound\-only +.RI \-\-formats .RS -Process only the sound from an `fmf' file. +List available FFMPEG formats (see \-F/\-\-format). .RE .PP -.RI "\-E "rate +.RI "\-p "profile .br -.RI "\-\-srate "rate +.RI "\-\-profile "profile .RS -Resample audio to `rate' sampling rate where `rate' is `cd' for 44100 or `dat' -for 48000 or a number (`cd' and `dat' set `stereo' as well). +Select the profile for FFMPEG output where `profile' is `youtube', `dvd', +`svcd' or `ipod'. .RE .PP -.RI \-v +.RI "\-R "res .br -.RI \-\-verbose +.RI "\-\-resize "res .RS -Increase the verbosity level by one. +Resize video frame where `res' is `vga' for 640x480, `hvga' for 480x360, +`qvga' for 320x240, `pal' for 768x576 (this set frame rate to 25 also) +or WxH, Sx, N/Mx or W. .RE .PP +.RI "\-E "rate +.br +.RI "\-\-srate "rate +.RS +Resample audio to `rate' sampling rate where `rate' is `cd' for 44100 Hz +or `dat' for 48000 Hz or a number (`cd' and `dat' set `stereo' as well). +.RE +.PP .RI "\-c "codec .br .RI "\-\-vcodec "codec @@ -236,53 +303,107 @@ Select video codec for FFMPEG output (by default file format determine). .RE .PP -.RI \-V -.br -.RI \-\-version +.RI \-\-vcodecs .RS -Print the version number and exit. +List available FFMPEG video codecs (see \-c/\-\-vcodec). .RE .PP .RI "\-r "rate .br .RI "\-\-vrate "rate .RS -Select video bitrate for FFMPEG output (by default audio codec determine) +Select video bitrate for FFMPEG output (by default audio codec determine) where `rate' is `default', `ffdefault' or a number. .RE +.SS +The following options are available when PNG files are supported: .PP -.RI \-\-vcodecs +.RI \-\-greyscale .RS -List available FFMPEG video codecs (see \-c/\-\-vcodec). +Save greyscale images. .RE .PP -.RI \-w +.RI \-G .br -.RI \-\-wav +.RI \-\-png .RS -Save sound to Microsoft audio (wav) file. +Save video frames as PNG screenshots. .RE .PP -.RI \-X +.RI "\-\-png\-compress "level +.RS +Set compression level from a range 0\(en9, or `none', `fast', `best'. +.RE +.PP +.RI \-\-progressive +.RS +Save progressive (interlaced) PNG files. +.RE +.SS +The following options are available when JPEG files are supported: +.PP +.RI \-\-avi\-mjpeg +.RS +Force the use of M-JPEG AVI frames (lossy). +.RE +.PP +.RI \-\-avi\-uncompr +.RS +Force the use of uncompressed BGR24 AVI frames. This format does not +produce compression artifacts but the file size is bigger. It is a good +choice if you want to process the video with an external tool. +.RE +.PP +.RI \-\-greyscale +.RS +Save greyscale images or convert video frames. +.RE +.PP +.RI \-J .br -.RI \-\-ffmpeg +.RI "\-\-jpeg .RS -Save video and audio as FFMPEG file (default if FFMPEG is available). +Save video frames as JPEG screenshots. .RE .PP -.RI \-Y +.RI \-\-jpeg\-fast +.RS +Use faster, less accurate integer method for DCT compression. +.RE +.PP +.RI \-\-jpeg\-float +.RS +Use floating-point method for DCT compression. +.RE +.PP +.RI \-\-jpeg\-optimize +.RS +Compute optimal Huffman coding tables for the image. +.RE +.PP +.RI \-Q .br -.RI \-\-yuv +.RI "\-\-jpeg\-quality "q .RS -Save video as yuv4mpeg2. +Set jpeg quality from a range 0\(en100. .RE .PP -.RI "\-\-yuv\-format "frm +.RI "\-\-jpeg\-smooth "factor .RS -Set yuv4mpeg2 file frame format to `frm', where `frm' is one of `444', -`422', `420j', `420m', `420' or `410'. +Set jpeg smoothing factor from a range 0\(en100. .RE .PP +.RI \-M +.br +.RI \-\-mjpeg +.RS +Save video as raw M-JPEG file (abbreviated JPEG stream). +.RE +.PP +.RI \-\-progressive +.RS +Save progressive (interlaced) JPEG files. +.RE .\" .\"------------------------------------------------------------------ .\" This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <sba...@us...> - 2015-04-19 21:57:30
|
Revision: 5202 http://sourceforge.net/p/fuse-emulator/code/5202 Author: sbaldovi Date: 2015-04-19 21:57:22 +0000 (Sun, 19 Apr 2015) Log Message: ----------- Abort program when passed unknown options (fixes bug #318) (thanks, Stuart). Modified Paths: -------------- trunk/fuse-utils/audio2tape.cc trunk/fuse-utils/createhdf.c trunk/fuse-utils/fmfconv.c trunk/fuse-utils/hacking/ChangeLog trunk/fuse-utils/listbasic.c trunk/fuse-utils/raw2hdf.c trunk/fuse-utils/rzxtool.c trunk/fuse-utils/snap2tzx.c trunk/fuse-utils/snapconv.c trunk/fuse-utils/tape2wav.c trunk/fuse-utils/tapeconv.c Modified: trunk/fuse-utils/audio2tape.cc =================================================================== --- trunk/fuse-utils/audio2tape.cc 2015-04-19 21:30:14 UTC (rev 5201) +++ trunk/fuse-utils/audio2tape.cc 2015-04-19 21:57:22 UTC (rev 5202) @@ -131,8 +131,14 @@ schmitt_noise_threshold = atol( optarg ); break; + case '?': + /* getopt prints an error message to stderr */ + error = 1; + break; + default: - exit(1); + std::cerr << progname << ": unknown option `" << (char) c << "'\n"; + error = 1; break; } @@ -141,7 +147,7 @@ argc -= optind; argv += optind; - if( argc < 2 ) { + if( error || argc < 2 ) { std::cerr << progname << ": usage: " << progname << " [-r] [-k] [-s] [-t <trigger type>] [-z <zero level>] " "[-c <schmitt noise threshold>] <infile> <outfile>\n"; Modified: trunk/fuse-utils/createhdf.c =================================================================== --- trunk/fuse-utils/createhdf.c 2015-04-19 21:30:14 UTC (rev 5201) +++ trunk/fuse-utils/createhdf.c 2015-04-19 21:57:22 UTC (rev 5202) @@ -46,6 +46,7 @@ const char **filename, enum hdf_version_t *version ) { int c; + int error = 0; while( ( c = getopt( argc, argv, "csv:" ) ) != -1 ) { @@ -58,13 +59,26 @@ *version = HDF_VERSION_10; } else if( strcasecmp( optarg, "1.1" ) == 0 ) { *version = HDF_VERSION_11; + } else { + error = 1; + fprintf( stderr, "%s: version not supported\n", progname ); } break; + case '?': + /* getopt prints an error message to stderr */ + error = 1; + break; + + default: + error = 1; + fprintf( stderr, "%s: unknown option `%c'\n", progname, (char) c ); + break; + } } - if( argc - optind < 4 ) { + if( error || argc - optind < 4 ) { fprintf( stderr, "%s: usage: %s [-c] [-s] [-v<version>] <cylinders> <heads> <sectors> <hdf>\n", progname, progname ); Modified: trunk/fuse-utils/fmfconv.c =================================================================== --- trunk/fuse-utils/fmfconv.c 2015-04-19 21:30:14 UTC (rev 5201) +++ trunk/fuse-utils/fmfconv.c 2015-04-19 21:57:22 UTC (rev 5202) @@ -2279,14 +2279,14 @@ else if( !strcmp( optarg, "time" ) ) prg_t = TYPE_TIME; break; - case ':': + case '?': - break; + /* getopt prints an error message to stderr */ + return ERR_BAD_PARAM; default: - printe ("%s: getopt_long returned `%c'\n", - "fmfconv", (char) c); - break; + printe ("%s: getopt_long returned `%c'\n", "fmfconv", (char) c); + return ERR_BAD_PARAM; } } @@ -2310,8 +2310,7 @@ int fd = fileno( stdin ); if( isatty( fd ) ) { printe( "%s: no input file specified\n", "fmfconv" ); - fprintf( stderr, "Try `fmfconv --help' for more information.\n" ); - help_exit = 1; + return ERR_BAD_PARAM; } #ifdef WIN32 else { @@ -2334,7 +2333,11 @@ { int err, eop = 0; - if( ( err = parse_args( argc, argv ) ) ) return err; + if( ( err = parse_args( argc, argv ) ) ) { + fprintf( stderr, "Try `fmfconv --help' for more information.\n" ); + return err; + } + if( help_exit ) return 0; #ifdef USE_FFMPEG if( ffmpeg_list >= 0 ) { Modified: trunk/fuse-utils/hacking/ChangeLog =================================================================== --- trunk/fuse-utils/hacking/ChangeLog 2015-04-19 21:30:14 UTC (rev 5201) +++ trunk/fuse-utils/hacking/ChangeLog 2015-04-19 21:57:22 UTC (rev 5202) @@ -459,3 +459,6 @@ output (patch #329) (Gergely Szasz). 20150419 man/fmfconv.1: add missing options and arrange options in categories (Sergio). +20150419 audio2tape.cc,createhdf.c,fmfconv.c,listbasic.c,raw2hdf.c,rzxtool.c, + snap2tzx.c,snapconv.c,tape2wav.c,tapeconv.c: abort program when passed + unknown options (fixes bug #318) (thanks, Stuart) (Sergio). Modified: trunk/fuse-utils/listbasic.c =================================================================== --- trunk/fuse-utils/listbasic.c 2015-04-19 21:30:14 UTC (rev 5201) +++ trunk/fuse-utils/listbasic.c 2015-04-19 21:57:22 UTC (rev 5202) @@ -68,7 +68,7 @@ libspectrum_class_t class; int c; - int error; + int error = 0; progname = argv[0]; @@ -78,12 +78,22 @@ case 'b': betabasic = 1; break; + case '?': + /* getopt prints an error message to stderr */ + error = 1; + break; + + default: + error = 1; + fprintf( stderr, "%s: unknown option `%c'\n", progname, (char) c ); + break; + } } argc -= optind; argv += optind; - if( argc != 1 ) { + if( error || argc != 1 ) { fprintf( stderr, "%s: usage: %s [-b] <file>\n", progname, progname ); return 1; } Modified: trunk/fuse-utils/raw2hdf.c =================================================================== --- trunk/fuse-utils/raw2hdf.c 2015-04-19 21:30:14 UTC (rev 5201) +++ trunk/fuse-utils/raw2hdf.c 2015-04-19 21:57:22 UTC (rev 5202) @@ -42,6 +42,7 @@ const char **hdf_filename, enum hdf_version_t *version ) { int c; + int error = 0; while( ( c = getopt( argc, argv, "v:" ) ) != -1 ) { @@ -52,13 +53,26 @@ *version = HDF_VERSION_10; } else if( strcasecmp( optarg, "1.1" ) == 0 ) { *version = HDF_VERSION_11; + } else { + error = 1; + fprintf( stderr, "%s: version not supported\n", progname ); } break; + case '?': + /* getopt prints an error message to stderr */ + error = 1; + break; + + default: + error = 1; + fprintf( stderr, "%s: unknown option `%c'\n", progname, (char) c ); + break; + } } - if( argc - optind != 2 ) { + if( error || argc - optind != 2 ) { fprintf( stderr, "%s: usage: %s [-v<version>] <raw-filename> <hdf-filename>\n", progname, progname ); return 1; Modified: trunk/fuse-utils/rzxtool.c =================================================================== --- trunk/fuse-utils/rzxtool.c 2015-04-19 21:30:14 UTC (rev 5201) +++ trunk/fuse-utils/rzxtool.c 2015-04-19 21:57:22 UTC (rev 5202) @@ -351,7 +351,14 @@ options->uncompressed = 1; output_needed = 1; break; - case '?': error = 1; break; + case '?': + /* getopt prints an error message to stderr */ + error = 1; + break; + default: + error = 1; + fprintf( stderr, "%s: unknown option `%c'\n", progname, (char) c ); + break; } if( error ) break; Modified: trunk/fuse-utils/snap2tzx.c =================================================================== --- trunk/fuse-utils/snap2tzx.c 2015-04-19 21:30:14 UTC (rev 5201) +++ trunk/fuse-utils/snap2tzx.c 2015-04-19 21:57:22 UTC (rev 5202) @@ -428,10 +428,15 @@ case '$': settings->external_filename = optarg; break; case '?': - print_error( "unknown option" ); + /* getopt prints an error message to stderr */ print_usage( 0 ); return 1; + default: + print_error( "%s: unknown option `%c'\n", progname, (char) c ); + print_usage( 0 ); + return 1; + } } Modified: trunk/fuse-utils/snapconv.c =================================================================== --- trunk/fuse-utils/snapconv.c 2015-04-19 21:30:14 UTC (rev 5201) +++ trunk/fuse-utils/snapconv.c 2015-04-19 21:57:22 UTC (rev 5202) @@ -63,7 +63,7 @@ int fix = 0; FILE *f; - int error; + int error = 0; int c; progname = argv[0]; @@ -81,12 +81,22 @@ case 'f': fix = 1; break; + case '?': + /* getopt prints an error message to stderr */ + error = 1; + break; + + default: + error = 1; + fprintf( stderr, "%s: unknown option `%c'\n", progname, (char) c ); + break; + } } argc -= optind; argv += optind; - if( argc < 2 ) { + if( error || argc < 2 ) { fprintf( stderr, "%s: usage: %s [-c] [-n] [-f] <infile> <outfile>\n", progname, progname ); return 1; Modified: trunk/fuse-utils/tape2wav.c =================================================================== --- trunk/fuse-utils/tape2wav.c 2015-04-19 21:30:14 UTC (rev 5201) +++ trunk/fuse-utils/tape2wav.c 2015-04-19 21:57:22 UTC (rev 5202) @@ -46,7 +46,7 @@ int main( int argc, char **argv ) { - int c, error; + int c, error = 0; libspectrum_tape *tzx; progname = argv[0]; @@ -59,6 +59,16 @@ case 'r': sample_rate = abs( atol( optarg ) ); break; + case '?': + /* getopt prints an error message to stderr */ + error = 1; + break; + + default: + error = 1; + fprintf( stderr, "%s: unknown option `%c'\n", progname, (char) c ); + break; + } } @@ -66,7 +76,7 @@ argc -= optind; argv += optind; - if( argc < 2 ) { + if( error || argc < 2 ) { fprintf( stderr, "%s: usage: %s [-r rate] <infile> <outfile>\n", progname, Modified: trunk/fuse-utils/tapeconv.c =================================================================== --- trunk/fuse-utils/tapeconv.c 2015-04-19 21:30:14 UTC (rev 5201) +++ trunk/fuse-utils/tapeconv.c 2015-04-19 21:57:22 UTC (rev 5202) @@ -57,7 +57,7 @@ int main( int argc, char **argv ) { - int c, error; + int c, error = 0; libspectrum_tape *tzx; progname = argv[0]; @@ -73,6 +73,16 @@ case 's': scr_file = optarg ; break; case 'i': inlay_file = optarg ; break; + case '?': + /* getopt prints an error message to stderr */ + error = 1; + break; + + default: + error = 1; + fprintf( stderr, "%s: unknown option `%c'\n", progname, (char) c ); + break; + } } @@ -80,7 +90,7 @@ argc -= optind; argv += optind; - if( argc < 2 ) { + if( error || argc < 2 ) { fprintf( stderr, "%s: usage: %s [-s <scr file>] [-a <archive info tzx>] " "[-b] [-i <inlay image>] <infile> <outfile>\n", This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <sba...@us...> - 2015-04-22 21:35:04
|
Revision: 5203 http://sourceforge.net/p/fuse-emulator/code/5203 Author: sbaldovi Date: 2015-04-22 21:35:02 +0000 (Wed, 22 Apr 2015) Log Message: ----------- Set default output type to AVI instead of YUV4MPEG2 when using pipes. Move --force-resample and --srate options (more from patch #329) (Gergely Szasz). Modified Paths: -------------- trunk/fuse-utils/fmfconv.c trunk/fuse-utils/hacking/ChangeLog trunk/fuse-utils/man/fmfconv.1 Modified: trunk/fuse-utils/fmfconv.c =================================================================== --- trunk/fuse-utils/fmfconv.c 2015-04-19 21:57:22 UTC (rev 5202) +++ trunk/fuse-utils/fmfconv.c 2015-04-22 21:35:02 UTC (rev 5203) @@ -885,7 +885,7 @@ #ifdef USE_FFMPEG out_t = TYPE_FFMPEG; /* default to FFMPEG */ #else - out_t = TYPE_YUV; /* default to YUV */ + out_t = TYPE_AVI; /* default to AVI */ #endif ext = find_filename_ext( out_name ); for( i = 0; ext != NULL && out_ext_tab[i].extension != NULL; i++ ) { @@ -933,8 +933,8 @@ out = NULL; out_name = "(-=null=-)"; } else { - if( out_t != TYPE_AVI && out_t != TYPE_MJPEG ) { - out_t = TYPE_YUV; /* default to YUV */ + if( out_t != TYPE_YUV && out_t != TYPE_MJPEG ) { + out_t = TYPE_AVI; /* default to AVI */ } out = stdout; out_to_stdout = 1; @@ -1728,10 +1728,10 @@ #ifdef USE_FFMPEG " note: FFMPEG needs PCM audio without change\n" " the channel number too.\n" -#endif /* USE_FFMPEG */ " --force-resample FFMPEG output (see -X) disable the internal\n" " sound resampling. You can force the internal\n" " resampling of sound with this option.\n" +#endif /* USE_FFMPEG */ " -E --srate <rate> Resample audio to <rate> sampling rate where\n" " <rate> is `cd' for 44100 or `dat' for 48000 or\n" " a number (`cd' and `dat' set `stereo' as well)\n" @@ -1972,7 +1972,7 @@ char t; int i; - c = getopt_long (argc, argv, "i:o:s:f:g:C:wumSPYy" + c = getopt_long (argc, argv, "i:o:s:f:g:C:wumSPYyE:" #ifdef USE_LIBJPEG "JQ:M" #endif @@ -1980,7 +1980,7 @@ "G" #endif #ifdef USE_FFMPEG_VARS - "p:F:a:c:A:r:R:E:" + "p:F:a:c:A:r:R:" #endif #ifdef USE_FFMPEG "X" @@ -2021,6 +2021,19 @@ sound_only = 1; out_t = TYPE_NONE; break; + case 'E': + if( !strcmp( optarg, "cd" ) ) + out_rte = 44100, sound_stereo = 1; + else if( !strcmp( optarg, "dat" ) ) + out_rte = 48000, sound_stereo = 1; + else + out_rte = atoi( optarg ); + + if( out_rte < 1000 ) { + printe( "Wrong value for '-E/--srate' ...\n"); + return ERR_BAD_PARAM; + } + break; case 'S': /* SCR output */ out_t = TYPE_SCR; break; @@ -2241,19 +2254,6 @@ case ARG_FORCE_RESAMPLE: /* force internal resample */ no_sound_resample = 0; break; - case 'E': - if( !strcmp( optarg, "cd" ) ) - out_rte = 44100, sound_stereo = 1; - else if( !strcmp( optarg, "dat" ) ) - out_rte = 48000, sound_stereo = 1; - else - out_rte = atoi( optarg ); - - if( out_rte < 1000 ) { - printe( "Wrong value for '-E/--srate' ...\n"); - return ERR_BAD_PARAM; - } - break; #endif /* USE_FFMPEG_VARS */ case 'h': print_help(); Modified: trunk/fuse-utils/hacking/ChangeLog =================================================================== --- trunk/fuse-utils/hacking/ChangeLog 2015-04-19 21:57:22 UTC (rev 5202) +++ trunk/fuse-utils/hacking/ChangeLog 2015-04-22 21:35:02 UTC (rev 5203) @@ -462,3 +462,6 @@ 20150419 audio2tape.cc,createhdf.c,fmfconv.c,listbasic.c,raw2hdf.c,rzxtool.c, snap2tzx.c,snapconv.c,tape2wav.c,tapeconv.c: abort program when passed unknown options (fixes bug #318) (thanks, Stuart) (Sergio). +20150422 fmfconv.c,man/fmfconv.1: set default output type to AVI instead of + YUV4MPEG2 when using pipes. Move --force-resample and --srate options + (more from patch #329) (Gergely Szasz). Modified: trunk/fuse-utils/man/fmfconv.1 =================================================================== --- trunk/fuse-utils/man/fmfconv.1 2015-04-19 21:57:22 UTC (rev 5202) +++ trunk/fuse-utils/man/fmfconv.1 2015-04-22 21:35:02 UTC (rev 5203) @@ -157,6 +157,14 @@ Process only the sound from an `fmf' file. .RE .PP +.RI "\-E "rate +.br +.RI "\-\-srate "rate +.RS +Resample audio to `rate' sampling rate where `rate' is `cd' for 44100\ Hz +or `dat' for 48000\ Hz or a number (`cd' and `dat' set `stereo' as well). +.RE +.PP .RI \-w .br .RI \-\-wav @@ -288,14 +296,6 @@ or WxH, Sx, N/Mx or W. .RE .PP -.RI "\-E "rate -.br -.RI "\-\-srate "rate -.RS -Resample audio to `rate' sampling rate where `rate' is `cd' for 44100 Hz -or `dat' for 48000 Hz or a number (`cd' and `dat' set `stereo' as well). -.RE -.PP .RI "\-c "codec .br .RI "\-\-vcodec "codec This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <sba...@us...> - 2015-04-23 22:07:54
|
Revision: 5204 http://sourceforge.net/p/fuse-emulator/code/5204 Author: sbaldovi Date: 2015-04-23 22:07:52 +0000 (Thu, 23 Apr 2015) Log Message: ----------- Add more details on DESCRIPTION, EXAMPLES and SEE ALSO (thanks, Gergely Szasz). Modified Paths: -------------- trunk/fuse-utils/hacking/ChangeLog trunk/fuse-utils/man/fmfconv.1 Modified: trunk/fuse-utils/hacking/ChangeLog =================================================================== --- trunk/fuse-utils/hacking/ChangeLog 2015-04-22 21:35:02 UTC (rev 5203) +++ trunk/fuse-utils/hacking/ChangeLog 2015-04-23 22:07:52 UTC (rev 5204) @@ -465,3 +465,5 @@ 20150422 fmfconv.c,man/fmfconv.1: set default output type to AVI instead of YUV4MPEG2 when using pipes. Move --force-resample and --srate options (more from patch #329) (Gergely Szasz). +20150423 man/fmfconv.1: add more details on DESCRIPTION, EXAMPLES and SEE ALSO + (thanks, Gergely Szasz) (Sergio). Modified: trunk/fuse-utils/man/fmfconv.1 =================================================================== --- trunk/fuse-utils/man/fmfconv.1 2015-04-22 21:35:02 UTC (rev 5203) +++ trunk/fuse-utils/man/fmfconv.1 2015-04-23 22:07:52 UTC (rev 5204) @@ -27,7 +27,7 @@ .\"------------------------------------------------------------------ .\" .SH NAME -fmfconv \(em Fuse movie file converter +fmfconv \(em Fuse Movie File converter .\" .\"------------------------------------------------------------------ .\" @@ -41,8 +41,16 @@ .\"------------------------------------------------------------------ .\" .SH DESCRIPTION -fmfconv is a Fuse movie file converter. It can convert .fmf files to -any video file format known by FFMPEG. +fmfconv is a Fuse Movie File converter. It can read .fmf files produced by +Fuse ZX Spectrum emulator and write audio files, video files or sequences of +images in a variety of popular formats. It can also stream data to external +tools through a pipe, so you can get virtually any possible format (see +EXAMPLES). +.PP +fmfconv has built-in support for AIFF, AU and WAV sound formats, PPM and +SCR image formats, AVI and YUV4MPEG2 video formats. Supports PNG and +JPEG/MJPEG formats internally if libpng and libjpeg are available respectively. +Also supports any format known by FFmpeg or Libav if they are available. .\" .\"------------------------------------------------------------------ .\" @@ -408,27 +416,99 @@ .\"------------------------------------------------------------------ .\" .SH EXAMPLES -Convert a Fuse movie file to a mpeg video with quality equivalent to YouTube +Some of the following examples use +.IR ffmpeg (1) +as an external tool for doing the final conversion. In some distributions +.IR avconv (1) +is available, which accepts the same parameters. .PP +Convert FMF to AVI: +.PP .RS -.B fmfconv -\-p youtube input.fmf output.mov +.EX +fmfconv input.fmf output.avi +.EE .RE .PP -Convert a Fuse movie file to a DVD video format +Convert FMF to a mpeg video with quality equivalent to YouTube: .PP .RS -.B fmfconv -\-p dvd input.fmf output.vob +.EX +fmfconv \-p youtube input.fmf output.mov +.EE +.PP +or +.PP +.EX +fmfconv input.fmf | ffmpeg \-i \- \-vf scale=480:360 \-r 25 + \-codec:v h264 \-codec:a aac \-f mov \-b:a 128000 + \-b:v 600000 \-pix_fmt yuv420p \-strict \-2 output.mov +.EE .RE .PP -Extract audio (mono) from a recording +Convert FMF to a DVD video format: .PP .RS -.B fmfconv -\-\-sound-only \-\-mono input.fmf output.wav +.EX +fmfconv \-p dvd input.fmf output.vob +.EE +.PP +or +.PP +.EX +fmfconv input.fmf | ffmpeg \-i \- \-aspect 4:3 \-target pal\-dvd + output.vob +.EE .RE .PP +Convert FMF to SVCD video format: +.PP +.RS +.EX +fmfconv \-p svcd input.fmf output.mpg +.EE +.PP +or +.PP +.EX +fmfconv input.fmf | ffmpeg \-i \- \-aspect 4:3 \-target pal\-svcd + output.mpg +.EE +.RE +.PP +Convert FMF to iPod video format: +.PP +.RS +.EX +fmfconv \-p ipod input.fmf output.m4v +.EE +.PP +or +.PP +.EX +fmfconv input.fmf | ffmpeg \-i \- \-vf scale=320:240 \-r 30 + \-codec:v h264 \-codec:a aac \-f ipod \-ar 44100 \-b:a 128000 + \-b:v 256000 \-pix_fmt yuv420p \-strict \-2 output.m4v +.EE +.RE +.PP +Convert FMF to animated GIF (25 fps) using ImageMagick: +.PP +.RS +.EX +fmfconv \-f 25 input.fmf tmp.png +convert \-delay 4 \-loop 0 \-layers removeDups \-layers Optimize + tmp*.png output.gif +.EE +.RE +.PP +Extract audio (mono) from a FMF file: +.PP +.RS +.EX +fmfconv \-\-sound-only \-\-mono input.fmf output.wav +.EE +.RE .\" .\"------------------------------------------------------------------ .\" @@ -438,10 +518,16 @@ .\"------------------------------------------------------------------ .\" .SH SEE ALSO +.IR avconv "(1)," .IR ffmpeg "(1)," .IR fuse "(1)," -.IR fuse\-utils "(1)" +.IR fuse\-utils "(1)," +.IR imagemagick "(1)." .PP +The Fuse Movie File specification, at +.br +.IR "http://sourceforge.net/p/fuse-emulator/wiki/FMF%20File%20Format/" . +.PP The comp.sys.sinclair Spectrum FAQ, at .br .IR "http://www.worldofspectrum.org/faq/index.html" . This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |