Hello community, here is the log from the commit of package libiec61883 for openSUSE:Factory checked in at 2013-01-07 15:30:49 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Comparing /work/SRC/openSUSE:Factory/libiec61883 (Old) and /work/SRC/openSUSE:Factory/.libiec61883.new (New) ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "libiec61883", Maintainer is "gnome-maintain...@suse.de" Changes: -------- --- /work/SRC/openSUSE:Factory/libiec61883/libiec61883.changes 2011-11-21 12:35:28.000000000 +0100 +++ /work/SRC/openSUSE:Factory/.libiec61883.new/libiec61883.changes 2013-01-07 15:30:52.000000000 +0100 @@ -1,0 +2,46 @@ +Wed Jan 2 11:17:33 UTC 2013 - p.drou...@gmail.com + +- Fix a typo mistake on devel Requires package + +------------------------------------------------------------------- +Sat Dec 29 16:25:28 UTC 2012 - p.drou...@gmail.com + +- Update to 1.2.0 version: + * Behavior changes of the backend to firewire-core: + - The isochronous reception buffer is now mapped read/writable rather + than read-only. The raw1394 backend already maps the buffer + read/writable too. Note that writing into the buffer will go + wrong on architectures without cache-coherent DMA if the CPU + and the OHCI write within the same cacheline region, so use this + feature with caution. + - Decrease memory footprint of IR and IT buffers by avoiding some internal rounding up of the buffer size. + * New APIs in <libraw1394/raw1394.h>: + - raw1394_add_config_rom_descriptor(): + - Add contents to the Configuration ROM of the local node(s). At + runtime, this API is only available if running on top of firewire-core. + It could probably also be implemented with the raw1394 kernel driver if + anybody cared. + - raw1394_remove_config_rom_descriptor(): + - Counterpart to raw1394_add_config_rom_descriptor(). + - raw1394_read_cycle_timer_and_clock(): + - Like the existing raw1394_read_cycle_timer(), but lets the caller choose + between CLOCK_REALTIME (which the former call is always using), + CLOCK_MONOTONIC, or CLOCK_MONOTONIC_RAW. + For example, this enables libffado's audio streaming to run undisturbed + by resets of CLOCK_REALTIME. + At runtime, this call requires firewire-core underneath. + - raw1394_get_speed(): + - Returns the speed code of the maximum possible transmission speed between + a given node and the local node. This takes maximum speeds of all participating + PHYs and the two links into account. This can be used to configure the speed + of isochronous streams. + - At runtime, this call requires firewire-core underneath. + - enum raw1394_iso_speed was extended by RAW1394_ISO_SPEED_800, _1600, and _3200. + * New APIs in <libraw1394/ieee1394.h>: + - Added preprocessor constants L1394_SPEED_BETA, L1394_SPEED_800, _1600, and _3200. + * testlibraw1394: + - Added unit tests of the new APIs. +- Removed patchs: fixed on upstream release: + * libiec61883-1.1.0-lfs.patch + +------------------------------------------------------------------- Old: ---- libiec61883-1.1.0-lfs.patch libiec61883-1.1.0.tar.bz2 New: ---- libiec61883-1.2.0.tar.bz2 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Other differences: ------------------ ++++++ libiec61883.spec ++++++ --- /var/tmp/diff_new_pack.H3xbPC/_old 2013-01-07 15:30:53.000000000 +0100 +++ /var/tmp/diff_new_pack.H3xbPC/_new 2013-01-07 15:30:53.000000000 +0100 @@ -1,7 +1,7 @@ # # spec file for package libiec61883 # -# Copyright (c) 2011 SUSE LINUX Products GmbH, Nuernberg, Germany. +# Copyright (c) 2012 SUSE LINUX Products GmbH, Nuernberg, Germany. # # All modifications and additions to the file contributed by third parties # remain the property of their copyright owners, unless otherwise agreed @@ -17,11 +17,10 @@ # norootforbuild - Name: libiec61883 BuildRequires: libraw1394-devel libtool pkgconfig -Version: 1.1.0 -Release: 1 +Version: 1.2.0 +Release: 0 License: GPL-2.0+ Summary: Implementation of IEC 61883 Url: http://www.linux1394.org/ @@ -29,7 +28,6 @@ BuildRoot: %{_tmppath}/%{name}-%{version}-build Source0: %{name}-%{version}.tar.bz2 Source1: baselibs.conf -Patch0: libiec61883-1.1.0-lfs.patch %description This library is an implementation of IEC 61883, part 1 (CIP, plug @@ -51,7 +49,8 @@ License: GPL-2.0+ Summary: Implementation of IEC 61883 Group: System/Kernel -Requires: %{name} = %{version} libraw1394-devel +Requires: %{name} = %{version} +Requires: libraw1394-devel %description devel This library is an implementation of IEC 61883, part 1 (CIP, plug @@ -71,10 +70,8 @@ %prep %setup -q -%patch0 %build -autoreconf -fiv export CFLAGS="%optflags -fno-strict-aliasing" %configure --disable-static --with-pic %{__make} %{?jobs:-j%jobs} all @@ -84,9 +81,6 @@ libtool --mode=install install -m 755 examples/test-mpeg2 %{buildroot}%{_bindir} rm -f %{buildroot}%{_libdir}/*.la -%clean -rm -rf "${RPM_BUILD_ROOT}" - %post -p /sbin/ldconfig %postun -p /sbin/ldconfig ++++++ libiec61883-1.1.0.tar.bz2 -> libiec61883-1.2.0.tar.bz2 ++++++ ++++ 61121 lines of diff (skipped) ++++ retrying with extended exclude list diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' --exclude Makefile.in --exclude configure --exclude config.guess --exclude '*.pot' --exclude mkinstalldirs --exclude aclocal.m4 --exclude config.sub --exclude depcomp --exclude install-sh --exclude ltmain.sh old/libiec61883-1.1.0/ChangeLog new/libiec61883-1.2.0/ChangeLog --- old/libiec61883-1.1.0/ChangeLog 2006-09-24 21:35:23.000000000 +0200 +++ new/libiec61883-1.2.0/ChangeLog 2009-01-15 07:36:11.000000000 +0100 @@ -1,4 +1,69 @@ ------------------------------------------------------------------------ +r83 | ddennedy | 2009-01-04 15:11:00 -0800 (Sun, 04 Jan 2009) | 1 line + +dv.c: remove a length check in dv_fb_recv that was already checked +------------------------------------------------------------------------ +r82 | ddennedy | 2009-01-04 14:09:53 -0800 (Sun, 04 Jan 2009) | 1 line + +dv.c: add some validation to the dv_fb receive handler +------------------------------------------------------------------------ +r81 | ddennedy | 2008-10-25 11:28:37 -0700 (Sat, 25 Oct 2008) | 1 line + +cmp.c: convert some confusing, chatty warnings into debug messages +------------------------------------------------------------------------ +r80 | ddennedy | 2008-02-02 11:43:09 -0800 (Sat, 02 Feb 2008) | 1 line + +tsbuffer.c: fix return size of ts_get_pid() to prevent truncation of value (as reported by Kai Hoffmann) +------------------------------------------------------------------------ +r79 | ddennedy | 2007-10-04 22:21:41 -0700 (Thu, 04 Oct 2007) | 1 line + +cmp.c: apply patch from Hugo Villeneuve to refactor iec61883_cmp_connect and _reconnect. +------------------------------------------------------------------------ +r78 | ddennedy | 2007-06-27 22:42:05 -0700 (Wed, 27 Jun 2007) | 1 line + +dv.c: bugfix start iso transmission when initialization fails in iec61883_dv_xmit_start (spotted by Maksym Veremeyenko) +------------------------------------------------------------------------ +r77 | ddennedy | 2007-05-14 21:37:39 -0700 (Mon, 14 May 2007) | 1 line + +convert c++ comments in amdtp.c to c-style +------------------------------------------------------------------------ +r76 | ddennedy | 2007-05-14 21:33:18 -0700 (Mon, 14 May 2007) | 26 lines + +Apply patch from Manfred Weihs: +1) I made IEC 60958 conformant PCM data more standard compliant. In +particular, I correctly calculate parity and PAC code. This was the +major fix that was necessary to make the Sony LISSA HiFi set output my +streams. + +2) I fixed the buffer variable in the fill_packet function to unsigned +char. The problem with (signed) char was that the compiler treats values +greater than 127 as negative and when it implicitly converts them to +(long) integers for the bit shifting operations, it sets all the more +significant bits (e. g. 0xa3 is converted to 0xffffffa3), which +obviously creates mess (i. e. noise in the speakers). + +3) In case packets get dropped (e. g. due to high load), the algorithm +for generating SYT timestamps gets out of sync with the actual cycle +count. I introduced a new function iec61883_cip_resync that (similar to +iec61883_cip_init) resets some internal variables and synchronises the +SYT timestamp generation with the cycle count. This function is called +when dropped packets are detected. Unfortunately this turned out not to +be sufficient because after dropped packets the reported cycle count is +not correct. Therefore, I check whether the timestamps are in sync and +resynchronise if necessary. + +4) I fixed some compiler warnings (mostly signedness issues) and removed +an unused field of a struct. + +------------------------------------------------------------------------ +r75 | ddennedy | 2007-03-19 19:17:52 -0700 (Mon, 19 Mar 2007) | 1 line + +large file support for examples +------------------------------------------------------------------------ +r74 | ddennedy | 2007-03-19 18:02:34 -0700 (Mon, 19 Mar 2007) | 1 line + +Apply patch from Robert Hailey to bugfix PID automatic selection possible on TSP with no PCR. Fix PCR PID filter option on test-mpeg2 utility. +------------------------------------------------------------------------ r73 | ddennedy | 2006-09-24 11:18:49 -0700 (Sun, 24 Sep 2006) | 1 line make manpages a part of dist tarball diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' --exclude Makefile.in --exclude configure --exclude config.guess --exclude '*.pot' --exclude mkinstalldirs --exclude aclocal.m4 --exclude config.sub --exclude depcomp --exclude install-sh --exclude ltmain.sh old/libiec61883-1.1.0/NEWS new/libiec61883-1.2.0/NEWS --- old/libiec61883-1.1.0/NEWS 2005-04-08 22:10:25.000000000 +0200 +++ new/libiec61883-1.2.0/NEWS 2009-01-15 07:31:02.000000000 +0100 @@ -2,6 +2,17 @@ Copyright (C) 2004-2005 Kristian Hogsberg, Dan Dennedy, and Dan Maas. http://www.linux1394.org/ +Version 1.2.0 + - Fixed PID handling in MPEG2-TS. + - Added iec61883_cip_resync(). + - Silence some warnings in CMP that may needlessly alarm users. + - Improved validation of DV packets in dv_fb. + - bugfixes + +Version 1.1.0 + - Added man pages for installed utilities. + - bugfixes + Version 1.0.0 First release. This release is mostly feature complete as opposed to diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' --exclude Makefile.in --exclude configure --exclude config.guess --exclude '*.pot' --exclude mkinstalldirs --exclude aclocal.m4 --exclude config.sub --exclude depcomp --exclude install-sh --exclude ltmain.sh old/libiec61883-1.1.0/config.h.in new/libiec61883-1.2.0/config.h.in --- old/libiec61883-1.1.0/config.h.in 2006-09-24 21:34:36.000000000 +0200 +++ new/libiec61883-1.2.0/config.h.in 2009-01-15 07:33:31.000000000 +0100 @@ -1,5 +1,8 @@ /* config.h.in. Generated from configure.ac by autoheader. */ +/* Define if building universal (internal helper macro) */ +#undef AC_APPLE_UNIVERSAL_BUILD + /* Define to 1 if you have the <dlfcn.h> header file. */ #undef HAVE_DLFCN_H @@ -30,6 +33,10 @@ /* Define to 1 if you have the <unistd.h> header file. */ #undef HAVE_UNISTD_H +/* Define to the sub-directory in which libtool stores uninstalled libraries. + */ +#undef LT_OBJDIR + /* Name of package */ #undef PACKAGE @@ -54,9 +61,26 @@ /* Version number of package */ #undef VERSION -/* Define to 1 if your processor stores words with the most significant byte - first (like Motorola and SPARC, unlike Intel and VAX). */ -#undef WORDS_BIGENDIAN +/* Define WORDS_BIGENDIAN to 1 if your processor stores words with the most + significant byte first (like Motorola and SPARC, unlike Intel). */ +#if defined AC_APPLE_UNIVERSAL_BUILD +# if defined __BIG_ENDIAN__ +# define WORDS_BIGENDIAN 1 +# endif +#else +# ifndef WORDS_BIGENDIAN +# undef WORDS_BIGENDIAN +# endif +#endif + +/* Number of bits in a file offset, on hosts where this is settable. */ +#undef _FILE_OFFSET_BITS + +/* Enable GNU extensions of glibc, notably large file support */ +#undef _GNU_SOURCE + +/* Define for large files, on AIX-style hosts. */ +#undef _LARGE_FILES /* Define to empty if `const' does not conform to ANSI C. */ #undef const diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' --exclude Makefile.in --exclude configure --exclude config.guess --exclude '*.pot' --exclude mkinstalldirs --exclude aclocal.m4 --exclude config.sub --exclude depcomp --exclude install-sh --exclude ltmain.sh old/libiec61883-1.1.0/configure.ac new/libiec61883-1.2.0/configure.ac --- old/libiec61883-1.1.0/configure.ac 2006-09-24 21:06:16.000000000 +0200 +++ new/libiec61883-1.2.0/configure.ac 2009-01-15 07:31:17.000000000 +0100 @@ -1,7 +1,7 @@ # process this file with autoconf to get a configure script AC_INIT(Makefile.am) -AM_INIT_AUTOMAKE(libiec61883, 1.1.0) +AM_INIT_AUTOMAKE(libiec61883, 1.2.0) AM_CONFIG_HEADER(config.h) AC_PROG_CC @@ -11,11 +11,14 @@ AC_C_CONST AC_C_BIGENDIAN +AC_DEFINE(_GNU_SOURCE, 1, [Enable GNU extensions of glibc, notably large file support]) +AC_SYS_LARGEFILE + PKG_CHECK_MODULES(LIBRAW1394, libraw1394 >= 1.2.1) # set the libtool so version numbers lt_current=1 -lt_revision=0 +lt_revision=1 lt_age=1 AC_SUBST(lt_current) diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' --exclude Makefile.in --exclude configure --exclude config.guess --exclude '*.pot' --exclude mkinstalldirs --exclude aclocal.m4 --exclude config.sub --exclude depcomp --exclude install-sh --exclude ltmain.sh old/libiec61883-1.1.0/examples/plugctl.c new/libiec61883-1.2.0/examples/plugctl.c --- old/libiec61883-1.1.0/examples/plugctl.c 2005-01-31 15:29:45.000000000 +0100 +++ new/libiec61883-1.2.0/examples/plugctl.c 2007-05-15 06:50:29.000000000 +0200 @@ -300,7 +300,7 @@ result = iec61883_get_oPCRX (handle, node, &o_pcr, idx); if (result < 0) continue; - is_got_opcr[idx]; + is_got_opcr[idx] = 1; } is_set_opcr[idx] = 1; if (strcasecmp (attribute, "online") == 0) { @@ -330,7 +330,7 @@ result = iec61883_get_iPCRX (handle, node, &i_pcr, idx); if (result < 0) continue; - is_got_ipcr[idx]; + is_got_ipcr[idx] = 1; } is_set_ipcr[idx] = 1; if (strcasecmp (attribute, "online") == 0) { diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' --exclude Makefile.in --exclude configure --exclude config.guess --exclude '*.pot' --exclude mkinstalldirs --exclude aclocal.m4 --exclude config.sub --exclude depcomp --exclude install-sh --exclude ltmain.sh old/libiec61883-1.1.0/examples/test-amdtp.c new/libiec61883-1.2.0/examples/test-amdtp.c --- old/libiec61883-1.1.0/examples/test-amdtp.c 2005-06-22 19:52:27.000000000 +0200 +++ new/libiec61883-1.2.0/examples/test-amdtp.c 2007-05-15 06:50:29.000000000 +0200 @@ -17,6 +17,10 @@ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ +#ifdef HAVE_CONFIG_H +#include <config.h> +#endif + #include "../src/iec61883.h" #include <stdio.h> #include <sys/select.h> @@ -31,19 +35,19 @@ g_done = 1; } -int fill_packet (iec61883_amdtp_t amdtp, char *data, int nevents, +int fill_packet (iec61883_amdtp_t amdtp, unsigned char *data, int nevents, unsigned int dbc, unsigned int dropped, void *callback_data) { FILE *fp = (FILE *) callback_data; static int total_packets = 0; int nsamples = nevents * 2; // stereo 16bit PCM - char buffer [nsamples * 2]; + unsigned char buffer [nsamples * 2]; if (fread (buffer, 2, nsamples, fp) != nsamples) { return -1; } else { // TODO: convert from additional formats (20 or 24-bits). - char *p = buffer; + unsigned char *p = buffer; quadlet_t *event = (quadlet_t*) data; int i; @@ -63,7 +67,7 @@ return 0; } -static int read_packet (iec61883_amdtp_t amdtp, char *data, int nsamples, +static int read_packet (iec61883_amdtp_t amdtp, unsigned char *data, int nsamples, unsigned int dbc, unsigned int dropped, void *callback_data) { FILE *f = (FILE*) callback_data; diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' --exclude Makefile.in --exclude configure --exclude config.guess --exclude '*.pot' --exclude mkinstalldirs --exclude aclocal.m4 --exclude config.sub --exclude depcomp --exclude install-sh --exclude ltmain.sh old/libiec61883-1.1.0/examples/test-dv.c new/libiec61883-1.2.0/examples/test-dv.c --- old/libiec61883-1.1.0/examples/test-dv.c 2006-05-12 08:42:17.000000000 +0200 +++ new/libiec61883-1.2.0/examples/test-dv.c 2007-08-12 01:43:54.000000000 +0200 @@ -17,6 +17,10 @@ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ +#ifdef HAVE_CONFIG_H +#include <config.h> +#endif + #include "../src/iec61883.h" #include <stdio.h> #include <sys/poll.h> @@ -170,6 +174,7 @@ raw1394_get_local_id (handle), &oplug, node, &iplug, &bandwidth); if (channel > -1) { + fprintf (stderr, "Connect succeeded, transmitting on channel %d.\n", channel); dv_transmit (handle, f, channel); iec61883_cmp_disconnect (handle, raw1394_get_local_id (handle), oplug, node, iplug, diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' --exclude Makefile.in --exclude configure --exclude config.guess --exclude '*.pot' --exclude mkinstalldirs --exclude aclocal.m4 --exclude config.sub --exclude depcomp --exclude install-sh --exclude ltmain.sh old/libiec61883-1.1.0/examples/test-mpeg2.c new/libiec61883-1.2.0/examples/test-mpeg2.c --- old/libiec61883-1.1.0/examples/test-mpeg2.c 2005-09-19 07:35:32.000000000 +0200 +++ new/libiec61883-1.2.0/examples/test-mpeg2.c 2007-03-20 02:32:07.000000000 +0100 @@ -17,6 +17,10 @@ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ +#ifdef HAVE_CONFIG_H +#include <config.h> +#endif + #include "../src/iec61883.h" #include <stdio.h> #include <sys/select.h> @@ -146,7 +150,7 @@ is_transmit = 0; node_specified = 1; } else if (strncmp (argv[i], "-p", 2) == 0) { - pid |= atoi (argv[++i]); + pid = atoi (argv[++i]); is_transmit = 1; } else if (strcmp (argv[i], "-") != 0) { if (node_specified && !is_transmit) diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' --exclude Makefile.in --exclude configure --exclude config.guess --exclude '*.pot' --exclude mkinstalldirs --exclude aclocal.m4 --exclude config.sub --exclude depcomp --exclude install-sh --exclude ltmain.sh old/libiec61883-1.1.0/libiec61883.spec new/libiec61883-1.2.0/libiec61883.spec --- old/libiec61883-1.1.0/libiec61883.spec 2006-09-24 21:34:56.000000000 +0200 +++ new/libiec61883-1.2.0/libiec61883.spec 2009-01-15 07:33:53.000000000 +0100 @@ -1,13 +1,13 @@ %define prefix /usr Name: libiec61883 -Version: 1.1.0 +Version: 1.2.0 Release: 1 License: LGPL Group: Libraries -Source: http://linux1394.org/dl/libiec61883-1.1.0.tar.gz +Source: http://linux1394.org/dl/libiec61883-1.2.0.tar.gz URL: http://linux1394.org -BuildRoot: /var/tmp/libiec61883-1.1.0-root +BuildRoot: /var/tmp/libiec61883-1.2.0-root Summary: Streaming library for IEEE1394 %changelog diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' --exclude Makefile.in --exclude configure --exclude config.guess --exclude '*.pot' --exclude mkinstalldirs --exclude aclocal.m4 --exclude config.sub --exclude depcomp --exclude install-sh --exclude ltmain.sh old/libiec61883-1.1.0/missing new/libiec61883-1.2.0/missing --- old/libiec61883-1.1.0/missing 2006-09-24 21:34:37.000000000 +0200 +++ new/libiec61883-1.2.0/missing 2009-01-15 07:33:32.000000000 +0100 @@ -1,9 +1,9 @@ #! /bin/sh # Common stub for a few missing GNU programs while installing. -scriptversion=2005-06-08.21 +scriptversion=2006-05-10.23 -# Copyright (C) 1996, 1997, 1999, 2000, 2002, 2003, 2004, 2005 +# Copyright (C) 1996, 1997, 1999, 2000, 2002, 2003, 2004, 2005, 2006 # Free Software Foundation, Inc. # Originally by Fran,cois Pinard <pin...@iro.umontreal.ca>, 1996. @@ -33,6 +33,8 @@ fi run=: +sed_output='s/.* --output[ =]\([^ ]*\).*/\1/p' +sed_minuso='s/.* -o \([^ ]*\).*/\1/p' # In the cases where this matters, `missing' is being run in the # srcdir already. @@ -44,7 +46,7 @@ msg="missing on your system" -case "$1" in +case $1 in --run) # Try to run requested program, and just exit if it succeeds. run= @@ -77,6 +79,7 @@ aclocal touch file \`aclocal.m4' autoconf touch file \`configure' autoheader touch file \`config.h.in' + autom4te touch the output file, or create a stub one automake touch all \`Makefile.in' files bison create \`y.tab.[ch]', if possible, from existing .[ch] flex create \`lex.yy.c', if possible, from existing .c @@ -106,7 +109,7 @@ # Now exit if we have it, but it failed. Also exit now if we # don't have it and --version was passed (most likely to detect # the program). -case "$1" in +case $1 in lex|yacc) # Not GNU programs, they don't have --version. ;; @@ -135,7 +138,7 @@ # If it does not exist, or fails to run (possibly an outdated version), # try to emulate it. -case "$1" in +case $1 in aclocal*) echo 1>&2 "\ WARNING: \`$1' is $msg. You should only need it if @@ -164,7 +167,7 @@ test -z "$files" && files="config.h" touch_files= for f in $files; do - case "$f" in + case $f in *:*) touch_files="$touch_files "`echo "$f" | sed -e 's/^[^:]*://' -e 's/:.*//'`;; *) touch_files="$touch_files $f.in";; @@ -192,8 +195,8 @@ You can get \`$1' as part of \`Autoconf' from any GNU archive site." - file=`echo "$*" | sed -n 's/.*--output[ =]*\([^ ]*\).*/\1/p'` - test -z "$file" && file=`echo "$*" | sed -n 's/.*-o[ ]*\([^ ]*\).*/\1/p'` + file=`echo "$*" | sed -n "$sed_output"` + test -z "$file" && file=`echo "$*" | sed -n "$sed_minuso"` if test -f "$file"; then touch $file else @@ -214,25 +217,25 @@ in order for those modifications to take effect. You can get \`Bison' from any GNU archive site." rm -f y.tab.c y.tab.h - if [ $# -ne 1 ]; then + if test $# -ne 1; then eval LASTARG="\${$#}" - case "$LASTARG" in + case $LASTARG in *.y) SRCFILE=`echo "$LASTARG" | sed 's/y$/c/'` - if [ -f "$SRCFILE" ]; then + if test -f "$SRCFILE"; then cp "$SRCFILE" y.tab.c fi SRCFILE=`echo "$LASTARG" | sed 's/y$/h/'` - if [ -f "$SRCFILE" ]; then + if test -f "$SRCFILE"; then cp "$SRCFILE" y.tab.h fi ;; esac fi - if [ ! -f y.tab.h ]; then + if test ! -f y.tab.h; then echo >y.tab.h fi - if [ ! -f y.tab.c ]; then + if test ! -f y.tab.c; then echo 'main() { return 0; }' >y.tab.c fi ;; @@ -244,18 +247,18 @@ in order for those modifications to take effect. You can get \`Flex' from any GNU archive site." rm -f lex.yy.c - if [ $# -ne 1 ]; then + if test $# -ne 1; then eval LASTARG="\${$#}" - case "$LASTARG" in + case $LASTARG in *.l) SRCFILE=`echo "$LASTARG" | sed 's/l$/c/'` - if [ -f "$SRCFILE" ]; then + if test -f "$SRCFILE"; then cp "$SRCFILE" lex.yy.c fi ;; esac fi - if [ ! -f lex.yy.c ]; then + if test ! -f lex.yy.c; then echo 'main() { return 0; }' >lex.yy.c fi ;; @@ -267,11 +270,9 @@ \`Help2man' package in order for those modifications to take effect. You can get \`Help2man' from any GNU archive site." - file=`echo "$*" | sed -n 's/.*-o \([^ ]*\).*/\1/p'` - if test -z "$file"; then - file=`echo "$*" | sed -n 's/.*--output=\([^ ]*\).*/\1/p'` - fi - if [ -f "$file" ]; then + file=`echo "$*" | sed -n "$sed_output"` + test -z "$file" && file=`echo "$*" | sed -n "$sed_minuso"` + if test -f "$file"; then touch $file else test -z "$file" || exec >$file @@ -289,11 +290,17 @@ DU, IRIX). You might want to install the \`Texinfo' package or the \`GNU make' package. Grab either from any GNU archive site." # The file to touch is that specified with -o ... - file=`echo "$*" | sed -n 's/.*-o \([^ ]*\).*/\1/p'` + file=`echo "$*" | sed -n "$sed_output"` + test -z "$file" && file=`echo "$*" | sed -n "$sed_minuso"` if test -z "$file"; then # ... or it is the one specified with @setfilename ... infile=`echo "$*" | sed 's/.* \([^ ]*\) *$/\1/'` - file=`sed -n '/^@setfilename/ { s/.* \([^ ]*\) *$/\1/; p; q; }' $infile` + file=`sed -n ' + /^@setfilename/{ + s/.* \([^ ]*\) *$/\1/ + p + q + }' $infile` # ... or it is derived from the source name (dir/f.texi becomes f.info) test -z "$file" && file=`echo "$infile" | sed 's,.*/,,;s,.[^.]*$,,'`.info fi @@ -317,13 +324,13 @@ fi firstarg="$1" if shift; then - case "$firstarg" in + case $firstarg in *o*) firstarg=`echo "$firstarg" | sed s/o//` tar "$firstarg" "$@" && exit 0 ;; esac - case "$firstarg" in + case $firstarg in *h*) firstarg=`echo "$firstarg" | sed s/h//` tar "$firstarg" "$@" && exit 0 diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' --exclude Makefile.in --exclude configure --exclude config.guess --exclude '*.pot' --exclude mkinstalldirs --exclude aclocal.m4 --exclude config.sub --exclude depcomp --exclude install-sh --exclude ltmain.sh old/libiec61883-1.1.0/src/amdtp.c new/libiec61883-1.2.0/src/amdtp.c --- old/libiec61883-1.1.0/src/amdtp.c 2006-09-24 21:30:19.000000000 +0200 +++ new/libiec61883-1.2.0/src/amdtp.c 2007-05-15 07:00:32.000000000 +0200 @@ -33,7 +33,7 @@ #include "iec61883.h" #include "iec61883-private.h" -#define AMDTP_MAX_PACKET_SIZE 2048 //XXX: what is max packet size in AMDTP? +#define AMDTP_MAX_PACKET_SIZE 2048 iec61883_amdtp_t iec61883_amdtp_xmit_init (raw1394handle_t handle, @@ -115,6 +115,9 @@ amdtp->dimension = dimension; } + /* reset framecounter for IEC958 mode */ + amdtp->iec958_frame_count = 0; + amdtp->sample_format = sample_format; amdtp->get_data = get_data; amdtp->callback_data = callback_data; @@ -143,14 +146,41 @@ { struct iec61883_amdtp *amdtp = raw1394_get_userdata (handle); struct iec61883_packet *packet = (struct iec61883_packet *) data; - int nevents = iec61883_cip_fill_header (handle, &amdtp->cip, packet); + int nevents; quadlet_t *event = (quadlet_t *) packet->data; enum raw1394_iso_disposition result = RAW1394_ISO_OK; int nsamples; + int diff_sync; assert (amdtp != NULL); amdtp->total_dropped += dropped; + /* If packets got dropped, we have to resynchronize the generation + of SYT timestamps. Otherwise the SYT timestamps would differ + too much from current cycle time. + Unfortunately, dropped does not tell us how many packets got + got dropped. It just tells us that we lost packets. + So the only thing we can do is restarting buffering and + taking the current cycle count as reference. */ + if (dropped) { + DEBUG ("dropped packets detected."); + iec61883_cip_resync(&amdtp->cip, cycle); + } + + /* The following is a workaround for a possible bug in the kernel + module. It seems that after a dropped packet event, the cycle + number passed to this handler is incorrect (does not match the + transmission cycle) for some time. Therefore, we check whether + the SYT timestamp is in sync with the current cycle count. If + we ran out of sync, we resynchronize. */ + diff_sync = (amdtp->cip.cycle_count - cycle + 8000) % 8000; + if (diff_sync > 5) { + DEBUG ("lost SYT sync, resynchronizing."); + iec61883_cip_resync(&amdtp->cip, cycle); + } + + nevents = iec61883_cip_fill_header (handle, &amdtp->cip, packet); + if (nevents > 0) { nsamples = nevents; } @@ -213,7 +243,14 @@ sample->validity = IEC60958_DATA_VALID; if( i % 2 == 0 || amdtp->dimension == 1 ) { /* even --> CHANNEL 1 */ - sample->pac = IEC60958_PAC_M; + if( amdtp->iec958_frame_count == 0 ) + { + sample->pac = IEC60958_PAC_B; + } + else + { + sample->pac = IEC60958_PAC_M; + } } else { /* Odd --> CHANNEL 2 */ @@ -221,8 +258,27 @@ } } - /* The parity bit should be computed here... */ + sample->ch_status = 0; + /* The parity bit is the xor of the sample bits and the channel + status info bit. */ + int shift; + u_int32_t p; + for (shift = 16, p = sample->data ^ sample->ch_status; shift > 0; shift >>= 1) + { + p ^= (p >> shift); + } + sample->parity = p & 1; + event[i] = htonl (event[i]); + + /* increase the IEC958 framecounter */ + if ((i % 2 == 1) || (amdtp->dimension == 1)) + { + amdtp->iec958_frame_count++; + if (amdtp->iec958_frame_count >= 192) { + amdtp->iec958_frame_count = 0; + } + } } } else { diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' --exclude Makefile.in --exclude configure --exclude config.guess --exclude '*.pot' --exclude mkinstalldirs --exclude aclocal.m4 --exclude config.sub --exclude depcomp --exclude install-sh --exclude ltmain.sh old/libiec61883-1.1.0/src/cip.c new/libiec61883-1.2.0/src/cip.c --- old/libiec61883-1.1.0/src/cip.c 2005-02-19 17:43:48.000000000 +0100 +++ new/libiec61883-1.2.0/src/cip.c 2007-05-15 06:51:40.000000000 +0200 @@ -89,7 +89,6 @@ ptz->rate = rate; ptz->cycle_count = transfer_delay / 3072; - ptz->cycle_count2 = 0; ptz->format = format; ptz->fdf = fdf; ptz->mode = IEC61883_MODE_BLOCKING_EMPTY; @@ -111,6 +110,19 @@ (transfer_delay % 3072) * ptz->rate, ptz->rate); } +void +iec61883_cip_resync(struct iec61883_cip *ptz, int cycle) +{ + const int transfer_delay = 9000; + + ptz->cycle_count = cycle + (transfer_delay / 3072); + fraction_init(&ptz->cycle_offset, + (transfer_delay % 3072) * ptz->rate, ptz->rate); + + fraction_init(&ptz->ready_samples, 0, 8000); + ptz->dbc = 0; +} + void iec61883_cip_set_transmission_mode(struct iec61883_cip *ptz, int mode) { @@ -170,10 +182,10 @@ fraction_add(&ptz->cycle_offset, &ptz->cycle_offset, &ptz->ticks_per_syt_offset); - /* This next addition should be modulo 8000 (0x1f40), - * but we only use the lower 4 bits of cycle_count, so - * we don't need the modulo. */ + /* The cycle_count field is a 13 bits value that goes from 0 to 7999. + * The cycle_offset field is a 12 bits value that goes from 0 to 3071. */ ptz->cycle_count += ptz->cycle_offset.integer / 3072; + ptz->cycle_count %= 8000; ptz->cycle_offset.integer %= 3072; } else diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' --exclude Makefile.in --exclude configure --exclude config.guess --exclude '*.pot' --exclude mkinstalldirs --exclude aclocal.m4 --exclude config.sub --exclude depcomp --exclude install-sh --exclude ltmain.sh old/libiec61883-1.1.0/src/cmp.c new/libiec61883-1.2.0/src/cmp.c --- old/libiec61883-1.1.0/src/cmp.c 2005-11-11 20:01:26.000000000 +0100 +++ new/libiec61883-1.2.0/src/cmp.c 2008-10-24 23:42:37.000000000 +0200 @@ -434,18 +434,45 @@ return c; } -int -iec61883_cmp_connect (raw1394handle_t handle, nodeid_t output, int *oplug, - nodeid_t input, int *iplug, int *bandwidth) +/** + * cmp_connect - establish, re-establish or overlay connection automatically + * @handle: a libraw1394 handle + * @output: node id of the transmitter + * @oplug: the output plug to use. If -1, find the first online plug, and + * upon return, contains the plug number used. + * @input: node id of the receiver + * @iplug: the input plug to use. If -1, find the first online plug, and + * upon return, contains the plug number used. + * @bandwidth: an input/output parameter. As an input this is a boolean that + * indicates whether to perform bandwidth allocation. Supply 0 to skip bandwidth + * allocation; any other value permits it. Upon return, actual bandwidth allocation + * units allocated are returned, which you supply to the disconnect routine. + * @channel: if channel is < 0, the function will establish a new connection. + * oherwise, it will try to re-establish an existing connection. + * + * This is a high level function that attempts to be as smart as possible, but + * it gives point-to-point connections higher priority over broadcast connections. + * It can automatically handle situations where either @input and/or @output does + * not implement plug control registers. However, if one node implements plug + * registers it assumes the other node has some sort of manual channel selection + * (i.e., through software or a control panel). + * + * Returns: + * It returns the isochronous channel number selected or -1 if the function has + * failed for any reason. + **/ +static int +cmp_connect (raw1394handle_t handle, nodeid_t output, int *oplug, + nodeid_t input, int *iplug, int *bandwidth, int channel) { struct iec61883_oMPR ompr; struct iec61883_iMPR impr; struct iec61883_oPCR opcr; struct iec61883_iPCR ipcr; int oplug_online = -1, iplug_online = -1; - int channel = -1; int skip_bandwidth = (*bandwidth == 0); int failure = 0; + int new_connection = (channel < 0); DEBUG ("%s", __FUNCTION__); @@ -515,7 +542,11 @@ } } if (!failure) { - channel = allocate_channel (handle); + if (new_connection) { + channel = allocate_channel (handle); + } else { + raw1394_channel_modify (handle, channel, RAW1394_MODIFY_ALLOC); + } if (iec61883_cmp_create_p2p (handle, output, *oplug, input, *iplug, channel, speed) < 0) { // release channel and bandwidth @@ -600,10 +631,14 @@ } } if (!failure) { - channel = allocate_channel (handle); + if( new_connection ) { + channel = allocate_channel (handle); + } else { + raw1394_channel_modify (handle, channel, RAW1394_MODIFY_ALLOC); + } if (iec61883_cmp_create_p2p_output (handle, output, *oplug, channel, ompr.data_rate) == 0) { - WARN ("Established connection on channel %d.\n" + DEBUG ("Established connection on channel %d.\n" "You may need to manually set the channel on the receiving node.", channel); } else { @@ -626,7 +661,7 @@ if (iec61883_cmp_overlay_p2p_output (handle, output, oplug_online) < 0) channel = -1; } - WARN ("Overlayed connection on channel %d.\n" + DEBUG ("Overlayed connection on channel %d.\n" "You may need to manually set the channel on the receiving node.", channel); } else { @@ -688,9 +723,13 @@ } } if (!failure) { - channel = allocate_channel (handle); + if( new_connection ) { + channel = allocate_channel (handle); + } else { + raw1394_channel_modify (handle, channel, RAW1394_MODIFY_ALLOC); + } if (iec61883_cmp_create_p2p_input (handle, input, *iplug, channel) == 0) { - WARN ("Established connection on channel %d.\n" + DEBUG ("Established connection on channel %d.\n" "You may need to manually set the channel on the transmitting node.", channel); } else { @@ -713,13 +752,15 @@ if (iec61883_cmp_overlay_p2p_input (handle, input, iplug_online) < 0) channel = -1; } - WARN ("Overlayed connection on channel %d.\n" + DEBUG ("Overlayed connection on channel %d.\n" "You may need to manually set the channel on the transmitting node.", channel); } else { WARN ("Receiving node has no plugs online!"); // failover to broadcast // allocate bandwidth based upon first input plug + *iplug = -1; + if (!skip_bandwidth) { *bandwidth = iec61883_cmp_calc_bandwidth (handle, input, 0, impr.data_rate); if (*bandwidth < 1) { @@ -753,311 +794,16 @@ iec61883_cmp_reconnect (raw1394handle_t handle, nodeid_t output, int *oplug, nodeid_t input, int *iplug, int *bandwidth, int channel) { - struct iec61883_oMPR ompr; - struct iec61883_iMPR impr; - struct iec61883_oPCR opcr; - struct iec61883_iPCR ipcr; - int oplug_online = -1, iplug_online = -1; - int skip_bandwidth = (*bandwidth == 0); - int failure = 0; - - DEBUG ("%s", __FUNCTION__); - - *bandwidth = 0; - - // Check for plugs on output - if (iec61883_get_oMPR (handle, output, &ompr) < 0) - ompr.n_plugs = 0; - - // Check for plugs on input - if (iec61883_get_iMPR (handle, input, &impr) < 0) - impr.n_plugs = 0; - - DEBUG ("output node %d #plugs=%d, input node %d #plugs=%d", output & 0x3f, - ompr.n_plugs, input & 0x3f, impr.n_plugs); - - if (ompr.n_plugs > 0 && impr.n_plugs > 0) { - // establish or overlay point-to-point - - // speed to use is lesser of output and input - unsigned int speed = impr.data_rate < ompr.data_rate ? impr.data_rate : ompr.data_rate; - - // determine if output has plug available - if (*oplug < 0) { - for (*oplug = 0; *oplug < ompr.n_plugs; (*oplug)++) { - if (iec61883_get_oPCRX (handle, output, &opcr, *oplug) == 0) { - // get first online plug - if (oplug_online == -1 && opcr.online) - oplug_online = *oplug; - if (opcr.online && opcr.n_p2p_connections == 0) - break; - } - } - } else if (iec61883_get_oPCRX (handle, output, &opcr, *oplug) < 0) - FAIL ("Failed to get plug %d for output node", *oplug); - - // determine if input has plug available - if (*iplug < 0) { - for (*iplug = 0; *iplug < impr.n_plugs; (*iplug)++) { - if (iec61883_get_iPCRX (handle, input, &ipcr, *iplug) == 0) { - // get first online plug - if (iplug_online == -1 && ipcr.online) - iplug_online = *iplug; - if (ipcr.online && ipcr.n_p2p_connections == 0) - break; - } - } - } else if (iec61883_get_iPCRX (handle, input, &ipcr, *iplug) < 0) - FAIL ("Failed to get plug %d for input node", *iplug); - - if (*oplug < ompr.n_plugs && *iplug < impr.n_plugs) { - - if (opcr.bcast_connection == 1) { - channel = opcr.channel; - iec61883_cmp_overlay_bcast (handle, output, *oplug, input, *iplug); - } else { - // allocate bandwidth - if (!skip_bandwidth) { - *bandwidth = iec61883_cmp_calc_bandwidth (handle, output, *oplug, speed); - if (*bandwidth < 1) { - WARN ("Failed to calculate bandwidth."); - failure = 1; - } else if (raw1394_bandwidth_modify (handle, *bandwidth, RAW1394_MODIFY_ALLOC) < 0) { - WARN ("Failed to allocate bandwidth."); - failure = 1; - } - } - if (!failure) { - raw1394_channel_modify (handle, channel, RAW1394_MODIFY_ALLOC); - if (iec61883_cmp_create_p2p (handle, output, *oplug, input, *iplug, channel, speed) < 0) { - // release channel and bandwidth - failure = raw1394_channel_modify (handle, channel, RAW1394_MODIFY_FREE); - if (!failure) - raw1394_bandwidth_modify (handle, *bandwidth, RAW1394_MODIFY_FREE); - channel = -1; - } - } - } - - } else if (*iplug < impr.n_plugs && oplug_online > -1 ) { - // get the channel from output - can not start another transmission - // on an existing channel, but can receive from multiple nodes/plugs - *oplug = oplug_online; - if (iec61883_get_oPCRX (handle, output, &opcr, oplug_online) == 0) { - channel = opcr.channel; - if (opcr.bcast_connection == 1) { - iec61883_cmp_overlay_bcast (handle, output, oplug_online, input, *iplug); - } else { - if (iec61883_cmp_create_p2p_input (handle, input, *iplug, channel) < 0) - channel = -1; - else if (iec61883_cmp_overlay_p2p_output (handle, output, oplug_online) < 0) - channel = -1; - } - } - - } else if (oplug_online != -1 && iplug_online > -1) { - // get channel from output - *oplug = oplug_online; - if (iec61883_get_oPCRX (handle, output, &opcr, oplug_online) == 0) { - channel = opcr.channel; - if (iec61883_cmp_overlay_p2p (handle, output, oplug_online, input, iplug_online) < 0) - channel = -1; - } - } else { - WARN ("All the plugs on both nodes are offline!"); - *oplug = *iplug = -1; - } - - } else if (ompr.n_plugs > 0) { - // establish or overlay half point-to-point on output - *iplug = -1; - - // determine if output has plug available - if (*oplug < 0) { - for (*oplug = 0; *oplug < ompr.n_plugs; (*oplug)++) { - if (iec61883_get_oPCRX (handle, output, &opcr, *oplug) == 0) { - // get first online plug - if (oplug_online == -1 && opcr.online) - oplug_online = *oplug; - if (opcr.online && opcr.n_p2p_connections == 0) - break; - } - } - } else if (iec61883_get_oPCRX (handle, output, &opcr, *oplug) < 0) - FAIL ("Failed to get plug %d for output node", *oplug); - - if (*oplug < ompr.n_plugs) { - if (opcr.bcast_connection == 1) { - channel = opcr.channel; - } else { - // establish - // XXX: the input must provide manual channel selection or we should - // do a broadcast. Example use case: DV device is output and local - // node is input, but software allows channel select. Failure use - // case: local node is output but input device has no channel selection! - // Both use cases are actually quite common. Should we provide a - // parameter to offer a hint in case operator knows something more - // about the device than firewire interfaces on it suggest? - - // allocate bandwidth - if (!skip_bandwidth) { - *bandwidth = iec61883_cmp_calc_bandwidth (handle, output, *oplug, ompr.data_rate); - if (*bandwidth < 1) { - WARN ("Failed to calculate bandwidth."); - failure = 1; - } else if (raw1394_bandwidth_modify (handle, *bandwidth, RAW1394_MODIFY_ALLOC) < 0) { - WARN ("Failed to allocate bandwidth."); - failure = 1; - } - } - if (!failure) { - raw1394_channel_modify (handle, channel, RAW1394_MODIFY_ALLOC); - if (iec61883_cmp_create_p2p_output (handle, output, *oplug, channel, ompr.data_rate) == 0) { - WARN ("Established connection on channel %d.\n" - "You may need to manually set the channel on the receiving node.", - channel); - } else { - // release channel and bandwidth - failure = raw1394_channel_modify (handle, channel, RAW1394_MODIFY_FREE); - if (!failure) - raw1394_bandwidth_modify (handle, *bandwidth, RAW1394_MODIFY_FREE); - channel = -1; - } - } - } - - } else if (oplug_online > -1) { - // overlay - // get channel from output - *oplug = oplug_online; - if (iec61883_get_oPCRX (handle, output, &opcr, oplug_online) == 0) { - channel = opcr.channel; - if (opcr.bcast_connection != 1) - if (iec61883_cmp_overlay_p2p_output (handle, output, oplug_online) < 0) - channel = -1; - } - WARN ("Overlayed connection on channel %d.\n" - "You may need to manually set the channel on the receiving node.", - channel); - } else { - WARN ("Transmission node has no plugs online!"); - // failover to broadcast - // allocate bandwidth based upon first out plug - *oplug = -1; - if (!skip_bandwidth) { - *bandwidth = iec61883_cmp_calc_bandwidth (handle, output, 0, ompr.data_rate); - if (*bandwidth < 1) { - WARN ("Failed to calculate bandwidth."); - failure = 1; - } else if (raw1394_bandwidth_modify (handle, *bandwidth, RAW1394_MODIFY_ALLOC) < 0) { - WARN ("Failed to allocate bandwidth."); - failure = 1; - } - } - if (!failure) { - if (raw1394_channel_modify (handle, ompr.bcast_channel, RAW1394_MODIFY_ALLOC) == 0) - channel = ompr.bcast_channel; - } - } - - } else if (impr.n_plugs > 0) { - // establish or overlay half point-to-point on input - *oplug = -1; - - // determine if input has plug available - if (*iplug < 0) { - for (*iplug = 0; *iplug < impr.n_plugs; (*iplug)++) { - if (iec61883_get_iPCRX (handle, input, &ipcr, *iplug) == 0) { - // get first online plug - if (iplug_online == -1 && ipcr.online) - iplug_online = *iplug; - if (ipcr.online && ipcr.n_p2p_connections == 0) - break; - } - } - } else if (iec61883_get_iPCRX (handle, input, &ipcr, *iplug) < 0) - FAIL ("Failed to get plug %d for input node", *iplug); - - if (*iplug < impr.n_plugs) { - if (ipcr.bcast_connection == 1) { - channel = ipcr.channel; - } else { - // establish - - // allocate bandwidth - // cannot accurately allocate bandwidth with no output plug - // use an output plug on the input device as a best guess - if (!skip_bandwidth) { - *bandwidth = iec61883_cmp_calc_bandwidth (handle, input, *iplug, -1); - if (*bandwidth < 1) { - WARN ("Failed to calculate bandwidth."); - failure = 1; - } else if (raw1394_bandwidth_modify (handle, *bandwidth, RAW1394_MODIFY_ALLOC) < 0) { - WARN ("Failed to allocate bandwidth."); - failure = 1; - } - } - if (!failure) { - raw1394_channel_modify (handle, channel, RAW1394_MODIFY_ALLOC); - if (iec61883_cmp_create_p2p_input (handle, input, *iplug, channel) == 0) { - WARN ("Established connection on channel %d.\n" - "You may need to manually set the channel on the transmitting node.", - channel); - } else { - // release channel and bandwidth - failure = raw1394_channel_modify (handle, channel, RAW1394_MODIFY_FREE); - if (!failure) - raw1394_bandwidth_modify (handle, *bandwidth, RAW1394_MODIFY_FREE); - channel = -1; - } - } - } - - } else if (iplug_online > -1) { - // overlay - // get channel from input - *iplug = iplug_online; - if (iec61883_get_iPCRX (handle, input, &ipcr, iplug_online) == 0) { - channel = ipcr.channel; - if (ipcr.bcast_connection != 1) - if (iec61883_cmp_overlay_p2p_input (handle, input, iplug_online) < 0) - channel = -1; - } - WARN ("Overlayed connection on channel %d.\n" - "You may need to manually set the channel on the transmitting node.", - channel); - } else { - WARN ("Receiving node has no plugs online!"); - // failover to broadcast - // allocate bandwidth based upon first input plug - *iplug = -1; - if (!skip_bandwidth) { - *bandwidth = iec61883_cmp_calc_bandwidth (handle, input, 0, impr.data_rate); - if (*bandwidth < 1) { - WARN ("Failed to calculate bandwidth."); - failure = 1; - } else if (raw1394_bandwidth_modify (handle, *bandwidth, RAW1394_MODIFY_ALLOC) < 0) { - WARN ("Failed to allocate bandwidth."); - failure = 1; - } - } - if (!failure) { - if (raw1394_channel_modify (handle, 63, RAW1394_MODIFY_ALLOC) == 0) - channel = 63; - } - } - - } else { - // no input or output plugs - failover broadcast on channel 63 - // not enough information to calculate bandwidth - *oplug = *iplug = -1; - if (raw1394_channel_modify (handle, 63, RAW1394_MODIFY_ALLOC) == 0) - channel = 63; - if (channel == 63) - WARN ("No plugs exist on either node; using default broadcast channel 63."); - } + /* Passing an existing channel means it is a reconnection. */ + return cmp_connect (handle, output, oplug, input, iplug, bandwidth, channel); +} - return channel; +int +iec61883_cmp_connect (raw1394handle_t handle, nodeid_t output, int *oplug, + nodeid_t input, int *iplug, int *bandwidth) +{ + /* Passing "-1" as the channel means it is a new connection. */ + return cmp_connect (handle, output, oplug, input, iplug, bandwidth, -1); } int diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' --exclude Makefile.in --exclude configure --exclude config.guess --exclude '*.pot' --exclude mkinstalldirs --exclude aclocal.m4 --exclude config.sub --exclude depcomp --exclude install-sh --exclude ltmain.sh old/libiec61883-1.1.0/src/dv.c new/libiec61883-1.2.0/src/dv.c --- old/libiec61883-1.1.0/src/dv.c 2006-05-12 07:31:06.000000000 +0200 +++ new/libiec61883-1.2.0/src/dv.c 2009-01-05 00:02:13.000000000 +0100 @@ -182,17 +182,20 @@ assert (dv != NULL); unsigned int max_packet_size = iec61883_cip_get_max_packet_size (&dv->cip); - if ((result = raw1394_iso_xmit_init (dv->handle, + result = raw1394_iso_xmit_init (dv->handle, dv_xmit_handler, - dv->buffer_packets, + dv->buffer_packets, max_packet_size, channel, dv->speed, - dv->irq_interval)) == 0) - + dv->irq_interval); + + if ( result == 0 ) + { dv->total_dropped = 0; dv->channel = channel; result = raw1394_iso_xmit_start (dv->handle, -1, dv->prebuffer_packets); + } return result; } @@ -280,11 +283,12 @@ static int dv_fb_recv (unsigned char *data, int len, unsigned int dropped, void *callback_data) { + int result = 0; + if (len != 480) return result; struct iec61883_dv_fb *fb = (struct iec61883_dv_fb *)callback_data; int section_type = data[0] >> 5; /* section type is in bits 5 - 7 */ int dif_sequence = data[1] >> 4; /* dif sequence number is in bits 4 - 7 */ int dif_block = data[2]; - int result = 0; assert (fb != NULL); /* test for start of frame */ @@ -303,27 +307,28 @@ } } /* if not the first frame */ - if (fb->ff == 0) { + if (fb->ff == 0 && dif_sequence < 12) { + unsigned char *p = fb->data + dif_sequence * 150 * 80; fb->len += len; switch ( section_type ) { case 0: /* 1 Header block */ - memcpy( fb->data + dif_sequence * 150 * 80, data, 480 ); + memcpy( p, data, len ); break; case 1: /* 2 Subcode blocks */ - memcpy( fb->data + dif_sequence * 150 * 80 + - ( 1 + dif_block ) * 80, data, 480 ); + if (dif_block < 2) + memcpy( p + ( 1 + dif_block ) * 80, data, len ); break; case 2: /* 3 VAUX blocks */ - memcpy( fb->data + dif_sequence * 150 * 80 + - ( 3 + dif_block ) * 80, data, 480 ); + if (dif_block < 3) + memcpy( p + ( 3 + dif_block ) * 80, data, len ); break; case 3: /* 9 Audio blocks interleaved with video */ - memcpy( fb->data + dif_sequence * 150 * 80 + - ( 6 + dif_block * 16 ) * 80, data, 480 ); + if (dif_block < 9) + memcpy( p + ( 6 + dif_block * 16 ) * 80, data, len ); break; case 4: /* 135 Video blocks interleaved with audio */ - memcpy( fb->data + dif_sequence * 150 * 80 + - ( 7 + ( dif_block / 15 ) + dif_block ) * 80, data, 480 ); + if (dif_block < 135) + memcpy( p + ( 7 + ( dif_block / 15 ) + dif_block ) * 80, data, len ); break; default: break; diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' --exclude Makefile.in --exclude configure --exclude config.guess --exclude '*.pot' --exclude mkinstalldirs --exclude aclocal.m4 --exclude config.sub --exclude depcomp --exclude install-sh --exclude ltmain.sh old/libiec61883-1.1.0/src/iec61883-private.h new/libiec61883-1.2.0/src/iec61883-private.h --- old/libiec61883-1.1.0/src/iec61883-private.h 2005-07-01 16:59:32.000000000 +0200 +++ new/libiec61883-1.2.0/src/iec61883-private.h 2007-05-15 06:50:29.000000000 +0200 @@ -142,7 +142,6 @@ struct iec61883_fraction samples_per_cycle; int dbc, dbs; int cycle_count; - int cycle_count2; int mode; int syt_interval; int dimension; @@ -154,6 +153,8 @@ void iec61883_cip_init(struct iec61883_cip *cip, int format, int fdf, int rate, int dbs, int syt_interval); +void +iec61883_cip_resync(struct iec61883_cip *ptz, int cycle); void iec61883_cip_set_transmission_mode(struct iec61883_cip *ptz, int mode); @@ -234,6 +235,7 @@ int rate; int iec958_rate_code; int sample_format; + int iec958_frame_count; iec61883_amdtp_recv_t put_data; iec61883_amdtp_xmit_t get_data; void *callback_data; diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' --exclude Makefile.in --exclude configure --exclude config.guess --exclude '*.pot' --exclude mkinstalldirs --exclude aclocal.m4 --exclude config.sub --exclude depcomp --exclude install-sh --exclude ltmain.sh old/libiec61883-1.1.0/src/iec61883.h new/libiec61883-1.2.0/src/iec61883.h --- old/libiec61883-1.1.0/src/iec61883.h 2005-10-25 20:41:47.000000000 +0200 +++ new/libiec61883-1.2.0/src/iec61883.h 2007-05-15 06:50:29.000000000 +0200 @@ -88,11 +88,11 @@ * 0 for success or -1 for failure */ typedef int -(*iec61883_amdtp_recv_t) (iec61883_amdtp_t amdtp, char *data, int nsamples, +(*iec61883_amdtp_recv_t) (iec61883_amdtp_t amdtp, unsigned char *data, int nsamples, unsigned int dbc, unsigned int dropped, void *callback_data); typedef int -(*iec61883_amdtp_xmit_t) (iec61883_amdtp_t amdtp, char *data, int nevents, +(*iec61883_amdtp_xmit_t) (iec61883_amdtp_t amdtp, unsigned char *data, int nevents, unsigned int dbc, unsigned int dropped, void *callback_data); /** diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' --exclude Makefile.in --exclude configure --exclude config.guess --exclude '*.pot' --exclude mkinstalldirs --exclude aclocal.m4 --exclude config.sub --exclude depcomp --exclude install-sh --exclude ltmain.sh old/libiec61883-1.1.0/src/tsbuffer.c new/libiec61883-1.2.0/src/tsbuffer.c --- old/libiec61883-1.1.0/src/tsbuffer.c 2004-12-20 04:30:44.000000000 +0100 +++ new/libiec61883-1.2.0/src/tsbuffer.c 2008-02-02 21:42:08.000000000 +0100 @@ -120,7 +120,7 @@ u8 data[ 176 ]; }; -static u8 +static int ts_get_pid( struct mpeg2_ts *ts ) { return ( ( ts->ts_header[ 1 ] << 8 ) + ts->ts_header[ 2 ] ) & 0x1fff; @@ -261,7 +261,7 @@ if (tsbuffer_read_ts (this) == 0) return 0; - if (this->selected_pid == -1) + if (this->selected_pid == -1 && ts_has_pcr(iec61883_deque_back (this->ts_queue), -1)) this->selected_pid = ts_get_pid (iec61883_deque_back (this->ts_queue)); } while (ts_has_pcr (iec61883_deque_back (this->ts_queue), this->selected_pid) == 0); -- To unsubscribe, e-mail: opensuse-commit+unsubscr...@opensuse.org For additional commands, e-mail: opensuse-commit+h...@opensuse.org