Reland "Delete CodecNamesEq, replaced with absl::EqualsIgnoreCase"

This is a reland of 80cd25bcfb2264fa0f1192de942a6f063879dd42

Original change's description:
> Delete CodecNamesEq, replaced with absl::EqualsIgnoreCase
>
> Bug: None
> Change-Id: I225fe1e16a3c96e5a03e3ae8fe975f368be7e6ad
> Reviewed-on: https://webrtc-review.googlesource.com/c/107303
> Commit-Queue: Niels Moller <nisse@webrtc.org>
> Reviewed-by: Karl Wiberg <kwiberg@webrtc.org>
> Cr-Commit-Position: refs/heads/master@{#25312}

Tbr: kwiberg@webrtc.org
Bug: None
Change-Id: Id43a93bada9d6d66a4d0f0286f583066156aa2fc
Reviewed-on: https://webrtc-review.googlesource.com/c/107716
Commit-Queue: Niels Moller <nisse@webrtc.org>
Reviewed-by: Niels Moller <nisse@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#25368}
This commit is contained in:
Niels Möller
2018-10-23 10:07:25 +02:00
committed by Commit Bot
parent e2754c95c5
commit 039743e066
18 changed files with 65 additions and 66 deletions

View File

@ -82,6 +82,7 @@ rtc_static_library("builtin_video_encoder_factory") {
"../../rtc_base:ptr_util",
"../../rtc_base/system:rtc_export",
"//third_party/abseil-cpp/absl/memory",
"//third_party/abseil-cpp/absl/strings",
]
}

View File

@ -13,6 +13,7 @@
#include <vector>
#include "absl/memory/memory.h"
#include "absl/strings/match.h"
#include "api/video_codecs/sdp_video_format.h"
#include "media/base/codec.h"
#include "media/base/mediaconstants.h"
@ -59,7 +60,7 @@ class BuiltinVideoEncoderFactory : public VideoEncoderFactory {
if (IsFormatSupported(internal_encoder_factory_->GetSupportedFormats(),
format)) {
internal_encoder =
cricket::CodecNamesEq(format.name.c_str(), cricket::kVp8CodecName)
absl::EqualsIgnoreCase(format.name, cricket::kVp8CodecName)
? absl::make_unique<VP8EncoderSimulcastProxy>(
internal_encoder_factory_.get(), format)
: internal_encoder_factory_->CreateVideoEncoder(format);

View File

@ -115,11 +115,6 @@ static const char* kPayloadNameI420 = "I420";
static const char* kPayloadNameGeneric = "Generic";
static const char* kPayloadNameMultiplex = "Multiplex";
// TODO(nisse): Delete this wrapper.
static bool CodecNamesEq(const char* name1, const char* name2) {
return absl::EqualsIgnoreCase(name1, name2);
}
const char* CodecTypeToPayloadString(VideoCodecType type) {
switch (type) {
case kVideoCodecVP8:
@ -137,15 +132,15 @@ const char* CodecTypeToPayloadString(VideoCodecType type) {
}
VideoCodecType PayloadStringToCodecType(const std::string& name) {
if (CodecNamesEq(name.c_str(), kPayloadNameVp8))
if (absl::EqualsIgnoreCase(name, kPayloadNameVp8))
return kVideoCodecVP8;
if (CodecNamesEq(name.c_str(), kPayloadNameVp9))
if (absl::EqualsIgnoreCase(name, kPayloadNameVp9))
return kVideoCodecVP9;
if (CodecNamesEq(name.c_str(), kPayloadNameH264))
if (absl::EqualsIgnoreCase(name, kPayloadNameH264))
return kVideoCodecH264;
if (CodecNamesEq(name.c_str(), kPayloadNameI420))
if (absl::EqualsIgnoreCase(name, kPayloadNameI420))
return kVideoCodecI420;
if (CodecNamesEq(name.c_str(), kPayloadNameMultiplex))
if (absl::EqualsIgnoreCase(name, kPayloadNameMultiplex))
return kVideoCodecMultiplex;
return kVideoCodecGeneric;
}