Mercurial > mplayer.hg
comparison stream/tv.c @ 23887:2b431d844608
Removing global variables from tv://
Step 6: removing references to old globals from tv.c
author | voroshil |
---|---|
date | Sun, 29 Jul 2007 10:22:39 +0000 |
parents | d65439444b75 |
children | 0ad7037df91f |
comparison
equal
deleted
inserted
replaced
23886:5af94a1df41e | 23887:2b431d844608 |
---|---|
122 demux_packet_t* dp; | 122 demux_packet_t* dp; |
123 unsigned int len=0; | 123 unsigned int len=0; |
124 | 124 |
125 /* ================== ADD AUDIO PACKET =================== */ | 125 /* ================== ADD AUDIO PACKET =================== */ |
126 | 126 |
127 if (ds==demux->audio && tv_param_noaudio == 0 && | 127 if (ds==demux->audio && tvh->tv_param->noaudio == 0 && |
128 tvh->functions->control(tvh->priv, | 128 tvh->functions->control(tvh->priv, |
129 TVI_CONTROL_IS_AUDIO, 0) == TVI_CONTROL_TRUE) | 129 TVI_CONTROL_IS_AUDIO, 0) == TVI_CONTROL_TRUE) |
130 { | 130 { |
131 len = tvh->functions->get_audio_framesize(tvh->priv); | 131 len = tvh->functions->get_audio_framesize(tvh->priv); |
132 | 132 |
152 } | 152 } |
153 | 153 |
154 static int norm_from_string(tvi_handle_t *tvh, char* norm) | 154 static int norm_from_string(tvi_handle_t *tvh, char* norm) |
155 { | 155 { |
156 #ifdef HAVE_TV_V4L2 | 156 #ifdef HAVE_TV_V4L2 |
157 if (strcmp(tv_param_driver, "v4l2") != 0) { | 157 if (strcmp(tvh->tv_param->driver, "v4l2") != 0) { |
158 #endif | 158 #endif |
159 if (!strcasecmp(norm, "pal")) | 159 if (!strcasecmp(norm, "pal")) |
160 return TV_NORM_PAL; | 160 return TV_NORM_PAL; |
161 else if (!strcasecmp(norm, "ntsc")) | 161 else if (!strcasecmp(norm, "ntsc")) |
162 return TV_NORM_NTSC; | 162 return TV_NORM_NTSC; |
209 { | 209 { |
210 mp_msg(MSGT_TV, MSGL_ERR, MSGTR_TV_NoVideoInputPresent); | 210 mp_msg(MSGT_TV, MSGL_ERR, MSGTR_TV_NoVideoInputPresent); |
211 return 0; | 211 return 0; |
212 } | 212 } |
213 | 213 |
214 if (tv_param_outfmt == -1) | 214 if (tvh->tv_param->outfmt == -1) |
215 for (i = 0; i < sizeof (tv_fmt_list) / sizeof (*tv_fmt_list); i++) | 215 for (i = 0; i < sizeof (tv_fmt_list) / sizeof (*tv_fmt_list); i++) |
216 { | 216 { |
217 tv_param_outfmt = tv_fmt_list[i]; | 217 tvh->tv_param->outfmt = tv_fmt_list[i]; |
218 if (funcs->control (tvh->priv, TVI_CONTROL_VID_SET_FORMAT, | 218 if (funcs->control (tvh->priv, TVI_CONTROL_VID_SET_FORMAT, |
219 &tv_param_outfmt) == TVI_CONTROL_TRUE) | 219 &tvh->tv_param->outfmt) == TVI_CONTROL_TRUE) |
220 break; | 220 break; |
221 } | 221 } |
222 else | 222 else |
223 { | 223 { |
224 switch(tv_param_outfmt) | 224 switch(tvh->tv_param->outfmt) |
225 { | 225 { |
226 case IMGFMT_YV12: | 226 case IMGFMT_YV12: |
227 case IMGFMT_I420: | 227 case IMGFMT_I420: |
228 case IMGFMT_UYVY: | 228 case IMGFMT_UYVY: |
229 case IMGFMT_YUY2: | 229 case IMGFMT_YUY2: |
233 case IMGFMT_BGR24: | 233 case IMGFMT_BGR24: |
234 case IMGFMT_BGR16: | 234 case IMGFMT_BGR16: |
235 case IMGFMT_BGR15: | 235 case IMGFMT_BGR15: |
236 break; | 236 break; |
237 default: | 237 default: |
238 mp_msg(MSGT_TV, MSGL_ERR, MSGTR_TV_UnknownImageFormat,tv_param_outfmt); | 238 mp_msg(MSGT_TV, MSGL_ERR, MSGTR_TV_UnknownImageFormat,tvh->tv_param->outfmt); |
239 } | 239 } |
240 funcs->control(tvh->priv, TVI_CONTROL_VID_SET_FORMAT, &tv_param_outfmt); | 240 funcs->control(tvh->priv, TVI_CONTROL_VID_SET_FORMAT, &tvh->tv_param->outfmt); |
241 } | 241 } |
242 | 242 |
243 /* set some params got from cmdline */ | 243 /* set some params got from cmdline */ |
244 funcs->control(tvh->priv, TVI_CONTROL_SPC_SET_INPUT, &tv_param_input); | 244 funcs->control(tvh->priv, TVI_CONTROL_SPC_SET_INPUT, &tvh->tv_param->input); |
245 | 245 |
246 #ifdef HAVE_TV_V4L2 | 246 #ifdef HAVE_TV_V4L2 |
247 if (!strcmp(tv_param_driver, "v4l2") && tv_param_normid >= 0) { | 247 if (!strcmp(tvh->tv_param->driver, "v4l2") && tvh->tv_param->normid >= 0) { |
248 mp_msg(MSGT_TV, MSGL_V, MSGTR_TV_SelectedNormId, tv_param_normid); | 248 mp_msg(MSGT_TV, MSGL_V, MSGTR_TV_SelectedNormId, tvh->tv_param->normid); |
249 if (funcs->control(tvh->priv, TVI_CONTROL_TUN_SET_NORM, &tv_param_normid) != TVI_CONTROL_TRUE) { | 249 if (funcs->control(tvh->priv, TVI_CONTROL_TUN_SET_NORM, &tvh->tv_param->normid) != TVI_CONTROL_TRUE) { |
250 mp_msg(MSGT_TV, MSGL_ERR, MSGTR_TV_CannotSetNorm); | 250 mp_msg(MSGT_TV, MSGL_ERR, MSGTR_TV_CannotSetNorm); |
251 } | 251 } |
252 } else { | 252 } else { |
253 #endif | 253 #endif |
254 /* select video norm */ | 254 /* select video norm */ |
255 tvh->norm = norm_from_string(tvh, tv_param_norm); | 255 tvh->norm = norm_from_string(tvh, tvh->tv_param->norm); |
256 | 256 |
257 mp_msg(MSGT_TV, MSGL_V, MSGTR_TV_SelectedNorm, tv_param_norm); | 257 mp_msg(MSGT_TV, MSGL_V, MSGTR_TV_SelectedNorm, tvh->tv_param->norm); |
258 if (funcs->control(tvh->priv, TVI_CONTROL_TUN_SET_NORM, &tvh->norm) != TVI_CONTROL_TRUE) { | 258 if (funcs->control(tvh->priv, TVI_CONTROL_TUN_SET_NORM, &tvh->norm) != TVI_CONTROL_TRUE) { |
259 mp_msg(MSGT_TV, MSGL_ERR, MSGTR_TV_CannotSetNorm); | 259 mp_msg(MSGT_TV, MSGL_ERR, MSGTR_TV_CannotSetNorm); |
260 } | 260 } |
261 #ifdef HAVE_TV_V4L2 | 261 #ifdef HAVE_TV_V4L2 |
262 } | 262 } |
263 #endif | 263 #endif |
264 | 264 |
265 #ifdef HAVE_TV_V4L1 | 265 #ifdef HAVE_TV_V4L1 |
266 if ( tv_param_mjpeg ) | 266 if ( tvh->tv_param->mjpeg ) |
267 { | 267 { |
268 /* set width to expected value */ | 268 /* set width to expected value */ |
269 if (tv_param_width == -1) | 269 if (tvh->tv_param->width == -1) |
270 { | 270 { |
271 tv_param_width = 704/tv_param_decimation; | 271 tvh->tv_param->width = 704/tvh->tv_param->decimation; |
272 } | 272 } |
273 if (tv_param_height == -1) | 273 if (tvh->tv_param->height == -1) |
274 { | 274 { |
275 if ( tvh->norm != TV_NORM_NTSC ) | 275 if ( tvh->norm != TV_NORM_NTSC ) |
276 tv_param_height = 576/tv_param_decimation; | 276 tvh->tv_param->height = 576/tvh->tv_param->decimation; |
277 else | 277 else |
278 tv_param_height = 480/tv_param_decimation; | 278 tvh->tv_param->height = 480/tvh->tv_param->decimation; |
279 } | 279 } |
280 mp_msg(MSGT_TV, MSGL_INFO, | 280 mp_msg(MSGT_TV, MSGL_INFO, |
281 MSGTR_TV_MJP_WidthHeight, tv_param_width, tv_param_height); | 281 MSGTR_TV_MJP_WidthHeight, tvh->tv_param->width, tvh->tv_param->height); |
282 } | 282 } |
283 #endif | 283 #endif |
284 | 284 |
285 /* limits on w&h are norm-dependent -- JM */ | 285 /* limits on w&h are norm-dependent -- JM */ |
286 /* set width */ | 286 /* set width */ |
287 if (tv_param_width != -1) | 287 if (tvh->tv_param->width != -1) |
288 { | 288 { |
289 if (funcs->control(tvh->priv, TVI_CONTROL_VID_CHK_WIDTH, &tv_param_width) == TVI_CONTROL_TRUE) | 289 if (funcs->control(tvh->priv, TVI_CONTROL_VID_CHK_WIDTH, &tvh->tv_param->width) == TVI_CONTROL_TRUE) |
290 funcs->control(tvh->priv, TVI_CONTROL_VID_SET_WIDTH, &tv_param_width); | 290 funcs->control(tvh->priv, TVI_CONTROL_VID_SET_WIDTH, &tvh->tv_param->width); |
291 else | 291 else |
292 { | 292 { |
293 mp_msg(MSGT_TV, MSGL_ERR, MSGTR_TV_UnableToSetWidth, tv_param_width); | 293 mp_msg(MSGT_TV, MSGL_ERR, MSGTR_TV_UnableToSetWidth, tvh->tv_param->width); |
294 funcs->control(tvh->priv, TVI_CONTROL_VID_GET_WIDTH, &tv_param_width); | 294 funcs->control(tvh->priv, TVI_CONTROL_VID_GET_WIDTH, &tvh->tv_param->width); |
295 } | 295 } |
296 } | 296 } |
297 | 297 |
298 /* set height */ | 298 /* set height */ |
299 if (tv_param_height != -1) | 299 if (tvh->tv_param->height != -1) |
300 { | 300 { |
301 if (funcs->control(tvh->priv, TVI_CONTROL_VID_CHK_HEIGHT, &tv_param_height) == TVI_CONTROL_TRUE) | 301 if (funcs->control(tvh->priv, TVI_CONTROL_VID_CHK_HEIGHT, &tvh->tv_param->height) == TVI_CONTROL_TRUE) |
302 funcs->control(tvh->priv, TVI_CONTROL_VID_SET_HEIGHT, &tv_param_height); | 302 funcs->control(tvh->priv, TVI_CONTROL_VID_SET_HEIGHT, &tvh->tv_param->height); |
303 else | 303 else |
304 { | 304 { |
305 mp_msg(MSGT_TV, MSGL_ERR, MSGTR_TV_UnableToSetHeight, tv_param_height); | 305 mp_msg(MSGT_TV, MSGL_ERR, MSGTR_TV_UnableToSetHeight, tvh->tv_param->height); |
306 funcs->control(tvh->priv, TVI_CONTROL_VID_GET_HEIGHT, &tv_param_height); | 306 funcs->control(tvh->priv, TVI_CONTROL_VID_GET_HEIGHT, &tvh->tv_param->height); |
307 } | 307 } |
308 } | 308 } |
309 | 309 |
310 if (funcs->control(tvh->priv, TVI_CONTROL_IS_TUNER, 0) != TVI_CONTROL_TRUE) | 310 if (funcs->control(tvh->priv, TVI_CONTROL_IS_TUNER, 0) != TVI_CONTROL_TRUE) |
311 { | 311 { |
314 } | 314 } |
315 | 315 |
316 /* select channel list */ | 316 /* select channel list */ |
317 for (i = 0; chanlists[i].name != NULL; i++) | 317 for (i = 0; chanlists[i].name != NULL; i++) |
318 { | 318 { |
319 if (!strcasecmp(chanlists[i].name, tv_param_chanlist)) | 319 if (!strcasecmp(chanlists[i].name, tvh->tv_param->chanlist)) |
320 { | 320 { |
321 tvh->chanlist = i; | 321 tvh->chanlist = i; |
322 tvh->chanlist_s = chanlists[i].list; | 322 tvh->chanlist_s = chanlists[i].list; |
323 break; | 323 break; |
324 } | 324 } |
325 } | 325 } |
326 | 326 |
327 if (tvh->chanlist == -1) | 327 if (tvh->chanlist == -1) |
328 mp_msg(MSGT_TV, MSGL_WARN, MSGTR_TV_UnableFindChanlist, | 328 mp_msg(MSGT_TV, MSGL_WARN, MSGTR_TV_UnableFindChanlist, |
329 tv_param_chanlist); | 329 tvh->tv_param->chanlist); |
330 else | 330 else |
331 mp_msg(MSGT_TV, MSGL_V, MSGTR_TV_SelectedChanlist, | 331 mp_msg(MSGT_TV, MSGL_V, MSGTR_TV_SelectedChanlist, |
332 chanlists[tvh->chanlist].name, chanlists[tvh->chanlist].count); | 332 chanlists[tvh->chanlist].name, chanlists[tvh->chanlist].count); |
333 | 333 |
334 if (tv_param_freq && tv_param_channel) | 334 if (tvh->tv_param->freq && tvh->tv_param->channel) |
335 { | 335 { |
336 mp_msg(MSGT_TV, MSGL_WARN, MSGTR_TV_ChannelFreqParamConflict); | 336 mp_msg(MSGT_TV, MSGL_WARN, MSGTR_TV_ChannelFreqParamConflict); |
337 goto done; | 337 goto done; |
338 } | 338 } |
339 | 339 |
340 /* Handle channel names */ | 340 /* Handle channel names */ |
341 if (tv_param_channels) { | 341 if (tvh->tv_param->channels) { |
342 char** channels = tv_param_channels; | 342 char** channels = tvh->tv_param->channels; |
343 mp_msg(MSGT_TV, MSGL_INFO, MSGTR_TV_ChannelNamesDetected); | 343 mp_msg(MSGT_TV, MSGL_INFO, MSGTR_TV_ChannelNamesDetected); |
344 tv_channel_list = malloc(sizeof(tv_channels_t)); | 344 tv_channel_list = malloc(sizeof(tv_channels_t)); |
345 tv_channel_list->index=1; | 345 tv_channel_list->index=1; |
346 tv_channel_list->next=NULL; | 346 tv_channel_list->next=NULL; |
347 tv_channel_list->prev=NULL; | 347 tv_channel_list->prev=NULL; |
410 tv_channel_last_real = malloc(5); | 410 tv_channel_last_real = malloc(5); |
411 | 411 |
412 if (tv_channel_list) { | 412 if (tv_channel_list) { |
413 int i; | 413 int i; |
414 int channel = 0; | 414 int channel = 0; |
415 if (tv_param_channel) | 415 if (tvh->tv_param->channel) |
416 { | 416 { |
417 if (isdigit(*tv_param_channel)) | 417 if (isdigit(*tvh->tv_param->channel)) |
418 /* if tv_param_channel begins with a digit interpret it as a number */ | 418 /* if tvh->tv_param->channel begins with a digit interpret it as a number */ |
419 channel = atoi(tv_param_channel); | 419 channel = atoi(tvh->tv_param->channel); |
420 else | 420 else |
421 { | 421 { |
422 /* if tv_param_channel does not begin with a digit | 422 /* if tvh->tv_param->channel does not begin with a digit |
423 set the first channel that contains tv_param_channel in its name */ | 423 set the first channel that contains tvh->tv_param->channel in its name */ |
424 | 424 |
425 tv_channel_current = tv_channel_list; | 425 tv_channel_current = tv_channel_list; |
426 while ( tv_channel_current ) { | 426 while ( tv_channel_current ) { |
427 if ( strstr(tv_channel_current->name, tv_param_channel) ) | 427 if ( strstr(tv_channel_current->name, tvh->tv_param->channel) ) |
428 break; | 428 break; |
429 tv_channel_current = tv_channel_current->next; | 429 tv_channel_current = tv_channel_current->next; |
430 } | 430 } |
431 if ( !tv_channel_current ) tv_channel_current = tv_channel_list; | 431 if ( !tv_channel_current ) tv_channel_current = tv_channel_list; |
432 } | 432 } |
445 tv_channel_current->name, (float)tv_channel_current->freq/1000); | 445 tv_channel_current->name, (float)tv_channel_current->freq/1000); |
446 tv_set_freq(tvh, (unsigned long)(((float)tv_channel_current->freq/1000)*16)); | 446 tv_set_freq(tvh, (unsigned long)(((float)tv_channel_current->freq/1000)*16)); |
447 tv_channel_last = tv_channel_current; | 447 tv_channel_last = tv_channel_current; |
448 } else { | 448 } else { |
449 /* we need to set frequency */ | 449 /* we need to set frequency */ |
450 if (tv_param_freq) | 450 if (tvh->tv_param->freq) |
451 { | 451 { |
452 unsigned long freq = atof(tv_param_freq)*16; | 452 unsigned long freq = atof(tvh->tv_param->freq)*16; |
453 | 453 |
454 /* set freq in MHz */ | 454 /* set freq in MHz */ |
455 funcs->control(tvh->priv, TVI_CONTROL_TUN_SET_FREQ, &freq); | 455 funcs->control(tvh->priv, TVI_CONTROL_TUN_SET_FREQ, &freq); |
456 | 456 |
457 funcs->control(tvh->priv, TVI_CONTROL_TUN_GET_FREQ, &freq); | 457 funcs->control(tvh->priv, TVI_CONTROL_TUN_GET_FREQ, &freq); |
458 mp_msg(MSGT_TV, MSGL_V, MSGTR_TV_SelectedFrequency, | 458 mp_msg(MSGT_TV, MSGL_V, MSGTR_TV_SelectedFrequency, |
459 freq, (float)freq/16); | 459 freq, (float)freq/16); |
460 } | 460 } |
461 | 461 |
462 if (tv_param_channel) { | 462 if (tvh->tv_param->channel) { |
463 struct CHANLIST cl; | 463 struct CHANLIST cl; |
464 | 464 |
465 mp_msg(MSGT_TV, MSGL_V, MSGTR_TV_RequestedChannel, tv_param_channel); | 465 mp_msg(MSGT_TV, MSGL_V, MSGTR_TV_RequestedChannel, tvh->tv_param->channel); |
466 for (i = 0; i < chanlists[tvh->chanlist].count; i++) | 466 for (i = 0; i < chanlists[tvh->chanlist].count; i++) |
467 { | 467 { |
468 cl = tvh->chanlist_s[i]; | 468 cl = tvh->chanlist_s[i]; |
469 // printf("count%d: name: %s, freq: %d\n", | 469 // printf("count%d: name: %s, freq: %d\n", |
470 // i, cl.name, cl.freq); | 470 // i, cl.name, cl.freq); |
471 if (!strcasecmp(cl.name, tv_param_channel)) | 471 if (!strcasecmp(cl.name, tvh->tv_param->channel)) |
472 { | 472 { |
473 strcpy(tv_channel_last_real, cl.name); | 473 strcpy(tv_channel_last_real, cl.name); |
474 tvh->channel = i; | 474 tvh->channel = i; |
475 mp_msg(MSGT_TV, MSGL_INFO, MSGTR_TV_SelectedChannel2, | 475 mp_msg(MSGT_TV, MSGL_INFO, MSGTR_TV_SelectedChannel2, |
476 cl.name, (float)cl.freq/1000); | 476 cl.name, (float)cl.freq/1000); |
580 if (funcs->control(tvh->priv, TVI_CONTROL_VID_GET_FPS, &tmp) != TVI_CONTROL_TRUE) | 580 if (funcs->control(tvh->priv, TVI_CONTROL_VID_GET_FPS, &tmp) != TVI_CONTROL_TRUE) |
581 sh_video->fps = 25.0f; /* on PAL */ | 581 sh_video->fps = 25.0f; /* on PAL */ |
582 else sh_video->fps = tmp; | 582 else sh_video->fps = tmp; |
583 } | 583 } |
584 | 584 |
585 if (tv_param_fps != -1.0f) | 585 if (tvh->tv_param->fps != -1.0f) |
586 sh_video->fps = tv_param_fps; | 586 sh_video->fps = tvh->tv_param->fps; |
587 | 587 |
588 sh_video->frametime = 1.0f/sh_video->fps; | 588 sh_video->frametime = 1.0f/sh_video->fps; |
589 | 589 |
590 /* If playback only mode, go to immediate mode, fail silently */ | 590 /* If playback only mode, go to immediate mode, fail silently */ |
591 if(tv_param_immediate == 1) | 591 if(tvh->tv_param->immediate == 1) |
592 { | 592 { |
593 funcs->control(tvh->priv, TVI_CONTROL_IMMEDIATE, 0); | 593 funcs->control(tvh->priv, TVI_CONTROL_IMMEDIATE, 0); |
594 tv_param_noaudio = 1; | 594 tvh->tv_param->noaudio = 1; |
595 } | 595 } |
596 | 596 |
597 /* disable TV audio if -nosound is present */ | 597 /* disable TV audio if -nosound is present */ |
598 if (!demuxer->audio || demuxer->audio->id == -2) { | 598 if (!demuxer->audio || demuxer->audio->id == -2) { |
599 tv_param_noaudio = 1; | 599 tvh->tv_param->noaudio = 1; |
600 } | 600 } |
601 | 601 |
602 /* set width */ | 602 /* set width */ |
603 funcs->control(tvh->priv, TVI_CONTROL_VID_GET_WIDTH, &sh_video->disp_w); | 603 funcs->control(tvh->priv, TVI_CONTROL_VID_GET_WIDTH, &sh_video->disp_w); |
604 | 604 |
609 sh_video->ds = demuxer->video; | 609 sh_video->ds = demuxer->video; |
610 demuxer->video->id = 0; | 610 demuxer->video->id = 0; |
611 demuxer->seekable = 0; | 611 demuxer->seekable = 0; |
612 | 612 |
613 /* here comes audio init */ | 613 /* here comes audio init */ |
614 if (tv_param_noaudio == 0 && funcs->control(tvh->priv, TVI_CONTROL_IS_AUDIO, 0) == TVI_CONTROL_TRUE) | 614 if (tvh->tv_param->noaudio == 0 && funcs->control(tvh->priv, TVI_CONTROL_IS_AUDIO, 0) == TVI_CONTROL_TRUE) |
615 { | 615 { |
616 int audio_format; | 616 int audio_format; |
617 int sh_audio_format; | 617 int sh_audio_format; |
618 char buf[128]; | 618 char buf[128]; |
619 | 619 |
620 /* yeah, audio is present */ | 620 /* yeah, audio is present */ |
621 | 621 |
622 funcs->control(tvh->priv, TVI_CONTROL_AUD_SET_SAMPLERATE, | 622 funcs->control(tvh->priv, TVI_CONTROL_AUD_SET_SAMPLERATE, |
623 &tv_param_audiorate); | 623 &tvh->tv_param->audiorate); |
624 | 624 |
625 if (funcs->control(tvh->priv, TVI_CONTROL_AUD_GET_FORMAT, &audio_format) != TVI_CONTROL_TRUE) | 625 if (funcs->control(tvh->priv, TVI_CONTROL_AUD_GET_FORMAT, &audio_format) != TVI_CONTROL_TRUE) |
626 goto no_audio; | 626 goto no_audio; |
627 | 627 |
628 switch(audio_format) | 628 switch(audio_format) |
688 tv_uninit(tvh); | 688 tv_uninit(tvh); |
689 return NULL; | 689 return NULL; |
690 } | 690 } |
691 | 691 |
692 /* set color eq */ | 692 /* set color eq */ |
693 tv_set_color_options(tvh, TV_COLOR_BRIGHTNESS, tv_param_brightness); | 693 tv_set_color_options(tvh, TV_COLOR_BRIGHTNESS, tvh->tv_param->brightness); |
694 tv_set_color_options(tvh, TV_COLOR_HUE, tv_param_hue); | 694 tv_set_color_options(tvh, TV_COLOR_HUE, tvh->tv_param->hue); |
695 tv_set_color_options(tvh, TV_COLOR_SATURATION, tv_param_saturation); | 695 tv_set_color_options(tvh, TV_COLOR_SATURATION, tvh->tv_param->saturation); |
696 tv_set_color_options(tvh, TV_COLOR_CONTRAST, tv_param_contrast); | 696 tv_set_color_options(tvh, TV_COLOR_CONTRAST, tvh->tv_param->contrast); |
697 | 697 |
698 return demuxer; | 698 return demuxer; |
699 } | 699 } |
700 | 700 |
701 static void demux_close_tv(demuxer_t *demuxer) | 701 static void demux_close_tv(demuxer_t *demuxer) |
762 | 762 |
763 int tv_set_freq(tvi_handle_t *tvh, unsigned long freq) | 763 int tv_set_freq(tvi_handle_t *tvh, unsigned long freq) |
764 { | 764 { |
765 if (tvh->functions->control(tvh->priv, TVI_CONTROL_IS_TUNER, 0) == TVI_CONTROL_TRUE) | 765 if (tvh->functions->control(tvh->priv, TVI_CONTROL_IS_TUNER, 0) == TVI_CONTROL_TRUE) |
766 { | 766 { |
767 // unsigned long freq = atof(tv_param_freq)*16; | 767 // unsigned long freq = atof(tvh->tv_param->freq)*16; |
768 | 768 |
769 /* set freq in MHz */ | 769 /* set freq in MHz */ |
770 tvh->functions->control(tvh->priv, TVI_CONTROL_TUN_SET_FREQ, &freq); | 770 tvh->functions->control(tvh->priv, TVI_CONTROL_TUN_SET_FREQ, &freq); |
771 | 771 |
772 tvh->functions->control(tvh->priv, TVI_CONTROL_TUN_GET_FREQ, &freq); | 772 tvh->functions->control(tvh->priv, TVI_CONTROL_TUN_GET_FREQ, &freq); |
942 | 942 |
943 int tv_set_norm(tvi_handle_t *tvh, char* norm) | 943 int tv_set_norm(tvi_handle_t *tvh, char* norm) |
944 { | 944 { |
945 tvh->norm = norm_from_string(tvh, norm); | 945 tvh->norm = norm_from_string(tvh, norm); |
946 | 946 |
947 mp_msg(MSGT_TV, MSGL_V, MSGTR_TV_SelectedNorm, tv_param_norm); | 947 mp_msg(MSGT_TV, MSGL_V, MSGTR_TV_SelectedNorm, tvh->tv_param->norm); |
948 if (tvh->functions->control(tvh->priv, TVI_CONTROL_TUN_SET_NORM, &tvh->norm) != TVI_CONTROL_TRUE) { | 948 if (tvh->functions->control(tvh->priv, TVI_CONTROL_TUN_SET_NORM, &tvh->norm) != TVI_CONTROL_TRUE) { |
949 mp_msg(MSGT_TV, MSGL_ERR, MSGTR_TV_CannotSetNorm); | 949 mp_msg(MSGT_TV, MSGL_ERR, MSGTR_TV_CannotSetNorm); |
950 return 0; | 950 return 0; |
951 } | 951 } |
952 return(1); | 952 return(1); |