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

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

Issue 289283014: Cast: Fake software video encoder to respect target bitrate (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: lowered bitrate Created 6 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 | Annotate | Revision Log
« no previous file with comments | « media/cast/video_sender/fake_software_video_encoder.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/video_sender/video_encoder_impl.h" 5 #include "media/cast/video_sender/video_encoder_impl.h"
6 6
7 #include "base/bind.h" 7 #include "base/bind.h"
8 #include "base/bind_helpers.h" 8 #include "base/bind_helpers.h"
9 #include "base/callback.h" 9 #include "base/callback.h"
10 #include "base/logging.h" 10 #include "base/logging.h"
(...skipping 63 matching lines...) Expand 10 before | Expand all | Expand 10 after
74 skip_count_(0) { 74 skip_count_(0) {
75 if (video_config.codec == transport::kVp8) { 75 if (video_config.codec == transport::kVp8) {
76 encoder_.reset(new Vp8Encoder(video_config, max_unacked_frames)); 76 encoder_.reset(new Vp8Encoder(video_config, max_unacked_frames));
77 cast_environment_->PostTask(CastEnvironment::VIDEO, 77 cast_environment_->PostTask(CastEnvironment::VIDEO,
78 FROM_HERE, 78 FROM_HERE,
79 base::Bind(&InitializeEncoderOnEncoderThread, 79 base::Bind(&InitializeEncoderOnEncoderThread,
80 cast_environment, 80 cast_environment,
81 encoder_.get())); 81 encoder_.get()));
82 #ifndef OFFICIAL_BUILD 82 #ifndef OFFICIAL_BUILD
83 } else if (video_config.codec == transport::kFakeSoftwareVideo) { 83 } else if (video_config.codec == transport::kFakeSoftwareVideo) {
84 encoder_.reset(new FakeSoftwareVideoEncoder()); 84 encoder_.reset(new FakeSoftwareVideoEncoder(video_config));
85 #endif 85 #endif
86 } else { 86 } else {
87 DCHECK(false) << "Invalid config"; // Codec not supported. 87 DCHECK(false) << "Invalid config"; // Codec not supported.
88 } 88 }
89 89
90 dynamic_config_.key_frame_requested = false; 90 dynamic_config_.key_frame_requested = false;
91 dynamic_config_.latest_frame_id_to_reference = kStartFrameId; 91 dynamic_config_.latest_frame_id_to_reference = kStartFrameId;
92 dynamic_config_.bit_rate = video_config.start_bitrate; 92 dynamic_config_.bit_rate = video_config.start_bitrate;
93 } 93 }
94 94
(...skipping 49 matching lines...) Expand 10 before | Expand all | Expand 10 after
144 144
145 // Inform the encoder to only reference frames older or equal to frame_id; 145 // Inform the encoder to only reference frames older or equal to frame_id;
146 void VideoEncoderImpl::LatestFrameIdToReference(uint32 frame_id) { 146 void VideoEncoderImpl::LatestFrameIdToReference(uint32 frame_id) {
147 dynamic_config_.latest_frame_id_to_reference = frame_id; 147 dynamic_config_.latest_frame_id_to_reference = frame_id;
148 } 148 }
149 149
150 int VideoEncoderImpl::NumberOfSkippedFrames() const { return skip_count_; } 150 int VideoEncoderImpl::NumberOfSkippedFrames() const { return skip_count_; }
151 151
152 } // namespace cast 152 } // namespace cast
153 } // namespace media 153 } // namespace media
OLDNEW
« no previous file with comments | « media/cast/video_sender/fake_software_video_encoder.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698