mirror of
https://github.com/freebsd/freebsd-src
synced 2024-10-15 04:43:53 +00:00
Begin basic improvements to fwcontrol in the area of handling
video streams from cameras. This patch changes the displayed timer to a time stamp and corrects one or two mishandled errors. Submitted by: imp
This commit is contained in:
parent
001944c3bd
commit
e627b033dc
Notes:
svn2git
2020-12-20 02:59:44 +00:00
svn path=/head/; revision=188029
|
@ -202,15 +202,20 @@ dvrecv(int d, const char *filename, char ich, int count)
|
||||||
(dv->payload[0] & DV_DSF_12) == 0)
|
(dv->payload[0] & DV_DSF_12) == 0)
|
||||||
dv->payload[0] |= DV_DSF_12;
|
dv->payload[0] |= DV_DSF_12;
|
||||||
nb = nblocks[system];
|
nb = nblocks[system];
|
||||||
fprintf(stderr, "%d", k%10);
|
fprintf(stderr, "%d:%02d:%02d %d\r",
|
||||||
|
k / (3600 * frame_rate[system]),
|
||||||
|
(k / (60 * frame_rate[system])) % 60,
|
||||||
|
(k / frame_rate[system]) % 60,
|
||||||
|
k % frame_rate[system]);
|
||||||
|
|
||||||
#if FIX_FRAME
|
#if FIX_FRAME
|
||||||
if (m > 0 && m != nb) {
|
if (m > 0 && m != nb) {
|
||||||
/* padding bad frame */
|
/* padding bad frame */
|
||||||
npad = ((nb - m) % nb);
|
npad = ((nb - m) % nb);
|
||||||
if (npad < 0)
|
if (npad < 0)
|
||||||
npad += nb;
|
npad += nb;
|
||||||
fprintf(stderr, "(%d blocks padded)",
|
fprintf(stderr, "\n%d blocks padded\n",
|
||||||
npad);
|
npad);
|
||||||
npad *= DSIZE;
|
npad *= DSIZE;
|
||||||
wbuf[vec].iov_base = pad;
|
wbuf[vec].iov_base = pad;
|
||||||
wbuf[vec++].iov_len = npad;
|
wbuf[vec++].iov_len = npad;
|
||||||
|
@ -221,10 +226,6 @@ dvrecv(int d, const char *filename, char ich, int count)
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
k++;
|
k++;
|
||||||
if (k % frame_rate[system] == 0) {
|
|
||||||
/* every second */
|
|
||||||
fprintf(stderr, "\n");
|
|
||||||
}
|
|
||||||
fflush(stderr);
|
fflush(stderr);
|
||||||
m = 0;
|
m = 0;
|
||||||
}
|
}
|
||||||
|
@ -245,9 +246,8 @@ dvrecv(int d, const char *filename, char ich, int count)
|
||||||
if (vec > 0)
|
if (vec > 0)
|
||||||
writev(fd, wbuf, vec);
|
writev(fd, wbuf, vec);
|
||||||
}
|
}
|
||||||
if(fd != STDOUT_FILENO) {
|
if (fd != STDOUT_FILENO)
|
||||||
close(fd);
|
close(fd);
|
||||||
}
|
|
||||||
fprintf(stderr, "\n");
|
fprintf(stderr, "\n");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -195,10 +195,9 @@ mpegtsrecv(int d, const char *filename, char ich, int count)
|
||||||
if (len < 0) {
|
if (len < 0) {
|
||||||
if (errno == EAGAIN) {
|
if (errno == EAGAIN) {
|
||||||
fprintf(stderr, "(EAGAIN) - push 'Play'?\n");
|
fprintf(stderr, "(EAGAIN) - push 'Play'?\n");
|
||||||
if (len <= 0)
|
continue;
|
||||||
continue;
|
}
|
||||||
} else
|
err(1, "read failed");
|
||||||
err(1, "read failed");
|
|
||||||
}
|
}
|
||||||
ptr = (uint32_t *) buf;
|
ptr = (uint32_t *) buf;
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue