2001-11-17 00:23:48 +00:00
|
|
|
#ifndef TV_H
|
|
|
|
#define TV_H
|
2001-11-09 23:46:06 +00:00
|
|
|
|
2001-11-11 03:53:42 +00:00
|
|
|
extern int tv_param_on;
|
|
|
|
|
2001-11-09 23:46:06 +00:00
|
|
|
#ifdef USE_TV
|
2001-11-11 13:47:42 +00:00
|
|
|
//#include "../libao2/afmt.h"
|
|
|
|
//#include "../libvo/img_format.h"
|
|
|
|
//#include "../libvo/fastmemcpy.h"
|
|
|
|
//#include "mp_msg.h"
|
2001-11-10 23:32:10 +00:00
|
|
|
|
2001-11-11 15:45:23 +00:00
|
|
|
extern char *tv_param_freq;
|
2001-11-09 23:46:06 +00:00
|
|
|
extern char *tv_param_channel;
|
2001-11-17 00:23:48 +00:00
|
|
|
extern char *tv_param_chanlist;
|
2001-11-09 23:46:06 +00:00
|
|
|
extern char *tv_param_norm;
|
2003-08-07 12:24:35 +00:00
|
|
|
#ifdef HAVE_TV_V4L2
|
|
|
|
extern int tv_param_normid;
|
|
|
|
#endif
|
2001-11-09 23:46:06 +00:00
|
|
|
extern char *tv_param_device;
|
|
|
|
extern char *tv_param_driver;
|
|
|
|
extern int tv_param_width;
|
|
|
|
extern int tv_param_height;
|
2001-11-10 23:32:10 +00:00
|
|
|
extern int tv_param_input;
|
2003-08-13 18:56:29 +00:00
|
|
|
extern int tv_param_outfmt;
|
2001-12-03 16:49:55 +00:00
|
|
|
extern float tv_param_fps;
|
2002-12-28 22:57:39 +00:00
|
|
|
extern char **tv_param_channels;
|
2002-03-15 17:58:19 +00:00
|
|
|
extern int tv_param_noaudio;
|
2002-04-12 10:40:38 +00:00
|
|
|
extern int tv_param_immediate;
|
|
|
|
extern int tv_param_audiorate;
|
2003-08-07 12:24:35 +00:00
|
|
|
#if defined(HAVE_TV_V4L) || defined(HAVE_TV_V4L2)
|
2002-08-30 11:37:42 +00:00
|
|
|
extern int tv_param_amode;
|
2002-08-21 21:31:20 +00:00
|
|
|
extern int tv_param_audio_id;
|
2002-08-30 11:37:42 +00:00
|
|
|
extern int tv_param_volume;
|
|
|
|
extern int tv_param_bass;
|
|
|
|
extern int tv_param_treble;
|
|
|
|
extern int tv_param_balance;
|
|
|
|
extern int tv_param_forcechan;
|
2002-10-22 07:56:13 +00:00
|
|
|
extern int tv_param_force_audio;
|
2002-10-25 09:42:41 +00:00
|
|
|
extern int tv_param_buffer_size;
|
2003-03-19 16:26:58 +00:00
|
|
|
extern int tv_param_mjpeg;
|
|
|
|
extern int tv_param_decimation;
|
|
|
|
extern int tv_param_quality;
|
2002-08-21 21:31:20 +00:00
|
|
|
#ifdef HAVE_ALSA9
|
|
|
|
extern int tv_param_alsa;
|
|
|
|
#endif
|
|
|
|
extern char* tv_param_adevice;
|
|
|
|
#endif
|
2003-03-23 15:05:14 +00:00
|
|
|
extern int tv_param_brightness;
|
|
|
|
extern int tv_param_contrast;
|
|
|
|
extern int tv_param_hue;
|
|
|
|
extern int tv_param_saturation;
|
2001-11-09 23:46:06 +00:00
|
|
|
|
|
|
|
typedef struct tvi_info_s
|
|
|
|
{
|
|
|
|
const char *name;
|
|
|
|
const char *short_name;
|
|
|
|
const char *author;
|
|
|
|
const char *comment;
|
|
|
|
} tvi_info_t;
|
|
|
|
|
|
|
|
typedef struct tvi_functions_s
|
|
|
|
{
|
|
|
|
int (*init)();
|
2001-11-10 23:32:10 +00:00
|
|
|
int (*uninit)();
|
2001-11-09 23:46:06 +00:00
|
|
|
int (*control)();
|
2001-11-10 23:32:10 +00:00
|
|
|
int (*start)();
|
2002-04-12 10:40:38 +00:00
|
|
|
double (*grab_video_frame)();
|
|
|
|
#ifdef HAVE_TV_BSDBT848
|
|
|
|
double (*grabimmediate_video_frame)();
|
|
|
|
#endif
|
2001-11-09 23:46:06 +00:00
|
|
|
int (*get_video_framesize)();
|
2002-04-12 10:40:38 +00:00
|
|
|
double (*grab_audio_frame)();
|
2001-11-09 23:46:06 +00:00
|
|
|
int (*get_audio_framesize)();
|
|
|
|
} tvi_functions_t;
|
|
|
|
|
|
|
|
typedef struct tvi_handle_s {
|
2001-11-10 23:32:10 +00:00
|
|
|
tvi_info_t *info;
|
|
|
|
tvi_functions_t *functions;
|
|
|
|
void *priv;
|
|
|
|
int seq;
|
2001-11-17 00:23:48 +00:00
|
|
|
|
|
|
|
/* specific */
|
|
|
|
int norm;
|
|
|
|
int chanlist;
|
|
|
|
struct CHANLIST *chanlist_s;
|
|
|
|
int channel;
|
2001-11-09 23:46:06 +00:00
|
|
|
} tvi_handle_t;
|
|
|
|
|
2002-12-28 22:57:39 +00:00
|
|
|
typedef struct tv_channels_s {
|
|
|
|
int index;
|
|
|
|
char number[5];
|
|
|
|
char name[20];
|
|
|
|
int freq;
|
|
|
|
struct tv_channels_s *next;
|
|
|
|
struct tv_channels_s *prev;
|
|
|
|
} tv_channels_t;
|
|
|
|
|
|
|
|
tv_channels_t *tv_channel_list;
|
|
|
|
tv_channels_t *tv_channel_current, *tv_channel_last;
|
|
|
|
char *tv_channel_last_real;
|
2001-11-10 23:32:10 +00:00
|
|
|
|
2001-11-09 23:46:06 +00:00
|
|
|
#define TVI_CONTROL_FALSE 0
|
|
|
|
#define TVI_CONTROL_TRUE 1
|
|
|
|
#define TVI_CONTROL_NA -1
|
|
|
|
#define TVI_CONTROL_UNKNOWN -2
|
|
|
|
|
2001-11-10 23:32:10 +00:00
|
|
|
/* ======================== CONTROLS =========================== */
|
|
|
|
|
|
|
|
/* GENERIC controls */
|
|
|
|
#define TVI_CONTROL_IS_AUDIO 0x1
|
|
|
|
#define TVI_CONTROL_IS_VIDEO 0x2
|
|
|
|
#define TVI_CONTROL_IS_TUNER 0x3
|
2002-08-21 21:31:20 +00:00
|
|
|
#define TVI_CONTROL_IMMEDIATE 0x4
|
2001-11-10 23:32:10 +00:00
|
|
|
|
|
|
|
/* VIDEO controls */
|
|
|
|
#define TVI_CONTROL_VID_GET_FPS 0x101
|
|
|
|
#define TVI_CONTROL_VID_GET_PLANES 0x102
|
|
|
|
#define TVI_CONTROL_VID_GET_BITS 0x103
|
|
|
|
#define TVI_CONTROL_VID_CHK_BITS 0x104
|
|
|
|
#define TVI_CONTROL_VID_SET_BITS 0x105
|
|
|
|
#define TVI_CONTROL_VID_GET_FORMAT 0x106
|
|
|
|
#define TVI_CONTROL_VID_CHK_FORMAT 0x107
|
|
|
|
#define TVI_CONTROL_VID_SET_FORMAT 0x108
|
|
|
|
#define TVI_CONTROL_VID_GET_WIDTH 0x109
|
|
|
|
#define TVI_CONTROL_VID_CHK_WIDTH 0x110
|
|
|
|
#define TVI_CONTROL_VID_SET_WIDTH 0x111
|
|
|
|
#define TVI_CONTROL_VID_GET_HEIGHT 0x112
|
|
|
|
#define TVI_CONTROL_VID_CHK_HEIGHT 0x113
|
|
|
|
#define TVI_CONTROL_VID_SET_HEIGHT 0x114
|
2001-11-16 22:59:07 +00:00
|
|
|
#define TVI_CONTROL_VID_GET_BRIGHTNESS 0x115
|
|
|
|
#define TVI_CONTROL_VID_SET_BRIGHTNESS 0x116
|
|
|
|
#define TVI_CONTROL_VID_GET_HUE 0x117
|
|
|
|
#define TVI_CONTROL_VID_SET_HUE 0x118
|
|
|
|
#define TVI_CONTROL_VID_GET_SATURATION 0x119
|
|
|
|
#define TVI_CONTROL_VID_SET_SATURATION 0x11a
|
|
|
|
#define TVI_CONTROL_VID_GET_CONTRAST 0x11b
|
|
|
|
#define TVI_CONTROL_VID_SET_CONTRAST 0x11c
|
|
|
|
#define TVI_CONTROL_VID_GET_PICTURE 0x11d
|
|
|
|
#define TVI_CONTROL_VID_SET_PICTURE 0x11e
|
2001-11-10 23:32:10 +00:00
|
|
|
|
|
|
|
/* TUNER controls */
|
|
|
|
#define TVI_CONTROL_TUN_GET_FREQ 0x201
|
|
|
|
#define TVI_CONTROL_TUN_SET_FREQ 0x202
|
|
|
|
#define TVI_CONTROL_TUN_GET_TUNER 0x203 /* update priv->tuner struct for used input */
|
|
|
|
#define TVI_CONTROL_TUN_SET_TUNER 0x204 /* update priv->tuner struct for used input */
|
|
|
|
#define TVI_CONTROL_TUN_GET_NORM 0x205
|
|
|
|
#define TVI_CONTROL_TUN_SET_NORM 0x206
|
|
|
|
|
|
|
|
/* AUDIO controls */
|
|
|
|
#define TVI_CONTROL_AUD_GET_FORMAT 0x301
|
|
|
|
#define TVI_CONTROL_AUD_GET_SAMPLERATE 0x302
|
|
|
|
#define TVI_CONTROL_AUD_GET_SAMPLESIZE 0x303
|
|
|
|
#define TVI_CONTROL_AUD_GET_CHANNELS 0x304
|
2002-04-12 10:40:38 +00:00
|
|
|
#define TVI_CONTROL_AUD_SET_SAMPLERATE 0x305
|
2001-11-10 23:32:10 +00:00
|
|
|
|
|
|
|
/* SPECIFIC controls */
|
|
|
|
#define TVI_CONTROL_SPC_GET_INPUT 0x401 /* set input channel (tv,s-video,composite..) */
|
|
|
|
#define TVI_CONTROL_SPC_SET_INPUT 0x402 /* set input channel (tv,s-video,composite..) */
|
2001-11-09 23:46:06 +00:00
|
|
|
|
2001-11-10 23:32:10 +00:00
|
|
|
extern tvi_handle_t *tv_begin(void);
|
|
|
|
extern int tv_init(tvi_handle_t *tvh);
|
2001-11-16 21:30:10 +00:00
|
|
|
extern int tv_uninit(tvi_handle_t *tvh);
|
2001-11-09 23:46:06 +00:00
|
|
|
|
2001-11-17 00:23:48 +00:00
|
|
|
int tv_set_color_options(tvi_handle_t *tvh, int opt, int val);
|
2001-11-16 22:59:07 +00:00
|
|
|
#define TV_COLOR_BRIGHTNESS 1
|
|
|
|
#define TV_COLOR_HUE 2
|
|
|
|
#define TV_COLOR_SATURATION 3
|
|
|
|
#define TV_COLOR_CONTRAST 4
|
|
|
|
|
2002-12-28 22:57:39 +00:00
|
|
|
int tv_step_channel_real(tvi_handle_t *tvh, int direction);
|
2001-11-17 00:23:48 +00:00
|
|
|
int tv_step_channel(tvi_handle_t *tvh, int direction);
|
|
|
|
#define TV_CHANNEL_LOWER 1
|
|
|
|
#define TV_CHANNEL_HIGHER 2
|
|
|
|
|
2002-12-28 22:57:39 +00:00
|
|
|
int tv_last_channel(tvi_handle_t *tvh);
|
|
|
|
|
|
|
|
int tv_set_channel_real(tvi_handle_t *tvh, char *channel);
|
2002-12-19 10:09:43 +00:00
|
|
|
int tv_set_channel(tvi_handle_t *tvh, char *channel);
|
|
|
|
|
2001-11-17 00:23:48 +00:00
|
|
|
int tv_step_norm(tvi_handle_t *tvh);
|
|
|
|
int tv_step_chanlist(tvi_handle_t *tvh);
|
|
|
|
|
2003-08-04 09:13:10 +00:00
|
|
|
int tv_set_freq(tvi_handle_t *tvh, unsigned long freq);
|
|
|
|
int tv_get_freq(tvi_handle_t *tvh, unsigned long *freq);
|
|
|
|
|
|
|
|
int tv_set_norm(tvi_handle_t *tvh, char* norm);
|
|
|
|
|
2001-11-17 00:23:48 +00:00
|
|
|
#define TV_NORM_PAL 1
|
|
|
|
#define TV_NORM_NTSC 2
|
|
|
|
#define TV_NORM_SECAM 3
|
2002-12-16 17:05:49 +00:00
|
|
|
#define TV_NORM_PALNC 4
|
|
|
|
#define TV_NORM_PALM 5
|
|
|
|
#define TV_NORM_PALN 6
|
|
|
|
#define TV_NORM_NTSCJP 7
|
2001-11-17 00:23:48 +00:00
|
|
|
|
2001-11-09 23:46:06 +00:00
|
|
|
#endif /* USE_TV */
|
2001-11-17 00:23:48 +00:00
|
|
|
|
|
|
|
#endif /* TV_H */
|