Fix deprecated and printf warnings.

[ Merge of http://go/wvgerrit/118703 ]

Bug: 182058081
Test: WV unit/integration tests
Change-Id: I2d8995b8aab864a2d2f5161d12a473d34e67bad4
This commit is contained in:
Rahul Frias
2021-03-07 00:03:17 -08:00
parent 71cf45fb3f
commit 24e4c33262
5 changed files with 30 additions and 10 deletions

View File

@@ -7,6 +7,7 @@
#include "crypto_session.h"
#include <inttypes.h>
#include <string.h>
#include <algorithm>
@@ -1745,11 +1746,11 @@ CdmResponseType CryptoSession::GenerateUsageReport(
static_cast<int>(pst_report.pst_length()));
LOGV("OEMCrypto_PST_Report.padding: %d\n",
static_cast<int>(pst_report.padding()));
LOGV("OEMCrypto_PST_Report.seconds_since_license_received: %ld\n",
LOGV("OEMCrypto_PST_Report.seconds_since_license_received: %" PRId64 "\n",
pst_report.seconds_since_license_received());
LOGV("OEMCrypto_PST_Report.seconds_since_first_decrypt: %ld\n",
LOGV("OEMCrypto_PST_Report.seconds_since_first_decrypt: %" PRId64 "\n",
pst_report.seconds_since_first_decrypt());
LOGV("OEMCrypto_PST_Report.seconds_since_last_decrypt: %ld\n",
LOGV("OEMCrypto_PST_Report.seconds_since_last_decrypt: %" PRId64 "\n",
pst_report.seconds_since_last_decrypt());
LOGV("OEMCrypto_PST_Report: %s\n", b2a_hex(*usage_report).c_str());

View File

@@ -558,13 +558,16 @@ bool InitializationData::ConstructWidevineInitData(
// Now format as Widevine init data protobuf
WidevinePsshData cenc_header;
// TODO(rfrias): The algorithm is a deprecated field, but proto changes
// have not yet been pushed to production. Set until then.
// TODO(rfrias): The algorithm and provider are deprecated fields, but proto
// changes have not yet been pushed to production. Set until then.
CORE_UTIL_IGNORE_DEPRECATED
cenc_header.set_algorithm(WidevinePsshData_Algorithm_AESCTR);
cenc_header.set_provider(provider);
CORE_UTIL_RESTORE_WARNINGS
for (size_t i = 0; i < key_ids.size(); ++i) {
cenc_header.add_key_ids(key_ids[i]);
}
cenc_header.set_provider(provider);
cenc_header.set_content_id(content_id);
if (method == kHlsMethodAes128)
cenc_header.set_protection_scheme(kFourCcCbc1);