OLD | NEW |
1 /* | 1 /* |
2 * Copyright (c) 2012 The WebRTC project authors. All Rights Reserved. | 2 * Copyright (c) 2012 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 47 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
58 const CodecSpecificInfo* codec_specific_info, | 58 const CodecSpecificInfo* codec_specific_info, |
59 const RTPFragmentationHeader* fragmentation) { | 59 const RTPFragmentationHeader* fragmentation) { |
60 CriticalSectionScoped cs(cs_.get()); | 60 CriticalSectionScoped cs(cs_.get()); |
61 if (callback_) | 61 if (callback_) |
62 return callback_->Encoded(encoded_image, codec_specific_info, | 62 return callback_->Encoded(encoded_image, codec_specific_info, |
63 fragmentation); | 63 fragmentation); |
64 return 0; | 64 return 0; |
65 } | 65 } |
66 | 66 |
67 private: | 67 private: |
68 rtc::scoped_ptr<CriticalSectionWrapper> cs_; | 68 std::unique_ptr<CriticalSectionWrapper> cs_; |
69 EncodedImageCallback* callback_ GUARDED_BY(cs_); | 69 EncodedImageCallback* callback_ GUARDED_BY(cs_); |
70 }; | 70 }; |
71 | 71 |
72 class VideoCodingModuleImpl : public VideoCodingModule { | 72 class VideoCodingModuleImpl : public VideoCodingModule { |
73 public: | 73 public: |
74 VideoCodingModuleImpl(Clock* clock, | 74 VideoCodingModuleImpl(Clock* clock, |
75 EventFactory* event_factory, | 75 EventFactory* event_factory, |
76 bool owns_event_factory, | 76 bool owns_event_factory, |
77 VideoEncoderRateObserver* encoder_rate_observer, | 77 VideoEncoderRateObserver* encoder_rate_observer, |
78 VCMQMSettingsCallback* qm_settings_callback) | 78 VCMQMSettingsCallback* qm_settings_callback) |
(...skipping 200 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
279 EncodedImageCallback* observer) override { | 279 EncodedImageCallback* observer) override { |
280 post_encode_callback_.Register(observer); | 280 post_encode_callback_.Register(observer); |
281 } | 281 } |
282 | 282 |
283 void TriggerDecoderShutdown() override { receiver_.TriggerDecoderShutdown(); } | 283 void TriggerDecoderShutdown() override { receiver_.TriggerDecoderShutdown(); } |
284 | 284 |
285 private: | 285 private: |
286 EncodedImageCallbackWrapper post_encode_callback_; | 286 EncodedImageCallbackWrapper post_encode_callback_; |
287 vcm::VideoSender sender_; | 287 vcm::VideoSender sender_; |
288 vcm::VideoReceiver receiver_; | 288 vcm::VideoReceiver receiver_; |
289 rtc::scoped_ptr<EventFactory> own_event_factory_; | 289 std::unique_ptr<EventFactory> own_event_factory_; |
290 }; | 290 }; |
291 } // namespace | 291 } // namespace |
292 | 292 |
293 void VideoCodingModule::Codec(VideoCodecType codecType, VideoCodec* codec) { | 293 void VideoCodingModule::Codec(VideoCodecType codecType, VideoCodec* codec) { |
294 VCMCodecDataBase::Codec(codecType, codec); | 294 VCMCodecDataBase::Codec(codecType, codec); |
295 } | 295 } |
296 | 296 |
297 VideoCodingModule* VideoCodingModule::Create( | 297 VideoCodingModule* VideoCodingModule::Create( |
298 Clock* clock, | 298 Clock* clock, |
299 VideoEncoderRateObserver* encoder_rate_observer, | 299 VideoEncoderRateObserver* encoder_rate_observer, |
300 VCMQMSettingsCallback* qm_settings_callback) { | 300 VCMQMSettingsCallback* qm_settings_callback) { |
301 return new VideoCodingModuleImpl(clock, new EventFactoryImpl, true, | 301 return new VideoCodingModuleImpl(clock, new EventFactoryImpl, true, |
302 encoder_rate_observer, qm_settings_callback); | 302 encoder_rate_observer, qm_settings_callback); |
303 } | 303 } |
304 | 304 |
305 VideoCodingModule* VideoCodingModule::Create(Clock* clock, | 305 VideoCodingModule* VideoCodingModule::Create(Clock* clock, |
306 EventFactory* event_factory) { | 306 EventFactory* event_factory) { |
307 assert(clock); | 307 assert(clock); |
308 assert(event_factory); | 308 assert(event_factory); |
309 return new VideoCodingModuleImpl(clock, event_factory, false, nullptr, | 309 return new VideoCodingModuleImpl(clock, event_factory, false, nullptr, |
310 nullptr); | 310 nullptr); |
311 } | 311 } |
312 | 312 |
313 } // namespace webrtc | 313 } // namespace webrtc |
OLD | NEW |