Mercurial > mplayer.hg
annotate stream/stream_pvr.c @ 23244:e5e8ac0bd7fc
support for PVR channel navigation (patch by Sven Gothel <sgothel at jausoft dot com>)
author | ben |
---|---|
date | Tue, 08 May 2007 12:20:46 +0000 |
parents | 9a4634744b41 |
children | 40a82b61fd79 |
rev | line source |
---|---|
18997 | 1 /* |
2 * Copyright (C) 2006 Benjamin Zores | |
19992
be7b8a83649c
removed ivtv driver dependancy in favor of native V4L2 MPEG API (requires Linux 2.6.18 and above)
ben
parents:
19976
diff
changeset
|
3 * Stream layer for hardware MPEG 1/2/4 encoders a.k.a PVR |
be7b8a83649c
removed ivtv driver dependancy in favor of native V4L2 MPEG API (requires Linux 2.6.18 and above)
ben
parents:
19976
diff
changeset
|
4 * (such as WinTV PVR-150/250/350/500 (a.k.a IVTV), pvrusb2 and cx88). |
18997 | 5 * See http://ivtvdriver.org/index.php/Main_Page for more details on the |
6 * cards supported by the ivtv driver. | |
7 * | |
8 * This program is free software; you can redistribute it and/or modify | |
9 * it under the terms of the GNU General Public License as published by | |
10 * the Free Software Foundation; either version 2 of the License, or | |
11 * (at your option) any later version. | |
12 * | |
13 * This program is distributed in the hope that it will be useful, | |
14 * but WITHOUT ANY WARRANTY; without even the implied warranty of | |
15 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | |
16 * GNU General Public License for more details. | |
17 * | |
18 * You should have received a copy of the GNU General Public License | |
19 * along with this program; if not, write to the Free Software Foundation, | |
20 * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA | |
21 */ | |
22 | |
23 #include "config.h" | |
24 | |
25 #include <stdio.h> | |
26 #include <stdlib.h> | |
27 #include <unistd.h> | |
28 #include <string.h> | |
29 #include <ctype.h> | |
30 #include <sys/time.h> | |
31 #include <errno.h> | |
32 #include <sys/ioctl.h> | |
33 #include <sys/fcntl.h> | |
34 #include <inttypes.h> | |
35 #include <sys/poll.h> | |
19617
75063178d39f
fix build on some old 2.6 kernels, patch by Gernot Hillier
ben
parents:
19294
diff
changeset
|
36 #include <linux/types.h> |
18997 | 37 #include <linux/videodev2.h> |
38 | |
39 #include "mp_msg.h" | |
40 #include "help_mp.h" | |
41 | |
42 #include "stream.h" | |
23244
e5e8ac0bd7fc
support for PVR channel navigation (patch by Sven Gothel <sgothel at jausoft dot com>)
ben
parents:
23166
diff
changeset
|
43 #include "pvr.h" |
e5e8ac0bd7fc
support for PVR channel navigation (patch by Sven Gothel <sgothel at jausoft dot com>)
ben
parents:
23166
diff
changeset
|
44 |
e5e8ac0bd7fc
support for PVR channel navigation (patch by Sven Gothel <sgothel at jausoft dot com>)
ben
parents:
23166
diff
changeset
|
45 #include "frequencies.h" |
e5e8ac0bd7fc
support for PVR channel navigation (patch by Sven Gothel <sgothel at jausoft dot com>)
ben
parents:
23166
diff
changeset
|
46 #include "libavutil/common.h" |
18997 | 47 |
48 #define PVR_DEFAULT_DEVICE "/dev/video0" | |
19992
be7b8a83649c
removed ivtv driver dependancy in favor of native V4L2 MPEG API (requires Linux 2.6.18 and above)
ben
parents:
19976
diff
changeset
|
49 #define PVR_MAX_CONTROLS 10 |
18997 | 50 |
51 /* logging mechanisms */ | |
52 #define LOG_LEVEL_PVR "[pvr]" | |
53 #define LOG_LEVEL_V4L2 "[v4l2]" | |
19976
281ac13bf72d
cosmetic renames because pvr support will soon be less ivtv driver dependant
ben
parents:
19617
diff
changeset
|
54 #define LOG_LEVEL_ENCODER "[encoder]" |
18997 | 55 |
56 /* audio codec mode */ | |
57 #define PVR_AUDIO_MODE_ARG_STEREO "stereo" | |
58 #define PVR_AUDIO_MODE_ARG_JOINT_STEREO "joint_stereo" | |
59 #define PVR_AUDIO_MODE_ARG_DUAL "dual" | |
60 #define PVR_AUDIO_MODE_ARG_MONO "mono" | |
61 | |
62 /* video codec bitrate mode */ | |
63 #define PVR_VIDEO_BITRATE_MODE_ARG_VBR "vbr" | |
64 #define PVR_VIDEO_BITRATE_MODE_ARG_CBR "cbr" | |
65 | |
66 /* video codec stream type */ | |
67 #define PVR_VIDEO_STREAM_TYPE_PS "ps" | |
68 #define PVR_VIDEO_STREAM_TYPE_TS "ts" | |
69 #define PVR_VIDEO_STREAM_TYPE_MPEG1 "mpeg1" | |
70 #define PVR_VIDEO_STREAM_TYPE_DVD "dvd" | |
71 #define PVR_VIDEO_STREAM_TYPE_VCD "vcd" | |
72 #define PVR_VIDEO_STREAM_TYPE_SVCD "svcd" | |
73 | |
23244
e5e8ac0bd7fc
support for PVR channel navigation (patch by Sven Gothel <sgothel at jausoft dot com>)
ben
parents:
23166
diff
changeset
|
74 #define PVR_STATION_NAME_SIZE 256 |
e5e8ac0bd7fc
support for PVR channel navigation (patch by Sven Gothel <sgothel at jausoft dot com>)
ben
parents:
23166
diff
changeset
|
75 |
18997 | 76 /* command line arguments */ |
77 int pvr_param_aspect_ratio = 0; | |
78 int pvr_param_sample_rate = 0; | |
79 int pvr_param_audio_layer = 0; | |
80 int pvr_param_audio_bitrate = 0; | |
81 char *pvr_param_audio_mode = NULL; | |
82 int pvr_param_bitrate = 0; | |
83 char *pvr_param_bitrate_mode = NULL; | |
84 int pvr_param_bitrate_peak = 0; | |
85 char *pvr_param_stream_type = NULL; | |
86 | |
23244
e5e8ac0bd7fc
support for PVR channel navigation (patch by Sven Gothel <sgothel at jausoft dot com>)
ben
parents:
23166
diff
changeset
|
87 typedef struct station_elem_s { |
e5e8ac0bd7fc
support for PVR channel navigation (patch by Sven Gothel <sgothel at jausoft dot com>)
ben
parents:
23166
diff
changeset
|
88 char name[8]; |
e5e8ac0bd7fc
support for PVR channel navigation (patch by Sven Gothel <sgothel at jausoft dot com>)
ben
parents:
23166
diff
changeset
|
89 int freq; |
e5e8ac0bd7fc
support for PVR channel navigation (patch by Sven Gothel <sgothel at jausoft dot com>)
ben
parents:
23166
diff
changeset
|
90 char station[PVR_STATION_NAME_SIZE]; |
e5e8ac0bd7fc
support for PVR channel navigation (patch by Sven Gothel <sgothel at jausoft dot com>)
ben
parents:
23166
diff
changeset
|
91 int enabled; |
e5e8ac0bd7fc
support for PVR channel navigation (patch by Sven Gothel <sgothel at jausoft dot com>)
ben
parents:
23166
diff
changeset
|
92 } station_elem_t; |
e5e8ac0bd7fc
support for PVR channel navigation (patch by Sven Gothel <sgothel at jausoft dot com>)
ben
parents:
23166
diff
changeset
|
93 |
e5e8ac0bd7fc
support for PVR channel navigation (patch by Sven Gothel <sgothel at jausoft dot com>)
ben
parents:
23166
diff
changeset
|
94 typedef struct stationlist_s { |
e5e8ac0bd7fc
support for PVR channel navigation (patch by Sven Gothel <sgothel at jausoft dot com>)
ben
parents:
23166
diff
changeset
|
95 char name[PVR_STATION_NAME_SIZE]; |
e5e8ac0bd7fc
support for PVR channel navigation (patch by Sven Gothel <sgothel at jausoft dot com>)
ben
parents:
23166
diff
changeset
|
96 station_elem_t *list; |
e5e8ac0bd7fc
support for PVR channel navigation (patch by Sven Gothel <sgothel at jausoft dot com>)
ben
parents:
23166
diff
changeset
|
97 int total; /* total number */ |
e5e8ac0bd7fc
support for PVR channel navigation (patch by Sven Gothel <sgothel at jausoft dot com>)
ben
parents:
23166
diff
changeset
|
98 int used; /* used number */ |
e5e8ac0bd7fc
support for PVR channel navigation (patch by Sven Gothel <sgothel at jausoft dot com>)
ben
parents:
23166
diff
changeset
|
99 int enabled; /* enabled number */ |
e5e8ac0bd7fc
support for PVR channel navigation (patch by Sven Gothel <sgothel at jausoft dot com>)
ben
parents:
23166
diff
changeset
|
100 } stationlist_t; |
e5e8ac0bd7fc
support for PVR channel navigation (patch by Sven Gothel <sgothel at jausoft dot com>)
ben
parents:
23166
diff
changeset
|
101 |
18997 | 102 struct pvr_t { |
103 int dev_fd; | |
104 char *video_dev; | |
105 | |
106 /* v4l2 params */ | |
107 int mute; | |
108 int input; | |
109 int normid; | |
110 int brightness; | |
111 int contrast; | |
112 int hue; | |
113 int saturation; | |
114 int width; | |
115 int height; | |
23244
e5e8ac0bd7fc
support for PVR channel navigation (patch by Sven Gothel <sgothel at jausoft dot com>)
ben
parents:
23166
diff
changeset
|
116 int freq; |
e5e8ac0bd7fc
support for PVR channel navigation (patch by Sven Gothel <sgothel at jausoft dot com>)
ben
parents:
23166
diff
changeset
|
117 int chan_idx; |
e5e8ac0bd7fc
support for PVR channel navigation (patch by Sven Gothel <sgothel at jausoft dot com>)
ben
parents:
23166
diff
changeset
|
118 int chan_idx_last; |
e5e8ac0bd7fc
support for PVR channel navigation (patch by Sven Gothel <sgothel at jausoft dot com>)
ben
parents:
23166
diff
changeset
|
119 stationlist_t stationlist; |
e5e8ac0bd7fc
support for PVR channel navigation (patch by Sven Gothel <sgothel at jausoft dot com>)
ben
parents:
23166
diff
changeset
|
120 /* dups the tv_param_channel, or the url's channel param */ |
e5e8ac0bd7fc
support for PVR channel navigation (patch by Sven Gothel <sgothel at jausoft dot com>)
ben
parents:
23166
diff
changeset
|
121 char *param_channel; |
18997 | 122 |
19976
281ac13bf72d
cosmetic renames because pvr support will soon be less ivtv driver dependant
ben
parents:
19617
diff
changeset
|
123 /* encoder params */ |
18997 | 124 int aspect; |
125 int samplerate; | |
126 int layer; | |
127 int audio_rate; | |
128 int audio_mode; | |
129 int bitrate; | |
130 int bitrate_mode; | |
131 int bitrate_peak; | |
132 int stream_type; | |
133 }; | |
134 | |
135 static struct pvr_t * | |
136 pvr_init (void) | |
137 { | |
138 struct pvr_t *pvr = NULL; | |
139 | |
23244
e5e8ac0bd7fc
support for PVR channel navigation (patch by Sven Gothel <sgothel at jausoft dot com>)
ben
parents:
23166
diff
changeset
|
140 pvr = calloc (1, sizeof (struct pvr_t)); |
18997 | 141 pvr->dev_fd = -1; |
142 pvr->video_dev = strdup (PVR_DEFAULT_DEVICE); | |
143 | |
144 /* v4l2 params */ | |
145 pvr->mute = 0; | |
146 pvr->input = 0; | |
147 pvr->normid = -1; | |
148 pvr->brightness = 0; | |
149 pvr->contrast = 0; | |
150 pvr->hue = 0; | |
151 pvr->saturation = 0; | |
152 pvr->width = -1; | |
153 pvr->height = -1; | |
23244
e5e8ac0bd7fc
support for PVR channel navigation (patch by Sven Gothel <sgothel at jausoft dot com>)
ben
parents:
23166
diff
changeset
|
154 pvr->freq = -1; |
e5e8ac0bd7fc
support for PVR channel navigation (patch by Sven Gothel <sgothel at jausoft dot com>)
ben
parents:
23166
diff
changeset
|
155 pvr->chan_idx = -1; |
e5e8ac0bd7fc
support for PVR channel navigation (patch by Sven Gothel <sgothel at jausoft dot com>)
ben
parents:
23166
diff
changeset
|
156 pvr->chan_idx_last = -1; |
18997 | 157 |
19992
be7b8a83649c
removed ivtv driver dependancy in favor of native V4L2 MPEG API (requires Linux 2.6.18 and above)
ben
parents:
19976
diff
changeset
|
158 /* set default encoding settings |
be7b8a83649c
removed ivtv driver dependancy in favor of native V4L2 MPEG API (requires Linux 2.6.18 and above)
ben
parents:
19976
diff
changeset
|
159 * may be overlapped by user parameters |
be7b8a83649c
removed ivtv driver dependancy in favor of native V4L2 MPEG API (requires Linux 2.6.18 and above)
ben
parents:
19976
diff
changeset
|
160 * Use VBR MPEG_PS encoding at 6 Mbps (peak at 9.6 Mbps) |
be7b8a83649c
removed ivtv driver dependancy in favor of native V4L2 MPEG API (requires Linux 2.6.18 and above)
ben
parents:
19976
diff
changeset
|
161 * with 48 KHz L2 384 kbps audio. |
be7b8a83649c
removed ivtv driver dependancy in favor of native V4L2 MPEG API (requires Linux 2.6.18 and above)
ben
parents:
19976
diff
changeset
|
162 */ |
be7b8a83649c
removed ivtv driver dependancy in favor of native V4L2 MPEG API (requires Linux 2.6.18 and above)
ben
parents:
19976
diff
changeset
|
163 pvr->aspect = V4L2_MPEG_VIDEO_ASPECT_4x3; |
be7b8a83649c
removed ivtv driver dependancy in favor of native V4L2 MPEG API (requires Linux 2.6.18 and above)
ben
parents:
19976
diff
changeset
|
164 pvr->samplerate = V4L2_MPEG_AUDIO_SAMPLING_FREQ_48000; |
be7b8a83649c
removed ivtv driver dependancy in favor of native V4L2 MPEG API (requires Linux 2.6.18 and above)
ben
parents:
19976
diff
changeset
|
165 pvr->layer = V4L2_MPEG_AUDIO_ENCODING_LAYER_2; |
be7b8a83649c
removed ivtv driver dependancy in favor of native V4L2 MPEG API (requires Linux 2.6.18 and above)
ben
parents:
19976
diff
changeset
|
166 pvr->audio_rate = V4L2_MPEG_AUDIO_L2_BITRATE_384K; |
be7b8a83649c
removed ivtv driver dependancy in favor of native V4L2 MPEG API (requires Linux 2.6.18 and above)
ben
parents:
19976
diff
changeset
|
167 pvr->audio_mode = V4L2_MPEG_AUDIO_MODE_STEREO; |
be7b8a83649c
removed ivtv driver dependancy in favor of native V4L2 MPEG API (requires Linux 2.6.18 and above)
ben
parents:
19976
diff
changeset
|
168 pvr->bitrate = 6000000; |
be7b8a83649c
removed ivtv driver dependancy in favor of native V4L2 MPEG API (requires Linux 2.6.18 and above)
ben
parents:
19976
diff
changeset
|
169 pvr->bitrate_mode = V4L2_MPEG_VIDEO_BITRATE_MODE_VBR; |
be7b8a83649c
removed ivtv driver dependancy in favor of native V4L2 MPEG API (requires Linux 2.6.18 and above)
ben
parents:
19976
diff
changeset
|
170 pvr->bitrate_peak = 9600000; |
be7b8a83649c
removed ivtv driver dependancy in favor of native V4L2 MPEG API (requires Linux 2.6.18 and above)
ben
parents:
19976
diff
changeset
|
171 pvr->stream_type = V4L2_MPEG_STREAM_TYPE_MPEG2_PS; |
18997 | 172 |
173 return pvr; | |
174 } | |
175 | |
176 static void | |
177 pvr_uninit (struct pvr_t *pvr) | |
178 { | |
179 if (!pvr) | |
180 return; | |
181 | |
182 /* close device */ | |
183 if (pvr->dev_fd) | |
184 close (pvr->dev_fd); | |
185 | |
186 if (pvr->video_dev) | |
187 free (pvr->video_dev); | |
23244
e5e8ac0bd7fc
support for PVR channel navigation (patch by Sven Gothel <sgothel at jausoft dot com>)
ben
parents:
23166
diff
changeset
|
188 |
e5e8ac0bd7fc
support for PVR channel navigation (patch by Sven Gothel <sgothel at jausoft dot com>)
ben
parents:
23166
diff
changeset
|
189 if (pvr->stationlist.list) |
e5e8ac0bd7fc
support for PVR channel navigation (patch by Sven Gothel <sgothel at jausoft dot com>)
ben
parents:
23166
diff
changeset
|
190 free (pvr->stationlist.list); |
e5e8ac0bd7fc
support for PVR channel navigation (patch by Sven Gothel <sgothel at jausoft dot com>)
ben
parents:
23166
diff
changeset
|
191 |
e5e8ac0bd7fc
support for PVR channel navigation (patch by Sven Gothel <sgothel at jausoft dot com>)
ben
parents:
23166
diff
changeset
|
192 if (pvr->param_channel) |
e5e8ac0bd7fc
support for PVR channel navigation (patch by Sven Gothel <sgothel at jausoft dot com>)
ben
parents:
23166
diff
changeset
|
193 free (pvr->param_channel); |
e5e8ac0bd7fc
support for PVR channel navigation (patch by Sven Gothel <sgothel at jausoft dot com>)
ben
parents:
23166
diff
changeset
|
194 |
18997 | 195 free (pvr); |
196 } | |
197 | |
23244
e5e8ac0bd7fc
support for PVR channel navigation (patch by Sven Gothel <sgothel at jausoft dot com>)
ben
parents:
23166
diff
changeset
|
198 /** |
e5e8ac0bd7fc
support for PVR channel navigation (patch by Sven Gothel <sgothel at jausoft dot com>)
ben
parents:
23166
diff
changeset
|
199 * @brief Copy Constructor for stationlist |
e5e8ac0bd7fc
support for PVR channel navigation (patch by Sven Gothel <sgothel at jausoft dot com>)
ben
parents:
23166
diff
changeset
|
200 * |
e5e8ac0bd7fc
support for PVR channel navigation (patch by Sven Gothel <sgothel at jausoft dot com>)
ben
parents:
23166
diff
changeset
|
201 * @see parse_setup_stationlist |
e5e8ac0bd7fc
support for PVR channel navigation (patch by Sven Gothel <sgothel at jausoft dot com>)
ben
parents:
23166
diff
changeset
|
202 */ |
e5e8ac0bd7fc
support for PVR channel navigation (patch by Sven Gothel <sgothel at jausoft dot com>)
ben
parents:
23166
diff
changeset
|
203 static int |
e5e8ac0bd7fc
support for PVR channel navigation (patch by Sven Gothel <sgothel at jausoft dot com>)
ben
parents:
23166
diff
changeset
|
204 copycreate_stationlist (stationlist_t *stationlist, int num) |
e5e8ac0bd7fc
support for PVR channel navigation (patch by Sven Gothel <sgothel at jausoft dot com>)
ben
parents:
23166
diff
changeset
|
205 { |
e5e8ac0bd7fc
support for PVR channel navigation (patch by Sven Gothel <sgothel at jausoft dot com>)
ben
parents:
23166
diff
changeset
|
206 int i; |
e5e8ac0bd7fc
support for PVR channel navigation (patch by Sven Gothel <sgothel at jausoft dot com>)
ben
parents:
23166
diff
changeset
|
207 |
e5e8ac0bd7fc
support for PVR channel navigation (patch by Sven Gothel <sgothel at jausoft dot com>)
ben
parents:
23166
diff
changeset
|
208 if (chantab < 0 || !stationlist) |
e5e8ac0bd7fc
support for PVR channel navigation (patch by Sven Gothel <sgothel at jausoft dot com>)
ben
parents:
23166
diff
changeset
|
209 return -1; |
e5e8ac0bd7fc
support for PVR channel navigation (patch by Sven Gothel <sgothel at jausoft dot com>)
ben
parents:
23166
diff
changeset
|
210 |
e5e8ac0bd7fc
support for PVR channel navigation (patch by Sven Gothel <sgothel at jausoft dot com>)
ben
parents:
23166
diff
changeset
|
211 num = FFMAX (num, chanlists[chantab].count); |
e5e8ac0bd7fc
support for PVR channel navigation (patch by Sven Gothel <sgothel at jausoft dot com>)
ben
parents:
23166
diff
changeset
|
212 |
e5e8ac0bd7fc
support for PVR channel navigation (patch by Sven Gothel <sgothel at jausoft dot com>)
ben
parents:
23166
diff
changeset
|
213 if (stationlist->list) |
e5e8ac0bd7fc
support for PVR channel navigation (patch by Sven Gothel <sgothel at jausoft dot com>)
ben
parents:
23166
diff
changeset
|
214 { |
e5e8ac0bd7fc
support for PVR channel navigation (patch by Sven Gothel <sgothel at jausoft dot com>)
ben
parents:
23166
diff
changeset
|
215 free (stationlist->list); |
e5e8ac0bd7fc
support for PVR channel navigation (patch by Sven Gothel <sgothel at jausoft dot com>)
ben
parents:
23166
diff
changeset
|
216 stationlist->list = NULL; |
e5e8ac0bd7fc
support for PVR channel navigation (patch by Sven Gothel <sgothel at jausoft dot com>)
ben
parents:
23166
diff
changeset
|
217 } |
e5e8ac0bd7fc
support for PVR channel navigation (patch by Sven Gothel <sgothel at jausoft dot com>)
ben
parents:
23166
diff
changeset
|
218 |
e5e8ac0bd7fc
support for PVR channel navigation (patch by Sven Gothel <sgothel at jausoft dot com>)
ben
parents:
23166
diff
changeset
|
219 stationlist->total = 0; |
e5e8ac0bd7fc
support for PVR channel navigation (patch by Sven Gothel <sgothel at jausoft dot com>)
ben
parents:
23166
diff
changeset
|
220 stationlist->enabled = 0; |
e5e8ac0bd7fc
support for PVR channel navigation (patch by Sven Gothel <sgothel at jausoft dot com>)
ben
parents:
23166
diff
changeset
|
221 stationlist->used = 0; |
e5e8ac0bd7fc
support for PVR channel navigation (patch by Sven Gothel <sgothel at jausoft dot com>)
ben
parents:
23166
diff
changeset
|
222 stationlist->list = calloc (num, sizeof (station_elem_t)); |
e5e8ac0bd7fc
support for PVR channel navigation (patch by Sven Gothel <sgothel at jausoft dot com>)
ben
parents:
23166
diff
changeset
|
223 |
e5e8ac0bd7fc
support for PVR channel navigation (patch by Sven Gothel <sgothel at jausoft dot com>)
ben
parents:
23166
diff
changeset
|
224 if (!stationlist->list) |
e5e8ac0bd7fc
support for PVR channel navigation (patch by Sven Gothel <sgothel at jausoft dot com>)
ben
parents:
23166
diff
changeset
|
225 { |
e5e8ac0bd7fc
support for PVR channel navigation (patch by Sven Gothel <sgothel at jausoft dot com>)
ben
parents:
23166
diff
changeset
|
226 mp_msg (MSGT_OPEN, MSGL_ERR, |
e5e8ac0bd7fc
support for PVR channel navigation (patch by Sven Gothel <sgothel at jausoft dot com>)
ben
parents:
23166
diff
changeset
|
227 "%s No memory allocated for station list, giving up\n", |
e5e8ac0bd7fc
support for PVR channel navigation (patch by Sven Gothel <sgothel at jausoft dot com>)
ben
parents:
23166
diff
changeset
|
228 LOG_LEVEL_V4L2); |
e5e8ac0bd7fc
support for PVR channel navigation (patch by Sven Gothel <sgothel at jausoft dot com>)
ben
parents:
23166
diff
changeset
|
229 return -1; |
e5e8ac0bd7fc
support for PVR channel navigation (patch by Sven Gothel <sgothel at jausoft dot com>)
ben
parents:
23166
diff
changeset
|
230 } |
e5e8ac0bd7fc
support for PVR channel navigation (patch by Sven Gothel <sgothel at jausoft dot com>)
ben
parents:
23166
diff
changeset
|
231 |
e5e8ac0bd7fc
support for PVR channel navigation (patch by Sven Gothel <sgothel at jausoft dot com>)
ben
parents:
23166
diff
changeset
|
232 /* transport the channel list data to our extented struct */ |
e5e8ac0bd7fc
support for PVR channel navigation (patch by Sven Gothel <sgothel at jausoft dot com>)
ben
parents:
23166
diff
changeset
|
233 stationlist->total = num; |
e5e8ac0bd7fc
support for PVR channel navigation (patch by Sven Gothel <sgothel at jausoft dot com>)
ben
parents:
23166
diff
changeset
|
234 strlcpy (stationlist->name, chanlists[chantab].name, PVR_STATION_NAME_SIZE); |
e5e8ac0bd7fc
support for PVR channel navigation (patch by Sven Gothel <sgothel at jausoft dot com>)
ben
parents:
23166
diff
changeset
|
235 |
e5e8ac0bd7fc
support for PVR channel navigation (patch by Sven Gothel <sgothel at jausoft dot com>)
ben
parents:
23166
diff
changeset
|
236 for (i = 0; i < chanlists[chantab].count; i++) |
e5e8ac0bd7fc
support for PVR channel navigation (patch by Sven Gothel <sgothel at jausoft dot com>)
ben
parents:
23166
diff
changeset
|
237 { |
e5e8ac0bd7fc
support for PVR channel navigation (patch by Sven Gothel <sgothel at jausoft dot com>)
ben
parents:
23166
diff
changeset
|
238 stationlist->list[i].station[0]= '\0'; /* no station name yet */ |
e5e8ac0bd7fc
support for PVR channel navigation (patch by Sven Gothel <sgothel at jausoft dot com>)
ben
parents:
23166
diff
changeset
|
239 strlcpy (stationlist->list[i].name, |
e5e8ac0bd7fc
support for PVR channel navigation (patch by Sven Gothel <sgothel at jausoft dot com>)
ben
parents:
23166
diff
changeset
|
240 chanlists[chantab].list[i].name, PVR_STATION_NAME_SIZE); |
e5e8ac0bd7fc
support for PVR channel navigation (patch by Sven Gothel <sgothel at jausoft dot com>)
ben
parents:
23166
diff
changeset
|
241 stationlist->list[i].freq = chanlists[chantab].list[i].freq; |
e5e8ac0bd7fc
support for PVR channel navigation (patch by Sven Gothel <sgothel at jausoft dot com>)
ben
parents:
23166
diff
changeset
|
242 stationlist->list[i].enabled = 1; /* default enabled */ |
e5e8ac0bd7fc
support for PVR channel navigation (patch by Sven Gothel <sgothel at jausoft dot com>)
ben
parents:
23166
diff
changeset
|
243 stationlist->enabled++; |
e5e8ac0bd7fc
support for PVR channel navigation (patch by Sven Gothel <sgothel at jausoft dot com>)
ben
parents:
23166
diff
changeset
|
244 stationlist->used++; |
e5e8ac0bd7fc
support for PVR channel navigation (patch by Sven Gothel <sgothel at jausoft dot com>)
ben
parents:
23166
diff
changeset
|
245 } |
e5e8ac0bd7fc
support for PVR channel navigation (patch by Sven Gothel <sgothel at jausoft dot com>)
ben
parents:
23166
diff
changeset
|
246 |
e5e8ac0bd7fc
support for PVR channel navigation (patch by Sven Gothel <sgothel at jausoft dot com>)
ben
parents:
23166
diff
changeset
|
247 return 0; |
e5e8ac0bd7fc
support for PVR channel navigation (patch by Sven Gothel <sgothel at jausoft dot com>)
ben
parents:
23166
diff
changeset
|
248 } |
e5e8ac0bd7fc
support for PVR channel navigation (patch by Sven Gothel <sgothel at jausoft dot com>)
ben
parents:
23166
diff
changeset
|
249 |
e5e8ac0bd7fc
support for PVR channel navigation (patch by Sven Gothel <sgothel at jausoft dot com>)
ben
parents:
23166
diff
changeset
|
250 static int |
e5e8ac0bd7fc
support for PVR channel navigation (patch by Sven Gothel <sgothel at jausoft dot com>)
ben
parents:
23166
diff
changeset
|
251 print_all_stations (struct pvr_t *pvr) |
e5e8ac0bd7fc
support for PVR channel navigation (patch by Sven Gothel <sgothel at jausoft dot com>)
ben
parents:
23166
diff
changeset
|
252 { |
e5e8ac0bd7fc
support for PVR channel navigation (patch by Sven Gothel <sgothel at jausoft dot com>)
ben
parents:
23166
diff
changeset
|
253 int i; |
e5e8ac0bd7fc
support for PVR channel navigation (patch by Sven Gothel <sgothel at jausoft dot com>)
ben
parents:
23166
diff
changeset
|
254 |
e5e8ac0bd7fc
support for PVR channel navigation (patch by Sven Gothel <sgothel at jausoft dot com>)
ben
parents:
23166
diff
changeset
|
255 if (!pvr || !pvr->stationlist.list) |
e5e8ac0bd7fc
support for PVR channel navigation (patch by Sven Gothel <sgothel at jausoft dot com>)
ben
parents:
23166
diff
changeset
|
256 return -1; |
e5e8ac0bd7fc
support for PVR channel navigation (patch by Sven Gothel <sgothel at jausoft dot com>)
ben
parents:
23166
diff
changeset
|
257 |
e5e8ac0bd7fc
support for PVR channel navigation (patch by Sven Gothel <sgothel at jausoft dot com>)
ben
parents:
23166
diff
changeset
|
258 for (i = 0; i < pvr->stationlist.total; i++) |
e5e8ac0bd7fc
support for PVR channel navigation (patch by Sven Gothel <sgothel at jausoft dot com>)
ben
parents:
23166
diff
changeset
|
259 { |
e5e8ac0bd7fc
support for PVR channel navigation (patch by Sven Gothel <sgothel at jausoft dot com>)
ben
parents:
23166
diff
changeset
|
260 mp_msg (MSGT_OPEN, MSGL_V, |
e5e8ac0bd7fc
support for PVR channel navigation (patch by Sven Gothel <sgothel at jausoft dot com>)
ben
parents:
23166
diff
changeset
|
261 "%s %3d: [%c] channel: %8s - freq: %8d - station: %s\n", |
e5e8ac0bd7fc
support for PVR channel navigation (patch by Sven Gothel <sgothel at jausoft dot com>)
ben
parents:
23166
diff
changeset
|
262 LOG_LEVEL_V4L2, i, (pvr->stationlist.list[i].enabled) ? 'X' : ' ', |
e5e8ac0bd7fc
support for PVR channel navigation (patch by Sven Gothel <sgothel at jausoft dot com>)
ben
parents:
23166
diff
changeset
|
263 pvr->stationlist.list[i].name, pvr->stationlist.list[i].freq, |
e5e8ac0bd7fc
support for PVR channel navigation (patch by Sven Gothel <sgothel at jausoft dot com>)
ben
parents:
23166
diff
changeset
|
264 pvr->stationlist.list[i].station); |
e5e8ac0bd7fc
support for PVR channel navigation (patch by Sven Gothel <sgothel at jausoft dot com>)
ben
parents:
23166
diff
changeset
|
265 } |
e5e8ac0bd7fc
support for PVR channel navigation (patch by Sven Gothel <sgothel at jausoft dot com>)
ben
parents:
23166
diff
changeset
|
266 |
e5e8ac0bd7fc
support for PVR channel navigation (patch by Sven Gothel <sgothel at jausoft dot com>)
ben
parents:
23166
diff
changeset
|
267 return 0; |
e5e8ac0bd7fc
support for PVR channel navigation (patch by Sven Gothel <sgothel at jausoft dot com>)
ben
parents:
23166
diff
changeset
|
268 } |
e5e8ac0bd7fc
support for PVR channel navigation (patch by Sven Gothel <sgothel at jausoft dot com>)
ben
parents:
23166
diff
changeset
|
269 |
e5e8ac0bd7fc
support for PVR channel navigation (patch by Sven Gothel <sgothel at jausoft dot com>)
ben
parents:
23166
diff
changeset
|
270 /** |
e5e8ac0bd7fc
support for PVR channel navigation (patch by Sven Gothel <sgothel at jausoft dot com>)
ben
parents:
23166
diff
changeset
|
271 * Disables all stations |
e5e8ac0bd7fc
support for PVR channel navigation (patch by Sven Gothel <sgothel at jausoft dot com>)
ben
parents:
23166
diff
changeset
|
272 * |
e5e8ac0bd7fc
support for PVR channel navigation (patch by Sven Gothel <sgothel at jausoft dot com>)
ben
parents:
23166
diff
changeset
|
273 * @see parse_setup_stationlist |
e5e8ac0bd7fc
support for PVR channel navigation (patch by Sven Gothel <sgothel at jausoft dot com>)
ben
parents:
23166
diff
changeset
|
274 */ |
e5e8ac0bd7fc
support for PVR channel navigation (patch by Sven Gothel <sgothel at jausoft dot com>)
ben
parents:
23166
diff
changeset
|
275 static void |
e5e8ac0bd7fc
support for PVR channel navigation (patch by Sven Gothel <sgothel at jausoft dot com>)
ben
parents:
23166
diff
changeset
|
276 disable_all_stations (struct pvr_t *pvr) |
e5e8ac0bd7fc
support for PVR channel navigation (patch by Sven Gothel <sgothel at jausoft dot com>)
ben
parents:
23166
diff
changeset
|
277 { |
e5e8ac0bd7fc
support for PVR channel navigation (patch by Sven Gothel <sgothel at jausoft dot com>)
ben
parents:
23166
diff
changeset
|
278 int i; |
e5e8ac0bd7fc
support for PVR channel navigation (patch by Sven Gothel <sgothel at jausoft dot com>)
ben
parents:
23166
diff
changeset
|
279 |
e5e8ac0bd7fc
support for PVR channel navigation (patch by Sven Gothel <sgothel at jausoft dot com>)
ben
parents:
23166
diff
changeset
|
280 for (i = 0; i < pvr->stationlist.total; i++) |
e5e8ac0bd7fc
support for PVR channel navigation (patch by Sven Gothel <sgothel at jausoft dot com>)
ben
parents:
23166
diff
changeset
|
281 pvr->stationlist.list[i].enabled = 0; |
e5e8ac0bd7fc
support for PVR channel navigation (patch by Sven Gothel <sgothel at jausoft dot com>)
ben
parents:
23166
diff
changeset
|
282 pvr->stationlist.enabled = 0; |
e5e8ac0bd7fc
support for PVR channel navigation (patch by Sven Gothel <sgothel at jausoft dot com>)
ben
parents:
23166
diff
changeset
|
283 } |
e5e8ac0bd7fc
support for PVR channel navigation (patch by Sven Gothel <sgothel at jausoft dot com>)
ben
parents:
23166
diff
changeset
|
284 |
e5e8ac0bd7fc
support for PVR channel navigation (patch by Sven Gothel <sgothel at jausoft dot com>)
ben
parents:
23166
diff
changeset
|
285 /** |
e5e8ac0bd7fc
support for PVR channel navigation (patch by Sven Gothel <sgothel at jausoft dot com>)
ben
parents:
23166
diff
changeset
|
286 * Update or add a station |
e5e8ac0bd7fc
support for PVR channel navigation (patch by Sven Gothel <sgothel at jausoft dot com>)
ben
parents:
23166
diff
changeset
|
287 * |
e5e8ac0bd7fc
support for PVR channel navigation (patch by Sven Gothel <sgothel at jausoft dot com>)
ben
parents:
23166
diff
changeset
|
288 * @see parse_setup_stationlist |
e5e8ac0bd7fc
support for PVR channel navigation (patch by Sven Gothel <sgothel at jausoft dot com>)
ben
parents:
23166
diff
changeset
|
289 */ |
e5e8ac0bd7fc
support for PVR channel navigation (patch by Sven Gothel <sgothel at jausoft dot com>)
ben
parents:
23166
diff
changeset
|
290 static int |
e5e8ac0bd7fc
support for PVR channel navigation (patch by Sven Gothel <sgothel at jausoft dot com>)
ben
parents:
23166
diff
changeset
|
291 set_station (struct pvr_t *pvr, const char *station, |
e5e8ac0bd7fc
support for PVR channel navigation (patch by Sven Gothel <sgothel at jausoft dot com>)
ben
parents:
23166
diff
changeset
|
292 const char *channel, int freq) |
e5e8ac0bd7fc
support for PVR channel navigation (patch by Sven Gothel <sgothel at jausoft dot com>)
ben
parents:
23166
diff
changeset
|
293 { |
e5e8ac0bd7fc
support for PVR channel navigation (patch by Sven Gothel <sgothel at jausoft dot com>)
ben
parents:
23166
diff
changeset
|
294 int i; |
e5e8ac0bd7fc
support for PVR channel navigation (patch by Sven Gothel <sgothel at jausoft dot com>)
ben
parents:
23166
diff
changeset
|
295 |
e5e8ac0bd7fc
support for PVR channel navigation (patch by Sven Gothel <sgothel at jausoft dot com>)
ben
parents:
23166
diff
changeset
|
296 if (!pvr || !pvr->stationlist.list) |
e5e8ac0bd7fc
support for PVR channel navigation (patch by Sven Gothel <sgothel at jausoft dot com>)
ben
parents:
23166
diff
changeset
|
297 return -1; |
e5e8ac0bd7fc
support for PVR channel navigation (patch by Sven Gothel <sgothel at jausoft dot com>)
ben
parents:
23166
diff
changeset
|
298 |
e5e8ac0bd7fc
support for PVR channel navigation (patch by Sven Gothel <sgothel at jausoft dot com>)
ben
parents:
23166
diff
changeset
|
299 if (0 >= pvr->stationlist.total || (!channel && !freq)) |
e5e8ac0bd7fc
support for PVR channel navigation (patch by Sven Gothel <sgothel at jausoft dot com>)
ben
parents:
23166
diff
changeset
|
300 return -1; |
e5e8ac0bd7fc
support for PVR channel navigation (patch by Sven Gothel <sgothel at jausoft dot com>)
ben
parents:
23166
diff
changeset
|
301 |
e5e8ac0bd7fc
support for PVR channel navigation (patch by Sven Gothel <sgothel at jausoft dot com>)
ben
parents:
23166
diff
changeset
|
302 /* select channel */ |
e5e8ac0bd7fc
support for PVR channel navigation (patch by Sven Gothel <sgothel at jausoft dot com>)
ben
parents:
23166
diff
changeset
|
303 for (i = 0; i < pvr->stationlist.used; i++) |
e5e8ac0bd7fc
support for PVR channel navigation (patch by Sven Gothel <sgothel at jausoft dot com>)
ben
parents:
23166
diff
changeset
|
304 { |
e5e8ac0bd7fc
support for PVR channel navigation (patch by Sven Gothel <sgothel at jausoft dot com>)
ben
parents:
23166
diff
changeset
|
305 if (channel && !strcasecmp (pvr->stationlist.list[i].name, channel)) |
e5e8ac0bd7fc
support for PVR channel navigation (patch by Sven Gothel <sgothel at jausoft dot com>)
ben
parents:
23166
diff
changeset
|
306 break; /* found existing channel entry */ |
e5e8ac0bd7fc
support for PVR channel navigation (patch by Sven Gothel <sgothel at jausoft dot com>)
ben
parents:
23166
diff
changeset
|
307 |
e5e8ac0bd7fc
support for PVR channel navigation (patch by Sven Gothel <sgothel at jausoft dot com>)
ben
parents:
23166
diff
changeset
|
308 if (freq > 0 && pvr->stationlist.list[i].freq == freq) |
e5e8ac0bd7fc
support for PVR channel navigation (patch by Sven Gothel <sgothel at jausoft dot com>)
ben
parents:
23166
diff
changeset
|
309 break; /* found existing frequency entry */ |
e5e8ac0bd7fc
support for PVR channel navigation (patch by Sven Gothel <sgothel at jausoft dot com>)
ben
parents:
23166
diff
changeset
|
310 } |
e5e8ac0bd7fc
support for PVR channel navigation (patch by Sven Gothel <sgothel at jausoft dot com>)
ben
parents:
23166
diff
changeset
|
311 |
e5e8ac0bd7fc
support for PVR channel navigation (patch by Sven Gothel <sgothel at jausoft dot com>)
ben
parents:
23166
diff
changeset
|
312 if (i < pvr->stationlist.used) |
e5e8ac0bd7fc
support for PVR channel navigation (patch by Sven Gothel <sgothel at jausoft dot com>)
ben
parents:
23166
diff
changeset
|
313 { |
e5e8ac0bd7fc
support for PVR channel navigation (patch by Sven Gothel <sgothel at jausoft dot com>)
ben
parents:
23166
diff
changeset
|
314 /** |
e5e8ac0bd7fc
support for PVR channel navigation (patch by Sven Gothel <sgothel at jausoft dot com>)
ben
parents:
23166
diff
changeset
|
315 * found an existing entry, |
e5e8ac0bd7fc
support for PVR channel navigation (patch by Sven Gothel <sgothel at jausoft dot com>)
ben
parents:
23166
diff
changeset
|
316 * which is about to change with the user data. |
e5e8ac0bd7fc
support for PVR channel navigation (patch by Sven Gothel <sgothel at jausoft dot com>)
ben
parents:
23166
diff
changeset
|
317 * it is also enabled .. |
e5e8ac0bd7fc
support for PVR channel navigation (patch by Sven Gothel <sgothel at jausoft dot com>)
ben
parents:
23166
diff
changeset
|
318 */ |
e5e8ac0bd7fc
support for PVR channel navigation (patch by Sven Gothel <sgothel at jausoft dot com>)
ben
parents:
23166
diff
changeset
|
319 if (!pvr->stationlist.list[i].enabled) |
e5e8ac0bd7fc
support for PVR channel navigation (patch by Sven Gothel <sgothel at jausoft dot com>)
ben
parents:
23166
diff
changeset
|
320 { |
e5e8ac0bd7fc
support for PVR channel navigation (patch by Sven Gothel <sgothel at jausoft dot com>)
ben
parents:
23166
diff
changeset
|
321 pvr->stationlist.list[i].enabled = 1; |
e5e8ac0bd7fc
support for PVR channel navigation (patch by Sven Gothel <sgothel at jausoft dot com>)
ben
parents:
23166
diff
changeset
|
322 pvr->stationlist.enabled++; |
e5e8ac0bd7fc
support for PVR channel navigation (patch by Sven Gothel <sgothel at jausoft dot com>)
ben
parents:
23166
diff
changeset
|
323 } |
e5e8ac0bd7fc
support for PVR channel navigation (patch by Sven Gothel <sgothel at jausoft dot com>)
ben
parents:
23166
diff
changeset
|
324 |
e5e8ac0bd7fc
support for PVR channel navigation (patch by Sven Gothel <sgothel at jausoft dot com>)
ben
parents:
23166
diff
changeset
|
325 if (station) |
e5e8ac0bd7fc
support for PVR channel navigation (patch by Sven Gothel <sgothel at jausoft dot com>)
ben
parents:
23166
diff
changeset
|
326 strlcpy (pvr->stationlist.list[i].station, |
e5e8ac0bd7fc
support for PVR channel navigation (patch by Sven Gothel <sgothel at jausoft dot com>)
ben
parents:
23166
diff
changeset
|
327 station, PVR_STATION_NAME_SIZE); |
e5e8ac0bd7fc
support for PVR channel navigation (patch by Sven Gothel <sgothel at jausoft dot com>)
ben
parents:
23166
diff
changeset
|
328 else if (channel) |
e5e8ac0bd7fc
support for PVR channel navigation (patch by Sven Gothel <sgothel at jausoft dot com>)
ben
parents:
23166
diff
changeset
|
329 strlcpy (pvr->stationlist.list[i].station, |
e5e8ac0bd7fc
support for PVR channel navigation (patch by Sven Gothel <sgothel at jausoft dot com>)
ben
parents:
23166
diff
changeset
|
330 channel, PVR_STATION_NAME_SIZE); |
e5e8ac0bd7fc
support for PVR channel navigation (patch by Sven Gothel <sgothel at jausoft dot com>)
ben
parents:
23166
diff
changeset
|
331 else |
e5e8ac0bd7fc
support for PVR channel navigation (patch by Sven Gothel <sgothel at jausoft dot com>)
ben
parents:
23166
diff
changeset
|
332 snprintf (pvr->stationlist.list[i].station, |
e5e8ac0bd7fc
support for PVR channel navigation (patch by Sven Gothel <sgothel at jausoft dot com>)
ben
parents:
23166
diff
changeset
|
333 PVR_STATION_NAME_SIZE, "F %d", freq); |
e5e8ac0bd7fc
support for PVR channel navigation (patch by Sven Gothel <sgothel at jausoft dot com>)
ben
parents:
23166
diff
changeset
|
334 |
e5e8ac0bd7fc
support for PVR channel navigation (patch by Sven Gothel <sgothel at jausoft dot com>)
ben
parents:
23166
diff
changeset
|
335 mp_msg (MSGT_OPEN, MSGL_DBG2, |
e5e8ac0bd7fc
support for PVR channel navigation (patch by Sven Gothel <sgothel at jausoft dot com>)
ben
parents:
23166
diff
changeset
|
336 "%s Set user station channel: %8s - freq: %8d - station: %s\n", |
e5e8ac0bd7fc
support for PVR channel navigation (patch by Sven Gothel <sgothel at jausoft dot com>)
ben
parents:
23166
diff
changeset
|
337 LOG_LEVEL_V4L2, pvr->stationlist.list[i].name, |
e5e8ac0bd7fc
support for PVR channel navigation (patch by Sven Gothel <sgothel at jausoft dot com>)
ben
parents:
23166
diff
changeset
|
338 pvr->stationlist.list[i].freq, |
e5e8ac0bd7fc
support for PVR channel navigation (patch by Sven Gothel <sgothel at jausoft dot com>)
ben
parents:
23166
diff
changeset
|
339 pvr->stationlist.list[i].station); |
e5e8ac0bd7fc
support for PVR channel navigation (patch by Sven Gothel <sgothel at jausoft dot com>)
ben
parents:
23166
diff
changeset
|
340 return 0; |
e5e8ac0bd7fc
support for PVR channel navigation (patch by Sven Gothel <sgothel at jausoft dot com>)
ben
parents:
23166
diff
changeset
|
341 } |
e5e8ac0bd7fc
support for PVR channel navigation (patch by Sven Gothel <sgothel at jausoft dot com>)
ben
parents:
23166
diff
changeset
|
342 |
e5e8ac0bd7fc
support for PVR channel navigation (patch by Sven Gothel <sgothel at jausoft dot com>)
ben
parents:
23166
diff
changeset
|
343 /* from here on, we have to create a new entry, frequency is mandatory */ |
e5e8ac0bd7fc
support for PVR channel navigation (patch by Sven Gothel <sgothel at jausoft dot com>)
ben
parents:
23166
diff
changeset
|
344 if (freq < 0) |
e5e8ac0bd7fc
support for PVR channel navigation (patch by Sven Gothel <sgothel at jausoft dot com>)
ben
parents:
23166
diff
changeset
|
345 { |
e5e8ac0bd7fc
support for PVR channel navigation (patch by Sven Gothel <sgothel at jausoft dot com>)
ben
parents:
23166
diff
changeset
|
346 mp_msg (MSGT_OPEN, MSGL_ERR, |
e5e8ac0bd7fc
support for PVR channel navigation (patch by Sven Gothel <sgothel at jausoft dot com>)
ben
parents:
23166
diff
changeset
|
347 "%s Cannot add new station/channel without frequency\n", |
e5e8ac0bd7fc
support for PVR channel navigation (patch by Sven Gothel <sgothel at jausoft dot com>)
ben
parents:
23166
diff
changeset
|
348 LOG_LEVEL_V4L2); |
e5e8ac0bd7fc
support for PVR channel navigation (patch by Sven Gothel <sgothel at jausoft dot com>)
ben
parents:
23166
diff
changeset
|
349 return -1; |
e5e8ac0bd7fc
support for PVR channel navigation (patch by Sven Gothel <sgothel at jausoft dot com>)
ben
parents:
23166
diff
changeset
|
350 } |
e5e8ac0bd7fc
support for PVR channel navigation (patch by Sven Gothel <sgothel at jausoft dot com>)
ben
parents:
23166
diff
changeset
|
351 |
e5e8ac0bd7fc
support for PVR channel navigation (patch by Sven Gothel <sgothel at jausoft dot com>)
ben
parents:
23166
diff
changeset
|
352 if (pvr->stationlist.total < i) |
e5e8ac0bd7fc
support for PVR channel navigation (patch by Sven Gothel <sgothel at jausoft dot com>)
ben
parents:
23166
diff
changeset
|
353 { |
e5e8ac0bd7fc
support for PVR channel navigation (patch by Sven Gothel <sgothel at jausoft dot com>)
ben
parents:
23166
diff
changeset
|
354 /** |
e5e8ac0bd7fc
support for PVR channel navigation (patch by Sven Gothel <sgothel at jausoft dot com>)
ben
parents:
23166
diff
changeset
|
355 * we have to extend the stationlist about |
e5e8ac0bd7fc
support for PVR channel navigation (patch by Sven Gothel <sgothel at jausoft dot com>)
ben
parents:
23166
diff
changeset
|
356 * an arbitrary size, even though this path is not performance critical |
e5e8ac0bd7fc
support for PVR channel navigation (patch by Sven Gothel <sgothel at jausoft dot com>)
ben
parents:
23166
diff
changeset
|
357 */ |
e5e8ac0bd7fc
support for PVR channel navigation (patch by Sven Gothel <sgothel at jausoft dot com>)
ben
parents:
23166
diff
changeset
|
358 pvr->stationlist.total += 10; |
e5e8ac0bd7fc
support for PVR channel navigation (patch by Sven Gothel <sgothel at jausoft dot com>)
ben
parents:
23166
diff
changeset
|
359 pvr->stationlist.list = |
e5e8ac0bd7fc
support for PVR channel navigation (patch by Sven Gothel <sgothel at jausoft dot com>)
ben
parents:
23166
diff
changeset
|
360 realloc (pvr->stationlist.list, |
e5e8ac0bd7fc
support for PVR channel navigation (patch by Sven Gothel <sgothel at jausoft dot com>)
ben
parents:
23166
diff
changeset
|
361 pvr->stationlist.total * sizeof (station_elem_t)); |
e5e8ac0bd7fc
support for PVR channel navigation (patch by Sven Gothel <sgothel at jausoft dot com>)
ben
parents:
23166
diff
changeset
|
362 |
e5e8ac0bd7fc
support for PVR channel navigation (patch by Sven Gothel <sgothel at jausoft dot com>)
ben
parents:
23166
diff
changeset
|
363 if (!pvr->stationlist.list) |
e5e8ac0bd7fc
support for PVR channel navigation (patch by Sven Gothel <sgothel at jausoft dot com>)
ben
parents:
23166
diff
changeset
|
364 { |
e5e8ac0bd7fc
support for PVR channel navigation (patch by Sven Gothel <sgothel at jausoft dot com>)
ben
parents:
23166
diff
changeset
|
365 mp_msg (MSGT_OPEN, MSGL_ERR, |
e5e8ac0bd7fc
support for PVR channel navigation (patch by Sven Gothel <sgothel at jausoft dot com>)
ben
parents:
23166
diff
changeset
|
366 "%s No memory allocated for station list, giving up\n", |
e5e8ac0bd7fc
support for PVR channel navigation (patch by Sven Gothel <sgothel at jausoft dot com>)
ben
parents:
23166
diff
changeset
|
367 LOG_LEVEL_V4L2); |
e5e8ac0bd7fc
support for PVR channel navigation (patch by Sven Gothel <sgothel at jausoft dot com>)
ben
parents:
23166
diff
changeset
|
368 return -1; |
e5e8ac0bd7fc
support for PVR channel navigation (patch by Sven Gothel <sgothel at jausoft dot com>)
ben
parents:
23166
diff
changeset
|
369 } |
e5e8ac0bd7fc
support for PVR channel navigation (patch by Sven Gothel <sgothel at jausoft dot com>)
ben
parents:
23166
diff
changeset
|
370 |
e5e8ac0bd7fc
support for PVR channel navigation (patch by Sven Gothel <sgothel at jausoft dot com>)
ben
parents:
23166
diff
changeset
|
371 /* clear the new space ..*/ |
e5e8ac0bd7fc
support for PVR channel navigation (patch by Sven Gothel <sgothel at jausoft dot com>)
ben
parents:
23166
diff
changeset
|
372 memset (&(pvr->stationlist.list[pvr->stationlist.used]), 0, |
e5e8ac0bd7fc
support for PVR channel navigation (patch by Sven Gothel <sgothel at jausoft dot com>)
ben
parents:
23166
diff
changeset
|
373 (pvr->stationlist.total - pvr->stationlist.used) |
e5e8ac0bd7fc
support for PVR channel navigation (patch by Sven Gothel <sgothel at jausoft dot com>)
ben
parents:
23166
diff
changeset
|
374 * sizeof (station_elem_t)); |
e5e8ac0bd7fc
support for PVR channel navigation (patch by Sven Gothel <sgothel at jausoft dot com>)
ben
parents:
23166
diff
changeset
|
375 } |
e5e8ac0bd7fc
support for PVR channel navigation (patch by Sven Gothel <sgothel at jausoft dot com>)
ben
parents:
23166
diff
changeset
|
376 |
e5e8ac0bd7fc
support for PVR channel navigation (patch by Sven Gothel <sgothel at jausoft dot com>)
ben
parents:
23166
diff
changeset
|
377 /* here we go, our actual new entry */ |
e5e8ac0bd7fc
support for PVR channel navigation (patch by Sven Gothel <sgothel at jausoft dot com>)
ben
parents:
23166
diff
changeset
|
378 pvr->stationlist.used++; |
e5e8ac0bd7fc
support for PVR channel navigation (patch by Sven Gothel <sgothel at jausoft dot com>)
ben
parents:
23166
diff
changeset
|
379 pvr->stationlist.list[i].enabled = 1; |
e5e8ac0bd7fc
support for PVR channel navigation (patch by Sven Gothel <sgothel at jausoft dot com>)
ben
parents:
23166
diff
changeset
|
380 pvr->stationlist.enabled++; |
e5e8ac0bd7fc
support for PVR channel navigation (patch by Sven Gothel <sgothel at jausoft dot com>)
ben
parents:
23166
diff
changeset
|
381 |
e5e8ac0bd7fc
support for PVR channel navigation (patch by Sven Gothel <sgothel at jausoft dot com>)
ben
parents:
23166
diff
changeset
|
382 if (station) |
e5e8ac0bd7fc
support for PVR channel navigation (patch by Sven Gothel <sgothel at jausoft dot com>)
ben
parents:
23166
diff
changeset
|
383 strlcpy (pvr->stationlist.list[i].station, |
e5e8ac0bd7fc
support for PVR channel navigation (patch by Sven Gothel <sgothel at jausoft dot com>)
ben
parents:
23166
diff
changeset
|
384 station, PVR_STATION_NAME_SIZE); |
e5e8ac0bd7fc
support for PVR channel navigation (patch by Sven Gothel <sgothel at jausoft dot com>)
ben
parents:
23166
diff
changeset
|
385 if (channel) |
e5e8ac0bd7fc
support for PVR channel navigation (patch by Sven Gothel <sgothel at jausoft dot com>)
ben
parents:
23166
diff
changeset
|
386 strlcpy (pvr->stationlist.list[i].name, channel, PVR_STATION_NAME_SIZE); |
e5e8ac0bd7fc
support for PVR channel navigation (patch by Sven Gothel <sgothel at jausoft dot com>)
ben
parents:
23166
diff
changeset
|
387 else |
e5e8ac0bd7fc
support for PVR channel navigation (patch by Sven Gothel <sgothel at jausoft dot com>)
ben
parents:
23166
diff
changeset
|
388 snprintf (pvr->stationlist.list[i].name, |
e5e8ac0bd7fc
support for PVR channel navigation (patch by Sven Gothel <sgothel at jausoft dot com>)
ben
parents:
23166
diff
changeset
|
389 PVR_STATION_NAME_SIZE, "F %d", freq); |
e5e8ac0bd7fc
support for PVR channel navigation (patch by Sven Gothel <sgothel at jausoft dot com>)
ben
parents:
23166
diff
changeset
|
390 |
e5e8ac0bd7fc
support for PVR channel navigation (patch by Sven Gothel <sgothel at jausoft dot com>)
ben
parents:
23166
diff
changeset
|
391 pvr->stationlist.list[i].freq = freq; |
e5e8ac0bd7fc
support for PVR channel navigation (patch by Sven Gothel <sgothel at jausoft dot com>)
ben
parents:
23166
diff
changeset
|
392 |
e5e8ac0bd7fc
support for PVR channel navigation (patch by Sven Gothel <sgothel at jausoft dot com>)
ben
parents:
23166
diff
changeset
|
393 mp_msg (MSGT_OPEN, MSGL_DBG2, |
e5e8ac0bd7fc
support for PVR channel navigation (patch by Sven Gothel <sgothel at jausoft dot com>)
ben
parents:
23166
diff
changeset
|
394 "%s Add user station channel: %8s - freq: %8d - station: %s\n", |
e5e8ac0bd7fc
support for PVR channel navigation (patch by Sven Gothel <sgothel at jausoft dot com>)
ben
parents:
23166
diff
changeset
|
395 LOG_LEVEL_V4L2, pvr->stationlist.list[i].name, |
e5e8ac0bd7fc
support for PVR channel navigation (patch by Sven Gothel <sgothel at jausoft dot com>)
ben
parents:
23166
diff
changeset
|
396 pvr->stationlist.list[i].freq, |
e5e8ac0bd7fc
support for PVR channel navigation (patch by Sven Gothel <sgothel at jausoft dot com>)
ben
parents:
23166
diff
changeset
|
397 pvr->stationlist.list[i].station); |
e5e8ac0bd7fc
support for PVR channel navigation (patch by Sven Gothel <sgothel at jausoft dot com>)
ben
parents:
23166
diff
changeset
|
398 |
e5e8ac0bd7fc
support for PVR channel navigation (patch by Sven Gothel <sgothel at jausoft dot com>)
ben
parents:
23166
diff
changeset
|
399 return 0; |
e5e8ac0bd7fc
support for PVR channel navigation (patch by Sven Gothel <sgothel at jausoft dot com>)
ben
parents:
23166
diff
changeset
|
400 } |
e5e8ac0bd7fc
support for PVR channel navigation (patch by Sven Gothel <sgothel at jausoft dot com>)
ben
parents:
23166
diff
changeset
|
401 |
e5e8ac0bd7fc
support for PVR channel navigation (patch by Sven Gothel <sgothel at jausoft dot com>)
ben
parents:
23166
diff
changeset
|
402 /** |
e5e8ac0bd7fc
support for PVR channel navigation (patch by Sven Gothel <sgothel at jausoft dot com>)
ben
parents:
23166
diff
changeset
|
403 * Here we set our stationlist, as follow |
e5e8ac0bd7fc
support for PVR channel navigation (patch by Sven Gothel <sgothel at jausoft dot com>)
ben
parents:
23166
diff
changeset
|
404 * - choose the frequency channel table, e.g. ntsc-cable |
e5e8ac0bd7fc
support for PVR channel navigation (patch by Sven Gothel <sgothel at jausoft dot com>)
ben
parents:
23166
diff
changeset
|
405 * - create our stationlist, same element size as the channellist |
e5e8ac0bd7fc
support for PVR channel navigation (patch by Sven Gothel <sgothel at jausoft dot com>)
ben
parents:
23166
diff
changeset
|
406 * - copy the channellist content to our stationlist |
e5e8ac0bd7fc
support for PVR channel navigation (patch by Sven Gothel <sgothel at jausoft dot com>)
ben
parents:
23166
diff
changeset
|
407 * - IF the user provides his channel-mapping, THEN: |
e5e8ac0bd7fc
support for PVR channel navigation (patch by Sven Gothel <sgothel at jausoft dot com>)
ben
parents:
23166
diff
changeset
|
408 * - disable all stations |
e5e8ac0bd7fc
support for PVR channel navigation (patch by Sven Gothel <sgothel at jausoft dot com>)
ben
parents:
23166
diff
changeset
|
409 * - update and/or create entries in the stationlist and enable them |
e5e8ac0bd7fc
support for PVR channel navigation (patch by Sven Gothel <sgothel at jausoft dot com>)
ben
parents:
23166
diff
changeset
|
410 */ |
e5e8ac0bd7fc
support for PVR channel navigation (patch by Sven Gothel <sgothel at jausoft dot com>)
ben
parents:
23166
diff
changeset
|
411 static int |
e5e8ac0bd7fc
support for PVR channel navigation (patch by Sven Gothel <sgothel at jausoft dot com>)
ben
parents:
23166
diff
changeset
|
412 parse_setup_stationlist (struct pvr_t *pvr) |
e5e8ac0bd7fc
support for PVR channel navigation (patch by Sven Gothel <sgothel at jausoft dot com>)
ben
parents:
23166
diff
changeset
|
413 { |
e5e8ac0bd7fc
support for PVR channel navigation (patch by Sven Gothel <sgothel at jausoft dot com>)
ben
parents:
23166
diff
changeset
|
414 int i; |
e5e8ac0bd7fc
support for PVR channel navigation (patch by Sven Gothel <sgothel at jausoft dot com>)
ben
parents:
23166
diff
changeset
|
415 |
e5e8ac0bd7fc
support for PVR channel navigation (patch by Sven Gothel <sgothel at jausoft dot com>)
ben
parents:
23166
diff
changeset
|
416 if (!pvr) |
e5e8ac0bd7fc
support for PVR channel navigation (patch by Sven Gothel <sgothel at jausoft dot com>)
ben
parents:
23166
diff
changeset
|
417 return -1; |
e5e8ac0bd7fc
support for PVR channel navigation (patch by Sven Gothel <sgothel at jausoft dot com>)
ben
parents:
23166
diff
changeset
|
418 |
e5e8ac0bd7fc
support for PVR channel navigation (patch by Sven Gothel <sgothel at jausoft dot com>)
ben
parents:
23166
diff
changeset
|
419 /* Create our station/channel list */ |
e5e8ac0bd7fc
support for PVR channel navigation (patch by Sven Gothel <sgothel at jausoft dot com>)
ben
parents:
23166
diff
changeset
|
420 if (tv_param_chanlist) |
e5e8ac0bd7fc
support for PVR channel navigation (patch by Sven Gothel <sgothel at jausoft dot com>)
ben
parents:
23166
diff
changeset
|
421 { |
e5e8ac0bd7fc
support for PVR channel navigation (patch by Sven Gothel <sgothel at jausoft dot com>)
ben
parents:
23166
diff
changeset
|
422 /* select channel list */ |
e5e8ac0bd7fc
support for PVR channel navigation (patch by Sven Gothel <sgothel at jausoft dot com>)
ben
parents:
23166
diff
changeset
|
423 for (i = 0; chanlists[i].name != NULL; i++) |
e5e8ac0bd7fc
support for PVR channel navigation (patch by Sven Gothel <sgothel at jausoft dot com>)
ben
parents:
23166
diff
changeset
|
424 { |
e5e8ac0bd7fc
support for PVR channel navigation (patch by Sven Gothel <sgothel at jausoft dot com>)
ben
parents:
23166
diff
changeset
|
425 if (!strcasecmp (chanlists[i].name, tv_param_chanlist)) |
e5e8ac0bd7fc
support for PVR channel navigation (patch by Sven Gothel <sgothel at jausoft dot com>)
ben
parents:
23166
diff
changeset
|
426 { |
e5e8ac0bd7fc
support for PVR channel navigation (patch by Sven Gothel <sgothel at jausoft dot com>)
ben
parents:
23166
diff
changeset
|
427 chantab = i; |
e5e8ac0bd7fc
support for PVR channel navigation (patch by Sven Gothel <sgothel at jausoft dot com>)
ben
parents:
23166
diff
changeset
|
428 break; |
e5e8ac0bd7fc
support for PVR channel navigation (patch by Sven Gothel <sgothel at jausoft dot com>)
ben
parents:
23166
diff
changeset
|
429 } |
e5e8ac0bd7fc
support for PVR channel navigation (patch by Sven Gothel <sgothel at jausoft dot com>)
ben
parents:
23166
diff
changeset
|
430 } |
e5e8ac0bd7fc
support for PVR channel navigation (patch by Sven Gothel <sgothel at jausoft dot com>)
ben
parents:
23166
diff
changeset
|
431 if (!chanlists[i].name) |
e5e8ac0bd7fc
support for PVR channel navigation (patch by Sven Gothel <sgothel at jausoft dot com>)
ben
parents:
23166
diff
changeset
|
432 { |
e5e8ac0bd7fc
support for PVR channel navigation (patch by Sven Gothel <sgothel at jausoft dot com>)
ben
parents:
23166
diff
changeset
|
433 mp_msg (MSGT_OPEN, MSGL_ERR, |
e5e8ac0bd7fc
support for PVR channel navigation (patch by Sven Gothel <sgothel at jausoft dot com>)
ben
parents:
23166
diff
changeset
|
434 "%s unable to find channel list %s, using default %s\n", |
e5e8ac0bd7fc
support for PVR channel navigation (patch by Sven Gothel <sgothel at jausoft dot com>)
ben
parents:
23166
diff
changeset
|
435 LOG_LEVEL_V4L2, tv_param_chanlist, chanlists[chantab].name); |
e5e8ac0bd7fc
support for PVR channel navigation (patch by Sven Gothel <sgothel at jausoft dot com>)
ben
parents:
23166
diff
changeset
|
436 } |
e5e8ac0bd7fc
support for PVR channel navigation (patch by Sven Gothel <sgothel at jausoft dot com>)
ben
parents:
23166
diff
changeset
|
437 else |
e5e8ac0bd7fc
support for PVR channel navigation (patch by Sven Gothel <sgothel at jausoft dot com>)
ben
parents:
23166
diff
changeset
|
438 { |
e5e8ac0bd7fc
support for PVR channel navigation (patch by Sven Gothel <sgothel at jausoft dot com>)
ben
parents:
23166
diff
changeset
|
439 mp_msg (MSGT_OPEN, MSGL_INFO, |
e5e8ac0bd7fc
support for PVR channel navigation (patch by Sven Gothel <sgothel at jausoft dot com>)
ben
parents:
23166
diff
changeset
|
440 "%s select channel list %s, entries %d\n", LOG_LEVEL_V4L2, |
e5e8ac0bd7fc
support for PVR channel navigation (patch by Sven Gothel <sgothel at jausoft dot com>)
ben
parents:
23166
diff
changeset
|
441 chanlists[chantab].name, chanlists[chantab].count); |
e5e8ac0bd7fc
support for PVR channel navigation (patch by Sven Gothel <sgothel at jausoft dot com>)
ben
parents:
23166
diff
changeset
|
442 } |
e5e8ac0bd7fc
support for PVR channel navigation (patch by Sven Gothel <sgothel at jausoft dot com>)
ben
parents:
23166
diff
changeset
|
443 } |
e5e8ac0bd7fc
support for PVR channel navigation (patch by Sven Gothel <sgothel at jausoft dot com>)
ben
parents:
23166
diff
changeset
|
444 |
e5e8ac0bd7fc
support for PVR channel navigation (patch by Sven Gothel <sgothel at jausoft dot com>)
ben
parents:
23166
diff
changeset
|
445 if (0 > chantab) |
e5e8ac0bd7fc
support for PVR channel navigation (patch by Sven Gothel <sgothel at jausoft dot com>)
ben
parents:
23166
diff
changeset
|
446 { |
e5e8ac0bd7fc
support for PVR channel navigation (patch by Sven Gothel <sgothel at jausoft dot com>)
ben
parents:
23166
diff
changeset
|
447 mp_msg (MSGT_OPEN, MSGL_FATAL, |
e5e8ac0bd7fc
support for PVR channel navigation (patch by Sven Gothel <sgothel at jausoft dot com>)
ben
parents:
23166
diff
changeset
|
448 "%s No channel list selected, giving up\n", LOG_LEVEL_V4L2); |
e5e8ac0bd7fc
support for PVR channel navigation (patch by Sven Gothel <sgothel at jausoft dot com>)
ben
parents:
23166
diff
changeset
|
449 return -1; |
e5e8ac0bd7fc
support for PVR channel navigation (patch by Sven Gothel <sgothel at jausoft dot com>)
ben
parents:
23166
diff
changeset
|
450 } |
e5e8ac0bd7fc
support for PVR channel navigation (patch by Sven Gothel <sgothel at jausoft dot com>)
ben
parents:
23166
diff
changeset
|
451 |
e5e8ac0bd7fc
support for PVR channel navigation (patch by Sven Gothel <sgothel at jausoft dot com>)
ben
parents:
23166
diff
changeset
|
452 if (copycreate_stationlist (&(pvr->stationlist), -1) < 0) |
e5e8ac0bd7fc
support for PVR channel navigation (patch by Sven Gothel <sgothel at jausoft dot com>)
ben
parents:
23166
diff
changeset
|
453 { |
e5e8ac0bd7fc
support for PVR channel navigation (patch by Sven Gothel <sgothel at jausoft dot com>)
ben
parents:
23166
diff
changeset
|
454 mp_msg (MSGT_OPEN, MSGL_FATAL, |
e5e8ac0bd7fc
support for PVR channel navigation (patch by Sven Gothel <sgothel at jausoft dot com>)
ben
parents:
23166
diff
changeset
|
455 "%s No memory allocated for station list, giving up\n", |
e5e8ac0bd7fc
support for PVR channel navigation (patch by Sven Gothel <sgothel at jausoft dot com>)
ben
parents:
23166
diff
changeset
|
456 LOG_LEVEL_V4L2); |
e5e8ac0bd7fc
support for PVR channel navigation (patch by Sven Gothel <sgothel at jausoft dot com>)
ben
parents:
23166
diff
changeset
|
457 return -1; |
e5e8ac0bd7fc
support for PVR channel navigation (patch by Sven Gothel <sgothel at jausoft dot com>)
ben
parents:
23166
diff
changeset
|
458 } |
e5e8ac0bd7fc
support for PVR channel navigation (patch by Sven Gothel <sgothel at jausoft dot com>)
ben
parents:
23166
diff
changeset
|
459 |
e5e8ac0bd7fc
support for PVR channel navigation (patch by Sven Gothel <sgothel at jausoft dot com>)
ben
parents:
23166
diff
changeset
|
460 /* Handle user channel mappings */ |
e5e8ac0bd7fc
support for PVR channel navigation (patch by Sven Gothel <sgothel at jausoft dot com>)
ben
parents:
23166
diff
changeset
|
461 if (tv_param_channels) |
e5e8ac0bd7fc
support for PVR channel navigation (patch by Sven Gothel <sgothel at jausoft dot com>)
ben
parents:
23166
diff
changeset
|
462 { |
e5e8ac0bd7fc
support for PVR channel navigation (patch by Sven Gothel <sgothel at jausoft dot com>)
ben
parents:
23166
diff
changeset
|
463 char channel[PVR_STATION_NAME_SIZE]; |
e5e8ac0bd7fc
support for PVR channel navigation (patch by Sven Gothel <sgothel at jausoft dot com>)
ben
parents:
23166
diff
changeset
|
464 char station[PVR_STATION_NAME_SIZE]; |
e5e8ac0bd7fc
support for PVR channel navigation (patch by Sven Gothel <sgothel at jausoft dot com>)
ben
parents:
23166
diff
changeset
|
465 char **channels = tv_param_channels; |
e5e8ac0bd7fc
support for PVR channel navigation (patch by Sven Gothel <sgothel at jausoft dot com>)
ben
parents:
23166
diff
changeset
|
466 |
e5e8ac0bd7fc
support for PVR channel navigation (patch by Sven Gothel <sgothel at jausoft dot com>)
ben
parents:
23166
diff
changeset
|
467 disable_all_stations (pvr); |
e5e8ac0bd7fc
support for PVR channel navigation (patch by Sven Gothel <sgothel at jausoft dot com>)
ben
parents:
23166
diff
changeset
|
468 |
e5e8ac0bd7fc
support for PVR channel navigation (patch by Sven Gothel <sgothel at jausoft dot com>)
ben
parents:
23166
diff
changeset
|
469 while (*channels) |
e5e8ac0bd7fc
support for PVR channel navigation (patch by Sven Gothel <sgothel at jausoft dot com>)
ben
parents:
23166
diff
changeset
|
470 { |
e5e8ac0bd7fc
support for PVR channel navigation (patch by Sven Gothel <sgothel at jausoft dot com>)
ben
parents:
23166
diff
changeset
|
471 char *tmp = *(channels++); |
e5e8ac0bd7fc
support for PVR channel navigation (patch by Sven Gothel <sgothel at jausoft dot com>)
ben
parents:
23166
diff
changeset
|
472 char *sep = strchr (tmp, '-'); |
e5e8ac0bd7fc
support for PVR channel navigation (patch by Sven Gothel <sgothel at jausoft dot com>)
ben
parents:
23166
diff
changeset
|
473 int freq=-1; |
e5e8ac0bd7fc
support for PVR channel navigation (patch by Sven Gothel <sgothel at jausoft dot com>)
ben
parents:
23166
diff
changeset
|
474 |
e5e8ac0bd7fc
support for PVR channel navigation (patch by Sven Gothel <sgothel at jausoft dot com>)
ben
parents:
23166
diff
changeset
|
475 if (!sep) |
e5e8ac0bd7fc
support for PVR channel navigation (patch by Sven Gothel <sgothel at jausoft dot com>)
ben
parents:
23166
diff
changeset
|
476 continue; /* Wrong syntax, but mplayer should not crash */ |
e5e8ac0bd7fc
support for PVR channel navigation (patch by Sven Gothel <sgothel at jausoft dot com>)
ben
parents:
23166
diff
changeset
|
477 |
e5e8ac0bd7fc
support for PVR channel navigation (patch by Sven Gothel <sgothel at jausoft dot com>)
ben
parents:
23166
diff
changeset
|
478 strlcpy (station, sep + 1, PVR_STATION_NAME_SIZE); |
e5e8ac0bd7fc
support for PVR channel navigation (patch by Sven Gothel <sgothel at jausoft dot com>)
ben
parents:
23166
diff
changeset
|
479 |
e5e8ac0bd7fc
support for PVR channel navigation (patch by Sven Gothel <sgothel at jausoft dot com>)
ben
parents:
23166
diff
changeset
|
480 sep[0] = '\0'; |
e5e8ac0bd7fc
support for PVR channel navigation (patch by Sven Gothel <sgothel at jausoft dot com>)
ben
parents:
23166
diff
changeset
|
481 strlcpy (channel, tmp, PVR_STATION_NAME_SIZE); |
e5e8ac0bd7fc
support for PVR channel navigation (patch by Sven Gothel <sgothel at jausoft dot com>)
ben
parents:
23166
diff
changeset
|
482 |
e5e8ac0bd7fc
support for PVR channel navigation (patch by Sven Gothel <sgothel at jausoft dot com>)
ben
parents:
23166
diff
changeset
|
483 while ((sep = strchr (station, '_'))) |
e5e8ac0bd7fc
support for PVR channel navigation (patch by Sven Gothel <sgothel at jausoft dot com>)
ben
parents:
23166
diff
changeset
|
484 sep[0] = ' '; |
e5e8ac0bd7fc
support for PVR channel navigation (patch by Sven Gothel <sgothel at jausoft dot com>)
ben
parents:
23166
diff
changeset
|
485 |
e5e8ac0bd7fc
support for PVR channel navigation (patch by Sven Gothel <sgothel at jausoft dot com>)
ben
parents:
23166
diff
changeset
|
486 /* if channel number is a number and larger than 1000 treat it as |
e5e8ac0bd7fc
support for PVR channel navigation (patch by Sven Gothel <sgothel at jausoft dot com>)
ben
parents:
23166
diff
changeset
|
487 * frequency tmp still contain pointer to null-terminated string with |
e5e8ac0bd7fc
support for PVR channel navigation (patch by Sven Gothel <sgothel at jausoft dot com>)
ben
parents:
23166
diff
changeset
|
488 * channel number here |
e5e8ac0bd7fc
support for PVR channel navigation (patch by Sven Gothel <sgothel at jausoft dot com>)
ben
parents:
23166
diff
changeset
|
489 */ |
e5e8ac0bd7fc
support for PVR channel navigation (patch by Sven Gothel <sgothel at jausoft dot com>)
ben
parents:
23166
diff
changeset
|
490 if ((freq = atoi (channel)) <= 1000) |
e5e8ac0bd7fc
support for PVR channel navigation (patch by Sven Gothel <sgothel at jausoft dot com>)
ben
parents:
23166
diff
changeset
|
491 freq = -1; |
e5e8ac0bd7fc
support for PVR channel navigation (patch by Sven Gothel <sgothel at jausoft dot com>)
ben
parents:
23166
diff
changeset
|
492 |
e5e8ac0bd7fc
support for PVR channel navigation (patch by Sven Gothel <sgothel at jausoft dot com>)
ben
parents:
23166
diff
changeset
|
493 if (set_station (pvr, station, (freq <= 0) ? channel : NULL, freq) < 0) |
e5e8ac0bd7fc
support for PVR channel navigation (patch by Sven Gothel <sgothel at jausoft dot com>)
ben
parents:
23166
diff
changeset
|
494 { |
e5e8ac0bd7fc
support for PVR channel navigation (patch by Sven Gothel <sgothel at jausoft dot com>)
ben
parents:
23166
diff
changeset
|
495 mp_msg (MSGT_OPEN, MSGL_ERR, |
e5e8ac0bd7fc
support for PVR channel navigation (patch by Sven Gothel <sgothel at jausoft dot com>)
ben
parents:
23166
diff
changeset
|
496 "%s Unable to set user station channel: %8s - freq: %8d - station: %s\n", LOG_LEVEL_V4L2, |
e5e8ac0bd7fc
support for PVR channel navigation (patch by Sven Gothel <sgothel at jausoft dot com>)
ben
parents:
23166
diff
changeset
|
497 channel, freq, station); |
e5e8ac0bd7fc
support for PVR channel navigation (patch by Sven Gothel <sgothel at jausoft dot com>)
ben
parents:
23166
diff
changeset
|
498 } |
e5e8ac0bd7fc
support for PVR channel navigation (patch by Sven Gothel <sgothel at jausoft dot com>)
ben
parents:
23166
diff
changeset
|
499 } |
e5e8ac0bd7fc
support for PVR channel navigation (patch by Sven Gothel <sgothel at jausoft dot com>)
ben
parents:
23166
diff
changeset
|
500 } |
e5e8ac0bd7fc
support for PVR channel navigation (patch by Sven Gothel <sgothel at jausoft dot com>)
ben
parents:
23166
diff
changeset
|
501 |
e5e8ac0bd7fc
support for PVR channel navigation (patch by Sven Gothel <sgothel at jausoft dot com>)
ben
parents:
23166
diff
changeset
|
502 return print_all_stations (pvr); |
e5e8ac0bd7fc
support for PVR channel navigation (patch by Sven Gothel <sgothel at jausoft dot com>)
ben
parents:
23166
diff
changeset
|
503 } |
e5e8ac0bd7fc
support for PVR channel navigation (patch by Sven Gothel <sgothel at jausoft dot com>)
ben
parents:
23166
diff
changeset
|
504 |
e5e8ac0bd7fc
support for PVR channel navigation (patch by Sven Gothel <sgothel at jausoft dot com>)
ben
parents:
23166
diff
changeset
|
505 static int |
e5e8ac0bd7fc
support for PVR channel navigation (patch by Sven Gothel <sgothel at jausoft dot com>)
ben
parents:
23166
diff
changeset
|
506 get_v4l2_freq (struct pvr_t *pvr) |
e5e8ac0bd7fc
support for PVR channel navigation (patch by Sven Gothel <sgothel at jausoft dot com>)
ben
parents:
23166
diff
changeset
|
507 { |
e5e8ac0bd7fc
support for PVR channel navigation (patch by Sven Gothel <sgothel at jausoft dot com>)
ben
parents:
23166
diff
changeset
|
508 int freq; |
e5e8ac0bd7fc
support for PVR channel navigation (patch by Sven Gothel <sgothel at jausoft dot com>)
ben
parents:
23166
diff
changeset
|
509 struct v4l2_frequency vf; |
e5e8ac0bd7fc
support for PVR channel navigation (patch by Sven Gothel <sgothel at jausoft dot com>)
ben
parents:
23166
diff
changeset
|
510 struct v4l2_tuner vt; |
e5e8ac0bd7fc
support for PVR channel navigation (patch by Sven Gothel <sgothel at jausoft dot com>)
ben
parents:
23166
diff
changeset
|
511 |
e5e8ac0bd7fc
support for PVR channel navigation (patch by Sven Gothel <sgothel at jausoft dot com>)
ben
parents:
23166
diff
changeset
|
512 if (!pvr) |
e5e8ac0bd7fc
support for PVR channel navigation (patch by Sven Gothel <sgothel at jausoft dot com>)
ben
parents:
23166
diff
changeset
|
513 return -1; |
e5e8ac0bd7fc
support for PVR channel navigation (patch by Sven Gothel <sgothel at jausoft dot com>)
ben
parents:
23166
diff
changeset
|
514 |
e5e8ac0bd7fc
support for PVR channel navigation (patch by Sven Gothel <sgothel at jausoft dot com>)
ben
parents:
23166
diff
changeset
|
515 if (pvr->dev_fd < 0) |
e5e8ac0bd7fc
support for PVR channel navigation (patch by Sven Gothel <sgothel at jausoft dot com>)
ben
parents:
23166
diff
changeset
|
516 return -1; |
e5e8ac0bd7fc
support for PVR channel navigation (patch by Sven Gothel <sgothel at jausoft dot com>)
ben
parents:
23166
diff
changeset
|
517 |
e5e8ac0bd7fc
support for PVR channel navigation (patch by Sven Gothel <sgothel at jausoft dot com>)
ben
parents:
23166
diff
changeset
|
518 memset (&vt, 0, sizeof (vt)); |
e5e8ac0bd7fc
support for PVR channel navigation (patch by Sven Gothel <sgothel at jausoft dot com>)
ben
parents:
23166
diff
changeset
|
519 memset (&vf, 0, sizeof (vf)); |
e5e8ac0bd7fc
support for PVR channel navigation (patch by Sven Gothel <sgothel at jausoft dot com>)
ben
parents:
23166
diff
changeset
|
520 |
e5e8ac0bd7fc
support for PVR channel navigation (patch by Sven Gothel <sgothel at jausoft dot com>)
ben
parents:
23166
diff
changeset
|
521 if (ioctl (pvr->dev_fd, VIDIOC_G_TUNER, &vt) < 0) |
e5e8ac0bd7fc
support for PVR channel navigation (patch by Sven Gothel <sgothel at jausoft dot com>)
ben
parents:
23166
diff
changeset
|
522 { |
e5e8ac0bd7fc
support for PVR channel navigation (patch by Sven Gothel <sgothel at jausoft dot com>)
ben
parents:
23166
diff
changeset
|
523 mp_msg (MSGT_OPEN, MSGL_ERR, "%s can't set tuner (%s).\n", |
e5e8ac0bd7fc
support for PVR channel navigation (patch by Sven Gothel <sgothel at jausoft dot com>)
ben
parents:
23166
diff
changeset
|
524 LOG_LEVEL_V4L2, strerror (errno)); |
e5e8ac0bd7fc
support for PVR channel navigation (patch by Sven Gothel <sgothel at jausoft dot com>)
ben
parents:
23166
diff
changeset
|
525 return -1; |
e5e8ac0bd7fc
support for PVR channel navigation (patch by Sven Gothel <sgothel at jausoft dot com>)
ben
parents:
23166
diff
changeset
|
526 } |
e5e8ac0bd7fc
support for PVR channel navigation (patch by Sven Gothel <sgothel at jausoft dot com>)
ben
parents:
23166
diff
changeset
|
527 |
e5e8ac0bd7fc
support for PVR channel navigation (patch by Sven Gothel <sgothel at jausoft dot com>)
ben
parents:
23166
diff
changeset
|
528 if (ioctl (pvr->dev_fd, VIDIOC_G_FREQUENCY, &vf) < 0) |
e5e8ac0bd7fc
support for PVR channel navigation (patch by Sven Gothel <sgothel at jausoft dot com>)
ben
parents:
23166
diff
changeset
|
529 { |
e5e8ac0bd7fc
support for PVR channel navigation (patch by Sven Gothel <sgothel at jausoft dot com>)
ben
parents:
23166
diff
changeset
|
530 mp_msg (MSGT_OPEN, MSGL_ERR, "%s can't get frequency %d.\n", |
e5e8ac0bd7fc
support for PVR channel navigation (patch by Sven Gothel <sgothel at jausoft dot com>)
ben
parents:
23166
diff
changeset
|
531 LOG_LEVEL_V4L2, errno); |
e5e8ac0bd7fc
support for PVR channel navigation (patch by Sven Gothel <sgothel at jausoft dot com>)
ben
parents:
23166
diff
changeset
|
532 return -1; |
e5e8ac0bd7fc
support for PVR channel navigation (patch by Sven Gothel <sgothel at jausoft dot com>)
ben
parents:
23166
diff
changeset
|
533 } |
e5e8ac0bd7fc
support for PVR channel navigation (patch by Sven Gothel <sgothel at jausoft dot com>)
ben
parents:
23166
diff
changeset
|
534 freq = vf.frequency; |
e5e8ac0bd7fc
support for PVR channel navigation (patch by Sven Gothel <sgothel at jausoft dot com>)
ben
parents:
23166
diff
changeset
|
535 if (!(vt.capability & V4L2_TUNER_CAP_LOW)) |
e5e8ac0bd7fc
support for PVR channel navigation (patch by Sven Gothel <sgothel at jausoft dot com>)
ben
parents:
23166
diff
changeset
|
536 freq *= 1000; |
e5e8ac0bd7fc
support for PVR channel navigation (patch by Sven Gothel <sgothel at jausoft dot com>)
ben
parents:
23166
diff
changeset
|
537 freq /= 16; |
e5e8ac0bd7fc
support for PVR channel navigation (patch by Sven Gothel <sgothel at jausoft dot com>)
ben
parents:
23166
diff
changeset
|
538 |
e5e8ac0bd7fc
support for PVR channel navigation (patch by Sven Gothel <sgothel at jausoft dot com>)
ben
parents:
23166
diff
changeset
|
539 return freq; |
e5e8ac0bd7fc
support for PVR channel navigation (patch by Sven Gothel <sgothel at jausoft dot com>)
ben
parents:
23166
diff
changeset
|
540 } |
e5e8ac0bd7fc
support for PVR channel navigation (patch by Sven Gothel <sgothel at jausoft dot com>)
ben
parents:
23166
diff
changeset
|
541 |
e5e8ac0bd7fc
support for PVR channel navigation (patch by Sven Gothel <sgothel at jausoft dot com>)
ben
parents:
23166
diff
changeset
|
542 static int |
e5e8ac0bd7fc
support for PVR channel navigation (patch by Sven Gothel <sgothel at jausoft dot com>)
ben
parents:
23166
diff
changeset
|
543 set_v4l2_freq (struct pvr_t *pvr) |
e5e8ac0bd7fc
support for PVR channel navigation (patch by Sven Gothel <sgothel at jausoft dot com>)
ben
parents:
23166
diff
changeset
|
544 { |
e5e8ac0bd7fc
support for PVR channel navigation (patch by Sven Gothel <sgothel at jausoft dot com>)
ben
parents:
23166
diff
changeset
|
545 struct v4l2_frequency vf; |
e5e8ac0bd7fc
support for PVR channel navigation (patch by Sven Gothel <sgothel at jausoft dot com>)
ben
parents:
23166
diff
changeset
|
546 struct v4l2_tuner vt; |
e5e8ac0bd7fc
support for PVR channel navigation (patch by Sven Gothel <sgothel at jausoft dot com>)
ben
parents:
23166
diff
changeset
|
547 |
e5e8ac0bd7fc
support for PVR channel navigation (patch by Sven Gothel <sgothel at jausoft dot com>)
ben
parents:
23166
diff
changeset
|
548 if (!pvr) |
e5e8ac0bd7fc
support for PVR channel navigation (patch by Sven Gothel <sgothel at jausoft dot com>)
ben
parents:
23166
diff
changeset
|
549 return -1; |
e5e8ac0bd7fc
support for PVR channel navigation (patch by Sven Gothel <sgothel at jausoft dot com>)
ben
parents:
23166
diff
changeset
|
550 |
e5e8ac0bd7fc
support for PVR channel navigation (patch by Sven Gothel <sgothel at jausoft dot com>)
ben
parents:
23166
diff
changeset
|
551 if (0 >= pvr->freq) |
e5e8ac0bd7fc
support for PVR channel navigation (patch by Sven Gothel <sgothel at jausoft dot com>)
ben
parents:
23166
diff
changeset
|
552 { |
e5e8ac0bd7fc
support for PVR channel navigation (patch by Sven Gothel <sgothel at jausoft dot com>)
ben
parents:
23166
diff
changeset
|
553 mp_msg (MSGT_OPEN, MSGL_ERR, |
e5e8ac0bd7fc
support for PVR channel navigation (patch by Sven Gothel <sgothel at jausoft dot com>)
ben
parents:
23166
diff
changeset
|
554 "%s Frequency invalid %d !!!\n", LOG_LEVEL_V4L2, pvr->freq); |
e5e8ac0bd7fc
support for PVR channel navigation (patch by Sven Gothel <sgothel at jausoft dot com>)
ben
parents:
23166
diff
changeset
|
555 return -1; |
e5e8ac0bd7fc
support for PVR channel navigation (patch by Sven Gothel <sgothel at jausoft dot com>)
ben
parents:
23166
diff
changeset
|
556 } |
e5e8ac0bd7fc
support for PVR channel navigation (patch by Sven Gothel <sgothel at jausoft dot com>)
ben
parents:
23166
diff
changeset
|
557 |
e5e8ac0bd7fc
support for PVR channel navigation (patch by Sven Gothel <sgothel at jausoft dot com>)
ben
parents:
23166
diff
changeset
|
558 /* don't set the frequency, if it's already set. |
e5e8ac0bd7fc
support for PVR channel navigation (patch by Sven Gothel <sgothel at jausoft dot com>)
ben
parents:
23166
diff
changeset
|
559 * setting it here would interrupt the stream. |
e5e8ac0bd7fc
support for PVR channel navigation (patch by Sven Gothel <sgothel at jausoft dot com>)
ben
parents:
23166
diff
changeset
|
560 */ |
e5e8ac0bd7fc
support for PVR channel navigation (patch by Sven Gothel <sgothel at jausoft dot com>)
ben
parents:
23166
diff
changeset
|
561 if (get_v4l2_freq (pvr) == pvr->freq) |
e5e8ac0bd7fc
support for PVR channel navigation (patch by Sven Gothel <sgothel at jausoft dot com>)
ben
parents:
23166
diff
changeset
|
562 { |
e5e8ac0bd7fc
support for PVR channel navigation (patch by Sven Gothel <sgothel at jausoft dot com>)
ben
parents:
23166
diff
changeset
|
563 mp_msg (MSGT_OPEN, MSGL_STATUS, |
e5e8ac0bd7fc
support for PVR channel navigation (patch by Sven Gothel <sgothel at jausoft dot com>)
ben
parents:
23166
diff
changeset
|
564 "%s Frequency %d already set.\n", LOG_LEVEL_V4L2, pvr->freq); |
e5e8ac0bd7fc
support for PVR channel navigation (patch by Sven Gothel <sgothel at jausoft dot com>)
ben
parents:
23166
diff
changeset
|
565 return 0; |
e5e8ac0bd7fc
support for PVR channel navigation (patch by Sven Gothel <sgothel at jausoft dot com>)
ben
parents:
23166
diff
changeset
|
566 } |
e5e8ac0bd7fc
support for PVR channel navigation (patch by Sven Gothel <sgothel at jausoft dot com>)
ben
parents:
23166
diff
changeset
|
567 |
e5e8ac0bd7fc
support for PVR channel navigation (patch by Sven Gothel <sgothel at jausoft dot com>)
ben
parents:
23166
diff
changeset
|
568 if (pvr->dev_fd < 0) |
e5e8ac0bd7fc
support for PVR channel navigation (patch by Sven Gothel <sgothel at jausoft dot com>)
ben
parents:
23166
diff
changeset
|
569 return -1; |
e5e8ac0bd7fc
support for PVR channel navigation (patch by Sven Gothel <sgothel at jausoft dot com>)
ben
parents:
23166
diff
changeset
|
570 |
e5e8ac0bd7fc
support for PVR channel navigation (patch by Sven Gothel <sgothel at jausoft dot com>)
ben
parents:
23166
diff
changeset
|
571 memset (&vf, 0, sizeof (vf)); |
e5e8ac0bd7fc
support for PVR channel navigation (patch by Sven Gothel <sgothel at jausoft dot com>)
ben
parents:
23166
diff
changeset
|
572 memset (&vt, 0, sizeof (vt)); |
e5e8ac0bd7fc
support for PVR channel navigation (patch by Sven Gothel <sgothel at jausoft dot com>)
ben
parents:
23166
diff
changeset
|
573 |
e5e8ac0bd7fc
support for PVR channel navigation (patch by Sven Gothel <sgothel at jausoft dot com>)
ben
parents:
23166
diff
changeset
|
574 if (ioctl (pvr->dev_fd, VIDIOC_G_TUNER, &vt) < 0) |
e5e8ac0bd7fc
support for PVR channel navigation (patch by Sven Gothel <sgothel at jausoft dot com>)
ben
parents:
23166
diff
changeset
|
575 { |
e5e8ac0bd7fc
support for PVR channel navigation (patch by Sven Gothel <sgothel at jausoft dot com>)
ben
parents:
23166
diff
changeset
|
576 mp_msg (MSGT_OPEN, MSGL_ERR, "%s can't get tuner (%s).\n", |
e5e8ac0bd7fc
support for PVR channel navigation (patch by Sven Gothel <sgothel at jausoft dot com>)
ben
parents:
23166
diff
changeset
|
577 LOG_LEVEL_V4L2, strerror (errno)); |
e5e8ac0bd7fc
support for PVR channel navigation (patch by Sven Gothel <sgothel at jausoft dot com>)
ben
parents:
23166
diff
changeset
|
578 return -1; |
e5e8ac0bd7fc
support for PVR channel navigation (patch by Sven Gothel <sgothel at jausoft dot com>)
ben
parents:
23166
diff
changeset
|
579 } |
e5e8ac0bd7fc
support for PVR channel navigation (patch by Sven Gothel <sgothel at jausoft dot com>)
ben
parents:
23166
diff
changeset
|
580 |
e5e8ac0bd7fc
support for PVR channel navigation (patch by Sven Gothel <sgothel at jausoft dot com>)
ben
parents:
23166
diff
changeset
|
581 vf.type = vt.type; |
e5e8ac0bd7fc
support for PVR channel navigation (patch by Sven Gothel <sgothel at jausoft dot com>)
ben
parents:
23166
diff
changeset
|
582 vf.frequency = pvr->freq * 16; |
e5e8ac0bd7fc
support for PVR channel navigation (patch by Sven Gothel <sgothel at jausoft dot com>)
ben
parents:
23166
diff
changeset
|
583 |
e5e8ac0bd7fc
support for PVR channel navigation (patch by Sven Gothel <sgothel at jausoft dot com>)
ben
parents:
23166
diff
changeset
|
584 if (!(vt.capability & V4L2_TUNER_CAP_LOW)) |
e5e8ac0bd7fc
support for PVR channel navigation (patch by Sven Gothel <sgothel at jausoft dot com>)
ben
parents:
23166
diff
changeset
|
585 vf.frequency /= 1000; |
e5e8ac0bd7fc
support for PVR channel navigation (patch by Sven Gothel <sgothel at jausoft dot com>)
ben
parents:
23166
diff
changeset
|
586 |
e5e8ac0bd7fc
support for PVR channel navigation (patch by Sven Gothel <sgothel at jausoft dot com>)
ben
parents:
23166
diff
changeset
|
587 if (ioctl (pvr->dev_fd, VIDIOC_S_FREQUENCY, &vf) < 0) |
e5e8ac0bd7fc
support for PVR channel navigation (patch by Sven Gothel <sgothel at jausoft dot com>)
ben
parents:
23166
diff
changeset
|
588 { |
e5e8ac0bd7fc
support for PVR channel navigation (patch by Sven Gothel <sgothel at jausoft dot com>)
ben
parents:
23166
diff
changeset
|
589 mp_msg (MSGT_OPEN, MSGL_ERR, "%s can't set frequency (%s).\n", |
e5e8ac0bd7fc
support for PVR channel navigation (patch by Sven Gothel <sgothel at jausoft dot com>)
ben
parents:
23166
diff
changeset
|
590 LOG_LEVEL_V4L2, strerror (errno)); |
e5e8ac0bd7fc
support for PVR channel navigation (patch by Sven Gothel <sgothel at jausoft dot com>)
ben
parents:
23166
diff
changeset
|
591 return -1; |
e5e8ac0bd7fc
support for PVR channel navigation (patch by Sven Gothel <sgothel at jausoft dot com>)
ben
parents:
23166
diff
changeset
|
592 } |
e5e8ac0bd7fc
support for PVR channel navigation (patch by Sven Gothel <sgothel at jausoft dot com>)
ben
parents:
23166
diff
changeset
|
593 |
e5e8ac0bd7fc
support for PVR channel navigation (patch by Sven Gothel <sgothel at jausoft dot com>)
ben
parents:
23166
diff
changeset
|
594 memset (&vt, 0, sizeof(vt)); |
e5e8ac0bd7fc
support for PVR channel navigation (patch by Sven Gothel <sgothel at jausoft dot com>)
ben
parents:
23166
diff
changeset
|
595 if (ioctl (pvr->dev_fd, VIDIOC_G_TUNER, &vt) < 0) |
e5e8ac0bd7fc
support for PVR channel navigation (patch by Sven Gothel <sgothel at jausoft dot com>)
ben
parents:
23166
diff
changeset
|
596 { |
e5e8ac0bd7fc
support for PVR channel navigation (patch by Sven Gothel <sgothel at jausoft dot com>)
ben
parents:
23166
diff
changeset
|
597 mp_msg (MSGT_OPEN, MSGL_ERR, "%s can't set tuner (%s).\n", |
e5e8ac0bd7fc
support for PVR channel navigation (patch by Sven Gothel <sgothel at jausoft dot com>)
ben
parents:
23166
diff
changeset
|
598 LOG_LEVEL_V4L2, strerror (errno)); |
e5e8ac0bd7fc
support for PVR channel navigation (patch by Sven Gothel <sgothel at jausoft dot com>)
ben
parents:
23166
diff
changeset
|
599 return -1; |
e5e8ac0bd7fc
support for PVR channel navigation (patch by Sven Gothel <sgothel at jausoft dot com>)
ben
parents:
23166
diff
changeset
|
600 } |
e5e8ac0bd7fc
support for PVR channel navigation (patch by Sven Gothel <sgothel at jausoft dot com>)
ben
parents:
23166
diff
changeset
|
601 |
e5e8ac0bd7fc
support for PVR channel navigation (patch by Sven Gothel <sgothel at jausoft dot com>)
ben
parents:
23166
diff
changeset
|
602 /* just a notification */ |
e5e8ac0bd7fc
support for PVR channel navigation (patch by Sven Gothel <sgothel at jausoft dot com>)
ben
parents:
23166
diff
changeset
|
603 if (!vt.signal) |
e5e8ac0bd7fc
support for PVR channel navigation (patch by Sven Gothel <sgothel at jausoft dot com>)
ben
parents:
23166
diff
changeset
|
604 mp_msg (MSGT_OPEN, MSGL_ERR, "%s NO SIGNAL at frequency %d (%d)\n", |
e5e8ac0bd7fc
support for PVR channel navigation (patch by Sven Gothel <sgothel at jausoft dot com>)
ben
parents:
23166
diff
changeset
|
605 LOG_LEVEL_V4L2, pvr->freq, vf.frequency); |
e5e8ac0bd7fc
support for PVR channel navigation (patch by Sven Gothel <sgothel at jausoft dot com>)
ben
parents:
23166
diff
changeset
|
606 else |
e5e8ac0bd7fc
support for PVR channel navigation (patch by Sven Gothel <sgothel at jausoft dot com>)
ben
parents:
23166
diff
changeset
|
607 mp_msg (MSGT_OPEN, MSGL_STATUS, "%s Got signal at frequency %d (%d)\n", |
e5e8ac0bd7fc
support for PVR channel navigation (patch by Sven Gothel <sgothel at jausoft dot com>)
ben
parents:
23166
diff
changeset
|
608 LOG_LEVEL_V4L2, pvr->freq, vf.frequency); |
e5e8ac0bd7fc
support for PVR channel navigation (patch by Sven Gothel <sgothel at jausoft dot com>)
ben
parents:
23166
diff
changeset
|
609 |
e5e8ac0bd7fc
support for PVR channel navigation (patch by Sven Gothel <sgothel at jausoft dot com>)
ben
parents:
23166
diff
changeset
|
610 return 0; |
e5e8ac0bd7fc
support for PVR channel navigation (patch by Sven Gothel <sgothel at jausoft dot com>)
ben
parents:
23166
diff
changeset
|
611 } |
e5e8ac0bd7fc
support for PVR channel navigation (patch by Sven Gothel <sgothel at jausoft dot com>)
ben
parents:
23166
diff
changeset
|
612 |
e5e8ac0bd7fc
support for PVR channel navigation (patch by Sven Gothel <sgothel at jausoft dot com>)
ben
parents:
23166
diff
changeset
|
613 static int |
e5e8ac0bd7fc
support for PVR channel navigation (patch by Sven Gothel <sgothel at jausoft dot com>)
ben
parents:
23166
diff
changeset
|
614 set_station_by_step (struct pvr_t *pvr, int step, int v4lAction) |
e5e8ac0bd7fc
support for PVR channel navigation (patch by Sven Gothel <sgothel at jausoft dot com>)
ben
parents:
23166
diff
changeset
|
615 { |
e5e8ac0bd7fc
support for PVR channel navigation (patch by Sven Gothel <sgothel at jausoft dot com>)
ben
parents:
23166
diff
changeset
|
616 if (!pvr || !pvr->stationlist.list) |
e5e8ac0bd7fc
support for PVR channel navigation (patch by Sven Gothel <sgothel at jausoft dot com>)
ben
parents:
23166
diff
changeset
|
617 return -1; |
e5e8ac0bd7fc
support for PVR channel navigation (patch by Sven Gothel <sgothel at jausoft dot com>)
ben
parents:
23166
diff
changeset
|
618 |
e5e8ac0bd7fc
support for PVR channel navigation (patch by Sven Gothel <sgothel at jausoft dot com>)
ben
parents:
23166
diff
changeset
|
619 if (pvr->stationlist.enabled >= abs (step)) |
e5e8ac0bd7fc
support for PVR channel navigation (patch by Sven Gothel <sgothel at jausoft dot com>)
ben
parents:
23166
diff
changeset
|
620 { |
e5e8ac0bd7fc
support for PVR channel navigation (patch by Sven Gothel <sgothel at jausoft dot com>)
ben
parents:
23166
diff
changeset
|
621 int gotcha = 0; |
e5e8ac0bd7fc
support for PVR channel navigation (patch by Sven Gothel <sgothel at jausoft dot com>)
ben
parents:
23166
diff
changeset
|
622 int chidx = pvr->chan_idx + step; |
e5e8ac0bd7fc
support for PVR channel navigation (patch by Sven Gothel <sgothel at jausoft dot com>)
ben
parents:
23166
diff
changeset
|
623 |
e5e8ac0bd7fc
support for PVR channel navigation (patch by Sven Gothel <sgothel at jausoft dot com>)
ben
parents:
23166
diff
changeset
|
624 while (!gotcha) |
e5e8ac0bd7fc
support for PVR channel navigation (patch by Sven Gothel <sgothel at jausoft dot com>)
ben
parents:
23166
diff
changeset
|
625 { |
e5e8ac0bd7fc
support for PVR channel navigation (patch by Sven Gothel <sgothel at jausoft dot com>)
ben
parents:
23166
diff
changeset
|
626 chidx = (chidx + pvr->stationlist.used) % pvr->stationlist.used; |
e5e8ac0bd7fc
support for PVR channel navigation (patch by Sven Gothel <sgothel at jausoft dot com>)
ben
parents:
23166
diff
changeset
|
627 |
e5e8ac0bd7fc
support for PVR channel navigation (patch by Sven Gothel <sgothel at jausoft dot com>)
ben
parents:
23166
diff
changeset
|
628 mp_msg (MSGT_OPEN, MSGL_DBG2, |
e5e8ac0bd7fc
support for PVR channel navigation (patch by Sven Gothel <sgothel at jausoft dot com>)
ben
parents:
23166
diff
changeset
|
629 "%s Offset switch: current %d, enabled %d, step %d -> %d\n", |
e5e8ac0bd7fc
support for PVR channel navigation (patch by Sven Gothel <sgothel at jausoft dot com>)
ben
parents:
23166
diff
changeset
|
630 LOG_LEVEL_V4L2, pvr->chan_idx, |
e5e8ac0bd7fc
support for PVR channel navigation (patch by Sven Gothel <sgothel at jausoft dot com>)
ben
parents:
23166
diff
changeset
|
631 pvr->stationlist.enabled, step, chidx); |
e5e8ac0bd7fc
support for PVR channel navigation (patch by Sven Gothel <sgothel at jausoft dot com>)
ben
parents:
23166
diff
changeset
|
632 |
e5e8ac0bd7fc
support for PVR channel navigation (patch by Sven Gothel <sgothel at jausoft dot com>)
ben
parents:
23166
diff
changeset
|
633 if (!pvr->stationlist.list[chidx].enabled) |
e5e8ac0bd7fc
support for PVR channel navigation (patch by Sven Gothel <sgothel at jausoft dot com>)
ben
parents:
23166
diff
changeset
|
634 { |
e5e8ac0bd7fc
support for PVR channel navigation (patch by Sven Gothel <sgothel at jausoft dot com>)
ben
parents:
23166
diff
changeset
|
635 mp_msg (MSGT_OPEN, MSGL_DBG2, |
e5e8ac0bd7fc
support for PVR channel navigation (patch by Sven Gothel <sgothel at jausoft dot com>)
ben
parents:
23166
diff
changeset
|
636 "%s Switch disabled to user station channel: %8s - freq: %8d - station: %s\n", LOG_LEVEL_V4L2, |
e5e8ac0bd7fc
support for PVR channel navigation (patch by Sven Gothel <sgothel at jausoft dot com>)
ben
parents:
23166
diff
changeset
|
637 pvr->stationlist.list[chidx].name, |
e5e8ac0bd7fc
support for PVR channel navigation (patch by Sven Gothel <sgothel at jausoft dot com>)
ben
parents:
23166
diff
changeset
|
638 pvr->stationlist.list[chidx].freq, |
e5e8ac0bd7fc
support for PVR channel navigation (patch by Sven Gothel <sgothel at jausoft dot com>)
ben
parents:
23166
diff
changeset
|
639 pvr->stationlist.list[chidx].station); |
e5e8ac0bd7fc
support for PVR channel navigation (patch by Sven Gothel <sgothel at jausoft dot com>)
ben
parents:
23166
diff
changeset
|
640 chidx += FFSIGN (step); |
e5e8ac0bd7fc
support for PVR channel navigation (patch by Sven Gothel <sgothel at jausoft dot com>)
ben
parents:
23166
diff
changeset
|
641 } |
e5e8ac0bd7fc
support for PVR channel navigation (patch by Sven Gothel <sgothel at jausoft dot com>)
ben
parents:
23166
diff
changeset
|
642 else |
e5e8ac0bd7fc
support for PVR channel navigation (patch by Sven Gothel <sgothel at jausoft dot com>)
ben
parents:
23166
diff
changeset
|
643 gotcha = 1; |
e5e8ac0bd7fc
support for PVR channel navigation (patch by Sven Gothel <sgothel at jausoft dot com>)
ben
parents:
23166
diff
changeset
|
644 } |
e5e8ac0bd7fc
support for PVR channel navigation (patch by Sven Gothel <sgothel at jausoft dot com>)
ben
parents:
23166
diff
changeset
|
645 |
e5e8ac0bd7fc
support for PVR channel navigation (patch by Sven Gothel <sgothel at jausoft dot com>)
ben
parents:
23166
diff
changeset
|
646 pvr->freq = pvr->stationlist.list[chidx].freq; |
e5e8ac0bd7fc
support for PVR channel navigation (patch by Sven Gothel <sgothel at jausoft dot com>)
ben
parents:
23166
diff
changeset
|
647 pvr->chan_idx_last = pvr->chan_idx; |
e5e8ac0bd7fc
support for PVR channel navigation (patch by Sven Gothel <sgothel at jausoft dot com>)
ben
parents:
23166
diff
changeset
|
648 pvr->chan_idx = chidx; |
e5e8ac0bd7fc
support for PVR channel navigation (patch by Sven Gothel <sgothel at jausoft dot com>)
ben
parents:
23166
diff
changeset
|
649 |
e5e8ac0bd7fc
support for PVR channel navigation (patch by Sven Gothel <sgothel at jausoft dot com>)
ben
parents:
23166
diff
changeset
|
650 mp_msg (MSGT_OPEN, MSGL_INFO, |
e5e8ac0bd7fc
support for PVR channel navigation (patch by Sven Gothel <sgothel at jausoft dot com>)
ben
parents:
23166
diff
changeset
|
651 "%s Switch to user station channel: %8s - freq: %8d - station: %s\n", LOG_LEVEL_V4L2, |
e5e8ac0bd7fc
support for PVR channel navigation (patch by Sven Gothel <sgothel at jausoft dot com>)
ben
parents:
23166
diff
changeset
|
652 pvr->stationlist.list[chidx].name, |
e5e8ac0bd7fc
support for PVR channel navigation (patch by Sven Gothel <sgothel at jausoft dot com>)
ben
parents:
23166
diff
changeset
|
653 pvr->stationlist.list[chidx].freq, |
e5e8ac0bd7fc
support for PVR channel navigation (patch by Sven Gothel <sgothel at jausoft dot com>)
ben
parents:
23166
diff
changeset
|
654 pvr->stationlist.list[chidx].station); |
e5e8ac0bd7fc
support for PVR channel navigation (patch by Sven Gothel <sgothel at jausoft dot com>)
ben
parents:
23166
diff
changeset
|
655 |
e5e8ac0bd7fc
support for PVR channel navigation (patch by Sven Gothel <sgothel at jausoft dot com>)
ben
parents:
23166
diff
changeset
|
656 if (v4lAction) |
e5e8ac0bd7fc
support for PVR channel navigation (patch by Sven Gothel <sgothel at jausoft dot com>)
ben
parents:
23166
diff
changeset
|
657 return set_v4l2_freq (pvr); |
e5e8ac0bd7fc
support for PVR channel navigation (patch by Sven Gothel <sgothel at jausoft dot com>)
ben
parents:
23166
diff
changeset
|
658 |
e5e8ac0bd7fc
support for PVR channel navigation (patch by Sven Gothel <sgothel at jausoft dot com>)
ben
parents:
23166
diff
changeset
|
659 return (pvr->freq > 0) ? 0 : -1; |
e5e8ac0bd7fc
support for PVR channel navigation (patch by Sven Gothel <sgothel at jausoft dot com>)
ben
parents:
23166
diff
changeset
|
660 } |
e5e8ac0bd7fc
support for PVR channel navigation (patch by Sven Gothel <sgothel at jausoft dot com>)
ben
parents:
23166
diff
changeset
|
661 |
e5e8ac0bd7fc
support for PVR channel navigation (patch by Sven Gothel <sgothel at jausoft dot com>)
ben
parents:
23166
diff
changeset
|
662 mp_msg (MSGT_OPEN, MSGL_ERR, |
e5e8ac0bd7fc
support for PVR channel navigation (patch by Sven Gothel <sgothel at jausoft dot com>)
ben
parents:
23166
diff
changeset
|
663 "%s Ooops couldn't set freq by channel entry step %d to current %d, enabled %d\n", LOG_LEVEL_V4L2, |
e5e8ac0bd7fc
support for PVR channel navigation (patch by Sven Gothel <sgothel at jausoft dot com>)
ben
parents:
23166
diff
changeset
|
664 step, pvr->chan_idx, pvr->stationlist.enabled); |
e5e8ac0bd7fc
support for PVR channel navigation (patch by Sven Gothel <sgothel at jausoft dot com>)
ben
parents:
23166
diff
changeset
|
665 |
e5e8ac0bd7fc
support for PVR channel navigation (patch by Sven Gothel <sgothel at jausoft dot com>)
ben
parents:
23166
diff
changeset
|
666 return -1; |
e5e8ac0bd7fc
support for PVR channel navigation (patch by Sven Gothel <sgothel at jausoft dot com>)
ben
parents:
23166
diff
changeset
|
667 } |
e5e8ac0bd7fc
support for PVR channel navigation (patch by Sven Gothel <sgothel at jausoft dot com>)
ben
parents:
23166
diff
changeset
|
668 |
e5e8ac0bd7fc
support for PVR channel navigation (patch by Sven Gothel <sgothel at jausoft dot com>)
ben
parents:
23166
diff
changeset
|
669 static int |
e5e8ac0bd7fc
support for PVR channel navigation (patch by Sven Gothel <sgothel at jausoft dot com>)
ben
parents:
23166
diff
changeset
|
670 set_station_by_channelname_or_freq (struct pvr_t *pvr, const char *channel, |
e5e8ac0bd7fc
support for PVR channel navigation (patch by Sven Gothel <sgothel at jausoft dot com>)
ben
parents:
23166
diff
changeset
|
671 int freq, int v4lAction) |
e5e8ac0bd7fc
support for PVR channel navigation (patch by Sven Gothel <sgothel at jausoft dot com>)
ben
parents:
23166
diff
changeset
|
672 { |
e5e8ac0bd7fc
support for PVR channel navigation (patch by Sven Gothel <sgothel at jausoft dot com>)
ben
parents:
23166
diff
changeset
|
673 int i = 0; |
e5e8ac0bd7fc
support for PVR channel navigation (patch by Sven Gothel <sgothel at jausoft dot com>)
ben
parents:
23166
diff
changeset
|
674 |
e5e8ac0bd7fc
support for PVR channel navigation (patch by Sven Gothel <sgothel at jausoft dot com>)
ben
parents:
23166
diff
changeset
|
675 if (!pvr || !pvr->stationlist.list) |
e5e8ac0bd7fc
support for PVR channel navigation (patch by Sven Gothel <sgothel at jausoft dot com>)
ben
parents:
23166
diff
changeset
|
676 return -1; |
e5e8ac0bd7fc
support for PVR channel navigation (patch by Sven Gothel <sgothel at jausoft dot com>)
ben
parents:
23166
diff
changeset
|
677 |
e5e8ac0bd7fc
support for PVR channel navigation (patch by Sven Gothel <sgothel at jausoft dot com>)
ben
parents:
23166
diff
changeset
|
678 if (0 >= pvr->stationlist.enabled) |
e5e8ac0bd7fc
support for PVR channel navigation (patch by Sven Gothel <sgothel at jausoft dot com>)
ben
parents:
23166
diff
changeset
|
679 { |
e5e8ac0bd7fc
support for PVR channel navigation (patch by Sven Gothel <sgothel at jausoft dot com>)
ben
parents:
23166
diff
changeset
|
680 mp_msg (MSGT_OPEN, MSGL_WARN, |
e5e8ac0bd7fc
support for PVR channel navigation (patch by Sven Gothel <sgothel at jausoft dot com>)
ben
parents:
23166
diff
changeset
|
681 "%s No enabled station, cannot switch channel/frequency\n", |
e5e8ac0bd7fc
support for PVR channel navigation (patch by Sven Gothel <sgothel at jausoft dot com>)
ben
parents:
23166
diff
changeset
|
682 LOG_LEVEL_V4L2); |
e5e8ac0bd7fc
support for PVR channel navigation (patch by Sven Gothel <sgothel at jausoft dot com>)
ben
parents:
23166
diff
changeset
|
683 return -1; |
e5e8ac0bd7fc
support for PVR channel navigation (patch by Sven Gothel <sgothel at jausoft dot com>)
ben
parents:
23166
diff
changeset
|
684 } |
e5e8ac0bd7fc
support for PVR channel navigation (patch by Sven Gothel <sgothel at jausoft dot com>)
ben
parents:
23166
diff
changeset
|
685 |
e5e8ac0bd7fc
support for PVR channel navigation (patch by Sven Gothel <sgothel at jausoft dot com>)
ben
parents:
23166
diff
changeset
|
686 if (channel) |
e5e8ac0bd7fc
support for PVR channel navigation (patch by Sven Gothel <sgothel at jausoft dot com>)
ben
parents:
23166
diff
changeset
|
687 { |
e5e8ac0bd7fc
support for PVR channel navigation (patch by Sven Gothel <sgothel at jausoft dot com>)
ben
parents:
23166
diff
changeset
|
688 /* select by channel */ |
e5e8ac0bd7fc
support for PVR channel navigation (patch by Sven Gothel <sgothel at jausoft dot com>)
ben
parents:
23166
diff
changeset
|
689 for (i = 0; i < pvr->stationlist.used ; i++) |
e5e8ac0bd7fc
support for PVR channel navigation (patch by Sven Gothel <sgothel at jausoft dot com>)
ben
parents:
23166
diff
changeset
|
690 { |
e5e8ac0bd7fc
support for PVR channel navigation (patch by Sven Gothel <sgothel at jausoft dot com>)
ben
parents:
23166
diff
changeset
|
691 if (!strcasecmp (pvr->stationlist.list[i].name, channel)) |
e5e8ac0bd7fc
support for PVR channel navigation (patch by Sven Gothel <sgothel at jausoft dot com>)
ben
parents:
23166
diff
changeset
|
692 { |
e5e8ac0bd7fc
support for PVR channel navigation (patch by Sven Gothel <sgothel at jausoft dot com>)
ben
parents:
23166
diff
changeset
|
693 if (!pvr->stationlist.list[i].enabled) |
e5e8ac0bd7fc
support for PVR channel navigation (patch by Sven Gothel <sgothel at jausoft dot com>)
ben
parents:
23166
diff
changeset
|
694 { |
e5e8ac0bd7fc
support for PVR channel navigation (patch by Sven Gothel <sgothel at jausoft dot com>)
ben
parents:
23166
diff
changeset
|
695 mp_msg (MSGT_OPEN, MSGL_WARN, |
e5e8ac0bd7fc
support for PVR channel navigation (patch by Sven Gothel <sgothel at jausoft dot com>)
ben
parents:
23166
diff
changeset
|
696 "%s Switch disabled to user station channel: %8s - freq: %8d - station: %s\n", LOG_LEVEL_V4L2, |
e5e8ac0bd7fc
support for PVR channel navigation (patch by Sven Gothel <sgothel at jausoft dot com>)
ben
parents:
23166
diff
changeset
|
697 pvr->stationlist.list[i].name, |
e5e8ac0bd7fc
support for PVR channel navigation (patch by Sven Gothel <sgothel at jausoft dot com>)
ben
parents:
23166
diff
changeset
|
698 pvr->stationlist.list[i].freq, |
e5e8ac0bd7fc
support for PVR channel navigation (patch by Sven Gothel <sgothel at jausoft dot com>)
ben
parents:
23166
diff
changeset
|
699 pvr->stationlist.list[i].station); |
e5e8ac0bd7fc
support for PVR channel navigation (patch by Sven Gothel <sgothel at jausoft dot com>)
ben
parents:
23166
diff
changeset
|
700 |
e5e8ac0bd7fc
support for PVR channel navigation (patch by Sven Gothel <sgothel at jausoft dot com>)
ben
parents:
23166
diff
changeset
|
701 return -1; |
e5e8ac0bd7fc
support for PVR channel navigation (patch by Sven Gothel <sgothel at jausoft dot com>)
ben
parents:
23166
diff
changeset
|
702 } |
e5e8ac0bd7fc
support for PVR channel navigation (patch by Sven Gothel <sgothel at jausoft dot com>)
ben
parents:
23166
diff
changeset
|
703 |
e5e8ac0bd7fc
support for PVR channel navigation (patch by Sven Gothel <sgothel at jausoft dot com>)
ben
parents:
23166
diff
changeset
|
704 pvr->freq = pvr->stationlist.list[i].freq; |
e5e8ac0bd7fc
support for PVR channel navigation (patch by Sven Gothel <sgothel at jausoft dot com>)
ben
parents:
23166
diff
changeset
|
705 pvr->chan_idx_last = pvr->chan_idx; |
e5e8ac0bd7fc
support for PVR channel navigation (patch by Sven Gothel <sgothel at jausoft dot com>)
ben
parents:
23166
diff
changeset
|
706 pvr->chan_idx = i; |
e5e8ac0bd7fc
support for PVR channel navigation (patch by Sven Gothel <sgothel at jausoft dot com>)
ben
parents:
23166
diff
changeset
|
707 break; |
e5e8ac0bd7fc
support for PVR channel navigation (patch by Sven Gothel <sgothel at jausoft dot com>)
ben
parents:
23166
diff
changeset
|
708 } |
e5e8ac0bd7fc
support for PVR channel navigation (patch by Sven Gothel <sgothel at jausoft dot com>)
ben
parents:
23166
diff
changeset
|
709 } |
e5e8ac0bd7fc
support for PVR channel navigation (patch by Sven Gothel <sgothel at jausoft dot com>)
ben
parents:
23166
diff
changeset
|
710 } |
e5e8ac0bd7fc
support for PVR channel navigation (patch by Sven Gothel <sgothel at jausoft dot com>)
ben
parents:
23166
diff
changeset
|
711 else if (freq >= 0) |
e5e8ac0bd7fc
support for PVR channel navigation (patch by Sven Gothel <sgothel at jausoft dot com>)
ben
parents:
23166
diff
changeset
|
712 { |
e5e8ac0bd7fc
support for PVR channel navigation (patch by Sven Gothel <sgothel at jausoft dot com>)
ben
parents:
23166
diff
changeset
|
713 /* select by freq */ |
e5e8ac0bd7fc
support for PVR channel navigation (patch by Sven Gothel <sgothel at jausoft dot com>)
ben
parents:
23166
diff
changeset
|
714 for (i = 0; i < pvr->stationlist.used; i++) |
e5e8ac0bd7fc
support for PVR channel navigation (patch by Sven Gothel <sgothel at jausoft dot com>)
ben
parents:
23166
diff
changeset
|
715 { |
e5e8ac0bd7fc
support for PVR channel navigation (patch by Sven Gothel <sgothel at jausoft dot com>)
ben
parents:
23166
diff
changeset
|
716 if (pvr->stationlist.list[i].freq == freq) |
e5e8ac0bd7fc
support for PVR channel navigation (patch by Sven Gothel <sgothel at jausoft dot com>)
ben
parents:
23166
diff
changeset
|
717 { |
e5e8ac0bd7fc
support for PVR channel navigation (patch by Sven Gothel <sgothel at jausoft dot com>)
ben
parents:
23166
diff
changeset
|
718 if (!pvr->stationlist.list[i].enabled) |
e5e8ac0bd7fc
support for PVR channel navigation (patch by Sven Gothel <sgothel at jausoft dot com>)
ben
parents:
23166
diff
changeset
|
719 { |
e5e8ac0bd7fc
support for PVR channel navigation (patch by Sven Gothel <sgothel at jausoft dot com>)
ben
parents:
23166
diff
changeset
|
720 mp_msg (MSGT_OPEN, MSGL_WARN, |
e5e8ac0bd7fc
support for PVR channel navigation (patch by Sven Gothel <sgothel at jausoft dot com>)
ben
parents:
23166
diff
changeset
|
721 "%s Switch disabled to user station channel: %8s - freq: %8d - station: %s\n", LOG_LEVEL_V4L2, |
e5e8ac0bd7fc
support for PVR channel navigation (patch by Sven Gothel <sgothel at jausoft dot com>)
ben
parents:
23166
diff
changeset
|
722 pvr->stationlist.list[i].name, |
e5e8ac0bd7fc
support for PVR channel navigation (patch by Sven Gothel <sgothel at jausoft dot com>)
ben
parents:
23166
diff
changeset
|
723 pvr->stationlist.list[i].freq, |
e5e8ac0bd7fc
support for PVR channel navigation (patch by Sven Gothel <sgothel at jausoft dot com>)
ben
parents:
23166
diff
changeset
|
724 pvr->stationlist.list[i].station); |
e5e8ac0bd7fc
support for PVR channel navigation (patch by Sven Gothel <sgothel at jausoft dot com>)
ben
parents:
23166
diff
changeset
|
725 |
e5e8ac0bd7fc
support for PVR channel navigation (patch by Sven Gothel <sgothel at jausoft dot com>)
ben
parents:
23166
diff
changeset
|
726 return -1; |
e5e8ac0bd7fc
support for PVR channel navigation (patch by Sven Gothel <sgothel at jausoft dot com>)
ben
parents:
23166
diff
changeset
|
727 } |
e5e8ac0bd7fc
support for PVR channel navigation (patch by Sven Gothel <sgothel at jausoft dot com>)
ben
parents:
23166
diff
changeset
|
728 |
e5e8ac0bd7fc
support for PVR channel navigation (patch by Sven Gothel <sgothel at jausoft dot com>)
ben
parents:
23166
diff
changeset
|
729 pvr->freq = pvr->stationlist.list[i].freq; |
e5e8ac0bd7fc
support for PVR channel navigation (patch by Sven Gothel <sgothel at jausoft dot com>)
ben
parents:
23166
diff
changeset
|
730 pvr->chan_idx_last = pvr->chan_idx; |
e5e8ac0bd7fc
support for PVR channel navigation (patch by Sven Gothel <sgothel at jausoft dot com>)
ben
parents:
23166
diff
changeset
|
731 pvr->chan_idx = i; |
e5e8ac0bd7fc
support for PVR channel navigation (patch by Sven Gothel <sgothel at jausoft dot com>)
ben
parents:
23166
diff
changeset
|
732 break; |
e5e8ac0bd7fc
support for PVR channel navigation (patch by Sven Gothel <sgothel at jausoft dot com>)
ben
parents:
23166
diff
changeset
|
733 } |
e5e8ac0bd7fc
support for PVR channel navigation (patch by Sven Gothel <sgothel at jausoft dot com>)
ben
parents:
23166
diff
changeset
|
734 } |
e5e8ac0bd7fc
support for PVR channel navigation (patch by Sven Gothel <sgothel at jausoft dot com>)
ben
parents:
23166
diff
changeset
|
735 } |
e5e8ac0bd7fc
support for PVR channel navigation (patch by Sven Gothel <sgothel at jausoft dot com>)
ben
parents:
23166
diff
changeset
|
736 |
e5e8ac0bd7fc
support for PVR channel navigation (patch by Sven Gothel <sgothel at jausoft dot com>)
ben
parents:
23166
diff
changeset
|
737 if (i >= pvr->stationlist.used) |
e5e8ac0bd7fc
support for PVR channel navigation (patch by Sven Gothel <sgothel at jausoft dot com>)
ben
parents:
23166
diff
changeset
|
738 { |
e5e8ac0bd7fc
support for PVR channel navigation (patch by Sven Gothel <sgothel at jausoft dot com>)
ben
parents:
23166
diff
changeset
|
739 if (channel) |
e5e8ac0bd7fc
support for PVR channel navigation (patch by Sven Gothel <sgothel at jausoft dot com>)
ben
parents:
23166
diff
changeset
|
740 mp_msg (MSGT_OPEN, MSGL_WARN, |
e5e8ac0bd7fc
support for PVR channel navigation (patch by Sven Gothel <sgothel at jausoft dot com>)
ben
parents:
23166
diff
changeset
|
741 "%s unable to find channel %s\n", LOG_LEVEL_V4L2, channel); |
e5e8ac0bd7fc
support for PVR channel navigation (patch by Sven Gothel <sgothel at jausoft dot com>)
ben
parents:
23166
diff
changeset
|
742 else |
e5e8ac0bd7fc
support for PVR channel navigation (patch by Sven Gothel <sgothel at jausoft dot com>)
ben
parents:
23166
diff
changeset
|
743 mp_msg (MSGT_OPEN, MSGL_WARN, |
e5e8ac0bd7fc
support for PVR channel navigation (patch by Sven Gothel <sgothel at jausoft dot com>)
ben
parents:
23166
diff
changeset
|
744 "%s unable to find frequency %d\n", LOG_LEVEL_V4L2, freq); |
e5e8ac0bd7fc
support for PVR channel navigation (patch by Sven Gothel <sgothel at jausoft dot com>)
ben
parents:
23166
diff
changeset
|
745 return -1; |
e5e8ac0bd7fc
support for PVR channel navigation (patch by Sven Gothel <sgothel at jausoft dot com>)
ben
parents:
23166
diff
changeset
|
746 } |
e5e8ac0bd7fc
support for PVR channel navigation (patch by Sven Gothel <sgothel at jausoft dot com>)
ben
parents:
23166
diff
changeset
|
747 |
e5e8ac0bd7fc
support for PVR channel navigation (patch by Sven Gothel <sgothel at jausoft dot com>)
ben
parents:
23166
diff
changeset
|
748 mp_msg (MSGT_OPEN, MSGL_INFO, |
e5e8ac0bd7fc
support for PVR channel navigation (patch by Sven Gothel <sgothel at jausoft dot com>)
ben
parents:
23166
diff
changeset
|
749 "%s Switch to user station channel: %8s - freq: %8d - station: %s\n", LOG_LEVEL_V4L2, |
e5e8ac0bd7fc
support for PVR channel navigation (patch by Sven Gothel <sgothel at jausoft dot com>)
ben
parents:
23166
diff
changeset
|
750 pvr->stationlist.list[i].name, |
e5e8ac0bd7fc
support for PVR channel navigation (patch by Sven Gothel <sgothel at jausoft dot com>)
ben
parents:
23166
diff
changeset
|
751 pvr->stationlist.list[i].freq, |
e5e8ac0bd7fc
support for PVR channel navigation (patch by Sven Gothel <sgothel at jausoft dot com>)
ben
parents:
23166
diff
changeset
|
752 pvr->stationlist.list[i].station); |
e5e8ac0bd7fc
support for PVR channel navigation (patch by Sven Gothel <sgothel at jausoft dot com>)
ben
parents:
23166
diff
changeset
|
753 |
e5e8ac0bd7fc
support for PVR channel navigation (patch by Sven Gothel <sgothel at jausoft dot com>)
ben
parents:
23166
diff
changeset
|
754 if (v4lAction) |
e5e8ac0bd7fc
support for PVR channel navigation (patch by Sven Gothel <sgothel at jausoft dot com>)
ben
parents:
23166
diff
changeset
|
755 return set_v4l2_freq (pvr); |
e5e8ac0bd7fc
support for PVR channel navigation (patch by Sven Gothel <sgothel at jausoft dot com>)
ben
parents:
23166
diff
changeset
|
756 |
e5e8ac0bd7fc
support for PVR channel navigation (patch by Sven Gothel <sgothel at jausoft dot com>)
ben
parents:
23166
diff
changeset
|
757 return (pvr->freq > 0) ? 0 : -1; |
e5e8ac0bd7fc
support for PVR channel navigation (patch by Sven Gothel <sgothel at jausoft dot com>)
ben
parents:
23166
diff
changeset
|
758 } |
e5e8ac0bd7fc
support for PVR channel navigation (patch by Sven Gothel <sgothel at jausoft dot com>)
ben
parents:
23166
diff
changeset
|
759 |
e5e8ac0bd7fc
support for PVR channel navigation (patch by Sven Gothel <sgothel at jausoft dot com>)
ben
parents:
23166
diff
changeset
|
760 static int |
e5e8ac0bd7fc
support for PVR channel navigation (patch by Sven Gothel <sgothel at jausoft dot com>)
ben
parents:
23166
diff
changeset
|
761 force_freq_step (struct pvr_t *pvr, int step) |
e5e8ac0bd7fc
support for PVR channel navigation (patch by Sven Gothel <sgothel at jausoft dot com>)
ben
parents:
23166
diff
changeset
|
762 { |
e5e8ac0bd7fc
support for PVR channel navigation (patch by Sven Gothel <sgothel at jausoft dot com>)
ben
parents:
23166
diff
changeset
|
763 int freq; |
e5e8ac0bd7fc
support for PVR channel navigation (patch by Sven Gothel <sgothel at jausoft dot com>)
ben
parents:
23166
diff
changeset
|
764 |
e5e8ac0bd7fc
support for PVR channel navigation (patch by Sven Gothel <sgothel at jausoft dot com>)
ben
parents:
23166
diff
changeset
|
765 if (!pvr) |
e5e8ac0bd7fc
support for PVR channel navigation (patch by Sven Gothel <sgothel at jausoft dot com>)
ben
parents:
23166
diff
changeset
|
766 return -1; |
e5e8ac0bd7fc
support for PVR channel navigation (patch by Sven Gothel <sgothel at jausoft dot com>)
ben
parents:
23166
diff
changeset
|
767 |
e5e8ac0bd7fc
support for PVR channel navigation (patch by Sven Gothel <sgothel at jausoft dot com>)
ben
parents:
23166
diff
changeset
|
768 freq = pvr->freq+step; |
e5e8ac0bd7fc
support for PVR channel navigation (patch by Sven Gothel <sgothel at jausoft dot com>)
ben
parents:
23166
diff
changeset
|
769 |
e5e8ac0bd7fc
support for PVR channel navigation (patch by Sven Gothel <sgothel at jausoft dot com>)
ben
parents:
23166
diff
changeset
|
770 if (freq) |
e5e8ac0bd7fc
support for PVR channel navigation (patch by Sven Gothel <sgothel at jausoft dot com>)
ben
parents:
23166
diff
changeset
|
771 { |
e5e8ac0bd7fc
support for PVR channel navigation (patch by Sven Gothel <sgothel at jausoft dot com>)
ben
parents:
23166
diff
changeset
|
772 mp_msg (MSGT_OPEN, MSGL_INFO, |
e5e8ac0bd7fc
support for PVR channel navigation (patch by Sven Gothel <sgothel at jausoft dot com>)
ben
parents:
23166
diff
changeset
|
773 "%s Force Frequency %d + %d = %d \n", LOG_LEVEL_V4L2, |
e5e8ac0bd7fc
support for PVR channel navigation (patch by Sven Gothel <sgothel at jausoft dot com>)
ben
parents:
23166
diff
changeset
|
774 pvr->freq, step, freq); |
e5e8ac0bd7fc
support for PVR channel navigation (patch by Sven Gothel <sgothel at jausoft dot com>)
ben
parents:
23166
diff
changeset
|
775 |
e5e8ac0bd7fc
support for PVR channel navigation (patch by Sven Gothel <sgothel at jausoft dot com>)
ben
parents:
23166
diff
changeset
|
776 pvr->freq = freq; |
e5e8ac0bd7fc
support for PVR channel navigation (patch by Sven Gothel <sgothel at jausoft dot com>)
ben
parents:
23166
diff
changeset
|
777 |
e5e8ac0bd7fc
support for PVR channel navigation (patch by Sven Gothel <sgothel at jausoft dot com>)
ben
parents:
23166
diff
changeset
|
778 return set_v4l2_freq (pvr); |
e5e8ac0bd7fc
support for PVR channel navigation (patch by Sven Gothel <sgothel at jausoft dot com>)
ben
parents:
23166
diff
changeset
|
779 } |
e5e8ac0bd7fc
support for PVR channel navigation (patch by Sven Gothel <sgothel at jausoft dot com>)
ben
parents:
23166
diff
changeset
|
780 |
e5e8ac0bd7fc
support for PVR channel navigation (patch by Sven Gothel <sgothel at jausoft dot com>)
ben
parents:
23166
diff
changeset
|
781 return -1; |
e5e8ac0bd7fc
support for PVR channel navigation (patch by Sven Gothel <sgothel at jausoft dot com>)
ben
parents:
23166
diff
changeset
|
782 } |
e5e8ac0bd7fc
support for PVR channel navigation (patch by Sven Gothel <sgothel at jausoft dot com>)
ben
parents:
23166
diff
changeset
|
783 |
18997 | 784 static void |
19976
281ac13bf72d
cosmetic renames because pvr support will soon be less ivtv driver dependant
ben
parents:
19617
diff
changeset
|
785 parse_encoder_options (struct pvr_t *pvr) |
18997 | 786 { |
787 if (!pvr) | |
788 return; | |
789 | |
790 /* -pvr aspect=digit */ | |
19992
be7b8a83649c
removed ivtv driver dependancy in favor of native V4L2 MPEG API (requires Linux 2.6.18 and above)
ben
parents:
19976
diff
changeset
|
791 if (pvr_param_aspect_ratio >= 0 && pvr_param_aspect_ratio <= 3) |
18997 | 792 pvr->aspect = pvr_param_aspect_ratio; |
793 | |
794 /* -pvr arate=x */ | |
795 if (pvr_param_sample_rate != 0) | |
796 { | |
797 switch (pvr_param_sample_rate) | |
798 { | |
799 case 32000: | |
19992
be7b8a83649c
removed ivtv driver dependancy in favor of native V4L2 MPEG API (requires Linux 2.6.18 and above)
ben
parents:
19976
diff
changeset
|
800 pvr->samplerate = V4L2_MPEG_AUDIO_SAMPLING_FREQ_32000; |
18997 | 801 break; |
802 case 44100: | |
19992
be7b8a83649c
removed ivtv driver dependancy in favor of native V4L2 MPEG API (requires Linux 2.6.18 and above)
ben
parents:
19976
diff
changeset
|
803 pvr->samplerate = V4L2_MPEG_AUDIO_SAMPLING_FREQ_44100; |
18997 | 804 break; |
805 case 48000: | |
19992
be7b8a83649c
removed ivtv driver dependancy in favor of native V4L2 MPEG API (requires Linux 2.6.18 and above)
ben
parents:
19976
diff
changeset
|
806 pvr->samplerate = V4L2_MPEG_AUDIO_SAMPLING_FREQ_48000; |
18997 | 807 break; |
808 default: | |
809 break; | |
810 } | |
811 } | |
812 | |
813 /* -pvr alayer=x */ | |
814 if (pvr_param_audio_layer == 1) | |
19992
be7b8a83649c
removed ivtv driver dependancy in favor of native V4L2 MPEG API (requires Linux 2.6.18 and above)
ben
parents:
19976
diff
changeset
|
815 pvr->layer = V4L2_MPEG_AUDIO_ENCODING_LAYER_1; |
18997 | 816 else if (pvr_param_audio_layer == 2) |
19992
be7b8a83649c
removed ivtv driver dependancy in favor of native V4L2 MPEG API (requires Linux 2.6.18 and above)
ben
parents:
19976
diff
changeset
|
817 pvr->layer = V4L2_MPEG_AUDIO_ENCODING_LAYER_2; |
be7b8a83649c
removed ivtv driver dependancy in favor of native V4L2 MPEG API (requires Linux 2.6.18 and above)
ben
parents:
19976
diff
changeset
|
818 else if (pvr_param_audio_layer == 3) |
be7b8a83649c
removed ivtv driver dependancy in favor of native V4L2 MPEG API (requires Linux 2.6.18 and above)
ben
parents:
19976
diff
changeset
|
819 pvr->layer = V4L2_MPEG_AUDIO_ENCODING_LAYER_3; |
18997 | 820 |
821 /* -pvr abitrate=x */ | |
822 if (pvr_param_audio_bitrate != 0) | |
823 { | |
19992
be7b8a83649c
removed ivtv driver dependancy in favor of native V4L2 MPEG API (requires Linux 2.6.18 and above)
ben
parents:
19976
diff
changeset
|
824 if (pvr->layer == V4L2_MPEG_AUDIO_ENCODING_LAYER_1) |
be7b8a83649c
removed ivtv driver dependancy in favor of native V4L2 MPEG API (requires Linux 2.6.18 and above)
ben
parents:
19976
diff
changeset
|
825 { |
be7b8a83649c
removed ivtv driver dependancy in favor of native V4L2 MPEG API (requires Linux 2.6.18 and above)
ben
parents:
19976
diff
changeset
|
826 switch (pvr_param_audio_bitrate) |
be7b8a83649c
removed ivtv driver dependancy in favor of native V4L2 MPEG API (requires Linux 2.6.18 and above)
ben
parents:
19976
diff
changeset
|
827 { |
be7b8a83649c
removed ivtv driver dependancy in favor of native V4L2 MPEG API (requires Linux 2.6.18 and above)
ben
parents:
19976
diff
changeset
|
828 case 32: |
be7b8a83649c
removed ivtv driver dependancy in favor of native V4L2 MPEG API (requires Linux 2.6.18 and above)
ben
parents:
19976
diff
changeset
|
829 pvr->audio_rate = V4L2_MPEG_AUDIO_L1_BITRATE_32K; |
be7b8a83649c
removed ivtv driver dependancy in favor of native V4L2 MPEG API (requires Linux 2.6.18 and above)
ben
parents:
19976
diff
changeset
|
830 break; |
be7b8a83649c
removed ivtv driver dependancy in favor of native V4L2 MPEG API (requires Linux 2.6.18 and above)
ben
parents:
19976
diff
changeset
|
831 case 64: |
be7b8a83649c
removed ivtv driver dependancy in favor of native V4L2 MPEG API (requires Linux 2.6.18 and above)
ben
parents:
19976
diff
changeset
|
832 pvr->audio_rate = V4L2_MPEG_AUDIO_L1_BITRATE_64K; |
be7b8a83649c
removed ivtv driver dependancy in favor of native V4L2 MPEG API (requires Linux 2.6.18 and above)
ben
parents:
19976
diff
changeset
|
833 break; |
be7b8a83649c
removed ivtv driver dependancy in favor of native V4L2 MPEG API (requires Linux 2.6.18 and above)
ben
parents:
19976
diff
changeset
|
834 case 96: |
be7b8a83649c
removed ivtv driver dependancy in favor of native V4L2 MPEG API (requires Linux 2.6.18 and above)
ben
parents:
19976
diff
changeset
|
835 pvr->audio_rate = V4L2_MPEG_AUDIO_L1_BITRATE_96K; |
be7b8a83649c
removed ivtv driver dependancy in favor of native V4L2 MPEG API (requires Linux 2.6.18 and above)
ben
parents:
19976
diff
changeset
|
836 break; |
be7b8a83649c
removed ivtv driver dependancy in favor of native V4L2 MPEG API (requires Linux 2.6.18 and above)
ben
parents:
19976
diff
changeset
|
837 case 128: |
be7b8a83649c
removed ivtv driver dependancy in favor of native V4L2 MPEG API (requires Linux 2.6.18 and above)
ben
parents:
19976
diff
changeset
|
838 pvr->audio_rate = V4L2_MPEG_AUDIO_L1_BITRATE_128K; |
be7b8a83649c
removed ivtv driver dependancy in favor of native V4L2 MPEG API (requires Linux 2.6.18 and above)
ben
parents:
19976
diff
changeset
|
839 break; |
be7b8a83649c
removed ivtv driver dependancy in favor of native V4L2 MPEG API (requires Linux 2.6.18 and above)
ben
parents:
19976
diff
changeset
|
840 case 160: |
be7b8a83649c
removed ivtv driver dependancy in favor of native V4L2 MPEG API (requires Linux 2.6.18 and above)
ben
parents:
19976
diff
changeset
|
841 pvr->audio_rate = V4L2_MPEG_AUDIO_L1_BITRATE_160K; |
be7b8a83649c
removed ivtv driver dependancy in favor of native V4L2 MPEG API (requires Linux 2.6.18 and above)
ben
parents:
19976
diff
changeset
|
842 break; |
be7b8a83649c
removed ivtv driver dependancy in favor of native V4L2 MPEG API (requires Linux 2.6.18 and above)
ben
parents:
19976
diff
changeset
|
843 case 192: |
be7b8a83649c
removed ivtv driver dependancy in favor of native V4L2 MPEG API (requires Linux 2.6.18 and above)
ben
parents:
19976
diff
changeset
|
844 pvr->audio_rate = V4L2_MPEG_AUDIO_L1_BITRATE_192K; |
be7b8a83649c
removed ivtv driver dependancy in favor of native V4L2 MPEG API (requires Linux 2.6.18 and above)
ben
parents:
19976
diff
changeset
|
845 break; |
be7b8a83649c
removed ivtv driver dependancy in favor of native V4L2 MPEG API (requires Linux 2.6.18 and above)
ben
parents:
19976
diff
changeset
|
846 case 224: |
be7b8a83649c
removed ivtv driver dependancy in favor of native V4L2 MPEG API (requires Linux 2.6.18 and above)
ben
parents:
19976
diff
changeset
|
847 pvr->audio_rate = V4L2_MPEG_AUDIO_L1_BITRATE_224K; |
be7b8a83649c
removed ivtv driver dependancy in favor of native V4L2 MPEG API (requires Linux 2.6.18 and above)
ben
parents:
19976
diff
changeset
|
848 break; |
be7b8a83649c
removed ivtv driver dependancy in favor of native V4L2 MPEG API (requires Linux 2.6.18 and above)
ben
parents:
19976
diff
changeset
|
849 case 256: |
be7b8a83649c
removed ivtv driver dependancy in favor of native V4L2 MPEG API (requires Linux 2.6.18 and above)
ben
parents:
19976
diff
changeset
|
850 pvr->audio_rate = V4L2_MPEG_AUDIO_L1_BITRATE_256K; |
be7b8a83649c
removed ivtv driver dependancy in favor of native V4L2 MPEG API (requires Linux 2.6.18 and above)
ben
parents:
19976
diff
changeset
|
851 break; |
be7b8a83649c
removed ivtv driver dependancy in favor of native V4L2 MPEG API (requires Linux 2.6.18 and above)
ben
parents:
19976
diff
changeset
|
852 case 288: |
be7b8a83649c
removed ivtv driver dependancy in favor of native V4L2 MPEG API (requires Linux 2.6.18 and above)
ben
parents:
19976
diff
changeset
|
853 pvr->audio_rate = V4L2_MPEG_AUDIO_L1_BITRATE_288K; |
be7b8a83649c
removed ivtv driver dependancy in favor of native V4L2 MPEG API (requires Linux 2.6.18 and above)
ben
parents:
19976
diff
changeset
|
854 break; |
be7b8a83649c
removed ivtv driver dependancy in favor of native V4L2 MPEG API (requires Linux 2.6.18 and above)
ben
parents:
19976
diff
changeset
|
855 case 320: |
be7b8a83649c
removed ivtv driver dependancy in favor of native V4L2 MPEG API (requires Linux 2.6.18 and above)
ben
parents:
19976
diff
changeset
|
856 pvr->audio_rate = V4L2_MPEG_AUDIO_L1_BITRATE_320K; |
be7b8a83649c
removed ivtv driver dependancy in favor of native V4L2 MPEG API (requires Linux 2.6.18 and above)
ben
parents:
19976
diff
changeset
|
857 break; |
be7b8a83649c
removed ivtv driver dependancy in favor of native V4L2 MPEG API (requires Linux 2.6.18 and above)
ben
parents:
19976
diff
changeset
|
858 case 352: |
be7b8a83649c
removed ivtv driver dependancy in favor of native V4L2 MPEG API (requires Linux 2.6.18 and above)
ben
parents:
19976
diff
changeset
|
859 pvr->audio_rate = V4L2_MPEG_AUDIO_L1_BITRATE_352K; |
be7b8a83649c
removed ivtv driver dependancy in favor of native V4L2 MPEG API (requires Linux 2.6.18 and above)
ben
parents:
19976
diff
changeset
|
860 break; |
be7b8a83649c
removed ivtv driver dependancy in favor of native V4L2 MPEG API (requires Linux 2.6.18 and above)
ben
parents:
19976
diff
changeset
|
861 case 384: |
be7b8a83649c
removed ivtv driver dependancy in favor of native V4L2 MPEG API (requires Linux 2.6.18 and above)
ben
parents:
19976
diff
changeset
|
862 pvr->audio_rate = V4L2_MPEG_AUDIO_L1_BITRATE_384K; |
be7b8a83649c
removed ivtv driver dependancy in favor of native V4L2 MPEG API (requires Linux 2.6.18 and above)
ben
parents:
19976
diff
changeset
|
863 break; |
be7b8a83649c
removed ivtv driver dependancy in favor of native V4L2 MPEG API (requires Linux 2.6.18 and above)
ben
parents:
19976
diff
changeset
|
864 case 416: |
be7b8a83649c
removed ivtv driver dependancy in favor of native V4L2 MPEG API (requires Linux 2.6.18 and above)
ben
parents:
19976
diff
changeset
|
865 pvr->audio_rate = V4L2_MPEG_AUDIO_L1_BITRATE_416K; |
be7b8a83649c
removed ivtv driver dependancy in favor of native V4L2 MPEG API (requires Linux 2.6.18 and above)
ben
parents:
19976
diff
changeset
|
866 break; |
be7b8a83649c
removed ivtv driver dependancy in favor of native V4L2 MPEG API (requires Linux 2.6.18 and above)
ben
parents:
19976
diff
changeset
|
867 case 448: |
be7b8a83649c
removed ivtv driver dependancy in favor of native V4L2 MPEG API (requires Linux 2.6.18 and above)
ben
parents:
19976
diff
changeset
|
868 pvr->audio_rate = V4L2_MPEG_AUDIO_L1_BITRATE_448K; |
be7b8a83649c
removed ivtv driver dependancy in favor of native V4L2 MPEG API (requires Linux 2.6.18 and above)
ben
parents:
19976
diff
changeset
|
869 break; |
be7b8a83649c
removed ivtv driver dependancy in favor of native V4L2 MPEG API (requires Linux 2.6.18 and above)
ben
parents:
19976
diff
changeset
|
870 default: |
be7b8a83649c
removed ivtv driver dependancy in favor of native V4L2 MPEG API (requires Linux 2.6.18 and above)
ben
parents:
19976
diff
changeset
|
871 break; |
be7b8a83649c
removed ivtv driver dependancy in favor of native V4L2 MPEG API (requires Linux 2.6.18 and above)
ben
parents:
19976
diff
changeset
|
872 } |
be7b8a83649c
removed ivtv driver dependancy in favor of native V4L2 MPEG API (requires Linux 2.6.18 and above)
ben
parents:
19976
diff
changeset
|
873 } |
be7b8a83649c
removed ivtv driver dependancy in favor of native V4L2 MPEG API (requires Linux 2.6.18 and above)
ben
parents:
19976
diff
changeset
|
874 |
be7b8a83649c
removed ivtv driver dependancy in favor of native V4L2 MPEG API (requires Linux 2.6.18 and above)
ben
parents:
19976
diff
changeset
|
875 else if (pvr->layer == V4L2_MPEG_AUDIO_ENCODING_LAYER_2) |
18997 | 876 { |
19992
be7b8a83649c
removed ivtv driver dependancy in favor of native V4L2 MPEG API (requires Linux 2.6.18 and above)
ben
parents:
19976
diff
changeset
|
877 switch (pvr_param_audio_bitrate) |
be7b8a83649c
removed ivtv driver dependancy in favor of native V4L2 MPEG API (requires Linux 2.6.18 and above)
ben
parents:
19976
diff
changeset
|
878 { |
be7b8a83649c
removed ivtv driver dependancy in favor of native V4L2 MPEG API (requires Linux 2.6.18 and above)
ben
parents:
19976
diff
changeset
|
879 case 32: |
be7b8a83649c
removed ivtv driver dependancy in favor of native V4L2 MPEG API (requires Linux 2.6.18 and above)
ben
parents:
19976
diff
changeset
|
880 pvr->audio_rate = V4L2_MPEG_AUDIO_L2_BITRATE_32K; |
be7b8a83649c
removed ivtv driver dependancy in favor of native V4L2 MPEG API (requires Linux 2.6.18 and above)
ben
parents:
19976
diff
changeset
|
881 break; |
be7b8a83649c
removed ivtv driver dependancy in favor of native V4L2 MPEG API (requires Linux 2.6.18 and above)
ben
parents:
19976
diff
changeset
|
882 case 48: |
be7b8a83649c
removed ivtv driver dependancy in favor of native V4L2 MPEG API (requires Linux 2.6.18 and above)
ben
parents:
19976
diff
changeset
|
883 pvr->audio_rate = V4L2_MPEG_AUDIO_L2_BITRATE_48K; |
be7b8a83649c
removed ivtv driver dependancy in favor of native V4L2 MPEG API (requires Linux 2.6.18 and above)
ben
parents:
19976
diff
changeset
|
884 break; |
be7b8a83649c
removed ivtv driver dependancy in favor of native V4L2 MPEG API (requires Linux 2.6.18 and above)
ben
parents:
19976
diff
changeset
|
885 case 56: |
be7b8a83649c
removed ivtv driver dependancy in favor of native V4L2 MPEG API (requires Linux 2.6.18 and above)
ben
parents:
19976
diff
changeset
|
886 pvr->audio_rate = V4L2_MPEG_AUDIO_L2_BITRATE_56K; |
be7b8a83649c
removed ivtv driver dependancy in favor of native V4L2 MPEG API (requires Linux 2.6.18 and above)
ben
parents:
19976
diff
changeset
|
887 break; |
be7b8a83649c
removed ivtv driver dependancy in favor of native V4L2 MPEG API (requires Linux 2.6.18 and above)
ben
parents:
19976
diff
changeset
|
888 case 64: |
be7b8a83649c
removed ivtv driver dependancy in favor of native V4L2 MPEG API (requires Linux 2.6.18 and above)
ben
parents:
19976
diff
changeset
|
889 pvr->audio_rate = V4L2_MPEG_AUDIO_L2_BITRATE_64K; |
be7b8a83649c
removed ivtv driver dependancy in favor of native V4L2 MPEG API (requires Linux 2.6.18 and above)
ben
parents:
19976
diff
changeset
|
890 break; |
be7b8a83649c
removed ivtv driver dependancy in favor of native V4L2 MPEG API (requires Linux 2.6.18 and above)
ben
parents:
19976
diff
changeset
|
891 case 80: |
be7b8a83649c
removed ivtv driver dependancy in favor of native V4L2 MPEG API (requires Linux 2.6.18 and above)
ben
parents:
19976
diff
changeset
|
892 pvr->audio_rate = V4L2_MPEG_AUDIO_L2_BITRATE_80K; |
be7b8a83649c
removed ivtv driver dependancy in favor of native V4L2 MPEG API (requires Linux 2.6.18 and above)
ben
parents:
19976
diff
changeset
|
893 break; |
be7b8a83649c
removed ivtv driver dependancy in favor of native V4L2 MPEG API (requires Linux 2.6.18 and above)
ben
parents:
19976
diff
changeset
|
894 case 96: |
be7b8a83649c
removed ivtv driver dependancy in favor of native V4L2 MPEG API (requires Linux 2.6.18 and above)
ben
parents:
19976
diff
changeset
|
895 pvr->audio_rate = V4L2_MPEG_AUDIO_L2_BITRATE_96K; |
be7b8a83649c
removed ivtv driver dependancy in favor of native V4L2 MPEG API (requires Linux 2.6.18 and above)
ben
parents:
19976
diff
changeset
|
896 break; |
be7b8a83649c
removed ivtv driver dependancy in favor of native V4L2 MPEG API (requires Linux 2.6.18 and above)
ben
parents:
19976
diff
changeset
|
897 case 112: |
be7b8a83649c
removed ivtv driver dependancy in favor of native V4L2 MPEG API (requires Linux 2.6.18 and above)
ben
parents:
19976
diff
changeset
|
898 pvr->audio_rate = V4L2_MPEG_AUDIO_L2_BITRATE_112K; |
be7b8a83649c
removed ivtv driver dependancy in favor of native V4L2 MPEG API (requires Linux 2.6.18 and above)
ben
parents:
19976
diff
changeset
|
899 break; |
be7b8a83649c
removed ivtv driver dependancy in favor of native V4L2 MPEG API (requires Linux 2.6.18 and above)
ben
parents:
19976
diff
changeset
|
900 case 128: |
be7b8a83649c
removed ivtv driver dependancy in favor of native V4L2 MPEG API (requires Linux 2.6.18 and above)
ben
parents:
19976
diff
changeset
|
901 pvr->audio_rate = V4L2_MPEG_AUDIO_L2_BITRATE_128K; |
be7b8a83649c
removed ivtv driver dependancy in favor of native V4L2 MPEG API (requires Linux 2.6.18 and above)
ben
parents:
19976
diff
changeset
|
902 break; |
be7b8a83649c
removed ivtv driver dependancy in favor of native V4L2 MPEG API (requires Linux 2.6.18 and above)
ben
parents:
19976
diff
changeset
|
903 case 160: |
be7b8a83649c
removed ivtv driver dependancy in favor of native V4L2 MPEG API (requires Linux 2.6.18 and above)
ben
parents:
19976
diff
changeset
|
904 pvr->audio_rate = V4L2_MPEG_AUDIO_L2_BITRATE_160K; |
be7b8a83649c
removed ivtv driver dependancy in favor of native V4L2 MPEG API (requires Linux 2.6.18 and above)
ben
parents:
19976
diff
changeset
|
905 break; |
be7b8a83649c
removed ivtv driver dependancy in favor of native V4L2 MPEG API (requires Linux 2.6.18 and above)
ben
parents:
19976
diff
changeset
|
906 case 192: |
be7b8a83649c
removed ivtv driver dependancy in favor of native V4L2 MPEG API (requires Linux 2.6.18 and above)
ben
parents:
19976
diff
changeset
|
907 pvr->audio_rate = V4L2_MPEG_AUDIO_L2_BITRATE_192K; |
be7b8a83649c
removed ivtv driver dependancy in favor of native V4L2 MPEG API (requires Linux 2.6.18 and above)
ben
parents:
19976
diff
changeset
|
908 break; |
be7b8a83649c
removed ivtv driver dependancy in favor of native V4L2 MPEG API (requires Linux 2.6.18 and above)
ben
parents:
19976
diff
changeset
|
909 case 224: |
be7b8a83649c
removed ivtv driver dependancy in favor of native V4L2 MPEG API (requires Linux 2.6.18 and above)
ben
parents:
19976
diff
changeset
|
910 pvr->audio_rate = V4L2_MPEG_AUDIO_L2_BITRATE_224K; |
be7b8a83649c
removed ivtv driver dependancy in favor of native V4L2 MPEG API (requires Linux 2.6.18 and above)
ben
parents:
19976
diff
changeset
|
911 break; |
be7b8a83649c
removed ivtv driver dependancy in favor of native V4L2 MPEG API (requires Linux 2.6.18 and above)
ben
parents:
19976
diff
changeset
|
912 case 256: |
be7b8a83649c
removed ivtv driver dependancy in favor of native V4L2 MPEG API (requires Linux 2.6.18 and above)
ben
parents:
19976
diff
changeset
|
913 pvr->audio_rate = V4L2_MPEG_AUDIO_L2_BITRATE_256K; |
be7b8a83649c
removed ivtv driver dependancy in favor of native V4L2 MPEG API (requires Linux 2.6.18 and above)
ben
parents:
19976
diff
changeset
|
914 break; |
be7b8a83649c
removed ivtv driver dependancy in favor of native V4L2 MPEG API (requires Linux 2.6.18 and above)
ben
parents:
19976
diff
changeset
|
915 case 320: |
be7b8a83649c
removed ivtv driver dependancy in favor of native V4L2 MPEG API (requires Linux 2.6.18 and above)
ben
parents:
19976
diff
changeset
|
916 pvr->audio_rate = V4L2_MPEG_AUDIO_L2_BITRATE_320K; |
be7b8a83649c
removed ivtv driver dependancy in favor of native V4L2 MPEG API (requires Linux 2.6.18 and above)
ben
parents:
19976
diff
changeset
|
917 break; |
be7b8a83649c
removed ivtv driver dependancy in favor of native V4L2 MPEG API (requires Linux 2.6.18 and above)
ben
parents:
19976
diff
changeset
|
918 case 384: |
be7b8a83649c
removed ivtv driver dependancy in favor of native V4L2 MPEG API (requires Linux 2.6.18 and above)
ben
parents:
19976
diff
changeset
|
919 pvr->audio_rate = V4L2_MPEG_AUDIO_L2_BITRATE_384K; |
be7b8a83649c
removed ivtv driver dependancy in favor of native V4L2 MPEG API (requires Linux 2.6.18 and above)
ben
parents:
19976
diff
changeset
|
920 break; |
be7b8a83649c
removed ivtv driver dependancy in favor of native V4L2 MPEG API (requires Linux 2.6.18 and above)
ben
parents:
19976
diff
changeset
|
921 default: |
be7b8a83649c
removed ivtv driver dependancy in favor of native V4L2 MPEG API (requires Linux 2.6.18 and above)
ben
parents:
19976
diff
changeset
|
922 break; |
be7b8a83649c
removed ivtv driver dependancy in favor of native V4L2 MPEG API (requires Linux 2.6.18 and above)
ben
parents:
19976
diff
changeset
|
923 } |
be7b8a83649c
removed ivtv driver dependancy in favor of native V4L2 MPEG API (requires Linux 2.6.18 and above)
ben
parents:
19976
diff
changeset
|
924 } |
be7b8a83649c
removed ivtv driver dependancy in favor of native V4L2 MPEG API (requires Linux 2.6.18 and above)
ben
parents:
19976
diff
changeset
|
925 |
be7b8a83649c
removed ivtv driver dependancy in favor of native V4L2 MPEG API (requires Linux 2.6.18 and above)
ben
parents:
19976
diff
changeset
|
926 else if (pvr->layer == V4L2_MPEG_AUDIO_ENCODING_LAYER_3) |
be7b8a83649c
removed ivtv driver dependancy in favor of native V4L2 MPEG API (requires Linux 2.6.18 and above)
ben
parents:
19976
diff
changeset
|
927 { |
be7b8a83649c
removed ivtv driver dependancy in favor of native V4L2 MPEG API (requires Linux 2.6.18 and above)
ben
parents:
19976
diff
changeset
|
928 switch (pvr_param_audio_bitrate) |
be7b8a83649c
removed ivtv driver dependancy in favor of native V4L2 MPEG API (requires Linux 2.6.18 and above)
ben
parents:
19976
diff
changeset
|
929 { |
be7b8a83649c
removed ivtv driver dependancy in favor of native V4L2 MPEG API (requires Linux 2.6.18 and above)
ben
parents:
19976
diff
changeset
|
930 case 32: |
be7b8a83649c
removed ivtv driver dependancy in favor of native V4L2 MPEG API (requires Linux 2.6.18 and above)
ben
parents:
19976
diff
changeset
|
931 pvr->audio_rate = V4L2_MPEG_AUDIO_L3_BITRATE_32K; |
be7b8a83649c
removed ivtv driver dependancy in favor of native V4L2 MPEG API (requires Linux 2.6.18 and above)
ben
parents:
19976
diff
changeset
|
932 break; |
be7b8a83649c
removed ivtv driver dependancy in favor of native V4L2 MPEG API (requires Linux 2.6.18 and above)
ben
parents:
19976
diff
changeset
|
933 case 40: |
be7b8a83649c
removed ivtv driver dependancy in favor of native V4L2 MPEG API (requires Linux 2.6.18 and above)
ben
parents:
19976
diff
changeset
|
934 pvr->audio_rate = V4L2_MPEG_AUDIO_L3_BITRATE_40K; |
be7b8a83649c
removed ivtv driver dependancy in favor of native V4L2 MPEG API (requires Linux 2.6.18 and above)
ben
parents:
19976
diff
changeset
|
935 break; |
be7b8a83649c
removed ivtv driver dependancy in favor of native V4L2 MPEG API (requires Linux 2.6.18 and above)
ben
parents:
19976
diff
changeset
|
936 case 48: |
be7b8a83649c
removed ivtv driver dependancy in favor of native V4L2 MPEG API (requires Linux 2.6.18 and above)
ben
parents:
19976
diff
changeset
|
937 pvr->audio_rate = V4L2_MPEG_AUDIO_L3_BITRATE_48K; |
be7b8a83649c
removed ivtv driver dependancy in favor of native V4L2 MPEG API (requires Linux 2.6.18 and above)
ben
parents:
19976
diff
changeset
|
938 break; |
be7b8a83649c
removed ivtv driver dependancy in favor of native V4L2 MPEG API (requires Linux 2.6.18 and above)
ben
parents:
19976
diff
changeset
|
939 case 56: |
be7b8a83649c
removed ivtv driver dependancy in favor of native V4L2 MPEG API (requires Linux 2.6.18 and above)
ben
parents:
19976
diff
changeset
|
940 pvr->audio_rate = V4L2_MPEG_AUDIO_L3_BITRATE_56K; |
be7b8a83649c
removed ivtv driver dependancy in favor of native V4L2 MPEG API (requires Linux 2.6.18 and above)
ben
parents:
19976
diff
changeset
|
941 break; |
be7b8a83649c
removed ivtv driver dependancy in favor of native V4L2 MPEG API (requires Linux 2.6.18 and above)
ben
parents:
19976
diff
changeset
|
942 case 64: |
be7b8a83649c
removed ivtv driver dependancy in favor of native V4L2 MPEG API (requires Linux 2.6.18 and above)
ben
parents:
19976
diff
changeset
|
943 pvr->audio_rate = V4L2_MPEG_AUDIO_L3_BITRATE_64K; |
be7b8a83649c
removed ivtv driver dependancy in favor of native V4L2 MPEG API (requires Linux 2.6.18 and above)
ben
parents:
19976
diff
changeset
|
944 break; |
be7b8a83649c
removed ivtv driver dependancy in favor of native V4L2 MPEG API (requires Linux 2.6.18 and above)
ben
parents:
19976
diff
changeset
|
945 case 80: |
be7b8a83649c
removed ivtv driver dependancy in favor of native V4L2 MPEG API (requires Linux 2.6.18 and above)
ben
parents:
19976
diff
changeset
|
946 pvr->audio_rate = V4L2_MPEG_AUDIO_L3_BITRATE_80K; |
be7b8a83649c
removed ivtv driver dependancy in favor of native V4L2 MPEG API (requires Linux 2.6.18 and above)
ben
parents:
19976
diff
changeset
|
947 break; |
be7b8a83649c
removed ivtv driver dependancy in favor of native V4L2 MPEG API (requires Linux 2.6.18 and above)
ben
parents:
19976
diff
changeset
|
948 case 96: |
be7b8a83649c
removed ivtv driver dependancy in favor of native V4L2 MPEG API (requires Linux 2.6.18 and above)
ben
parents:
19976
diff
changeset
|
949 pvr->audio_rate = V4L2_MPEG_AUDIO_L3_BITRATE_96K; |
be7b8a83649c
removed ivtv driver dependancy in favor of native V4L2 MPEG API (requires Linux 2.6.18 and above)
ben
parents:
19976
diff
changeset
|
950 break; |
be7b8a83649c
removed ivtv driver dependancy in favor of native V4L2 MPEG API (requires Linux 2.6.18 and above)
ben
parents:
19976
diff
changeset
|
951 case 112: |
be7b8a83649c
removed ivtv driver dependancy in favor of native V4L2 MPEG API (requires Linux 2.6.18 and above)
ben
parents:
19976
diff
changeset
|
952 pvr->audio_rate = V4L2_MPEG_AUDIO_L3_BITRATE_112K; |
be7b8a83649c
removed ivtv driver dependancy in favor of native V4L2 MPEG API (requires Linux 2.6.18 and above)
ben
parents:
19976
diff
changeset
|
953 break; |
be7b8a83649c
removed ivtv driver dependancy in favor of native V4L2 MPEG API (requires Linux 2.6.18 and above)
ben
parents:
19976
diff
changeset
|
954 case 128: |
be7b8a83649c
removed ivtv driver dependancy in favor of native V4L2 MPEG API (requires Linux 2.6.18 and above)
ben
parents:
19976
diff
changeset
|
955 pvr->audio_rate = V4L2_MPEG_AUDIO_L3_BITRATE_128K; |
be7b8a83649c
removed ivtv driver dependancy in favor of native V4L2 MPEG API (requires Linux 2.6.18 and above)
ben
parents:
19976
diff
changeset
|
956 break; |
be7b8a83649c
removed ivtv driver dependancy in favor of native V4L2 MPEG API (requires Linux 2.6.18 and above)
ben
parents:
19976
diff
changeset
|
957 case 160: |
be7b8a83649c
removed ivtv driver dependancy in favor of native V4L2 MPEG API (requires Linux 2.6.18 and above)
ben
parents:
19976
diff
changeset
|
958 pvr->audio_rate = V4L2_MPEG_AUDIO_L3_BITRATE_160K; |
be7b8a83649c
removed ivtv driver dependancy in favor of native V4L2 MPEG API (requires Linux 2.6.18 and above)
ben
parents:
19976
diff
changeset
|
959 break; |
be7b8a83649c
removed ivtv driver dependancy in favor of native V4L2 MPEG API (requires Linux 2.6.18 and above)
ben
parents:
19976
diff
changeset
|
960 case 192: |
be7b8a83649c
removed ivtv driver dependancy in favor of native V4L2 MPEG API (requires Linux 2.6.18 and above)
ben
parents:
19976
diff
changeset
|
961 pvr->audio_rate = V4L2_MPEG_AUDIO_L3_BITRATE_192K; |
be7b8a83649c
removed ivtv driver dependancy in favor of native V4L2 MPEG API (requires Linux 2.6.18 and above)
ben
parents:
19976
diff
changeset
|
962 break; |
be7b8a83649c
removed ivtv driver dependancy in favor of native V4L2 MPEG API (requires Linux 2.6.18 and above)
ben
parents:
19976
diff
changeset
|
963 case 224: |
be7b8a83649c
removed ivtv driver dependancy in favor of native V4L2 MPEG API (requires Linux 2.6.18 and above)
ben
parents:
19976
diff
changeset
|
964 pvr->audio_rate = V4L2_MPEG_AUDIO_L3_BITRATE_224K; |
be7b8a83649c
removed ivtv driver dependancy in favor of native V4L2 MPEG API (requires Linux 2.6.18 and above)
ben
parents:
19976
diff
changeset
|
965 break; |
be7b8a83649c
removed ivtv driver dependancy in favor of native V4L2 MPEG API (requires Linux 2.6.18 and above)
ben
parents:
19976
diff
changeset
|
966 case 256: |
be7b8a83649c
removed ivtv driver dependancy in favor of native V4L2 MPEG API (requires Linux 2.6.18 and above)
ben
parents:
19976
diff
changeset
|
967 pvr->audio_rate = V4L2_MPEG_AUDIO_L3_BITRATE_256K; |
be7b8a83649c
removed ivtv driver dependancy in favor of native V4L2 MPEG API (requires Linux 2.6.18 and above)
ben
parents:
19976
diff
changeset
|
968 break; |
be7b8a83649c
removed ivtv driver dependancy in favor of native V4L2 MPEG API (requires Linux 2.6.18 and above)
ben
parents:
19976
diff
changeset
|
969 case 320: |
be7b8a83649c
removed ivtv driver dependancy in favor of native V4L2 MPEG API (requires Linux 2.6.18 and above)
ben
parents:
19976
diff
changeset
|
970 pvr->audio_rate = V4L2_MPEG_AUDIO_L3_BITRATE_320K; |
be7b8a83649c
removed ivtv driver dependancy in favor of native V4L2 MPEG API (requires Linux 2.6.18 and above)
ben
parents:
19976
diff
changeset
|
971 break; |
be7b8a83649c
removed ivtv driver dependancy in favor of native V4L2 MPEG API (requires Linux 2.6.18 and above)
ben
parents:
19976
diff
changeset
|
972 default: |
be7b8a83649c
removed ivtv driver dependancy in favor of native V4L2 MPEG API (requires Linux 2.6.18 and above)
ben
parents:
19976
diff
changeset
|
973 break; |
be7b8a83649c
removed ivtv driver dependancy in favor of native V4L2 MPEG API (requires Linux 2.6.18 and above)
ben
parents:
19976
diff
changeset
|
974 } |
18997 | 975 } |
976 } | |
977 | |
978 /* -pvr amode=x */ | |
979 if (pvr_param_audio_mode) | |
980 { | |
981 if (!strcmp (pvr_param_audio_mode, PVR_AUDIO_MODE_ARG_STEREO)) | |
19992
be7b8a83649c
removed ivtv driver dependancy in favor of native V4L2 MPEG API (requires Linux 2.6.18 and above)
ben
parents:
19976
diff
changeset
|
982 pvr->audio_mode = V4L2_MPEG_AUDIO_MODE_STEREO; |
18997 | 983 else if (!strcmp (pvr_param_audio_mode, PVR_AUDIO_MODE_ARG_JOINT_STEREO)) |
19992
be7b8a83649c
removed ivtv driver dependancy in favor of native V4L2 MPEG API (requires Linux 2.6.18 and above)
ben
parents:
19976
diff
changeset
|
984 pvr->audio_mode = V4L2_MPEG_AUDIO_MODE_JOINT_STEREO; |
18997 | 985 else if (!strcmp (pvr_param_audio_mode, PVR_AUDIO_MODE_ARG_DUAL)) |
19992
be7b8a83649c
removed ivtv driver dependancy in favor of native V4L2 MPEG API (requires Linux 2.6.18 and above)
ben
parents:
19976
diff
changeset
|
986 pvr->audio_mode = V4L2_MPEG_AUDIO_MODE_DUAL; |
18997 | 987 else if (!strcmp (pvr_param_audio_mode, PVR_AUDIO_MODE_ARG_MONO)) |
19992
be7b8a83649c
removed ivtv driver dependancy in favor of native V4L2 MPEG API (requires Linux 2.6.18 and above)
ben
parents:
19976
diff
changeset
|
988 pvr->audio_mode = V4L2_MPEG_AUDIO_MODE_MONO; |
18997 | 989 } |
990 | |
991 /* -pvr vbitrate=x */ | |
992 if (pvr_param_bitrate) | |
993 pvr->bitrate = pvr_param_bitrate; | |
994 | |
995 /* -pvr vmode=x */ | |
996 if (pvr_param_bitrate_mode) | |
997 { | |
998 if (!strcmp (pvr_param_bitrate_mode, PVR_VIDEO_BITRATE_MODE_ARG_VBR)) | |
19992
be7b8a83649c
removed ivtv driver dependancy in favor of native V4L2 MPEG API (requires Linux 2.6.18 and above)
ben
parents:
19976
diff
changeset
|
999 pvr->bitrate_mode = V4L2_MPEG_VIDEO_BITRATE_MODE_VBR; |
18997 | 1000 else if (!strcmp (pvr_param_bitrate_mode, PVR_VIDEO_BITRATE_MODE_ARG_CBR)) |
19992
be7b8a83649c
removed ivtv driver dependancy in favor of native V4L2 MPEG API (requires Linux 2.6.18 and above)
ben
parents:
19976
diff
changeset
|
1001 pvr->bitrate_mode = V4L2_MPEG_VIDEO_BITRATE_MODE_CBR; |
18997 | 1002 } |
1003 | |
1004 /* -pvr vpeak=x */ | |
1005 if (pvr_param_bitrate_peak) | |
1006 pvr->bitrate_peak = pvr_param_bitrate_peak; | |
1007 | |
1008 /* -pvr fmt=x */ | |
1009 if (pvr_param_stream_type) | |
1010 { | |
1011 if (!strcmp (pvr_param_stream_type, PVR_VIDEO_STREAM_TYPE_PS)) | |
19992
be7b8a83649c
removed ivtv driver dependancy in favor of native V4L2 MPEG API (requires Linux 2.6.18 and above)
ben
parents:
19976
diff
changeset
|
1012 pvr->stream_type = V4L2_MPEG_STREAM_TYPE_MPEG2_PS; |
18997 | 1013 else if (!strcmp (pvr_param_stream_type, PVR_VIDEO_STREAM_TYPE_TS)) |
19992
be7b8a83649c
removed ivtv driver dependancy in favor of native V4L2 MPEG API (requires Linux 2.6.18 and above)
ben
parents:
19976
diff
changeset
|
1014 pvr->stream_type = V4L2_MPEG_STREAM_TYPE_MPEG2_TS; |
18997 | 1015 else if (!strcmp (pvr_param_stream_type, PVR_VIDEO_STREAM_TYPE_MPEG1)) |
19992
be7b8a83649c
removed ivtv driver dependancy in favor of native V4L2 MPEG API (requires Linux 2.6.18 and above)
ben
parents:
19976
diff
changeset
|
1016 pvr->stream_type = V4L2_MPEG_STREAM_TYPE_MPEG1_SS; |
18997 | 1017 else if (!strcmp (pvr_param_stream_type, PVR_VIDEO_STREAM_TYPE_DVD)) |
19992
be7b8a83649c
removed ivtv driver dependancy in favor of native V4L2 MPEG API (requires Linux 2.6.18 and above)
ben
parents:
19976
diff
changeset
|
1018 pvr->stream_type = V4L2_MPEG_STREAM_TYPE_MPEG2_DVD; |
18997 | 1019 else if (!strcmp (pvr_param_stream_type, PVR_VIDEO_STREAM_TYPE_VCD)) |
19992
be7b8a83649c
removed ivtv driver dependancy in favor of native V4L2 MPEG API (requires Linux 2.6.18 and above)
ben
parents:
19976
diff
changeset
|
1020 pvr->stream_type = V4L2_MPEG_STREAM_TYPE_MPEG1_VCD; |
18997 | 1021 else if (!strcmp (pvr_param_stream_type, PVR_VIDEO_STREAM_TYPE_SVCD)) |
19992
be7b8a83649c
removed ivtv driver dependancy in favor of native V4L2 MPEG API (requires Linux 2.6.18 and above)
ben
parents:
19976
diff
changeset
|
1022 pvr->stream_type = V4L2_MPEG_STREAM_TYPE_MPEG2_SVCD; |
18997 | 1023 } |
1024 } | |
1025 | |
19992
be7b8a83649c
removed ivtv driver dependancy in favor of native V4L2 MPEG API (requires Linux 2.6.18 and above)
ben
parents:
19976
diff
changeset
|
1026 static void |
be7b8a83649c
removed ivtv driver dependancy in favor of native V4L2 MPEG API (requires Linux 2.6.18 and above)
ben
parents:
19976
diff
changeset
|
1027 add_v4l2_ext_control (struct v4l2_ext_control *ctrl, |
be7b8a83649c
removed ivtv driver dependancy in favor of native V4L2 MPEG API (requires Linux 2.6.18 and above)
ben
parents:
19976
diff
changeset
|
1028 uint32_t id, int32_t value) |
be7b8a83649c
removed ivtv driver dependancy in favor of native V4L2 MPEG API (requires Linux 2.6.18 and above)
ben
parents:
19976
diff
changeset
|
1029 { |
be7b8a83649c
removed ivtv driver dependancy in favor of native V4L2 MPEG API (requires Linux 2.6.18 and above)
ben
parents:
19976
diff
changeset
|
1030 ctrl->id = id; |
be7b8a83649c
removed ivtv driver dependancy in favor of native V4L2 MPEG API (requires Linux 2.6.18 and above)
ben
parents:
19976
diff
changeset
|
1031 ctrl->value = value; |
be7b8a83649c
removed ivtv driver dependancy in favor of native V4L2 MPEG API (requires Linux 2.6.18 and above)
ben
parents:
19976
diff
changeset
|
1032 } |
be7b8a83649c
removed ivtv driver dependancy in favor of native V4L2 MPEG API (requires Linux 2.6.18 and above)
ben
parents:
19976
diff
changeset
|
1033 |
18997 | 1034 static int |
19976
281ac13bf72d
cosmetic renames because pvr support will soon be less ivtv driver dependant
ben
parents:
19617
diff
changeset
|
1035 set_encoder_settings (struct pvr_t *pvr) |
18997 | 1036 { |
19992
be7b8a83649c
removed ivtv driver dependancy in favor of native V4L2 MPEG API (requires Linux 2.6.18 and above)
ben
parents:
19976
diff
changeset
|
1037 struct v4l2_ext_control *ext_ctrl = NULL; |
be7b8a83649c
removed ivtv driver dependancy in favor of native V4L2 MPEG API (requires Linux 2.6.18 and above)
ben
parents:
19976
diff
changeset
|
1038 struct v4l2_ext_controls ctrls; |
be7b8a83649c
removed ivtv driver dependancy in favor of native V4L2 MPEG API (requires Linux 2.6.18 and above)
ben
parents:
19976
diff
changeset
|
1039 uint32_t count = 0; |
be7b8a83649c
removed ivtv driver dependancy in favor of native V4L2 MPEG API (requires Linux 2.6.18 and above)
ben
parents:
19976
diff
changeset
|
1040 |
18997 | 1041 if (!pvr) |
1042 return -1; | |
1043 | |
1044 if (pvr->dev_fd < 0) | |
1045 return -1; | |
1046 | |
19992
be7b8a83649c
removed ivtv driver dependancy in favor of native V4L2 MPEG API (requires Linux 2.6.18 and above)
ben
parents:
19976
diff
changeset
|
1047 ext_ctrl = (struct v4l2_ext_control *) |
be7b8a83649c
removed ivtv driver dependancy in favor of native V4L2 MPEG API (requires Linux 2.6.18 and above)
ben
parents:
19976
diff
changeset
|
1048 malloc (PVR_MAX_CONTROLS * sizeof (struct v4l2_ext_control)); |
be7b8a83649c
removed ivtv driver dependancy in favor of native V4L2 MPEG API (requires Linux 2.6.18 and above)
ben
parents:
19976
diff
changeset
|
1049 |
be7b8a83649c
removed ivtv driver dependancy in favor of native V4L2 MPEG API (requires Linux 2.6.18 and above)
ben
parents:
19976
diff
changeset
|
1050 add_v4l2_ext_control (&ext_ctrl[count++], V4L2_CID_MPEG_VIDEO_ASPECT, |
be7b8a83649c
removed ivtv driver dependancy in favor of native V4L2 MPEG API (requires Linux 2.6.18 and above)
ben
parents:
19976
diff
changeset
|
1051 pvr->aspect); |
be7b8a83649c
removed ivtv driver dependancy in favor of native V4L2 MPEG API (requires Linux 2.6.18 and above)
ben
parents:
19976
diff
changeset
|
1052 |
be7b8a83649c
removed ivtv driver dependancy in favor of native V4L2 MPEG API (requires Linux 2.6.18 and above)
ben
parents:
19976
diff
changeset
|
1053 add_v4l2_ext_control (&ext_ctrl[count++], V4L2_CID_MPEG_AUDIO_SAMPLING_FREQ, |
be7b8a83649c
removed ivtv driver dependancy in favor of native V4L2 MPEG API (requires Linux 2.6.18 and above)
ben
parents:
19976
diff
changeset
|
1054 pvr->samplerate); |
be7b8a83649c
removed ivtv driver dependancy in favor of native V4L2 MPEG API (requires Linux 2.6.18 and above)
ben
parents:
19976
diff
changeset
|
1055 |
be7b8a83649c
removed ivtv driver dependancy in favor of native V4L2 MPEG API (requires Linux 2.6.18 and above)
ben
parents:
19976
diff
changeset
|
1056 add_v4l2_ext_control (&ext_ctrl[count++], V4L2_CID_MPEG_AUDIO_ENCODING, |
be7b8a83649c
removed ivtv driver dependancy in favor of native V4L2 MPEG API (requires Linux 2.6.18 and above)
ben
parents:
19976
diff
changeset
|
1057 pvr->layer); |
be7b8a83649c
removed ivtv driver dependancy in favor of native V4L2 MPEG API (requires Linux 2.6.18 and above)
ben
parents:
19976
diff
changeset
|
1058 |
be7b8a83649c
removed ivtv driver dependancy in favor of native V4L2 MPEG API (requires Linux 2.6.18 and above)
ben
parents:
19976
diff
changeset
|
1059 switch (pvr->layer) |
18997 | 1060 { |
19992
be7b8a83649c
removed ivtv driver dependancy in favor of native V4L2 MPEG API (requires Linux 2.6.18 and above)
ben
parents:
19976
diff
changeset
|
1061 case V4L2_MPEG_AUDIO_ENCODING_LAYER_1: |
be7b8a83649c
removed ivtv driver dependancy in favor of native V4L2 MPEG API (requires Linux 2.6.18 and above)
ben
parents:
19976
diff
changeset
|
1062 add_v4l2_ext_control (&ext_ctrl[count++], V4L2_CID_MPEG_AUDIO_L1_BITRATE, |
be7b8a83649c
removed ivtv driver dependancy in favor of native V4L2 MPEG API (requires Linux 2.6.18 and above)
ben
parents:
19976
diff
changeset
|
1063 pvr->audio_rate); |
be7b8a83649c
removed ivtv driver dependancy in favor of native V4L2 MPEG API (requires Linux 2.6.18 and above)
ben
parents:
19976
diff
changeset
|
1064 break; |
be7b8a83649c
removed ivtv driver dependancy in favor of native V4L2 MPEG API (requires Linux 2.6.18 and above)
ben
parents:
19976
diff
changeset
|
1065 case V4L2_MPEG_AUDIO_ENCODING_LAYER_2: |
be7b8a83649c
removed ivtv driver dependancy in favor of native V4L2 MPEG API (requires Linux 2.6.18 and above)
ben
parents:
19976
diff
changeset
|
1066 add_v4l2_ext_control (&ext_ctrl[count++], V4L2_CID_MPEG_AUDIO_L2_BITRATE, |
be7b8a83649c
removed ivtv driver dependancy in favor of native V4L2 MPEG API (requires Linux 2.6.18 and above)
ben
parents:
19976
diff
changeset
|
1067 pvr->audio_rate); |
be7b8a83649c
removed ivtv driver dependancy in favor of native V4L2 MPEG API (requires Linux 2.6.18 and above)
ben
parents:
19976
diff
changeset
|
1068 break; |
be7b8a83649c
removed ivtv driver dependancy in favor of native V4L2 MPEG API (requires Linux 2.6.18 and above)
ben
parents:
19976
diff
changeset
|
1069 case V4L2_MPEG_AUDIO_ENCODING_LAYER_3: |
be7b8a83649c
removed ivtv driver dependancy in favor of native V4L2 MPEG API (requires Linux 2.6.18 and above)
ben
parents:
19976
diff
changeset
|
1070 add_v4l2_ext_control (&ext_ctrl[count++], V4L2_CID_MPEG_AUDIO_L3_BITRATE, |
be7b8a83649c
removed ivtv driver dependancy in favor of native V4L2 MPEG API (requires Linux 2.6.18 and above)
ben
parents:
19976
diff
changeset
|
1071 pvr->audio_rate); |
be7b8a83649c
removed ivtv driver dependancy in favor of native V4L2 MPEG API (requires Linux 2.6.18 and above)
ben
parents:
19976
diff
changeset
|
1072 break; |
be7b8a83649c
removed ivtv driver dependancy in favor of native V4L2 MPEG API (requires Linux 2.6.18 and above)
ben
parents:
19976
diff
changeset
|
1073 default: |
be7b8a83649c
removed ivtv driver dependancy in favor of native V4L2 MPEG API (requires Linux 2.6.18 and above)
ben
parents:
19976
diff
changeset
|
1074 break; |
be7b8a83649c
removed ivtv driver dependancy in favor of native V4L2 MPEG API (requires Linux 2.6.18 and above)
ben
parents:
19976
diff
changeset
|
1075 } |
be7b8a83649c
removed ivtv driver dependancy in favor of native V4L2 MPEG API (requires Linux 2.6.18 and above)
ben
parents:
19976
diff
changeset
|
1076 |
be7b8a83649c
removed ivtv driver dependancy in favor of native V4L2 MPEG API (requires Linux 2.6.18 and above)
ben
parents:
19976
diff
changeset
|
1077 add_v4l2_ext_control (&ext_ctrl[count++], V4L2_CID_MPEG_AUDIO_MODE, |
be7b8a83649c
removed ivtv driver dependancy in favor of native V4L2 MPEG API (requires Linux 2.6.18 and above)
ben
parents:
19976
diff
changeset
|
1078 pvr->audio_mode); |
be7b8a83649c
removed ivtv driver dependancy in favor of native V4L2 MPEG API (requires Linux 2.6.18 and above)
ben
parents:
19976
diff
changeset
|
1079 |
be7b8a83649c
removed ivtv driver dependancy in favor of native V4L2 MPEG API (requires Linux 2.6.18 and above)
ben
parents:
19976
diff
changeset
|
1080 add_v4l2_ext_control (&ext_ctrl[count++], V4L2_CID_MPEG_VIDEO_BITRATE, |
be7b8a83649c
removed ivtv driver dependancy in favor of native V4L2 MPEG API (requires Linux 2.6.18 and above)
ben
parents:
19976
diff
changeset
|
1081 pvr->bitrate); |
be7b8a83649c
removed ivtv driver dependancy in favor of native V4L2 MPEG API (requires Linux 2.6.18 and above)
ben
parents:
19976
diff
changeset
|
1082 |
be7b8a83649c
removed ivtv driver dependancy in favor of native V4L2 MPEG API (requires Linux 2.6.18 and above)
ben
parents:
19976
diff
changeset
|
1083 add_v4l2_ext_control (&ext_ctrl[count++], V4L2_CID_MPEG_VIDEO_BITRATE_PEAK, |
be7b8a83649c
removed ivtv driver dependancy in favor of native V4L2 MPEG API (requires Linux 2.6.18 and above)
ben
parents:
19976
diff
changeset
|
1084 pvr->bitrate_peak); |
be7b8a83649c
removed ivtv driver dependancy in favor of native V4L2 MPEG API (requires Linux 2.6.18 and above)
ben
parents:
19976
diff
changeset
|
1085 |
be7b8a83649c
removed ivtv driver dependancy in favor of native V4L2 MPEG API (requires Linux 2.6.18 and above)
ben
parents:
19976
diff
changeset
|
1086 add_v4l2_ext_control (&ext_ctrl[count++], V4L2_CID_MPEG_VIDEO_BITRATE_MODE, |
be7b8a83649c
removed ivtv driver dependancy in favor of native V4L2 MPEG API (requires Linux 2.6.18 and above)
ben
parents:
19976
diff
changeset
|
1087 pvr->bitrate_mode); |
be7b8a83649c
removed ivtv driver dependancy in favor of native V4L2 MPEG API (requires Linux 2.6.18 and above)
ben
parents:
19976
diff
changeset
|
1088 |
be7b8a83649c
removed ivtv driver dependancy in favor of native V4L2 MPEG API (requires Linux 2.6.18 and above)
ben
parents:
19976
diff
changeset
|
1089 add_v4l2_ext_control (&ext_ctrl[count++], V4L2_CID_MPEG_STREAM_TYPE, |
be7b8a83649c
removed ivtv driver dependancy in favor of native V4L2 MPEG API (requires Linux 2.6.18 and above)
ben
parents:
19976
diff
changeset
|
1090 pvr->stream_type); |
be7b8a83649c
removed ivtv driver dependancy in favor of native V4L2 MPEG API (requires Linux 2.6.18 and above)
ben
parents:
19976
diff
changeset
|
1091 |
be7b8a83649c
removed ivtv driver dependancy in favor of native V4L2 MPEG API (requires Linux 2.6.18 and above)
ben
parents:
19976
diff
changeset
|
1092 /* set new encoding settings */ |
be7b8a83649c
removed ivtv driver dependancy in favor of native V4L2 MPEG API (requires Linux 2.6.18 and above)
ben
parents:
19976
diff
changeset
|
1093 ctrls.ctrl_class = V4L2_CTRL_CLASS_MPEG; |
be7b8a83649c
removed ivtv driver dependancy in favor of native V4L2 MPEG API (requires Linux 2.6.18 and above)
ben
parents:
19976
diff
changeset
|
1094 ctrls.count = count; |
be7b8a83649c
removed ivtv driver dependancy in favor of native V4L2 MPEG API (requires Linux 2.6.18 and above)
ben
parents:
19976
diff
changeset
|
1095 ctrls.controls = ext_ctrl; |
be7b8a83649c
removed ivtv driver dependancy in favor of native V4L2 MPEG API (requires Linux 2.6.18 and above)
ben
parents:
19976
diff
changeset
|
1096 |
be7b8a83649c
removed ivtv driver dependancy in favor of native V4L2 MPEG API (requires Linux 2.6.18 and above)
ben
parents:
19976
diff
changeset
|
1097 if (ioctl (pvr->dev_fd, VIDIOC_S_EXT_CTRLS, &ctrls) < 0) |
be7b8a83649c
removed ivtv driver dependancy in favor of native V4L2 MPEG API (requires Linux 2.6.18 and above)
ben
parents:
19976
diff
changeset
|
1098 { |
be7b8a83649c
removed ivtv driver dependancy in favor of native V4L2 MPEG API (requires Linux 2.6.18 and above)
ben
parents:
19976
diff
changeset
|
1099 mp_msg (MSGT_OPEN, MSGL_ERR, "%s Error setting MPEG controls (%s).\n", |
be7b8a83649c
removed ivtv driver dependancy in favor of native V4L2 MPEG API (requires Linux 2.6.18 and above)
ben
parents:
19976
diff
changeset
|
1100 LOG_LEVEL_ENCODER, strerror (errno)); |
be7b8a83649c
removed ivtv driver dependancy in favor of native V4L2 MPEG API (requires Linux 2.6.18 and above)
ben
parents:
19976
diff
changeset
|
1101 free (ext_ctrl); |
18997 | 1102 return -1; |
1103 } | |
1104 | |
19992
be7b8a83649c
removed ivtv driver dependancy in favor of native V4L2 MPEG API (requires Linux 2.6.18 and above)
ben
parents:
19976
diff
changeset
|
1105 free (ext_ctrl); |
18997 | 1106 |
1107 return 0; | |
1108 } | |
1109 | |
1110 static void | |
1111 parse_v4l2_tv_options (struct pvr_t *pvr) | |
1112 { | |
1113 if (!pvr) | |
1114 return; | |
23244
e5e8ac0bd7fc
support for PVR channel navigation (patch by Sven Gothel <sgothel at jausoft dot com>)
ben
parents:
23166
diff
changeset
|
1115 |
e5e8ac0bd7fc
support for PVR channel navigation (patch by Sven Gothel <sgothel at jausoft dot com>)
ben
parents:
23166
diff
changeset
|
1116 /* Create our station/channel list */ |
e5e8ac0bd7fc
support for PVR channel navigation (patch by Sven Gothel <sgothel at jausoft dot com>)
ben
parents:
23166
diff
changeset
|
1117 parse_setup_stationlist (pvr); |
e5e8ac0bd7fc
support for PVR channel navigation (patch by Sven Gothel <sgothel at jausoft dot com>)
ben
parents:
23166
diff
changeset
|
1118 |
e5e8ac0bd7fc
support for PVR channel navigation (patch by Sven Gothel <sgothel at jausoft dot com>)
ben
parents:
23166
diff
changeset
|
1119 if (pvr->param_channel) |
e5e8ac0bd7fc
support for PVR channel navigation (patch by Sven Gothel <sgothel at jausoft dot com>)
ben
parents:
23166
diff
changeset
|
1120 { |
e5e8ac0bd7fc
support for PVR channel navigation (patch by Sven Gothel <sgothel at jausoft dot com>)
ben
parents:
23166
diff
changeset
|
1121 if (set_station_by_channelname_or_freq (pvr, pvr->param_channel, |
e5e8ac0bd7fc
support for PVR channel navigation (patch by Sven Gothel <sgothel at jausoft dot com>)
ben
parents:
23166
diff
changeset
|
1122 -1, 0) >= 0) |
e5e8ac0bd7fc
support for PVR channel navigation (patch by Sven Gothel <sgothel at jausoft dot com>)
ben
parents:
23166
diff
changeset
|
1123 { |
e5e8ac0bd7fc
support for PVR channel navigation (patch by Sven Gothel <sgothel at jausoft dot com>)
ben
parents:
23166
diff
changeset
|
1124 if (tv_param_freq) |
e5e8ac0bd7fc
support for PVR channel navigation (patch by Sven Gothel <sgothel at jausoft dot com>)
ben
parents:
23166
diff
changeset
|
1125 { |
e5e8ac0bd7fc
support for PVR channel navigation (patch by Sven Gothel <sgothel at jausoft dot com>)
ben
parents:
23166
diff
changeset
|
1126 mp_msg (MSGT_OPEN, MSGL_HINT, |
e5e8ac0bd7fc
support for PVR channel navigation (patch by Sven Gothel <sgothel at jausoft dot com>)
ben
parents:
23166
diff
changeset
|
1127 "%s tv param freq %s is overwritten by channel setting freq %d\n", LOG_LEVEL_V4L2, |
e5e8ac0bd7fc
support for PVR channel navigation (patch by Sven Gothel <sgothel at jausoft dot com>)
ben
parents:
23166
diff
changeset
|
1128 tv_param_freq, pvr->freq); |
e5e8ac0bd7fc
support for PVR channel navigation (patch by Sven Gothel <sgothel at jausoft dot com>)
ben
parents:
23166
diff
changeset
|
1129 } |
e5e8ac0bd7fc
support for PVR channel navigation (patch by Sven Gothel <sgothel at jausoft dot com>)
ben
parents:
23166
diff
changeset
|
1130 } |
e5e8ac0bd7fc
support for PVR channel navigation (patch by Sven Gothel <sgothel at jausoft dot com>)
ben
parents:
23166
diff
changeset
|
1131 } |
e5e8ac0bd7fc
support for PVR channel navigation (patch by Sven Gothel <sgothel at jausoft dot com>)
ben
parents:
23166
diff
changeset
|
1132 |
e5e8ac0bd7fc
support for PVR channel navigation (patch by Sven Gothel <sgothel at jausoft dot com>)
ben
parents:
23166
diff
changeset
|
1133 if (pvr->freq < 0 && tv_param_freq) |
e5e8ac0bd7fc
support for PVR channel navigation (patch by Sven Gothel <sgothel at jausoft dot com>)
ben
parents:
23166
diff
changeset
|
1134 { |
e5e8ac0bd7fc
support for PVR channel navigation (patch by Sven Gothel <sgothel at jausoft dot com>)
ben
parents:
23166
diff
changeset
|
1135 mp_msg (MSGT_OPEN, MSGL_HINT, "%s tv param freq %s is used directly\n", |
e5e8ac0bd7fc
support for PVR channel navigation (patch by Sven Gothel <sgothel at jausoft dot com>)
ben
parents:
23166
diff
changeset
|
1136 LOG_LEVEL_V4L2, tv_param_freq); |
e5e8ac0bd7fc
support for PVR channel navigation (patch by Sven Gothel <sgothel at jausoft dot com>)
ben
parents:
23166
diff
changeset
|
1137 |
e5e8ac0bd7fc
support for PVR channel navigation (patch by Sven Gothel <sgothel at jausoft dot com>)
ben
parents:
23166
diff
changeset
|
1138 if (set_station_by_channelname_or_freq (pvr, NULL, |
e5e8ac0bd7fc
support for PVR channel navigation (patch by Sven Gothel <sgothel at jausoft dot com>)
ben
parents:
23166
diff
changeset
|
1139 atoi (tv_param_freq), 0)<0) |
e5e8ac0bd7fc
support for PVR channel navigation (patch by Sven Gothel <sgothel at jausoft dot com>)
ben
parents:
23166
diff
changeset
|
1140 { |
e5e8ac0bd7fc
support for PVR channel navigation (patch by Sven Gothel <sgothel at jausoft dot com>)
ben
parents:
23166
diff
changeset
|
1141 mp_msg (MSGT_OPEN, MSGL_WARN, |
e5e8ac0bd7fc
support for PVR channel navigation (patch by Sven Gothel <sgothel at jausoft dot com>)
ben
parents:
23166
diff
changeset
|
1142 "%s tv param freq %s invalid to set station\n", |
e5e8ac0bd7fc
support for PVR channel navigation (patch by Sven Gothel <sgothel at jausoft dot com>)
ben
parents:
23166
diff
changeset
|
1143 LOG_LEVEL_V4L2, tv_param_freq); |
e5e8ac0bd7fc
support for PVR channel navigation (patch by Sven Gothel <sgothel at jausoft dot com>)
ben
parents:
23166
diff
changeset
|
1144 } |
e5e8ac0bd7fc
support for PVR channel navigation (patch by Sven Gothel <sgothel at jausoft dot com>)
ben
parents:
23166
diff
changeset
|
1145 } |
18997 | 1146 |
1147 if (tv_param_device) | |
1148 { | |
1149 if (pvr->video_dev) | |
1150 free (pvr->video_dev); | |
1151 pvr->video_dev = strdup (tv_param_device); | |
1152 } | |
1153 | |
1154 if (tv_param_noaudio) | |
1155 pvr->mute = tv_param_noaudio; | |
1156 | |
1157 if (tv_param_input) | |
1158 pvr->input = tv_param_input; | |
1159 | |
1160 if (tv_param_normid) | |
1161 pvr->normid = tv_param_normid; | |
1162 | |
1163 if (tv_param_brightness) | |
1164 pvr->brightness = tv_param_brightness; | |
1165 | |
1166 if (tv_param_contrast) | |
1167 pvr->contrast = tv_param_contrast; | |
1168 | |
1169 if (tv_param_hue) | |
1170 pvr->hue = tv_param_hue; | |
1171 | |
1172 if (tv_param_saturation) | |
1173 pvr->saturation = tv_param_saturation; | |
1174 | |
1175 if (tv_param_width) | |
1176 pvr->width = tv_param_width; | |
1177 | |
1178 if (tv_param_height) | |
1179 pvr->height = tv_param_height; | |
1180 } | |
1181 | |
1182 static int | |
1183 set_v4l2_settings (struct pvr_t *pvr) | |
1184 { | |
1185 if (!pvr) | |
1186 return -1; | |
1187 | |
1188 if (pvr->dev_fd < 0) | |
1189 return -1; | |
1190 | |
1191 /* -tv noaudio */ | |
1192 if (pvr->mute) | |
1193 { | |
1194 struct v4l2_control ctrl; | |
1195 ctrl.id = V4L2_CID_AUDIO_MUTE; | |
1196 ctrl.value = 1; | |
1197 if (ioctl (pvr->dev_fd, VIDIOC_S_CTRL, &ctrl) < 0) | |
1198 { | |
1199 mp_msg (MSGT_OPEN, MSGL_ERR, | |
1200 "%s can't mute (%s).\n", LOG_LEVEL_V4L2, strerror (errno)); | |
1201 return -1; | |
1202 } | |
1203 } | |
1204 | |
1205 /* -tv input=x */ | |
1206 if (pvr->input != 0) | |
1207 { | |
1208 if (ioctl (pvr->dev_fd, VIDIOC_S_INPUT, &pvr->input) < 0) | |
1209 { | |
1210 mp_msg (MSGT_OPEN, MSGL_ERR, | |
1211 "%s can't set input (%s)\n", LOG_LEVEL_V4L2, strerror (errno)); | |
1212 return -1; | |
1213 } | |
1214 } | |
1215 | |
1216 /* -tv normid=x */ | |
1217 if (pvr->normid != -1) | |
1218 { | |
1219 struct v4l2_standard std; | |
1220 std.index = pvr->normid; | |
1221 | |
1222 if (ioctl (pvr->dev_fd, VIDIOC_ENUMSTD, &std) < 0) | |
1223 { | |
1224 mp_msg (MSGT_OPEN, MSGL_ERR, | |
1225 "%s can't set norm (%s)\n", LOG_LEVEL_V4L2, strerror (errno)); | |
1226 return -1; | |
1227 } | |
1228 | |
1229 mp_msg (MSGT_OPEN, MSGL_V, | |
1230 "%s set norm to %s\n", LOG_LEVEL_V4L2, std.name); | |
1231 | |
1232 if (ioctl (pvr->dev_fd, VIDIOC_S_STD, &std.id) < 0) | |
1233 { | |
1234 mp_msg (MSGT_OPEN, MSGL_ERR, | |
1235 "%s can't set norm (%s)\n", LOG_LEVEL_V4L2, strerror (errno)); | |
1236 return -1; | |
1237 } | |
1238 } | |
1239 | |
1240 /* -tv brightness=x */ | |
1241 if (pvr->brightness != 0) | |
1242 { | |
1243 struct v4l2_control ctrl; | |
1244 ctrl.id = V4L2_CID_BRIGHTNESS; | |
1245 ctrl.value = pvr->brightness; | |
1246 | |
1247 if (ctrl.value < 0) | |
1248 ctrl.value = 0; | |
1249 if (ctrl.value > 255) | |
1250 ctrl.value = 255; | |
1251 | |
1252 if (ioctl (pvr->dev_fd, VIDIOC_S_CTRL, &ctrl) < 0) | |
1253 { | |
1254 mp_msg (MSGT_OPEN, MSGL_ERR, | |
1255 "%s can't set brightness to %d (%s).\n", | |
1256 LOG_LEVEL_V4L2, ctrl.value, strerror (errno)); | |
1257 return -1; | |
1258 } | |
1259 } | |
1260 | |
1261 /* -tv contrast=x */ | |
1262 if (pvr->contrast != 0) | |
1263 { | |
1264 struct v4l2_control ctrl; | |
1265 ctrl.id = V4L2_CID_CONTRAST; | |
1266 ctrl.value = pvr->contrast; | |
1267 | |
1268 if (ctrl.value < 0) | |
1269 ctrl.value = 0; | |
1270 if (ctrl.value > 127) | |
1271 ctrl.value = 127; | |
1272 | |
1273 if (ioctl (pvr->dev_fd, VIDIOC_S_CTRL, &ctrl) < 0) | |
1274 { | |
1275 mp_msg (MSGT_OPEN, MSGL_ERR, | |
1276 "%s can't set contrast to %d (%s).\n", | |
1277 LOG_LEVEL_V4L2, ctrl.value, strerror (errno)); | |
1278 return -1; | |
1279 } | |
1280 } | |
1281 | |
1282 /* -tv hue=x */ | |
1283 if (pvr->hue != 0) | |
1284 { | |
1285 struct v4l2_control ctrl; | |
1286 ctrl.id = V4L2_CID_HUE; | |
1287 ctrl.value = pvr->hue; | |
1288 | |
1289 if (ctrl.value < -128) | |
1290 ctrl.value = -128; | |
1291 if (ctrl.value > 127) | |
1292 ctrl.value = 127; | |
1293 | |
1294 if (ioctl (pvr->dev_fd, VIDIOC_S_CTRL, &ctrl) < 0) | |
1295 { | |
1296 mp_msg (MSGT_OPEN, MSGL_ERR, | |
1297 "%s can't set hue to %d (%s).\n", | |
1298 LOG_LEVEL_V4L2, ctrl.value, strerror (errno)); | |
1299 return -1; | |
1300 } | |
1301 } | |
1302 | |
1303 /* -tv saturation=x */ | |
1304 if (pvr->saturation != 0) | |
1305 { | |
1306 struct v4l2_control ctrl; | |
1307 ctrl.id = V4L2_CID_SATURATION; | |
1308 ctrl.value = pvr->saturation; | |
1309 | |
1310 if (ctrl.value < 0) | |
1311 ctrl.value = 0; | |
1312 if (ctrl.value > 127) | |
1313 ctrl.value = 127; | |
1314 | |
1315 if (ioctl (pvr->dev_fd, VIDIOC_S_CTRL, &ctrl) < 0) | |
1316 { | |
1317 mp_msg (MSGT_OPEN, MSGL_ERR, | |
1318 "%s can't set saturation to %d (%s).\n", | |
1319 LOG_LEVEL_V4L2, ctrl.value, strerror (errno)); | |
1320 return -1; | |
1321 } | |
1322 } | |
1323 | |
1324 /* -tv width=x:height=y */ | |
1325 if (pvr->width && pvr->height) | |
1326 { | |
1327 struct v4l2_format vfmt; | |
1328 vfmt.type = V4L2_BUF_TYPE_VIDEO_CAPTURE; | |
1329 vfmt.fmt.pix.width = pvr->width; | |
1330 vfmt.fmt.pix.height = pvr->height; | |
1331 | |
1332 if (ioctl (pvr->dev_fd, VIDIOC_S_FMT, &vfmt) < 0) | |
1333 { | |
1334 mp_msg (MSGT_OPEN, MSGL_ERR, | |
1335 "%s can't set resolution to %dx%d (%s).\n", | |
1336 LOG_LEVEL_V4L2, pvr->width, pvr->height, strerror (errno)); | |
1337 return -1; | |
1338 } | |
1339 } | |
1340 | |
23244
e5e8ac0bd7fc
support for PVR channel navigation (patch by Sven Gothel <sgothel at jausoft dot com>)
ben
parents:
23166
diff
changeset
|
1341 if (pvr->freq < 0) |
18997 | 1342 { |
23244
e5e8ac0bd7fc
support for PVR channel navigation (patch by Sven Gothel <sgothel at jausoft dot com>)
ben
parents:
23166
diff
changeset
|
1343 int freq = get_v4l2_freq (pvr); |
18997 | 1344 mp_msg (MSGT_OPEN, MSGL_INFO, |
23244
e5e8ac0bd7fc
support for PVR channel navigation (patch by Sven Gothel <sgothel at jausoft dot com>)
ben
parents:
23166
diff
changeset
|
1345 "%s Using current set frequency %d, to set channel\n", |
e5e8ac0bd7fc
support for PVR channel navigation (patch by Sven Gothel <sgothel at jausoft dot com>)
ben
parents:
23166
diff
changeset
|
1346 LOG_LEVEL_V4L2, freq); |
e5e8ac0bd7fc
support for PVR channel navigation (patch by Sven Gothel <sgothel at jausoft dot com>)
ben
parents:
23166
diff
changeset
|
1347 |
e5e8ac0bd7fc
support for PVR channel navigation (patch by Sven Gothel <sgothel at jausoft dot com>)
ben
parents:
23166
diff
changeset
|
1348 if (0 < freq) |
e5e8ac0bd7fc
support for PVR channel navigation (patch by Sven Gothel <sgothel at jausoft dot com>)
ben
parents:
23166
diff
changeset
|
1349 return set_station_by_channelname_or_freq (pvr, NULL, freq, 1); |
18997 | 1350 } |
1351 | |
23244
e5e8ac0bd7fc
support for PVR channel navigation (patch by Sven Gothel <sgothel at jausoft dot com>)
ben
parents:
23166
diff
changeset
|
1352 if (0 < pvr->freq) |
e5e8ac0bd7fc
support for PVR channel navigation (patch by Sven Gothel <sgothel at jausoft dot com>)
ben
parents:
23166
diff
changeset
|
1353 return set_v4l2_freq (pvr) ; |
e5e8ac0bd7fc
support for PVR channel navigation (patch by Sven Gothel <sgothel at jausoft dot com>)
ben
parents:
23166
diff
changeset
|
1354 |
18997 | 1355 return 0; |
1356 } | |
1357 | |
1358 static int | |
1359 v4l2_list_capabilities (struct pvr_t *pvr) | |
1360 { | |
1361 struct v4l2_audio vaudio; | |
1362 struct v4l2_standard vs; | |
1363 struct v4l2_input vin; | |
1364 int err = 0; | |
1365 | |
1366 if (!pvr) | |
1367 return -1; | |
1368 | |
1369 if (pvr->dev_fd < 0) | |
1370 return -1; | |
1371 | |
1372 /* list available video inputs */ | |
1373 vin.index = 0; | |
1374 err = 1; | |
1375 mp_msg (MSGT_OPEN, MSGL_INFO, | |
1376 "%s Available video inputs: ", LOG_LEVEL_V4L2); | |
1377 while (ioctl (pvr->dev_fd, VIDIOC_ENUMINPUT, &vin) >= 0) | |
1378 { | |
1379 err = 0; | |
1380 mp_msg (MSGT_OPEN, MSGL_INFO, "'#%d, %s' ", vin.index, vin.name); | |
1381 vin.index++; | |
1382 } | |
1383 if (err) | |
1384 { | |
1385 mp_msg (MSGT_OPEN, MSGL_INFO, "none\n"); | |
1386 return -1; | |
1387 } | |
1388 else | |
1389 mp_msg (MSGT_OPEN, MSGL_INFO, "\n"); | |
1390 | |
1391 /* list available audio inputs */ | |
1392 vaudio.index = 0; | |
1393 err = 1; | |
1394 mp_msg (MSGT_OPEN, MSGL_INFO, | |
1395 "%s Available audio inputs: ", LOG_LEVEL_V4L2); | |
1396 while (ioctl (pvr->dev_fd, VIDIOC_ENUMAUDIO, &vaudio) >= 0) | |
1397 { | |
1398 err = 0; | |
1399 mp_msg (MSGT_OPEN, MSGL_INFO, "'#%d, %s' ", vaudio.index, vaudio.name); | |
1400 vaudio.index++; | |
1401 } | |
1402 if (err) | |
1403 { | |
1404 mp_msg (MSGT_OPEN, MSGL_INFO, "none\n"); | |
1405 return -1; | |
1406 } | |
1407 else | |
1408 mp_msg (MSGT_OPEN, MSGL_INFO, "\n"); | |
1409 | |
1410 /* list available norms */ | |
1411 vs.index = 0; | |
1412 mp_msg (MSGT_OPEN, MSGL_INFO, "%s Available norms: ", LOG_LEVEL_V4L2); | |
1413 while (ioctl (pvr->dev_fd, VIDIOC_ENUMSTD, &vs) >= 0) | |
1414 { | |
1415 err = 0; | |
1416 mp_msg (MSGT_OPEN, MSGL_INFO, "'#%d, %s' ", vs.index, vs.name); | |
1417 vs.index++; | |
1418 } | |
1419 if (err) | |
1420 { | |
1421 mp_msg (MSGT_OPEN, MSGL_INFO, "none\n"); | |
1422 return -1; | |
1423 } | |
1424 else | |
1425 mp_msg (MSGT_OPEN, MSGL_INFO, "\n"); | |
1426 | |
1427 return 0; | |
1428 } | |
1429 | |
1430 static int | |
1431 v4l2_display_settings (struct pvr_t *pvr) | |
1432 { | |
1433 struct v4l2_audio vaudio; | |
1434 struct v4l2_standard vs; | |
1435 struct v4l2_input vin; | |
1436 v4l2_std_id std; | |
1437 int input; | |
1438 | |
1439 if (!pvr) | |
1440 return -1; | |
1441 | |
1442 if (pvr->dev_fd < 0) | |
1443 return -1; | |
1444 | |
1445 /* get current video input */ | |
1446 if (ioctl (pvr->dev_fd, VIDIOC_G_INPUT, &input) == 0) | |
1447 { | |
1448 vin.index = input; | |
1449 if (ioctl (pvr->dev_fd, VIDIOC_ENUMINPUT, &vin) < 0) | |
1450 { | |
1451 mp_msg (MSGT_OPEN, MSGL_ERR, | |
1452 "%s can't get input (%s).\n", LOG_LEVEL_V4L2, strerror (errno)); | |
1453 return -1; | |
1454 } | |
1455 else | |
1456 mp_msg (MSGT_OPEN, MSGL_INFO, | |
1457 "%s Video input: %s\n", LOG_LEVEL_V4L2, vin.name); | |
1458 } | |
1459 else | |
1460 { | |
1461 mp_msg (MSGT_OPEN, MSGL_ERR, | |
1462 "%s can't get input (%s).\n", LOG_LEVEL_V4L2, strerror (errno)); | |
1463 return -1; | |
1464 } | |
1465 | |
1466 /* get current audio input */ | |
1467 if (ioctl (pvr->dev_fd, VIDIOC_G_AUDIO, &vaudio) == 0) | |
1468 { | |
19294 | 1469 mp_msg (MSGT_OPEN, MSGL_INFO, |
1470 "%s Audio input: %s\n", LOG_LEVEL_V4L2, vaudio.name); | |
18997 | 1471 } |
1472 else | |
1473 { | |
1474 mp_msg (MSGT_OPEN, MSGL_ERR, | |
1475 "%s can't get input (%s).\n", LOG_LEVEL_V4L2, strerror (errno)); | |
1476 return -1; | |
1477 } | |
1478 | |
1479 /* get current video format */ | |
1480 if (ioctl (pvr->dev_fd, VIDIOC_G_STD, &std) == 0) | |
1481 { | |
1482 vs.index = 0; | |
1483 | |
1484 while (ioctl (pvr->dev_fd, VIDIOC_ENUMSTD, &vs) >= 0) | |
1485 { | |
1486 if (vs.id == std) | |
1487 { | |
1488 mp_msg (MSGT_OPEN, MSGL_INFO, | |
1489 "%s Norm: %s.\n", LOG_LEVEL_V4L2, vs.name); | |
1490 break; | |
1491 } | |
1492 vs.index++; | |
1493 } | |
1494 } | |
1495 else | |
1496 { | |
1497 mp_msg (MSGT_OPEN, MSGL_ERR, | |
1498 "%s can't get norm (%s)\n", LOG_LEVEL_V4L2, strerror (errno)); | |
1499 return -1; | |
1500 } | |
1501 | |
1502 return 0; | |
1503 } | |
1504 | |
1505 /* stream layer */ | |
1506 | |
1507 static void | |
1508 pvr_stream_close (stream_t *stream) | |
1509 { | |
1510 struct pvr_t *pvr; | |
1511 | |
1512 if (!stream) | |
1513 return; | |
1514 | |
1515 pvr = (struct pvr_t *) stream->priv; | |
1516 pvr_uninit (pvr); | |
1517 } | |
1518 | |
1519 static int | |
1520 pvr_stream_read (stream_t *stream, char *buffer, int size) | |
1521 { | |
1522 struct pollfd pfds[1]; | |
1523 struct pvr_t *pvr; | |
1524 int rk, fd, pos; | |
1525 | |
1526 if (!stream || !buffer) | |
1527 return 0; | |
1528 | |
1529 pvr = (struct pvr_t *) stream->priv; | |
1530 fd = pvr->dev_fd; | |
1531 pos = 0; | |
1532 | |
1533 if (fd < 0) | |
1534 return 0; | |
1535 | |
1536 while (pos < size) | |
1537 { | |
1538 pfds[0].fd = fd; | |
1539 pfds[0].events = POLLIN | POLLPRI; | |
1540 | |
1541 rk = size - pos; | |
1542 | |
1543 if (poll (pfds, 1, 500) <= 0) | |
1544 { | |
1545 mp_msg (MSGT_OPEN, MSGL_ERR, | |
1546 "%s failed with errno %d when reading %d bytes\n", | |
1547 LOG_LEVEL_PVR, errno, size-pos); | |
1548 break; | |
1549 } | |
1550 | |
1551 rk = read (fd, &buffer[pos], rk); | |
1552 if (rk > 0) | |
1553 { | |
1554 pos += rk; | |
1555 mp_msg (MSGT_OPEN, MSGL_DBG3, | |
1556 "%s read (%d) bytes\n", LOG_LEVEL_PVR, pos); | |
1557 } | |
1558 } | |
1559 | |
1560 if (!pos) | |
1561 mp_msg (MSGT_OPEN, MSGL_ERR, "%s read %d bytes\n", LOG_LEVEL_PVR, pos); | |
1562 | |
1563 return pos; | |
1564 } | |
1565 | |
1566 static int | |
1567 pvr_stream_open (stream_t *stream, int mode, void *opts, int *file_format) | |
1568 { | |
1569 struct v4l2_capability vcap; | |
19992
be7b8a83649c
removed ivtv driver dependancy in favor of native V4L2 MPEG API (requires Linux 2.6.18 and above)
ben
parents:
19976
diff
changeset
|
1570 struct v4l2_ext_controls ctrls; |
18997 | 1571 struct pvr_t *pvr = NULL; |
1572 | |
1573 if (mode != STREAM_READ) | |
1574 return STREAM_UNSUPORTED; | |
1575 | |
1576 pvr = pvr_init (); | |
1577 | |
23244
e5e8ac0bd7fc
support for PVR channel navigation (patch by Sven Gothel <sgothel at jausoft dot com>)
ben
parents:
23166
diff
changeset
|
1578 /** |
e5e8ac0bd7fc
support for PVR channel navigation (patch by Sven Gothel <sgothel at jausoft dot com>)
ben
parents:
23166
diff
changeset
|
1579 * if the url, i.e. 'pvr://8', contains the channel, use it, |
e5e8ac0bd7fc
support for PVR channel navigation (patch by Sven Gothel <sgothel at jausoft dot com>)
ben
parents:
23166
diff
changeset
|
1580 * else use the tv parameter. |
e5e8ac0bd7fc
support for PVR channel navigation (patch by Sven Gothel <sgothel at jausoft dot com>)
ben
parents:
23166
diff
changeset
|
1581 */ |
e5e8ac0bd7fc
support for PVR channel navigation (patch by Sven Gothel <sgothel at jausoft dot com>)
ben
parents:
23166
diff
changeset
|
1582 if (stream->url && strlen (stream->url) > 6 && stream->url[6] != '\0') |
e5e8ac0bd7fc
support for PVR channel navigation (patch by Sven Gothel <sgothel at jausoft dot com>)
ben
parents:
23166
diff
changeset
|
1583 pvr->param_channel = strdup (stream->url + 6); |
e5e8ac0bd7fc
support for PVR channel navigation (patch by Sven Gothel <sgothel at jausoft dot com>)
ben
parents:
23166
diff
changeset
|
1584 else if (tv_param_channel && strlen (tv_param_channel)) |
e5e8ac0bd7fc
support for PVR channel navigation (patch by Sven Gothel <sgothel at jausoft dot com>)
ben
parents:
23166
diff
changeset
|
1585 pvr->param_channel = strdup (tv_param_channel); |
e5e8ac0bd7fc
support for PVR channel navigation (patch by Sven Gothel <sgothel at jausoft dot com>)
ben
parents:
23166
diff
changeset
|
1586 |
18997 | 1587 parse_v4l2_tv_options (pvr); |
19976
281ac13bf72d
cosmetic renames because pvr support will soon be less ivtv driver dependant
ben
parents:
19617
diff
changeset
|
1588 parse_encoder_options (pvr); |
18997 | 1589 |
1590 /* open device */ | |
1591 pvr->dev_fd = open (pvr->video_dev, O_RDWR); | |
1592 mp_msg (MSGT_OPEN, MSGL_INFO, | |
1593 "%s Using device %s\n", LOG_LEVEL_PVR, pvr->video_dev); | |
1594 if (pvr->dev_fd == -1) | |
1595 { | |
1596 mp_msg (MSGT_OPEN, MSGL_ERR, | |
1597 "%s error opening device %s\n", LOG_LEVEL_PVR, pvr->video_dev); | |
1598 pvr_uninit (pvr); | |
1599 return STREAM_ERROR; | |
1600 } | |
1601 | |
1602 /* query capabilities (i.e test V4L2 support) */ | |
1603 if (ioctl (pvr->dev_fd, VIDIOC_QUERYCAP, &vcap) < 0) | |
1604 { | |
1605 mp_msg (MSGT_OPEN, MSGL_ERR, | |
1606 "%s device is not V4L2 compliant (%s).\n", | |
1607 LOG_LEVEL_PVR, strerror (errno)); | |
1608 pvr_uninit (pvr); | |
1609 return STREAM_ERROR; | |
1610 } | |
1611 else | |
1612 mp_msg (MSGT_OPEN, MSGL_INFO, | |
1613 "%s Detected %s\n", LOG_LEVEL_PVR, vcap.card); | |
1614 | |
19992
be7b8a83649c
removed ivtv driver dependancy in favor of native V4L2 MPEG API (requires Linux 2.6.18 and above)
ben
parents:
19976
diff
changeset
|
1615 /* check for a valid V4L2 capture device */ |
be7b8a83649c
removed ivtv driver dependancy in favor of native V4L2 MPEG API (requires Linux 2.6.18 and above)
ben
parents:
19976
diff
changeset
|
1616 if (!(vcap.capabilities & V4L2_CAP_VIDEO_CAPTURE)) |
18997 | 1617 { |
1618 mp_msg (MSGT_OPEN, MSGL_ERR, | |
19992
be7b8a83649c
removed ivtv driver dependancy in favor of native V4L2 MPEG API (requires Linux 2.6.18 and above)
ben
parents:
19976
diff
changeset
|
1619 "%s device is not a valid V4L2 capture device.\n", |
be7b8a83649c
removed ivtv driver dependancy in favor of native V4L2 MPEG API (requires Linux 2.6.18 and above)
ben
parents:
19976
diff
changeset
|
1620 LOG_LEVEL_PVR); |
18997 | 1621 pvr_uninit (pvr); |
1622 return STREAM_ERROR; | |
1623 } | |
19992
be7b8a83649c
removed ivtv driver dependancy in favor of native V4L2 MPEG API (requires Linux 2.6.18 and above)
ben
parents:
19976
diff
changeset
|
1624 |
be7b8a83649c
removed ivtv driver dependancy in favor of native V4L2 MPEG API (requires Linux 2.6.18 and above)
ben
parents:
19976
diff
changeset
|
1625 /* check for device hardware MPEG encoding capability */ |
be7b8a83649c
removed ivtv driver dependancy in favor of native V4L2 MPEG API (requires Linux 2.6.18 and above)
ben
parents:
19976
diff
changeset
|
1626 ctrls.ctrl_class = V4L2_CTRL_CLASS_MPEG; |
be7b8a83649c
removed ivtv driver dependancy in favor of native V4L2 MPEG API (requires Linux 2.6.18 and above)
ben
parents:
19976
diff
changeset
|
1627 ctrls.count = 0; |
be7b8a83649c
removed ivtv driver dependancy in favor of native V4L2 MPEG API (requires Linux 2.6.18 and above)
ben
parents:
19976
diff
changeset
|
1628 ctrls.controls = NULL; |
18997 | 1629 |
19992
be7b8a83649c
removed ivtv driver dependancy in favor of native V4L2 MPEG API (requires Linux 2.6.18 and above)
ben
parents:
19976
diff
changeset
|
1630 if (ioctl (pvr->dev_fd, VIDIOC_G_EXT_CTRLS, &ctrls) < 0) |
18997 | 1631 { |
1632 mp_msg (MSGT_OPEN, MSGL_ERR, | |
19992
be7b8a83649c
removed ivtv driver dependancy in favor of native V4L2 MPEG API (requires Linux 2.6.18 and above)
ben
parents:
19976
diff
changeset
|
1633 "%s device do not support MPEG input.\n", LOG_LEVEL_ENCODER); |
18997 | 1634 return STREAM_ERROR; |
1635 } | |
1636 | |
1637 /* list V4L2 capabilities */ | |
1638 if (v4l2_list_capabilities (pvr) == -1) | |
1639 { | |
1640 mp_msg (MSGT_OPEN, MSGL_ERR, | |
1641 "%s can't get v4l2 capabilities\n", LOG_LEVEL_PVR); | |
1642 pvr_uninit (pvr); | |
1643 return STREAM_ERROR; | |
1644 } | |
1645 | |
1646 /* apply V4L2 settings */ | |
1647 if (set_v4l2_settings (pvr) == -1) | |
1648 { | |
1649 mp_msg (MSGT_OPEN, MSGL_ERR, | |
1650 "%s can't set v4l2 settings\n", LOG_LEVEL_PVR); | |
1651 pvr_uninit (pvr); | |
1652 return STREAM_ERROR; | |
1653 } | |
1654 | |
19976
281ac13bf72d
cosmetic renames because pvr support will soon be less ivtv driver dependant
ben
parents:
19617
diff
changeset
|
1655 /* apply encoder settings */ |
281ac13bf72d
cosmetic renames because pvr support will soon be less ivtv driver dependant
ben
parents:
19617
diff
changeset
|
1656 if (set_encoder_settings (pvr) == -1) |
18997 | 1657 { |
1658 mp_msg (MSGT_OPEN, MSGL_ERR, | |
19976
281ac13bf72d
cosmetic renames because pvr support will soon be less ivtv driver dependant
ben
parents:
19617
diff
changeset
|
1659 "%s can't set encoder settings\n", LOG_LEVEL_PVR); |
18997 | 1660 pvr_uninit (pvr); |
1661 return STREAM_ERROR; | |
1662 } | |
1663 | |
1664 /* display current V4L2 settings */ | |
1665 if (v4l2_display_settings (pvr) == -1) | |
1666 { | |
1667 mp_msg (MSGT_OPEN, MSGL_ERR, | |
1668 "%s can't get v4l2 settings\n", LOG_LEVEL_PVR); | |
1669 pvr_uninit (pvr); | |
1670 return STREAM_ERROR; | |
1671 } | |
1672 | |
1673 stream->priv = pvr; | |
1674 stream->type = STREAMTYPE_PVR; | |
1675 stream->fill_buffer = pvr_stream_read; | |
1676 stream->close = pvr_stream_close; | |
1677 | |
1678 return STREAM_OK; | |
1679 } | |
1680 | |
23244
e5e8ac0bd7fc
support for PVR channel navigation (patch by Sven Gothel <sgothel at jausoft dot com>)
ben
parents:
23166
diff
changeset
|
1681 /* PVR Public API access */ |
e5e8ac0bd7fc
support for PVR channel navigation (patch by Sven Gothel <sgothel at jausoft dot com>)
ben
parents:
23166
diff
changeset
|
1682 |
e5e8ac0bd7fc
support for PVR channel navigation (patch by Sven Gothel <sgothel at jausoft dot com>)
ben
parents:
23166
diff
changeset
|
1683 const char * |
e5e8ac0bd7fc
support for PVR channel navigation (patch by Sven Gothel <sgothel at jausoft dot com>)
ben
parents:
23166
diff
changeset
|
1684 pvr_get_current_stationname (stream_t *stream) |
e5e8ac0bd7fc
support for PVR channel navigation (patch by Sven Gothel <sgothel at jausoft dot com>)
ben
parents:
23166
diff
changeset
|
1685 { |
e5e8ac0bd7fc
support for PVR channel navigation (patch by Sven Gothel <sgothel at jausoft dot com>)
ben
parents:
23166
diff
changeset
|
1686 struct pvr_t *pvr; |
e5e8ac0bd7fc
support for PVR channel navigation (patch by Sven Gothel <sgothel at jausoft dot com>)
ben
parents:
23166
diff
changeset
|
1687 |
e5e8ac0bd7fc
support for PVR channel navigation (patch by Sven Gothel <sgothel at jausoft dot com>)
ben
parents:
23166
diff
changeset
|
1688 if (!stream || stream->type != STREAMTYPE_PVR) |
e5e8ac0bd7fc
support for PVR channel navigation (patch by Sven Gothel <sgothel at jausoft dot com>)
ben
parents:
23166
diff
changeset
|
1689 return NULL; |
e5e8ac0bd7fc
support for PVR channel navigation (patch by Sven Gothel <sgothel at jausoft dot com>)
ben
parents:
23166
diff
changeset
|
1690 |
e5e8ac0bd7fc
support for PVR channel navigation (patch by Sven Gothel <sgothel at jausoft dot com>)
ben
parents:
23166
diff
changeset
|
1691 pvr = (struct pvr_t *) stream->priv; |
e5e8ac0bd7fc
support for PVR channel navigation (patch by Sven Gothel <sgothel at jausoft dot com>)
ben
parents:
23166
diff
changeset
|
1692 |
e5e8ac0bd7fc
support for PVR channel navigation (patch by Sven Gothel <sgothel at jausoft dot com>)
ben
parents:
23166
diff
changeset
|
1693 if (pvr->stationlist.list && |
e5e8ac0bd7fc
support for PVR channel navigation (patch by Sven Gothel <sgothel at jausoft dot com>)
ben
parents:
23166
diff
changeset
|
1694 pvr->stationlist.used > pvr->chan_idx && |
e5e8ac0bd7fc
support for PVR channel navigation (patch by Sven Gothel <sgothel at jausoft dot com>)
ben
parents:
23166
diff
changeset
|
1695 pvr->chan_idx >= 0) |
e5e8ac0bd7fc
support for PVR channel navigation (patch by Sven Gothel <sgothel at jausoft dot com>)
ben
parents:
23166
diff
changeset
|
1696 return pvr->stationlist.list[pvr->chan_idx].station; |
e5e8ac0bd7fc
support for PVR channel navigation (patch by Sven Gothel <sgothel at jausoft dot com>)
ben
parents:
23166
diff
changeset
|
1697 |
e5e8ac0bd7fc
support for PVR channel navigation (patch by Sven Gothel <sgothel at jausoft dot com>)
ben
parents:
23166
diff
changeset
|
1698 return NULL; |
e5e8ac0bd7fc
support for PVR channel navigation (patch by Sven Gothel <sgothel at jausoft dot com>)
ben
parents:
23166
diff
changeset
|
1699 } |
e5e8ac0bd7fc
support for PVR channel navigation (patch by Sven Gothel <sgothel at jausoft dot com>)
ben
parents:
23166
diff
changeset
|
1700 |
e5e8ac0bd7fc
support for PVR channel navigation (patch by Sven Gothel <sgothel at jausoft dot com>)
ben
parents:
23166
diff
changeset
|
1701 const char * |
e5e8ac0bd7fc
support for PVR channel navigation (patch by Sven Gothel <sgothel at jausoft dot com>)
ben
parents:
23166
diff
changeset
|
1702 pvr_get_current_channelname (stream_t *stream) |
e5e8ac0bd7fc
support for PVR channel navigation (patch by Sven Gothel <sgothel at jausoft dot com>)
ben
parents:
23166
diff
changeset
|
1703 { |
e5e8ac0bd7fc
support for PVR channel navigation (patch by Sven Gothel <sgothel at jausoft dot com>)
ben
parents:
23166
diff
changeset
|
1704 struct pvr_t *pvr = (struct pvr_t *) stream->priv; |
e5e8ac0bd7fc
support for PVR channel navigation (patch by Sven Gothel <sgothel at jausoft dot com>)
ben
parents:
23166
diff
changeset
|
1705 |
e5e8ac0bd7fc
support for PVR channel navigation (patch by Sven Gothel <sgothel at jausoft dot com>)
ben
parents:
23166
diff
changeset
|
1706 if (pvr->stationlist.list && |
e5e8ac0bd7fc
support for PVR channel navigation (patch by Sven Gothel <sgothel at jausoft dot com>)
ben
parents:
23166
diff
changeset
|
1707 pvr->stationlist.used > pvr->chan_idx && |
e5e8ac0bd7fc
support for PVR channel navigation (patch by Sven Gothel <sgothel at jausoft dot com>)
ben
parents:
23166
diff
changeset
|
1708 pvr->chan_idx >= 0) |
e5e8ac0bd7fc
support for PVR channel navigation (patch by Sven Gothel <sgothel at jausoft dot com>)
ben
parents:
23166
diff
changeset
|
1709 return pvr->stationlist.list[pvr->chan_idx].name; |
e5e8ac0bd7fc
support for PVR channel navigation (patch by Sven Gothel <sgothel at jausoft dot com>)
ben
parents:
23166
diff
changeset
|
1710 |
e5e8ac0bd7fc
support for PVR channel navigation (patch by Sven Gothel <sgothel at jausoft dot com>)
ben
parents:
23166
diff
changeset
|
1711 return NULL; |
e5e8ac0bd7fc
support for PVR channel navigation (patch by Sven Gothel <sgothel at jausoft dot com>)
ben
parents:
23166
diff
changeset
|
1712 } |
e5e8ac0bd7fc
support for PVR channel navigation (patch by Sven Gothel <sgothel at jausoft dot com>)
ben
parents:
23166
diff
changeset
|
1713 |
e5e8ac0bd7fc
support for PVR channel navigation (patch by Sven Gothel <sgothel at jausoft dot com>)
ben
parents:
23166
diff
changeset
|
1714 int |
e5e8ac0bd7fc
support for PVR channel navigation (patch by Sven Gothel <sgothel at jausoft dot com>)
ben
parents:
23166
diff
changeset
|
1715 pvr_get_current_frequency (stream_t *stream) |
e5e8ac0bd7fc
support for PVR channel navigation (patch by Sven Gothel <sgothel at jausoft dot com>)
ben
parents:
23166
diff
changeset
|
1716 { |
e5e8ac0bd7fc
support for PVR channel navigation (patch by Sven Gothel <sgothel at jausoft dot com>)
ben
parents:
23166
diff
changeset
|
1717 struct pvr_t *pvr = (struct pvr_t *) stream->priv; |
e5e8ac0bd7fc
support for PVR channel navigation (patch by Sven Gothel <sgothel at jausoft dot com>)
ben
parents:
23166
diff
changeset
|
1718 |
e5e8ac0bd7fc
support for PVR channel navigation (patch by Sven Gothel <sgothel at jausoft dot com>)
ben
parents:
23166
diff
changeset
|
1719 return pvr->freq; |
e5e8ac0bd7fc
support for PVR channel navigation (patch by Sven Gothel <sgothel at jausoft dot com>)
ben
parents:
23166
diff
changeset
|
1720 } |
e5e8ac0bd7fc
support for PVR channel navigation (patch by Sven Gothel <sgothel at jausoft dot com>)
ben
parents:
23166
diff
changeset
|
1721 |
e5e8ac0bd7fc
support for PVR channel navigation (patch by Sven Gothel <sgothel at jausoft dot com>)
ben
parents:
23166
diff
changeset
|
1722 int |
e5e8ac0bd7fc
support for PVR channel navigation (patch by Sven Gothel <sgothel at jausoft dot com>)
ben
parents:
23166
diff
changeset
|
1723 pvr_set_channel (stream_t *stream, const char * channel) |
e5e8ac0bd7fc
support for PVR channel navigation (patch by Sven Gothel <sgothel at jausoft dot com>)
ben
parents:
23166
diff
changeset
|
1724 { |
e5e8ac0bd7fc
support for PVR channel navigation (patch by Sven Gothel <sgothel at jausoft dot com>)
ben
parents:
23166
diff
changeset
|
1725 struct pvr_t *pvr = (struct pvr_t *) stream->priv; |
e5e8ac0bd7fc
support for PVR channel navigation (patch by Sven Gothel <sgothel at jausoft dot com>)
ben
parents:
23166
diff
changeset
|
1726 |
e5e8ac0bd7fc
support for PVR channel navigation (patch by Sven Gothel <sgothel at jausoft dot com>)
ben
parents:
23166
diff
changeset
|
1727 return set_station_by_channelname_or_freq (pvr, channel, -1, 1); |
e5e8ac0bd7fc
support for PVR channel navigation (patch by Sven Gothel <sgothel at jausoft dot com>)
ben
parents:
23166
diff
changeset
|
1728 } |
e5e8ac0bd7fc
support for PVR channel navigation (patch by Sven Gothel <sgothel at jausoft dot com>)
ben
parents:
23166
diff
changeset
|
1729 |
e5e8ac0bd7fc
support for PVR channel navigation (patch by Sven Gothel <sgothel at jausoft dot com>)
ben
parents:
23166
diff
changeset
|
1730 int |
e5e8ac0bd7fc
support for PVR channel navigation (patch by Sven Gothel <sgothel at jausoft dot com>)
ben
parents:
23166
diff
changeset
|
1731 pvr_set_lastchannel (stream_t *stream) |
e5e8ac0bd7fc
support for PVR channel navigation (patch by Sven Gothel <sgothel at jausoft dot com>)
ben
parents:
23166
diff
changeset
|
1732 { |
e5e8ac0bd7fc
support for PVR channel navigation (patch by Sven Gothel <sgothel at jausoft dot com>)
ben
parents:
23166
diff
changeset
|
1733 struct pvr_t *pvr = (struct pvr_t *) stream->priv; |
e5e8ac0bd7fc
support for PVR channel navigation (patch by Sven Gothel <sgothel at jausoft dot com>)
ben
parents:
23166
diff
changeset
|
1734 |
e5e8ac0bd7fc
support for PVR channel navigation (patch by Sven Gothel <sgothel at jausoft dot com>)
ben
parents:
23166
diff
changeset
|
1735 if (pvr->stationlist.list && |
e5e8ac0bd7fc
support for PVR channel navigation (patch by Sven Gothel <sgothel at jausoft dot com>)
ben
parents:
23166
diff
changeset
|
1736 pvr->stationlist.used > pvr->chan_idx_last && |
e5e8ac0bd7fc
support for PVR channel navigation (patch by Sven Gothel <sgothel at jausoft dot com>)
ben
parents:
23166
diff
changeset
|
1737 pvr->chan_idx_last >= 0) |
e5e8ac0bd7fc
support for PVR channel navigation (patch by Sven Gothel <sgothel at jausoft dot com>)
ben
parents:
23166
diff
changeset
|
1738 return set_station_by_channelname_or_freq (pvr, pvr->stationlist.list[pvr->chan_idx_last].name, -1, 1); |
e5e8ac0bd7fc
support for PVR channel navigation (patch by Sven Gothel <sgothel at jausoft dot com>)
ben
parents:
23166
diff
changeset
|
1739 |
e5e8ac0bd7fc
support for PVR channel navigation (patch by Sven Gothel <sgothel at jausoft dot com>)
ben
parents:
23166
diff
changeset
|
1740 return -1; |
e5e8ac0bd7fc
support for PVR channel navigation (patch by Sven Gothel <sgothel at jausoft dot com>)
ben
parents:
23166
diff
changeset
|
1741 } |
e5e8ac0bd7fc
support for PVR channel navigation (patch by Sven Gothel <sgothel at jausoft dot com>)
ben
parents:
23166
diff
changeset
|
1742 |
e5e8ac0bd7fc
support for PVR channel navigation (patch by Sven Gothel <sgothel at jausoft dot com>)
ben
parents:
23166
diff
changeset
|
1743 int |
e5e8ac0bd7fc
support for PVR channel navigation (patch by Sven Gothel <sgothel at jausoft dot com>)
ben
parents:
23166
diff
changeset
|
1744 pvr_set_freq (stream_t *stream, int freq) |
e5e8ac0bd7fc
support for PVR channel navigation (patch by Sven Gothel <sgothel at jausoft dot com>)
ben
parents:
23166
diff
changeset
|
1745 { |
e5e8ac0bd7fc
support for PVR channel navigation (patch by Sven Gothel <sgothel at jausoft dot com>)
ben
parents:
23166
diff
changeset
|
1746 struct pvr_t *pvr = (struct pvr_t *) stream->priv; |
e5e8ac0bd7fc
support for PVR channel navigation (patch by Sven Gothel <sgothel at jausoft dot com>)
ben
parents:
23166
diff
changeset
|
1747 |
e5e8ac0bd7fc
support for PVR channel navigation (patch by Sven Gothel <sgothel at jausoft dot com>)
ben
parents:
23166
diff
changeset
|
1748 return set_station_by_channelname_or_freq (pvr, NULL, freq, 1); |
e5e8ac0bd7fc
support for PVR channel navigation (patch by Sven Gothel <sgothel at jausoft dot com>)
ben
parents:
23166
diff
changeset
|
1749 } |
e5e8ac0bd7fc
support for PVR channel navigation (patch by Sven Gothel <sgothel at jausoft dot com>)
ben
parents:
23166
diff
changeset
|
1750 |
e5e8ac0bd7fc
support for PVR channel navigation (patch by Sven Gothel <sgothel at jausoft dot com>)
ben
parents:
23166
diff
changeset
|
1751 int |
e5e8ac0bd7fc
support for PVR channel navigation (patch by Sven Gothel <sgothel at jausoft dot com>)
ben
parents:
23166
diff
changeset
|
1752 pvr_set_channel_step (stream_t *stream, int step) |
e5e8ac0bd7fc
support for PVR channel navigation (patch by Sven Gothel <sgothel at jausoft dot com>)
ben
parents:
23166
diff
changeset
|
1753 { |
e5e8ac0bd7fc
support for PVR channel navigation (patch by Sven Gothel <sgothel at jausoft dot com>)
ben
parents:
23166
diff
changeset
|
1754 struct pvr_t *pvr = (struct pvr_t *) stream->priv; |
e5e8ac0bd7fc
support for PVR channel navigation (patch by Sven Gothel <sgothel at jausoft dot com>)
ben
parents:
23166
diff
changeset
|
1755 |
e5e8ac0bd7fc
support for PVR channel navigation (patch by Sven Gothel <sgothel at jausoft dot com>)
ben
parents:
23166
diff
changeset
|
1756 return set_station_by_step (pvr, step, 1); |
e5e8ac0bd7fc
support for PVR channel navigation (patch by Sven Gothel <sgothel at jausoft dot com>)
ben
parents:
23166
diff
changeset
|
1757 } |
e5e8ac0bd7fc
support for PVR channel navigation (patch by Sven Gothel <sgothel at jausoft dot com>)
ben
parents:
23166
diff
changeset
|
1758 |
e5e8ac0bd7fc
support for PVR channel navigation (patch by Sven Gothel <sgothel at jausoft dot com>)
ben
parents:
23166
diff
changeset
|
1759 int |
e5e8ac0bd7fc
support for PVR channel navigation (patch by Sven Gothel <sgothel at jausoft dot com>)
ben
parents:
23166
diff
changeset
|
1760 pvr_force_freq_step (stream_t *stream, int step) |
e5e8ac0bd7fc
support for PVR channel navigation (patch by Sven Gothel <sgothel at jausoft dot com>)
ben
parents:
23166
diff
changeset
|
1761 { |
e5e8ac0bd7fc
support for PVR channel navigation (patch by Sven Gothel <sgothel at jausoft dot com>)
ben
parents:
23166
diff
changeset
|
1762 struct pvr_t *pvr = (struct pvr_t *) stream->priv; |
e5e8ac0bd7fc
support for PVR channel navigation (patch by Sven Gothel <sgothel at jausoft dot com>)
ben
parents:
23166
diff
changeset
|
1763 |
e5e8ac0bd7fc
support for PVR channel navigation (patch by Sven Gothel <sgothel at jausoft dot com>)
ben
parents:
23166
diff
changeset
|
1764 return force_freq_step (pvr, step); |
e5e8ac0bd7fc
support for PVR channel navigation (patch by Sven Gothel <sgothel at jausoft dot com>)
ben
parents:
23166
diff
changeset
|
1765 } |
e5e8ac0bd7fc
support for PVR channel navigation (patch by Sven Gothel <sgothel at jausoft dot com>)
ben
parents:
23166
diff
changeset
|
1766 |
18997 | 1767 stream_info_t stream_info_pvr = { |
19992
be7b8a83649c
removed ivtv driver dependancy in favor of native V4L2 MPEG API (requires Linux 2.6.18 and above)
ben
parents:
19976
diff
changeset
|
1768 "V4L2 MPEG Input (a.k.a PVR)", |
18997 | 1769 "pvr", |
1770 "Benjamin Zores", | |
1771 "", | |
1772 pvr_stream_open, | |
1773 { "pvr", NULL }, | |
1774 NULL, | |
1775 1 | |
1776 }; |