Unify VideoCodecType to/from string functionality
BUG=None Review-Url: https://codereview.webrtc.org/2509273002 Cr-Commit-Position: refs/heads/master@{#15200}
This commit is contained in:
@ -403,24 +403,6 @@ const char* ExcludeFrameTypesToStr(ExcludeFrameTypes e) {
|
||||
}
|
||||
}
|
||||
|
||||
const char* VideoCodecTypeToStr(webrtc::VideoCodecType e) {
|
||||
switch (e) {
|
||||
case kVideoCodecVP8:
|
||||
return "VP8";
|
||||
case kVideoCodecI420:
|
||||
return "I420";
|
||||
case kVideoCodecRED:
|
||||
return "RED";
|
||||
case kVideoCodecULPFEC:
|
||||
return "ULPFEC";
|
||||
case kVideoCodecUnknown:
|
||||
return "Unknown";
|
||||
default:
|
||||
RTC_NOTREACHED();
|
||||
return "Unknown";
|
||||
}
|
||||
}
|
||||
|
||||
// Callbacks
|
||||
EncodedImageCallback::Result
|
||||
VideoProcessorImpl::VideoProcessorEncodeCompleteCallback::OnEncodedImage(
|
||||
|
||||
@ -108,9 +108,6 @@ struct TestConfig {
|
||||
bool verbose;
|
||||
};
|
||||
|
||||
// Returns a string representation of the enum value.
|
||||
const char* VideoCodecTypeToStr(webrtc::VideoCodecType e);
|
||||
|
||||
// Handles encoding/decoding of video using the VideoEncoder/VideoDecoder
|
||||
// interfaces. This is done in a sequential manner in order to be able to
|
||||
// measure times properly.
|
||||
|
||||
@ -412,7 +412,8 @@ void PrintPythonOutput(const webrtc::test::TestConfig& config,
|
||||
ExcludeFrameTypesToStr(config.exclude_frame_types),
|
||||
config.frame_length_in_bytes, config.use_single_core ? "True " : "False",
|
||||
config.keyframe_interval,
|
||||
webrtc::test::VideoCodecTypeToStr(config.codec_settings->codecType),
|
||||
CodecTypeToPayloadName(config.codec_settings->codecType)
|
||||
.value_or("Unknown"),
|
||||
config.codec_settings->width, config.codec_settings->height,
|
||||
config.codec_settings->startBitrate);
|
||||
printf(
|
||||
|
||||
@ -122,20 +122,8 @@ bool IvfFileWriter::InitFromFirstFrame(const EncodedImage& encoded_image,
|
||||
if (!WriteHeader())
|
||||
return false;
|
||||
|
||||
std::string codec_name;
|
||||
switch (codec_type_) {
|
||||
case kVideoCodecVP8:
|
||||
codec_name = "VP8";
|
||||
break;
|
||||
case kVideoCodecVP9:
|
||||
codec_name = "VP9";
|
||||
break;
|
||||
case kVideoCodecH264:
|
||||
codec_name = "H264";
|
||||
break;
|
||||
default:
|
||||
codec_name = "Unknown";
|
||||
}
|
||||
const char* codec_name =
|
||||
CodecTypeToPayloadName(codec_type_).value_or("Unknown");
|
||||
LOG(LS_WARNING) << "Created IVF file for codec data of type " << codec_name
|
||||
<< " at resolution " << width_ << " x " << height_
|
||||
<< ", using " << (using_capture_timestamps_ ? "1" : "90")
|
||||
|
||||
Reference in New Issue
Block a user