Skip to content

Commit 492652d

Browse files
lashminthaLashminthaJ
authored andcommitted
VPLAY-11225 [Tech Debt] mediafailed event enhancements ( minor code etc )
Reason for change: Added minor code for MediaFailedEvent Risks: Low Test Procedure: Refer jira ticket Priority: P1 Signed-off-by: lashmintha <[email protected]>
1 parent 393bc23 commit 492652d

File tree

9 files changed

+292
-140
lines changed

9 files changed

+292
-140
lines changed

AAMP-UVE-API.md

Lines changed: 45 additions & 40 deletions
Original file line numberDiff line numberDiff line change
@@ -2439,46 +2439,51 @@ When a player instance is no longer needed, recommend to call explicit release()
24392439

24402440
## Universal Video Engine Player Errors
24412441

2442-
| Error Code | Code | Error String |
2443-
| ---- | ---- | ----- |
2444-
| AAMP_TUNE_INIT_FAILED | 10 | AAMP: init failed |
2445-
| AAMP_TUNE_INIT_FAILED_MANIFEST_DNLD_ERROR | 10 | AAMP: init failed (unable to download manifest) |
2446-
| AAMP_TUNE_INIT_FAILED_MANIFEST_CONTENT_ERROR | 10 | AAMP: init failed (manifest missing tracks) |
2447-
| AAMP_TUNE_INIT_FAILED_MANIFEST_PARSE_ERROR | 10 | AAMP: init failed (corrupt/invalid manifest) |
2448-
| AAMP_TUNE_INIT_FAILED_TRACK_SYNC_ERROR | 10 | AAMP: init failed (unsynchronized tracks) |
2449-
| AAMP_TUNE_MANIFEST_REQ_FAILED | 10 | AAMP: Manifest Download failed; Playlist refresh failed |
2450-
| AAMP_TUNE_INIT_FAILED_PLAYLIST_VIDEO_DNLD_ERROR | 10 | AAMP: init failed (unable to download video playlist) |
2451-
| AAMP_TUNE_INIT_FAILED_PLAYLIST_AUDIO_DNLD_ERROR | 10 | AAMP: init failed (unable to download audio playlist) |
2452-
| AAMP_TUNE_FRAGMENT_DOWNLOAD_FAILURE | 10 | AAMP: fragment download failures |
2453-
| AAMP_TUNE_INIT_FRAGMENT_DOWNLOAD_FAILURE | 10 | AAMP: init fragment download failed |
2454-
| AAMP_TUNE_INVALID_MANIFEST_FAILURE | 10 | AAMP: Invalid Manifest, parse failed |
2455-
| AAMP_TUNE_MP4_INIT_FRAGMENT_MISSING | 10 | AAMP: init fragments missing in playlist |
2456-
| AAMP_TUNE_CONTENT_NOT_FOUND | 20 | AAMP: Resource was not found at the URL(HTTP 404) |
2457-
| AAMP_TUNE_AUTHORIZATION_FAILURE | 40 | AAMP: Authorization failure |
2458-
| AAMP_TUNE_UNTRACKED_DRM_ERROR | 50 | AAMP: DRM error untracked error |
2459-
| AAMP_TUNE_DRM_INIT_FAILED | 50 | AAMP: DRM Initialization Failed |
2460-
| AAMP_TUNE_DRM_DATA_BIND_FAILED | 50 | AAMP: InitData-DRM Binding Failed |
2461-
| AAMP_TUNE_DRM_SESSIONID_EMPTY | 50 | AAMP: DRM Session ID Empty |
2462-
| AAMP_TUNE_DRM_CHALLENGE_FAILED | 50 | AAMP: DRM License Challenge Generation Failed |
2463-
| AAMP_TUNE_LICENCE_TIMEOUT | 50 | AAMP: DRM License Request Timed out |
2464-
| AAMP_TUNE_LICENCE_REQUEST_FAILED | 50 | AAMP: DRM License Request Failed |
2465-
| AAMP_TUNE_INVALID_DRM_KEY | 50 | AAMP: Invalid Key Error, from DRM |
2466-
| AAMP_TUNE_UNSUPPORTED_STREAM_TYPE | 60 | AAMP: Unsupported Stream Type. Unable to determine stream type for DRM Init |
2467-
| AAMP_TUNE_UNSUPPORTED_AUDIO_TYPE | 60 | AAMP: No supported Audio Types in Manifest |
2468-
| AAMP_TUNE_FAILED_TO_GET_KEYID | 50 | AAMP: Failed to parse key id from PSSH |
2469-
| AAMP_TUNE_FAILED_TO_GET_ACCESS_TOKEN | 50 | AAMP: Failed to get access token from Auth Service |
2470-
| AAMP_TUNE_CORRUPT_DRM_METADATA | 50 | AAMP: DRM failure due to Bad DRMMetadata in stream |
2471-
| AAMP_TUNE_DRM_DECRYPT_FAILED | 50 | AAMP: DRM Decryption Failed for Fragments |
2472-
| AAMP_TUNE_DRM_UNSUPPORTED | 50 | AAMP: DRM format Unsupported |
2473-
| AAMP_TUNE_DRM_SELF_ABORT | 50 | AAMP: DRM license request aborted by player |
2474-
| AAMP_TUNE_DRM_KEY_UPDATE_FAILED | 50 | AAMP: Failed to process DRM key |
2475-
| AAMP_TUNE_CORRUPT_DRM_DATA | 51 | AAMP: DRM failure due to Corrupt DRM files |
2476-
| AAMP_TUNE_DEVICE_NOT_PROVISIONED | 52 | AAMP: Device not provisioned |
2477-
| AAMP_TUNE_HDCP_COMPLIANCE_ERROR | 53 | AAMP: HDCP Compliance Check Failure |
2478-
| AAMP_TUNE_GST_PIPELINE_ERROR | 80 | AAMP: Error from gstreamer pipeline |
2479-
| AAMP_TUNE_FAILED_PTS_ERROR | 80 | AAMP: Playback failed due to PTS error |
2480-
| AAMP_TUNE_PLAYBACK_STALLED | 7600 | AAMP: Playback was stalled due to lack of new fragments |
2481-
| AAMP_TUNE_FAILURE_UNKNOWN | 100 | AAMP: Unknown Failure |
2442+
| Error Code | Code | MinorCode | Error String |
2443+
| ---- | ---- | ----- | ----- |
2444+
| AAMP_TUNE_INIT_FAILED | 10 | 1001 | AAMP: init failed |
2445+
| AAMP_TUNE_INIT_FAILED_MANIFEST_DNLD_ERROR | 10 | 1002 | AAMP: init failed (unable to download manifest) |
2446+
| AAMP_TUNE_INIT_FAILED_MANIFEST_CONTENT_ERROR | 10 | 1003 | AAMP: init failed (manifest missing tracks) |
2447+
| AAMP_TUNE_INIT_FAILED_MANIFEST_PARSE_ERROR | 10 | 1004 | AAMP: init failed (corrupt/invalid manifest) |
2448+
| AAMP_TUNE_INIT_FAILED_PLAYLIST_VIDEO_DNLD_ERROR | 10 | 1005 | AAMP: init failed (unable to download video playlist) |
2449+
| AAMP_TUNE_INIT_FAILED_PLAYLIST_AUDIO_DNLD_ERROR | 10 | 1006 | AAMP: init failed (unable to download audio playlist) |
2450+
| AAMP_TUNE_INIT_FAILED_TRACK_SYNC_ERROR | 10 | 1007 | AAMP: init failed (unsynchronized tracks) |
2451+
| AAMP_TUNE_CONTENT_NOT_FOUND | 20 | 2001 | AAMP: Resource was not found at the URL(HTTP 404) |
2452+
| AAMP_TUNE_MANIFEST_REQ_FAILED | 30 | 3001 | AAMP: Manifest Download failed |
2453+
| AAMP_TUNE_FRAGMENT_DOWNLOAD_FAILURE | 30 | 3002 | AAMP: fragment download failures |
2454+
| AAMP_TUNE_INIT_FRAGMENT_DOWNLOAD_FAILURE | 30 | 3003 | AAMP: init fragment download failed |
2455+
| AAMP_TUNE_INVALID_MANIFEST_FAILURE | 30 | 3004 | AAMP: Invalid Manifest, parse failed |
2456+
| AAMP_TUNE_MP4_INIT_FRAGMENT_MISSING | 30 | 3005 | AAMP: init fragments missing in playlist |
2457+
| AAMP_TUNE_DNS_RESOLVE_TIMEOUT | 30 | 3006 | AAMP: Manifest download failed due to DNS resolve timeout |
2458+
| AAMP_TUNE_CURL_CONNECTION_TIMEOUT | 30 | 3007 | AAMP: Manifest download failed due to connection timeout |
2459+
| AAMP_TUNE_DATA_TRANSFER_TIMEOUT | 30 | 3008 | AAMP: Manifest download failed due to data transfer timeout |
2460+
| AAMP_TUNE_AUTHORIZATION_FAILURE | 40 | 4001 | AAMP: Authorization failure |
2461+
| AAMP_TUNE_UNTRACKED_DRM_ERROR | 50 | 5001 | AAMP: DRM error untracked error |
2462+
| AAMP_TUNE_DRM_INIT_FAILED | 50 | 5002 | AAMP: DRM Initialization Failed |
2463+
| AAMP_TUNE_DRM_DATA_BIND_FAILED | 50 | 5003 | AAMP: InitData-DRM Binding Failed |
2464+
| AAMP_TUNE_DRM_SESSIONID_EMPTY | 50 | 5004 | AAMP: DRM Session ID Empty |
2465+
| AAMP_TUNE_DRM_CHALLENGE_FAILED | 50 | 5005 | AAMP: DRM License Challenge Generation Failed |
2466+
| AAMP_TUNE_LICENCE_TIMEOUT | 50 | 5006 | AAMP: DRM License Request Timed out |
2467+
| AAMP_TUNE_LICENCE_REQUEST_FAILED | 50 | 5007 | AAMP: DRM License Request Failed |
2468+
| AAMP_TUNE_INVALID_DRM_KEY | 50 | 5008 | AAMP: Invalid Key Error, from DRM |
2469+
| AAMP_TUNE_FAILED_TO_GET_KEYID | 50 | 5009 | AAMP: Failed to parse key id from PSSH |
2470+
| AAMP_TUNE_CORRUPT_DRM_DATA | 50 | 5010 | AAMP: DRM failure due to Corrupt DRM files |
2471+
| AAMP_TUNE_CORRUPT_DRM_METADATA | 50 | 5011 | AAMP: DRM failure due to Bad DRMMetadata in stream |
2472+
| AAMP_TUNE_DRM_DECRYPT_FAILED | 50 | 5012 | AAMP: DRM Decryption Failed for Fragments |
2473+
| AAMP_TUNE_DRM_UNSUPPORTED | 50 | 5013 | AAMP: DRM format Unsupported |
2474+
| AAMP_TUNE_DRM_SELF_ABORT | 50 | 5014 | AAMP: DRM license request aborted by player |
2475+
| AAMP_TUNE_FAILED_TO_GET_ACCESS_TOKEN | 50 | 5015 | AAMP: Failed to get access token from Auth Service |
2476+
| AAMP_TUNE_DRM_KEY_UPDATE_FAILED | 50 | 5016 | AAMP: Failed to process DRM key |
2477+
| AAMP_TUNE_DEVICE_NOT_PROVISIONED | 51 | 5101 | AAMP: Device not provisioned |
2478+
| AAMP_TUNE_HDCP_COMPLIANCE_ERROR | 52 | 5201 | AAMP: HDCP Compliance Check Failure |
2479+
2480+
| AAMP_TUNE_UNSUPPORTED_STREAM_TYPE | 60 | 6001 | AAMP: Unsupported Stream Type |
2481+
| AAMP_TUNE_UNSUPPORTED_AUDIO_TYPE | 60 | 6002 | AAMP: No supported Audio Types in Manifest |
2482+
| AAMP_TUNE_GST_PIPELINE_ERROR | 80 | 8001 | AAMP: Error from gstreamer pipeline |
2483+
| AAMP_TUNE_FAILED_PTS_ERROR | 80 | 8002 | AAMP: Playback failed due to PTS error |
2484+
2485+
| AAMP_TUNE_PLAYBACK_STALLED | 7600 | 1 | AAMP: Playback was stalled due to lack of new fragments |
2486+
| AAMP_TUNE_FAILURE_UNKNOWN | 100 | 1 | AAMP: Unknown Failure |
24822487

