Cas Client repo update.
-Parse EMM in Cas plugin -Entitlement key rotation support -Multi_content_license support
This commit is contained in:
49
plugin/include/emm_parser.h
Normal file
49
plugin/include/emm_parser.h
Normal file
@@ -0,0 +1,49 @@
|
||||
// Copyright 2020 Google LLC. All Rights Reserved. This file and proprietary
|
||||
// source code may only be used and distributed under the Widevine Master
|
||||
// License Agreement.
|
||||
|
||||
#ifndef EMM_PARSER_H
|
||||
#define EMM_PARSER_H
|
||||
|
||||
#include <memory>
|
||||
#include <vector>
|
||||
|
||||
#include "cas_types.h"
|
||||
#include "media_cas.pb.h"
|
||||
|
||||
namespace wvcas {
|
||||
|
||||
using video_widevine::EmmPayload;
|
||||
|
||||
class EmmParser {
|
||||
public:
|
||||
EmmParser(const EmmParser&) = delete;
|
||||
EmmParser& operator=(const EmmParser&) = delete;
|
||||
virtual ~EmmParser() = default;
|
||||
|
||||
// The EmmParser factory method.
|
||||
// The methods validates the passed in |emm|. If validation is successful, it
|
||||
// constructs and returns an EmmParser. Otherwise, nullptr is returned.
|
||||
static std::unique_ptr<const EmmParser> Create(const CasEmm& emm);
|
||||
|
||||
// Accessor methods.
|
||||
virtual uint64_t timestamp() const { return timestamp_; }
|
||||
virtual std::string signature() const { return signature_; }
|
||||
virtual EmmPayload emm_payload() const { return emm_payload_; };
|
||||
|
||||
protected:
|
||||
// Called by the factory create and unit test.
|
||||
EmmParser() = default;
|
||||
|
||||
private:
|
||||
bool Parse(int start_index, const CasEmm& emm);
|
||||
|
||||
uint8_t version_;
|
||||
uint64_t timestamp_;
|
||||
EmmPayload emm_payload_;
|
||||
std::string signature_;
|
||||
};
|
||||
|
||||
} // namespace wvcas
|
||||
|
||||
#endif // EMM_PARSER_H
|
||||
Reference in New Issue
Block a user