Skip to content

Commit

Permalink
[GStreamer] Optimize the GstGL no color conversion case on WPE
Browse files Browse the repository at this point in the history
  • Loading branch information
eocanha committed Nov 22, 2017
1 parent d5a3de1 commit 6c53a5e
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 1 deletion.
Expand Up @@ -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
Expand Down
Expand Up @@ -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;
Expand Down
Expand Up @@ -35,6 +35,7 @@ class ImageOrientation;
class VideoTextureCopierGStreamer {
public:
enum class ColorConversion {
AlreadyRGBA,
ConvertBGRAToRGBA,
ConvertARGBToRGBA
};
Expand Down

0 comments on commit 6c53a5e

Please sign in to comment.