media: docs: Fix newline typo

Fix example code which has missing or double backslash typo.

Signed-off-by: Kwang Son <dev.kwang.son@gmail.com>
Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
This commit is contained in:
Kwang Son 2021-11-02 11:17:47 +00:00 committed by Mauro Carvalho Chehab
parent 22be5a10d0
commit d7894721f7
2 changed files with 30 additions and 30 deletions

View File

@ -56,7 +56,7 @@ file: media/v4l/capture.c
static void errno_exit(const char *s)
{
fprintf(stderr, "%s error %d, %s\\n", s, errno, strerror(errno));
fprintf(stderr, "%s error %d, %s\n", s, errno, strerror(errno));
exit(EXIT_FAILURE);
}
@ -201,7 +201,7 @@ file: media/v4l/capture.c
}
if (0 == r) {
fprintf(stderr, "select timeout\\n");
fprintf(stderr, "select timeout\n");
exit(EXIT_FAILURE);
}
@ -307,7 +307,7 @@ file: media/v4l/capture.c
buffers = calloc(1, sizeof(*buffers));
if (!buffers) {
fprintf(stderr, "Out of memory\\n");
fprintf(stderr, "Out of memory\n");
exit(EXIT_FAILURE);
}
@ -315,7 +315,7 @@ file: media/v4l/capture.c
buffers[0].start = malloc(buffer_size);
if (!buffers[0].start) {
fprintf(stderr, "Out of memory\\n");
fprintf(stderr, "Out of memory\n");
exit(EXIT_FAILURE);
}
}
@ -341,7 +341,7 @@ file: media/v4l/capture.c
}
if (req.count < 2) {
fprintf(stderr, "Insufficient buffer memory on %s\\n",
fprintf(stderr, "Insufficient buffer memory on %s\n",
dev_name);
exit(EXIT_FAILURE);
}
@ -349,7 +349,7 @@ file: media/v4l/capture.c
buffers = calloc(req.count, sizeof(*buffers));
if (!buffers) {
fprintf(stderr, "Out of memory\\n");
fprintf(stderr, "Out of memory\n");
exit(EXIT_FAILURE);
}
@ -401,7 +401,7 @@ file: media/v4l/capture.c
buffers = calloc(4, sizeof(*buffers));
if (!buffers) {
fprintf(stderr, "Out of memory\\n");
fprintf(stderr, "Out of memory\n");
exit(EXIT_FAILURE);
}
@ -410,7 +410,7 @@ file: media/v4l/capture.c
buffers[n_buffers].start = malloc(buffer_size);
if (!buffers[n_buffers].start) {
fprintf(stderr, "Out of memory\\n");
fprintf(stderr, "Out of memory\n");
exit(EXIT_FAILURE);
}
}
@ -426,7 +426,7 @@ file: media/v4l/capture.c
if (-1 == xioctl(fd, VIDIOC_QUERYCAP, &cap)) {
if (EINVAL == errno) {
fprintf(stderr, "%s is no V4L2 device\\n",
fprintf(stderr, "%s is no V4L2 device\n",
dev_name);
exit(EXIT_FAILURE);
} else {
@ -435,7 +435,7 @@ file: media/v4l/capture.c
}
if (!(cap.capabilities & V4L2_CAP_VIDEO_CAPTURE)) {
fprintf(stderr, "%s is no video capture device\\n",
fprintf(stderr, "%s is no video capture device\n",
dev_name);
exit(EXIT_FAILURE);
}
@ -443,7 +443,7 @@ file: media/v4l/capture.c
switch (io) {
case IO_METHOD_READ:
if (!(cap.capabilities & V4L2_CAP_READWRITE)) {
fprintf(stderr, "%s does not support read i/o\\n",
fprintf(stderr, "%s does not support read i/o\n",
dev_name);
exit(EXIT_FAILURE);
}
@ -452,7 +452,7 @@ file: media/v4l/capture.c
case IO_METHOD_MMAP:
case IO_METHOD_USERPTR:
if (!(cap.capabilities & V4L2_CAP_STREAMING)) {
fprintf(stderr, "%s does not support streaming i/o\\n",
fprintf(stderr, "%s does not support streaming i/o\n",
dev_name);
exit(EXIT_FAILURE);
}
@ -541,7 +541,7 @@ file: media/v4l/capture.c
struct stat st;
if (-1 == stat(dev_name, &st)) {
fprintf(stderr, "Cannot identify '%s': %d, %s\\n",
fprintf(stderr, "Cannot identify '%s': %d, %s\n",
dev_name, errno, strerror(errno));
exit(EXIT_FAILURE);
}
@ -554,7 +554,7 @@ file: media/v4l/capture.c
fd = open(dev_name, O_RDWR /* required */ | O_NONBLOCK, 0);
if (-1 == fd) {
fprintf(stderr, "Cannot open '%s': %d, %s\\n",
fprintf(stderr, "Cannot open '%s': %d, %s\n",
dev_name, errno, strerror(errno));
exit(EXIT_FAILURE);
}
@ -563,17 +563,17 @@ file: media/v4l/capture.c
static void usage(FILE *fp, int argc, char **argv)
{
fprintf(fp,
"Usage: %s [options]\\n\\n"
"Version 1.3\\n"
"Options:\\n"
"-d | --device name Video device name [%s]n"
"-h | --help Print this messagen"
"-m | --mmap Use memory mapped buffers [default]n"
"-r | --read Use read() callsn"
"-u | --userp Use application allocated buffersn"
"-o | --output Outputs stream to stdoutn"
"-f | --format Force format to 640x480 YUYVn"
"-c | --count Number of frames to grab [%i]n"
"Usage: %s [options]\n\n"
"Version 1.3\n"
"Options:\n"
"-d | --device name Video device name [%s]\n"
"-h | --help Print this message\n"
"-m | --mmap Use memory mapped buffers [default]\n"
"-r | --read Use read() calls\n"
"-u | --userp Use application allocated buffers\n"
"-o | --output Outputs stream to stdout\n"
"-f | --format Force format to 640x480 YUYV\n"
"-c | --count Number of frames to grab [%i]\n"
"",
argv[0], dev_name, frame_count);
}
@ -659,6 +659,6 @@ file: media/v4l/capture.c
stop_capturing();
uninit_device();
close_device();
fprintf(stderr, "\\n");
fprintf(stderr, "\n");
return 0;
}

View File

@ -46,7 +46,7 @@ file: media/v4l/v4l2grab.c
} while (r == -1 && ((errno == EINTR) || (errno == EAGAIN)));
if (r == -1) {
fprintf(stderr, "error %d, %s\\n", errno, strerror(errno));
fprintf(stderr, "error %d, %s\n", errno, strerror(errno));
exit(EXIT_FAILURE);
}
}
@ -80,11 +80,11 @@ file: media/v4l/v4l2grab.c
fmt.fmt.pix.field = V4L2_FIELD_INTERLACED;
xioctl(fd, VIDIOC_S_FMT, &fmt);
if (fmt.fmt.pix.pixelformat != V4L2_PIX_FMT_RGB24) {
printf("Libv4l didn't accept RGB24 format. Can't proceed.\\n");
printf("Libv4l didn't accept RGB24 format. Can't proceed.\n");
exit(EXIT_FAILURE);
}
if ((fmt.fmt.pix.width != 640) || (fmt.fmt.pix.height != 480))
printf("Warning: driver is sending image at %dx%d\\n",
printf("Warning: driver is sending image at %dx%d\n",
fmt.fmt.pix.width, fmt.fmt.pix.height);
CLEAR(req);
@ -151,7 +151,7 @@ file: media/v4l/v4l2grab.c
perror("Cannot open image");
exit(EXIT_FAILURE);
}
fprintf(fout, "P6\\n%d %d 255\\n",
fprintf(fout, "P6\n%d %d 255\n",
fmt.fmt.pix.width, fmt.fmt.pix.height);
fwrite(buffers[buf.index].start, buf.bytesused, 1, fout);
fclose(fout);