Source release v3.0.2
This commit is contained in:
@@ -130,6 +130,20 @@ class CDM_EXPORT Cdm : public ITimerClient {
|
||||
// See Cdm::createSession().
|
||||
class IEventListener {
|
||||
public:
|
||||
// A URL to be added to a renewal request message.
|
||||
// This call will immediately precede the onMessage() call.
|
||||
// Do not override this call if the URL is not needed.
|
||||
//
|
||||
// WARNING: this call exists temporarily to allow interoperation with
|
||||
// older versions of Chromium and the prefixed EME API. This call will
|
||||
// be removed in a future release. Therefore: (1) Do not use this call
|
||||
// unless you are certain that it is needed on your platform for your
|
||||
// application, and (2) If it is needed, figure how move to a new version
|
||||
// of Chromium and the unprefixed EME API as soon as possible.
|
||||
// TODO: Remove this call (see b/24776024).
|
||||
virtual void onMessageUrl(const std::string& session_id,
|
||||
const std::string& server_url) {}
|
||||
|
||||
// A message (license request, renewal, etc.) to be dispatched to the
|
||||
// application's license server.
|
||||
// The response, if successful, should be provided back to the CDM via a
|
||||
|
||||
@@ -1,2 +1,2 @@
|
||||
// Widevine CE CDM Version
|
||||
#define CDM_VERSION "v3.0.1-0-g41710d9-ce"
|
||||
#define CDM_VERSION "v3.0.2-0-g161de1b-ce"
|
||||
|
||||
@@ -288,13 +288,20 @@ Cdm::Status CdmImpl::generateRequest(const std::string& session_id,
|
||||
return kInvalidAccess;
|
||||
}
|
||||
|
||||
InitializationData init_data_obj(init_data_type_name, init_data);
|
||||
|
||||
if (init_data_obj.IsEmpty()) {
|
||||
LOGE("Failed to parse init data.");
|
||||
if (init_data.empty()) {
|
||||
LOGE("Empty init data is not valid.");
|
||||
return kInvalidAccess;
|
||||
}
|
||||
|
||||
InitializationData init_data_obj(init_data_type_name, init_data);
|
||||
if (init_data_obj.IsEmpty()) {
|
||||
// Note that InitializationData's idea of "empty" includes "failed to find
|
||||
// and parse a Widevine PSSH". This should not happen for WebM init data,
|
||||
// which requires no parsing.
|
||||
LOGE("Failed to parse init data, may not contain a Widevine PSSH.");
|
||||
return kNotSupported;
|
||||
}
|
||||
|
||||
std::string key_request;
|
||||
CdmKeyRequestType key_request_type;
|
||||
std::string ignored_server_url;
|
||||
@@ -404,6 +411,8 @@ Cdm::Status CdmImpl::update(const std::string& session_id,
|
||||
bool predicted_to_be_server_cert_response =
|
||||
property_set_.use_privacy_mode() &&
|
||||
property_set_.service_certificate().empty();
|
||||
(void)predicted_to_be_server_cert_response;
|
||||
// predicted_to_be_server_cert_response is now used when assertions are off.
|
||||
|
||||
// NOTE: If the CdmSession object recognizes that this is not the first
|
||||
// AddKey(), it will internally delegate to RenewKey().
|
||||
@@ -640,6 +649,11 @@ void CdmImpl::OnSessionRenewalNeeded(const CdmSessionId& session_id) {
|
||||
|
||||
LOGI("A license renewal has been generated.");
|
||||
MessageType message_type = kLicenseRenewal;
|
||||
|
||||
// Post the server_url before providing the message.
|
||||
// For systems that still require the server URL,
|
||||
// the listener will add the URL to its renewal request.
|
||||
listener_->onMessageUrl(session_id, server_url);
|
||||
listener_->onMessage(session_id, message_type, message);
|
||||
}
|
||||
|
||||
@@ -650,7 +664,6 @@ void CdmImpl::OnSessionKeysChange(const CdmSessionId& session_id,
|
||||
|
||||
CdmKeyStatusMap::const_iterator it;
|
||||
for (it = keys_status.begin(); it != keys_status.end(); ++it) {
|
||||
KeyStatus status;
|
||||
switch (it->second) {
|
||||
case kKeyStatusUsable:
|
||||
map[it->first] = kUsable;
|
||||
@@ -835,7 +848,8 @@ int64_t Clock::GetCurrentTime() {
|
||||
return host.clock->now() / 1000;
|
||||
}
|
||||
|
||||
struct File::Impl {
|
||||
class File::Impl {
|
||||
public:
|
||||
std::string name;
|
||||
bool read_only;
|
||||
bool truncate;
|
||||
|
||||
@@ -8,7 +8,8 @@
|
||||
|
||||
namespace wvcdm {
|
||||
|
||||
struct Lock::Impl {
|
||||
class Lock::Impl {
|
||||
public:
|
||||
pthread_mutex_t mutex;
|
||||
};
|
||||
|
||||
|
||||
@@ -76,6 +76,16 @@ const std::string kCencPersistentInitData = a2bs_hex(
|
||||
// pssh data:
|
||||
"08011a0d7769646576696e655f746573"
|
||||
"74220d6f66666c696e655f636c697032");
|
||||
const std::string kInvalidCencInitData = a2bs_hex(
|
||||
"0000000c" // blob size
|
||||
"61736466" // "asdf" (wrong box type)
|
||||
"01020304"); // nonsense
|
||||
const std::string kNonWidevineCencInitData = a2bs_hex(
|
||||
"00000020" // blob size
|
||||
"70737368" // "pssh"
|
||||
"00000000" // flags
|
||||
"000102030405060708090a0b0c0d0e0f" // unknown system id
|
||||
"00000000"); // pssh data size
|
||||
const std::string kWebMInitData = a2bs_hex("deadbeefdeadbeefdeadbeefdeadbeef");
|
||||
const std::string kKeyIdsInitData =
|
||||
"{\"kids\":[\"67ef0gd8pvfd0\",\"77ef0gd8pvfd0\"]}";
|
||||
@@ -582,6 +592,23 @@ TEST_F(CdmTest, GenerateRequest) {
|
||||
EXPECT_EQ(Cdm::kInvalidAccess, status);
|
||||
Mock::VerifyAndClear(this);
|
||||
|
||||
// Try to pass invalid CENC init data.
|
||||
status = cdm_->createSession(Cdm::kTemporary, &session_id);
|
||||
ASSERT_EQ(Cdm::kSuccess, status);
|
||||
EXPECT_CALL(*this, onMessage(session_id, Cdm::kLicenseRequest, _)).Times(0);
|
||||
status = cdm_->generateRequest(session_id, Cdm::kCenc, kInvalidCencInitData);
|
||||
EXPECT_EQ(Cdm::kNotSupported, status);
|
||||
Mock::VerifyAndClear(this);
|
||||
|
||||
// Try to pass non-Widevine CENC init data.
|
||||
status = cdm_->createSession(Cdm::kTemporary, &session_id);
|
||||
ASSERT_EQ(Cdm::kSuccess, status);
|
||||
EXPECT_CALL(*this, onMessage(session_id, Cdm::kLicenseRequest, _)).Times(0);
|
||||
status = cdm_->generateRequest(session_id, Cdm::kCenc,
|
||||
kNonWidevineCencInitData);
|
||||
EXPECT_EQ(Cdm::kNotSupported, status);
|
||||
Mock::VerifyAndClear(this);
|
||||
|
||||
// Try a bogus session ID.
|
||||
EXPECT_CALL(*this, onMessage(_, _, _)).Times(0);
|
||||
status = cdm_->generateRequest(kBogusSessionId, Cdm::kCenc, kCencInitData);
|
||||
|
||||
@@ -72,6 +72,7 @@ int main(int argc, char** argv) {
|
||||
Cdm::Status status = Cdm::initialize(
|
||||
Cdm::kNoSecureOutput, client_info, g_host, g_host, g_host, &cert_request,
|
||||
static_cast<Cdm::LogLevel>(verbosity));
|
||||
(void)status; // status is now used when assertions are turned off.
|
||||
assert(status == Cdm::kSuccess);
|
||||
assert(cert_request.needed == false);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user