gldownloadelement: fix export of BGR/BGRA textures
GStreamer always stores data in RGBA textures, then uses shaders to
swizzle and convert between formats. When we get a texture GStreamer
says is BGR, it's really an RGB texture as far as the driver is
concerned. If we ask the driver to export it as BGR, driver will
see that source is RGB (according to its internal bookkeeping) and
destination is BGR, so it swizzles B and R. When GStreamer gets the
output intended to be BGR, it's therefore really RGB because it
was swizzled when texture was generated, and then again on export.
Solution is simple; always export the data as RGB/A to get the bytes
exactly as GStreamer stored them in the texture, as they're already in
the correct format.
1 file changed