19 Digital Equipment Corporation
20 Workstation Engineering/Project Athena
44 - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
45 Copyright 1991 by Digital Equipment Corporation, Maynard, Massachusetts,
46 and the Massachusetts Institute of Technology, Cambridge, Massachusetts.
50 Permission to use, copy, modify, and distribute this software and its
51 documentation for any purpose and without fee is hereby granted, provided
52 that the above copyright notice appear in all copies and that both that
53 copyright notice and this permission notice appear in supporting
54 documentation, and that the names of Digital or MIT not be used in
55 advertising or publicity pertaining to distribution of the software
56 without specific, written prior permission.
58 DIGITAL DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING
59 ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL
60 DIGITAL BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR
61 ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER
62 IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING
63 OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
64 - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
71 The following is an outline for an X video extension protocol. It
72 is preliminary and subject to change. My goal in writing this was
73 to fix some the shortcomings of existing overly simplistic
74 extensions while avoiding pitfalls in an overly complex extension.
76 Your feedback is desired, and since the major design directions
77 have been stable for some time, feel free to hammer on the details
80 When you receive a revision of the document, refer to the changes
81 and issues sections to guide your review and analysis.
87 The following people have made major contributions to the design of
90 Branko Gerovac (DEC/Corporate Research)
91 Russ Sasnett (GTE/Project Athena)
92 Ralph Swick (DEC/Project Athena)
94 Many ideas and approaches in Xv were the product of discussions
95 with several groups, including
97 Project Athena's Visual Computing Group
99 The MIT Media Lab's Interactive Cinema Group
106 From version 1.3 to 2.0
108 -- Changed SetPortControl and GetPortControl to GetPortAttribute
109 and SetPortAttribute.
111 -- Changed QueryBestSize
113 -- Simplified SelectVideoNotify and SelectPortNotify requests.
115 -- Changed the way SetPortControl and GetPortControl works.
117 -- Added a QueryExtension request to return the version and
118 revision information of the extension.
120 -- Changed the name of the QueryVideo request to QueryAdaptors;
121 Removed the list of encodings from QueryVideo and added a
122 QueryEncodings request.
124 -- Added a PortNotify event that notifies interested clients that
125 a port control has been changed.
127 -- Added SelectPortNotify request to select for PortNotify events.
129 -- The XvInterruped reason has been replaced by two new reasons:
130 one for when video is preempted by another video request and
131 one for when video is terminated because of hard transmission
134 -- Changed the wording of the QueryBestSize request. Added issue
135 about whether or not returned sizes should maintain the
136 requested aspect ratio.
143 Video technology is moving very quickly. Standards for processing
144 high resolution video are currently a hot topic of discussion
145 internationally, and it will soon be possible to process video
146 entirely within the digital domain. The Xv extension, however,
147 does not attempt to address issues of digital video. Its purpose
148 is to provide a mechanism for support of current and near term
149 interactive video technology.
151 It is somewhat ironic that Xv contains nothing particularly
152 innovative. It takes a minimalistic approach, and without a doubt
153 it could have been defined years ago, and with several revisions.
154 So, the life expectancy of Xv is not long. Nevertheless, it may
155 undergo further revision and experimentation that will help our
156 progress towards digital video systems.
158 One premise of the Xv extension is that the X server is not alone.
159 A separate video server is often used to manage other aspects of
160 video processing, though the partition between what the X server
161 does and what a video server does is a matter of great debate.
167 This extension models video monitor capabilities in the X Window
168 System. Some advanced monitors support the simultaneous display
169 of multiple video signals (into separate windows), and that is
170 prepresented here through the ability to display video from
171 multiple video input adaptors into X drawables.
173 Some monitors support multiple video encodings (mostly for
174 internationalization purposes) either through switches or
175 automatic detection, thus each video adaptor specifies the set of
176 encodings it supports.
178 The requests to display video from an adaptor into a drawable are
179 modeled after the core PutImage request, though extended to
180 support scaling and source clipping.
182 Video output is also supported and is symmetric with the video
183 input function, though fewer GC components are used.
189 The Xv extension does the following:
191 -- lists available video adaptors
192 -- identifies the number of ports each adaptor supports
193 -- describes what drawable formats each adaptor supports
194 -- describes what video encodings each adaptor supports
195 -- displays video from a port to a drawable
196 -- captures video from a drawable to a port
197 -- grabs and ungrabs ports
198 -- sets and gets port attributes
199 -- delivers event notification
206 A display may have multiple video input and output adaptors. An
207 adaptor may support multiple simultaneously active ports, and in
208 some cases the number of ports has no fixed limit.
210 An input port receives encoded video data and converts it to a
211 stream of data used to update a drawable. An output port samples
212 data from a drawable and produces a stream of encoded video data.
214 The ADAPTORINFO structure is used to describe a video adaptor.
219 type: SETofADAPTORTYPE
220 formats: LISTofFORMAT
223 ADAPTORTYPE: {Input, Output}
229 The base-id field specifies the XID of the first port of the
230 adaptor. The `num-ports' field specifies how many ports the
231 adaptor supports. The ports of the adaptor have XIDs in the range
232 [base-id..base-id + num-ports - 1]
234 The type attribute determines if the adaptor can process video
235 input, output, or input and output. The if the adaptor can
236 process input then Input is asserted, if the adaptor can process
237 output then Output is asserted.
239 The drawable depths and visual types supported by the adaptor are
240 listed in `formats'. Note: that when video is being processed for
241 pixmaps the visual format is taken to be the visual of the first
242 pair that matches the depth of the pixmap.
244 The name field contains an a vendor specific string that
245 identifies the adaptor.
247 It should be noted that the existence of separate adaptors doesn't
248 necessarily imply that simultaneous operation is supported.
257 A Port error is returned if any request names a PORT that does not
263 An Encoding error is returned if any request names an ENCODINGID
277 The QueryExtension request returns the extension version and
284 adaptors: LISTofADAPTORINFO
286 The QueryAdaptors request returns the video adaptor information for
287 the screen of the specified window.
295 encodings: LISTofENCODINGINFO
297 The QueryEncodings request returns the list of encodings supported
298 by the port adaptor. Use the SetPortAttribute request to set
299 which encoding a port is to process. The ENCODINGINFO record
300 describes an encoding:
303 [encoding: ENCODINGID
305 width, height: CARD16
308 The `encoding' field identifies an encoding supported by a port.
309 Its value is unique for a screen. Width and height specify the
310 size of the video image and rate specifies the rate at which
311 fields of image information are encoded.
313 An encoding is identified by a string that names the encoding.
314 Encoding naming conventions need to be established (i.e.,
315 something along the lines of font naming, but simpler)
318 [numerator, denominator: INT32]
320 The FRACTION structure is used to specify a fractional number.
338 The PutVideo request writes video into a drawable. The position
339 and size of the source rectangle is specified by vid-x, vid-y,
340 vid-w, and vid-h. The position and size of the destination
341 rectangle is specified by drw-x, drw-y, drw-w, drw-h.
343 Video data is clipped to the bounds of the video encoding, scaled
344 to the requested drawable region size (or the closest size
345 supported), and clipped to the bounds of the drawable.
347 If video is successfully initiated, a VideoNotify event with
348 detail Started is generated for the drawable. If the port is
349 already in use, its video is preempted, and if the new drawable is
350 different than the old, a VideoNotify event with detail Preempted
351 is generated for the old drawable. If the port is grabbed by
352 another client, this request is ignored, and a VideoNotify event
353 with detail Busy is generated for the drawable. If the port is
354 not receiving a valid video signal or if the video signal is
355 interrupted while video is active a VideoNotify event with detail
356 HardError is generated for the drawable.
358 GC components: subwindow-mode, clip-x-origin, clip-y-origin, clip-mask.
360 Errors: {Match, Value, GContext, Port, Alloc}
372 The PutStill request writes a single frame of video into a
373 drawable. The position and size of the source rectangle is
374 specified by vid-x, vid-y, vid-w, and vid-h. The position and
375 size of the destination rectangle is specified by drw-x, drw-y,
378 Video data is clipped to the bounds of the video encoding, scaled
379 to the requested drawable region size (or the closest size
380 supported) and clipped to the bounds of the drawable.
382 If the port is grabbed by another client, this request is ignored,
383 and a VideoNotify event with detail Busy is generated for the
384 drawable. If the port is not receiving a valid video signal a
385 VideoNotify event with detail HardError is generated for the
388 GC components: subwindow-mode, clip-x-origin, clip-y-origin, clip-mask.
390 Errors: {Match, Value, GContext, Port, Alloc}
406 The GetVideo request outputs video from a drawable. The position
407 and size of the destination rectangle is specified by vid-x,
408 vid-y, vid-w, and vid-h. The position and size of the source
409 rectangle is specified by drw-x, drw-y, drw-w, and drw-h.
411 Drawable data is clipped to the bounds of the drawable, scaled to
412 the requested video region size (or the closest size supported)
413 and clipped to the bounds of the video encoding. The contents of
414 any region not updated with drawable data is undefined.
416 If video is successfully initiated, a VideoNotify event with
417 detail Started is generated for the drawable. If the port is
418 already in use, its video is preempted, and if the new drawable is
419 different than the old, a VideoNotify event with detail Preempted
420 is generated for the old drawable. If the port is grabbed by
421 another client, this request is ignored, and a VideoNotify event
422 with detail Busy is generated for the drawable.
424 GC components: subwindow-mode, clip-x-origin, clip-y-origin,
427 Errors: {Match, Value, GContext, Port, Alloc}
439 The GetStill request outputs video from a drawable. The position
440 and size of the destination rectangle is specified by vid-x,
441 vid-y, vid-w, and vid-h. The position and size of the source
442 rectangle is specified by drw-x, drw-y, drw-w, and drw-h.
444 Drawable data is clipped to the bounds of the drawable, scaled to
445 the requested video region size (or the closest size supported)
446 and clipped to the bounds of the video encoding. The contents of
447 any region not updated with drawable data is undefined.
449 If the still is successfully captured a VideoNotify event with
450 detail Still is generated for the drawable. If the port is
451 grabbed by another client, this request is ignored, and a
452 VideoNotify event with detail Busy is generated for the drawable.
454 GC components: subwindow-mode, clip-x-origin, clip-y-origin,
457 Errors: {Match, Value, GContext, Port, Alloc}
467 timestamp: {TIMESTAMP, CurrentTime}
469 status: {Success, AlreadyGrabbed, InvalidTime}
471 The GrabPort request grabs a port. While a port is grabbed, only
472 video requests from the grabbing client are permitted.
474 If timestamp specifies a time older than the current port time, a
475 status of InvalidTime is returned. If the port is already grabbed
476 by another client, a status of AlreadyGrabbed is returned.
477 Otherwise a status of Success is returned. The port time is
478 updated when the following requests are processed: GrabPort,
479 UngrabPort, PutVideo, PutStill, GetVideo, GetStill
481 If the port is actively processing video for another client, the
482 video is preempted, and an VideoNotify event with detail Preempted
483 is generated for its drawable.
490 timestamp: {TIMESTAMP, CurrentTime}
492 The UngrabPort request ungrabs a port. If timestamp specifies a
493 time before the last connection request time of this port, the
507 The StopVideo request stops active video for the specified port
508 and drawable. If the port isn't processing video, or if it is
509 processing video in a different drawable, the request is ignored.
510 When video is stopped a VideoNotify event with detail Stopped is
511 generated for the associated drawable.
513 Errors: {Drawable, Port}
520 The SelectVideoNotify request enables or disables VideoNotify
521 event delivery to the requesting client. VideoNotify events are
522 generated when video starts and stops.
531 The SelectPortNotify request enables or disables PortNotify event
532 delivery to the requesting client. PortNotify events are
533 generated when port attributes are changed using SetPortAttribute.
544 actual-width, actual-height: CARD16
546 The QueryBestSize request returns, for the given source size and
547 desired destination size, the closest destination size that the
548 port adaptor supports. The returned size will be equal
549 or smaller than the requested size if one is supported. If motion
550 is True then the requested size is intended for use with full
551 motion video. If motion is False, the requested size is intended
552 for use with stills only.
554 The retuned size is also chosen to maintain the requested aspect ratio
566 The SetPortAttribute request sets the value of a port attribute.
567 The port attribute is identified by the attribute atom. The
568 following strings are guaranteed to generate valid atoms using the
572 -----------------------------------------------------------------
574 "XV_ENCODING" ENCODINGID
575 "XV_HUE" [-1000..1000]
576 "XV_SATURATION" [-1000..1000]
577 "XV_BRIGHTNESS" [-1000..1000]
578 "XV_CONTRAST" [-1000..1000]
581 If the given attribute doesn't match an attribute supported by the
582 port adaptor a Match error is generated. The supplied encoding
583 must be one of the encodings listed for the adaptor, otherwise an
584 Encoding error is generated.
586 If the adaptor doesn't support the exact hue, saturation,
587 brightness, and contrast levels supplied, the closest levels
588 supported are assumed. The GetPortAttribute request can be used
589 to query the resulting levels.
591 When a SetPortAttribute request is processed a PortNotify event is
592 generated for all clients that have requested port change
593 notification using SelectPortNotify.
595 Errors: {Port, Match, Value}
605 The GetPortAttribute request returns the current value of the
606 attribute identified by the given atom. If the given atom
607 doesn't match an attribute supported by the adaptor a Match
610 Errors: {Port, Match}
623 REASON: {Started, Still, Stopped, Busy, Preempted, HardError}
625 A VideoNotify event is generated when video activity is started,
626 stopped, or unable to proceed in a drawable.
628 A Started reason is generated when video starts in a drawable.
630 A Stopped reason is generated when video is stopped in a
631 drawable upon request.
633 A Busy reason is generated when a put or get request cannot
634 proceed because the port is grabbed by another client.
636 A Preempted reason is generated when video is stopped by a
639 A HardError reason is generated when the video port cannot
640 initiate or continue processing a video request because of an
641 underlying transmission or reception error.
650 The PortNotify event is generated when a SetPortAttribute request
651 is processed. The event is delivered to all clients that have
652 performed a SelectPortNotify request for the port. The event
653 contains the atom identifying the attribute that changed, and the
654 new value of that attribute.