Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(847)

Unified Diff: media/base/yuv_convert.cc

Issue 10075001: add more color formats NV21 and YV12 in video capture (mainly from Android). (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: Created 8 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: media/base/yuv_convert.cc
===================================================================
--- media/base/yuv_convert.cc (revision 132018)
+++ media/base/yuv_convert.cc (working copy)
@@ -508,6 +508,23 @@
}
}
+void ConvertNV21ToYUV(const uint8* src,
+ uint8* yplane,
+ uint8* uplane,
+ uint8* vplane,
+ int width,
+ int height) {
+ int y_plane_size = width * height;
+ memcpy(yplane, src, y_plane_size);
+
+ src += y_plane_size;
+ int u_plane_size = y_plane_size >> 2;
+ for (int i = 0; i < u_plane_size; ++i) {
+ *vplane++ = *src++;
+ *uplane++ = *src++;
+ }
+}
+
void ConvertYUVToRGB32(const uint8* yplane,
const uint8* uplane,
const uint8* vplane,

Powered by Google App Engine
This is Rietveld 408576698