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

Unified Diff: media/cast/sender/fake_software_video_encoder.cc

Issue 1148233002: [Cast] Compute utilization metrics and add performance overlay. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Addressed hubbe's comments. Created 5 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « media/cast/sender/fake_software_video_encoder.h ('k') | media/cast/sender/h264_vt_encoder.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: media/cast/sender/fake_software_video_encoder.cc
diff --git a/media/cast/sender/fake_software_video_encoder.cc b/media/cast/sender/fake_software_video_encoder.cc
index 0cd01396fa911f7f68c29b1c827087a582fa60af..53cfb6c1e4d95db639a44c6a78f7c8e9fa0aed63 100644
--- a/media/cast/sender/fake_software_video_encoder.cc
+++ b/media/cast/sender/fake_software_video_encoder.cc
@@ -7,7 +7,6 @@
#include "base/json/json_writer.h"
#include "base/values.h"
#include "media/base/video_frame.h"
-#include "media/cast/net/cast_transport_config.h"
#ifndef OFFICIAL_BUILD
@@ -30,7 +29,7 @@ void FakeSoftwareVideoEncoder::Initialize() {}
void FakeSoftwareVideoEncoder::Encode(
const scoped_refptr<media::VideoFrame>& video_frame,
const base::TimeTicks& reference_time,
- EncodedFrame* encoded_frame) {
+ SenderEncodedFrame* encoded_frame) {
DCHECK(encoded_frame);
if (video_frame->visible_rect().size() != last_frame_size_) {
@@ -60,6 +59,14 @@ void FakeSoftwareVideoEncoder::Encode(
base::JSONWriter::Write(values, &encoded_frame->data);
encoded_frame->data.resize(
std::max<size_t>(encoded_frame->data.size(), frame_size_), ' ');
+
+ if (encoded_frame->dependency == EncodedFrame::KEY) {
+ encoded_frame->deadline_utilization = 1.0;
+ encoded_frame->lossy_utilization = 6.0;
+ } else {
+ encoded_frame->deadline_utilization = 0.8;
+ encoded_frame->lossy_utilization = 0.8;
+ }
}
void FakeSoftwareVideoEncoder::UpdateRates(uint32 new_bitrate) {
« no previous file with comments | « media/cast/sender/fake_software_video_encoder.h ('k') | media/cast/sender/h264_vt_encoder.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698