From b7024883abce59eaf38769e229b3a8e016eff442 Mon Sep 17 00:00:00 2001 From: yuanjinghua Date: Tue, 12 Mar 2024 19:52:47 +0800 Subject: [PATCH] Log Optimize of OnOutputBufferAvailable Signed-off-by: yuanjinghua --- services/media_engine/filters/video_decoder_adapter.cpp | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/services/media_engine/filters/video_decoder_adapter.cpp b/services/media_engine/filters/video_decoder_adapter.cpp index ce6c5c007..fc0d9fce8 100644 --- a/services/media_engine/filters/video_decoder_adapter.cpp +++ b/services/media_engine/filters/video_decoder_adapter.cpp @@ -256,10 +256,14 @@ void VideoDecoderAdapter::OnOutputFormatChanged(const MediaAVCodec::Format &form void VideoDecoderAdapter::OnOutputBufferAvailable(uint32_t index, std::shared_ptr buffer) { AVCodecTrace trace("VideoDecoderAdapter::OnOutputBufferAvailable"); + if (buffer != nullptr) { + MEDIA_LOG_D("OnOutputBufferAvailable start. index: %{public}u, bufferid: %{public}" PRIu64 + ", pts: %{public}" PRIu64 ", flag: %{public}u", index, buffer->GetUniqueId(), buffer->pts_, buffer->flag_); + } else { + MEDIA_LOG_D("OnOutputBufferAvailable start. buffer is nullptr, index: %{public}u", index); + } FALSE_RETURN_MSG(buffer != nullptr, "buffer is nullptr"); FALSE_RETURN_MSG(callback_ != nullptr, "callback_ is nullptr"); - MEDIA_LOG_D("OnOutputBufferAvailable start. index: %{public}u, bufferid: %{public}" PRIu64 ", pts: %{public}" PRIu64 - ", flag: %{public}u", index, buffer->GetUniqueId(), buffer->pts_, buffer->flag_); callback_->OnOutputBufferAvailable(index, buffer); } -- Gitee