ViewVC Help
View File | Revision Log | Show Annotations | Revision Graph | Root Listing
root/cebix/mintv/mintv.cpp
(Generate patch)

Comparing mintv/mintv.cpp (file contents):
Revision 1.5 by cebix, 2003-03-07T20:08:37Z vs.
Revision 1.8 by cebix, 2005-10-02T11:57:30Z

# Line 1 | Line 1
1   /*
2 < *  mintv.cpp - 50/60Hz video display using v4l and XVideo
2 > *  mintv.cpp - 50/60Hz noninterlaced video display using v4l and XVideo
3   *
4 < *  Written in 2003 by Christian Bauer
4 > *  Written in 2003-2004 by Christian Bauer
5   */
6  
7   #include <stdio.h>
# Line 39 | Line 39 | static int grab_width = -1, grab_height;
39   static int image_width, image_height;
40   static int win_width, win_height;
41  
42 < const int PAL_FPS = 50;
43 < const int NTSC_FPS = 60;
42 > const double PAL_FPS = 50.0;
43 > const double NTSC_FPS = 59.94;
44  
45 < static int fps;
45 > static double fps;
46  
47   static int brightness = 50, contrast = 50, color = 50;
48  
# Line 285 | Line 285 | static Boolean work_proc(XtPointer clien
285  
286          now = GetTicks_usec();
287          uint64 elapsed = now - prev;
288 <        int64 delay = 1000000 / fps - (now - prev);
288 >        int64 delay = int64(1000000.0 / fps) - (now - prev);
289   #if LOGGING
290          fprintf(log, "elapsed %Ld usec, delay %Ld usec\n", elapsed, delay);
291   #endif
# Line 333 | Line 333 | int main(int argc, char **argv)
333          // Parse options
334          for (;;) {
335                  int c;
336 <                if ((c = getopt_long(argc, argv, "hnp:w:", long_opts,NULL)) == -1)
336 >                if ((c = getopt_long(argc, argv, "hnp:w:", long_opts, NULL)) == -1)
337                          break;
338  
339                  switch (c) {
# Line 463 | Line 463 | port_found:
463                  NULL
464          );
465          XtRealizeWidget(app_shell);
466        Cursor null_cursor = XCreateFontCursor(dpy, XC_left_ptr);
467        XDefineCursor(dpy, XtWindow(app_shell), null_cursor);
466          XtVaSetValues(app_shell,
467                  XtNtitle, "mintv",
468                  XtNinput, True,
# Line 473 | Line 471 | port_found:
471          XSetWMProtocols(dpy, XtWindow(app_shell), &wm, 1);
472          gc = XCreateGC(dpy, XtWindow(video), 0, NULL);
473  
474 +        // Hide cursor
475 +        Colormap cmap = DefaultColormap(dpy, DefaultScreen(dpy));
476 +        XColor black;
477 +        XParseColor(dpy, cmap, "#000000", &black);
478 +        XAllocColor(dpy, cmap, &black);
479 +        static char null_data[] = {0, 0, 0, 0, 0, 0, 0, 0};
480 +        Pixmap null_pixmap = XCreateBitmapFromData(dpy, XtWindow(video), null_data, 8, 8);
481 +        Cursor null_cursor = XCreatePixmapCursor(dpy, null_pixmap, null_pixmap, &black, &black, 0, 0);
482 +        XDefineCursor(dpy, XtWindow(video), null_cursor);
483 +
484          // Set image format
485          unsigned format = XV_FORMAT;
486  

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines