- bpp = am7xxxsink->varinfo.bits_per_pixel;
-
- rmask = ((1 << am7xxxsink->varinfo.red.length) - 1)
- << am7xxxsink->varinfo.red.offset;
- gmask = ((1 << am7xxxsink->varinfo.green.length) - 1)
- << am7xxxsink->varinfo.green.offset;
- bmask = ((1 << am7xxxsink->varinfo.blue.length) - 1)
- << am7xxxsink->varinfo.blue.offset;
- tmask = ((1 << am7xxxsink->varinfo.transp.length) - 1)
- << am7xxxsink->varinfo.transp.offset;
-
- depth = am7xxxsink->varinfo.red.length + am7xxxsink->varinfo.green.length
- + am7xxxsink->varinfo.blue.length;
-
- switch (am7xxxsink->varinfo.bits_per_pixel) {
- case 32:
- /* swap endianness of masks */
- rmask = GUINT32_SWAP_LE_BE (rmask);
- gmask = GUINT32_SWAP_LE_BE (gmask);
- bmask = GUINT32_SWAP_LE_BE (bmask);
- tmask = GUINT32_SWAP_LE_BE (tmask);
- depth += am7xxxsink->varinfo.transp.length;
- endianness = G_BIG_ENDIAN;
- break;
- case 24:{
- /* swap red and blue masks */
- tmask = rmask;
- rmask = bmask;
- bmask = tmask;
- tmask = 0;
- endianness = G_BIG_ENDIAN;
- break;
- }
- case 15:
- case 16:
- tmask = 0;
- endianness = G_LITTLE_ENDIAN;
- break;
- default:
- goto unsupported_bpp;
- }
-
- format = gst_video_format_from_masks (depth, bpp, endianness, rmask, gmask,
- bmask, tmask);
-
- if (format == GST_VIDEO_FORMAT_UNKNOWN)
- goto unknown_format;
-