comparison libmpdemux/tvi_v4l.c @ 2837:c63562f5f56f

tuning worx (can set frequency)
author alex
date Sun, 11 Nov 2001 15:45:23 +0000
parents 596a6ba3520f
children 7ff47d6ae6e9
comparison
equal deleted inserted replaced
2836:ec672ea5ac2c 2837:c63562f5f56f
325 return(0); 325 return(0);
326 } 326 }
327 327
328 static int uninit(priv_t *priv) 328 static int uninit(priv_t *priv)
329 { 329 {
330 close(priv->fd);
330 #warning "Implement uninit!" 331 #warning "Implement uninit!"
331 } 332 }
332 333
333 static int start(priv_t *priv) 334 static int start(priv_t *priv)
334 { 335 {
366 priv->buf[i].frame = i; 367 priv->buf[i].frame = i;
367 priv->buf[i].width = priv->width; 368 priv->buf[i].width = priv->width;
368 priv->buf[i].height = priv->height; 369 priv->buf[i].height = priv->height;
369 mp_msg(MSGT_TV, MSGL_DBG2, "buffer: %d => %p\n", i, &priv->buf[i]); 370 mp_msg(MSGT_TV, MSGL_DBG2, "buffer: %d => %p\n", i, &priv->buf[i]);
370 } 371 }
371 372
373
374 #if 0
375 {
376 struct video_window win;
377
378 win.x = 0;
379 win.y = 0;
380 win.width = priv->width;
381 win.height = priv->height;
382 win.chromakey = -1;
383 win.flags = 0;
384
385 ioctl(priv->fd, VIDIOCSWIN, &win);
386 }
387
372 /* start capture */ 388 /* start capture */
373 if (ioctl(priv->fd, VIDIOCCAPTURE, &one) == -1) 389 if (ioctl(priv->fd, VIDIOCCAPTURE, &one) == -1)
374 { 390 {
375 mp_msg(MSGT_TV, MSGL_ERR, "ioctl capture failed: %s\n", strerror(errno)); 391 mp_msg(MSGT_TV, MSGL_ERR, "ioctl capture failed: %s\n", strerror(errno));
376 return(0); 392 return(0);
377 } 393 }
394 #endif
395
396 return(1);
378 } 397 }
379 398
380 static int control(priv_t *priv, int cmd, void *arg) 399 static int control(priv_t *priv, int cmd, void *arg)
381 { 400 {
382 mp_msg(MSGT_TV, MSGL_DBG2, "debug: control(priv=%p, cmd=%d, arg=%p)\n", 401 mp_msg(MSGT_TV, MSGL_DBG2, "debug: control(priv=%p, cmd=%d, arg=%p)\n",
488 mp_msg(MSGT_TV, MSGL_ERR, "ioctl get freq failed: %s\n", strerror(errno)); 507 mp_msg(MSGT_TV, MSGL_ERR, "ioctl get freq failed: %s\n", strerror(errno));
489 return(TVI_CONTROL_FALSE); 508 return(TVI_CONTROL_FALSE);
490 } 509 }
491 510
492 /* tuner uses khz not mhz ! */ 511 /* tuner uses khz not mhz ! */
493 if (priv->tuner.flags & VIDEO_TUNER_LOW) 512 // if (priv->tuner.flags & VIDEO_TUNER_LOW)
494 freq /= 1000; 513 // freq /= 1000;
495 (unsigned long)*(void **)arg = freq; 514 (unsigned long)*(void **)arg = freq;
496 return(TVI_CONTROL_TRUE); 515 return(TVI_CONTROL_TRUE);
497 } 516 }
498 case TVI_CONTROL_TUN_SET_FREQ: 517 case TVI_CONTROL_TUN_SET_FREQ:
499 { 518 {
500 /* argument is in MHz ! */ 519 /* argument is in MHz ! */
501 unsigned long freq = (unsigned long)*(void **)arg; 520 unsigned long freq = (unsigned long)*(void **)arg;
502 521
503 mp_msg(MSGT_TV, MSGL_V, "requested frequency: %lu MHz\n", (float)freq/16); 522 mp_msg(MSGT_TV, MSGL_V, "requested frequency: %.3f\n", (float)freq/16);
504 523
505 /* tuner uses khz not mhz ! */ 524 /* tuner uses khz not mhz ! */
506 if (priv->tuner.flags & VIDEO_TUNER_LOW) 525 // if (priv->tuner.flags & VIDEO_TUNER_LOW)
507 freq *= 1000; 526 // freq *= 1000;
508 mp_msg(MSGT_TV, MSGL_V, " requesting from driver: freq=%.3f\n", (float)freq/16); 527 // mp_msg(MSGT_TV, MSGL_V, " requesting from driver: freq=%.3f\n", (float)freq/16);
509 if (ioctl(priv->fd, VIDIOCSFREQ, &freq) == -1) 528 if (ioctl(priv->fd, VIDIOCSFREQ, &freq) == -1)
510 { 529 {
511 mp_msg(MSGT_TV, MSGL_ERR, "ioctl set freq failed: %s\n", strerror(errno)); 530 mp_msg(MSGT_TV, MSGL_ERR, "ioctl set freq failed: %s\n", strerror(errno));
512 return(TVI_CONTROL_FALSE); 531 return(TVI_CONTROL_FALSE);
513 } 532 }