More cleanup in proto usage
Change-Id: If35f95dbff47bc9e8c1c42cb56d75719367abfc0
This commit is contained in:
parent
4f9c8ea781
commit
7e533ec5ca
|
@ -136,7 +136,9 @@ bool SimpleHlsNotifier::NotifyEncryptionUpdate(
|
||||||
}
|
}
|
||||||
|
|
||||||
std::string content_id_base64;
|
std::string content_id_base64;
|
||||||
base::Base64Encode(pssh_data.content_id(), &content_id_base64);
|
base::Base64Encode(base::StringPiece(pssh_data.content_id().data(),
|
||||||
|
pssh_data.content_id().size()),
|
||||||
|
&content_id_base64);
|
||||||
std::string json_format = base::StringPrintf(
|
std::string json_format = base::StringPrintf(
|
||||||
"{"
|
"{"
|
||||||
"\"provider\":\"%s\","
|
"\"provider\":\"%s\","
|
||||||
|
|
|
@ -7,6 +7,10 @@
|
||||||
#ifndef PACKAGER_HLS_BASE_SIMPLE_HLS_NOTIFIER_H_
|
#ifndef PACKAGER_HLS_BASE_SIMPLE_HLS_NOTIFIER_H_
|
||||||
#define PACKAGER_HLS_BASE_SIMPLE_HLS_NOTIFIER_H_
|
#define PACKAGER_HLS_BASE_SIMPLE_HLS_NOTIFIER_H_
|
||||||
|
|
||||||
|
#include <map>
|
||||||
|
#include <string>
|
||||||
|
#include <vector>
|
||||||
|
|
||||||
#include "packager/base/atomic_sequence_num.h"
|
#include "packager/base/atomic_sequence_num.h"
|
||||||
#include "packager/base/macros.h"
|
#include "packager/base/macros.h"
|
||||||
#include "packager/base/memory/scoped_ptr.h"
|
#include "packager/base/memory/scoped_ptr.h"
|
||||||
|
|
|
@ -185,8 +185,8 @@ TEST_F(SimpleHlsNotifierTest, NotifyEncryptionUpdate) {
|
||||||
};
|
};
|
||||||
widevine_pssh_data.add_key_id()->assign(kAnyKeyId,
|
widevine_pssh_data.add_key_id()->assign(kAnyKeyId,
|
||||||
kAnyKeyId + arraysize(kAnyKeyId));
|
kAnyKeyId + arraysize(kAnyKeyId));
|
||||||
std::string widevine_pssh_data_str;
|
std::string widevine_pssh_data_str = widevine_pssh_data.SerializeAsString();
|
||||||
ASSERT_TRUE(widevine_pssh_data.SerializeToString(&widevine_pssh_data_str));
|
EXPECT_TRUE(!widevine_pssh_data_str.empty());
|
||||||
std::vector<uint8_t> pssh_data(widevine_pssh_data_str.begin(),
|
std::vector<uint8_t> pssh_data(widevine_pssh_data_str.begin(),
|
||||||
widevine_pssh_data_str.end());
|
widevine_pssh_data_str.end());
|
||||||
|
|
||||||
|
@ -255,8 +255,8 @@ TEST_F(SimpleHlsNotifierTest, MultipleKeyIdsInPssh) {
|
||||||
kFirstKeyId + arraysize(kFirstKeyId));
|
kFirstKeyId + arraysize(kFirstKeyId));
|
||||||
widevine_pssh_data.add_key_id()->assign(
|
widevine_pssh_data.add_key_id()->assign(
|
||||||
kSecondKeyId, kSecondKeyId + arraysize(kSecondKeyId));
|
kSecondKeyId, kSecondKeyId + arraysize(kSecondKeyId));
|
||||||
std::string widevine_pssh_data_str;
|
std::string widevine_pssh_data_str = widevine_pssh_data.SerializeAsString();
|
||||||
ASSERT_TRUE(widevine_pssh_data.SerializeToString(&widevine_pssh_data_str));
|
EXPECT_TRUE(!widevine_pssh_data_str.empty());
|
||||||
std::vector<uint8_t> pssh_data(widevine_pssh_data_str.begin(),
|
std::vector<uint8_t> pssh_data(widevine_pssh_data_str.begin(),
|
||||||
widevine_pssh_data_str.end());
|
widevine_pssh_data_str.end());
|
||||||
|
|
||||||
|
@ -320,8 +320,8 @@ TEST_F(SimpleHlsNotifierTest, NotifyEncryptionUpdateEmptyIv) {
|
||||||
};
|
};
|
||||||
widevine_pssh_data.add_key_id()->assign(kAnyKeyId,
|
widevine_pssh_data.add_key_id()->assign(kAnyKeyId,
|
||||||
kAnyKeyId + arraysize(kAnyKeyId));
|
kAnyKeyId + arraysize(kAnyKeyId));
|
||||||
std::string widevine_pssh_data_str;
|
std::string widevine_pssh_data_str = widevine_pssh_data.SerializeAsString();
|
||||||
ASSERT_TRUE(widevine_pssh_data.SerializeToString(&widevine_pssh_data_str));
|
EXPECT_TRUE(!widevine_pssh_data_str.empty());
|
||||||
std::vector<uint8_t> pssh_data(widevine_pssh_data_str.begin(),
|
std::vector<uint8_t> pssh_data(widevine_pssh_data_str.begin(),
|
||||||
widevine_pssh_data_str.end());
|
widevine_pssh_data_str.end());
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue