The EME spec technically requires CDMs to treat audio/mp4 and video/mp4 equivalently, as well as audio/webm and video/webm. We had only been accepting video/mp4 and video/webm up until now. This change also centralizes handling of init data types in the shared CDM code instead of having it spread across multiple places in the codebase. (This is a merge of https://widevine-internal-review.googlesource.com/9532/ from the Widevine CDM repo.) Bug: 13564917 Change-Id: Ib8bdfb2b003ffb00e8f0559561335abb3c5778b0
48 lines
1.2 KiB
C++
48 lines
1.2 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:
|
|
friend WvCdmEngineTest;
|
|
|
|
// Parse a blob of multiple concatenated PSSH atoms to extract the first
|
|
// Widevine PSSH.
|
|
// TODO(juce): Make this non-static and remove the friend above once the unit
|
|
// test is rewritten to not need this.
|
|
static 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_
|