comparison v4l2.c @ 2078:17b7ebc3e1f9 libavformat

Reindent code after last commit
author lucabe
date Thu, 10 May 2007 10:15:15 +0000
parents 4b07eb8709f2
children efb7b615d57c
comparison
equal deleted inserted replaced
2077:4b07eb8709f2 2078:17b7ebc3e1f9
428 struct v4l2_input input; 428 struct v4l2_input input;
429 struct v4l2_standard standard; 429 struct v4l2_standard standard;
430 int i; 430 int i;
431 431
432 if(ap->channel>=0) { 432 if(ap->channel>=0) {
433 /* set tv video input */ 433 /* set tv video input */
434 memset (&input, 0, sizeof (input)); 434 memset (&input, 0, sizeof (input));
435 input.index = ap->channel; 435 input.index = ap->channel;
436 if(ioctl (s->fd, VIDIOC_ENUMINPUT, &input) < 0) { 436 if(ioctl (s->fd, VIDIOC_ENUMINPUT, &input) < 0) {
437 av_log(s1, AV_LOG_ERROR, "The V4L2 driver ioctl enum input failed:\n"); 437 av_log(s1, AV_LOG_ERROR, "The V4L2 driver ioctl enum input failed:\n");
438 return AVERROR_IO; 438 return AVERROR_IO;
439 } 439 }
440 440
441 av_log(s1, AV_LOG_DEBUG, "The V4L2 driver set input_id: %d, input: %s\n", 441 av_log(s1, AV_LOG_DEBUG, "The V4L2 driver set input_id: %d, input: %s\n",
442 ap->channel, input.name); 442 ap->channel, input.name);
443 if(ioctl (s->fd, VIDIOC_S_INPUT, &input.index) < 0 ) { 443 if(ioctl (s->fd, VIDIOC_S_INPUT, &input.index) < 0 ) {
444 av_log(s1, AV_LOG_ERROR, "The V4L2 driver ioctl set input(%d) failed\n", 444 av_log(s1, AV_LOG_ERROR, "The V4L2 driver ioctl set input(%d) failed\n",
445 ap->channel); 445 ap->channel);
446 return AVERROR_IO; 446 return AVERROR_IO;
447 } 447 }
448 } 448 }
449 449
450 if(ap->standard) { 450 if(ap->standard) {
451 av_log(s1, AV_LOG_DEBUG, "The V4L2 driver set standard: %s\n", 451 av_log(s1, AV_LOG_DEBUG, "The V4L2 driver set standard: %s\n",
452 ap->standard ); 452 ap->standard );
453 /* set tv standard */ 453 /* set tv standard */
454 memset (&standard, 0, sizeof (standard)); 454 memset (&standard, 0, sizeof (standard));
455 for(i=0;;i++) { 455 for(i=0;;i++) {
456 standard.index = i; 456 standard.index = i;
457 if (ioctl(s->fd, VIDIOC_ENUMSTD, &standard) < 0) { 457 if (ioctl(s->fd, VIDIOC_ENUMSTD, &standard) < 0) {
458 av_log(s1, AV_LOG_ERROR, "The V4L2 driver ioctl set standard(%s) failed\n",
459 ap->standard);
460 return AVERROR_IO;
461 }
462
463 if(!strcasecmp(standard.name, ap->standard)) {
464 break;
465 }
466 }
467
468 av_log(s1, AV_LOG_DEBUG, "The V4L2 driver set standard: %s, id: %"PRIu64"\n",
469 ap->standard, standard.id);
470 if (ioctl(s->fd, VIDIOC_S_STD, &standard.id) < 0) {
458 av_log(s1, AV_LOG_ERROR, "The V4L2 driver ioctl set standard(%s) failed\n", 471 av_log(s1, AV_LOG_ERROR, "The V4L2 driver ioctl set standard(%s) failed\n",
459 ap->standard); 472 ap->standard);
460 return AVERROR_IO; 473 return AVERROR_IO;
461 } 474 }
462
463 if(!strcasecmp(standard.name, ap->standard)) {
464 break;
465 }
466 }
467
468 av_log(s1, AV_LOG_DEBUG, "The V4L2 driver set standard: %s, id: %"PRIu64"\n",
469 ap->standard, standard.id);
470 if (ioctl(s->fd, VIDIOC_S_STD, &standard.id) < 0) {
471 av_log(s1, AV_LOG_ERROR, "The V4L2 driver ioctl set standard(%s) failed\n",
472 ap->standard);
473 return AVERROR_IO;
474 }
475 } 475 }
476 476
477 return 0; 477 return 0;
478 } 478 }
479 479