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

Side by Side Diff: webrtc/media/devices/gtkvideorenderer.cc

Issue 2287233002: Delete cricket::VideoFrame::ConvertToRgbBuffer. (Closed)
Patch Set: Rebase. Created 4 years, 3 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 unified diff | Download patch
« no previous file with comments | « webrtc/media/devices/gdivideorenderer.cc ('k') | webrtc/media/engine/webrtcvideoframe.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 /* 1 /*
2 * Copyright (c) 2004 The WebRTC project authors. All Rights Reserved. 2 * Copyright (c) 2004 The WebRTC project authors. All Rights Reserved.
3 * 3 *
4 * Use of this source code is governed by a BSD-style license 4 * Use of this source code is governed by a BSD-style license
5 * that can be found in the LICENSE file in the root of the source 5 * that can be found in the LICENSE file in the root of the source
6 * tree. An additional intellectual property rights grant can be found 6 * tree. An additional intellectual property rights grant can be found
7 * in the file PATENTS. All contributing project authors may 7 * in the file PATENTS. All contributing project authors may
8 * be found in the AUTHORS file in the root of the source tree. 8 * be found in the AUTHORS file in the root of the source tree.
9 */ 9 */
10 10
11 // Implementation of GtkVideoRenderer 11 // Implementation of GtkVideoRenderer
12 12
13 #include "webrtc/media/devices/gtkvideorenderer.h" 13 #include "webrtc/media/devices/gtkvideorenderer.h"
14 14
15 #include <gdk/gdk.h> 15 #include <gdk/gdk.h>
16 #include <glib.h> 16 #include <glib.h>
17 #include <gtk/gtk.h> 17 #include <gtk/gtk.h>
18 18
19 #include "webrtc/media/base/videocommon.h" 19 #include "libyuv/convert_argb.h"
20 #include "webrtc/media/engine/webrtcvideoframe.h" 20 #include "webrtc/media/engine/webrtcvideoframe.h"
21 21
22 namespace cricket { 22 namespace cricket {
23 23
24 class ScopedGdkLock { 24 class ScopedGdkLock {
25 public: 25 public:
26 ScopedGdkLock() { 26 ScopedGdkLock() {
27 gdk_threads_enter(); 27 gdk_threads_enter();
28 } 28 }
29 29
(...skipping 55 matching lines...) Expand 10 before | Expand all | Expand 10 after
85 webrtc::I420Buffer::Rotate(video_frame.video_frame_buffer(), 85 webrtc::I420Buffer::Rotate(video_frame.video_frame_buffer(),
86 video_frame.rotation()), 86 video_frame.rotation()),
87 webrtc::kVideoRotation_0, video_frame.timestamp_us()); 87 webrtc::kVideoRotation_0, video_frame.timestamp_us());
88 88
89 // Need to set size as the frame might be rotated. 89 // Need to set size as the frame might be rotated.
90 if (!SetSize(frame.width(), frame.height())) { 90 if (!SetSize(frame.width(), frame.height())) {
91 return; 91 return;
92 } 92 }
93 93
94 // convert I420 frame to ABGR format, which is accepted by GTK 94 // convert I420 frame to ABGR format, which is accepted by GTK
95 frame.ConvertToRgbBuffer(cricket::FOURCC_ABGR, 95 rtc::scoped_refptr<webrtc::VideoFrameBuffer> buffer(
96 image_.get(), 96 frame.video_frame_buffer());
97 static_cast<size_t>(frame.width()) * 97 libyuv::I420ToARGB(buffer->DataY(), buffer->StrideY(),
98 frame.height() * 4, 98 buffer->DataU(), buffer->StrideU(),
99 frame.width() * 4); 99 buffer->DataV(), buffer->StrideV(),
100 image_.get(), frame.width() * 4,
101 buffer->width(), buffer->height());
100 102
101 ScopedGdkLock lock; 103 ScopedGdkLock lock;
102 104
103 if (IsClosed()) { 105 if (IsClosed()) {
104 return; 106 return;
105 } 107 }
106 108
107 // draw the ABGR image 109 // draw the ABGR image
108 gdk_draw_rgb_32_image(draw_area_->window, 110 gdk_draw_rgb_32_image(draw_area_->window,
109 draw_area_->style->fg_gc[GTK_STATE_NORMAL], 111 draw_area_->style->fg_gc[GTK_STATE_NORMAL],
(...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after
152 } 154 }
153 155
154 if (!GTK_IS_WINDOW(window_) || !GTK_IS_DRAWING_AREA(draw_area_)) { 156 if (!GTK_IS_WINDOW(window_) || !GTK_IS_DRAWING_AREA(draw_area_)) {
155 return true; 157 return true;
156 } 158 }
157 159
158 return false; 160 return false;
159 } 161 }
160 162
161 } // namespace cricket 163 } // namespace cricket
OLDNEW
« no previous file with comments | « webrtc/media/devices/gdivideorenderer.cc ('k') | webrtc/media/engine/webrtcvideoframe.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698