Commit b0223a7e authored by Anthony Léonard's avatar Anthony Léonard Committed by Andreas Traczyk

fix color channels on macOS

Incorrect condition was leading to bad pixel format conversion before
sending frames to client on macOS (BGR instead of correct RGB).

Change-Id: Ie76a488c4151d00249ed1adb5b0b02e43d2972eb
Reviewed-by: Andreas Traczyk's avatarAndreas Traczyk <andreas.traczyk@savoirfairelinux.com>
parent 7a46d091
......@@ -343,11 +343,12 @@ SinkClient::update(Observable<std::shared_ptr<VideoFrame>>* /*obs*/,
VideoScaler scaler;
const int width = f.width();
const int height = f.height();
#if (defined(__ANDROID__) || (defined(__APPLE__)) && !defined(TARGET_OS_IPHONE))
#if defined(__ANDROID__) || (defined(__APPLE__) && !TARGET_OS_IPHONE)
const int format = VIDEO_PIXFMT_RGBA;
#else
const int format = VIDEO_PIXFMT_BGRA;
#endif
const auto bytes = videoFrameSize(format, width, height);
if (bytes > 0) {
......
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