The open source OpenXR runtime
0
fork

Configure Feed

Select the types of activity you want to include in your feed.

a/util: Support yuyv422 images in u_sink_combiner

Part-of: <https://gitlab.freedesktop.org/monado/monado/-/merge_requests/2457>

authored by

Beyley Cardellio and committed by
Marge Bot
b2836371 4b38d313

+28 -1
+28 -1
src/xrt/auxiliary/util/u_sink_combiner.c
··· 98 98 } 99 99 100 100 static void 101 + combine_frames_yuyv422(struct xrt_frame *l, struct xrt_frame *r, struct xrt_frame *f) 102 + { 103 + SINK_TRACE_MARKER(); 104 + 105 + uint32_t height = l->height; 106 + 107 + for (uint32_t y = 0; y < height; y++) { 108 + uint8_t *dst = f->data + f->stride * y; 109 + uint8_t *src = l->data + l->stride * y; 110 + 111 + for (uint32_t x = 0; x < l->width * 2; x++) { 112 + *dst++ = *src++; 113 + } 114 + 115 + dst = f->data + f->stride * y + l->width * 2; 116 + src = r->data + r->stride * y; 117 + for (uint32_t x = 0; x < r->width * 2; x++) { 118 + *dst++ = *src++; 119 + } 120 + } 121 + } 122 + 123 + static void 101 124 combine_frames(struct xrt_frame *l, struct xrt_frame *r, struct xrt_frame **out_frame) 102 125 { 103 126 SINK_TRACE_MARKER(); ··· 105 128 assert(l->width == r->width); 106 129 assert(l->height == r->height); 107 130 assert(l->format == r->format); 108 - assert((l->format == XRT_FORMAT_L8) || (l->format == XRT_FORMAT_R8G8B8)); 131 + assert((l->format == XRT_FORMAT_L8) || (l->format == XRT_FORMAT_R8G8B8) || (l->format == XRT_FORMAT_YUYV422)); 109 132 110 133 int64_t diff_ns = l->timestamp - r->timestamp; 111 134 uint32_t height = l->height; ··· 120 143 f->source_sequence = l->source_sequence; 121 144 122 145 switch (l->format) { 146 + case XRT_FORMAT_YUYV422: { 147 + combine_frames_yuyv422(l, r, f); 148 + break; 149 + } 123 150 case XRT_FORMAT_L8: { 124 151 combine_frames_l8(l, r, f); 125 152 break;