From d61e1cab0888f95d6c56d5eb9d2e39db52b945b6 Mon Sep 17 00:00:00 2001 From: "mikhal@webrtc.org" Date: Wed, 4 Jan 2012 18:57:52 +0000 Subject: [PATCH] Updating video engine following latest libyuv api changes Review URL: http://webrtc-codereview.appspot.com/330026 git-svn-id: http://webrtc.googlecode.com/svn/trunk@1336 4adac7df-926f-26a2-2b94-8c16560cd09d --- src/video_engine/vie_renderer.cc | 43 +++++++++----------------------- 1 file changed, 12 insertions(+), 31 deletions(-) diff --git a/src/video_engine/vie_renderer.cc b/src/video_engine/vie_renderer.cc index d3598c32c..9c0891272 100644 --- a/src/video_engine/vie_renderer.cc +++ b/src/video_engine/vie_renderer.cc @@ -173,43 +173,24 @@ WebRtc_Word32 ViEExternalRendererImpl::RenderFrame( p_converted_frame = &video_frame; break; case kVideoYV12: - converted_frame.VerifyAndAllocate(CalcBufferSize(kYV12, - video_frame.Width(), - video_frame.Height())); - ConvertI420ToYV12(video_frame.Buffer(), converted_frame.Buffer(), - video_frame.Width(), video_frame.Height(), 0); - break; case kVideoYUY2: - converted_frame.VerifyAndAllocate(CalcBufferSize(kYUY2, - video_frame.Width(), - video_frame.Height())); - ConvertI420ToYUY2(video_frame.Buffer(), converted_frame.Buffer(), - video_frame.Width(), video_frame.Height(), 0); - break; case kVideoUYVY: - converted_frame.VerifyAndAllocate(CalcBufferSize(kUYVY, - video_frame.Width(), - video_frame.Height())); - ConvertI420ToUYVY(video_frame.Buffer(), converted_frame.Buffer(), - video_frame.Width(), video_frame.Height(), 0); + case kVideoARGB: + case kVideoRGB24: + { + VideoType type = + RawVideoTypeToCommonVideoVideoType(external_renderer_format_); + converted_frame.VerifyAndAllocate(CalcBufferSize(type, + video_frame.Width(), + video_frame.Height())); + ConvertFromI420(video_frame.Buffer(), video_frame.Width(), type, 0, + video_frame.Width(), video_frame.Height(), + converted_frame.Buffer()); + } break; case kVideoIYUV: // no conversion available break; - case kVideoARGB: - converted_frame.VerifyAndAllocate(CalcBufferSize(kARGB, - video_frame.Width(), - video_frame.Height())); - ConvertI420ToARGB(video_frame.Buffer(), converted_frame.Buffer(), - video_frame.Width(), video_frame.Height(), 0); - break; - case kVideoRGB24: - converted_frame.VerifyAndAllocate(CalcBufferSize(kRGB24, - video_frame.Width(), - video_frame.Height())); - ConvertI420ToRGB24(video_frame.Buffer(), converted_frame.Buffer(), - video_frame.Width(), video_frame.Height()); - break; case kVideoRGB565: converted_frame.VerifyAndAllocate(CalcBufferSize(kRGB565, video_frame.Width(),