OLD | NEW |
1 /* | 1 /* |
2 * Copyright (c) 2014 The WebRTC project authors. All Rights Reserved. | 2 * Copyright (c) 2014 The WebRTC project authors. All Rights Reserved. |
3 * | 3 * |
4 * Use of this source code is governed by a BSD-style license | 4 * Use of this source code is governed by a BSD-style license |
5 * that can be found in the LICENSE file in the root of the source | 5 * that can be found in the LICENSE file in the root of the source |
6 * tree. An additional intellectual property rights grant can be found | 6 * tree. An additional intellectual property rights grant can be found |
7 * in the file PATENTS. All contributing project authors may | 7 * in the file PATENTS. All contributing project authors may |
8 * be found in the AUTHORS file in the root of the source tree. | 8 * be found in the AUTHORS file in the root of the source tree. |
9 */ | 9 */ |
10 | 10 |
(...skipping 131 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
142 | 142 |
143 int SimulcastEncoderAdapter::Release() { | 143 int SimulcastEncoderAdapter::Release() { |
144 // TODO(pbos): Keep the last encoder instance but call ::Release() on it, then | 144 // TODO(pbos): Keep the last encoder instance but call ::Release() on it, then |
145 // re-use this instance in ::InitEncode(). This means that changing | 145 // re-use this instance in ::InitEncode(). This means that changing |
146 // resolutions doesn't require reallocation of the first encoder, but only | 146 // resolutions doesn't require reallocation of the first encoder, but only |
147 // reinitialization, which makes sense. Then Destroy this instance instead in | 147 // reinitialization, which makes sense. Then Destroy this instance instead in |
148 // ~SimulcastEncoderAdapter(). | 148 // ~SimulcastEncoderAdapter(). |
149 while (!streaminfos_.empty()) { | 149 while (!streaminfos_.empty()) { |
150 VideoEncoder* encoder = streaminfos_.back().encoder; | 150 VideoEncoder* encoder = streaminfos_.back().encoder; |
151 EncodedImageCallback* callback = streaminfos_.back().callback; | 151 EncodedImageCallback* callback = streaminfos_.back().callback; |
| 152 encoder->Release(); |
152 factory_->Destroy(encoder); | 153 factory_->Destroy(encoder); |
153 delete callback; | 154 delete callback; |
154 streaminfos_.pop_back(); | 155 streaminfos_.pop_back(); |
155 } | 156 } |
156 return WEBRTC_VIDEO_CODEC_OK; | 157 return WEBRTC_VIDEO_CODEC_OK; |
157 } | 158 } |
158 | 159 |
159 int SimulcastEncoderAdapter::InitEncode(const VideoCodec* inst, | 160 int SimulcastEncoderAdapter::InitEncode(const VideoCodec* inst, |
160 int number_of_cores, | 161 int number_of_cores, |
161 size_t max_payload_size) { | 162 size_t max_payload_size) { |
(...skipping 308 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
470 if (!Initialized() || NumberOfStreams(codec_) != 1) | 471 if (!Initialized() || NumberOfStreams(codec_) != 1) |
471 return VideoEncoder::ScalingSettings(false); | 472 return VideoEncoder::ScalingSettings(false); |
472 return streaminfos_[0].encoder->GetScalingSettings(); | 473 return streaminfos_[0].encoder->GetScalingSettings(); |
473 } | 474 } |
474 | 475 |
475 const char* SimulcastEncoderAdapter::ImplementationName() const { | 476 const char* SimulcastEncoderAdapter::ImplementationName() const { |
476 return implementation_name_.c_str(); | 477 return implementation_name_.c_str(); |
477 } | 478 } |
478 | 479 |
479 } // namespace webrtc | 480 } // namespace webrtc |
OLD | NEW |