OLD | NEW |
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 Loading... |
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 Loading... |
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 |
OLD | NEW |