Eliminate use of IsZeroSize method
Check for dropped frames by instead checking the frame_buffer pointer directly. Also add RTC_DCHECK to verify that a webrtc::VideoFrame never has video_frame_buffer_ set to nullptr (except by the default constructor). BUG=webrtc:5682 Review-Url: https://codereview.webrtc.org/1995343002 Cr-Commit-Position: refs/heads/master@{#12859}
This commit is contained in:
@ -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) {
|
||||
|
||||
Reference in New Issue
Block a user