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

Unified Diff: webrtc/api/android/jni/androidmediaencoder_jni.cc

Issue 2405173006: Remove deprected functions from EncodedImageCallback and RtpRtcp (Closed)
Patch Set: fix android Created 4 years, 1 month 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
« no previous file with comments | « no previous file | webrtc/modules/rtp_rtcp/include/rtp_rtcp.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: webrtc/api/android/jni/androidmediaencoder_jni.cc
diff --git a/webrtc/api/android/jni/androidmediaencoder_jni.cc b/webrtc/api/android/jni/androidmediaencoder_jni.cc
index c5c84549d6c717293542dec6edb4b83d9e509dc6..3b753246eecc3b0e5af841df5cc49f139097b96e 100644
--- a/webrtc/api/android/jni/androidmediaencoder_jni.cc
+++ b/webrtc/api/android/jni/androidmediaencoder_jni.cc
@@ -266,8 +266,8 @@ class MediaCodecVideoEncoder : public webrtc::VideoEncoder,
// |input_frame_infos_|.
// Frame size in bytes fed to MediaCodec.
int yuv_size_;
- // True only when between a callback_->Encoded() call return a positive value
- // and the next Encode() call being ignored.
+ // True only when between a callback_->OnEncodedImage() call return a positive
+ // value and the next Encode() call being ignored.
bool drop_next_input_frame_;
// Global references; must be deleted in Release().
std::vector<jobject> input_buffers_;
@@ -1066,7 +1066,8 @@ bool MediaCodecVideoEncoder::DeliverPendingOutputs(JNIEnv* jni) {
}
// Callback - return encoded frame.
- int32_t callback_status = 0;
+ webrtc::EncodedImageCallback::Result callback_result(
+ webrtc::EncodedImageCallback::Result::OK);
if (callback_) {
std::unique_ptr<webrtc::EncodedImage> image(
new webrtc::EncodedImage(payload, payload_size, payload_size));
@@ -1177,7 +1178,7 @@ bool MediaCodecVideoEncoder::DeliverPendingOutputs(JNIEnv* jni) {
}
}
- callback_status = callback_->Encoded(*image, &info, &header);
+ callback_result = callback_->OnEncodedImage(*image, &info, &header);
}
// Return output buffer back to the encoder.
@@ -1211,11 +1212,9 @@ bool MediaCodecVideoEncoder::DeliverPendingOutputs(JNIEnv* jni) {
current_encoding_time_ms_ += frame_encoding_time_ms;
LogStatistics(false);
- if (callback_status > 0) {
+ // Errors in callback_result are currently ignored.
+ if (callback_result.drop_next_frame)
drop_next_input_frame_ = true;
- // Theoretically could handle callback_status<0 here, but unclear what
- // that would mean for us.
- }
}
return true;
}
« no previous file with comments | « no previous file | webrtc/modules/rtp_rtcp/include/rtp_rtcp.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698