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

Side by Side Diff: media/cast/sender/video_sender.cc

Issue 1955233002: Revert of Memory copy the VideoFrame to match the requirement for HW encoders. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 7 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 | « media/cast/sender/size_adaptable_video_encoder_base.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 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 "media/cast/sender/video_sender.h" 5 #include "media/cast/sender/video_sender.h"
6 6
7 #include <stdint.h> 7 #include <stdint.h>
8 #include <algorithm> 8 #include <algorithm>
9 #include <cmath> 9 #include <cmath>
10 #include <cstring> 10 #include <cstring>
(...skipping 308 matching lines...) Expand 10 before | Expand all | Expand 10 after
319 319
320 void VideoSender::OnEncodedVideoFrame( 320 void VideoSender::OnEncodedVideoFrame(
321 const scoped_refptr<media::VideoFrame>& video_frame, 321 const scoped_refptr<media::VideoFrame>& video_frame,
322 int encoder_bitrate, 322 int encoder_bitrate,
323 std::unique_ptr<SenderEncodedFrame> encoded_frame) { 323 std::unique_ptr<SenderEncodedFrame> encoded_frame) {
324 DCHECK(cast_environment_->CurrentlyOn(CastEnvironment::MAIN)); 324 DCHECK(cast_environment_->CurrentlyOn(CastEnvironment::MAIN));
325 325
326 frames_in_encoder_--; 326 frames_in_encoder_--;
327 DCHECK_GE(frames_in_encoder_, 0); 327 DCHECK_GE(frames_in_encoder_, 0);
328 328
329 // Encoding was exited with errors.
330 if (!encoded_frame)
331 return;
332
333 duration_in_encoder_ = 329 duration_in_encoder_ =
334 last_enqueued_frame_reference_time_ - encoded_frame->reference_time; 330 last_enqueued_frame_reference_time_ - encoded_frame->reference_time;
335 331
336 last_reported_deadline_utilization_ = encoded_frame->deadline_utilization; 332 last_reported_deadline_utilization_ = encoded_frame->deadline_utilization;
337 last_reported_lossy_utilization_ = encoded_frame->lossy_utilization; 333 last_reported_lossy_utilization_ = encoded_frame->lossy_utilization;
338 334
339 TRACE_EVENT_ASYNC_END2("cast.stream", "Video Encode", video_frame.get(), 335 TRACE_EVENT_ASYNC_END2("cast.stream", "Video Encode", video_frame.get(),
340 "deadline_utilization", last_reported_deadline_utilization_, 336 "deadline_utilization", last_reported_deadline_utilization_,
341 "lossy_utilization", last_reported_lossy_utilization_); 337 "lossy_utilization", last_reported_lossy_utilization_);
342 338
(...skipping 12 matching lines...) Expand all
355 media::VideoFrameMetadata::RESOURCE_UTILIZATION, 351 media::VideoFrameMetadata::RESOURCE_UTILIZATION,
356 encoded_frame->dependency == EncodedFrame::KEY ? 352 encoded_frame->dependency == EncodedFrame::KEY ?
357 std::min(1.0, attenuated_utilization) : attenuated_utilization); 353 std::min(1.0, attenuated_utilization) : attenuated_utilization);
358 } 354 }
359 355
360 SendEncodedFrame(encoder_bitrate, std::move(encoded_frame)); 356 SendEncodedFrame(encoder_bitrate, std::move(encoded_frame));
361 } 357 }
362 358
363 } // namespace cast 359 } // namespace cast
364 } // namespace media 360 } // namespace media
OLDNEW
« no previous file with comments | « media/cast/sender/size_adaptable_video_encoder_base.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698