From owner-freebsd-firewire@FreeBSD.ORG Sat Jan 3 06:29:12 2009 Return-Path: Delivered-To: firewire@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 0DA011065670 for ; Sat, 3 Jan 2009 06:29:12 +0000 (UTC) (envelope-from imp@bsdimp.com) Received: from harmony.bsdimp.com (bsdimp.com [199.45.160.85]) by mx1.freebsd.org (Postfix) with ESMTP id C74308FC16 for ; Sat, 3 Jan 2009 06:29:11 +0000 (UTC) (envelope-from imp@bsdimp.com) Received: from localhost (localhost [127.0.0.1]) by harmony.bsdimp.com (8.14.2/8.14.1) with ESMTP id n036QIXv064970 for ; Fri, 2 Jan 2009 23:26:18 -0700 (MST) (envelope-from imp@bsdimp.com) Date: Fri, 02 Jan 2009 23:26:30 -0700 (MST) Message-Id: <20090102.232630.1387162816.imp@bsdimp.com> To: firewire@freebsd.org From: "M. Warner Losh" X-Mailer: Mew version 5.2 on Emacs 21.3 / Mule 5.0 (SAKAKI) Mime-Version: 1.0 Content-Type: Text/Plain; charset=us-ascii Content-Transfer-Encoding: 7bit Cc: Subject: fwcontrol patches X-BeenThere: freebsd-firewire@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Firewire support in FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 03 Jan 2009 06:29:12 -0000 Here's some minor patches to fwcontrol so that the DV capture mode is "nicer". I'd like to make the EAGAIN handling better, as well as offer automated rewind + play + error recoverty for at least my camera. The first step in that is to have it print an elapsed time instead of the single digit per frame. The second chunk is just removing dead code. Comments? Warner Index: fwdv.c =================================================================== --- fwdv.c (revision 186639) +++ fwdv.c (working copy) @@ -202,7 +202,9 @@ (dv->payload[0] & DV_DSF_12) == 0) dv->payload[0] |= DV_DSF_12; nb = nblocks[system]; - fprintf(stderr, "%d", k%10); + fprintf(stderr, "%d:%02d:%02d %2d\r", + k / (1800 * 60), (k / 1800) % 60, + (k / 30) % 60, k % 30); #if FIX_FRAME if (m > 0 && m != nb) { /* padding bad frame */ @@ -221,10 +223,6 @@ } #endif k++; - if (k % frame_rate[system] == 0) { - /* every second */ - fprintf(stderr, "\n"); - } fflush(stderr); m = 0; } Index: fwmpegts.c =================================================================== --- fwmpegts.c (revision 186639) +++ fwmpegts.c (working copy) @@ -195,10 +195,9 @@ if (len < 0) { if (errno == EAGAIN) { fprintf(stderr, "(EAGAIN) - push 'Play'?\n"); - if (len <= 0) - continue; - } else - err(1, "read failed"); + continue; + } + err(1, "read failed"); } ptr = (uint32_t *) buf;