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/sender/video_encoder_impl.h" | 5 #include "media/cast/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 85 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
96 STATUS_UNSUPPORTED_CODEC)); | 96 STATUS_UNSUPPORTED_CODEC)); |
97 } | 97 } |
98 | 98 |
99 VideoEncoderImpl::~VideoEncoderImpl() { | 99 VideoEncoderImpl::~VideoEncoderImpl() { |
100 DCHECK(cast_environment_->CurrentlyOn(CastEnvironment::MAIN)); | 100 DCHECK(cast_environment_->CurrentlyOn(CastEnvironment::MAIN)); |
101 if (encoder_) { | 101 if (encoder_) { |
102 cast_environment_->PostTask( | 102 cast_environment_->PostTask( |
103 CastEnvironment::VIDEO, | 103 CastEnvironment::VIDEO, |
104 FROM_HERE, | 104 FROM_HERE, |
105 base::Bind(&base::DeletePointer<SoftwareVideoEncoder>, | 105 base::Bind(&base::DeletePointer<SoftwareVideoEncoder>, |
106 encoder_.release())); | 106 base::Passed(&encoder_))); |
107 } | 107 } |
108 } | 108 } |
109 | 109 |
110 bool VideoEncoderImpl::EncodeVideoFrame( | 110 bool VideoEncoderImpl::EncodeVideoFrame( |
111 const scoped_refptr<media::VideoFrame>& video_frame, | 111 const scoped_refptr<media::VideoFrame>& video_frame, |
112 const base::TimeTicks& reference_time, | 112 const base::TimeTicks& reference_time, |
113 const FrameEncodedCallback& frame_encoded_callback) { | 113 const FrameEncodedCallback& frame_encoded_callback) { |
114 DCHECK(cast_environment_->CurrentlyOn(CastEnvironment::MAIN)); | 114 DCHECK(cast_environment_->CurrentlyOn(CastEnvironment::MAIN)); |
115 DCHECK(!video_frame->visible_rect().IsEmpty()); | 115 DCHECK(!video_frame->visible_rect().IsEmpty()); |
116 DCHECK(!frame_encoded_callback.is_null()); | 116 DCHECK(!frame_encoded_callback.is_null()); |
(...skipping 22 matching lines...) Expand all Loading... |
139 dynamic_config_.key_frame_requested = true; | 139 dynamic_config_.key_frame_requested = true; |
140 } | 140 } |
141 | 141 |
142 // Inform the encoder to only reference frames older or equal to frame_id; | 142 // Inform the encoder to only reference frames older or equal to frame_id; |
143 void VideoEncoderImpl::LatestFrameIdToReference(uint32 frame_id) { | 143 void VideoEncoderImpl::LatestFrameIdToReference(uint32 frame_id) { |
144 dynamic_config_.latest_frame_id_to_reference = frame_id; | 144 dynamic_config_.latest_frame_id_to_reference = frame_id; |
145 } | 145 } |
146 | 146 |
147 } // namespace cast | 147 } // namespace cast |
148 } // namespace media | 148 } // namespace media |
OLD | NEW |