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

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

Issue 526173003: Change VideoTrackAdapter to not drop frames if the source frame rate is known. Also change remote v… (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@2125
Patch Set: Created 6 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 | « content/renderer/media/webrtc/media_stream_remote_video_source.cc ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 128 matching lines...) Expand 10 before | Expand all | Expand 10 after
139 139
140 // TODO(perkj): It would be more efficient to use I420 here. Using YV12 will 140 // TODO(perkj): It would be more efficient to use I420 here. Using YV12 will
141 // force a copy into a tightly packed I420 frame in 141 // force a copy into a tightly packed I420 frame in
142 // WebRtcVideoCapturerAdapter before the frame is delivered to libJingle. 142 // WebRtcVideoCapturerAdapter before the frame is delivered to libJingle.
143 // crbug/359587. 143 // crbug/359587.
144 scoped_refptr<media::VideoFrame> new_frame = 144 scoped_refptr<media::VideoFrame> new_frame =
145 frame_pool_.CreateFrame(media::VideoFrame::YV12, frame_size, 145 frame_pool_.CreateFrame(media::VideoFrame::YV12, frame_size,
146 gfx::Rect(frame_size), frame_size, timestamp); 146 gfx::Rect(frame_size), frame_size, timestamp);
147 media::VideoCaptureFormat format( 147 media::VideoCaptureFormat format(
148 frame_size, 148 frame_size,
149 MediaStreamVideoSource::kDefaultFrameRate, 149 MediaStreamVideoSource::kUnknownFrameRate,
150 media::PIXEL_FORMAT_YV12); 150 media::PIXEL_FORMAT_YV12);
151 151
152 libyuv::BGRAToI420(reinterpret_cast<uint8*>(bitmap->getPixels()), 152 libyuv::BGRAToI420(reinterpret_cast<uint8*>(bitmap->getPixels()),
153 bitmap->rowBytes(), 153 bitmap->rowBytes(),
154 new_frame->data(media::VideoFrame::kYPlane), 154 new_frame->data(media::VideoFrame::kYPlane),
155 new_frame->stride(media::VideoFrame::kYPlane), 155 new_frame->stride(media::VideoFrame::kYPlane),
156 new_frame->data(media::VideoFrame::kUPlane), 156 new_frame->data(media::VideoFrame::kUPlane),
157 new_frame->stride(media::VideoFrame::kUPlane), 157 new_frame->stride(media::VideoFrame::kUPlane),
158 new_frame->data(media::VideoFrame::kVPlane), 158 new_frame->data(media::VideoFrame::kVPlane),
159 new_frame->stride(media::VideoFrame::kVPlane), 159 new_frame->stride(media::VideoFrame::kVPlane),
(...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 | « content/renderer/media/webrtc/media_stream_remote_video_source.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698