fwcontrol patches
"M. Warner Losh" <[email protected]>
| Newsgroups | gmane.os.freebsd.devel.firewire |
|---|---|
| Message-ID | <[email protected]> |
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;
_______________________________________________
[email protected] mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-firewire
To unsubscribe, send any mail to "[email protected]"