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

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

Issue 1227383003: Remove memset from VideoFrame and mark buffer as unpoisoned (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: dalecurtis@ comments. Created 5 years, 5 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
OLDNEW
1 // Copyright (c) 2013 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2013 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/video_destination_handler.h" 5 #include "content/renderer/media/webrtc/video_destination_handler.h"
6 6
7 #include <string> 7 #include <string>
8 8
9 #include "base/base64.h" 9 #include "base/base64.h"
10 #include "base/logging.h" 10 #include "base/logging.h"
(...skipping 126 matching lines...) Expand 10 before | Expand all | Expand 10 after
137 DCHECK(image_data->format() == PP_IMAGEDATAFORMAT_BGRA_PREMUL); 137 DCHECK(image_data->format() == PP_IMAGEDATAFORMAT_BGRA_PREMUL);
138 138
139 const gfx::Size frame_size(width, height); 139 const gfx::Size frame_size(width, height);
140 140
141 if (state() != MediaStreamVideoSource::STARTED) 141 if (state() != MediaStreamVideoSource::STARTED)
142 return; 142 return;
143 143
144 const base::TimeDelta timestamp = base::TimeDelta::FromMicroseconds( 144 const base::TimeDelta timestamp = base::TimeDelta::FromMicroseconds(
145 time_stamp_ns / base::Time::kNanosecondsPerMicrosecond); 145 time_stamp_ns / base::Time::kNanosecondsPerMicrosecond);
146 146
147 scoped_refptr<media::VideoFrame> new_frame = 147 scoped_refptr<media::VideoFrame> new_frame = frame_pool_.CreateFrame(
148 frame_pool_.CreateFrame(media::VideoFrame::YV12, frame_size, 148 media::VideoFrame::YV12, frame_size, gfx::Rect(frame_size), frame_size,
149 gfx::Rect(frame_size), frame_size, timestamp); 149 timestamp, false);
150 150
151 libyuv::ARGBToI420(src_data, 151 libyuv::ARGBToI420(src_data,
152 src_stride, 152 src_stride,
153 new_frame->data(media::VideoFrame::kYPlane), 153 new_frame->data(media::VideoFrame::kYPlane),
154 new_frame->stride(media::VideoFrame::kYPlane), 154 new_frame->stride(media::VideoFrame::kYPlane),
155 new_frame->data(media::VideoFrame::kUPlane), 155 new_frame->data(media::VideoFrame::kUPlane),
156 new_frame->stride(media::VideoFrame::kUPlane), 156 new_frame->stride(media::VideoFrame::kUPlane),
157 new_frame->data(media::VideoFrame::kVPlane), 157 new_frame->data(media::VideoFrame::kVPlane),
158 new_frame->stride(media::VideoFrame::kVPlane), 158 new_frame->stride(media::VideoFrame::kVPlane),
159 width, 159 width,
(...skipping 67 matching lines...) Expand 10 before | Expand all | Expand 10 after
227 227
228 stream.addTrack(MediaStreamVideoTrack::CreateVideoTrack( 228 stream.addTrack(MediaStreamVideoTrack::CreateVideoTrack(
229 writer, constraints, MediaStreamVideoSource::ConstraintsCallback(), 229 writer, constraints, MediaStreamVideoSource::ConstraintsCallback(),
230 track_enabled)); 230 track_enabled));
231 231
232 *frame_writer = new PpFrameWriterProxy(writer->AsWeakPtr()); 232 *frame_writer = new PpFrameWriterProxy(writer->AsWeakPtr());
233 return true; 233 return true;
234 } 234 }
235 235
236 } // namespace content 236 } // namespace content
OLDNEW
« no previous file with comments | « no previous file | content/renderer/media/webrtc/webrtc_video_capturer_adapter.cc » ('j') | media/base/video_frame_pool.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698