29 #include "sec_client.h"
34 std::map<const int32_t, std::pair<const int32_t, const int32_t>> secClientSeManagerErrorLookUp =
36 {SEC_CLIENT_RESULT_SUCCESS, {SECMANAGER_CLASS_RESULT_SUCCESS, SECMANAGER_SUCCESS}},
37 {SEC_CLIENT_RESULT_FAILURE, {SECMANAGER_CLASS_RESULT_DRM_FAIL, SECMANAGER_REASON_DRM_GENERAL_FAILURE}},
38 {SEC_CLIENT_RESULT_INVALID_PARAMETERS, {SECMANAGER_CLASS_RESULT_SECCLIENT_FAIL, 0}},
39 {SEC_CLIENT_RESULT_HTTP_RESULT_FAILURE_GENERIC, {SECMANAGER_CLASS_RESULT_DRM_FAIL, SECMANAGER_REASON_DRM_LICENSE_NETWORK_FAIL}},
40 {SEC_CLIENT_RESULT_HTTP_RESULT_FAILURE_TOO_MANY_REDIRECTS, {SECMANAGER_CLASS_RESULT_DRM_FAIL, SECMANAGER_REASON_DRM_LICENSE_NETWORK_FAIL}},
41 {SEC_CLIENT_RESULT_HTTP_RESULT_FAILURE_CONNECTIVITY, {SECMANAGER_CLASS_RESULT_DRM_FAIL, SECMANAGER_REASON_DRM_LICENSE_NETWORK_FAIL}},
42 {SEC_CLIENT_RESULT_HTTP_RESULT_FAILURE_HOST_RESOLUTION, {SECMANAGER_CLASS_RESULT_DRM_FAIL, SECMANAGER_REASON_DRM_LICENSE_NETWORK_FAIL}},
43 {SEC_CLIENT_RESULT_HTTP_RESULT_FAILURE_TIMEOUT, {SECMANAGER_CLASS_RESULT_DRM_FAIL, SECMANAGER_REASON_DRM_LICENSE_NETWORK_FAIL}},
44 {SEC_CLIENT_RESULT_HTTP_RESULT_FAILURE_TLS, {SECMANAGER_CLASS_RESULT_DRM_FAIL, SECMANAGER_REASON_DRM_LICENSE_NETWORK_FAIL}},
45 {SEC_CLIENT_RESULT_MAC_AUTH_NOT_PROVISIONED, {SECMANAGER_CLASS_RESULT_DRM_FAIL, SECMANAGER_REASON_DRM_MAC_TOKEN_NO_PROV}},
46 {SEC_CLIENT_RESULT_MONEYTRACE_MISSING_OR_MALFORMED, {SECMANAGER_CLASS_RESULT_SECCLIENT_FAIL, 0}},
47 {SEC_CLIENT_RESULT_REQUEST_CREATION_ERROR, {SECMANAGER_CLASS_RESULT_DRM_FAIL, SECMANAGER_REASON_DRM_GENERAL_FAILURE}},
48 {SEC_CLIENT_RESULT_MALFORMED_RESPONSE_ERROR, {SECMANAGER_CLASS_RESULT_DRM_FAIL, SECMANAGER_REASON_DRM_GENERAL_FAILURE}},
49 {SEC_CLIENT_RESULT_MALFORMED_CONFIGURATION_PARAMETER_ERROR,{SECMANAGER_CLASS_RESULT_DRM_FAIL, SECMANAGER_REASON_DRM_GENERAL_FAILURE}},
50 {SEC_CLIENT_RESULT_MEMORY_ERROR, {SECMANAGER_CLASS_RESULT_DRM_FAIL, SECMANAGER_REASON_DRM_MEMORY_ALLOCATION_ERROR}},
51 {SEC_CLIENT_RESULT_FAILED_TO_LOAD_SEC_LIBRARY_ERROR, {SECMANAGER_CLASS_RESULT_SECCLIENT_FAIL, 0}},
52 {SEC_CLIENT_RESULT_INVALID_LOAD_CONFIGURATION_ERROR, {SECMANAGER_CLASS_RESULT_SECCLIENT_FAIL, 0}},
53 {SEC_CLIENT_RESULT_INVALID_LOAD_CRYPTO_TYPE_ERROR, {SECMANAGER_CLASS_RESULT_SECCLIENT_FAIL, 0}},
54 {SEC_CLIENT_RESULT_INVALID_LOAD_TIMEOUT_ERROR, {SECMANAGER_CLASS_RESULT_SECCLIENT_FAIL, 0}},
55 {SEC_CLIENT_RESULT_JSON_ENCODING_ERROR, {SECMANAGER_CLASS_RESULT_DRM_FAIL, SECMANAGER_REASON_DRM_GENERAL_FAILURE}},
56 {SEC_CLIENT_RESULT_UNSUPPORTED_FEATURE, {SECMANAGER_CLASS_RESULT_SECCLIENT_FAIL, 0}},
57 {SEC_CLIENT_RESULT_WATERMARKING_NOT_REQUIRED, {SECMANAGER_CLASS_RESULT_DRM_FAIL, SECMANAGER_REASON_DRM_GENERAL_FAILURE}},
58 {SEC_CLIENT_RESULT_WATERMARKING_SESSION_DENIED, {SECMANAGER_CLASS_RESULT_DRM_FAIL, SECMANAGER_REASON_DRM_GENERAL_FAILURE}},
59 {SEC_CLIENT_RESULT_GENERAL_CRYPTOGRAPHIC_ERROR, {SECMANAGER_CLASS_RESULT_DRM_FAIL, SECMANAGER_REASON_DRM_GENERAL_FAILURE}},
60 {SEC_CLIENT_RESULT_UNKNOWN_CRYPTO_ENGINE, {SECMANAGER_CLASS_RESULT_DRM_FAIL, SECMANAGER_REASON_DRM_GENERAL_FAILURE}},
61 {SEC_CLIENT_RESULT_UNKNOWN_KEY_AGREEMENT_ALGO, {SECMANAGER_CLASS_RESULT_DRM_FAIL, SECMANAGER_REASON_DRM_GENERAL_FAILURE}},
62 {SEC_CLIENT_RESULT_INTERNAL_ERROR_EXPONENT, {SECMANAGER_CLASS_RESULT_DRM_FAIL, SECMANAGER_REASON_DRM_GENERAL_FAILURE}},
63 {SEC_CLIENT_RESULT_INTERNAL_ERROR_RANDOM, {SECMANAGER_CLASS_RESULT_DRM_FAIL, SECMANAGER_REASON_DRM_GENERAL_FAILURE}},
64 {SEC_CLIENT_RESULT_UNSUPPORTED_HASH_ALGORITHM, {SECMANAGER_CLASS_RESULT_DRM_FAIL, SECMANAGER_REASON_DRM_GENERAL_FAILURE}},
65 {SEC_CLIENT_RESULT_ERROR_CREATING_MAC_AUTH_HEADER, {SECMANAGER_CLASS_RESULT_DRM_FAIL, SECMANAGER_REASON_DRM_GENERAL_FAILURE}},
66 {SEC_CLIENT_RESULT_ERROR_GENERATING_KEY_PAIR, {SECMANAGER_CLASS_RESULT_DRM_FAIL, SECMANAGER_REASON_DRM_GENERAL_FAILURE}},
67 {SEC_CLIENT_RESULT_ERROR_GENERATING_DERIVED_KEYS, {SECMANAGER_CLASS_RESULT_DRM_FAIL, SECMANAGER_REASON_DRM_GENERAL_FAILURE}},
68 {SEC_CLIENT_RESULT_ERROR_GENERATING_MAC_VALUE, {SECMANAGER_CLASS_RESULT_DRM_FAIL, SECMANAGER_REASON_DRM_GENERAL_FAILURE}},
69 {SEC_CLIENT_RESULT_CLIENT_VERFICATION_ERROR, {SECMANAGER_CLASS_RESULT_DRM_FAIL, SECMANAGER_REASON_DRM_GENERAL_FAILURE}},
70 {SEC_CLIENT_RESULT_MISSING_SESSION_CREDENTIALS, {SECMANAGER_CLASS_RESULT_DRM_FAIL, SECMANAGER_REASON_DRM_GENERAL_FAILURE}},
71 {SEC_CLIENT_RESULT_ENCRYPTION_KEY_MISMATCH, {SECMANAGER_CLASS_RESULT_DRM_FAIL, SECMANAGER_REASON_DRM_GENERAL_FAILURE}},
72 {SEC_CLIENT_RESULT_PKCS7_SIGNATURE_ERROR, {SECMANAGER_CLASS_RESULT_API_FAIL, SECMANAGER_REASON_API_UNDEFINED_ERROR}},
73 {SEC_CLIENT_RESULT_CLIENT_AUTH_TOKEN_FAILURE, {SECMANAGER_CLASS_RESULT_API_FAIL, SECMANAGER_REASON_API_UNDEFINED_ERROR}},
74 {SEC_CLIENT_RESULT_MISSING_KEY_PROVISIONING_DATA, {SECMANAGER_CLASS_RESULT_API_FAIL, SECMANAGER_REASON_API_UNDEFINED_ERROR}},
75 {SEC_CLIENT_RESULT_MISSING_DEVICE_AUTH_DATA, {SECMANAGER_CLASS_RESULT_API_FAIL, SECMANAGER_REASON_API_UNDEFINED_ERROR}},
76 {SEC_CLIENT_RESULT_INVALID_CONFIGURATION_PARAMETER, {SECMANAGER_CLASS_RESULT_DRM_FAIL, SECMANAGER_REASON_DRM_GENERAL_FAILURE}},
77 {SEC_CLIENT_RESULT_INVALID_DEVICE_TOKEN_PARAMETER, {SECMANAGER_CLASS_RESULT_API_FAIL, SECMANAGER_REASON_API_UNDEFINED_ERROR}},
78 {SEC_CLIENT_RESULT_INVALID_KEY_PROVISION_RESULT_PARAMETER, {SECMANAGER_CLASS_RESULT_API_FAIL, SECMANAGER_REASON_API_UNDEFINED_ERROR}},
79 {SEC_CLIENT_RESULT_INVALID_DEVICE_AUTHENTICATION_RESULT_PARAMETER, {SECMANAGER_CLASS_RESULT_API_FAIL, SECMANAGER_REASON_API_UNDEFINED_ERROR}},
80 {SEC_CLIENT_RESULT_INVALID_DEVICE_ATTRIBUTES_PARAMETER, {SECMANAGER_CLASS_RESULT_API_FAIL, SECMANAGER_REASON_API_UNDEFINED_ERROR}},
81 {SEC_CLIENT_RESULT_INVALID_ACCESS_TOKEN_PARAMETER, {SECMANAGER_CLASS_RESULT_API_FAIL, SECMANAGER_REASON_API_INVALID_ACCESS_TOKEN}},
82 {SEC_CLIENT_RESULT_INVALID_ACCESS_ATTRIBUTES_PARAMETER, {SECMANAGER_CLASS_RESULT_API_FAIL, SECMANAGER_REASON_API_INVALID_ACCESS_ATTRIBUTE}},
83 {SEC_CLIENT_RESULT_INVALID_KEY_SYSTEM_PARAMETER, {SECMANAGER_CLASS_RESULT_API_FAIL, SECMANAGER_REASON_API_INVALID_KEY_SYSTEM_PARAM}},
84 {SEC_CLIENT_RESULT_INVALID_LICENSE_REQUEST_PARAMETER, {SECMANAGER_CLASS_RESULT_API_FAIL, SECMANAGER_REASON_API_INVALID_DRM_LICENSE_PARAM}},
85 {SEC_CLIENT_RESULT_INVALID_CONTENT_METADATA_PARAMETER, {SECMANAGER_CLASS_RESULT_API_FAIL, SECMANAGER_REASON_API_INVALID_CONTENT_METADATA}},
86 {SEC_CLIENT_RESULT_INVALID_MEDIA_USAGE_PARAMETER, {SECMANAGER_CLASS_RESULT_API_FAIL, SECMANAGER_REASON_API_INVALID_MEDIA_USAGE}},
87 {SEC_CLIENT_RESULT_INVALID_LICENSE_IDENTIFIER, {SECMANAGER_CLASS_RESULT_API_FAIL, SECMANAGER_REASON_API_UNDEFINED_ERROR}},
88 {SEC_CLIENT_RESULT_INVALID_REQUEST_BODY, {SECMANAGER_CLASS_RESULT_DRM_FAIL, SECMANAGER_REASON_DRM_ENTITLEMENT_ERROR}},
89 {SEC_CLIENT_RESULT_INVALID_ACCOUNT_TOKEN_PARAMETER, {SECMANAGER_CLASS_RESULT_API_FAIL, SECMANAGER_REASON_API_UNDEFINED_ERROR}},
90 {SEC_CLIENT_RESULT_INVALID_REQUEST_METADATA_PARAMETER, {SECMANAGER_CLASS_RESULT_SECCLIENT_FAIL, 0}},
91 {SEC_CLIENT_RESULT_INVALID_CONTENT_IDENTIFIER_PARAMETER, {SECMANAGER_CLASS_RESULT_API_FAIL, SECMANAGER_REASON_API_UNDEFINED_ERROR}},
92 {SEC_CLIENT_RESULT_INVALID_DOWNLOADS_LIST_PARAMETER, {SECMANAGER_CLASS_RESULT_API_FAIL, SECMANAGER_REASON_API_UNDEFINED_ERROR}},
93 {SEC_CLIENT_RESULT_INVALID_ACQUIRE_SAT_FUNCTION_PARAMETER, {SECMANAGER_CLASS_RESULT_API_FAIL, SECMANAGER_REASON_API_UNDEFINED_ERROR}},
94 {SEC_CLIENT_RESULT_INVALID_WATERMARKING_SYSTEM_PARAMETER, {SECMANAGER_CLASS_RESULT_API_FAIL, SECMANAGER_REASON_API_INVALID_WATERMARK_PARAMETER}},
95 {SEC_CLIENT_RESULT_INVALID_CONTENT_ATTRIBUTES_PARAMETER, {SECMANAGER_CLASS_RESULT_API_FAIL, SECMANAGER_REASON_API_INVALID_CONTENT_PARAMETER}},
96 {SEC_CLIENT_RESULT_UNSUPPORTED_OR_INVALID_WATERMARK_FEATURE, {SECMANAGER_CLASS_RESULT_DRM_FAIL, SECMANAGER_REASON_DRM_GENERAL_FAILURE}},
97 {SEC_CLIENT_RESULT_INVALID_WATERMARK_SESSION_RESPONSE, {SECMANAGER_CLASS_RESULT_DRM_FAIL, SECMANAGER_REASON_DRM_GENERAL_FAILURE}}
124 mDescription(desc), mShouldRetry(shouldRetry), mSecManagerClass(classCode), mSecManagerReasonCode(reason), mBusinessStatus(businessStatus)
172 int32_t MediaErrorEvent::getClass()
const
180 int32_t MediaErrorEvent::getReason()
const
187 int32_t MediaErrorEvent::getBusinessStatus()
const
215 ProgressEvent::ProgressEvent(
double duration,
double position,
double start,
double end,
float speed,
long long pts,
double bufferedDuration, std::string seiTimecode):
217 mPosition(position), mStart(start),
218 mEnd(end), mSpeed(speed), mPTS(pts),
219 mBufferedDuration(bufferedDuration),
220 mSEITimecode(seiTimecode)
310 CCHandleEvent::CCHandleEvent(
unsigned long handle):
331 mLanguages(), mBitrates(), mWidth(width), mHeight(height),
332 mHasDrm(hasDrm), mSupportedSpeeds(), mIsLive(isLive), mDrmType(DrmType), mProgramStartTime(programStartTime),
333 mPCRating(),mSsi(-1),mFrameRate(0),mVideoScanType(
eVIDEOSCAN_UNKNOWN),mAspectRatioWidth(0),mAspectRatioHeight(0),
334 mVideoCodec(),mHdrType(),mAudioBitrates(),mAudioCodec(),mAudioMixType(),isAtmos(false),mMediaFormatName()
526 BitrateChangeEvent::BitrateChangeEvent(
int time,
long bitrate,
const std::string &desc,
int width,
int height,
double frameRate,
double position,
bool cappedProfile,
int displayWidth,
int displayHeight,
VideoScanType videoScanType,
int aspectRatioWidth,
int aspectRatioHeight):
528 mBitrate(bitrate), mDescription(desc), mWidth(width),
529 mHeight(height), mFrameRate(frameRate), mPosition(position), mCappedProfile(cappedProfile), mDisplayWidth(displayWidth), mDisplayHeight(displayHeight), mVideoScanType(videoScanType), mAspectRatioWidth(aspectRatioWidth), mAspectRatioHeight(aspectRatioHeight)
669 mTime(time), mDuration(duration), mContent(content)
802 SeekedEvent::SeekedEvent(
double positionMS):
859 DrmMetaDataEvent::DrmMetaDataEvent(
AAMPTuneFailure failure,
const std::string &accessStatus,
int statusValue,
long responseCode,
bool secclientErr):
861 mAccessStatusValue(statusValue), mResponseCode(responseCode), mSecclientError(secclientErr), mSecManagerReasonCode(-1), mSecManagerClass(-1),
986 auto it = secClientSeManagerErrorLookUp.find(-httpCode);
987 if (it != secClientSeManagerErrorLookUp.end()) {
990 if(412 == httpCode && 401 == httpExtStatusCode)
1083 mStartMS(startMS), mDurationMs(durationMs)
1162 mOffset(offset), mDuration(duration), mErrorCode(errorCode)
1222 mMetricUUID(uuid), mMetricsData(data)
1260 ID3MetadataEvent::ID3MetadataEvent(
const std::vector<uint8_t> &metadata,
const std::string &schIDUri, std::string &id3Value, uint32_t timeScale, uint64_t presentationTime, uint32_t eventDuration, uint32_t
id, uint64_t timestampOffset):
1261 AAMPEventObject(
AAMP_EVENT_ID3_METADATA), mMetadata(metadata), mId(id), mTimeScale(timeScale), mSchemeIdUri(schIDUri), mValue(id3Value), mEventDuration(eventDuration), mPresentationTime(presentationTime), mTimestampOffset(timestampOffset)
1303 return mEventDuration;
1323 return mPresentationTime;
1333 return mTimestampOffset;
1343 return mSchemeIdUri;
1380 , mTime(time), mDuration(duration)
1410 , mHeaderName(header), mHeaderResponse(response)
1441 ContentProtectionDataEvent::ContentProtectionDataEvent(
const std::vector<uint8_t> &keyID,
const std::string &streamType):
1443 , mKeyID(keyID), mStreamType(streamType)