Permalink
Browse files

Merge pull request #410 from WebPlatformForEmbedded/eocanha/gstgl-opt…

…imization

[GStreamer] Optimize the GstGL no color conversion case on WPE
  • Loading branch information...
magomez committed Nov 22, 2017
2 parents d5a3de1 + 6c53a5e commit fd30e1377133cd9ddd7646dc84e2bd0e264bb6b4
@@ -61,7 +61,11 @@
#endif
#if USE(GSTREAMER_GL)
#if G_BYTE_ORDER == G_LITTLE_ENDIAN
#if PLATFORM(WPE)
#define GST_GL_CAPS_FORMAT "{ RGBA }"
#define TEXTURE_MAPPER_COLOR_CONVERT_FLAG static_cast<TextureMapperGL::Flag>(0);
#define TEXTURE_COPIER_COLOR_CONVERT_FLAG VideoTextureCopierGStreamer::ColorConversion::AlreadyRGBA
#elif G_BYTE_ORDER == G_LITTLE_ENDIAN)
#define GST_GL_CAPS_FORMAT "{ BGRx, BGRA }"
#define TEXTURE_MAPPER_COLOR_CONVERT_FLAG TextureMapperGL::ShouldConvertTextureBGRAToRGBA
#define TEXTURE_COPIER_COLOR_CONVERT_FLAG VideoTextureCopierGStreamer::ColorConversion::ConvertBGRAToRGBA
@@ -75,6 +75,9 @@ VideoTextureCopierGStreamer::~VideoTextureCopierGStreamer()
void VideoTextureCopierGStreamer::updateColorConversionMatrix(ColorConversion colorConversion)
{
switch (colorConversion) {
case ColorConversion::AlreadyRGBA:
m_colorConversionMatrix.setMatrix(1.0, 0.0, 0.0, 0.0, 0.0, 1.0, 0.0, 0.0, 0.0, 0.0, 1.0, 0.0, 0.0, 0.0, 0.0, 1.0);
break;
case ColorConversion::ConvertBGRAToRGBA:
m_colorConversionMatrix.setMatrix(0.0, 0.0, 1.0, 0.0, 0.0, 1.0, 0.0, 0.0, 1.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 1.0);
break;
@@ -35,6 +35,7 @@ class ImageOrientation;
class VideoTextureCopierGStreamer {
public:
enum class ColorConversion {
AlreadyRGBA,
ConvertBGRAToRGBA,
ConvertARGBToRGBA
};

0 comments on commit fd30e13

Please sign in to comment.