24832488
---
24842489

AampEvent.cpp

Lines changed: 15 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -49,8 +49,8 @@ AAMPEventType AAMPEventObject::getType() const
4949
/**
5050
* @brief MediaErrorEvent Constructor
5151
*/
52-
MediaErrorEvent::MediaErrorEvent(AAMPTuneFailure failure, int code, const std::string &desc, bool shouldRetry, int classCode, int reason, int businessStatus, const std::string &responseData, std::string sid):
53-
AAMPEventObject(AAMP_EVENT_TUNE_FAILED, std::move(sid)), mFailure(failure), mCode(code),
52+
MediaErrorEvent::MediaErrorEvent(AAMPTuneFailure failure, int code, int minorCode, const std::string &desc, bool shouldRetry, int classCode, int reason, int businessStatus, const std::string &responseData, std::string sid):
53+
AAMPEventObject(AAMP_EVENT_TUNE_FAILED, std::move(sid)), mFailure(failure), mMajorCode(code), mMinorCode(minorCode),
5454
mDescription(desc), mShouldRetry(shouldRetry), mSecManagerClass(classCode), mSecManagerReasonCode(reason), mBusinessStatus(businessStatus), mResponseData(responseData)
5555
{
5656

@@ -67,15 +67,23 @@ AAMPTuneFailure MediaErrorEvent::getFailure() const
6767
}
6868

