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

Unified Diff: content/browser/renderer_host/media/video_capture_controller.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
« no previous file with comments | « no previous file | media/base/yuv_convert.h » ('j') | media/base/yuv_convert.h » ('J')
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/browser/renderer_host/media/video_capture_controller.cc
===================================================================
--- content/browser/renderer_host/media/video_capture_controller.cc (revision 132018)
+++ content/browser/renderer_host/media/video_capture_controller.cc (working copy)
@@ -294,6 +294,20 @@
memcpy(target, data, (frame_info_.width * frame_info_.height * 3) / 2);
break;
}
+ case media::VideoCaptureDevice::kYV12: {
+ const uint8* ptr = data;
+ memcpy(yplane, ptr, (frame_info_.width * frame_info_.height));
+ ptr += frame_info_.width * frame_info_.height;
+ memcpy(vplane, ptr, (frame_info_.width * frame_info_.height) >> 2);
+ ptr += (frame_info_.width * frame_info_.height) >> 2;
+ memcpy(uplane, ptr, (frame_info_.width * frame_info_.height) >> 2);
+ break;
+ }
+ case media::VideoCaptureDevice::kNV21: {
+ media::ConvertNV21ToYUV(data, yplane, uplane, vplane, frame_info_.width,
+ frame_info_.height);
+ break;
+ }
case media::VideoCaptureDevice::kYUY2: {
media::ConvertYUY2ToYUV(data, yplane, uplane, vplane, frame_info_.width,
frame_info_.height);
« no previous file with comments | « no previous file | media/base/yuv_convert.h » ('j') | media/base/yuv_convert.h » ('J')

Powered by Google App Engine
This is Rietveld 408576698