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

Unified Diff: webrtc/api/java/jni/androidmediadecoder_jni.cc

Issue 1995343002: android: Eliminate use of IsZeroSize method (Closed) Base URL: https://chromium.googlesource.com/external/webrtc.git@master
Patch Set: Rebase. Created 4 years, 7 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
« no previous file with comments | « no previous file | webrtc/common_video/video_frame.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: webrtc/api/java/jni/androidmediadecoder_jni.cc
diff --git a/webrtc/api/java/jni/androidmediadecoder_jni.cc b/webrtc/api/java/jni/androidmediadecoder_jni.cc
index b3c2ffc241d456df5b489bb64c94e3dbfe2de6ec..831b68d512c0292f68db001cac7b624fcd3c18ac 100644
--- a/webrtc/api/java/jni/androidmediadecoder_jni.cc
+++ b/webrtc/api/java/jni/androidmediadecoder_jni.cc
@@ -823,10 +823,6 @@ bool MediaCodecVideoDecoder::DeliverPendingOutputs(
return false;
}
}
- VideoFrame decoded_frame(frame_buffer, 0, 0, webrtc::kVideoRotation_0);
- decoded_frame.set_timestamp(output_timestamps_ms);
- decoded_frame.set_ntp_time_ms(output_ntp_timestamps_ms);
-
if (frames_decoded_ < frames_decoded_logged_) {
ALOGD << "Decoder frame out # " << frames_decoded_ <<
". " << width << " x " << height <<
@@ -862,9 +858,12 @@ bool MediaCodecVideoDecoder::DeliverPendingOutputs(
current_delay_time_ms_ = 0;
}
- // |.IsZeroSize())| returns true when a frame has been dropped.
- if (!decoded_frame.IsZeroSize()) {
- // Callback - output decoded frame.
+ // If the frame was dropped, frame_buffer is left as nullptr.
+ if (frame_buffer) {
+ VideoFrame decoded_frame(frame_buffer, 0, 0, webrtc::kVideoRotation_0);
+ decoded_frame.set_timestamp(output_timestamps_ms);
+ decoded_frame.set_ntp_time_ms(output_ntp_timestamps_ms);
+
const int32_t callback_status =
callback_->Decoded(decoded_frame, decode_time_ms);
if (callback_status > 0) {
« no previous file with comments | « no previous file | webrtc/common_video/video_frame.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698