469
set_control (tveng_device_info * info,
470
tv_control * control,
475
if ((c->atom == info->filter) &&
476
(info->port != None))
478
XvSetPortAttribute(info->display,
483
else if ((c->atom == info->double_buffer) &&
484
(info->port != None))
486
XvSetPortAttribute(info->display,
491
else if ((c->atom == info->colorkey) &&
492
(info->port != None))
495
int rm=0xff, gm=0xff, bm=0xff, rs=16, gs=8, bs=0; /* masks, shifts */
496
/* Adjust colorkey to the current pixformat */
497
switch (info->current_bpp)
501
rs = 7; gs = 2; bs = -3;
504
rm = bm = 0xf8; gm = 0xfc;
505
rs = 8; gs = 3; bs = -3;
526
XvSetPortAttribute(info->display,
538
get_control (tveng_device_info * info,
539
tv_control * control)
544
if ((c->atom == info->filter) &&
545
(info->port != None))
547
XvGetPortAttribute(info->display,
552
else if ((c->atom == info->double_buffer) &&
553
(info->port != None))
555
XvGetPortAttribute(info->display,
560
else if ((c->atom == info->colorkey) &&
561
(info->port != None))
564
int rm=0xff, gm=0xff, bm=0xff, rs=16, gs=8, bs=0; /* masks, shifts */
566
XvGetPortAttribute(info->display,
571
/* Adjust colorkey to the current pixformat */
572
switch (info->current_bpp)
576
rs = 7; gs = 2; bs = -3;
579
rm = bm = 0xf8; gm = 0xfc;
580
rs = 8; gs = 3; bs = -3;
600
value = (r<<16)+(g<<8)+b;
607
if (c->pub.value != value)
609
c->pub.value = value;
610
tv_callback_notify (info, &c->pub, c->pub._callback);
619
get_control_list (tveng_device_info * info)
628
/* ? REQUIRE_IO_MODE (-1); */
632
tv_clear_error (info);
636
info->filter = info->colorkey =
637
info->double_buffer = None;
639
/* Add the controls in this port to the struct of controls */
640
at = XvQueryPortAttributes(dpy, port, &attributes);
642
for (i=0; i<attributes; i++)
646
if (info->debug_level)
647
fprintf(stderr, " TVeng.c Xv atom: %s%s%s (%i -> %i)\n",
649
(at[i].flags & XvGettable) ? " gettable" : "",
650
(at[i].flags & XvSettable) ? " settable" : "",
651
at[i].min_value, at[i].max_value);
653
/* Any attribute not settable and Gettable is of little value */
654
if ((!(at[i].flags & XvGettable)) ||
655
(!(at[i].flags & XvSettable)))
660
if (!strcmp("XV_FILTER", at[i].name))
662
info->filter = XInternAtom(dpy, "XV_FILTER",
664
c.atom = info->filter;
665
if (!(c.pub.label = strdup (_("Filter"))))
667
c.pub.minimum = at[i].min_value;
668
c.pub.maximum = at[i].max_value;
669
c.pub.type = TV_CONTROL_TYPE_BOOLEAN;
671
c.pub._parent = NULL; /* TVENG_CONTROLLER_MOTHER; */
672
/* XXX clone, not panel. */
673
if (!append_panel_control(info, &c.pub, sizeof (c)))
682
else if (!strcmp("XV_DOUBLE_BUFFER", at[i].name))
684
info->double_buffer = XInternAtom(dpy, "XV_DOUBLE_BUFFER",
686
c.atom = info->double_buffer;
687
if (!(c.pub.label = strdup (_("Filter"))))
689
c.pub.minimum = at[i].min_value;
690
c.pub.maximum = at[i].max_value;
691
c.pub.type = TV_CONTROL_TYPE_BOOLEAN;
693
c.pub._parent = NULL; /* TVENG_CONTROLLER_MOTHER; */
694
if (!append_panel_control(info, &c.pub, sizeof (c)))
703
else if (!strcmp("XV_COLORKEY", at[i].name))
705
info->colorkey = XInternAtom(dpy, "XV_COLORKEY",
707
c.atom = info->colorkey;
708
/* TRANSLATORS: Color replaced by video in overlay mode. */
709
if (!(c.pub.label = strdup (_("Colorkey"))))
711
c.pub.minimum = at[i].min_value;
712
c.pub.maximum = at[i].max_value;
713
c.pub.type = TV_CONTROL_TYPE_COLOR;
715
c.pub._parent = NULL; /* TVENG_CONTROLLER_MOTHER; */
716
if (!append_panel_control(info, &c.pub, sizeof (c)))
728
p_tveng_update_controls(info);
740
struct panel_device panel;
744
panel.set_control = set_control;
745
panel.get_control = get_control;
747
get_control_list (NULL);
468
751
register_port (XvPortID xvport,
469
752
tv_pixfmt pixfmt,