// INCLUDES ////////////////////////////////////////////////////////////// #include #include #include #include "saadriver/kmod/saa713x_ioctl.h" #include "saa_reg.h" #include "saa_var.h" // Edit this one for build time config // SWIG MODULE DECLARATION /////////////////////////////////////////////// #ifdef SWIG %module saa %feature("autodoc", "1"); #define MODULE_AUTHOR "Danny Pansters" #define MODULE_AUTHOR_EMAIL "danny@ricin.com" #define MODULE_COPYRIGHT "(c) 2006-2007, Danny Pansters \n(c) 2004-2005, Rohit Jalan (saa driver)" #define MODULE_LICENSE "BSD" #endif // CONVENIENCE CONSTANTS ///////////////////////////////////////////////// #define MINPERC 0 // Lowest percentage value #define MAXPERC 100 // Highest percentage value #define IICDEV "/dev/iic0" // The i2c device (only zero devices for now) #define SAADEV "/dev/saa0" // The saa video device #define SAUDEV "/dev/sau0" // The saa audio device #define SAA_HUEMIN 0 // Both 0 and 255 are highest #define SAA_HUEMAX 255 #define SAA_SATMAX 127 // Most color, half of scale #define SAA_SATMIN 0 #define SAA_BRIGHTMAX 255 // Whole scale 0..255 #define SAA_BRIGHTMIN 0 #define SAA_CONTMAX 127 // Half of scale used, max at 127 #define SAA_CONTMIN 0 #define PAL_LINE_COUNT 288 // Same for SECAM #define PAL_LINE_OFFSET 19 #define NTSC_LINE_COUNT 240 #define NTSC_LINE_OFFSET 16 // TUNER FUNCTIONS /////////////////////////////////////////////////////// // Video input device (Note: different than with bktr) #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", "Return tuner device. Always 1."); #endif int tuner_tunerdev(); // Tuner init (tuner section) #ifdef SWIG %feature("docstring", "Init tuner opens iic device, determines internal variables, writes some HW registers (MK3). Returns 0 on success, -1 on failure."); #endif int tuner_init(); // TDA988x init (IF section) #ifdef SWIG %feature("docstring", "Init programmable IF section TDA988x chip (MK3). Returns 0 on success, -1 on failure. Includes a probe, if no TDA, returns 0."); #endif int tuner_if_init(); // Tuner frequency (MHz) #ifdef SWIG %feature("docstring", "Set frequency in MHz. 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(); // Tuner close #ifdef SWIG %feature("docstring", "Close iic device. Returns -1 on failure."); #endif int tuner_quit(); // Audio input (Note: different than with bktr) #ifdef SWIG %feature("docstring", "Set audiosource, 0 (tuner), 1 (ext), 2 (ext), 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 (muted), or -1 on failure."); #endif int tuner_audiosource(); // Audio init (Note: no bktr counterpart) #ifdef SWIG %feature("docstring", "Init audio. Saa specific, returns -1 on failure."); #endif int tuner_audio_init(); // AFC (placeholder only) #ifdef SWIG %feature("docstring", "Set AFC. Does nothing. Some tuners have it built in, others may not."); #endif int tuner_afc_set(int afcbool); #ifdef SWIG %feature("docstring", "Get AFC. Always 0. MK3 has some built in AFC functionality."); #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 (none) to 100 (none again). 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. Returns 0 on success. On failure it returns (in order of actual operations) 1 if the SAADEV device couldn't be opened, 2 if the ioctl GETVIDEOSTD failed, 3 if GETVIDEOOPT failed, 4 if SETVIDEOSTD failed, 5 if SETVIDEOOPT failed, 6 if SDL_Init failed, 7 if SDL_SetVideoMode failed, 8 if SDL_CreateYUVOverlay failed, 9 if the ioctl CAPTUREON failed, and 10 if mmap failed."""); #endif int viewer_init(int width, int height); #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 ///////////////////////////////////////////////////////////////////