mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2024-12-22 00:06:36 +00:00
gl/format: fix swizzle indices for RGB10A2/BGR10A2
Fixes: https://gitlab.freedesktop.org/gstreamer/gstreamer/-/issues/3003 Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/5400>
This commit is contained in:
parent
47dbdea469
commit
237d195209
1 changed files with 15 additions and 0 deletions
|
@ -493,6 +493,21 @@ get_single_planar_format_gl_swizzle_order (GstVideoFormat format,
|
|||
g_return_if_fail (finfo->flags & GST_VIDEO_FORMAT_FLAG_RGB
|
||||
|| format == GST_VIDEO_FORMAT_AYUV || format == GST_VIDEO_FORMAT_VUYA);
|
||||
|
||||
if (format == GST_VIDEO_FORMAT_BGR10A2_LE) {
|
||||
swizzle[0] = 2;
|
||||
swizzle[1] = 1;
|
||||
swizzle[2] = 0;
|
||||
swizzle[3] = 3;
|
||||
return;
|
||||
}
|
||||
if (format == GST_VIDEO_FORMAT_RGB10A2_LE) {
|
||||
swizzle[0] = 0;
|
||||
swizzle[1] = 1;
|
||||
swizzle[2] = 2;
|
||||
swizzle[3] = 3;
|
||||
return;
|
||||
}
|
||||
|
||||
for (i = 0; i < finfo->n_components; i++) {
|
||||
swizzle[c_i++] = finfo->poffset[i] / (GST_ROUND_UP_8 (finfo->bits) / 8);
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue