Revert "Delete CodecNamesEq, replaced with absl::EqualsIgnoreCase"
This reverts commit 80cd25bcfb2264fa0f1192de942a6f063879dd42. Reason for revert: Breaks downstream project 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=mbonadei@webrtc.org,kwiberg@webrtc.org,nisse@webrtc.org No-Try: true Bug: None Change-Id: I77b66bc032e2d95d1bd408c6cdeceb4dcd511699 Reviewed-on: https://webrtc-review.googlesource.com/c/107643 Reviewed-by: Oleh Prypin <oprypin@webrtc.org> Commit-Queue: Oleh Prypin <oprypin@webrtc.org> Cr-Commit-Position: refs/heads/master@{#25317}
This commit is contained in:
parent
7e6b528e5d
commit
6e8e2993dd
@ -82,7 +82,6 @@ rtc_static_library("builtin_video_encoder_factory") {
|
|||||||
"../../rtc_base:ptr_util",
|
"../../rtc_base:ptr_util",
|
||||||
"../../rtc_base/system:rtc_export",
|
"../../rtc_base/system:rtc_export",
|
||||||
"//third_party/abseil-cpp/absl/memory",
|
"//third_party/abseil-cpp/absl/memory",
|
||||||
"//third_party/abseil-cpp/absl/strings",
|
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -13,7 +13,6 @@
|
|||||||
#include <vector>
|
#include <vector>
|
||||||
|
|
||||||
#include "absl/memory/memory.h"
|
#include "absl/memory/memory.h"
|
||||||
#include "absl/strings/match.h"
|
|
||||||
#include "api/video_codecs/sdp_video_format.h"
|
#include "api/video_codecs/sdp_video_format.h"
|
||||||
#include "media/base/codec.h"
|
#include "media/base/codec.h"
|
||||||
#include "media/base/mediaconstants.h"
|
#include "media/base/mediaconstants.h"
|
||||||
@ -60,7 +59,7 @@ class BuiltinVideoEncoderFactory : public VideoEncoderFactory {
|
|||||||
if (IsFormatSupported(internal_encoder_factory_->GetSupportedFormats(),
|
if (IsFormatSupported(internal_encoder_factory_->GetSupportedFormats(),
|
||||||
format)) {
|
format)) {
|
||||||
internal_encoder =
|
internal_encoder =
|
||||||
absl::EqualsIgnoreCase(format.name, cricket::kVp8CodecName)
|
cricket::CodecNamesEq(format.name.c_str(), cricket::kVp8CodecName)
|
||||||
? absl::make_unique<VP8EncoderSimulcastProxy>(
|
? absl::make_unique<VP8EncoderSimulcastProxy>(
|
||||||
internal_encoder_factory_.get(), format)
|
internal_encoder_factory_.get(), format)
|
||||||
: internal_encoder_factory_->CreateVideoEncoder(format);
|
: internal_encoder_factory_->CreateVideoEncoder(format);
|
||||||
|
|||||||
@ -115,6 +115,11 @@ static const char* kPayloadNameI420 = "I420";
|
|||||||
static const char* kPayloadNameGeneric = "Generic";
|
static const char* kPayloadNameGeneric = "Generic";
|
||||||
static const char* kPayloadNameMultiplex = "Multiplex";
|
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) {
|
const char* CodecTypeToPayloadString(VideoCodecType type) {
|
||||||
switch (type) {
|
switch (type) {
|
||||||
case kVideoCodecVP8:
|
case kVideoCodecVP8:
|
||||||
@ -132,15 +137,15 @@ const char* CodecTypeToPayloadString(VideoCodecType type) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
VideoCodecType PayloadStringToCodecType(const std::string& name) {
|
VideoCodecType PayloadStringToCodecType(const std::string& name) {
|
||||||
if (absl::EqualsIgnoreCase(name, kPayloadNameVp8))
|
if (CodecNamesEq(name.c_str(), kPayloadNameVp8))
|
||||||
return kVideoCodecVP8;
|
return kVideoCodecVP8;
|
||||||
if (absl::EqualsIgnoreCase(name, kPayloadNameVp9))
|
if (CodecNamesEq(name.c_str(), kPayloadNameVp9))
|
||||||
return kVideoCodecVP9;
|
return kVideoCodecVP9;
|
||||||
if (absl::EqualsIgnoreCase(name, kPayloadNameH264))
|
if (CodecNamesEq(name.c_str(), kPayloadNameH264))
|
||||||
return kVideoCodecH264;
|
return kVideoCodecH264;
|
||||||
if (absl::EqualsIgnoreCase(name, kPayloadNameI420))
|
if (CodecNamesEq(name.c_str(), kPayloadNameI420))
|
||||||
return kVideoCodecI420;
|
return kVideoCodecI420;
|
||||||
if (absl::EqualsIgnoreCase(name, kPayloadNameMultiplex))
|
if (CodecNamesEq(name.c_str(), kPayloadNameMultiplex))
|
||||||
return kVideoCodecMultiplex;
|
return kVideoCodecMultiplex;
|
||||||
return kVideoCodecGeneric;
|
return kVideoCodecGeneric;
|
||||||
}
|
}
|
||||||
|
|||||||
@ -250,7 +250,6 @@ rtc_static_library("rtc_internal_video_codecs") {
|
|||||||
"../rtc_base:rtc_base_approved",
|
"../rtc_base:rtc_base_approved",
|
||||||
"../rtc_base:sequenced_task_checker",
|
"../rtc_base:sequenced_task_checker",
|
||||||
"../rtc_base/system:rtc_export",
|
"../rtc_base/system:rtc_export",
|
||||||
"//third_party/abseil-cpp/absl/strings",
|
|
||||||
"//third_party/abseil-cpp/absl/types:optional",
|
"//third_party/abseil-cpp/absl/types:optional",
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
|
|||||||
@ -268,10 +268,10 @@ static bool IsSameH264PacketizationMode(const CodecParameterMap& ours,
|
|||||||
bool VideoCodec::Matches(const VideoCodec& other) const {
|
bool VideoCodec::Matches(const VideoCodec& other) const {
|
||||||
if (!Codec::Matches(other))
|
if (!Codec::Matches(other))
|
||||||
return false;
|
return false;
|
||||||
if (absl::EqualsIgnoreCase(name, kH264CodecName))
|
if (CodecNamesEq(name.c_str(), kH264CodecName))
|
||||||
return webrtc::H264::IsSameH264Profile(params, other.params) &&
|
return webrtc::H264::IsSameH264Profile(params, other.params) &&
|
||||||
IsSameH264PacketizationMode(params, other.params);
|
IsSameH264PacketizationMode(params, other.params);
|
||||||
if (absl::EqualsIgnoreCase(name, kVp9CodecName))
|
if (CodecNamesEq(name.c_str(), kVp9CodecName))
|
||||||
return webrtc::IsSameVP9Profile(params, other.params);
|
return webrtc::IsSameVP9Profile(params, other.params);
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
@ -362,6 +362,15 @@ bool HasTransportCc(const Codec& codec) {
|
|||||||
FeedbackParam(kRtcpFbParamTransportCc, kParamValueEmpty));
|
FeedbackParam(kRtcpFbParamTransportCc, kParamValueEmpty));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// TODO(nisse): Delete these wrappers.
|
||||||
|
bool CodecNamesEq(const std::string& name1, const std::string& name2) {
|
||||||
|
return CodecNamesEq(name1.c_str(), name2.c_str());
|
||||||
|
}
|
||||||
|
|
||||||
|
bool CodecNamesEq(const char* name1, const char* name2) {
|
||||||
|
return absl::EqualsIgnoreCase(name1, name2);
|
||||||
|
}
|
||||||
|
|
||||||
const VideoCodec* FindMatchingCodec(
|
const VideoCodec* FindMatchingCodec(
|
||||||
const std::vector<VideoCodec>& supported_codecs,
|
const std::vector<VideoCodec>& supported_codecs,
|
||||||
const VideoCodec& codec) {
|
const VideoCodec& codec) {
|
||||||
@ -379,12 +388,12 @@ bool IsSameCodec(const std::string& name1,
|
|||||||
const std::string& name2,
|
const std::string& name2,
|
||||||
const CodecParameterMap& params2) {
|
const CodecParameterMap& params2) {
|
||||||
// If different names (case insensitive), then not same formats.
|
// If different names (case insensitive), then not same formats.
|
||||||
if (!absl::EqualsIgnoreCase(name1, name2))
|
if (!CodecNamesEq(name1, name2))
|
||||||
return false;
|
return false;
|
||||||
// For every format besides H264 and VP9, comparing names is enough.
|
// For every format besides H264 and VP9, comparing names is enough.
|
||||||
if (absl::EqualsIgnoreCase(name1, kH264CodecName))
|
if (CodecNamesEq(name1.c_str(), kH264CodecName))
|
||||||
return webrtc::H264::IsSameH264Profile(params1, params2);
|
return webrtc::H264::IsSameH264Profile(params1, params2);
|
||||||
if (absl::EqualsIgnoreCase(name1, kVp9CodecName))
|
if (CodecNamesEq(name1.c_str(), kVp9CodecName))
|
||||||
return webrtc::IsSameVP9Profile(params1, params2);
|
return webrtc::IsSameVP9Profile(params1, params2);
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|||||||
@ -216,6 +216,9 @@ const Codec* FindCodecById(const std::vector<Codec>& codecs, int payload_type) {
|
|||||||
return nullptr;
|
return nullptr;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
RTC_EXPORT bool CodecNamesEq(const std::string& name1,
|
||||||
|
const std::string& name2);
|
||||||
|
RTC_EXPORT bool CodecNamesEq(const char* name1, const char* name2);
|
||||||
bool HasNack(const Codec& codec);
|
bool HasNack(const Codec& codec);
|
||||||
bool HasRemb(const Codec& codec);
|
bool HasRemb(const Codec& codec);
|
||||||
bool HasRrtr(const Codec& codec);
|
bool HasRrtr(const Codec& codec);
|
||||||
|
|||||||
@ -15,7 +15,6 @@
|
|||||||
#include <vector>
|
#include <vector>
|
||||||
|
|
||||||
#include "absl/memory/memory.h"
|
#include "absl/memory/memory.h"
|
||||||
#include "absl/strings/match.h"
|
|
||||||
#include "api/video_codecs/video_decoder_factory.h"
|
#include "api/video_codecs/video_decoder_factory.h"
|
||||||
#include "api/video_codecs/video_decoder_software_fallback_wrapper.h"
|
#include "api/video_codecs/video_decoder_software_fallback_wrapper.h"
|
||||||
#include "api/video_codecs/video_encoder_factory.h"
|
#include "api/video_codecs/video_encoder_factory.h"
|
||||||
@ -131,7 +130,7 @@ class EncoderAdapter : public webrtc::VideoEncoderFactory {
|
|||||||
if (IsFormatSupported(internal_encoder_factory_->GetSupportedFormats(),
|
if (IsFormatSupported(internal_encoder_factory_->GetSupportedFormats(),
|
||||||
format)) {
|
format)) {
|
||||||
internal_encoder =
|
internal_encoder =
|
||||||
absl::EqualsIgnoreCase(format.name, kVp8CodecName)
|
CodecNamesEq(format.name.c_str(), kVp8CodecName)
|
||||||
? absl::make_unique<webrtc::VP8EncoderSimulcastProxy>(
|
? absl::make_unique<webrtc::VP8EncoderSimulcastProxy>(
|
||||||
internal_encoder_factory_.get(), format)
|
internal_encoder_factory_.get(), format)
|
||||||
: internal_encoder_factory_->CreateVideoEncoder(format);
|
: internal_encoder_factory_->CreateVideoEncoder(format);
|
||||||
@ -142,7 +141,7 @@ class EncoderAdapter : public webrtc::VideoEncoderFactory {
|
|||||||
if (IsFormatSupported(external_encoder_factory_->GetSupportedFormats(),
|
if (IsFormatSupported(external_encoder_factory_->GetSupportedFormats(),
|
||||||
format)) {
|
format)) {
|
||||||
external_encoder =
|
external_encoder =
|
||||||
absl::EqualsIgnoreCase(format.name, kVp8CodecName)
|
CodecNamesEq(format.name.c_str(), kVp8CodecName)
|
||||||
? absl::make_unique<webrtc::SimulcastEncoderAdapter>(
|
? absl::make_unique<webrtc::SimulcastEncoderAdapter>(
|
||||||
external_encoder_factory_.get(), format)
|
external_encoder_factory_.get(), format)
|
||||||
: external_encoder_factory_->CreateVideoEncoder(format);
|
: external_encoder_factory_->CreateVideoEncoder(format);
|
||||||
|
|||||||
@ -10,7 +10,6 @@
|
|||||||
|
|
||||||
#include "media/engine/fakewebrtcvideoengine.h"
|
#include "media/engine/fakewebrtcvideoengine.h"
|
||||||
|
|
||||||
#include "absl/strings/match.h"
|
|
||||||
#include "media/base/codec.h"
|
#include "media/base/codec.h"
|
||||||
#include "media/engine/simulcast_encoder_adapter.h"
|
#include "media/engine/simulcast_encoder_adapter.h"
|
||||||
#include "media/engine/webrtcvideodecoderfactory.h"
|
#include "media/engine/webrtcvideodecoderfactory.h"
|
||||||
@ -219,7 +218,7 @@ FakeWebRtcVideoEncoderFactory::CreateVideoEncoder(
|
|||||||
rtc::CritScope lock(&crit_);
|
rtc::CritScope lock(&crit_);
|
||||||
std::unique_ptr<webrtc::VideoEncoder> encoder;
|
std::unique_ptr<webrtc::VideoEncoder> encoder;
|
||||||
if (IsFormatSupported(formats_, format)) {
|
if (IsFormatSupported(formats_, format)) {
|
||||||
if (absl::EqualsIgnoreCase(format.name, kVp8CodecName) &&
|
if (CodecNamesEq(format.name.c_str(), kVp8CodecName) &&
|
||||||
!vp8_factory_mode_) {
|
!vp8_factory_mode_) {
|
||||||
// The simulcast adapter will ask this factory for multiple VP8
|
// The simulcast adapter will ask this factory for multiple VP8
|
||||||
// encoders. Enter vp8_factory_mode so that we now create these encoders
|
// encoders. Enter vp8_factory_mode so that we now create these encoders
|
||||||
|
|||||||
@ -10,7 +10,6 @@
|
|||||||
|
|
||||||
#include "media/engine/internaldecoderfactory.h"
|
#include "media/engine/internaldecoderfactory.h"
|
||||||
|
|
||||||
#include "absl/strings/match.h"
|
|
||||||
#include "api/video_codecs/sdp_video_format.h"
|
#include "api/video_codecs/sdp_video_format.h"
|
||||||
#include "media/base/mediaconstants.h"
|
#include "media/base/mediaconstants.h"
|
||||||
#include "modules/video_coding/codecs/h264/include/h264.h"
|
#include "modules/video_coding/codecs/h264/include/h264.h"
|
||||||
@ -56,11 +55,11 @@ std::unique_ptr<VideoDecoder> InternalDecoderFactory::CreateVideoDecoder(
|
|||||||
return nullptr;
|
return nullptr;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (absl::EqualsIgnoreCase(format.name, cricket::kVp8CodecName))
|
if (cricket::CodecNamesEq(format.name, cricket::kVp8CodecName))
|
||||||
return VP8Decoder::Create();
|
return VP8Decoder::Create();
|
||||||
if (absl::EqualsIgnoreCase(format.name, cricket::kVp9CodecName))
|
if (cricket::CodecNamesEq(format.name, cricket::kVp9CodecName))
|
||||||
return VP9Decoder::Create();
|
return VP9Decoder::Create();
|
||||||
if (absl::EqualsIgnoreCase(format.name, cricket::kH264CodecName))
|
if (cricket::CodecNamesEq(format.name, cricket::kH264CodecName))
|
||||||
return H264Decoder::Create();
|
return H264Decoder::Create();
|
||||||
|
|
||||||
RTC_NOTREACHED();
|
RTC_NOTREACHED();
|
||||||
|
|||||||
@ -12,7 +12,6 @@
|
|||||||
|
|
||||||
#include <utility>
|
#include <utility>
|
||||||
|
|
||||||
#include "absl/strings/match.h"
|
|
||||||
#include "api/video_codecs/sdp_video_format.h"
|
#include "api/video_codecs/sdp_video_format.h"
|
||||||
#include "modules/video_coding/codecs/h264/include/h264.h"
|
#include "modules/video_coding/codecs/h264/include/h264.h"
|
||||||
#include "modules/video_coding/codecs/vp8/include/vp8.h"
|
#include "modules/video_coding/codecs/vp8/include/vp8.h"
|
||||||
@ -42,11 +41,11 @@ VideoEncoderFactory::CodecInfo InternalEncoderFactory::QueryVideoEncoder(
|
|||||||
|
|
||||||
std::unique_ptr<VideoEncoder> InternalEncoderFactory::CreateVideoEncoder(
|
std::unique_ptr<VideoEncoder> InternalEncoderFactory::CreateVideoEncoder(
|
||||||
const SdpVideoFormat& format) {
|
const SdpVideoFormat& format) {
|
||||||
if (absl::EqualsIgnoreCase(format.name, cricket::kVp8CodecName))
|
if (cricket::CodecNamesEq(format.name, cricket::kVp8CodecName))
|
||||||
return VP8Encoder::Create();
|
return VP8Encoder::Create();
|
||||||
if (absl::EqualsIgnoreCase(format.name, cricket::kVp9CodecName))
|
if (cricket::CodecNamesEq(format.name, cricket::kVp9CodecName))
|
||||||
return VP9Encoder::Create(cricket::VideoCodec(format));
|
return VP9Encoder::Create(cricket::VideoCodec(format));
|
||||||
if (absl::EqualsIgnoreCase(format.name, cricket::kH264CodecName))
|
if (cricket::CodecNamesEq(format.name, cricket::kH264CodecName))
|
||||||
return H264Encoder::Create(cricket::VideoCodec(format));
|
return H264Encoder::Create(cricket::VideoCodec(format));
|
||||||
RTC_LOG(LS_ERROR) << "Trying to created encoder of unsupported format "
|
RTC_LOG(LS_ERROR) << "Trying to created encoder of unsupported format "
|
||||||
<< format.name;
|
<< format.name;
|
||||||
|
|||||||
@ -12,7 +12,6 @@
|
|||||||
|
|
||||||
#include <utility>
|
#include <utility>
|
||||||
|
|
||||||
#include "absl/strings/match.h"
|
|
||||||
#include "api/video_codecs/sdp_video_format.h"
|
#include "api/video_codecs/sdp_video_format.h"
|
||||||
#include "media/base/codec.h"
|
#include "media/base/codec.h"
|
||||||
#include "media/base/mediaconstants.h"
|
#include "media/base/mediaconstants.h"
|
||||||
@ -23,8 +22,8 @@
|
|||||||
namespace {
|
namespace {
|
||||||
|
|
||||||
bool IsMultiplexCodec(const cricket::VideoCodec& codec) {
|
bool IsMultiplexCodec(const cricket::VideoCodec& codec) {
|
||||||
return absl::EqualsIgnoreCase(codec.name.c_str(),
|
return cricket::CodecNamesEq(codec.name.c_str(),
|
||||||
cricket::kMultiplexCodecName);
|
cricket::kMultiplexCodecName);
|
||||||
}
|
}
|
||||||
|
|
||||||
} // anonymous namespace
|
} // anonymous namespace
|
||||||
@ -43,7 +42,7 @@ std::vector<SdpVideoFormat> MultiplexEncoderFactory::GetSupportedFormats()
|
|||||||
const {
|
const {
|
||||||
std::vector<SdpVideoFormat> formats = factory_->GetSupportedFormats();
|
std::vector<SdpVideoFormat> formats = factory_->GetSupportedFormats();
|
||||||
for (const auto& format : formats) {
|
for (const auto& format : formats) {
|
||||||
if (absl::EqualsIgnoreCase(format.name, kMultiplexAssociatedCodecName)) {
|
if (cricket::CodecNamesEq(format.name, kMultiplexAssociatedCodecName)) {
|
||||||
SdpVideoFormat multiplex_format = format;
|
SdpVideoFormat multiplex_format = format;
|
||||||
multiplex_format.parameters[cricket::kCodecParamAssociatedCodecName] =
|
multiplex_format.parameters[cricket::kCodecParamAssociatedCodecName] =
|
||||||
format.name;
|
format.name;
|
||||||
@ -89,7 +88,7 @@ std::vector<SdpVideoFormat> MultiplexDecoderFactory::GetSupportedFormats()
|
|||||||
const {
|
const {
|
||||||
std::vector<SdpVideoFormat> formats = factory_->GetSupportedFormats();
|
std::vector<SdpVideoFormat> formats = factory_->GetSupportedFormats();
|
||||||
for (const auto& format : formats) {
|
for (const auto& format : formats) {
|
||||||
if (absl::EqualsIgnoreCase(format.name, kMultiplexAssociatedCodecName)) {
|
if (cricket::CodecNamesEq(format.name, kMultiplexAssociatedCodecName)) {
|
||||||
SdpVideoFormat multiplex_format = format;
|
SdpVideoFormat multiplex_format = format;
|
||||||
multiplex_format.parameters[cricket::kCodecParamAssociatedCodecName] =
|
multiplex_format.parameters[cricket::kCodecParamAssociatedCodecName] =
|
||||||
format.name;
|
format.name;
|
||||||
|
|||||||
@ -16,7 +16,6 @@
|
|||||||
#include <string>
|
#include <string>
|
||||||
#include <utility>
|
#include <utility>
|
||||||
|
|
||||||
#include "absl/strings/match.h"
|
|
||||||
#include "api/video_codecs/sdp_video_format.h"
|
#include "api/video_codecs/sdp_video_format.h"
|
||||||
#include "api/video_codecs/video_decoder_factory.h"
|
#include "api/video_codecs/video_decoder_factory.h"
|
||||||
#include "api/video_codecs/video_encoder.h"
|
#include "api/video_codecs/video_encoder.h"
|
||||||
@ -112,8 +111,8 @@ std::vector<VideoCodec> AssignPayloadTypesAndDefaultCodecs(
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Add associated RTX codec for non-FEC codecs.
|
// Add associated RTX codec for non-FEC codecs.
|
||||||
if (!absl::EqualsIgnoreCase(codec.name, kUlpfecCodecName) &&
|
if (!CodecNamesEq(codec.name, kUlpfecCodecName) &&
|
||||||
!absl::EqualsIgnoreCase(codec.name, kFlexfecCodecName)) {
|
!CodecNamesEq(codec.name, kFlexfecCodecName)) {
|
||||||
output_codecs.push_back(
|
output_codecs.push_back(
|
||||||
VideoCodec::CreateRtxCodec(payload_type, codec.id));
|
VideoCodec::CreateRtxCodec(payload_type, codec.id));
|
||||||
|
|
||||||
@ -148,8 +147,8 @@ int GetMaxFramerate(const webrtc::VideoEncoderConfig& encoder_config,
|
|||||||
}
|
}
|
||||||
|
|
||||||
bool IsTemporalLayersSupported(const std::string& codec_name) {
|
bool IsTemporalLayersSupported(const std::string& codec_name) {
|
||||||
return absl::EqualsIgnoreCase(codec_name, kVp8CodecName) ||
|
return CodecNamesEq(codec_name, kVp8CodecName) ||
|
||||||
absl::EqualsIgnoreCase(codec_name, kVp9CodecName);
|
CodecNamesEq(codec_name, kVp9CodecName);
|
||||||
}
|
}
|
||||||
|
|
||||||
static std::string CodecVectorToString(const std::vector<VideoCodec>& codecs) {
|
static std::string CodecVectorToString(const std::vector<VideoCodec>& codecs) {
|
||||||
@ -221,9 +220,9 @@ static bool ValidateStreamParams(const StreamParams& sp) {
|
|||||||
// Returns true if the given codec is disallowed from doing simulcast.
|
// Returns true if the given codec is disallowed from doing simulcast.
|
||||||
bool IsCodecBlacklistedForSimulcast(const std::string& codec_name) {
|
bool IsCodecBlacklistedForSimulcast(const std::string& codec_name) {
|
||||||
return webrtc::field_trial::IsEnabled("WebRTC-H264Simulcast")
|
return webrtc::field_trial::IsEnabled("WebRTC-H264Simulcast")
|
||||||
? absl::EqualsIgnoreCase(codec_name, kVp9CodecName)
|
? CodecNamesEq(codec_name, kVp9CodecName)
|
||||||
: absl::EqualsIgnoreCase(codec_name, kH264CodecName) ||
|
: CodecNamesEq(codec_name, kH264CodecName) ||
|
||||||
absl::EqualsIgnoreCase(codec_name, kVp9CodecName);
|
CodecNamesEq(codec_name, kVp9CodecName);
|
||||||
}
|
}
|
||||||
|
|
||||||
// The selected thresholds for QVGA and VGA corresponded to a QP around 10.
|
// The selected thresholds for QVGA and VGA corresponded to a QP around 10.
|
||||||
@ -338,14 +337,14 @@ WebRtcVideoChannel::WebRtcVideoSendStream::ConfigureVideoEncoderSettings(
|
|||||||
denoising = parameters_.options.video_noise_reduction.value_or(false);
|
denoising = parameters_.options.video_noise_reduction.value_or(false);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (absl::EqualsIgnoreCase(codec.name, kH264CodecName)) {
|
if (CodecNamesEq(codec.name, kH264CodecName)) {
|
||||||
webrtc::VideoCodecH264 h264_settings =
|
webrtc::VideoCodecH264 h264_settings =
|
||||||
webrtc::VideoEncoder::GetDefaultH264Settings();
|
webrtc::VideoEncoder::GetDefaultH264Settings();
|
||||||
h264_settings.frameDroppingOn = frame_dropping;
|
h264_settings.frameDroppingOn = frame_dropping;
|
||||||
return new rtc::RefCountedObject<
|
return new rtc::RefCountedObject<
|
||||||
webrtc::VideoEncoderConfig::H264EncoderSpecificSettings>(h264_settings);
|
webrtc::VideoEncoderConfig::H264EncoderSpecificSettings>(h264_settings);
|
||||||
}
|
}
|
||||||
if (absl::EqualsIgnoreCase(codec.name, kVp8CodecName)) {
|
if (CodecNamesEq(codec.name, kVp8CodecName)) {
|
||||||
webrtc::VideoCodecVP8 vp8_settings =
|
webrtc::VideoCodecVP8 vp8_settings =
|
||||||
webrtc::VideoEncoder::GetDefaultVp8Settings();
|
webrtc::VideoEncoder::GetDefaultVp8Settings();
|
||||||
vp8_settings.automaticResizeOn = automatic_resize;
|
vp8_settings.automaticResizeOn = automatic_resize;
|
||||||
@ -355,7 +354,7 @@ WebRtcVideoChannel::WebRtcVideoSendStream::ConfigureVideoEncoderSettings(
|
|||||||
return new rtc::RefCountedObject<
|
return new rtc::RefCountedObject<
|
||||||
webrtc::VideoEncoderConfig::Vp8EncoderSpecificSettings>(vp8_settings);
|
webrtc::VideoEncoderConfig::Vp8EncoderSpecificSettings>(vp8_settings);
|
||||||
}
|
}
|
||||||
if (absl::EqualsIgnoreCase(codec.name, kVp9CodecName)) {
|
if (CodecNamesEq(codec.name, kVp9CodecName)) {
|
||||||
webrtc::VideoCodecVP9 vp9_settings =
|
webrtc::VideoCodecVP9 vp9_settings =
|
||||||
webrtc::VideoEncoder::GetDefaultVp9Settings();
|
webrtc::VideoEncoder::GetDefaultVp9Settings();
|
||||||
const size_t default_num_spatial_layers =
|
const size_t default_num_spatial_layers =
|
||||||
@ -2697,11 +2696,10 @@ std::vector<webrtc::VideoStream> EncoderStreamFactory::CreateEncoderStreams(
|
|||||||
std::vector<webrtc::VideoStream> layers;
|
std::vector<webrtc::VideoStream> layers;
|
||||||
|
|
||||||
if (encoder_config.number_of_streams > 1 ||
|
if (encoder_config.number_of_streams > 1 ||
|
||||||
((absl::EqualsIgnoreCase(codec_name_, kVp8CodecName) ||
|
((CodecNamesEq(codec_name_, kVp8CodecName) ||
|
||||||
absl::EqualsIgnoreCase(codec_name_, kH264CodecName)) &&
|
CodecNamesEq(codec_name_, kH264CodecName)) &&
|
||||||
is_screenshare_ && screenshare_config_explicitly_enabled_)) {
|
is_screenshare_ && screenshare_config_explicitly_enabled_)) {
|
||||||
bool temporal_layers_supported =
|
bool temporal_layers_supported = CodecNamesEq(codec_name_, kVp8CodecName);
|
||||||
absl::EqualsIgnoreCase(codec_name_, kVp8CodecName);
|
|
||||||
layers = GetSimulcastConfig(encoder_config.number_of_streams, width, height,
|
layers = GetSimulcastConfig(encoder_config.number_of_streams, width, height,
|
||||||
0 /*not used*/, encoder_config.bitrate_priority,
|
0 /*not used*/, encoder_config.bitrate_priority,
|
||||||
max_qp_, 0 /*not_used*/, is_screenshare_,
|
max_qp_, 0 /*not_used*/, is_screenshare_,
|
||||||
@ -2794,7 +2792,7 @@ std::vector<webrtc::VideoStream> EncoderStreamFactory::CreateEncoderStreams(
|
|||||||
layer.max_qp = max_qp_;
|
layer.max_qp = max_qp_;
|
||||||
layer.bitrate_priority = encoder_config.bitrate_priority;
|
layer.bitrate_priority = encoder_config.bitrate_priority;
|
||||||
|
|
||||||
if (absl::EqualsIgnoreCase(codec_name_, kVp9CodecName)) {
|
if (CodecNamesEq(codec_name_, kVp9CodecName)) {
|
||||||
RTC_DCHECK(encoder_config.encoder_specific_settings);
|
RTC_DCHECK(encoder_config.encoder_specific_settings);
|
||||||
// Use VP9 SVC layering from codec settings which might be initialized
|
// Use VP9 SVC layering from codec settings which might be initialized
|
||||||
// though field trial in ConfigureVideoEncoderSettings.
|
// though field trial in ConfigureVideoEncoderSettings.
|
||||||
|
|||||||
@ -14,7 +14,6 @@
|
|||||||
#include <utility>
|
#include <utility>
|
||||||
#include <vector>
|
#include <vector>
|
||||||
|
|
||||||
#include "absl/strings/match.h"
|
|
||||||
#include "api/rtpparameters.h"
|
#include "api/rtpparameters.h"
|
||||||
#include "api/test/mock_video_decoder_factory.h"
|
#include "api/test/mock_video_decoder_factory.h"
|
||||||
#include "api/test/mock_video_encoder_factory.h"
|
#include "api/test/mock_video_encoder_factory.h"
|
||||||
@ -102,7 +101,7 @@ bool HasRtxCodec(const std::vector<cricket::VideoCodec>& codecs,
|
|||||||
int payload_type) {
|
int payload_type) {
|
||||||
for (const cricket::VideoCodec& codec : codecs) {
|
for (const cricket::VideoCodec& codec : codecs) {
|
||||||
int associated_payload_type;
|
int associated_payload_type;
|
||||||
if (absl::EqualsIgnoreCase(codec.name.c_str(), "rtx") &&
|
if (cricket::CodecNamesEq(codec.name.c_str(), "rtx") &&
|
||||||
codec.GetParam(cricket::kCodecParamAssociatedPayloadType,
|
codec.GetParam(cricket::kCodecParamAssociatedPayloadType,
|
||||||
&associated_payload_type) &&
|
&associated_payload_type) &&
|
||||||
associated_payload_type == payload_type) {
|
associated_payload_type == payload_type) {
|
||||||
@ -651,11 +650,11 @@ size_t WebRtcVideoEngineTest::GetEngineCodecIndex(
|
|||||||
const std::vector<cricket::VideoCodec> codecs = engine_.codecs();
|
const std::vector<cricket::VideoCodec> codecs = engine_.codecs();
|
||||||
for (size_t i = 0; i < codecs.size(); ++i) {
|
for (size_t i = 0; i < codecs.size(); ++i) {
|
||||||
const cricket::VideoCodec engine_codec = codecs[i];
|
const cricket::VideoCodec engine_codec = codecs[i];
|
||||||
if (!absl::EqualsIgnoreCase(name, engine_codec.name))
|
if (!CodecNamesEq(name, engine_codec.name))
|
||||||
continue;
|
continue;
|
||||||
// The tests only use H264 Constrained Baseline. Make sure we don't return
|
// The tests only use H264 Constrained Baseline. Make sure we don't return
|
||||||
// an internal H264 codec from the engine with a different H264 profile.
|
// an internal H264 codec from the engine with a different H264 profile.
|
||||||
if (absl::EqualsIgnoreCase(name.c_str(), kH264CodecName)) {
|
if (CodecNamesEq(name.c_str(), kH264CodecName)) {
|
||||||
const absl::optional<webrtc::H264::ProfileLevelId> profile_level_id =
|
const absl::optional<webrtc::H264::ProfileLevelId> profile_level_id =
|
||||||
webrtc::H264::ParseSdpProfileLevelId(engine_codec.params);
|
webrtc::H264::ParseSdpProfileLevelId(engine_codec.params);
|
||||||
if (profile_level_id->profile !=
|
if (profile_level_id->profile !=
|
||||||
@ -1432,7 +1431,7 @@ class WebRtcVideoChannelBaseTest : public testing::Test {
|
|||||||
|
|
||||||
cricket::VideoCodec GetEngineCodec(const std::string& name) {
|
cricket::VideoCodec GetEngineCodec(const std::string& name) {
|
||||||
for (const cricket::VideoCodec& engine_codec : engine_.codecs()) {
|
for (const cricket::VideoCodec& engine_codec : engine_.codecs()) {
|
||||||
if (absl::EqualsIgnoreCase(name, engine_codec.name))
|
if (CodecNamesEq(name, engine_codec.name))
|
||||||
return engine_codec;
|
return engine_codec;
|
||||||
}
|
}
|
||||||
// This point should never be reached.
|
// This point should never be reached.
|
||||||
|
|||||||
@ -306,7 +306,6 @@ rtc_static_library("webrtc_h264") {
|
|||||||
"../../rtc_base/system:rtc_export",
|
"../../rtc_base/system:rtc_export",
|
||||||
"../../system_wrappers:metrics",
|
"../../system_wrappers:metrics",
|
||||||
"//third_party/abseil-cpp/absl/memory",
|
"//third_party/abseil-cpp/absl/memory",
|
||||||
"//third_party/abseil-cpp/absl/strings",
|
|
||||||
"//third_party/libyuv",
|
"//third_party/libyuv",
|
||||||
]
|
]
|
||||||
|
|
||||||
|
|||||||
@ -19,7 +19,6 @@
|
|||||||
#include "third_party/openh264/src/codec/api/svc/codec_def.h"
|
#include "third_party/openh264/src/codec/api/svc/codec_def.h"
|
||||||
#include "third_party/openh264/src/codec/api/svc/codec_ver.h"
|
#include "third_party/openh264/src/codec/api/svc/codec_ver.h"
|
||||||
|
|
||||||
#include "absl/strings/match.h"
|
|
||||||
#include "common_video/libyuv/include/webrtc_libyuv.h"
|
#include "common_video/libyuv/include/webrtc_libyuv.h"
|
||||||
#include "modules/video_coding/utility/simulcast_rate_allocator.h"
|
#include "modules/video_coding/utility/simulcast_rate_allocator.h"
|
||||||
#include "modules/video_coding/utility/simulcast_utility.h"
|
#include "modules/video_coding/utility/simulcast_utility.h"
|
||||||
@ -168,7 +167,7 @@ H264EncoderImpl::H264EncoderImpl(const cricket::VideoCodec& codec)
|
|||||||
encoded_image_callback_(nullptr),
|
encoded_image_callback_(nullptr),
|
||||||
has_reported_init_(false),
|
has_reported_init_(false),
|
||||||
has_reported_error_(false) {
|
has_reported_error_(false) {
|
||||||
RTC_CHECK(absl::EqualsIgnoreCase(codec.name, cricket::kH264CodecName));
|
RTC_CHECK(cricket::CodecNamesEq(codec.name, cricket::kH264CodecName));
|
||||||
std::string packetization_mode_string;
|
std::string packetization_mode_string;
|
||||||
if (codec.GetParam(cricket::kH264FmtpPacketizationMode,
|
if (codec.GetParam(cricket::kH264FmtpPacketizationMode,
|
||||||
&packetization_mode_string) &&
|
&packetization_mode_string) &&
|
||||||
|
|||||||
@ -212,7 +212,6 @@ rtc_static_library("peerconnection") {
|
|||||||
"../system_wrappers:field_trial",
|
"../system_wrappers:field_trial",
|
||||||
"../system_wrappers:metrics",
|
"../system_wrappers:metrics",
|
||||||
"//third_party/abseil-cpp/absl/memory",
|
"//third_party/abseil-cpp/absl/memory",
|
||||||
"//third_party/abseil-cpp/absl/strings",
|
|
||||||
"//third_party/abseil-cpp/absl/types:optional",
|
"//third_party/abseil-cpp/absl/types:optional",
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
|
|||||||
@ -312,8 +312,7 @@ void FilterDataCodecs(std::vector<DataCodec>* codecs, bool sctp) {
|
|||||||
sctp ? kGoogleRtpDataCodecName : kGoogleSctpDataCodecName;
|
sctp ? kGoogleRtpDataCodecName : kGoogleSctpDataCodecName;
|
||||||
codecs->erase(std::remove_if(codecs->begin(), codecs->end(),
|
codecs->erase(std::remove_if(codecs->begin(), codecs->end(),
|
||||||
[&codec_name](const DataCodec& codec) {
|
[&codec_name](const DataCodec& codec) {
|
||||||
return absl::EqualsIgnoreCase(codec.name,
|
return CodecNamesEq(codec.name, codec_name);
|
||||||
codec_name);
|
|
||||||
}),
|
}),
|
||||||
codecs->end());
|
codecs->end());
|
||||||
}
|
}
|
||||||
@ -747,7 +746,7 @@ static void NegotiateCodecs(const std::vector<C>& local_codecs,
|
|||||||
RTC_DCHECK(apt_it != theirs.params.end());
|
RTC_DCHECK(apt_it != theirs.params.end());
|
||||||
negotiated.SetParam(kCodecParamAssociatedPayloadType, apt_it->second);
|
negotiated.SetParam(kCodecParamAssociatedPayloadType, apt_it->second);
|
||||||
}
|
}
|
||||||
if (absl::EqualsIgnoreCase(ours.name, kH264CodecName)) {
|
if (CodecNamesEq(ours.name.c_str(), kH264CodecName)) {
|
||||||
webrtc::H264::GenerateProfileLevelIdForAnswer(
|
webrtc::H264::GenerateProfileLevelIdForAnswer(
|
||||||
ours.params, theirs.params, &negotiated.params);
|
ours.params, theirs.params, &negotiated.params);
|
||||||
}
|
}
|
||||||
|
|||||||
@ -23,12 +23,11 @@
|
|||||||
#include <utility>
|
#include <utility>
|
||||||
#include <vector>
|
#include <vector>
|
||||||
|
|
||||||
#include "absl/strings/match.h"
|
#include "api/mediatypes.h"
|
||||||
#include "api/candidate.h"
|
#include "api/candidate.h"
|
||||||
#include "api/cryptoparams.h"
|
#include "api/cryptoparams.h"
|
||||||
#include "api/jsepicecandidate.h"
|
#include "api/jsepicecandidate.h"
|
||||||
#include "api/jsepsessiondescription.h"
|
#include "api/jsepsessiondescription.h"
|
||||||
#include "api/mediatypes.h"
|
|
||||||
// for RtpExtension
|
// for RtpExtension
|
||||||
#include "api/rtpparameters.h"
|
#include "api/rtpparameters.h"
|
||||||
#include "media/base/codec.h"
|
#include "media/base/codec.h"
|
||||||
@ -1313,8 +1312,8 @@ void BuildMediaDescription(const ContentInfo* content_info,
|
|||||||
|
|
||||||
if (data_desc->use_sctpmap()) {
|
if (data_desc->use_sctpmap()) {
|
||||||
for (const cricket::DataCodec& codec : data_desc->codecs()) {
|
for (const cricket::DataCodec& codec : data_desc->codecs()) {
|
||||||
if (absl::EqualsIgnoreCase(codec.name,
|
if (cricket::CodecNamesEq(codec.name,
|
||||||
cricket::kGoogleSctpDataCodecName) &&
|
cricket::kGoogleSctpDataCodecName) &&
|
||||||
codec.GetParam(cricket::kCodecParamPort, &sctp_port)) {
|
codec.GetParam(cricket::kCodecParamPort, &sctp_port)) {
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
@ -1752,7 +1751,7 @@ void AddRtcpFbLines(const T& codec, std::string* message) {
|
|||||||
|
|
||||||
bool AddSctpDataCodec(DataContentDescription* media_desc, int sctp_port) {
|
bool AddSctpDataCodec(DataContentDescription* media_desc, int sctp_port) {
|
||||||
for (const auto& codec : media_desc->codecs()) {
|
for (const auto& codec : media_desc->codecs()) {
|
||||||
if (absl::EqualsIgnoreCase(codec.name, cricket::kGoogleSctpDataCodecName)) {
|
if (cricket::CodecNamesEq(codec.name, cricket::kGoogleSctpDataCodecName)) {
|
||||||
return ParseFailed("", "Can't have multiple sctp port attributes.", NULL);
|
return ParseFailed("", "Can't have multiple sctp port attributes.", NULL);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user