Add a flag --video_feature for Widevine

Change-Id: Id9ab958add1239972a4f94faf5e65cffe64444be
This commit is contained in:
KongQun Yang 2019-04-16 07:55:08 -07:00
parent fa7a6d967a
commit fa2c4409a6
3 changed files with 17 additions and 0 deletions

View File

@ -120,6 +120,7 @@
'../../packager.gyp:status',
'../../third_party/boringssl/boringssl.gyp:boringssl',
'../../third_party/curl/curl.gyp:libcurl',
'../../third_party/gflags/gflags.gyp:gflags',
'../../third_party/libxml/libxml.gyp:libxml',
'../../version/version.gyp:version',
],

View File

@ -74,6 +74,13 @@ message CommonEncryptionRequest {
// Enable entitlement license if set to true.
optional bool enable_entitlement_license = 16;
// Video feature identifier, which is used in conjunction with |content_id|
// to derive key IDs and content keys. For example, it can be used to generate
// different keys for HDR and SDR. The value is propagated to PSSH.
// Ignored for tracks with type AUDIO.
// Current values are "HDR".
optional string video_feature = 19;
}
message CommonEncryptionResponse {

View File

@ -6,6 +6,8 @@
#include "packager/media/base/widevine_key_source.h"
#include <gflags/gflags.h>
#include "packager/base/base64.h"
#include "packager/base/bind.h"
#include "packager/base/strings/string_number_conversions.h"
@ -20,6 +22,10 @@
#include "packager/media/base/request_signer.h"
#include "packager/media/base/widevine_common_encryption.pb.h"
DEFINE_string(video_feature,
"",
"Specify the optional video feature, e.g. HDR.");
namespace shaka {
namespace media {
namespace {
@ -364,6 +370,9 @@ void WidevineKeySource::FillRequest(bool enable_key_rotation,
if (!group_id_.empty())
request->set_group_id(group_id_.data(), group_id_.size());
if (!FLAGS_video_feature.empty())
request->set_video_feature(FLAGS_video_feature);
}
Status WidevineKeySource::GenerateKeyMessage(