commit dvgrab for openSUSE:Factory
Hello community, here is the log from the commit of package dvgrab for openSUSE:Factory checked in at Thu Apr 22 10:28:04 CEST 2010. -------- --- dvgrab/dvgrab.changes 2009-06-09 14:50:45.000000000 +0200 +++ /mounts/work_src_done/STABLE/dvgrab/dvgrab.changes 2010-04-22 08:51:21.000000000 +0200 @@ -1,0 +2,30 @@ +Thu Apr 22 06:42:20 UTC 2010 - davejplater@gmail.com + +- Fix url in spec file +- Changes in version 3.5 :- + * Automatically detect DV vs. HDV when not using -noavc, -input, or -stdin. + * Now waits indefinitely for DV or HDV instead of giving up after 10 seconds. + * Bugfixes see ChangeLog file. +- Changes in version 3.4 + * Fix a showstopping bug in the v3.3 release. +- Changes in version 3.3 + * Give different warnings for dropped versus damaged frames. + * Bugfixes see ChangeLog file. + +------------------------------------------------------------------- +Sat Jan 23 21:14:17 UTC 2010 - jw@novell.com + +- pulled from home:Freespacer:kino +- tested, looks good. + +------------------------------------------------------------------- +Tue Jan 5 21:00:00 CEST 2010 - freespacer@gmx.de + +- update to 3.5 + +------------------------------------------------------------------- +Sat Sep 5 00:11:06 CEST 2009 - jslaby@suse.de + +- update to 3.4 + +------------------------------------------------------------------- calling whatdependson for head-i586 Old: ---- dvgrab-3.2-no-return-in-nonvoid-function.patch dvgrab-3.2.tar.bz2 New: ---- dvgrab-3.5.tar.bz2 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Other differences: ------------------ ++++++ dvgrab.spec ++++++ --- /var/tmp/diff_new_pack.dhVy3W/_old 2010-04-22 10:27:14.000000000 +0200 +++ /var/tmp/diff_new_pack.dhVy3W/_new 2010-04-22 10:27:14.000000000 +0200 @@ -1,7 +1,7 @@ # -# spec file for package dvgrab (Version 3.2) +# spec file for package dvgrab (Version 3.5) # -# Copyright (c) 2009 SUSE LINUX Products GmbH, Nuernberg, Germany. +# Copyright (c) 2010 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 @@ -20,16 +20,15 @@ Name: dvgrab BuildRequires: gcc-c++ libiec61883-devel libjpeg-devel libquicktime-devel pkgconfig -Url: http://kino.schirmacher.de/ -License: GPL v2 or later +Url: http://www.kinodv.org/ +License: GPLv2+ Group: Productivity/Multimedia/CD/Grabbers AutoReqProv: on -Version: 3.2 -Release: 2 +Version: 3.5 +Release: 1 Summary: Record Digital Video (DV) via an IEEE 1394 (Firewire) Interface BuildRoot: %{_tmppath}/%{name}-%{version}-build Source: %{name}-%{version}.tar.bz2 -Patch0: dvgrab-3.2-no-return-in-nonvoid-function.patch Patch1: dvgrab-3.2-gcc44.patch %description @@ -38,15 +37,13 @@ file. It features autosplit of long video sequences into several files and supports saving the data as raw frames, AVI type 1, and AVI type 2. - - Authors: -------- Arne Schirmacher <dvgrab@schirmacher.de> + Dan Dennedy <dan@dennedy.org> %prep %setup -q -%patch0 %patch1 -p1 %build ++++++ dvgrab-3.2.tar.bz2 -> dvgrab-3.5.tar.bz2 ++++++ ++++ 12818 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/dvgrab-3.2/ChangeLog new/dvgrab-3.5/ChangeLog --- old/dvgrab-3.2/ChangeLog 2008-08-05 07:27:56.000000000 +0200 +++ new/dvgrab-3.5/ChangeLog 2009-09-08 05:55:53.000000000 +0200 @@ -1,9 +1,79 @@ -dvgrab +dvgrab ChangeLog (c) 2000-2003 Arne Schirmacher dvgrab@schirmacher.de -(c) 2002-2007 Dan Dennedy <dan@dennedy.org> +(c) 2002-2009 Dan Dennedy <dan@dennedy.org> SEE the NEWS file for RELEASE NOTES! +----- v3.5 released ----- + +2009-09-07 Dan Dennedy <dan@dennegy.org> + - iec13818-1.{h,cc}, iec13818-2.{h,cc}: apply patch from Arren to remove + compiler warnings (2804114). + - filehandler.cc: apply fix to undefined return value in + QtHandler::GetFileSize() from Arren (2813664). + - dvgrab.cc: remove (H)DV timeout and replace with "Waiting" message per + Carl Karsten's suggestion. + - filehandler.cc: apply patch from Marcel Mol to allow both -timecode + and -timestamp or -timesys (2706278). + - ieee1394io.cc: fix deadlock on SIGINT/SIGTERM with -stdin + or -input(2460025). + +2009-04-10 Dan Dennedy <dan@dennegy.org> + - main.cc: apply patch from Jarod Wilson to set retval to 1 if we get + an error, to make life easier for folks who wrap dvgrab to tell if + something went wrong (rhbz #486061). + - error.cc, smiltime.cc: apply patch from Jarod Wilson to fix build + on gcc 4.4. + - ieee1394io.{h,cc}: added AVC:isHDV(). + - dvgrab.cc: try to automatically detect HDV devices and set file format. + +----- v3.4 released ----- + +2009-02-14 Dan Dennedy <dan@dennegy.org> + - main.cc: bugfix failure to start due to regression in 3.3. + +----- v3.3 released ----- + +2009-01-14 Dan Dennedy <dan@dennedy.org> + - ieee1394io.{h,cc}, dvgrab.{h,cc}: separate the warnings for dropped + versus damaged frames. + - main.cc: silence warnings about inability to change scheduling class + and lock memory. + - ieee1394io.cc: return false on invalid timecode in AVC::Timecode(). + - io.c: read terminal every 125ms instead of 1s. + - dvgrab.cc: in interactive mode display invalid timecode as + "--:--:--:--" instead of "ff:ff:ff:ff" and suppress filename when + no capture is in progress instead of displaying "stdout". + - dvgrab.cc: reduce the frequency of AVC::TransportStatus calls making + it consistently every ~125ms. + - filehandler.cc: remove "deprecated conversion from string constant" + warnings. + - dvgrab.{cc,1}: add 'avi' as alias for dv2 and 'mov' as alias for qt. + +2009-01-04 Dan Dennedy <dan@dennedy.org> + - dvframe.cc, filehandler.cc: bugfix compilation errors when not using + libdv due to missing includes. + +2008-11-25 Dan Dennedy <dan@dennedy.org> + - v4l2reader.cc: bugfix (2337246) hang on interrupting capture with no + valid data received. Also, bugfix double free on exit. + - most files: updated copyrights. + - dvgrab.1: fix (2313429) missing hyphens. + +2008-11-19 Dan Dennedy <dan@dennedy.org> + - dvgrab.cc: bugfix (2313380) premature exit/stop capture when using + live/record mode - this time to cover more use cases. + +2008-11-18 Dan Dennedy <dan@dennedy.org> + - dvgrab.cc: bugfix (2313380) premature exit/stop capture when using + live/record mode on device instead of VCR and not using -record + option. + +2008-11-09 Dan Dennedy <dan@dennedy.org> + - filehandler.cc: bugfix -timestamp option not putting file extension + on filename. + + ----- v3.2 released ----- 2008-08-04 Dan Dennedy <dan@dennedy.org> 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/dvgrab-3.2/NEWS new/dvgrab-3.5/NEWS --- old/dvgrab-3.2/NEWS 2008-08-05 07:26:18.000000000 +0200 +++ new/dvgrab-3.5/NEWS 2009-09-08 05:58:30.000000000 +0200 @@ -1,5 +1,22 @@ -R E L E A S E N O T E S +dvgrab R E L E A S E N O T E S +------- +v3.5 +------- +* Automatically detect DV vs. HDV when not using -noavc, -input, or -stdin. +* Now waits indefinitely for DV or HDV instead of giving up after 10 seconds. +* Bugfixes + +------- +v3.4 +------- +* Fix a showstopping bug in the v3.3 release + +------- +v3.3 +------- +* Give different warnings for dropped versus damaged frames +* Bugfixes ------- v3.2 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/dvgrab-3.2/README new/dvgrab-3.5/README --- old/dvgrab-3.2/README 2007-07-06 20:49:26.000000000 +0200 +++ new/dvgrab-3.5/README 2008-11-26 04:37:48.000000000 +0100 @@ -1,6 +1,6 @@ dvgrab (C) 2000-2004 Arne Schirmacher <dvgrab@schirmacher.de> -(C) 2002-2007 Dan Dennedy <dan@dennedy.org> +(C) 2002-2008 Dan Dennedy <dan@dennedy.org> (C) 2007 Dan Streetman <ddstreet@ieee.org> dvgrab website: http://www.kinodv.org/ 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/dvgrab-3.2/config.h.in new/dvgrab-3.5/config.h.in --- old/dvgrab-3.2/config.h.in 2008-07-25 03:52:15.000000000 +0200 +++ new/dvgrab-3.5/config.h.in 2009-09-08 04:39:41.000000000 +0200 @@ -1,5 +1,8 @@ /* config.h.in. Generated from configure.in by autoheader. */ +/* Define if building universal (internal helper macro) */ +#undef AC_APPLE_UNIVERSAL_BUILD + /* Define to 1 if you have the <fcntl.h> header file. */ #undef HAVE_FCNTL_H @@ -75,6 +78,9 @@ /* Define to the one symbol short name of this package. */ #undef PACKAGE_TARNAME +/* Define to the home page for this package. */ +#undef PACKAGE_URL + /* Define to the version of this package. */ #undef PACKAGE_VERSION @@ -91,11 +97,15 @@ #undef VERSION /* Define WORDS_BIGENDIAN to 1 if your processor stores words with the most - significant byte first (like Motorola and SPARC, unlike Intel and VAX). */ -#if defined __BIG_ENDIAN__ -# define WORDS_BIGENDIAN 1 -#elif ! defined __LITTLE_ENDIAN__ -# undef WORDS_BIGENDIAN + 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 /* Define to empty if `const' does not conform to ANSI C. */ 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/dvgrab-3.2/configure.in new/dvgrab-3.5/configure.in --- old/dvgrab-3.2/configure.in 2008-07-25 03:51:55.000000000 +0200 +++ new/dvgrab-3.5/configure.in 2009-04-11 05:59:22.000000000 +0200 @@ -1,6 +1,6 @@ dnl Process this file with autoconf to produce a configure script. AC_PREREQ(2.52) -AC_INIT(dvgrab, 3.2, http://sourceforge.net/tracker/?atid=114103&group_id=14103) +AC_INIT(dvgrab, 3.5, http://sourceforge.net/tracker/?atid=114103&group_id=14103) AM_INIT_AUTOMAKE(AC_PACKAGE_NAME, AC_PACKAGE_VERSION) AM_CONFIG_HEADER(config.h) AM_MAINTAINER_MODE 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/dvgrab-3.2/dvframe.cc new/dvgrab-3.5/dvframe.cc --- old/dvgrab-3.2/dvframe.cc 2008-07-03 07:12:09.000000000 +0200 +++ new/dvgrab-3.5/dvframe.cc 2009-01-04 22:16:08.000000000 +0100 @@ -25,7 +25,9 @@ \file dvframe.cc */ +#include <stdlib.h> #include <string.h> +#include <stdlib.h> #include "dvframe.h" VideoInfo::VideoInfo() : width( 0 ), height( 0 ), isPAL( false ) 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/dvgrab-3.2/dvgrab.1 new/dvgrab-3.5/dvgrab.1 --- old/dvgrab-3.2/dvgrab.1 2008-08-05 07:15:55.000000000 +0200 +++ new/dvgrab-3.5/dvgrab.1 2009-01-15 09:07:21.000000000 +0100 @@ -168,7 +168,7 @@ This option tells \fBdvgrab\fP to write every \fIn\fP'th frame only (default all frames). -.IP "\fB-f, -format \fIdv1\fP | \fIdv2\fP | \fIraw\fP | \fIdif\fP | \fIqt\fP | \fIjpeg\fP | \fIjpg\fP | \fImpeg2\fP | \fIhdv\fP\fP" 10 +.IP "\fB-f, -format \fIdv1\fP | \fIdv2\fP | \fIavi\fP | \fIraw\fP | \fIdif\fP | \fIqt\fP | \fImov\fP | \fIjpeg\fP | \fIjpg\fP | \fImpeg2\fP | \fIhdv\fP\fP" 10 Specifies the format of the output file(s). File format can also be determined if you include an extension on the \fIbase\fP name. The following extensions are recognizable: avi, dv, dif, mov, jpg, jpeg, and m2t (HDV). @@ -226,7 +226,7 @@ especially handy with MPEG2-TS settop boxes, which typically require a connection management procedure to start transmitting. -.IP "\fB-h, help\fP" 10 +.IP "\fB-h, -help\fP" 10 Show summary of options. .IP "\fB-I, -input \fIfile\fP\fP" 10 @@ -369,7 +369,7 @@ The default device file is /dev/video. Use the \fB-input\fP option to set a different device file. -.IP "\fB-v, version\fP" 10 +.IP "\fB-v, -version\fP" 10 Show version of program. .IP "\fB-24p\fP" 10 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/dvgrab-3.2/dvgrab.cc new/dvgrab-3.5/dvgrab.cc --- old/dvgrab-3.2/dvgrab.cc 2008-08-05 07:21:02.000000000 +0200 +++ new/dvgrab-3.5/dvgrab.cc 2009-09-08 05:42:33.000000000 +0200 @@ -1,6 +1,6 @@ /* * dvgrab.cc -- DVGrab control class -* Copyright (C) 2003 Dan Dennedy <dan@dennedy.org> +* Copyright (C) 2003-2009 Dan Dennedy <dan@dennedy.org> * Major rewrite of code based upon older versions of dvgrab by Arne Schirmacher * and some Kino code also contributed by Charles Yates. * @@ -69,7 +69,7 @@ m_file_format( DEFAULT_FORMAT ), m_open_dml( false ), m_frame_every( DEFAULT_EVERY ), m_jpeg_quality( 75 ), m_jpeg_deinterlace( false ), m_jpeg_width( -1 ), m_jpeg_height( -1 ), m_jpeg_overwrite( false ), m_jpeg_temp( "dvtmp.jpg" ), m_jpeg_usetemp( false ), - m_dropped_frames( 0 ), m_interactive( false ), m_buffers( DEFAULT_BUFFERS ), m_total_frames( 0 ), + m_dropped_frames( 0 ), m_bad_frames(0), m_interactive( false ), m_buffers( DEFAULT_BUFFERS ), m_total_frames( 0 ), m_duration( "" ), m_timeDuration( 0 ), m_noavc( false ), m_guid( 0 ), m_timesys( false ), m_connection( 0 ), m_raw_pipe( false ), m_no_stop( false ), m_timecode( false ), m_lockstep( false ), m_lockPending( false ), @@ -119,6 +119,11 @@ throw std::string( "failed to initialize AV/C" ); if ( m_interactive ) m_avc->Pause( m_node ); + if ( m_avc->isHDV( m_node ) ) + { + m_file_format = MPEG2TS_FORMAT; + m_hdv = true; + } } if ( m_guid ) @@ -193,9 +198,9 @@ cerr << " raw raw DV file with a .dv extension" << endl; cerr << " dif raw DV file with a .dif extension" << endl; cerr << " dv1 'Type 1' DV AVI file" << endl; - cerr << " dv2 'Type 2' DV AVI file" << endl; + cerr << " dv2, avi 'Type 2' DV AVI file" << endl; #ifdef HAVE_LIBQUICKTIME - cerr << " qt QuickTime DV movie" << endl; + cerr << " qt, mov QuickTime DV movie" << endl; #endif cerr << " mpeg2, hdv MPEG-2 transport stream (HDV)" << endl; #if defined(HAVE_LIBJPEG) && defined(HAVE_LIBDV) @@ -254,11 +259,11 @@ { if ( strcmp( "dv1", format ) == 0 ) m_file_format = AVI_DV1_FORMAT; - else if ( strcmp( "dv2", format ) == 0 ) + else if ( strcmp( "dv2", format ) == 0 || strcmp( "avi", format ) == 0 ) m_file_format = AVI_DV2_FORMAT; else if ( strcmp( "raw", format ) == 0 ) m_file_format = RAW_FORMAT; - else if ( strcmp( "qt", format ) == 0 ) + else if ( strcmp( "qt", format ) == 0 || strcmp( "mov", format ) == 0 ) m_file_format = QT_FORMAT; else if ( strcmp( "dif", format ) == 0 ) m_file_format = DIF_FORMAT; @@ -510,8 +515,6 @@ void DVgrab::startCapture() { - int tryCounter = 400; - if ( m_dst_file_name ) { pthread_mutex_lock( &capture_mutex ); @@ -593,20 +596,24 @@ AVC1394_MASK_RESPONSE_OPERAND( m_avc->TransportStatus( m_node ), 3 ) != AVC1394_VCR_OPERAND_WIND_STOP ) { - timespec t = {0, 25000000UL}; + timespec t = {0, 125000000L}; nanosleep( &t, NULL ); } // Rewind if ( !g_done ) + { m_avc->Rewind( m_node ); + timespec t = {0, 125000000L}; + nanosleep( &t, NULL ); + } // Wait until is done rewinding while ( !g_done && AVC1394_MASK_RESPONSE_OPERAND( m_avc->TransportStatus( m_node ), 3 ) != AVC1394_VCR_OPERAND_WIND_STOP ) { - timespec t = {0, 25000000UL}; + timespec t = {0, 125000000L}; nanosleep( &t, NULL ); } } @@ -616,17 +623,18 @@ m_avc->Play( m_node ); } - // Wait up to N seconds to see if we got any data + sendEvent( "Waiting for %s...", m_hdv ? "HDV" : "DV" ); + // this is a little unclean, checking global g_done from main.cc to allow interruption - while ( !g_done && m_frame == NULL && tryCounter-- > 0 ) + while ( !g_done && m_frame == NULL ) { - timespec t = {0, 25000000UL}; + timespec t = {0, 25000000L}; nanosleep( &t, NULL ); } - // OK, we have data, commence capture if ( !g_done && m_frame ) { + // OK, we have data, commence capture sendEvent( "Capture Started" ); m_captureActive = true; m_total_frames = 0; @@ -638,10 +646,9 @@ if ( m_dst_file_name ) pthread_mutex_unlock( &capture_mutex ); } - - // No data received in N seconds, throw an error - else if ( !g_done ) + else { + // No data received, throw an error if ( m_dst_file_name ) pthread_mutex_unlock( &capture_mutex ); const char *err = m_hdv ? "no HDV. Try again before giving up." : "no DV"; @@ -649,11 +656,6 @@ reset_bus( m_port ); throw std::string( err ); } - else - { - if ( m_dst_file_name ) - pthread_mutex_unlock( &capture_mutex ); - } } @@ -696,7 +698,10 @@ if ( m_dropped_frames > 0 ) sendEvent( "Warning: %d dropped frames.", m_dropped_frames ); + if ( m_bad_frames > 0 ) + sendEvent( "Warning: %d damaged frames.", m_bad_frames ); m_dropped_frames = 0; + m_bad_frames = 0; m_captureActive = false; } pthread_mutex_unlock( &capture_mutex ); @@ -891,6 +896,9 @@ if ( m_dropped_frames > 0 ) sendEvent( "Warning: %d dropped frames.", m_dropped_frames ); m_dropped_frames = 0; + if ( m_bad_frames > 0 ) + sendEvent( "Warning: %d damaged frames.", m_bad_frames ); + m_bad_frames = 0; } else if ( m_showstatus ) { @@ -944,7 +952,7 @@ sprintf( rd, "????.??.?? ??:??:??" ); sendEvent( "\n\a\"%s\": %s: timecode %s date %s", - m_writer ? m_writer->GetFileName().c_str() : "stdout", reason, tc, rd ); + m_writer ? m_writer->GetFileName().c_str() : "", reason, tc, rd ); sendEvent( meaning ); } @@ -962,6 +970,7 @@ m_reader->WaitForAction( ); int dropped = m_reader->GetDroppedFrames(); + int badFrames = m_reader->GetBadFrames(); // Get the next frame if ( ( m_frame = m_reader->GetFrame() ) == NULL ) @@ -996,7 +1005,12 @@ m_dropped_frames = 0; } } - + } + if ( badFrames > 0 ) + { + m_bad_frames += badFrames; + sendFrameDroppedStatus( "damaged frame near", + "This means that there were missing or invalid FireWire packets." ); } if ( ! m_frame->IsComplete() ) @@ -1038,7 +1052,7 @@ !m_avc || !m_isRecordMode || ( m_isRecordMode && - strcmp( avc1394_vcr_decode_status( m_avc->TransportStatus( m_node ) ), "Recording" ) == 0 && + strcmp( avc1394_vcr_decode_status( m_transportStatus ), "Recording" ) == 0 && !( timeCode.hour == 0 && timeCode.min == 0 && timeCode.sec == 0 && timeCode.frame == 0 ) ) ) @@ -1074,7 +1088,7 @@ unsigned int status; static unsigned int prevStatus = 0; std::string transportStatus( "" ); - std::string timecode( "" ); + std::string timecode( "--:--:--:--" ); std::string filename( "" ); std::string duration( "" ); @@ -1268,9 +1282,8 @@ { if ( ! m_avc ) return false; - unsigned int status = m_avc->TransportStatus( m_node ); - quadlet_t resp2 = AVC1394_MASK_RESPONSE_OPERAND( status, 2 ); - quadlet_t resp3 = AVC1394_MASK_RESPONSE_OPERAND( status, 3 ); + quadlet_t resp2 = AVC1394_MASK_RESPONSE_OPERAND( m_transportStatus, 2 ); + quadlet_t resp3 = AVC1394_MASK_RESPONSE_OPERAND( m_transportStatus, 3 ); return ( ( resp2 == AVC1394_VCR_RESPONSE_TRANSPORT_STATE_PLAY && resp3 != AVC1394_VCR_OPERAND_PLAY_FORWARD_PAUSE ) || ( resp2 == AVC1394_VCR_RESPONSE_TRANSPORT_STATE_RECORD && resp3 != AVC1394_VCR_OPERAND_RECORD_PAUSE ) ); } @@ -1280,13 +1293,15 @@ if ( m_reader_active ) { // Stop capture at end of tape - if ( !m_interactive && m_writer && m_writer->GetFileSize() > 0 && m_avc && - AVC1394_MASK_RESPONSE_OPERAND( m_avc->TransportStatus( m_node ), 3 ) == AVC1394_VCR_OPERAND_WIND_STOP ) + if ( !m_interactive && m_writer && m_writer->GetFileSize() > 0 && m_avc && !m_isRecordMode ) { + m_transportStatus = m_avc->TransportStatus( m_node ); + if ( AVC1394_MASK_RESPONSE_OPERAND( m_transportStatus, 3 ) == AVC1394_VCR_OPERAND_WIND_STOP + && AVC1394_MASK_OPCODE( m_transportStatus ) == AVC1394_VCR_RESPONSE_TRANSPORT_STATE_WIND ) return true; } - timespec t = {0, 25000000}; + timespec t = {0, 125000000L}; return ( nanosleep( &t, NULL ) == -1 ); } return true; 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/dvgrab-3.2/dvgrab.h new/dvgrab-3.5/dvgrab.h --- old/dvgrab-3.2/dvgrab.h 2008-08-05 07:21:32.000000000 +0200 +++ new/dvgrab-3.5/dvgrab.h 2009-01-15 05:55:35.000000000 +0100 @@ -1,6 +1,6 @@ /* * dvgrab.h -- DVGrab control class -* Copyright (C) 2003 Dan Dennedy <dan@dennedy.org> +* Copyright (C) 2003-2008 Dan Dennedy <dan@dennedy.org> * * 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 @@ -84,6 +84,7 @@ int m_jpeg_usetemp; int m_jpeg_overwrite; int m_dropped_frames; + int m_bad_frames; bool m_interactive; int m_buffers; int m_total_frames; 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/dvgrab-3.2/error.cc new/dvgrab-3.5/error.cc --- old/dvgrab-3.2/error.cc 2007-07-06 21:04:24.000000000 +0200 +++ new/dvgrab-3.5/error.cc 2009-04-11 06:09:09.000000000 +0200 @@ -32,6 +32,7 @@ #include <iostream> #include <sstream> #include <iomanip> +#include <cstdio> using std::ostringstream; using std::string; 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/dvgrab-3.2/filehandler.cc new/dvgrab-3.5/filehandler.cc --- old/dvgrab-3.2/filehandler.cc 2008-08-01 06:50:50.000000000 +0200 +++ new/dvgrab-3.5/filehandler.cc 2009-09-08 05:17:40.000000000 +0200 @@ -1,7 +1,7 @@ /* * filehandler.cc -- saving DV data into different file formats * Copyright (C) 2000 Arne Schirmacher <arne@schirmacher.de> -* Raw DV, JPEG, and Quicktime portions Copyright (C) 2003 Dan Dennedy <dan@dennedy.org> +* Raw DV, JPEG, and Quicktime portions Copyright (C) 2003-2008 Dan Dennedy <dan@dennedy.org> * Portions of Quicktime code borrowed from Arthur Peters' dv_utils. * * This program is free software; you can redistribute it and/or modify @@ -44,6 +44,7 @@ #include <time.h> #include <errno.h> #include <string.h> +#include <stdlib.h> #include "filehandler.h" #include "error.h" @@ -380,75 +381,66 @@ { static int counter = 0; + ostringstream stimestamp, stimecode; prevTimeCode.sec = -1; - if ( GetTimeStamp() ) + if ( GetTimeStamp() || GetTimeSys() ) { - ostringstream sb, sb2; struct tm date; - string recDate; - if ( frame->GetRecordingDate( date ) ) + if ( ( GetTimeStamp() && ! frame->GetRecordingDate( date ) ) || GetTimeSys() ) { - sb << setfill( '0' ) + time_t timesys; + + time( ×ys ); + localtime_r( ×ys, &date ); + } + + stimestamp << setfill( '0' ) << setw( 4 ) << date.tm_year + 1900 << '.' << setw( 2 ) << date.tm_mon + 1 << '.' << setw( 2 ) << date.tm_mday << '_' << setw( 2 ) << date.tm_hour << '-' << setw( 2 ) << date.tm_min << '-' - << setw( 2 ) << date.tm_sec << ends; - recDate = sb.str(); - } - else - { - goto TimeSys; - } - sb2 << GetBaseName() << recDate << GetExtension() << ends; - filename = sb2.str(); + << setw( 2 ) << date.tm_sec; } - else if ( GetTimeSys() ) - { -TimeSys: - ostringstream sb; - time_t timesys; - struct tm date; - - time( ×ys ); - localtime_r( ×ys, &date ); - - sb << GetBaseName() - << setfill( '0' ) - << setw( 4 ) << date.tm_year + 1900 << '.' - << setw( 2 ) << date.tm_mon + 1 << '.' - << setw( 2 ) << date.tm_mday << '_' - << setw( 2 ) << date.tm_hour << '-' - << setw( 2 ) << date.tm_min << '-' - << setw( 2 ) << date.tm_sec - << GetExtension() << ends; - filename = sb.str(); - } - else if ( GetTimeCode() ) + + if ( GetTimeCode() ) { - ostringstream sb; TimeCode tc; if ( frame->GetTimeCode( tc ) ) { - sb << GetBaseName() - << setfill( '0' ) - << setw( 2 ) << tc.hour << ':' - << setw( 2 ) << tc.min << ':' - << setw( 2 ) << tc.sec << ':' - << setw( 2 ) << tc.frame - << GetExtension(); + stimecode << setfill( '0' ) + << setw( 2 ) << tc.hour << ':' + << setw( 2 ) << tc.min << ':' + << setw( 2 ) << tc.sec << ':' + << setw( 2 ) << tc.frame; } else { - sb << GetBaseName() - << "EE:EE:EE:EE" - << GetExtension(); + stimecode << "EE:EE:EE:EE"; } - sb << ends; + } + + if ( GetTimeStamp() || GetTimeSys() || GetTimeCode() ) + { + ostringstream sb; + + sb << GetBaseName(); + if ( ( GetTimeStamp() || GetTimeSys() ) && GetTimeCode() ) + { + sb << stimestamp.str() << "--" << stimecode.str(); + } + else if ( GetTimeCode() ) + { + sb << stimecode.str(); + } + else + { + sb << stimestamp.str(); + } + sb << GetExtension() << ends; filename = sb.str(); } else @@ -898,9 +890,10 @@ if ( frame->GetAudioInfo( audio ) ) { /* TODO: handle 12-bit, non-linear audio */ + char compressor[] = QUICKTIME_TWOS; channels = 2; quicktime_set_audio( fd, channels, audio.frequency, 16, - QUICKTIME_TWOS ); + compressor ); } else { @@ -909,12 +902,14 @@ if ( filmRate || remove2332 ) { - quicktime_set_video( fd, 1, 720, 480, 24, QUICKTIME_DV ); + char compressor[] = QUICKTIME_DV; + quicktime_set_video( fd, 1, 720, 480, 24, compressor ); } else { + char compressor[] = QUICKTIME_DV; quicktime_set_video( fd, 1, 720, frame->IsPAL() ? 576 : 480, - frame->GetFrameRate(), QUICKTIME_DV ); + frame->GetFrameRate(), compressor ); } if ( channels > 0 ) @@ -1015,8 +1010,7 @@ if ( stat( filename.c_str(), &file_status ) == 0 ) return file_status.st_size; } - else - return 0; + return 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/dvgrab-3.2/filehandler.h new/dvgrab-3.5/filehandler.h --- old/dvgrab-3.2/filehandler.h 2008-08-01 05:58:59.000000000 +0200 +++ new/dvgrab-3.5/filehandler.h 2009-05-13 08:41:05.000000000 +0200 @@ -1,7 +1,7 @@ /* * filehandler.h * Copyright (C) 2000 Arne Schirmacher <arne@schirmacher.de> -* Raw DV, JPEG, and Quicktime portions Copyright (C) 2003 Dan Dennedy <dan@dennedy.org> +* Raw DV, JPEG, and Quicktime portions Copyright (C) 2003-2008 Dan Dennedy <dan@dennedy.org> * Portions of Quicktime code borrowed from Arthur Peters' dv_utils. * * This program is free software; you can redistribute it and/or modify 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/dvgrab-3.2/iec13818-1.cc new/dvgrab-3.5/iec13818-1.cc --- old/dvgrab-3.2/iec13818-1.cc 2008-02-27 04:30:23.000000000 +0100 +++ new/dvgrab-3.5/iec13818-1.cc 2009-09-08 04:41:56.000000000 +0200 @@ -207,7 +207,7 @@ unsigned char PAT::section_number() { return GetBits( 48, 8 ); } unsigned char PAT::last_section_number() { return GetBits( 56, 8 ); } -#define NUM_PROGRAMS ( ( section_length() - 9 ) / 4 ) +#define NUM_PROGRAMS ( ( section_length() - 9U ) / 4U ) int PAT::program_number( unsigned int n ) { @@ -227,7 +227,7 @@ int PAT::network_PID() { - for ( int n = 0; n < NUM_PROGRAMS; n++ ) + for ( unsigned int n = 0; n < NUM_PROGRAMS; n++ ) { if ( program_number( n ) == 0 ) return pid( n ); @@ -238,7 +238,7 @@ int PAT::program_map_PID() { - for ( int n = 0; n < NUM_PROGRAMS; n++ ) + for ( unsigned int n = 0; n < NUM_PROGRAMS; n++ ) { if ( program_number( n ) != 0 ) return pid( n ); @@ -279,7 +279,7 @@ last_section_number() ); - for ( int n = 0; n < NUM_PROGRAMS; n++ ) + for ( unsigned int n = 0; n < NUM_PROGRAMS; n++ ) DEBUG_RAW( d_hdv_pat, " PROG_NUM=%04x,PID=%04x", program_number( n ), pid( n ) ); DEBUG_PARAMS( d_hdv_pat, 0, 1, "" ); @@ -302,7 +302,7 @@ { int start = 5; - for ( int i = 0, j = 0; i < ES_info_length(); i += data[start+i+1]+2, j++ ) + for ( unsigned int i = 0, j = 0; i < ES_info_length(); i += data[start+i+1]+2, j++ ) if ( j == n ) return &data[start+i]; @@ -356,7 +356,7 @@ ////////////// /// PMT packet -PMT::PMT() : nPmtElements( 0 ), length( 0 ) +PMT::PMT() : length( 0 ), nPmtElements( 0 ) { } @@ -379,7 +379,7 @@ { int start = 12; - for ( int i = 0, j = 0; i < program_info_length(); i += data[start+i+1]+2, j++ ) + for ( unsigned int i = 0, j = 0; i < program_info_length(); i += data[start+i+1]+2, j++ ) if ( j == n ) return &data[start+i]; @@ -419,7 +419,7 @@ { int start = 12 + program_info_length(); int end = 3 + section_length() - 4; - int i, j; + int i; nPmtElements = 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/dvgrab-3.2/iec13818-1.h new/dvgrab-3.5/iec13818-1.h --- old/dvgrab-3.2/iec13818-1.h 2007-07-06 21:04:24.000000000 +0200 +++ new/dvgrab-3.5/iec13818-1.h 2009-09-08 04:41:13.000000000 +0200 @@ -156,7 +156,7 @@ #define MAX_PMT_ELEMENTS 32 PMT_element pmtElement[MAX_PMT_ELEMENTS]; - int nPmtElements; + unsigned int nPmtElements; }; 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/dvgrab-3.2/iec13818-2.cc new/dvgrab-3.5/iec13818-2.cc --- old/dvgrab-3.2/iec13818-2.cc 2007-11-22 05:07:44.000000000 +0100 +++ new/dvgrab-3.5/iec13818-2.cc 2009-09-08 04:41:13.000000000 +0200 @@ -1331,7 +1331,7 @@ } bool Slice::extra_bit_slice( unsigned int n ) { - int p = 0; + unsigned int p = 0; int bits = 32; if ( video->width > 2800 ) @@ -1357,7 +1357,7 @@ } unsigned char Slice::extra_information_slice( unsigned int n ) { - int p = 0; + unsigned int p = 0; int bits = 32; if ( video->width > 2800 ) 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/dvgrab-3.2/iec13818-2.h new/dvgrab-3.5/iec13818-2.h --- old/dvgrab-3.2/iec13818-2.h 2007-11-02 04:47:05.000000000 +0100 +++ new/dvgrab-3.5/iec13818-2.h 2009-09-08 04:41:13.000000000 +0200 @@ -93,7 +93,7 @@ { public: VideoSection( Video *video ); - ~VideoSection(); + virtual ~VideoSection(); virtual void Clear(); virtual void SetOffset( int o ); 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/dvgrab-3.2/ieee1394io.cc new/dvgrab-3.5/ieee1394io.cc --- old/dvgrab-3.2/ieee1394io.cc 2008-07-22 06:44:56.000000000 +0200 +++ new/dvgrab-3.5/ieee1394io.cc 2009-09-08 05:45:34.000000000 +0200 @@ -1,6 +1,7 @@ /* * ieee1394io.cc -- asynchronously grabbing DV data * Copyright (C) 2000 Arne Schirmacher <arne@schirmacher.de> +* Copyright (C) 2003-2009 Dan Dennedy <dan@dennedy.org> * * 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 @@ -90,6 +91,7 @@ IEEE1394Reader::IEEE1394Reader( int c, int bufSize, bool hdv ) : droppedFrames( 0 ), + badFrames( 0 ), currentFrame( NULL ), channel( c ), isRunning( false ), @@ -208,6 +210,19 @@ } +/** Return the number of incomplete frames since last call +*/ + +int IEEE1394Reader::GetBadFrames( void ) +{ + pthread_mutex_lock( &mutex ); + int n = badFrames; + badFrames = 0; + pthread_mutex_unlock( &mutex ); + return n; +} + + /** Throw away all currently available frames. All frames in the outFrames queue are put back to the inFrames @@ -503,7 +518,7 @@ int iec61883Reader::Handler( unsigned char *data, int length, int dropped ) { - droppedFrames += dropped; + badFrames += dropped; if ( currentFrame == NULL ) { @@ -774,7 +789,7 @@ } struct timespec t = { - 0, 250000000 + 0, 250000000L }; nanosleep( &t, NULL ); pthread_mutex_unlock( &avc_mutex ); @@ -792,7 +807,7 @@ } struct timespec t = { - 0, 250000000 + 0, 250000000L }; nanosleep( &t, NULL ); pthread_mutex_unlock( &avc_mutex ); @@ -912,6 +927,7 @@ bool AVC::Timecode( int phyID, char* timecode ) { + bool result = false; pthread_mutex_lock( &avc_mutex ); if ( avc_handle != NULL ) { @@ -924,22 +940,20 @@ AVC1394_VCR_COMMAND_TIME_CODE | AVC1394_VCR_OPERAND_TIME_CODE_STATUS; request[ 1 ] = 0xFFFFFFFF; response = avc1394_transaction_block( avc_handle, phyID, request, 2, 1 ); - if ( response == NULL ) + if ( response && response[1] != 0xffffffff ) { - pthread_mutex_unlock( &avc_mutex ); - return false; - } - - sprintf( timecode, "%2.2x:%2.2x:%2.2x:%2.2x", + sprintf( timecode, "%2.2x:%2.2x:%2.2x:%2.2x", response[ 1 ] & 0x000000ff, ( response[ 1 ] >> 8 ) & 0x000000ff, ( response[ 1 ] >> 16 ) & 0x000000ff, ( response[ 1 ] >> 24 ) & 0x000000ff ); + result = true; + } } } pthread_mutex_unlock( &avc_mutex ); - return true; + return result; } int AVC::getNodeId( const char *guid ) @@ -976,6 +990,17 @@ return 0; } +bool AVC::isHDV( int phyID ) const +{ + int retry = 2; + quadlet_t response = avc1394_transaction( avc_handle, phyID, + AVC1394_CTYPE_STATUS | AVC1394_SUBUNIT_TYPE_TAPE_RECORDER | AVC1394_SUBUNIT_ID_0 + | AVC1394_VCR_COMMAND_OUTPUT_SIGNAL_MODE | 0xFF, retry ); + response = AVC1394_GET_OPERAND0( response ); +// fprintf(stderr, "%s: 0x%x\n", __PRETTY_FUNCTION__, response); + return ( response == 0x10 || response == 0x90 || response == 0x1A || response == 0x9A ); +} + /** Start receiving DV frames The received frames can be retrieved from the outFrames queue. @@ -1000,10 +1025,8 @@ */ void pipeReader::StopThread() { - pthread_mutex_lock( &mutex ); pthread_cancel( thread ); pthread_join( thread, NULL ); - pthread_mutex_unlock( &mutex ); Flush(); } 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/dvgrab-3.2/ieee1394io.h new/dvgrab-3.5/ieee1394io.h --- old/dvgrab-3.2/ieee1394io.h 2007-11-22 05:10:58.000000000 +0100 +++ new/dvgrab-3.5/ieee1394io.h 2009-04-11 06:38:26.000000000 +0200 @@ -1,6 +1,7 @@ /* * ieee1394io.cc -- asynchronously grabbing DV data * Copyright (C) 2000 Arne Schirmacher <arne@schirmacher.de> +* Copyright (C) 2003-2008 Dan Dennedy <dan@dennedy.org> * * 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 @@ -40,6 +41,7 @@ /// the number of frames that had to be thrown away because /// our inFrames queue did not contain available frames int droppedFrames; + int badFrames; /// a pointer to the frame which is currently been transmitted Frame *currentFrame; @@ -61,6 +63,7 @@ Frame* GetFrame( void ); void DoneWithFrame( Frame* ); int GetDroppedFrames( void ); + int GetBadFrames( void ); int GetOutQueueSize( void ) { return outFrames.size(); @@ -211,6 +214,7 @@ bool Timecode( int id, char* timecode ); int getNodeId( const char *guid ); int Reverse( int id ); + bool isHDV( int phyID ) const; private: 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/dvgrab-3.2/io.c new/dvgrab-3.5/io.c --- old/dvgrab-3.2/io.c 2005-04-18 16:24:51.000000000 +0200 +++ new/dvgrab-3.5/io.c 2009-01-15 08:02:36.000000000 +0100 @@ -167,8 +167,8 @@ FD_ZERO( &rfds ); FD_SET( 0, &rfds ); - tv.tv_sec = 1; - tv.tv_usec = 0; + tv.tv_sec = 0; + tv.tv_usec = 125000; n = select( 1, &rfds, NULL, NULL, &tv ); if ( n > 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/dvgrab-3.2/main.cc new/dvgrab-3.5/main.cc --- old/dvgrab-3.2/main.cc 2008-02-27 04:31:30.000000000 +0100 +++ new/dvgrab-3.5/main.cc 2009-09-08 05:34:20.000000000 +0200 @@ -1,7 +1,7 @@ /* * main.cc -- A DV/1394 capture utility -* Orginally Copyright (C) 2000 - 2002 Arne Schirmacher <arne@schirmacher.de> -* This portion rewritten by and Copyright (C) 2003 Dan Dennedy <dan@dennedy.org> +* Copyright (C) 2000-2002 Arne Schirmacher <arne@schirmacher.de> +* Copyright (C) 2003-2008 Dan Dennedy <dan@dennedy.org> * * 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 @@ -71,7 +71,7 @@ */ if ( sysconf( _SC_PRIORITY_SCHEDULING ) == -1) { - sendEvent( "Warning: RR-scheduler not available, disabling." ); +// sendEvent( "Warning: RR-scheduler not available, disabling." ); return -1; } else @@ -80,7 +80,7 @@ scp.sched_priority = sched_get_priority_max( SCHED_RR ) - pri; if ( sched_setscheduler( 0, SCHED_RR, &scp ) < 0 ) { - sendEvent( "Warning: Cannot set RR-scheduler" ); +// sendEvent( "Warning: Cannot set RR-scheduler" ); return -1; } } @@ -93,6 +93,8 @@ int main( int argc, char *argv[] ) { + int ret = 0; + fcntl( fileno( stderr ), F_SETFL, O_NONBLOCK ); try { @@ -108,8 +110,7 @@ setpriority( PRIO_PROCESS, 0, -20 ); #if _POSIX_MEMLOCK > 0 - if ( mlockall( MCL_CURRENT | MCL_FUTURE ) == -1 ) - sendEvent( "Warning: Cannot disable swapping" ); + mlockall( MCL_CURRENT | MCL_FUTURE ); #endif if ( dvgrab.isInteractive() ) @@ -138,13 +139,15 @@ { fprintf( stderr, "Error: %s\n", s.c_str() ); fflush( stderr ); + ret = 1; } catch ( ... ) { fprintf( stderr, "Error: unknown\n" ); fflush( stderr ); + ret = 1; } fprintf( stderr, "\n" ); - return 0; + return ret; } 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/dvgrab-3.2/missing new/dvgrab-3.5/missing --- old/dvgrab-3.2/missing 2007-08-07 08:43:14.000000000 +0200 +++ new/dvgrab-3.5/missing 2009-09-08 04:39:41.000000000 +0200 @@ -1,10 +1,10 @@ #! /bin/sh # Common stub for a few missing GNU programs while installing. -scriptversion=2006-05-10.23 +scriptversion=2009-04-28.21; # UTC -# Copyright (C) 1996, 1997, 1999, 2000, 2002, 2003, 2004, 2005, 2006 -# Free Software Foundation, Inc. +# Copyright (C) 1996, 1997, 1999, 2000, 2002, 2003, 2004, 2005, 2006, +# 2008, 2009 Free Software Foundation, Inc. # Originally by Fran,cois Pinard <pinard@iro.umontreal.ca>, 1996. # This program is free software; you can redistribute it and/or modify @@ -18,9 +18,7 @@ # 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. +# along with this program. If not, see <http://www.gnu.org/licenses/>. # As a special exception to the GNU General Public License, if you # distribute this file as part of a program that contains a @@ -89,6 +87,9 @@ tar try tar, gnutar, gtar, then tar without non-portable flags yacc create \`y.tab.[ch]', if possible, from existing .[ch] +Version suffixes to PROGRAM as well as the prefixes \`gnu-', \`gnu', and +\`g' are ignored when checking the name. + Send bug reports to <bug-automake@gnu.org>." exit $? ;; @@ -106,15 +107,22 @@ esac +# normalize program name to check for. +program=`echo "$1" | sed ' + s/^gnu-//; t + s/^gnu//; t + s/^g//; t'` + # 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). +# the program). This is about non-GNU programs, so use $1 not +# $program. case $1 in - lex|yacc) + lex*|yacc*) # Not GNU programs, they don't have --version. ;; - tar) + tar*) if test -n "$run"; then echo 1>&2 "ERROR: \`tar' requires --run" exit 1 @@ -138,7 +146,7 @@ # If it does not exist, or fails to run (possibly an outdated version), # try to emulate it. -case $1 in +case $program in aclocal*) echo 1>&2 "\ WARNING: \`$1' is $msg. You should only need it if @@ -148,7 +156,7 @@ touch aclocal.m4 ;; - autoconf) + autoconf*) echo 1>&2 "\ WARNING: \`$1' is $msg. You should only need it if you modified \`${configure_ac}'. You might want to install the @@ -157,7 +165,7 @@ touch configure ;; - autoheader) + autoheader*) echo 1>&2 "\ WARNING: \`$1' is $msg. You should only need it if you modified \`acconfig.h' or \`${configure_ac}'. You might want @@ -187,7 +195,7 @@ while read f; do touch "$f"; done ;; - autom4te) + autom4te*) echo 1>&2 "\ WARNING: \`$1' is needed, but is $msg. You might have modified some files without having the @@ -210,7 +218,7 @@ fi ;; - bison|yacc) + bison*|yacc*) echo 1>&2 "\ WARNING: \`$1' $msg. You should only need it if you modified a \`.y' file. You may need the \`Bison' package @@ -240,7 +248,7 @@ fi ;; - lex|flex) + lex*|flex*) echo 1>&2 "\ WARNING: \`$1' is $msg. You should only need it if you modified a \`.l' file. You may need the \`Flex' package @@ -263,7 +271,7 @@ fi ;; - help2man) + help2man*) echo 1>&2 "\ WARNING: \`$1' is $msg. You should only need it if you modified a dependency of a manual page. You may need the @@ -277,11 +285,11 @@ else test -z "$file" || exec >$file echo ".ab help2man is required to generate this page" - exit 1 + exit $? fi ;; - makeinfo) + makeinfo*) echo 1>&2 "\ WARNING: \`$1' is $msg. You should only need it if you modified a \`.texi' or \`.texinfo' file, or any other file @@ -310,7 +318,7 @@ touch $file ;; - tar) + tar*) shift # We have already tried tar in the generic part. @@ -363,5 +371,6 @@ # eval: (add-hook 'write-file-hooks 'time-stamp) # time-stamp-start: "scriptversion=" # time-stamp-format: "%:y-%02m-%02d.%02H" -# time-stamp-end: "$" +# time-stamp-time-zone: "UTC" +# time-stamp-end: "; # UTC" # End: 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/dvgrab-3.2/raw1394util.c new/dvgrab-3.5/raw1394util.c --- old/dvgrab-3.2/raw1394util.c 2008-07-22 05:59:37.000000000 +0200 +++ new/dvgrab-3.5/raw1394util.c 2008-11-26 04:47:58.000000000 +0100 @@ -1,3 +1,22 @@ +/* +* raw1394util.c -- libraw1394 utilities +* Copyright (C) 2003-2008 Dan Dennedy <dan@dennedy.org> +* +* 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., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. +* +*/ #include <stdio.h> #include <unistd.h> 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/dvgrab-3.2/raw1394util.h new/dvgrab-3.5/raw1394util.h --- old/dvgrab-3.2/raw1394util.h 2007-07-07 09:55:17.000000000 +0200 +++ new/dvgrab-3.5/raw1394util.h 2008-11-26 04:47:41.000000000 +0100 @@ -1,3 +1,22 @@ +/* +* raw1394util.h -- libraw1394 utilities +* Copyright (C) 2003-2008 Dan Dennedy <dan@dennedy.org> +* +* 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., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. +* +*/ #ifndef RAW1394UTIL_H #define RAW1394UTIL_H 1 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/dvgrab-3.2/smiltime.cc new/dvgrab-3.5/smiltime.cc --- old/dvgrab-3.2/smiltime.cc 2008-07-22 05:33:35.000000000 +0200 +++ new/dvgrab-3.5/smiltime.cc 2009-04-11 06:09:09.000000000 +0200 @@ -1,6 +1,6 @@ /* * smiltime.cc -- W3C SMIL2 Time value parser -* Copyright (C) 2003 Dan Dennedy <dan@dennedy.org> +* Copyright (C) 2003-2008 Dan Dennedy <dan@dennedy.org> * * 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 @@ -27,6 +27,7 @@ #include <iostream> #include <iomanip> #include <sstream> +#include <cstdio> #include <stdlib.h> #include <math.h> 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/dvgrab-3.2/smiltime.h new/dvgrab-3.5/smiltime.h --- old/dvgrab-3.2/smiltime.h 2005-04-18 16:24:48.000000000 +0200 +++ new/dvgrab-3.5/smiltime.h 2008-11-26 04:41:33.000000000 +0100 @@ -1,6 +1,6 @@ /* * smiltime.h -- W3C SMIL2 Time value parser -* Copyright (C) 2003 Dan Dennedy <dan@dennedy.org> +* Copyright (C) 2003-2008 Dan Dennedy <dan@dennedy.org> * * 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 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/dvgrab-3.2/stringutils.cc new/dvgrab-3.5/stringutils.cc --- old/dvgrab-3.2/stringutils.cc 2008-07-22 05:34:05.000000000 +0200 +++ new/dvgrab-3.5/stringutils.cc 2008-11-26 04:41:21.000000000 +0100 @@ -1,6 +1,6 @@ /* * stringutils.cc -- C++ STL string functions -* Copyright (C) 2003 Dan Dennedy <dan@dennedy.org> +* Copyright (C) 2003-2008 Dan Dennedy <dan@dennedy.org> * * 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 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/dvgrab-3.2/stringutils.h new/dvgrab-3.5/stringutils.h --- old/dvgrab-3.2/stringutils.h 2007-07-09 02:20:40.000000000 +0200 +++ new/dvgrab-3.5/stringutils.h 2008-11-26 04:41:26.000000000 +0100 @@ -1,6 +1,6 @@ /* * stringutils.h -- C++ STL string functions -* Copyright (C) 2003 Dan Dennedy <dan@dennedy.org> +* Copyright (C) 2003-2008 Dan Dennedy <dan@dennedy.org> * * 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 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/dvgrab-3.2/v4l2reader.cc new/dvgrab-3.5/v4l2reader.cc --- old/dvgrab-3.2/v4l2reader.cc 2008-02-27 04:31:52.000000000 +0100 +++ new/dvgrab-3.5/v4l2reader.cc 2008-11-26 04:40:07.000000000 +0100 @@ -1,6 +1,6 @@ /* * ieee1394io.cc -- grab DV/MPEG-2 from V4L2 -* Copyright (C) 2007 Dan Dennedy <dan@dennedy.org> +* Copyright (C) 2007-2008 Dan Dennedy <dan@dennedy.org> * * 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 @@ -112,12 +112,16 @@ void v4l2Reader::Close( void ) { - // Release mmaped buffers - for ( unsigned int i = 0; i < m_bufferCount; i++ ) - munmap( m_buffers[i].start, m_buffers[i].length ); - - // Release mmap buffers tracking list - free( m_buffers ); + if ( m_buffers ) + { + // Release mmaped buffers + for ( unsigned int i = 0; i < m_bufferCount; i++ ) + munmap( m_buffers[i].start, m_buffers[i].length ); + + // Release mmap buffers tracking list + free( m_buffers ); + m_buffers = NULL; + } // Close device file if ( m_fd > -1 ) @@ -221,7 +225,8 @@ } if ( result > 0 && ( ( v4l2_poll.revents & POLLIN ) || ( v4l2_poll.revents & POLLPRI ) ) ) - isRunning = Handler( ); + if ( ! Handler( ) ) + isRunning = false; } return NULL; } ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Remember to have fun... -- To unsubscribe, e-mail: opensuse-commit+unsubscribe@opensuse.org For additional commands, e-mail: opensuse-commit+help@opensuse.org
participants (1)
-
root@hilbert.suse.de