(This is a merge of https://widevine-internal-review.googlesource.com/9711 from the Widevine CDM repo.) This change updates the CDM's handling of init data types, previously known as MIME types, to comply with the latest version of the EME spec. Following this change, in addition to accepting the deprecated MIME types "video/mp4", "audio/mp4", "video/webm", and "audio/webm", the CDM will accept the new standard: Init data types "cenc" and "webm". Furthermore, this removes the non-PSSH-parsing path from the CDM. All platforms have unified on the CDM being responsible for parsing the concatenated PSSH box list, as outlined in the latest EME spec. As Android has shipped code that expects pre-unwrapped PSSH boxes and must maintain backwards-compatibility, code has been inserted on that platform to detect pre-unwrapped data and re-wrap it with a PSSH header before sending it to the CDM. There are some small changes to unit tests because of this change: 1) The CDM Engine unit test now no longer needs to unwrap the PSSH on any platforms when testing ISO-BMFF. It now pre-caches the unwrapped key ID for use when testing WebM. 2) Several substantially-similar unit tests in the Android code have been rolled into one test. Bug: 13564917 Bug: 13570595 Bug: 9465346 Bug: 13570288 Change-Id: I7f27b16b8503f24a26746b5dce71fb61b6fd1bb2
43 lines
1.0 KiB
C++
43 lines
1.0 KiB
C++
// Copyright 2014 Google Inc. All Rights Reserved.
|
|
|
|
#ifndef CORE_INCLUDE_INITIALIZATION_DATA_H_
|
|
#define CORE_INCLUDE_INITIALIZATION_DATA_H_
|
|
|
|
#include <string>
|
|
|
|
#include "wv_cdm_types.h"
|
|
|
|
namespace wvcdm {
|
|
|
|
class WvCdmEngineTest;
|
|
|
|
class InitializationData {
|
|
public:
|
|
InitializationData(const std::string& type,
|
|
const CdmInitData& data = CdmInitData());
|
|
|
|
bool is_supported() const { return is_cenc_ || is_webm_; }
|
|
bool is_cenc() const { return is_cenc_; }
|
|
bool is_webm() const { return is_webm_; }
|
|
|
|
bool IsEmpty() const { return data_.empty(); }
|
|
|
|
const std::string& type() const { return type_; }
|
|
const CdmInitData& data() const { return data_; }
|
|
|
|
private:
|
|
// Parse a blob of multiple concatenated PSSH atoms to extract the first
|
|
// Widevine PSSH.
|
|
bool ExtractWidevinePssh(const CdmInitData& init_data, CdmInitData* output);
|
|
|
|
std::string type_;
|
|
CdmInitData data_;
|
|
bool is_cenc_;
|
|
bool is_webm_;
|
|
CORE_DISALLOW_COPY_AND_ASSIGN(InitializationData);
|
|
};
|
|
|
|
} // namespace wvcdm
|
|
|
|
#endif // CORE_INCLUDE_INITIALIZATION_DATA_H_
|