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