#include #include #include #include #include #include #include #include "saa713x_ioctl.h" int main(int argc, char **argv) { int fd; uint32_t v; char *dname; if (argc >= 2) dname = argv[1]; else dname = "/dev/saa0"; if ( (fd = open(dname, O_RDWR)) == -1) err(errno, "Error opening video device %s", argv[1]); if (ioctl(fd, GETVIDEOSTS, &v) == -1) err(errno, "IOCTL Error reading video status"); printf("Status: 0x%x\n", v); v &= VIDEO_STS1_DCSTD_MASK; v >>= VIDEO_STS1_DCSTD_SHIFT; switch(v) { case 0: printf("No color signal detected\n"); break; case 1: printf("NTSC color signal detected\n"); break; case 2: printf("PAL color signal detected\n"); break; case 3: printf("SECAM color signal detected\n"); break; } return 0; }