Skip to content
Draft
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
95 changes: 38 additions & 57 deletions interfaces/IContentProtection.h
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
namespace Thunder {
namespace Exchange {

// @json 1.0.0
// @json 1.0.0 @text:keep
struct EXTERNAL IContentProtection : virtual public Core::IUnknown {
enum { ID = ID_CONTENTPROTECTION };

Expand Down Expand Up @@ -59,33 +59,29 @@ namespace Exchange {
State state;
// @brief same as that returned by the SecManager.
// For other cases greater than 20000 (e.g. 2)
// @text failureReason
int32_t failureReason;
};

// @alt onWatermarkStatusChanged
// @text onWatermarkStatusChanged
// @param sessionId session id for the content protection session
// (e.g. 930762523)
// (e.g. "930762523")
// @param appId application that should receive the notification
virtual void WatermarkStatusChanged(
uint32_t sessionId /* @text:sessionId */,
const string& appId /* @text:appId */,
const Status& status)
= 0;
virtual void WatermarkStatusChanged(const string& sessionId,
const string& appId, const Status& status) = 0;
};

virtual uint32_t Register(INotification* notification) = 0;
virtual uint32_t Unregister(INotification* notification) = 0;
virtual Core::hresult Register(INotification* notification) = 0;
virtual Core::hresult Unregister(INotification* notification) = 0;

// @alt openDrmSession
// @text openDrmSession
// @param clientId client that establishes the playback session
// (e.g. "com.comcast.vipa:1")
// @param appId application requesting the new watermarking session
// @param licenseRequest base64-encoded DRM license request
// @param initData video platform specific init data
// (e.g. "{\"sessionConfiguration\":{\"distributedTraceId\":\"...\"},\"accessToken\":\"...\",\"contentMetadata\":\"...\"}")
// @param sessionId generated by SecManager to track sessions
// (e.g. 930762523)
// (e.g. "930762523")
// @param response video platform specific response data
// (e.g. "{\"license\":\"...\",\"refreshDuration\":0}")
// @retval 21002 Invalid aspect dimension
Expand All @@ -111,28 +107,23 @@ namespace Exchange {
// @retval 23003 Watermark request timeout
// @retval 23012 Watermark memory allocation error
// @retval 23014 Watermark perceptibility error
virtual uint32_t OpenDrmSession(
const string& clientId /* @text:clientId */,
const string& appId /* @text:appId */,
KeySystem keySystem /* @text:keySystem */,
const string& licenseRequest /* @text:licenseRequest */,
const string& initData /* @text:initData */,
uint32_t& sessionId /* @text:sessionId @out */,
string& response /* @text:openSessionResponse @out */)
= 0;

// @alt setDrmSessionState
virtual Core::hresult OpenDrmSession(
const string& clientId, const string& appId,
KeySystem keySystem,
const string& licenseRequest, const string& initData,
string& sessionId /* @out */,
string& response /* @text:openSessionResponse @out */) = 0;

// @text setDrmSessionState
// @param sessionId sec manager generated playback session id
// (e.g. 930762523)
// (e.g. "930762523")
// @retval 21009 Invalid session id
virtual uint32_t SetDrmSessionState(
uint32_t sessionId /* @text:sessionId */,
State sessionState /* @text:sessionState */)
= 0;
virtual Core::hresult SetDrmSessionState(const string& sessionId,
State sessionState) = 0;

// @alt updateDrmSession
// @text updateDrmSession
// @param sessionId sec manager generated playback session id
// (e.g. 930762523)
// (e.g. "930762523")
// @param licenseRequest base64-encoded DRM license request
// @param initData video platform specific init data
// (e.g. "{\"sessionConfiguration\":{\"distributedTraceId\":\"...\"},\"accessToken\":\"...\",\"contentMetadata\":\"...\"}")
Expand Down Expand Up @@ -161,43 +152,33 @@ namespace Exchange {
// @retval 23003 Watermark request timeout
// @retval 23012 Watermark memory allocation error
// @retval 23014 Watermark perceptibility error
virtual uint32_t UpdateDrmSession(
uint32_t sessionId /* @text:sessionId */,
const string& licenseRequest /* @text:licenseRequest */,
const string& initData /* @text:initData */,
string& response /* @text:updateSessionResponse @out */)
= 0;

// @alt closeDrmSession
virtual Core::hresult UpdateDrmSession(const string& sessionId,
const string& licenseRequest, const string& initData,
string& response /* @text:updateSessionResponse @out */) = 0;

// @text closeDrmSession
// @param sessionId sec manager generated playback session id
// (e.g. 930762523)
// (e.g. "930762523")
// @param response video platform specific response data
// @retval 21009 Invalid session id
// @retval 21012 Invalid client id
virtual uint32_t CloseDrmSession(
uint32_t sessionId /* @text:sessionId */,
string& response /* @text:closeSessionResponse @out */)
= 0;
virtual Core::hresult CloseDrmSession(const string& sessionId,
string& response /* @text:closeSessionResponse @out */) = 0;

// @alt showWatermark
// @text showWatermark
// @param sessionId id returned on a call to openDrmSession
// (e.g. 930762523)
// (e.g. "930762523")
// @param show true when watermark has to be presented
virtual uint32_t ShowWatermark(
uint32_t sessionId /* @text:sessionId */,
bool show,
const uint8_t opacityLevel /* @text:opacityLevel @restrict:0..100 */)
= 0;
virtual Core::hresult ShowWatermark(const string& sessionId,
bool show, const uint8_t opacityLevel /* @restrict:0..100 */) = 0;

// @alt setPlaybackPosition
// @text setPlaybackPosition
// @param sessionId sec manager generated playback session id
// (e.g. 930762523)
// (e.g. "930762523")
// @param speed current playback speed
// @param position current playback position
virtual uint32_t SetPlaybackPosition(
uint32_t sessionId /* @text:sessionId */,
int32_t speed, long position)
= 0;
virtual Core::hresult SetPlaybackPosition(const string& sessionId,
int32_t speed, long position) = 0;
};

} // namespace Exchange
Expand Down
Loading