Reland "Handle scalability mode in QueryCodecSupport"
This reverts commit 74281bed5350af9c15f83e0b1aec5c5921dbf76f. Reason for revert: Fixed unit test by removing VP9 profile 2 from encoder factory unit test since this is platform dependent. Original change's description: > Revert "Handle scalability mode in QueryCodecSupport" > > This reverts commit 715a14811883a642e3acca21fb6017f8a128c0a5. > > Reason for revert: Speculative revert. Breaks upstream project http://b/200009579 > > Original change's description: > > Handle scalability mode in QueryCodecSupport > > > > All valid scalability modes should be supported by the builtin > > software decoder/encoder. > > > > Bug: chromium:1187565 > > Change-Id: If66105d210d5055019f35dae2f80a18ad4a70cdd > > Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/222642 > > Commit-Queue: Johannes Kron <kron@webrtc.org> > > Reviewed-by: Danil Chapovalov <danilchap@webrtc.org> > > Reviewed-by: Erik Språng <sprang@webrtc.org> > > Cr-Commit-Position: refs/heads/main@{#34998} > > TBR=danilchap@webrtc.org,sprang@webrtc.org,kron@webrtc.org,webrtc-scoped@luci-project-accounts.iam.gserviceaccount.com > > Change-Id: Ibf40d523c50791d73e2afdc3917892b859d2bcb6 > No-Presubmit: true > No-Tree-Checks: true > No-Try: true > Bug: chromium:1187565 > Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/232020 > Reviewed-by: Andrey Logvin <landrey@webrtc.org> > Commit-Queue: Andrey Logvin <landrey@webrtc.org> > Cr-Commit-Position: refs/heads/main@{#35001} Bug: chromium:1187565 Change-Id: I598a2a530b8fea22997bbb5910eb3b864d1e28a2 Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/232021 Reviewed-by: Erik Språng <sprang@webrtc.org> Reviewed-by: Danil Chapovalov <danilchap@webrtc.org> Commit-Queue: Johannes Kron <kron@webrtc.org> Cr-Commit-Position: refs/heads/main@{#35003}
This commit is contained in:
committed by
WebRTC LUCI CQ
parent
9c1657cba8
commit
b26863ed0c
@ -60,6 +60,7 @@ rtc_library("libaom_av1_encoder") {
|
||||
absl_deps = [
|
||||
"//third_party/abseil-cpp/absl/algorithm:container",
|
||||
"//third_party/abseil-cpp/absl/base:core_headers",
|
||||
"//third_party/abseil-cpp/absl/strings:strings",
|
||||
"//third_party/abseil-cpp/absl/types:optional",
|
||||
]
|
||||
|
||||
|
||||
@ -806,4 +806,11 @@ std::unique_ptr<VideoEncoder> CreateLibaomAv1Encoder() {
|
||||
return std::make_unique<LibaomAv1Encoder>();
|
||||
}
|
||||
|
||||
bool LibaomAv1EncoderSupportsScalabilityMode(
|
||||
absl::string_view scalability_mode) {
|
||||
// For AV1, the scalability mode is supported if we can create the scalability
|
||||
// structure.
|
||||
return ScalabilityStructureConfig(scalability_mode) != absl::nullopt;
|
||||
}
|
||||
|
||||
} // namespace webrtc
|
||||
|
||||
@ -13,6 +13,7 @@
|
||||
#include <memory>
|
||||
|
||||
#include "absl/base/attributes.h"
|
||||
#include "absl/strings/string_view.h"
|
||||
#include "api/video_codecs/video_encoder.h"
|
||||
|
||||
namespace webrtc {
|
||||
@ -20,6 +21,8 @@ namespace webrtc {
|
||||
ABSL_CONST_INIT extern const bool kIsLibaomAv1EncoderSupported;
|
||||
|
||||
std::unique_ptr<VideoEncoder> CreateLibaomAv1Encoder();
|
||||
bool LibaomAv1EncoderSupportsScalabilityMode(
|
||||
absl::string_view scalability_mode);
|
||||
|
||||
} // namespace webrtc
|
||||
|
||||
|
||||
@ -21,4 +21,9 @@ std::unique_ptr<VideoEncoder> CreateLibaomAv1Encoder() {
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
bool LibaomAv1EncoderSupportsScalabilityMode(
|
||||
absl::string_view scalability_mode) {
|
||||
return false;
|
||||
}
|
||||
|
||||
} // namespace webrtc
|
||||
|
||||
@ -44,6 +44,8 @@ bool IsH264CodecSupported() {
|
||||
#endif
|
||||
}
|
||||
|
||||
constexpr absl::string_view kSupportedScalabilityModes[] = {"L1T2", "L1T3"};
|
||||
|
||||
} // namespace
|
||||
|
||||
SdpVideoFormat CreateH264Format(H264Profile profile,
|
||||
@ -105,6 +107,15 @@ bool H264Encoder::IsSupported() {
|
||||
return IsH264CodecSupported();
|
||||
}
|
||||
|
||||
bool H264Encoder::SupportsScalabilityMode(absl::string_view scalability_mode) {
|
||||
for (const auto& entry : kSupportedScalabilityModes) {
|
||||
if (entry == scalability_mode) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
std::unique_ptr<H264Decoder> H264Decoder::Create() {
|
||||
RTC_DCHECK(H264Decoder::IsSupported());
|
||||
#if defined(WEBRTC_USE_H264)
|
||||
|
||||
@ -16,6 +16,7 @@
|
||||
#include <string>
|
||||
#include <vector>
|
||||
|
||||
#include "absl/strings/string_view.h"
|
||||
#include "api/video_codecs/h264_profile_level_id.h"
|
||||
#include "media/base/codec.h"
|
||||
#include "modules/video_coding/include/video_codec_interface.h"
|
||||
@ -46,6 +47,7 @@ class RTC_EXPORT H264Encoder : public VideoEncoder {
|
||||
static std::unique_ptr<H264Encoder> Create(const cricket::VideoCodec& codec);
|
||||
// If H.264 is supported (any implementation).
|
||||
static bool IsSupported();
|
||||
static bool SupportsScalabilityMode(absl::string_view scalability_mode);
|
||||
|
||||
~H264Encoder() override {}
|
||||
};
|
||||
|
||||
@ -15,6 +15,7 @@
|
||||
#include <vector>
|
||||
|
||||
#include "absl/base/attributes.h"
|
||||
#include "absl/strings/string_view.h"
|
||||
#include "api/video_codecs/video_encoder.h"
|
||||
#include "api/video_codecs/vp8_frame_buffer_controller.h"
|
||||
#include "modules/video_coding/include/video_codec_interface.h"
|
||||
@ -39,6 +40,7 @@ class VP8Encoder {
|
||||
|
||||
static std::unique_ptr<VideoEncoder> Create();
|
||||
static std::unique_ptr<VideoEncoder> Create(Settings settings);
|
||||
static bool SupportsScalabilityMode(absl::string_view scalability_mode);
|
||||
|
||||
ABSL_DEPRECATED("")
|
||||
static std::unique_ptr<VideoEncoder> Create(
|
||||
|
||||
@ -49,6 +49,8 @@ constexpr char kVP8IosMaxNumberOfThreadFieldTrial[] =
|
||||
constexpr char kVP8IosMaxNumberOfThreadFieldTrialParameter[] = "max_thread";
|
||||
#endif
|
||||
|
||||
constexpr absl::string_view kSupportedScalabilityModes[] = {"L1T2", "L1T3"};
|
||||
|
||||
constexpr char kVp8ForcePartitionResilience[] =
|
||||
"WebRTC-VP8-ForcePartitionResilience";
|
||||
|
||||
@ -230,6 +232,15 @@ std::unique_ptr<VideoEncoder> VP8Encoder::Create(
|
||||
std::move(settings));
|
||||
}
|
||||
|
||||
bool VP8Encoder::SupportsScalabilityMode(absl::string_view scalability_mode) {
|
||||
for (const auto& entry : kSupportedScalabilityModes) {
|
||||
if (entry == scalability_mode) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
vpx_enc_frame_flags_t LibvpxVp8Encoder::EncodeFlags(
|
||||
const Vp8FrameConfig& references) {
|
||||
RTC_DCHECK(!references.drop_frame);
|
||||
|
||||
@ -15,6 +15,7 @@
|
||||
#include <memory>
|
||||
#include <vector>
|
||||
|
||||
#include "absl/strings/string_view.h"
|
||||
#include "api/video_codecs/sdp_video_format.h"
|
||||
#include "media/base/codec.h"
|
||||
#include "modules/video_coding/include/video_codec_interface.h"
|
||||
@ -36,6 +37,7 @@ class VP9Encoder : public VideoEncoder {
|
||||
static std::unique_ptr<VP9Encoder> Create();
|
||||
// Parses VP9 Profile from `codec` and returns the appropriate implementation.
|
||||
static std::unique_ptr<VP9Encoder> Create(const cricket::VideoCodec& codec);
|
||||
static bool SupportsScalabilityMode(absl::string_view scalability_mode);
|
||||
|
||||
~VP9Encoder() override {}
|
||||
};
|
||||
|
||||
@ -23,6 +23,13 @@
|
||||
#include "vpx/vpx_codec.h"
|
||||
|
||||
namespace webrtc {
|
||||
namespace {
|
||||
constexpr absl::string_view kSupportedScalabilityModes[] = {
|
||||
"L1T2", "L1T3", "L2T1", "L2T2", "L2T3", "L3T1",
|
||||
"L3T2", "L3T3", "L1T2h", "L1T3h", "L2T1h", "L2T2h",
|
||||
"L2T3h", "L3T1h", "L3T2h", "L3T3h", "L2T2_KEY", "L2T3_KEY",
|
||||
"L3T1_KEY", "L3T2_KEY", "L3T3_KEY"};
|
||||
} // namespace
|
||||
|
||||
std::vector<SdpVideoFormat> SupportedVP9Codecs() {
|
||||
#ifdef RTC_ENABLE_VP9
|
||||
@ -86,6 +93,15 @@ std::unique_ptr<VP9Encoder> VP9Encoder::Create(
|
||||
#endif
|
||||
}
|
||||
|
||||
bool VP9Encoder::SupportsScalabilityMode(absl::string_view scalability_mode) {
|
||||
for (const auto& entry : kSupportedScalabilityModes) {
|
||||
if (entry == scalability_mode) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
std::unique_ptr<VP9Decoder> VP9Decoder::Create() {
|
||||
#ifdef RTC_ENABLE_VP9
|
||||
return std::make_unique<LibvpxVp9Decoder>();
|
||||
|
||||
Reference in New Issue
Block a user