Log decoder implementation name

Bug: none
Change-Id: I2c6b6a2a62bbcd058b8ed336e6e0f36b8b0d0844
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/175220
Reviewed-by: Erik Språng <sprang@webrtc.org>
Commit-Queue: Ilya Nikolaevskiy <ilnik@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#31321}
This commit is contained in:
Ilya Nikolaevskiy
2020-05-15 12:24:29 +02:00
committed by Commit Bot
parent 3361af35dd
commit 43c108b7e9
3 changed files with 17 additions and 5 deletions

View File

@ -169,8 +169,10 @@ std::unique_ptr<VCMGenericDecoder> VCMDecoderDataBase::CreateAndInitDecoder(
decoder_item->settings->width = frame.EncodedImage()._encodedWidth;
decoder_item->settings->height = frame.EncodedImage()._encodedHeight;
}
if (ptr_decoder->InitDecode(decoder_item->settings.get(),
decoder_item->number_of_cores) < 0) {
int err = ptr_decoder->InitDecode(decoder_item->settings.get(),
decoder_item->number_of_cores);
if (err < 0) {
RTC_LOG(LS_ERROR) << "Failed to initialize decoder. Error code: " << err;
return nullptr;
}
memcpy(new_codec, decoder_item->settings.get(), sizeof(VideoCodec));

View File

@ -211,7 +211,10 @@ int32_t VCMGenericDecoder::InitDecode(const VideoCodec* settings,
TRACE_EVENT0("webrtc", "VCMGenericDecoder::InitDecode");
_codecType = settings->codecType;
return decoder_->InitDecode(settings, numberOfCores);
int err = decoder_->InitDecode(settings, numberOfCores);
implementation_name_ = decoder_->ImplementationName();
RTC_LOG(LS_INFO) << "Decoder implementation: " << implementation_name_;
return err;
}
int32_t VCMGenericDecoder::Decode(const VCMEncodedFrame& frame, Timestamp now) {
@ -239,8 +242,13 @@ int32_t VCMGenericDecoder::Decode(const VCMEncodedFrame& frame, Timestamp now) {
_nextFrameInfoIdx = (_nextFrameInfoIdx + 1) % kDecoderFrameMemoryLength;
int32_t ret = decoder_->Decode(frame.EncodedImage(), frame.MissingFrame(),
frame.RenderTimeMs());
_callback->OnDecoderImplementationName(decoder_->ImplementationName());
const char* new_implementation_name = decoder_->ImplementationName();
if (new_implementation_name != implementation_name_) {
implementation_name_ = new_implementation_name;
RTC_LOG(LS_INFO) << "Changed decoder implementation to: "
<< new_implementation_name;
}
_callback->OnDecoderImplementationName(implementation_name_.c_str());
if (ret < WEBRTC_VIDEO_CODEC_OK) {
RTC_LOG(LS_WARNING) << "Failed to decode frame with timestamp "
<< frame.Timestamp() << ", error code: " << ret;

View File

@ -12,6 +12,7 @@
#define MODULES_VIDEO_CODING_GENERIC_DECODER_H_
#include <memory>
#include <string>
#include "api/units/time_delta.h"
#include "modules/video_coding/encoded_frame.h"
@ -112,6 +113,7 @@ class VCMGenericDecoder {
VideoCodecType _codecType;
const bool _isExternal;
VideoContentType _last_keyframe_content_type;
std::string implementation_name_;
};
} // namespace webrtc