6969
/**
70-
* @brief Get Error Code
70+
* @brief Get Major Code
7171
*
72-
* @return Tune error code
72+
* @return Major code
7373
*/
74-
int MediaErrorEvent::getCode() const
74+
int MediaErrorEvent::getMajorCode() const
7575
{
76-
return mCode;
76+
return mMajorCode;
77+
}
78+
/**
79+
* @brief Get Minor Code
80+
*
81+
* @return Minor code
82+
*/
83+
int MediaErrorEvent::getMinorCode() const
84+
{
85+
return mMinorCode;
7786
}
78-
7987
/**
8088
* @brief Get Description
8189
*

AampEvent.h

Lines changed: 68 additions & 39 deletions
Original file line numberDiff line numberDiff line change
@@ -123,40 +123,63 @@ typedef enum
123123
AAMP_TUNE_INIT_FAILED_PLAYLIST_VIDEO_DNLD_ERROR, /**< Tune failure due to video playlist download error*/
124124
AAMP_TUNE_INIT_FAILED_PLAYLIST_AUDIO_DNLD_ERROR, /**< Tune failure due to audio playlist download error*/
125125
AAMP_TUNE_INIT_FAILED_TRACK_SYNC_ERROR, /**< Tune failure due to A/V track sync error*/
126-
AAMP_TUNE_MANIFEST_REQ_FAILED, /**< Tune failure caused by manifest fetch failure*/
127-
AAMP_TUNE_AUTHORIZATION_FAILURE, /**< Not authorized to view the content*/
128-
AAMP_TUNE_FRAGMENT_DOWNLOAD_FAILURE, /**< When fragment download fails for 5 consecutive fragments*/
129-
AAMP_TUNE_INIT_FRAGMENT_DOWNLOAD_FAILURE, /**< Unable to download init fragment*/
130-
AAMP_TUNE_UNTRACKED_DRM_ERROR, /**< DRM error*/
131-
AAMP_TUNE_DRM_INIT_FAILED, /**< DRM initialization failure */
132-
AAMP_TUNE_DRM_DATA_BIND_FAILED, /**< InitData binding with DRM failed */
133-
AAMP_TUNE_DRM_SESSIONID_EMPTY, /**< DRM session ID empty */
134-
AAMP_TUNE_DRM_CHALLENGE_FAILED, /**< DRM key request challenge generation failed */
135-
AAMP_TUNE_LICENCE_TIMEOUT, /**< DRM license request timeout */
136-
AAMP_TUNE_LICENCE_REQUEST_FAILED, /**< DRM license got invalid response */
137-
AAMP_TUNE_INVALID_DRM_KEY, /**< DRM reporting invalid license key */
138-
AAMP_TUNE_UNSUPPORTED_STREAM_TYPE, /**< Unsupported stream type */
139-
AAMP_TUNE_UNSUPPORTED_AUDIO_TYPE, /**< Unsupported audio type in manifest */
140-
AAMP_TUNE_FAILED_TO_GET_KEYID, /**< Failed to parse key id from init data*/
141-
AAMP_TUNE_FAILED_TO_GET_ACCESS_TOKEN, /**< Failed to get session token from AuthService*/
142-
AAMP_TUNE_CORRUPT_DRM_DATA, /**< DRM failure due to corrupt drm data, self heal might clear further errors*/
143-
AAMP_TUNE_CORRUPT_DRM_METADATA, /**< DRM failure due to corrupt drm metadata in the stream*/
144-
AAMP_TUNE_DRM_DECRYPT_FAILED, /**< DRM Decryption Failed for Fragments */
145-
AAMP_TUNE_DRM_UNSUPPORTED, /**< DRM Format Unsupported */
146-
AAMP_TUNE_DRM_SELF_ABORT, /**< Download activity is aborted by player */
147-
AAMP_TUNE_GST_PIPELINE_ERROR, /**< Playback failure due to error from GStreamer pipeline or associated plugins */
148-
AAMP_TUNE_PLAYBACK_STALLED, /**< Playback was stalled due to valid fragments not available in playlist */
149-
AAMP_TUNE_CONTENT_NOT_FOUND, /**< The resource was not found at the URL provided (HTTP 404) */
150-
AAMP_TUNE_DRM_KEY_UPDATE_FAILED, /**< Failed to process DRM key, see the error code returned from Update() for more info */
151-
AAMP_TUNE_DEVICE_NOT_PROVISIONED, /**< STB not provisioned/corrupted; need to re-provision. */
152-
AAMP_TUNE_HDCP_COMPLIANCE_ERROR, /**< HDCP Compliance Check failure.Not compatible hdcp version for playback */
153-
AAMP_TUNE_INVALID_MANIFEST_FAILURE, /**< Manifest is invalid */
154-
AAMP_TUNE_FAILED_PTS_ERROR, /**< Playback failed due to PTS error */
155-
AAMP_TUNE_MP4_INIT_FRAGMENT_MISSING, /**< Init fragments missing in playlist */
156-
AAMP_TUNE_DNS_RESOLVE_TIMEOUT,
157-
AAMP_TUNE_CURL_CONNECTION_TIMEOUT,
158-
AAMP_TUNE_DATA_TRANSFER_TIMEOUT,
159-
AAMP_TUNE_FAILURE_UNKNOWN /**< Unknown failure */
126+
127+
128+
//Resource failure
129+
AAMP_TUNE_CONTENT_NOT_FOUND, /**< The resource was not found at the URL provided (HTTP 404) */
130+
131+
//Download failure
132+
AAMP_TUNE_MANIFEST_REQ_FAILED, /**< Tune failure caused by manifest fetch failure*/
133+
AAMP_TUNE_FRAGMENT_DOWNLOAD_FAILURE, /**< When fragment download fails for 5 consecutive fragments*/
134+
AAMP_TUNE_INIT_FRAGMENT_DOWNLOAD_FAILURE, /**< Unable to download init fragment*/
135+
AAMP_TUNE_INVALID_MANIFEST_FAILURE, /**< Manifest is invalid */
136+
AAMP_TUNE_MP4_INIT_FRAGMENT_MISSING, /**< Init fragments missing in playlist */
137+
AAMP_TUNE_DNS_RESOLVE_TIMEOUT, /**< DNS resolve timedout */
138+
AAMP_TUNE_CURL_CONNECTION_TIMEOUT, /**< Curl connection timedout */
139+
AAMP_TUNE_DATA_TRANSFER_TIMEOUT, /**< Data transfer timedout */
140+
141+
//Authorization failure
142+
AAMP_TUNE_AUTHORIZATION_FAILURE, /**< Not authorized to view the content*/
143+
144+
//DRM Failure
145+
AAMP_TUNE_UNTRACKED_DRM_ERROR, /**< DRM error*/
146+
AAMP_TUNE_DRM_INIT_FAILED, /**< DRM initialization failure */
147+
AAMP_TUNE_DRM_DATA_BIND_FAILED, /**< InitData binding with DRM failed */
148+
AAMP_TUNE_DRM_SESSIONID_EMPTY, /**< DRM session ID empty */
149+
AAMP_TUNE_DRM_CHALLENGE_FAILED, /**< DRM key request challenge generation failed */
150+
AAMP_TUNE_LICENCE_TIMEOUT, /**< DRM license request timeout */
151+
AAMP_TUNE_LICENCE_REQUEST_FAILED, /**< DRM license got invalid response */
152+
AAMP_TUNE_INVALID_DRM_KEY, /**< DRM reporting invalid license key */
153+
AAMP_TUNE_FAILED_TO_GET_KEYID, /**< Failed to parse key id from init data*/
154+
AAMP_TUNE_CORRUPT_DRM_DATA, /**< DRM failure due to corrupt drm data, self heal might clear further errors*/
155+
AAMP_TUNE_CORRUPT_DRM_METADATA, /**< DRM failure due to corrupt drm metadata in the stream*/
156+
AAMP_TUNE_DRM_DECRYPT_FAILED, /**< DRM Decryption Failed for Fragments */
157+
AAMP_TUNE_DRM_UNSUPPORTED, /**< DRM Format Unsupported */
158+
AAMP_TUNE_DRM_SELF_ABORT, /**< Download activity is aborted by player */
159+
AAMP_TUNE_FAILED_TO_GET_ACCESS_TOKEN, /**< Failed to get session token from AuthService*/
160+
AAMP_TUNE_DRM_KEY_UPDATE_FAILED, /**< Failed to process DRM key, see the error code returned from Update() for more info */
161+
162+
163+
164+
//Provisioning failure
165+
AAMP_TUNE_DEVICE_NOT_PROVISIONED, /**< STB not provisioned/corrupted; need to re-provision. */
166+
167+
//Hdcp failure
168+
AAMP_TUNE_HDCP_COMPLIANCE_ERROR, /**< HDCP Compliance Check failure.Not compatible hdcp version for playback */
169+
170+
//Stream failure
171+
AAMP_TUNE_UNSUPPORTED_STREAM_TYPE, /**< Unsupported stream type */
172+
AAMP_TUNE_UNSUPPORTED_AUDIO_TYPE, /**< Unsupported audio type in manifest */
173+
174+
//Gstreamer error
175+
AAMP_TUNE_GST_PIPELINE_ERROR, /**< Playback failed due to an error in the GStreamer pipeline */
176+
AAMP_TUNE_FAILED_PTS_ERROR, /**< Playback failed due to PTS error */
177+
178+
//Playback failure
179+
AAMP_TUNE_PLAYBACK_STALLED, /**< Playback was stalled due to valid fragments not available in playlist */
180+
181+
//Unknown failure
182+
AAMP_TUNE_FAILURE_UNKNOWN
160183
} AAMPTuneFailure;
161184

