.\" $Header: proto,v 1.8 90/04/13 16:13:18 toddb Exp $
\&
.sp 1
.ce 3
\s+1\fBSection 3\fP\s-1

\s+1\fBVEX Protocol Functions\fP\s-1
.sp 2
.nr H1 0
.nr H2 0
.nr H3 0
.nr H4 0
.nr H5 0
.na
.LP
.XS
Section 3: VEX Protocol Functions
.XE
.NH 1
Video Manager Routines
.XS
\*(SN Video Manager Routines
.XE
.IN "XVEXChangeOwnership" "" "@DEF@"
.FD 0
XVEXChangeOwnership(\^\fIdisplay\fP, \fIowners\fP, \fInowners\fP\^)
.br
	Display *\fIdisplay\fP\^;
.br
	XVEXOwner \fIowners\fP[]\^;
.br
	unsigned long \fInowners\fP;
.FN
.IP \fIdisplay\fP 1i
Specifies the connection to the X server.
.IP \fIowners\fP 1i
Specifies array of ownerships to set.
.IP \fInowners\fP 1i
Specifies number of entries in \fIowners\fP array.
.LP
For each member of the \fIowners\fP list, the client that created the
specified window is given ownership of the specified resource.
[See the VEX Protocol ChangeOwnership request description]
.sp 5
.ne 20
.NH 1
Device Controls
.XS
\*(SN Device Controls
.XE
.IN "XVEXChangeControls" "" "@DEF@"
.FD 0
XVEXChangeControls(\^\fIdisplay\fP, \fIsettings\fP, \fInsettings\fP\^)
.br
	Display *\fIdisplay\fP\^;
.br
	XVEXSetting \fIsettings\fP[]\^;
.br
	unsigned long \fInsettings\fP;
.FN
.IP \fIdisplay\fP 1i
Specifies the connection to the X server.
.IP \fIsettings\fP 1i
Specifies array of settings to set.
.IP \fInsettings\fP 1i
Specifies number of entries in \fIsettings\fP array.
.LP
Changes the setting of each control named in each member of the \fIsettings\fP
array.  The \fIsettings\fP array may be created by
.PN XVEXCreateSettingList ,
but this is not required.
[See the VEX Protocol ChangeVideoControls request description]
.sp 5
.ne 35
.IN "XVEXQueryControls" "" "@DEF@"
.FD 0
XVEXSetting *XVEXQueryControls(\^\fIdisplay\fP, \fIvid\fP, \fIcontrols\fP, \fIncontrols\fP, \fInsettings_return\fP\^)
.br
	Display *\fIdisplay\fP\^;
.br
	VideoID \fIvid\fP\^;
.br
	Atom \fIcontrols\fP[]\^;
.br
	unsigned long \fIncontrols\fP;
.br
	unsigned long *\fInsettings_return\fP;
.FN
.IP \fIdisplay\fP 1i
Specifies the connection to the X server.
.IP \fIvid\fP 1i
Specifies the video id whose settings are requested.
.IP \fIcontrols\fP 1i
Specifies the controls whose settings are requested.
.IP \fIncontrols\fP 1i
Specifies number of entries in \fIcontrols\fP array.
.IP \fInsettings_return\fP 1i
Returns number of entries in the returned XVEXSetting array.
.LP
Returns the current setting associated with each of the controls in the
\fIcontrols\fP array for the video device named by \fIvid\fP.
To free the data returned by this function, use
.PN XFree .
[See the VEX Protocol QueryVideoControls request description]
.sp 5
.ne 20
.NH 1
Video Input and Video Output
.XS
\*(SN Video Input and Video Output
.XE
.IN "XVEXCreateVideo" "" "@DEF@"
.FD 0
VideoIO XVEXCreateVideo(\^\fIdisplay\fP, \fIreference\fP\^)
.br
	Display *\fIdisplay\fP\^;
.br
	VideoReference \fIreference\fP\^;
.FN
.IP \fIdisplay\fP 1i
Specifies the connection to the X server.
.IP \fIreference\fP 1i
Specifies reference for which a VIDEOIO alias is requested.
.LP
Returns a VideoIO corresponding to the given VideoReference.  If the VEX
extension cannot be initialized, the returned value is None.
[See the VEX Protocol CreateVideo request description]
.bp
.IN "XVEXRenderVideo" "" "@DEF@"
.FD 0
XVEXRenderVideo\^(\^\fIdisplay\fP, \fIsrc\fP\^, \fIdest\fP\^, \fIsrc_x\fP\^, \fIsrc_y\fP\^, \fIsrc_width\fP\^, \fIsrc_height\fP\^, \fIdest_x\fP\^, \fIdest_y\fP\^, \fIdest_width\fP\^, \fIdest_height\fP\^,
 \fIfull_motion\fP\^, \fIpriority\fP\^, \fIsubwindow_mode\fP\^)
.br
	Display *\fIdisplay\fP\^;
.br
	VideoIn \fIsrc\fP\^;
.br
	Drawable \fIdest\fP\^;
.br
	int \fIsrc_x\fP\^, \fIsrc_y\fP\^;
.br
	unsigned int \fIsrc_width\fP\^, \fIsrc_height\fP\^;
.br
	int \fIdest_x\fP\^, \fIdest_y\fP\^;
.br
	unsigned int \fIdest_width\fP\^, \fIdest_height\fP\^;
.br
	Bool \fIfull_motion\fP\^;
.br
	int \fIpriority\fP\^;
.br
	int \fIsubwindow_mode\fP\^;
.FN
.IP \fIdisplay\fP 1i
Specifies the connection to the X server.
.IP \fIsrc\fP 1i
Specifies the video source.
.IP \fIdest\fP 1i
Specifies drawable which accepts the video signal.
.IP \fIsrc_x\fP 1i
.br
.ns
.IP \fIsrc_y\fP 1i
Specify the x and y coordinates of the upper-left corner
of the video source rectangle.
.IP \fIsrc_width\fP 1i
.br
.ns
.IP \fIsrc_height\fP 1i
Specify the width and height of the video source rectangle.
.IP \fIdest_x\fP 1i
.br
.ns
.IP \fIdest_y\fP 1i
Specify the x and y coordinates of the upper-left corner
of the destination drawable rectangle.  The coordinates are relative to the
origin of the destination drawable.
.IP \fIdest_width\fP 1i
.br
.ns
.IP \fIdest_height\fP 1i
Specify the width and height of the destination drawable rectangle.
.IP \fIfull_motion\fP 1i
Specifies whether the video input signal is continually updated.
.IP \fIpriority\fP 1i
Specifies the percentage of video bandwidth that the server should try to 
preserve.
.IP \fIsubwindow_mode\fP 1i
Specifies the treatment of the destination window's children.  Ignored if
destination is a pixmap.  You can pass ClipByChildren or IncludeInferiors.
.LP
The specified region of the source video signal is decoded and
directed to the destination drawable.
[See the VEX Protocol RenderVideo request description]
.bp
.IN "XVEXCaptureGraphics" "" "@DEF@"
.FD 0
XVEXCaptureGraphics\^(\^\fIdisplay\fP, \fIsrc\fP\^, \fIdest\fP\^, \fIcmap\fP\^, \fIsrc_x\fP\^, \fIsrc_y\fP\^, \fIsrc_width\fP\^, \fIsrc_height\fP\^, \fIdest_x\fP\^, \fIdest_y\fP\^, \fIdest_width\fP\^,
 \fIdest_height\fP\^, \fIfull_motion\fP\^, \fIpriority\fP\^, \fIsubwindow_mode\fP\^)
.br
	Display *\fIdisplay\fP\^;
.br
	Drawable \fIsrc\fP\^;    
.br
	VideoOut \fIdest\fP\^;    
.br
	Colormap \fIcmap\fP\^;    
.br
	int \fIsrc_x\fP\^, \fIsrc_y\fP\^;
.br
	unsigned int \fIsrc_width\fP\^, \fIsrc_height\fP\^;
.br
	int \fIdest_x\fP\^, \fIdest_y\fP\^;
.br
	unsigned int \fIdest_width\fP\^, \fIdest_height\fP\^;
.br
	Bool \fIfull_motion\fP\^;
.br
	int \fIpriority\fP\^;
.br
	int \fIsubwindow_mode\fP\^;
.FN
.IP \fIdisplay\fP 1i
Specifies the connection to the X server.
.IP \fIsrc\fP 1i
Specifies the drawable source.
.IP \fIdest\fP 1i
Specifies the video output which accepts the video signal.
.IP \fIcmap\fP 1i
Specifies the colormap to use for a Pixmap drawable.  Must be None for window
drawable.
.IP \fIsrc_x\fP 1i
.br
.ns
.IP \fIsrc_y\fP 1i
Specify the x and y coordinates of the upper-left corner
of the source drawable rectangle.  The coordinates are relative to the
origin of the source drawable.
.IP \fIsrc_width\fP 1i
.br
.ns
.IP \fIsrc_height\fP 1i
Specify the width and height of the drawable source rectangle.
.IP \fIdest_x\fP 1i
.br
.ns
.IP \fIdest_y\fP 1i
Specify the x and y coordinates of the upper-left corner
of the destination video rectangle.
.IP \fIdest_width\fP 1i
.br
.ns
.IP \fIdest_height\fP 1i
Specify the width and height of the destination video rectangle.
.IP \fIfull_motion\fP 1i
Specifies whether the video input signal is continually updated.
.IP \fIpriority\fP 1i
Specifies the percentage of video bandwidth that the server should try to 
preserve.
.IP \fIsubwindow_mode\fP 1i
Specifies the treatment of the source window's children.  Ignored if
source is a pixmap.  You can pass ClipByChildren or IncludeInferiors.
.LP
The specified region of the drawable source is encoded into a video signal by
the destination encoder.
[See the VEX Protocol CaptureGraphics request description]
.bp
.IN "XVEXStopVideo" "" "@DEF@"
.FD 0
.sp 5
.ne 20
XVEXStopVideo(\^\fIdisplay\fP, \fIaction_mask\fP, \fIdrawables\fP, \fIndrawables\fP\^)
.br
    Display *\fIdisplay\fP\^;
.br
    int \fIaction_mask\fP;
.br
    Drawable \fIdrawables\fP[]\^;
.br
    unsigned long \fIndrawables\fP;
.FN
.IP \fIdisplay\fP 1i
Specifies the connection to the X server.
.IP \fIaction_mask\fP 1i
Specifies the action to take on the drawables list. The mask values is a
bitwise OR of these masks: VEXStopRenderVideo and VEXStopCaptureVideo.
.IP \fIdrawables\fP 1i
Specifies array of drawables to stop.
.IP \fIndrawables\fP 1i
Specifies number of entries in \fIdrawables\fP array.
.LP
The video actions previously requested on any of the drawables given in the
\fIdrawables\fP array are stopped, even if one of the drawables produces
an error.
[See the VEX Protocol StopVideo request description]
.bp
.IN "XVEXSelectEvents" "" "@DEF@"
.FD 0
XVEXSelectEvents(\^\fIdisplay\fP, \fIid\fP, \fIevent_mask\fP\^)
.br
    Display *\fIdisplay\fP\^;
.br
    XID \fIid\fP\^;
.br
    unsigned long \fIevent_mask\fP;
.FN
.IP \fIdisplay\fP 1i
Specifies the connection to the X server.
.IP \fIid\fP 1i
Specifies the VideoID or Drawable on which events are selected.
.IP \fIevent_mask\fP 1i
Specifies the events to select.
.LP
.\"Table 8-2 
The following table 
lists the event mask constants you can pass to
the event_mask argument and
the circumstances in which you would want to specify the
event mask:
.LP
.\" .CP T 2
.\"Event Mask Definitions
.TS H
lw(2i) lw(3.5i).
_
.sp 6p
.TB
Event Mask	Circumstances
.sp 6p
_
.sp 6p
.TH
.R
T{
.PN NoEventMask
T}	T{
No events wanted
T}
T{
.PN VEXRedirectMask
T}	T{
VEXRequest events wanted on a screen (should be used only by Video Manager)
T}
T{
.PN VEXConnectivityMask
T}	T{
VEXConnectivity events wanted on a screen
T}
T{
.PN VEXSyncMask
T}	T{
VEXSync events wanted
T}
T{
.PN VEXControlMask
T}	T{
VEXControl events wanted
T}
T{
.PN VEXViolationMask
T}	T{
VEXViolation events wanted
T}
T{
.PN VEXOverrideMask
T}	T{
VEXOverride events wanted
T}
.sp 6p
_
.TE
VEXRequest, VEXConnectivity, VEXViolation, and VEXOverride events
can be selected only on a
Drawable.  VEXSync events can be selected only on a VideoIO and
VEXControl events can be selected only on a VideoID.  Selections are not
cumulative;  if an event is not asserted in conjunction with a valid 
resource for that event (e.g. not asserting VEXOverrideMask when using
a Drawable resource), the event will not be delivered on that
resource regardless of earlier selections on that resource.
VEXConnectivity and VEXRequest events are actually selected on the
screen associated with the drawable id argument; to maintain these selections,
VEXRedirectMask and VEXConnectivityMask
must be asserted on each drawable id associated with that screen.
[See the VEX Protocol SelectVideoEvents request description]
.sp 5
.ne 25
.IN "XVEXQueryVideo" "" "@DEF@"
.FD 0
XVEXQueryVideo(\^\fIdisplay\fP, \fIscreen_number\fP\^)
.br
    Display *\fIdisplay\fP\^;
.br
    int \fIscreen_number\fP\^;
.FN
.IP \fIdisplay\fP 1i
Specifies the connection to the X server.
.IP \fIscreen_number\fP 1i
Specifies the screen to be updated.
.LP
[See the VEX Protocol QueryVideo request description]
.LP
.PN XVEXQueryVideo
updates connectivity and device list information in VEXlib.  It should be
called by the client after receiving a 
XVEXConnectivityEvent or a XVEXChangeEvent.
The client should get a new XVout array by calling
.PN XVEXGetVouts
after calling 
.PN XVEXQueryVideo.
The client should get a new XVEXConnectState structure by calling
.PN XVEXGetConnectState
after calling 
.PN XVEXQueryVideo.
.LP
.PN XVEXQueryVideo
does an implicit selection for VEXChange events.  This selection cannot
be withdrawn.
.bp
