ISOFairPlayStreamingPsshBox.h [plain text]
#pragma once
#include "ISOProtectionSystemSpecificHeaderBox.h"
#include <wtf/Optional.h>
namespace WebCore {
class WEBCORE_EXPORT ISOFairPlayStreamingInfoBox final : public ISOFullBox {
public:
static FourCC boxTypeName() { return "fpsi"; }
FourCC scheme() const { return m_scheme; }
private:
bool parse(JSC::DataView&, unsigned& offset) override;
FourCC m_scheme;
};
class WEBCORE_EXPORT ISOFairPlayStreamingKeyRequestInfoBox final : public ISOFullBox {
public:
static FourCC boxTypeName() { return "fkri"; }
using KeyID = Vector<uint8_t, 16>;
const KeyID& keyID() const { return m_keyID; }
private:
bool parse(JSC::DataView&, unsigned& offset) override;
KeyID m_keyID;
};
class WEBCORE_EXPORT ISOFairPlayStreamingKeyAssetIdBox final : public ISOBox {
public:
static FourCC boxTypeName() { return "fkai"; }
const Vector<uint8_t> data() const { return m_data; }
private:
bool parse(JSC::DataView&, unsigned& offset) override;
Vector<uint8_t> m_data;
};
class WEBCORE_EXPORT ISOFairPlayStreamingKeyContextBox final : public ISOBox {
public:
static FourCC boxTypeName() { return "fkcx"; }
const Vector<uint8_t> data() const { return m_data; }
private:
bool parse(JSC::DataView&, unsigned& offset) override;
Vector<uint8_t> m_data;
};
class WEBCORE_EXPORT ISOFairPlayStreamingKeyVersionListBox final : public ISOBox {
public:
static FourCC boxTypeName() { return "fkvl"; }
const Vector<uint8_t> versions() const { return m_versions; }
private:
bool parse(JSC::DataView&, unsigned& offset) override;
Vector<uint8_t> m_versions;
};
class WEBCORE_EXPORT ISOFairPlayStreamingKeyRequestBox final : public ISOBox {
public:
static FourCC boxTypeName() { return "fpsk"; }
const ISOFairPlayStreamingKeyRequestInfoBox& requestInfo() const { return m_requestInfo; }
const Optional<ISOFairPlayStreamingKeyAssetIdBox>& assetID() const { return m_assetID; }
const Optional<ISOFairPlayStreamingKeyContextBox>& content() const { return m_context; }
const Optional<ISOFairPlayStreamingKeyVersionListBox>& versionList() const { return m_versionList; }
private:
bool parse(JSC::DataView&, unsigned& offset) override;
ISOFairPlayStreamingKeyRequestInfoBox m_requestInfo;
Optional<ISOFairPlayStreamingKeyAssetIdBox> m_assetID;
Optional<ISOFairPlayStreamingKeyContextBox> m_context;
Optional<ISOFairPlayStreamingKeyVersionListBox> m_versionList;
};
class WEBCORE_EXPORT ISOFairPlayStreamingInitDataBox final : public ISOBox {
public:
static FourCC boxTypeName() { return "fpsd"; }
const ISOFairPlayStreamingInfoBox& info() const { return m_info; }
const Vector<ISOFairPlayStreamingKeyRequestBox>& requests() const { return m_requests; }
private:
bool parse(JSC::DataView&, unsigned& offset) override;
ISOFairPlayStreamingInfoBox m_info;
Vector<ISOFairPlayStreamingKeyRequestBox> m_requests;
};
class WEBCORE_EXPORT ISOFairPlayStreamingPsshBox final : public ISOProtectionSystemSpecificHeaderBox {
public:
static const Vector<uint8_t>& fairPlaySystemID();
const ISOFairPlayStreamingInitDataBox& initDataBox() { return m_initDataBox; }
private:
bool parse(JSC::DataView&, unsigned& offset) override;
ISOFairPlayStreamingInitDataBox m_initDataBox;
};
}
SPECIALIZE_TYPE_TRAITS_BEGIN(WebCore::ISOFairPlayStreamingPsshBox) \
static bool isType(const WebCore::ISOProtectionSystemSpecificHeaderBox& psshBox) { return psshBox.systemID() == WebCore::ISOFairPlayStreamingPsshBox::fairPlaySystemID(); }
SPECIALIZE_TYPE_TRAITS_END()