[PATCH:libXv 1/2] XvQueryPortAttributes: add a comment explaining memory strategy

Alan Coopersmith alan.coopersmith at oracle.com
Sat Jun 1 20:03:52 PDT 2013


Signed-off-by: Alan Coopersmith <alan.coopersmith at oracle.com>
---
 src/Xv.c |   11 +++++++++++
 1 file changed, 11 insertions(+)

diff --git a/src/Xv.c b/src/Xv.c
index f268f8e..15c0bfd 100644
--- a/src/Xv.c
+++ b/src/Xv.c
@@ -850,6 +850,17 @@ XvQueryPortAttributes(Display *dpy, XvPortID port, int *num)
       return ret;
   }
 
+  /*
+   * X server sends data packed as:
+   *   attribute1, name1, attribute2, name2, ...
+   * We allocate a single buffer large enough to hold them all and
+   * then de-interleave the data so we return it to clients as:
+   *   attribute1, attribute2, ..., name1, name2, ...
+   * so that clients may refer to attributes as a simple array of
+   * structs:  attributes[0], attributes[1], ...
+   * and free it as a single/simple buffer.
+   */
+
   if(rep.num_attributes) {
       unsigned long size;
       /* limit each part to no more than one half the max size */
-- 
1.7.9.2



More information about the xorg-devel mailing list