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

Unified Diff: webrtc/examples/peerconnection/client/linux/main_wnd.cc

Issue 2287233002: Delete cricket::VideoFrame::ConvertToRgbBuffer. (Closed)
Patch Set: Convert non-linux renderers. Created 4 years, 4 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: webrtc/examples/peerconnection/client/linux/main_wnd.cc
diff --git a/webrtc/examples/peerconnection/client/linux/main_wnd.cc b/webrtc/examples/peerconnection/client/linux/main_wnd.cc
index e2ed0085e08fa220380606e09e83ea7b96db3ff4..b6307399d9a169522abba5c4125f86472ab497e7 100644
--- a/webrtc/examples/peerconnection/client/linux/main_wnd.cc
+++ b/webrtc/examples/peerconnection/client/linux/main_wnd.cc
@@ -14,6 +14,7 @@
#include <gtk/gtk.h>
#include <stddef.h>
+#include "libyuv/convert_from.h"
#include "webrtc/examples/peerconnection/client/defaults.h"
#include "webrtc/base/common.h"
#include "webrtc/base/logging.h"
@@ -489,11 +490,17 @@ void GtkMainWnd::VideoRenderer::OnFrame(
SetSize(frame->width(), frame->height());
int size = width_ * height_ * 4;
+
// TODO(henrike): Convert directly to RGBA
perkj_webrtc 2016/08/30 07:13:39 Did you check if there is a RGBA convert in libyuv
nisse-webrtc 2016/08/30 07:46:07 There is, it seems. One could also call I420ToRGBA
- frame->ConvertToRgbBuffer(cricket::FOURCC_ARGB,
- image_.get(),
- size,
- width_ * 4);
+ rtc::scoped_refptr<webrtc::VideoFrameBuffer> buffer(
+ frame->video_frame_buffer());
+ libyuv::ConvertFromI420(buffer->DataY(), buffer->StrideY(),
+ buffer->DataU(), buffer->StrideU(),
+ buffer->DataV(), buffer->StrideV(),
+ image_.get(), width_ * 4,
+ buffer->width(), buffer->height(),
+ cricket::FOURCC_ARGB);
perkj_webrtc 2016/08/30 07:13:39 use libyuv type not cricket::FOURCC_...
+
// Convert the B,G,R,A frame to R,G,B,A, which is accepted by GTK.
// The 'A' is just padding for GTK, so we can use it as temp.
uint8_t* pix = image_.get();

Powered by Google App Engine
This is Rietveld 408576698