162185
/**
@@ -383,7 +406,8 @@ struct AAMPEvent
383406
struct
384407
{
385408
AAMPTuneFailure failure; /**< Error Type */
386-
int code; /**< Error code */
409+
int code;
410+
int minorCode; /**< Error code */
387411
const char *description; /**< Error description */
388412
bool shouldRetry; /**< If recovery on retry is possible */
389413
int32_t classCode; /**< class Code */
@@ -619,7 +643,8 @@ class AAMPEventObject
619643
class MediaErrorEvent: public AAMPEventObject
620644
{
621645
AAMPTuneFailure mFailure; /**< Error Type */
622-
int mCode; /**< Error code */
646+
int mMajorCode; /**< Error code */
647+
int mMinorCode;
623648
std::string mDescription; /**< Error description */
624649
std::string mResponseData; /**< Response Data */
625650
bool mShouldRetry; /**< If recovery on retry is possible */
@@ -638,10 +663,11 @@ class MediaErrorEvent: public AAMPEventObject
638663
*
639664
* @param[in] failure - Failure type
640665
* @param[in] code - Error code
666+
* @param[in] minorCode - Error code
641667
* @param[in] desc - Error description
642668
* @param[in] shouldRetry - Retry or not
643669
*/
644-
MediaErrorEvent(AAMPTuneFailure failure, int code, const std::string &desc, bool shouldRetry, int32_t classCode, int32_t reason, int32_t businessStatus, const std::string &responseData, std::string sid);
670+
MediaErrorEvent(AAMPTuneFailure failure, int code, int minorCode, const std::string &desc, bool shouldRetry, int32_t classCode, int32_t reason, int32_t businessStatus, const std::string &responseData, std::string sid);
645671

646672
/**
647673
* @brief MediaErrorEvent Destructor
@@ -653,11 +679,14 @@ class MediaErrorEvent: public AAMPEventObject
653679
*/
654680
AAMPTuneFailure getFailure() const;
655681

682+
/**
683+
* @fn getMinorCode
684+
*/
685+
int getMinorCode() const;
656686
/**
657687
* @fn getCode
658688
*/
659-
int getCode() const;
660-
689+
int getMajorCode() const;
661690
/**
662691
* @fn getDescription
663692
*/

AampEventListener.cpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,8 @@ static void GenerateLegacyAAMPEvent(const AAMPEventPtr &e, AAMPEvent &event)
4141
{
4242
MediaErrorEventPtr ev = std::dynamic_pointer_cast<MediaErrorEvent>(e);
4343
event.data.mediaError.failure = ev->getFailure();
44-
event.data.mediaError.code = ev->getCode();
44+
event.data.mediaError.code = ev->getMajorCode();
45+
event.data.mediaError.minorCode = ev->getMinorCode();
4546
event.data.mediaError.description = ev->getDescription().c_str();
4647
event.data.mediaError.shouldRetry = ev->shouldRetry();
4748
if(-1 != ev->getClass()) //Only send the verbose logging for DRM failure due to secclient/secmanager

jsbindings/jsbindings.cpp

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -928,14 +928,18 @@ class AAMP_JSListener_TuneFailed : public AAMP_JSListener
928928
void setEventProperties(const AAMPEventPtr& e, JSContextRef context, JSObjectRef eventObj)
929929
{
930930
MediaErrorEventPtr evt = std::dynamic_pointer_cast<MediaErrorEvent>(e);
931-
932-
int code = evt->getCode();
931+
int code = evt->getMajorCode();
932+
int minorCode = evt->getMinorCode();
933933
const char* description = evt->getDescription().c_str();
934934

935935
JSStringRef name = JSStringCreateWithUTF8CString("code");
936936
JSObjectSetProperty(context, eventObj, name, JSValueMakeNumber(context, code), kJSPropertyAttributeReadOnly, NULL);
937937
JSStringRelease(name);
938938

939+
name = JSStringCreateWithUTF8CString("minorCode");
940+
JSObjectSetProperty(context, eventObj, name, JSValueMakeNumber(context, minorCode), kJSPropertyAttributeReadOnly, NULL);
941+
JSStringRelease(name);
942+
939943
name = JSStringCreateWithUTF8CString("description");
940944
JSObjectSetProperty(context, eventObj, name, aamp_CStringToJSValue(context, description), kJSPropertyAttributeReadOnly, NULL);
941945
JSStringRelease(name);

jsbindings/jseventlistener.cpp

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -258,7 +258,11 @@ class AAMP_Listener_PlaybackFailed : public AAMP_JSEventListener
258258
JSStringRef prop;
259259

260260
prop = JSStringCreateWithUTF8CString("code");
261-
JSObjectSetProperty(p_obj->_ctx, jsEventObj, prop, JSValueMakeNumber(p_obj->_ctx, evt->getCode()), kJSPropertyAttributeReadOnly, NULL);
261+
JSObjectSetProperty(p_obj->_ctx, jsEventObj, prop, JSValueMakeNumber(p_obj->_ctx, evt->getMajorCode()), kJSPropertyAttributeReadOnly, NULL);
262+
JSStringRelease(prop);
263+
264+
prop = JSStringCreateWithUTF8CString("minorCode");
265+
JSObjectSetProperty(p_obj->_ctx, jsEventObj, prop, JSValueMakeNumber(p_obj->_ctx, evt->getMinorCode()), kJSPropertyAttributeReadOnly, NULL);
262266
JSStringRelease(prop);
263267

264268
prop = JSStringCreateWithUTF8CString("description");

0 commit comments

Comments
 (0)