summaryrefslogtreecommitdiffstats
path: root/remoting/base
diff options
context:
space:
mode:
Diffstat (limited to 'remoting/base')
-rw-r--r--remoting/base/util.cc22
-rw-r--r--remoting/base/util.h13
-rw-r--r--remoting/base/util_unittest.cc22
3 files changed, 11 insertions, 46 deletions
diff --git a/remoting/base/util.cc b/remoting/base/util.cc
index 8102cb9..6ee8548 100644
--- a/remoting/base/util.cc
+++ b/remoting/base/util.cc
@@ -45,28 +45,6 @@ int CalculateUVOffset(int x, int y, int stride) {
return stride * y / 2 + x / 2;
}
-void ConvertRGB32ToYUVWithRect(const uint8* rgb_plane,
- uint8* y_plane,
- uint8* u_plane,
- uint8* v_plane,
- int x,
- int y,
- int width,
- int height,
- int rgb_stride,
- int y_stride,
- int uv_stride) {
- int rgb_offset = CalculateRGBOffset(x, y, rgb_stride);
- int y_offset = CalculateYOffset(x, y, y_stride);
- int uv_offset = CalculateUVOffset(x, y, uv_stride);;
-
- libyuv::ARGBToI420(rgb_plane + rgb_offset, rgb_stride,
- y_plane + y_offset, y_stride,
- u_plane + uv_offset, uv_stride,
- v_plane + uv_offset, uv_stride,
- width, height);
-}
-
void ConvertAndScaleYUVToRGB32Rect(
const uint8* source_yplane,
const uint8* source_uplane,
diff --git a/remoting/base/util.h b/remoting/base/util.h
index c8c7021..2546221 100644
--- a/remoting/base/util.h
+++ b/remoting/base/util.h
@@ -50,19 +50,6 @@ void ConvertAndScaleYUVToRGB32Rect(
const webrtc::DesktopRect& dest_buffer_rect,
const webrtc::DesktopRect& dest_rect);
-// Convert RGB32 to YUV on a specific rectangle.
-void ConvertRGB32ToYUVWithRect(const uint8* rgb_plane,
- uint8* y_plane,
- uint8* u_plane,
- uint8* v_plane,
- int x,
- int y,
- int width,
- int height,
- int rgb_stride,
- int y_stride,
- int uv_stride);
-
int RoundToTwosMultiple(int x);
// Align the sides of the rectangle to multiples of 2 (expanding outwards).
diff --git a/remoting/base/util_unittest.cc b/remoting/base/util_unittest.cc
index 28fd1a7..42237f7 100644
--- a/remoting/base/util_unittest.cc
+++ b/remoting/base/util_unittest.cc
@@ -6,6 +6,7 @@
#include "remoting/base/util.h"
#include "testing/gtest/include/gtest/gtest.h"
+#include "third_party/libyuv/include/libyuv/convert_from_argb.h"
#include "third_party/webrtc/modules/desktop_capture/desktop_geometry.h"
static const int kWidth = 32 ;
@@ -91,17 +92,16 @@ class YuvToRgbTester {
FillRgbBuffer(rect);
// RGB -> YUV
- ConvertRGB32ToYUVWithRect(rgb_buffer_.get(),
- yplane_,
- uplane_,
- vplane_,
- 0,
- 0,
- kWidth,
- kHeight,
- kRgbStride,
- kYStride,
- kUvStride);
+ libyuv::ARGBToI420(rgb_buffer_.get(),
+ kRgbStride,
+ yplane_,
+ kYStride,
+ uplane_,
+ kUvStride,
+ vplane_,
+ kUvStride,
+ kWidth,
+ kHeight);
// Reset RGB buffer and do opposite conversion.
ResetRgbBuffer();