OLD | NEW |
1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 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/size_adaptable_video_encoder_base.h" | 5 #include "media/cast/sender/size_adaptable_video_encoder_base.h" |
6 | 6 |
7 #include <utility> | 7 #include <utility> |
8 | 8 |
9 #include "base/bind.h" | 9 #include "base/bind.h" |
10 #include "base/location.h" | 10 #include "base/location.h" |
11 #include "media/base/video_frame.h" | 11 #include "media/base/video_frame.h" |
12 | 12 |
13 namespace media { | 13 namespace media { |
14 namespace cast { | 14 namespace cast { |
15 | 15 |
16 SizeAdaptableVideoEncoderBase::SizeAdaptableVideoEncoderBase( | 16 SizeAdaptableVideoEncoderBase::SizeAdaptableVideoEncoderBase( |
17 const scoped_refptr<CastEnvironment>& cast_environment, | 17 const scoped_refptr<CastEnvironment>& cast_environment, |
18 const VideoSenderConfig& video_config, | 18 const FrameSenderConfig& video_config, |
19 const StatusChangeCallback& status_change_cb) | 19 const StatusChangeCallback& status_change_cb) |
20 : cast_environment_(cast_environment), | 20 : cast_environment_(cast_environment), |
21 video_config_(video_config), | 21 video_config_(video_config), |
22 status_change_cb_(status_change_cb), | 22 status_change_cb_(status_change_cb), |
23 frames_in_encoder_(0), | 23 frames_in_encoder_(0), |
24 next_frame_id_(FrameId::first()), | 24 next_frame_id_(FrameId::first()), |
25 weak_factory_(this) { | 25 weak_factory_(this) { |
26 cast_environment_->PostTask( | 26 cast_environment_->PostTask( |
27 CastEnvironment::MAIN, | 27 CastEnvironment::MAIN, |
28 FROM_HERE, | 28 FROM_HERE, |
(...skipping 128 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
157 --frames_in_encoder_; | 157 --frames_in_encoder_; |
158 DCHECK_GE(frames_in_encoder_, 0); | 158 DCHECK_GE(frames_in_encoder_, 0); |
159 | 159 |
160 if (encoded_frame) | 160 if (encoded_frame) |
161 next_frame_id_ = encoded_frame->frame_id + 1; | 161 next_frame_id_ = encoded_frame->frame_id + 1; |
162 frame_encoded_callback.Run(std::move(encoded_frame)); | 162 frame_encoded_callback.Run(std::move(encoded_frame)); |
163 } | 163 } |
164 | 164 |
165 } // namespace cast | 165 } // namespace cast |
166 } // namespace media | 166 } // namespace media |
OLD | NEW |