// INCLUDES ////////////////////////////////////////////////////////////// #include #include #ifdef __NetBSD__ #include // OpenBSD also? #elif __FreeBSD_version >= 502100 #include #include #else #include // Dfly also? #include #endif // SWIG MODULE DECLARATION /////////////////////////////////////////////// #ifdef SWIG %module bt848 %feature("autodoc", "1"); #define MODULE_AUTHOR "Danny Pansters" #define MODULE_AUTHOR_EMAIL "danny@ricin.com" #define MODULE_COPYRIGHT "(c) 2005-2007, Danny Pansters " #define MODULE_LICENSE "BSD" #endif // CONVENIENCE CONSTANTS ///////////////////////////////////////////////// #define FREQFACTOR 16 // 1 MHz is represented by 16 bits in the HW #define HUEVAL 65 // Fixed hue value, this is fine for TV #define MINFREQ 0 // Lowest frequency possible #define MAXFREQ 900 // Highest frequency considered #define MINPERC 0 // Lowest percentage value #define MAXPERC 100 // Highest percentage value #define TUNERDEV "/dev/tuner" // Tuner device (symlink to /dev/tunerN) #define BKTRDEV "/dev/bktr" // Bktr device (symlink to /dev/bktrN) // TUNER FUNCTIONS /////////////////////////////////////////////////////// // Video input device #ifdef SWIG %feature("docstring", "Set videosource, 0 to 4 (DEV0-3 and SVID). Returns -1 on failure."); #endif int tuner_videosource_set(int videosource); #ifdef SWIG %feature("docstring", "Get videosource. Returns one of 0 to 4, or -1 on failure."); #endif int tuner_videosource(); #ifdef SWIG %feature("docstring", "Find tuner device. Returns one of 0 to 4, -1 on failure."); #endif int tuner_tunerdev(); // Init opens tuner device #ifdef SWIG %feature("docstring", "Opens tuner device. Returns < 0 on failure."); #endif int tuner_init(); // Closes tuner device #ifdef SWIG %feature("docstring", "Closes tuner device. Returns < 0 on failure."); #endif int tuner_quit(); // Tuner frequency (MHz) #ifdef SWIG %feature("docstring", "Set frequency in MHz, 0 to 900 (MAXFREQ). Returns -1 on failure."); #endif int tuner_frequency_set(int frequency); #ifdef SWIG %feature("docstring", "Get frequency. Returns frequency in MHz, or -1 on failure"); #endif int tuner_frequency(); // Audio input (if composite video becomes 1 automatically by HW) #ifdef SWIG %feature("docstring", "Set audiosource, 0 (tuner), 1 (ext), 2 (int), 0x80 (mute), 0x81\n(unmute). Returns -1 on failure."); #endif int tuner_audiosource_set(int audiosource); #ifdef SWIG %feature("docstring", "Get audiosource. Returns 0 to 2, 0x80 or 0x81, or -1 on failure."); #endif int tuner_audiosource(); // AFC (up to 5 MHz) #ifdef SWIG %feature("docstring", "Set AFC, 0 (off) or 1 (on). Returns -1 on failure."); #endif int tuner_afc_set(int afcbool); #ifdef SWIG %feature("docstring", "Get AFC. Returns 0 or 1, or -1 on failure."); #endif int tuner_afc(); // Brightness, contrast, color, saturation (percentage) #ifdef SWIG %feature("docstring", "Set brightness, 0 to 100. Returns -1 on failure."); #endif int tuner_brightness_set(int brightness); #ifdef SWIG %feature("docstring", "Get brightness. Returns percentage, or -1 on failure."); #endif int tuner_brightness(); #ifdef SWIG %feature("docstring", "Set contrast, 0 to 100. Returns -1 on failure."); #endif int tuner_contrast_set(int contrast); #ifdef SWIG %feature("docstring", "Get contrast. Returns percentage, or -1 on failure."); #endif int tuner_contrast(); #ifdef SWIG %feature("docstring", "Set color, 0 (green) to 100 (red). Returns -1 on failure."); #endif int tuner_color_set(int color); #ifdef SWIG %feature("docstring", "Get color. Returns percentage, or -1 on failure."); #endif int tuner_color(); #ifdef SWIG %feature("docstring", "Set saturation, 0 to 100. Returns -1 on failure."); #endif int tuner_saturation_set(int saturation); #ifdef SWIG %feature("docstring", "Get saturation. Returns percentage, or -1 on failure."); #endif int tuner_saturation(); // VIEWER FUNCTIONS ////////////////////////////////////////////////////// #ifdef SWIG %feature("docstring", """Init the hardware and SDL viewer, start capturing frames. The standard std should be set to 0 for PAL, 1 for NTSC, 2 for SECAM. Returns 0 on success. On failure it returns (in order of actual operations) 1 if the BKTRDEV device couldn't be opened, 2 if the ioctl METEORSETGEO failed, 3 if BT848SFMT failed, 4 if SDL_Init failed, 5 if SDL_SetVideoMode failed, 6 if SDL_CreateYUVOverlay failed, 7 if the ioctl METEORCAPTUR failed, 8 if the ioctl METEORSSIGNAL failed, and 9 if mmap failed."""); #endif int viewer_init(int width, int height, int std); #ifdef SWIG %feature("docstring", "Start/unpause video."); #endif void viewer_start(); #ifdef SWIG %feature("docstring", "Pause video (not capturing)."); #endif void viewer_pause(); #ifdef SWIG %feature("docstring", "Resize the viewer area to width x height pixels."); #endif void viewer_resize(int width, int height); #ifdef SWIG %feature("docstring", "Quit viewer, shut down SDL, stop capturing, clean up."); #endif void viewer_quit(); #ifdef SWIG %feature("docstring", "Signal handler, for internal use only."); #endif void frame_handler(); // END ///////////////////////////////////////////////////////////////////