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

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

Issue 2103043005: media/cast/sender: Rename deadline_utilization to encoder_utilization. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 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
« no previous file with comments | « media/cast/sender/external_video_encoder.cc ('k') | media/cast/sender/frame_sender.cc » ('j') | 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/fake_software_video_encoder.h" 5 #include "media/cast/sender/fake_software_video_encoder.h"
6 6
7 #include <stddef.h> 7 #include <stddef.h>
8 8
9 #include "base/json/json_writer.h" 9 #include "base/json/json_writer.h"
10 #include "base/values.h" 10 #include "base/values.h"
(...skipping 45 matching lines...) Expand 10 before | Expand all | Expand 10 after
56 values.SetBoolean("key", 56 values.SetBoolean("key",
57 encoded_frame->dependency == EncodedFrame::KEY); 57 encoded_frame->dependency == EncodedFrame::KEY);
58 values.SetInteger("ref", encoded_frame->referenced_frame_id.lower_32_bits()); 58 values.SetInteger("ref", encoded_frame->referenced_frame_id.lower_32_bits());
59 values.SetInteger("id", encoded_frame->frame_id.lower_32_bits()); 59 values.SetInteger("id", encoded_frame->frame_id.lower_32_bits());
60 values.SetInteger("size", frame_size_); 60 values.SetInteger("size", frame_size_);
61 base::JSONWriter::Write(values, &encoded_frame->data); 61 base::JSONWriter::Write(values, &encoded_frame->data);
62 encoded_frame->data.resize( 62 encoded_frame->data.resize(
63 std::max<size_t>(encoded_frame->data.size(), frame_size_), ' '); 63 std::max<size_t>(encoded_frame->data.size(), frame_size_), ' ');
64 64
65 if (encoded_frame->dependency == EncodedFrame::KEY) { 65 if (encoded_frame->dependency == EncodedFrame::KEY) {
66 encoded_frame->deadline_utilization = 1.0; 66 encoded_frame->encoder_utilization = 1.0;
67 encoded_frame->lossy_utilization = 6.0; 67 encoded_frame->lossy_utilization = 6.0;
68 } else { 68 } else {
69 encoded_frame->deadline_utilization = 0.8; 69 encoded_frame->encoder_utilization = 0.8;
70 encoded_frame->lossy_utilization = 0.8; 70 encoded_frame->lossy_utilization = 0.8;
71 } 71 }
72 } 72 }
73 73
74 void FakeSoftwareVideoEncoder::UpdateRates(uint32_t new_bitrate) { 74 void FakeSoftwareVideoEncoder::UpdateRates(uint32_t new_bitrate) {
75 frame_size_ = new_bitrate / video_config_.max_frame_rate / 8; 75 frame_size_ = new_bitrate / video_config_.max_frame_rate / 8;
76 } 76 }
77 77
78 void FakeSoftwareVideoEncoder::GenerateKeyFrame() { 78 void FakeSoftwareVideoEncoder::GenerateKeyFrame() {
79 next_frame_is_key_ = true; 79 next_frame_is_key_ = true;
80 } 80 }
81 81
82 } // namespace cast 82 } // namespace cast
83 } // namespace media 83 } // namespace media
84 84
85 #endif 85 #endif
OLDNEW
« no previous file with comments | « media/cast/sender/external_video_encoder.cc ('k') | media/cast/sender/frame_sender.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698