summaryrefslogtreecommitdiffstats
path: root/src/core/renderer/content_renderer_client_qt.cpp
diff options
context:
space:
mode:
authorAllan Sandfeld Jensen <allan.jensen@qt.io>2021-10-06 17:06:14 +0200
committerAllan Sandfeld Jensen <allan.jensen@qt.io>2021-12-02 09:18:45 +0100
commit61de0e721f672e854551a8938d2d42ba946398cf (patch)
tree2a36dfb72417701b093cde8b333a434f8fcacd27 /src/core/renderer/content_renderer_client_qt.cpp
parent5dc3a3fb5e3286a9643fece7c7f94cec7fc29f3e (diff)
Adaptations for Chromium 94
Change-Id: I9fb8998a3a7762b0aea70993ca231f0bbf4f7761 Reviewed-by: Michal Klocek <michal.klocek@qt.io>
Diffstat (limited to 'src/core/renderer/content_renderer_client_qt.cpp')
-rw-r--r--src/core/renderer/content_renderer_client_qt.cpp33
1 files changed, 29 insertions, 4 deletions
diff --git a/src/core/renderer/content_renderer_client_qt.cpp b/src/core/renderer/content_renderer_client_qt.cpp
index 84dd1c2a0..474c9e765 100644
--- a/src/core/renderer/content_renderer_client_qt.cpp
+++ b/src/core/renderer/content_renderer_client_qt.cpp
@@ -490,6 +490,32 @@ static void AddExternalClearKey(std::vector<std::unique_ptr<media::KeySystemProp
}
#if BUILDFLAG(ENABLE_WIDEVINE)
+media::SupportedCodecs GetVP9Codecs(const std::vector<media::VideoCodecProfile> &profiles)
+{
+ if (profiles.empty()) {
+ // If no profiles are specified, then all are supported.
+ return media::EME_CODEC_VP9_PROFILE0 | media::EME_CODEC_VP9_PROFILE2;
+ }
+
+ media::SupportedCodecs supported_vp9_codecs = media::EME_CODEC_NONE;
+ for (const auto& profile : profiles) {
+ switch (profile) {
+ case media::VP9PROFILE_PROFILE0:
+ supported_vp9_codecs |= media::EME_CODEC_VP9_PROFILE0;
+ break;
+ case media::VP9PROFILE_PROFILE2:
+ supported_vp9_codecs |= media::EME_CODEC_VP9_PROFILE2;
+ break;
+ default:
+ DVLOG(1) << "Unexpected " << GetCodecName(media::VideoCodec::kCodecVP9)
+ << " profile: " << GetProfileName(profile);
+ break;
+ }
+ }
+
+ return supported_vp9_codecs;
+}
+
static media::SupportedCodecs GetSupportedCodecs(const media::CdmCapability& capability,
bool is_secure)
{
@@ -518,13 +544,12 @@ static media::SupportedCodecs GetSupportedCodecs(const media::CdmCapability& cap
}
for (const auto &codec : capability.video_codecs) {
- switch (codec) {
+ switch (codec.first) {
case media::VideoCodec::kCodecVP8:
supported_codecs |= media::EME_CODEC_VP8;
break;
case media::VideoCodec::kCodecVP9:
- supported_codecs |= media::EME_CODEC_VP9_PROFILE0;
- supported_codecs |= media::EME_CODEC_VP9_PROFILE2;
+ supported_codecs |= GetVP9Codecs(codec.second);
break;
case media::VideoCodec::kCodecAV1:
supported_codecs |= media::EME_CODEC_AV1;
@@ -535,7 +560,7 @@ static media::SupportedCodecs GetSupportedCodecs(const media::CdmCapability& cap
break;
#endif // BUILDFLAG(USE_PROPRIETARY_CODECS)
default:
- DVLOG(1) << "Unexpected supported codec: " << GetCodecName(codec);
+ DVLOG(1) << "Unexpected supported codec: " << GetCodecName(codec.first);
break;
}
}