diff --git a/interfaces/IContentProtection.h b/interfaces/IContentProtection.h index c883c4ef..db0e2f60 100644 --- a/interfaces/IContentProtection.h +++ b/interfaces/IContentProtection.h @@ -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 }; @@ -59,25 +59,21 @@ 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 @@ -85,7 +81,7 @@ namespace Exchange { // @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 @@ -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\":\"...\"}") @@ -161,43 +152,44 @@ 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; + }; + + // @json 1.0.0 @text:keep + struct EXTERNAL IErrorToString : virtual public Core::IUnknown { + enum { ID = ID_ERRORTOSTRING }; + + ~IErrorToString() override = default; + + // @text errorToString + virtual Core::hresult ErrorToString( + const int32_t code, string& result /* @out */) const = 0; }; } // namespace Exchange diff --git a/interfaces/Ids.h b/interfaces/Ids.h index 9ddb0bb4..18e63e70 100644 --- a/interfaces/Ids.h +++ b/interfaces/Ids.h @@ -387,6 +387,7 @@ namespace Exchange { ID_CONTENTPROTECTION = RPC::IDS::ID_EXTERNAL_INTERFACE_OFFSET + 0x500, ID_CONTENTPROTECTION_NOTIFICATION = ID_CONTENTPROTECTION + 1, + ID_ERRORTOSTRING = ID_CONTENTPROTECTION + 2, ID_WATERMARK = RPC::IDS::ID_EXTERNAL_INTERFACE_OFFSET + 0x510, ID_WATERMARK_NOTIFICATION = ID_WATERMARK + 2,