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

Side by Side Diff: content/renderer/media/webrtc/media_stream_remote_video_source.cc

Issue 258663003: Use texture-backed VideoFrame pipeline for Aura desktop capturing. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Fix a DCHECK failure in base::Bind. Created 6 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 unified diff | Download patch | Annotate | Revision Log
OLDNEW
1 // Copyright 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "content/renderer/media/webrtc/media_stream_remote_video_source.h" 5 #include "content/renderer/media/webrtc/media_stream_remote_video_source.h"
6 6
7 #include "base/bind.h" 7 #include "base/bind.h"
8 #include "base/location.h" 8 #include "base/location.h"
9 #include "base/message_loop/message_loop_proxy.h" 9 #include "base/message_loop/message_loop_proxy.h"
10 #include "content/renderer/media/native_handle_impl.h" 10 #include "content/renderer/media/native_handle_impl.h"
(...skipping 46 matching lines...) Expand 10 before | Expand all | Expand 10 after
57 void MediaStreamRemoteVideoSource::SetSize(int width, int height) { 57 void MediaStreamRemoteVideoSource::SetSize(int width, int height) {
58 } 58 }
59 59
60 void MediaStreamRemoteVideoSource::RenderFrame( 60 void MediaStreamRemoteVideoSource::RenderFrame(
61 const cricket::VideoFrame* frame) { 61 const cricket::VideoFrame* frame) {
62 base::TimeDelta timestamp = base::TimeDelta::FromMilliseconds( 62 base::TimeDelta timestamp = base::TimeDelta::FromMilliseconds(
63 frame->GetTimeStamp() / talk_base::kNumNanosecsPerMillisec); 63 frame->GetTimeStamp() / talk_base::kNumNanosecsPerMillisec);
64 64
65 scoped_refptr<media::VideoFrame> video_frame; 65 scoped_refptr<media::VideoFrame> video_frame;
66 if (frame->GetNativeHandle() != NULL) { 66 if (frame->GetNativeHandle() != NULL) {
67 NativeHandleImpl* handle = 67 video_frame = static_cast<media::VideoFrame*>(frame->GetNativeHandle());
Ami GONE FROM CHROMIUM 2014/04/30 03:03:43 urr, wat? What happened in this thunk?
hshi1 2014/04/30 18:05:19 I actually don't think this change is correct, we
68 static_cast<NativeHandleImpl*>(frame->GetNativeHandle());
69 video_frame = static_cast<media::VideoFrame*>(handle->GetHandle());
70 video_frame->set_timestamp(timestamp); 68 video_frame->set_timestamp(timestamp);
71 } else { 69 } else {
72 gfx::Size size(frame->GetWidth(), frame->GetHeight()); 70 gfx::Size size(frame->GetWidth(), frame->GetHeight());
73 video_frame = frame_pool_.CreateFrame( 71 video_frame = frame_pool_.CreateFrame(
74 media::VideoFrame::YV12, size, gfx::Rect(size), size, timestamp); 72 media::VideoFrame::YV12, size, gfx::Rect(size), size, timestamp);
75 73
76 // Non-square pixels are unsupported. 74 // Non-square pixels are unsupported.
77 DCHECK_EQ(frame->GetPixelWidth(), 1u); 75 DCHECK_EQ(frame->GetPixelWidth(), 1u);
78 DCHECK_EQ(frame->GetPixelHeight(), 1u); 76 DCHECK_EQ(frame->GetPixelHeight(), 1u);
79 77
(...skipping 66 matching lines...) Expand 10 before | Expand all | Expand 10 after
146 } 144 }
147 145
148 void MediaStreamRemoteVideoSource::DoRenderFrameOnMainThread( 146 void MediaStreamRemoteVideoSource::DoRenderFrameOnMainThread(
149 scoped_refptr<media::VideoFrame> video_frame) { 147 scoped_refptr<media::VideoFrame> video_frame) {
150 DCHECK(message_loop_proxy_->BelongsToCurrentThread()); 148 DCHECK(message_loop_proxy_->BelongsToCurrentThread());
151 if (state() == STARTED) 149 if (state() == STARTED)
152 DeliverVideoFrame(video_frame); 150 DeliverVideoFrame(video_frame);
153 } 151 }
154 152
155 } // namespace content 153 } // namespace content
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698