Offline playback for fastball

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

This adds support for offline playback. If the content contains
mutiple playlists which contain differing EXT-X-KEY attribute lists,
each of those keys will need to be saved and restored into separate
sessions.

b/30041089

Test: Added unit tests to cover new functionality. Some oem_crypto,
request_license_test failures but the same as without this CL.

Change-Id: Ia1b877e12a67e8a720d29897ac7e2da236090123
This commit is contained in:
Rahul Frias
2017-01-09 17:54:06 -08:00
parent 3bb90b9450
commit 079ee03869
4 changed files with 231 additions and 2 deletions

View File

@@ -98,6 +98,13 @@ class DeviceFiles {
CdmKeyMessage* license_request,
CdmKeyResponse* license_response);
virtual bool StoreHlsAttributes(const std::string& key_set_id,
const CdmHlsMethod method,
const std::vector<uint8_t>& media_segment_iv);
virtual bool RetrieveHlsAttributes(const std::string& key_set_id,
CdmHlsMethod* method,
std::vector<uint8_t>* media_segment_iv);
virtual bool DeleteHlsAttributes(const std::string& key_set_id);
private:
// Helpers that wrap the File interface and automatically handle hashing, as
// well as adding the device files base path to to the file name.
@@ -112,6 +119,7 @@ class DeviceFiles {
ssize_t GetFileSize(const std::string& name);
static std::string GetCertificateFileName();
static std::string GetHlsAttributesFileNameExtension();
static std::string GetLicenseFileNameExtension();
static std::string GetUsageInfoFileName(const std::string& app_id);
static std::string GetFileNameSafeHash(const std::string& input);
@@ -122,6 +130,9 @@ class DeviceFiles {
FRIEND_TEST(DeviceCertificateTest, ReadCertificate);
FRIEND_TEST(DeviceCertificateTest, HasCertificate);
FRIEND_TEST(DeviceFilesStoreTest, StoreLicense);
FRIEND_TEST(DeviceFilesHlsAttributesTest, Delete);
FRIEND_TEST(DeviceFilesHlsAttributesTest, Read);
FRIEND_TEST(DeviceFilesHlsAttributesTest, Store);
FRIEND_TEST(DeviceFilesTest, DeleteLicense);
FRIEND_TEST(DeviceFilesTest, ReserveLicenseIdsDoesNotUseFileSystem);
FRIEND_TEST(DeviceFilesTest, RetrieveLicenses);