Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(2015)

Unified Diff: webrtc/modules/video_coding/video_coding_impl.cc

Issue 2089773002: Add EncodedImageCallback::OnEncodedImage(). (Closed) Base URL: https://chromium.googlesource.com/external/webrtc.git@master
Patch Set: Created 4 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
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 {

Powered by Google App Engine
This is Rietveld 408576698