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

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

Issue 2089773002: Add EncodedImageCallback::OnEncodedImage(). (Closed) Base URL: https://chromium.googlesource.com/external/webrtc.git@master
Patch Set: . Created 4 years, 4 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/generic_encoder.cc
diff --git a/webrtc/modules/video_coding/generic_encoder.cc b/webrtc/modules/video_coding/generic_encoder.cc
index e63da026fe1dcf066f133fc282c162238d282150..28eb10ada1f43c3a5dd092cfd9531320ded9257c 100644
--- a/webrtc/modules/video_coding/generic_encoder.cc
+++ b/webrtc/modules/video_coding/generic_encoder.cc
@@ -21,6 +21,7 @@
#include "webrtc/system_wrappers/include/critical_section_wrapper.h"
namespace webrtc {
+
VCMGenericEncoder::VCMGenericEncoder(
VideoEncoder* encoder,
VCMEncodedFrameCallback* encoded_frame_callback,
@@ -143,23 +144,25 @@ VCMEncodedFrameCallback::VCMEncodedFrameCallback(
VCMEncodedFrameCallback::~VCMEncodedFrameCallback() {}
-int32_t VCMEncodedFrameCallback::Encoded(
+EncodedImageCallback::Result VCMEncodedFrameCallback::OnEncodedImage(
const EncodedImage& encoded_image,
const CodecSpecificInfo* codec_specific,
const RTPFragmentationHeader* fragmentation_header) {
TRACE_EVENT_INSTANT1("webrtc", "VCMEncodedFrameCallback::Encoded",
"timestamp", encoded_image._timeStamp);
- int ret_val = post_encode_callback_->Encoded(encoded_image, codec_specific,
- fragmentation_header);
- if (ret_val < 0)
- return ret_val;
+ Result result = post_encode_callback_->OnEncodedImage(
+ encoded_image, codec_specific, fragmentation_header);
+ if (result.error != Result::OK)
+ return result;
if (media_opt_) {
media_opt_->UpdateWithEncodedData(encoded_image);
- if (internal_source_)
- return media_opt_->DropFrame(); // Signal to encoder to drop next frame.
+ if (internal_source_) {
+ // Signal to encoder to drop next frame.
+ result.drop_next_frame = media_opt_->DropFrame();
+ }
}
- return VCM_OK;
+ return result;
}
} // namespace webrtc
« no previous file with comments | « webrtc/modules/video_coding/generic_encoder.h ('k') | webrtc/modules/video_coding/include/mock/mock_video_codec_interface.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698