diff options
author | Alan Coopersmith <alan.coopersmith@oracle.com> | 2013-06-01 17:26:11 -0700 |
---|---|---|
committer | Alan Coopersmith <alan.coopersmith@oracle.com> | 2013-06-01 20:03:43 -0700 |
commit | edfb6fc397686c1892603d0f86a9aadf14dbc12e (patch) | |
tree | fd51c05c0580ab769d0925264d2bf19591d94bd0 | |
parent | 179ed259e75a62e74532e36f52f3838deb2aac92 (diff) |
XvQueryPortAttributes: add a comment explaining memory strategy
Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
-rw-r--r-- | src/Xv.c | 11 |
1 files changed, 11 insertions, 0 deletions
@@ -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 */ |