Reformat wv core/src files
[ Merge of http://go/wvgerrit/80484 ] Clang-format has been run on files in core/src. clang-format has been turned off for some blocks but otherwise no other changes have been made. Bug: 134365840 Test: WV unit/integration tests Change-Id: I6e509f25136f84d37de3d920084302f0f2c23dc4
This commit is contained in:
@@ -5,6 +5,7 @@
|
||||
#include "initialization_data.h"
|
||||
|
||||
#include <string.h>
|
||||
|
||||
#include <string>
|
||||
|
||||
#include "buffer_reader.h"
|
||||
@@ -134,7 +135,8 @@ bool InitializationData::SelectWidevinePssh(const CdmInitData& init_data,
|
||||
if (!pssh.ParseFromString(pssh_payloads[i])) {
|
||||
LOGE(
|
||||
"InitializationData::SelectWidevinePssh: Unable to parse PSSH data "
|
||||
"%lu into a protobuf.", i);
|
||||
"%lu into a protobuf.",
|
||||
i);
|
||||
continue;
|
||||
}
|
||||
if (pssh.type() == WidevinePsshData_Type_ENTITLED_KEY) {
|
||||
@@ -164,8 +166,8 @@ bool InitializationData::SelectWidevinePssh(const CdmInitData& init_data,
|
||||
// 4 byte size of PSSH data, exclusive. (N)
|
||||
// N byte PSSH data.
|
||||
|
||||
bool InitializationData::ExtractWidevinePsshs(
|
||||
const CdmInitData& init_data, std::vector<CdmInitData>* psshs) {
|
||||
bool InitializationData::ExtractWidevinePsshs(const CdmInitData& init_data,
|
||||
std::vector<CdmInitData>* psshs) {
|
||||
if (psshs == NULL) {
|
||||
LOGE("InitializationData::ExtractWidevinePsshs: NULL psshs parameter");
|
||||
return false;
|
||||
@@ -173,7 +175,8 @@ bool InitializationData::ExtractWidevinePsshs(
|
||||
psshs->clear();
|
||||
psshs->reserve(2); // We expect 1 or 2 Widevine PSSHs
|
||||
|
||||
const uint8_t* data_start = reinterpret_cast<const uint8_t*>(init_data.data());
|
||||
const uint8_t* data_start =
|
||||
reinterpret_cast<const uint8_t*>(init_data.data());
|
||||
BufferReader reader(data_start, init_data.length());
|
||||
|
||||
while (!reader.IsEOF()) {
|
||||
@@ -243,8 +246,9 @@ bool InitializationData::ExtractWidevinePsshs(
|
||||
// Checks if the given reader contains a Widevine PSSH. If so, it extracts the
|
||||
// data from the box. Returns true if a PSSH was extracted, false if there was
|
||||
// an error or if the data is not a Widevine PSSH.
|
||||
bool InitializationData::ExtractWidevinePsshData(
|
||||
const uint8_t* data, size_t length, CdmInitData* output) {
|
||||
bool InitializationData::ExtractWidevinePsshData(const uint8_t* data,
|
||||
size_t length,
|
||||
CdmInitData* output) {
|
||||
BufferReader reader(data, length);
|
||||
|
||||
// Read the 32-bit size only so we can check if we need to expect a 64-bit
|
||||
@@ -267,8 +271,7 @@ bool InitializationData::ExtractWidevinePsshData(
|
||||
return false;
|
||||
}
|
||||
if (memcmp(&atom_type[0], "pssh", 4) != 0) {
|
||||
LOGV(
|
||||
"InitializationData::ExtractWidevinePsshData: Atom type is not PSSH.");
|
||||
LOGV("InitializationData::ExtractWidevinePsshData: Atom type is not PSSH.");
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -313,9 +316,8 @@ bool InitializationData::ExtractWidevinePsshData(
|
||||
"system ID.");
|
||||
return false;
|
||||
}
|
||||
if (memcmp(&system_id[0],
|
||||
kWidevineSystemId,
|
||||
sizeof(kWidevineSystemId)) != 0) {
|
||||
if (memcmp(&system_id[0], kWidevineSystemId, sizeof(kWidevineSystemId)) !=
|
||||
0) {
|
||||
LOGV(
|
||||
"InitializationData::ExtractWidevinePsshData: Found a non-Widevine "
|
||||
"PSSH.");
|
||||
|
||||
Reference in New Issue
Block a user