Chromium Code Reviews| Index: webrtc/modules/video_coding/video_coding_impl.cc |
| diff --git a/webrtc/modules/video_coding/video_coding_impl.cc b/webrtc/modules/video_coding/video_coding_impl.cc |
| index bb81ba9f9efe3c976bf2c9d79901077ced39d506..6d0e947af34714e67c00fdcdac8cc16040591242 100644 |
| --- a/webrtc/modules/video_coding/video_coding_impl.cc |
| +++ b/webrtc/modules/video_coding/video_coding_impl.cc |
| @@ -45,7 +45,7 @@ namespace { |
| class EncodedImageCallbackWrapper : public EncodedImageCallback { |
| public: |
| EncodedImageCallbackWrapper() |
| - : cs_(CriticalSectionWrapper::CreateCriticalSection()), callback_(NULL) {} |
| + : cs_(CriticalSectionWrapper::CreateCriticalSection()) {} |
| virtual ~EncodedImageCallbackWrapper() {} |
| @@ -54,19 +54,20 @@ class EncodedImageCallbackWrapper : public EncodedImageCallback { |
| callback_ = callback; |
| } |
| - virtual int32_t Encoded(const EncodedImage& encoded_image, |
| - const CodecSpecificInfo* codec_specific_info, |
| - const RTPFragmentationHeader* fragmentation) { |
| + virtual Result OnEncodedImage(const EncodedImage& encoded_image, |
| + const CodecSpecificInfo* codec_specific_info, |
| + const RTPFragmentationHeader* fragmentation) { |
| CriticalSectionScoped cs(cs_.get()); |
| - if (callback_) |
| - return callback_->Encoded(encoded_image, codec_specific_info, |
| - fragmentation); |
| - return 0; |
| + if (callback_) { |
| + return callback_->OnEncodedImage(encoded_image, codec_specific_info, |
| + fragmentation); |
| + } |
| + return Result::FrameDropped(); |
| } |
| private: |
| std::unique_ptr<CriticalSectionWrapper> cs_; |
| - EncodedImageCallback* callback_ GUARDED_BY(cs_); |
| + EncodedImageCallback* callback_ GUARDED_BY(cs_) = nullptr; |
|
sprang_webrtc
2016/06/28 13:54:18
Why remove this initialization from the constructo
Sergey Ulanov
2016/06/29 22:18:52
in-class member initialization ensures that the me
|
| }; |
| class VideoCodingModuleImpl : public VideoCodingModule { |