Commit d1206cae authored by fbarchard@google.com's avatar fbarchard@google.com

Apple uses 'BGRA' to mean 'ARGB', so map this on Apple machines.

BUG=229
TESTED=untested
R=tpsiaki@google.com

Review URL: https://webrtc-codereview.appspot.com/6459005

git-svn-id: http://libyuv.googlecode.com/svn/trunk@934 16f28f9a-4ce2-e073-06de-1de4eb20be90
parent 48ab3cf3
Name: libyuv
URL: http://code.google.com/p/libyuv/
Version: 933
Version: 934
License: BSD
License File: LICENSE
......
......@@ -11,6 +11,6 @@
#ifndef INCLUDE_LIBYUV_VERSION_H_ // NOLINT
#define INCLUDE_LIBYUV_VERSION_H_
#define LIBYUV_VERSION 933
#define LIBYUV_VERSION 934
#endif // INCLUDE_LIBYUV_VERSION_H_ NOLINT
......@@ -28,16 +28,19 @@ static const FourCCAliasEntry kFourCCAliases[] = {
{FOURCC_YU16, FOURCC_I422},
{FOURCC_YU24, FOURCC_I444},
{FOURCC_YUYV, FOURCC_YUY2},
{FOURCC_YUVS, FOURCC_YUY2},
{FOURCC_YUVS, FOURCC_YUY2}, // kCMPixelFormat_422YpCbCr8_yuvs
{FOURCC_HDYC, FOURCC_UYVY},
{FOURCC_2VUY, FOURCC_UYVY},
{FOURCC_2VUY, FOURCC_UYVY}, // kCMPixelFormat_422YpCbCr8
{FOURCC_JPEG, FOURCC_MJPG}, // Note: JPEG has DHT while MJPG does not.
{FOURCC_DMB1, FOURCC_MJPG},
{FOURCC_BA81, FOURCC_BGGR},
{FOURCC_RGB3, FOURCC_RAW},
{FOURCC_RGB3, FOURCC_RAW },
{FOURCC_BGR3, FOURCC_24BG},
{FOURCC_CM32, FOURCC_BGRA},
{FOURCC_CM24, FOURCC_RAW},
{FOURCC_CM32, FOURCC_BGRA}, // kCMPixelFormat_32ARGB
{FOURCC_CM24, FOURCC_RAW }, // kCMPixelFormat_24RGB
#if defined(__APPLE__)
{FOURCC_BGRA, FOURCC_ARGB}, // kCMPixelFormat_32BGRA
#endif
};
LIBYUV_API
......
......@@ -52,10 +52,15 @@ TEST_F(libyuvTest, TestCanonicalFourCC) {
EXPECT_EQ(FOURCC_MJPG, CanonicalFourCC(FOURCC_JPEG));
EXPECT_EQ(FOURCC_MJPG, CanonicalFourCC(FOURCC_DMB1));
EXPECT_EQ(FOURCC_BGGR, CanonicalFourCC(FOURCC_BA81));
EXPECT_EQ(FOURCC_RAW, CanonicalFourCC(FOURCC_RGB3));
EXPECT_EQ(FOURCC_RAW, CanonicalFourCC(FOURCC_RGB3));
EXPECT_EQ(FOURCC_24BG, CanonicalFourCC(FOURCC_BGR3));
EXPECT_EQ(FOURCC_BGRA, CanonicalFourCC(FOURCC_CM32));
EXPECT_EQ(FOURCC_RAW, CanonicalFourCC(FOURCC_CM24));
EXPECT_EQ(FOURCC_RAW, CanonicalFourCC(FOURCC_CM24));
#if defined(__APPLE__)
EXPECT_EQ(FOURCC_ARGB, CanonicalFourCC(FOURCC_BGRA));
#else
EXPECT_EQ(FOURCC_BGRA, CanonicalFourCC(FOURCC_BGRA));
#endif
}
TEST_F(libyuvTest, TestFourCC) {
......@@ -75,7 +80,7 @@ TEST_F(libyuvTest, TestFourCC) {
EXPECT_TRUE(TestValidFourCC(FOURCC_BGRA, FOURCC_BPP_BGRA));
EXPECT_TRUE(TestValidFourCC(FOURCC_ABGR, FOURCC_BPP_ABGR));
EXPECT_TRUE(TestValidFourCC(FOURCC_24BG, FOURCC_BPP_24BG));
EXPECT_TRUE(TestValidFourCC(FOURCC_RAW, FOURCC_BPP_RAW));
EXPECT_TRUE(TestValidFourCC(FOURCC_RAW, FOURCC_BPP_RAW));
EXPECT_TRUE(TestValidFourCC(FOURCC_RGBA, FOURCC_BPP_RGBA));
EXPECT_TRUE(TestValidFourCC(FOURCC_RGBP, FOURCC_BPP_RGBP));
EXPECT_TRUE(TestValidFourCC(FOURCC_RGBO, FOURCC_BPP_RGBO));
......@@ -102,7 +107,7 @@ TEST_F(libyuvTest, TestFourCC) {
EXPECT_TRUE(TestValidFourCC(FOURCC_RGB3, FOURCC_BPP_RGB3));
EXPECT_TRUE(TestValidFourCC(FOURCC_BGR3, FOURCC_BPP_BGR3));
EXPECT_TRUE(TestValidFourCC(FOURCC_H264, FOURCC_BPP_H264));
EXPECT_TRUE(TestValidFourCC(FOURCC_ANY, FOURCC_BPP_ANY));
EXPECT_TRUE(TestValidFourCC(FOURCC_ANY, FOURCC_BPP_ANY));
}
} // namespace libyuv
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment