Mercurial > mplayer.hg
annotate stream/tv.h @ 23889:0ad7037df91f
Removing global variables from tv://
Step 8 (last): removing old globals from tv.c, tv.h,
fixing remaining references in cfg-common.h and mplayer.c
author | voroshil |
---|---|
date | Sun, 29 Jul 2007 10:30:41 +0000 |
parents | d65439444b75 |
children | b5cc28c45d73 |
rev | line source |
---|---|
2941
60c1b7c0ea21
added support for norm=,chanlist=,channel= and also on-the-fly channel chaning with keys
alex
parents:
2937
diff
changeset
|
1 #ifndef TV_H |
60c1b7c0ea21
added support for norm=,chanlist=,channel= and also on-the-fly channel chaning with keys
alex
parents:
2937
diff
changeset
|
2 #define TV_H |
2790 | 3 |
17012 | 4 //#include "libao2/afmt.h" |
19431
ac69ba536915
Explicitly include libmpcodecs/img_format.h and libvo/fastmemcpy.h.
diego
parents:
19271
diff
changeset
|
5 //#include "libmpcodecs/img_format.h" |
2830 | 6 //#include "mp_msg.h" |
2802 | 7 |
23882 | 8 typedef struct tv_param_s { |
9 char *freq; | |
10 char *channel; | |
11 char *chanlist; | |
12 char *norm; | |
13 int automute; | |
14 #ifdef HAVE_TV_V4L2 | |
15 int normid; | |
16 #endif | |
17 char *device; | |
18 char *driver; | |
19 int width; | |
20 int height; | |
21 int input; | |
22 int outfmt; | |
23 float fps; | |
24 char **channels; | |
25 int noaudio; | |
26 int immediate; | |
27 int audiorate; | |
28 int audio_id; | |
29 #if defined(HAVE_TV_V4L) | |
30 int amode; | |
31 int volume; | |
32 int bass; | |
33 int treble; | |
34 int balance; | |
35 int forcechan; | |
36 int force_audio; | |
37 int buffer_size; | |
38 int mjpeg; | |
39 int decimation; | |
40 int quality; | |
41 #if defined(HAVE_ALSA9) || defined(HAVE_ALSA1X) | |
42 int alsa; | |
43 #endif | |
44 char* adevice; | |
45 #endif | |
46 int brightness; | |
47 int contrast; | |
48 int hue; | |
49 int saturation; | |
50 } tv_param_t; | |
51 | |
52 extern tv_param_t stream_tv_defaults; | |
53 | |
2790 | 54 typedef struct tvi_info_s |
55 { | |
23883 | 56 struct tvi_handle_s * (*tvi_init)(tv_param_t* tv_param); |
2790 | 57 const char *name; |
58 const char *short_name; | |
59 const char *author; | |
60 const char *comment; | |
61 } tvi_info_t; | |
62 | |
63 typedef struct tvi_functions_s | |
64 { | |
65 int (*init)(); | |
2802 | 66 int (*uninit)(); |
2790 | 67 int (*control)(); |
2802 | 68 int (*start)(); |
5572
8cd761968f35
BSD-BT848 TV update patch by Charles Henrich <henrich@sigbus.com>
arpi
parents:
5098
diff
changeset
|
69 double (*grab_video_frame)(); |
2790 | 70 int (*get_video_framesize)(); |
5572
8cd761968f35
BSD-BT848 TV update patch by Charles Henrich <henrich@sigbus.com>
arpi
parents:
5098
diff
changeset
|
71 double (*grab_audio_frame)(); |
2790 | 72 int (*get_audio_framesize)(); |
73 } tvi_functions_t; | |
74 | |
75 typedef struct tvi_handle_s { | |
2802 | 76 tvi_functions_t *functions; |
77 void *priv; | |
78 int seq; | |
2941
60c1b7c0ea21
added support for norm=,chanlist=,channel= and also on-the-fly channel chaning with keys
alex
parents:
2937
diff
changeset
|
79 |
60c1b7c0ea21
added support for norm=,chanlist=,channel= and also on-the-fly channel chaning with keys
alex
parents:
2937
diff
changeset
|
80 /* specific */ |
60c1b7c0ea21
added support for norm=,chanlist=,channel= and also on-the-fly channel chaning with keys
alex
parents:
2937
diff
changeset
|
81 int norm; |
60c1b7c0ea21
added support for norm=,chanlist=,channel= and also on-the-fly channel chaning with keys
alex
parents:
2937
diff
changeset
|
82 int chanlist; |
18032
de6740c3ab2a
10l: huge amount of constant crap in data segment
rfelker
parents:
17012
diff
changeset
|
83 const struct CHANLIST *chanlist_s; |
2941
60c1b7c0ea21
added support for norm=,chanlist=,channel= and also on-the-fly channel chaning with keys
alex
parents:
2937
diff
changeset
|
84 int channel; |
23882 | 85 tv_param_t * tv_param; |
2790 | 86 } tvi_handle_t; |
87 | |
8627
14ab71b47a58
user friendly channel tuning + 10L fix in tvi_v4l (by Stephane Jourdois)
henry
parents:
8494
diff
changeset
|
88 typedef struct tv_channels_s { |
14ab71b47a58
user friendly channel tuning + 10L fix in tvi_v4l (by Stephane Jourdois)
henry
parents:
8494
diff
changeset
|
89 int index; |
14ab71b47a58
user friendly channel tuning + 10L fix in tvi_v4l (by Stephane Jourdois)
henry
parents:
8494
diff
changeset
|
90 char number[5]; |
14ab71b47a58
user friendly channel tuning + 10L fix in tvi_v4l (by Stephane Jourdois)
henry
parents:
8494
diff
changeset
|
91 char name[20]; |
14ab71b47a58
user friendly channel tuning + 10L fix in tvi_v4l (by Stephane Jourdois)
henry
parents:
8494
diff
changeset
|
92 int freq; |
14ab71b47a58
user friendly channel tuning + 10L fix in tvi_v4l (by Stephane Jourdois)
henry
parents:
8494
diff
changeset
|
93 struct tv_channels_s *next; |
14ab71b47a58
user friendly channel tuning + 10L fix in tvi_v4l (by Stephane Jourdois)
henry
parents:
8494
diff
changeset
|
94 struct tv_channels_s *prev; |
14ab71b47a58
user friendly channel tuning + 10L fix in tvi_v4l (by Stephane Jourdois)
henry
parents:
8494
diff
changeset
|
95 } tv_channels_t; |
14ab71b47a58
user friendly channel tuning + 10L fix in tvi_v4l (by Stephane Jourdois)
henry
parents:
8494
diff
changeset
|
96 |
14607
7a80c6ac5058
several sets of headers declare global variables in them, which causes multiple definition errors with gcc 4.x
iive
parents:
13978
diff
changeset
|
97 extern tv_channels_t *tv_channel_list; |
7a80c6ac5058
several sets of headers declare global variables in them, which causes multiple definition errors with gcc 4.x
iive
parents:
13978
diff
changeset
|
98 extern tv_channels_t *tv_channel_current, *tv_channel_last; |
7a80c6ac5058
several sets of headers declare global variables in them, which causes multiple definition errors with gcc 4.x
iive
parents:
13978
diff
changeset
|
99 extern char *tv_channel_last_real; |
2802 | 100 |
2790 | 101 #define TVI_CONTROL_FALSE 0 |
102 #define TVI_CONTROL_TRUE 1 | |
103 #define TVI_CONTROL_NA -1 | |
104 #define TVI_CONTROL_UNKNOWN -2 | |
105 | |
2802 | 106 /* ======================== CONTROLS =========================== */ |
2790 | 107 |
2802 | 108 /* GENERIC controls */ |
109 #define TVI_CONTROL_IS_AUDIO 0x1 | |
110 #define TVI_CONTROL_IS_VIDEO 0x2 | |
111 #define TVI_CONTROL_IS_TUNER 0x3 | |
7058
2e5c07262861
new v4l capture patch by Jindrich Makovicka <makovick@kmlinux.fjfi.cvut.cz>:
arpi
parents:
5572
diff
changeset
|
112 #define TVI_CONTROL_IMMEDIATE 0x4 |
2802 | 113 |
114 /* VIDEO controls */ | |
115 #define TVI_CONTROL_VID_GET_FPS 0x101 | |
116 #define TVI_CONTROL_VID_GET_PLANES 0x102 | |
117 #define TVI_CONTROL_VID_GET_BITS 0x103 | |
118 #define TVI_CONTROL_VID_CHK_BITS 0x104 | |
119 #define TVI_CONTROL_VID_SET_BITS 0x105 | |
120 #define TVI_CONTROL_VID_GET_FORMAT 0x106 | |
121 #define TVI_CONTROL_VID_CHK_FORMAT 0x107 | |
122 #define TVI_CONTROL_VID_SET_FORMAT 0x108 | |
123 #define TVI_CONTROL_VID_GET_WIDTH 0x109 | |
124 #define TVI_CONTROL_VID_CHK_WIDTH 0x110 | |
125 #define TVI_CONTROL_VID_SET_WIDTH 0x111 | |
126 #define TVI_CONTROL_VID_GET_HEIGHT 0x112 | |
127 #define TVI_CONTROL_VID_CHK_HEIGHT 0x113 | |
128 #define TVI_CONTROL_VID_SET_HEIGHT 0x114 | |
2937 | 129 #define TVI_CONTROL_VID_GET_BRIGHTNESS 0x115 |
130 #define TVI_CONTROL_VID_SET_BRIGHTNESS 0x116 | |
131 #define TVI_CONTROL_VID_GET_HUE 0x117 | |
132 #define TVI_CONTROL_VID_SET_HUE 0x118 | |
133 #define TVI_CONTROL_VID_GET_SATURATION 0x119 | |
134 #define TVI_CONTROL_VID_SET_SATURATION 0x11a | |
135 #define TVI_CONTROL_VID_GET_CONTRAST 0x11b | |
136 #define TVI_CONTROL_VID_SET_CONTRAST 0x11c | |
137 #define TVI_CONTROL_VID_GET_PICTURE 0x11d | |
138 #define TVI_CONTROL_VID_SET_PICTURE 0x11e | |
2790 | 139 |
2802 | 140 /* TUNER controls */ |
141 #define TVI_CONTROL_TUN_GET_FREQ 0x201 | |
142 #define TVI_CONTROL_TUN_SET_FREQ 0x202 | |
143 #define TVI_CONTROL_TUN_GET_TUNER 0x203 /* update priv->tuner struct for used input */ | |
144 #define TVI_CONTROL_TUN_SET_TUNER 0x204 /* update priv->tuner struct for used input */ | |
145 #define TVI_CONTROL_TUN_GET_NORM 0x205 | |
146 #define TVI_CONTROL_TUN_SET_NORM 0x206 | |
147 | |
148 /* AUDIO controls */ | |
149 #define TVI_CONTROL_AUD_GET_FORMAT 0x301 | |
150 #define TVI_CONTROL_AUD_GET_SAMPLERATE 0x302 | |
151 #define TVI_CONTROL_AUD_GET_SAMPLESIZE 0x303 | |
152 #define TVI_CONTROL_AUD_GET_CHANNELS 0x304 | |
5572
8cd761968f35
BSD-BT848 TV update patch by Charles Henrich <henrich@sigbus.com>
arpi
parents:
5098
diff
changeset
|
153 #define TVI_CONTROL_AUD_SET_SAMPLERATE 0x305 |
2802 | 154 |
155 /* SPECIFIC controls */ | |
156 #define TVI_CONTROL_SPC_GET_INPUT 0x401 /* set input channel (tv,s-video,composite..) */ | |
157 #define TVI_CONTROL_SPC_SET_INPUT 0x402 /* set input channel (tv,s-video,composite..) */ | |
13978 | 158 #define TVI_CONTROL_SPC_GET_NORMID 0x403 /* get normid from norm name */ |
2802 | 159 |
2941
60c1b7c0ea21
added support for norm=,chanlist=,channel= and also on-the-fly channel chaning with keys
alex
parents:
2937
diff
changeset
|
160 int tv_set_color_options(tvi_handle_t *tvh, int opt, int val); |
18172
90b62d7c0fca
Implement tv_get_color_options() and make tv_set_color_options() return
albeu
parents:
18032
diff
changeset
|
161 int tv_get_color_options(tvi_handle_t *tvh, int opt, int* val); |
2937 | 162 #define TV_COLOR_BRIGHTNESS 1 |
163 #define TV_COLOR_HUE 2 | |
164 #define TV_COLOR_SATURATION 3 | |
165 #define TV_COLOR_CONTRAST 4 | |
166 | |
8627
14ab71b47a58
user friendly channel tuning + 10L fix in tvi_v4l (by Stephane Jourdois)
henry
parents:
8494
diff
changeset
|
167 int tv_step_channel_real(tvi_handle_t *tvh, int direction); |
2941
60c1b7c0ea21
added support for norm=,chanlist=,channel= and also on-the-fly channel chaning with keys
alex
parents:
2937
diff
changeset
|
168 int tv_step_channel(tvi_handle_t *tvh, int direction); |
60c1b7c0ea21
added support for norm=,chanlist=,channel= and also on-the-fly channel chaning with keys
alex
parents:
2937
diff
changeset
|
169 #define TV_CHANNEL_LOWER 1 |
60c1b7c0ea21
added support for norm=,chanlist=,channel= and also on-the-fly channel chaning with keys
alex
parents:
2937
diff
changeset
|
170 #define TV_CHANNEL_HIGHER 2 |
60c1b7c0ea21
added support for norm=,chanlist=,channel= and also on-the-fly channel chaning with keys
alex
parents:
2937
diff
changeset
|
171 |
8627
14ab71b47a58
user friendly channel tuning + 10L fix in tvi_v4l (by Stephane Jourdois)
henry
parents:
8494
diff
changeset
|
172 int tv_last_channel(tvi_handle_t *tvh); |
14ab71b47a58
user friendly channel tuning + 10L fix in tvi_v4l (by Stephane Jourdois)
henry
parents:
8494
diff
changeset
|
173 |
14ab71b47a58
user friendly channel tuning + 10L fix in tvi_v4l (by Stephane Jourdois)
henry
parents:
8494
diff
changeset
|
174 int tv_set_channel_real(tvi_handle_t *tvh, char *channel); |
8494 | 175 int tv_set_channel(tvi_handle_t *tvh, char *channel); |
176 | |
2941
60c1b7c0ea21
added support for norm=,chanlist=,channel= and also on-the-fly channel chaning with keys
alex
parents:
2937
diff
changeset
|
177 int tv_step_norm(tvi_handle_t *tvh); |
60c1b7c0ea21
added support for norm=,chanlist=,channel= and also on-the-fly channel chaning with keys
alex
parents:
2937
diff
changeset
|
178 int tv_step_chanlist(tvi_handle_t *tvh); |
60c1b7c0ea21
added support for norm=,chanlist=,channel= and also on-the-fly channel chaning with keys
alex
parents:
2937
diff
changeset
|
179 |
10521
141141fdd250
I'd like to change tv tuner frequency in the slave mode. So this patch
gabucino
parents:
9663
diff
changeset
|
180 int tv_set_freq(tvi_handle_t *tvh, unsigned long freq); |
141141fdd250
I'd like to change tv tuner frequency in the slave mode. So this patch
gabucino
parents:
9663
diff
changeset
|
181 int tv_get_freq(tvi_handle_t *tvh, unsigned long *freq); |
22667 | 182 int tv_step_freq(tvi_handle_t *tvh, float step_interval); |
10521
141141fdd250
I'd like to change tv tuner frequency in the slave mode. So this patch
gabucino
parents:
9663
diff
changeset
|
183 |
141141fdd250
I'd like to change tv tuner frequency in the slave mode. So this patch
gabucino
parents:
9663
diff
changeset
|
184 int tv_set_norm(tvi_handle_t *tvh, char* norm); |
141141fdd250
I'd like to change tv tuner frequency in the slave mode. So this patch
gabucino
parents:
9663
diff
changeset
|
185 |
2941
60c1b7c0ea21
added support for norm=,chanlist=,channel= and also on-the-fly channel chaning with keys
alex
parents:
2937
diff
changeset
|
186 #define TV_NORM_PAL 1 |
60c1b7c0ea21
added support for norm=,chanlist=,channel= and also on-the-fly channel chaning with keys
alex
parents:
2937
diff
changeset
|
187 #define TV_NORM_NTSC 2 |
60c1b7c0ea21
added support for norm=,chanlist=,channel= and also on-the-fly channel chaning with keys
alex
parents:
2937
diff
changeset
|
188 #define TV_NORM_SECAM 3 |
8477 | 189 #define TV_NORM_PALNC 4 |
190 #define TV_NORM_PALM 5 | |
191 #define TV_NORM_PALN 6 | |
192 #define TV_NORM_NTSCJP 7 | |
2941
60c1b7c0ea21
added support for norm=,chanlist=,channel= and also on-the-fly channel chaning with keys
alex
parents:
2937
diff
changeset
|
193 |
60c1b7c0ea21
added support for norm=,chanlist=,channel= and also on-the-fly channel chaning with keys
alex
parents:
2937
diff
changeset
|
194 #endif /* TV_H */ |