From 313035de827a93b8c31d0e2ed3601ca66678ad3a Mon Sep 17 00:00:00 2001 From: deepikasri Date: Tue, 17 Feb 2026 16:26:08 +0530 Subject: [PATCH 01/46] RDKEMW-13310: Telemetry T2 markers for Player-interface component Reason for change : telemetry marker implementation . Test Steps : . Signed-off by: Deepikasri Natarajan (deepikasri_n@comcast.com) --- CMakeLists.txt | 7 ++- InterfacePlayerRDK.cpp | 68 +++++++++++++++++++++++++- PlayerTelemetry2.cpp | 108 +++++++++++++++++++++++++++++++++++++++++ PlayerTelemetry2.hpp | 67 +++++++++++++++++++++++++ 4 files changed, 247 insertions(+), 3 deletions(-) create mode 100644 PlayerTelemetry2.cpp create mode 100644 PlayerTelemetry2.hpp diff --git a/CMakeLists.txt b/CMakeLists.txt index 86e8ed66..80a73699 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -138,7 +138,12 @@ if(CMAKE_SYSTEM_NAME STREQUAL "Darwin") else() set(LIBPLAYERGSTINTERFACE_DEPENDS ${OS_LD_FLAGS} ${UUID_LINK_LIBRARIES} ${LIBCJSON_LINK_LIBRARIES} ${GSTREAMERBASE_LINK_LIBRARIES} ${GSTREAMER_LINK_LIBRARIES} ${CURL_LINK_LIBRARIES} ${LIBDASH_LINK_LIBRARIES} ${LibXml2_LIBRARIES} ${CMAKE_THREAD_LIBS_INIT} ${OPENSSL_LIBRARIES} ${OPENGL_LIBRARIES} ${GLEW_LIBRARIES} -ldl) endif() - +if(CMAKE_TELEMETRY_2_0_REQUIRED) + message("CMAKE_TELEMETRY_2_0_REQUIRED set") + set(LIBPLAYERGSTINTERFACE_SOURCES "${LIBPLAYERGSTINTERFACE_SOURCES}" PlayerTelemetry2.cpp) + set(LIBPLAYERGSTINTERFACE_DEFINES "${LIBPLAYERGSTINTERFACE_DEFINES} -DPLAYER_TELEMETRY_SUPPORT=1") + set(LIBPLAYERGSTINTERFACE_DEPENDS ${LIBPLAYERGSTINTERFACE_DEPENDS} "-ltelemetry_msgsender") +endif() set(LIBPLAYERGSTINTERFACE_HEADERS closedcaptions/CCTrackInfo.h GstUtils.h diff --git a/InterfacePlayerRDK.cpp b/InterfacePlayerRDK.cpp index a7d138b2..9c418ccf 100644 --- a/InterfacePlayerRDK.cpp +++ b/InterfacePlayerRDK.cpp @@ -31,6 +31,9 @@ #include "TextStyleAttributes.h" #include #include +#ifdef MWPLAYER_TELEMETRY_SUPPORT +#include "PlayerTelemetry2.hpp" +#endif //MWPLAYER_TELEMETRY_SUPPORT #ifdef USE_EXTERNAL_STATS #include "player-xternal-stats.h" #endif @@ -357,7 +360,13 @@ void InterfacePlayerRDK::ConfigurePipeline(int format, int audioFormat, int subF if (interfacePlayerPriv->gstPrivateContext->pipeline == NULL || interfacePlayerPriv->gstPrivateContext->bus == NULL) { - MW_LOG_MIL("Create pipeline %s (pipeline %p bus %p)", pipelineName, interfacePlayerPriv->gstPrivateContext->pipeline, interfacePlayerPriv->gstPrivateContext->bus); + +#ifdef MWPLAYER_TELEMETRY_SUPPORT /** verifying telemetry support*/ + MW_LOG_MIL("MWPLAYER_TELEMETRY_SUPPORT is enabled at runtime"); +#else + MW_LOG_MIL("MWPLAYER_TELEMETRY_SUPPORT is NOT enabled at runtime"); +#endif + MW_LOG_MIL("Nitz : Create pipeline %s (pipeline %p bus %p)", pipelineName, interfacePlayerPriv->gstPrivateContext->pipeline, interfacePlayerPriv->gstPrivateContext->bus); CreatePipeline(pipelineName, PipelinePriority); /*Create a new pipeline if pipeline or the message bus does not exist*/ } @@ -1278,6 +1287,13 @@ static GstStateChangeReturn SetStateWithWarnings(GstElement *element, GstState t switch(stateChangeReturn) { case GST_STATE_CHANGE_FAILURE: +#ifdef MWPLAYER_TELEMETRY_SUPPORT + MWPlayerTelemetry2::send("MW_PIPELINE_STATE_CHANGE_FAILURE", + SafeName(element), + gst_element_state_get_name(current), + gst_element_state_get_name(pending), + targetState); +#endif MW_LOG_ERR("InterfacePlayerRDK: %s is in FAILURE state : current %s pending %s", SafeName(element).c_str(),gst_element_state_get_name(current), gst_element_state_get_name(pending)); LogStatus(element); break; @@ -3257,6 +3273,16 @@ void InterfacePlayerRDK::QueueProtectionEvent(const std::string& formatType, con gst_buffer_unref (pssi); } + else + { +#ifdef MWPLAYER_TELEMETRY_SUPPORT + MWPlayerTelemetry2::send("MW_PROTECTION_EVENT_FAILED", + formatType, + protSystemId ? protSystemId : "", + mediaType, + initDataSize); +#endif + } } /** @@ -4025,7 +4051,14 @@ static void GstPlayer_OnGstBufferUnderflowCb(GstElement* object, guint arg0, gpo MW_LOG_WARN("## Got Underflow message from %s type %d ##", GST_ELEMENT_NAME(object), type); privatePlayer->gstPrivateContext->stream[type].bufferUnderrun = true; - +#ifdef MWPLAYER_TELEMETRY_SUPPORT + MWPlayerTelemetry2::send("MW_BUFFER_UNDERFLOW", + GST_ELEMENT_NAME(object), + type, + privatePlayer->gstPrivateContext->stream[type].eosReached, + privatePlayer->gstPrivateContext->rate, + privatePlayer->gstPrivateContext->stream[type].bufferUnderrun); +#endif if ((privatePlayer->gstPrivateContext->stream[type].eosReached) && (privatePlayer->gstPrivateContext->rate > 0)) { if (!privatePlayer->gstPrivateContext->ptsCheckForEosOnUnderflowIdleTaskId) @@ -4073,6 +4106,14 @@ static void GstPlayer_OnGstPtsErrorCb(GstElement *object, guint arg0, gpointer a MW_LOG_ERR("Got PTS error message from %s", GST_ELEMENT_NAME(object)); bool isVideo = false; bool isAudioSink = false; +#ifdef MWPLAYER_TELEMETRY_SUPPORT + MWPlayerTelemetry2::send("MW_PTS_ERROR", + GST_ELEMENT_NAME(object), + isVideo, + isAudioSink, + privatePlayer->gstPrivateContext->lastKnownPTS, + privatePlayer->gstPrivateContext->ptsUpdatedTimeMS); +#endif if (privatePlayer->socInterface->IsVideoSinkHandleErrors()) { isVideo = GstPlayer_isVideoSink(GST_ELEMENT_NAME(object), pInterfacePlayerRDK); @@ -4102,6 +4143,13 @@ static void GstPlayer_OnGstDecodeErrorCb(GstElement* object, guint arg0, gpointe HANDLER_CONTROL_HELPER_CALLBACK_VOID(); long long deltaMS = NOW_STEADY_TS_MS - privatePlayer->gstPrivateContext->decodeErrorMsgTimeMS; privatePlayer->gstPrivateContext->decodeErrorCBCount += 1; +#ifdef MWPLAYER_TELEMETRY_SUPPORT + MWPlayerTelemetry2::send("MW_DECODE_ERROR", + GST_ELEMENT_NAME(object), + privatePlayer->gstPrivateContext->decodeErrorCBCount, + deltaMS, + privatePlayer->gstPrivateContext->rate); +#endif if (deltaMS >= GST_MIN_DECODE_ERROR_INTERVAL) { pInterfacePlayerRDK->OnGstDecodeErrorCb(privatePlayer->gstPrivateContext->decodeErrorCBCount); @@ -4138,6 +4186,13 @@ static gboolean bus_message(GstBus * bus, GstMessage * msg, InterfacePlayerRDK * { case GST_MESSAGE_ERROR: gst_message_parse_error(msg, &error, &dbg_info); +#ifdef MWPLAYER_TELEMETRY_SUPPORT + MWPlayerTelemetry2::send("MW_GST_ERROR", + GST_OBJECT_NAME(msg->src), + error->message, + dbg_info ? dbg_info : "", + privatePlayer->gstPrivateContext->rate); +#endif MW_LOG_ERR("GST_MESSAGE_ERROR %s: %s\n", GST_OBJECT_NAME(msg->src), error->message); busEvent.msgType = MESSAGE_ERROR; busEvent.msg = error->message; @@ -4583,6 +4638,15 @@ static gboolean buffering_timeout (gpointer data) pInterfacePlayerRDK->OnBuffering_timeoutCb(isBufferingTimeoutConditionMet, isRateCorrectionDefaultOnPlaying, isPlayerReady); } return privatePlayer->gstPrivateContext->buffering_in_progress; +#ifdef MWPLAYER_TELEMETRY_SUPPORT + MWPlayerTelemetry2::send("MW_BUFFERING_TIMEOUT", + privatePlayer->gstPrivateContext->numberOfVideoBuffersSent, + privatePlayer->gstPrivateContext->buffering_timeout_cnt, + privatePlayer->gstPrivateContext->rate, + isBufferingTimeoutConditionMet, + isRateCorrectionDefaultOnPlaying, + isPlayerReady); +#endif } else { diff --git a/PlayerTelemetry2.cpp b/PlayerTelemetry2.cpp new file mode 100644 index 00000000..7668c1eb --- /dev/null +++ b/PlayerTelemetry2.cpp @@ -0,0 +1,108 @@ +#include "PlayerTelemetry2.hpp" +#include + +#include + +Player_TelemetryInitializer::Player_TelemetryInitializer() +: m_Initialized(false) // Initialize 'initialized' to false +{ +} + +void Player_TelemetryInitializer::Init() +{ + if(false == m_Initialized) + { + m_Initialized = true; + t2_init((char *)"mwplayer"); + MW_LOG_MIL("t2_init done "); + } +} + +bool Player_TelemetryInitializer::isInitialized() const +{ + return m_Initialized; +} + +Player_TelemetryInitializer::~Player_TelemetryInitializer() +{ + t2_uninit(); + MW_LOG_MIL("t2_uninit done "); +} + +Player_TelemetryInitializer PlayerTelemetry2::mInitializer; + +PlayerTelemetry2::PlayerTelemetry2() { + PlayerTelemetry2(""); +} + +PlayerTelemetry2::PlayerTelemetry2( const std::string &appName) : appName(appName) { + mInitializer.Init(); // deinit is done in destructor of PlayerTelemetryInitializer. +} + +bool PlayerTelemetry2::send( const std::string &markerName, const std::map& intData, const std::map& stringData, const std::map& floatData ) { + bool bRet = false; + if(mInitializer.isInitialized() ) + { + cJSON *root = cJSON_CreateObject(); + + cJSON_AddStringToObject(root, "app", appName.c_str()); + + for (const auto& pair : intData) { + std::string key = pair.first; + int value = pair.second; + cJSON_AddNumberToObject(root, key.c_str(), value); + } + + for (const auto& pair : stringData) { + std::string key = pair.first; + std::string value = pair.second; + cJSON_AddStringToObject(root, key.c_str(), value.c_str()); + } + + for (const auto& pair : floatData) { + std::string key = pair.first; + float value = pair.second; + cJSON_AddNumberToObject(root, key.c_str(), value); + } + + //lets use cJSON_PrintUnformatted , cJSON_Print is formated adds whitespace n hence takes more memory also eats up more logs if logged. + char *jsonString = cJSON_PrintUnformatted(root); + + MW_LOG_INFO("[M] Marker Name: %s value:%s", markerName.c_str(),jsonString); + + T2ERROR t2Error = t2_event_s( (char *)markerName.c_str(),jsonString); + + if(T2ERROR_SUCCESS == t2Error) + { + bRet = true; + } + else + { + MW_LOG_ERR("t2_event_s map failed:%d ", t2Error); + } + cJSON_free(jsonString); + cJSON_Delete(root); + } + + return bRet; +} + +bool PlayerTelemetry2::send( const std::string &markerName, const char * data) +{ + bool bRet = false; + if(mInitializer.isInitialized() && NULL != data) + { + MW_LOG_INFO("[S] Marker Name: %s value:%s", markerName.c_str(),data ); + T2ERROR t2Error = t2_event_s( (char *)markerName.c_str(),(char*)data ); + + if(T2ERROR_SUCCESS == t2Error) + { + bRet = true; + } + else + { + MW_LOG_ERR("t2_event_s string failed:%d ", t2Error); + } + } + return bRet; +} diff --git a/PlayerTelemetry2.hpp b/PlayerTelemetry2.hpp new file mode 100644 index 00000000..ea5833ee --- /dev/null +++ b/PlayerTelemetry2.hpp @@ -0,0 +1,67 @@ +/** + * @file PlayerTelemetry2.hpp + * @brief Supporting class to provide telemetry support to Player + */ + +#ifndef __PLAYER_TELEMETRY_2_H__ +#define __PLAYER_TELEMETRY_2_H__ + +#include +#include +#include +#include +#include "PlayerLogManager.h" + +// Note that RDK telemetry 2.0 support is per process basic, +// this class is created to take care of un initialization of telemetry but having object as global variable +// when process goes down, destructor of this class will be called and it will uninitialize the telemetry. + +class Player_TelemetryInitializer { +private: + bool m_Initialized = false; +public: + Player_TelemetryInitializer(); + void Init(); + bool isInitialized() const; + ~Player_TelemetryInitializer(); +}; + + +class PlayerTelemetry2 { +private: + static Player_TelemetryInitializer mInitializer; + std::string appName; + +public: + /** + * @brief Constructor + * @param[in] NONE + */ + PlayerTelemetry2(); + + /** + * @brief Constructor + * @param[in] appName - Name of the application + */ + PlayerTelemetry2(const std::string &appName); + + /** + * + * @brief send - Send the telemetry data to the telemetry bus by converting input map to json string + * @param[in] markerName - Name of the marker + * @param[in] intData - Map of int data + * @param[in] stringData - Map of string data + * @param[in] floatData - Map of float data + * @return bool - true if success, false otherwise + */ + bool send(const std::string &markerName, const std::map& intData, const std::map& stringData, const std::map& floatData); + + /** + * @brief send - Send the telemetry data to the telemetry bus + * @param[in] markerName - Name of the marker + * @param[in] data - Data to be sent + */ + bool send(const std::string &markerName, const char * data); +}; + +#endif // __PLAYER_TELEMETRY_2_H__ From beae9af8bcaa819877a5b3815619af402615208d Mon Sep 17 00:00:00 2001 From: deepikasri Date: Wed, 18 Feb 2026 16:01:39 +0530 Subject: [PATCH 02/46] T2 changes --- InterfacePlayerRDK.cpp | 24 ++++++++++++------------ 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/InterfacePlayerRDK.cpp b/InterfacePlayerRDK.cpp index 9c418ccf..5a4b3cab 100644 --- a/InterfacePlayerRDK.cpp +++ b/InterfacePlayerRDK.cpp @@ -31,9 +31,9 @@ #include "TextStyleAttributes.h" #include #include -#ifdef MWPLAYER_TELEMETRY_SUPPORT +#ifdef PLAYER_TELEMETRY_SUPPORT #include "PlayerTelemetry2.hpp" -#endif //MWPLAYER_TELEMETRY_SUPPORT +#endif //PLAYER_TELEMETRY_SUPPORT #ifdef USE_EXTERNAL_STATS #include "player-xternal-stats.h" #endif @@ -361,10 +361,10 @@ void InterfacePlayerRDK::ConfigurePipeline(int format, int audioFormat, int subF if (interfacePlayerPriv->gstPrivateContext->pipeline == NULL || interfacePlayerPriv->gstPrivateContext->bus == NULL) { -#ifdef MWPLAYER_TELEMETRY_SUPPORT /** verifying telemetry support*/ - MW_LOG_MIL("MWPLAYER_TELEMETRY_SUPPORT is enabled at runtime"); +#ifdef PLAYER_TELEMETRY_SUPPORT /** verifying telemetry support*/ + MW_LOG_MIL("PLAYER_TELEMETRY_SUPPORT is enabled at runtime"); #else - MW_LOG_MIL("MWPLAYER_TELEMETRY_SUPPORT is NOT enabled at runtime"); + MW_LOG_MIL("PLAYER_TELEMETRY_SUPPORT is NOT enabled at runtime"); #endif MW_LOG_MIL("Nitz : Create pipeline %s (pipeline %p bus %p)", pipelineName, interfacePlayerPriv->gstPrivateContext->pipeline, interfacePlayerPriv->gstPrivateContext->bus); CreatePipeline(pipelineName, PipelinePriority); /*Create a new pipeline if pipeline or the message bus does not exist*/ @@ -1287,7 +1287,7 @@ static GstStateChangeReturn SetStateWithWarnings(GstElement *element, GstState t switch(stateChangeReturn) { case GST_STATE_CHANGE_FAILURE: -#ifdef MWPLAYER_TELEMETRY_SUPPORT +#ifdef PLAYER_TELEMETRY_SUPPORT MWPlayerTelemetry2::send("MW_PIPELINE_STATE_CHANGE_FAILURE", SafeName(element), gst_element_state_get_name(current), @@ -3275,7 +3275,7 @@ void InterfacePlayerRDK::QueueProtectionEvent(const std::string& formatType, con } else { -#ifdef MWPLAYER_TELEMETRY_SUPPORT +#ifdef PLAYER_TELEMETRY_SUPPORT MWPlayerTelemetry2::send("MW_PROTECTION_EVENT_FAILED", formatType, protSystemId ? protSystemId : "", @@ -4051,7 +4051,7 @@ static void GstPlayer_OnGstBufferUnderflowCb(GstElement* object, guint arg0, gpo MW_LOG_WARN("## Got Underflow message from %s type %d ##", GST_ELEMENT_NAME(object), type); privatePlayer->gstPrivateContext->stream[type].bufferUnderrun = true; -#ifdef MWPLAYER_TELEMETRY_SUPPORT +#ifdef PLAYER_TELEMETRY_SUPPORT MWPlayerTelemetry2::send("MW_BUFFER_UNDERFLOW", GST_ELEMENT_NAME(object), type, @@ -4106,7 +4106,7 @@ static void GstPlayer_OnGstPtsErrorCb(GstElement *object, guint arg0, gpointer a MW_LOG_ERR("Got PTS error message from %s", GST_ELEMENT_NAME(object)); bool isVideo = false; bool isAudioSink = false; -#ifdef MWPLAYER_TELEMETRY_SUPPORT +#ifdef PLAYER_TELEMETRY_SUPPORT MWPlayerTelemetry2::send("MW_PTS_ERROR", GST_ELEMENT_NAME(object), isVideo, @@ -4143,7 +4143,7 @@ static void GstPlayer_OnGstDecodeErrorCb(GstElement* object, guint arg0, gpointe HANDLER_CONTROL_HELPER_CALLBACK_VOID(); long long deltaMS = NOW_STEADY_TS_MS - privatePlayer->gstPrivateContext->decodeErrorMsgTimeMS; privatePlayer->gstPrivateContext->decodeErrorCBCount += 1; -#ifdef MWPLAYER_TELEMETRY_SUPPORT +#ifdef PLAYER_TELEMETRY_SUPPORT MWPlayerTelemetry2::send("MW_DECODE_ERROR", GST_ELEMENT_NAME(object), privatePlayer->gstPrivateContext->decodeErrorCBCount, @@ -4186,7 +4186,7 @@ static gboolean bus_message(GstBus * bus, GstMessage * msg, InterfacePlayerRDK * { case GST_MESSAGE_ERROR: gst_message_parse_error(msg, &error, &dbg_info); -#ifdef MWPLAYER_TELEMETRY_SUPPORT +#ifdef PLAYER_TELEMETRY_SUPPORT MWPlayerTelemetry2::send("MW_GST_ERROR", GST_OBJECT_NAME(msg->src), error->message, @@ -4638,7 +4638,7 @@ static gboolean buffering_timeout (gpointer data) pInterfacePlayerRDK->OnBuffering_timeoutCb(isBufferingTimeoutConditionMet, isRateCorrectionDefaultOnPlaying, isPlayerReady); } return privatePlayer->gstPrivateContext->buffering_in_progress; -#ifdef MWPLAYER_TELEMETRY_SUPPORT +#ifdef PLAYER_TELEMETRY_SUPPORT MWPlayerTelemetry2::send("MW_BUFFERING_TIMEOUT", privatePlayer->gstPrivateContext->numberOfVideoBuffersSent, privatePlayer->gstPrivateContext->buffering_timeout_cnt, From 71a8b638514fddea3315cdedf0b3bb291ad47e25 Mon Sep 17 00:00:00 2001 From: deepikasri Date: Thu, 19 Feb 2026 14:21:50 +0530 Subject: [PATCH 03/46] resovling compilation issues --- InterfacePlayerRDK.cpp | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/InterfacePlayerRDK.cpp b/InterfacePlayerRDK.cpp index 5a4b3cab..f799c0e9 100644 --- a/InterfacePlayerRDK.cpp +++ b/InterfacePlayerRDK.cpp @@ -1288,7 +1288,7 @@ static GstStateChangeReturn SetStateWithWarnings(GstElement *element, GstState t { case GST_STATE_CHANGE_FAILURE: #ifdef PLAYER_TELEMETRY_SUPPORT - MWPlayerTelemetry2::send("MW_PIPELINE_STATE_CHANGE_FAILURE", + PlayerTelemetry2::send("MW_PIPELINE_STATE_CHANGE_FAILURE", SafeName(element), gst_element_state_get_name(current), gst_element_state_get_name(pending), @@ -3276,7 +3276,7 @@ void InterfacePlayerRDK::QueueProtectionEvent(const std::string& formatType, con else { #ifdef PLAYER_TELEMETRY_SUPPORT - MWPlayerTelemetry2::send("MW_PROTECTION_EVENT_FAILED", + PlayerTelemetry2::send("MW_PROTECTION_EVENT_FAILED", formatType, protSystemId ? protSystemId : "", mediaType, @@ -4052,7 +4052,7 @@ static void GstPlayer_OnGstBufferUnderflowCb(GstElement* object, guint arg0, gpo MW_LOG_WARN("## Got Underflow message from %s type %d ##", GST_ELEMENT_NAME(object), type); privatePlayer->gstPrivateContext->stream[type].bufferUnderrun = true; #ifdef PLAYER_TELEMETRY_SUPPORT - MWPlayerTelemetry2::send("MW_BUFFER_UNDERFLOW", + PlayerTelemetry2::send("MW_BUFFER_UNDERFLOW", GST_ELEMENT_NAME(object), type, privatePlayer->gstPrivateContext->stream[type].eosReached, @@ -4107,7 +4107,7 @@ static void GstPlayer_OnGstPtsErrorCb(GstElement *object, guint arg0, gpointer a bool isVideo = false; bool isAudioSink = false; #ifdef PLAYER_TELEMETRY_SUPPORT - MWPlayerTelemetry2::send("MW_PTS_ERROR", + PlayerTelemetry2::send("MW_PTS_ERROR", GST_ELEMENT_NAME(object), isVideo, isAudioSink, @@ -4144,7 +4144,7 @@ static void GstPlayer_OnGstDecodeErrorCb(GstElement* object, guint arg0, gpointe long long deltaMS = NOW_STEADY_TS_MS - privatePlayer->gstPrivateContext->decodeErrorMsgTimeMS; privatePlayer->gstPrivateContext->decodeErrorCBCount += 1; #ifdef PLAYER_TELEMETRY_SUPPORT - MWPlayerTelemetry2::send("MW_DECODE_ERROR", + PlayerTelemetry2::send("MW_DECODE_ERROR", GST_ELEMENT_NAME(object), privatePlayer->gstPrivateContext->decodeErrorCBCount, deltaMS, @@ -4187,7 +4187,7 @@ static gboolean bus_message(GstBus * bus, GstMessage * msg, InterfacePlayerRDK * case GST_MESSAGE_ERROR: gst_message_parse_error(msg, &error, &dbg_info); #ifdef PLAYER_TELEMETRY_SUPPORT - MWPlayerTelemetry2::send("MW_GST_ERROR", + PlayerTelemetry2::send("MW_GST_ERROR", GST_OBJECT_NAME(msg->src), error->message, dbg_info ? dbg_info : "", @@ -4639,7 +4639,7 @@ static gboolean buffering_timeout (gpointer data) } return privatePlayer->gstPrivateContext->buffering_in_progress; #ifdef PLAYER_TELEMETRY_SUPPORT - MWPlayerTelemetry2::send("MW_BUFFERING_TIMEOUT", + PlayerTelemetry2::send("MW_BUFFERING_TIMEOUT", privatePlayer->gstPrivateContext->numberOfVideoBuffersSent, privatePlayer->gstPrivateContext->buffering_timeout_cnt, privatePlayer->gstPrivateContext->rate, From b9d1c2485d647f6962db37351e0fcd3d56b1328f Mon Sep 17 00:00:00 2001 From: deepikasri Date: Thu, 19 Feb 2026 19:15:30 +0530 Subject: [PATCH 04/46] underflow msg added --- InterfacePlayerRDK.cpp | 48 ++++++++++++++++++++++++++++-------------- 1 file changed, 32 insertions(+), 16 deletions(-) diff --git a/InterfacePlayerRDK.cpp b/InterfacePlayerRDK.cpp index f799c0e9..1770dce2 100644 --- a/InterfacePlayerRDK.cpp +++ b/InterfacePlayerRDK.cpp @@ -1287,12 +1287,21 @@ static GstStateChangeReturn SetStateWithWarnings(GstElement *element, GstState t switch(stateChangeReturn) { case GST_STATE_CHANGE_FAILURE: + + #ifdef PLAYER_TELEMETRY_SUPPORT - PlayerTelemetry2::send("MW_PIPELINE_STATE_CHANGE_FAILURE", - SafeName(element), - gst_element_state_get_name(current), - gst_element_state_get_name(pending), - targetState); + std::map i; + std::map s; + std::map f; + + s["elem"] = SafeName(element); + s["cur"] = gst_element_state_get_name(current); + s["pen"] = gst_element_state_get_name(pending); + + // GstState is an enum; transmit numeric value (stable for decoding on the backend) + i["tgt"] = static_cast(targetState); + + PlayerTelemetry2::send("MW_PIPELINE_STATE_CHANGE_FAILURE", i, s, f); #endif MW_LOG_ERR("InterfacePlayerRDK: %s is in FAILURE state : current %s pending %s", SafeName(element).c_str(),gst_element_state_get_name(current), gst_element_state_get_name(pending)); LogStatus(element); @@ -3275,7 +3284,7 @@ void InterfacePlayerRDK::QueueProtectionEvent(const std::string& formatType, con } else { -#ifdef PLAYER_TELEMETRY_SUPPORT +#if 0 PlayerTelemetry2::send("MW_PROTECTION_EVENT_FAILED", formatType, protSystemId ? protSystemId : "", @@ -4052,12 +4061,19 @@ static void GstPlayer_OnGstBufferUnderflowCb(GstElement* object, guint arg0, gpo MW_LOG_WARN("## Got Underflow message from %s type %d ##", GST_ELEMENT_NAME(object), type); privatePlayer->gstPrivateContext->stream[type].bufferUnderrun = true; #ifdef PLAYER_TELEMETRY_SUPPORT - PlayerTelemetry2::send("MW_BUFFER_UNDERFLOW", - GST_ELEMENT_NAME(object), - type, - privatePlayer->gstPrivateContext->stream[type].eosReached, - privatePlayer->gstPrivateContext->rate, - privatePlayer->gstPrivateContext->stream[type].bufferUnderrun); + std::map i; + std::map s; + std::map f; + + s["elem"] = GST_ELEMENT_NAME(object); + + i["typ"] = static_cast(type); + i["eos"] = privatePlayer->gstPrivateContext->stream[type].eosReached ? 1 : 0; + i["und"] = privatePlayer->gstPrivateContext->stream[type].bufferUnderrun ? 1 : 0; + + f["rate"] = privatePlayer->gstPrivateContext->rate; + + PlayerTelemetry2::send("MW_BUFFER_UNDERFLOW", i, s, f); #endif if ((privatePlayer->gstPrivateContext->stream[type].eosReached) && (privatePlayer->gstPrivateContext->rate > 0)) { @@ -4106,7 +4122,7 @@ static void GstPlayer_OnGstPtsErrorCb(GstElement *object, guint arg0, gpointer a MW_LOG_ERR("Got PTS error message from %s", GST_ELEMENT_NAME(object)); bool isVideo = false; bool isAudioSink = false; -#ifdef PLAYER_TELEMETRY_SUPPORT +#if 0 PlayerTelemetry2::send("MW_PTS_ERROR", GST_ELEMENT_NAME(object), isVideo, @@ -4143,7 +4159,7 @@ static void GstPlayer_OnGstDecodeErrorCb(GstElement* object, guint arg0, gpointe HANDLER_CONTROL_HELPER_CALLBACK_VOID(); long long deltaMS = NOW_STEADY_TS_MS - privatePlayer->gstPrivateContext->decodeErrorMsgTimeMS; privatePlayer->gstPrivateContext->decodeErrorCBCount += 1; -#ifdef PLAYER_TELEMETRY_SUPPORT +#if 0 PlayerTelemetry2::send("MW_DECODE_ERROR", GST_ELEMENT_NAME(object), privatePlayer->gstPrivateContext->decodeErrorCBCount, @@ -4186,7 +4202,7 @@ static gboolean bus_message(GstBus * bus, GstMessage * msg, InterfacePlayerRDK * { case GST_MESSAGE_ERROR: gst_message_parse_error(msg, &error, &dbg_info); -#ifdef PLAYER_TELEMETRY_SUPPORT +#if 0 PlayerTelemetry2::send("MW_GST_ERROR", GST_OBJECT_NAME(msg->src), error->message, @@ -4638,7 +4654,7 @@ static gboolean buffering_timeout (gpointer data) pInterfacePlayerRDK->OnBuffering_timeoutCb(isBufferingTimeoutConditionMet, isRateCorrectionDefaultOnPlaying, isPlayerReady); } return privatePlayer->gstPrivateContext->buffering_in_progress; -#ifdef PLAYER_TELEMETRY_SUPPORT +#if 0 PlayerTelemetry2::send("MW_BUFFERING_TIMEOUT", privatePlayer->gstPrivateContext->numberOfVideoBuffersSent, privatePlayer->gstPrivateContext->buffering_timeout_cnt, From 7c20fb01355e24ed4988110cb25f04562eb7a2b4 Mon Sep 17 00:00:00 2001 From: deepikasri Date: Thu, 19 Feb 2026 22:44:45 +0530 Subject: [PATCH 05/46] static code usage is removed --- InterfacePlayerRDK.cpp | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/InterfacePlayerRDK.cpp b/InterfacePlayerRDK.cpp index 1770dce2..aa46ff23 100644 --- a/InterfacePlayerRDK.cpp +++ b/InterfacePlayerRDK.cpp @@ -1287,6 +1287,7 @@ static GstStateChangeReturn SetStateWithWarnings(GstElement *element, GstState t switch(stateChangeReturn) { case GST_STATE_CHANGE_FAILURE: + { #ifdef PLAYER_TELEMETRY_SUPPORT @@ -1301,10 +1302,13 @@ static GstStateChangeReturn SetStateWithWarnings(GstElement *element, GstState t // GstState is an enum; transmit numeric value (stable for decoding on the backend) i["tgt"] = static_cast(targetState); - PlayerTelemetry2::send("MW_PIPELINE_STATE_CHANGE_FAILURE", i, s, f); + PlayerTelemetry2 telemetry; + telemetry.send("MW_PIPELINE_STATE_CHANGE_FAILURE", i, s, f); + #endif MW_LOG_ERR("InterfacePlayerRDK: %s is in FAILURE state : current %s pending %s", SafeName(element).c_str(),gst_element_state_get_name(current), gst_element_state_get_name(pending)); LogStatus(element); + } break; case GST_STATE_CHANGE_SUCCESS: MW_LOG_DEBUG("InterfacePlayerRDK: %s is in success state : current %s pending %s", SafeName(element).c_str(),gst_element_state_get_name(current), gst_element_state_get_name(pending)); @@ -4073,7 +4077,8 @@ static void GstPlayer_OnGstBufferUnderflowCb(GstElement* object, guint arg0, gpo f["rate"] = privatePlayer->gstPrivateContext->rate; - PlayerTelemetry2::send("MW_BUFFER_UNDERFLOW", i, s, f); + PlayerTelemetry2 telemetry; + telemetry.send("MW_BUFFER_UNDERFLOW", i, s, f); #endif if ((privatePlayer->gstPrivateContext->stream[type].eosReached) && (privatePlayer->gstPrivateContext->rate > 0)) { From 64366e1fd7c7d72a04eb56afb05c0bd015ff4a5d Mon Sep 17 00:00:00 2001 From: deepikasri Date: Mon, 23 Feb 2026 14:36:18 +0530 Subject: [PATCH 06/46] resolving conflicts --- test/utests/run.sh | 28 ---------------------------- 1 file changed, 28 deletions(-) diff --git a/test/utests/run.sh b/test/utests/run.sh index a2e00f98..a8b4b82e 100755 --- a/test/utests/run.sh +++ b/test/utests/run.sh @@ -184,37 +184,9 @@ else fi if [ "$build_coverage" -eq "1" ]; then -<<<<<<< HEAD -#We are in utests/build - -LCOV=lcov - -#Get initial baseline of files from player-cli build -$LCOV --initial $IGNORE --directory ${PLAYER_BUILD_GCNO} -b $PLAYERDIR --capture --output-file baseline.info - -#Get a list of dirs which contain coverage data for player source files. -TEST_DIRS=$(find tests -name '*.dir' -type d | grep -v _coverage.dir ) -COMBINE="" -for DIR in $TEST_DIRS; do - info_file=$DIR/TEST.info - cmd="$LCOV --directory $DIR -b $TESTDIR --capture --output-file ${info_file}" - echo $cmd - $cmd - COMBINE=$COMBINE" -a $info_file" -done -HTML_OUT=$(realpath ../CombinedCoverage) -XML_OUT=$(realpath ../coverage.xml) -$LCOV $COMBINE -a baseline.info --output-file all.info.1 -$LCOV --remove all.info.1 --output-file all.info "*/aamp/tsb/test/*" "*/aamp/.libs/*" "*/aamp/test/*" "*/aamp/Linux/*" "*/aamp/subtec/subtecparser/*" "/usr/*" -genhtml --demangle-cpp -o ${HTML_OUT} all.info -# Generate coverage.xml -lcov_cobertura all.info -b ${PLAYERDIR} --demangle -o ${XML_OUT} || true -echo "Coverage written to ${HTML_OUT}" -======= lcov --ignore-errors mismatch --directory ${TEST_DIR} -b ${PLAYER_DIR} --capture --rc geninfo_unexecuted_blocks=1 --output-file all.info && \ lcov --ignore-errors mismatch --remove all.info "*/test/*" "*/.libs/*" "/usr/*" --output-file all.cleaned.info && \ genhtml --demangle-cpp -o CombinedCoverage all.cleaned.info echo "Checking for CombinedCoverage directory in $(pwd):" ls -l CombinedCoverage || echo "No CombinedCoverage directory in $(pwd)" ->>>>>>> develop fi From f404e6ee59d86cbaa9d0e61097fdaad5e1ce6297 Mon Sep 17 00:00:00 2001 From: deepikasri Date: Wed, 4 Mar 2026 15:25:52 +0530 Subject: [PATCH 07/46] added error PTS conditions --- InterfacePlayerRDK.cpp | 75 ++++++++++++++++++++++++++++++------------ 1 file changed, 54 insertions(+), 21 deletions(-) diff --git a/InterfacePlayerRDK.cpp b/InterfacePlayerRDK.cpp index aa46ff23..f21899cf 100644 --- a/InterfacePlayerRDK.cpp +++ b/InterfacePlayerRDK.cpp @@ -4062,7 +4062,7 @@ static void GstPlayer_OnGstBufferUnderflowCb(GstElement* object, guint arg0, gpo return; } - MW_LOG_WARN("## Got Underflow message from %s type %d ##", GST_ELEMENT_NAME(object), type); + MW_LOG_WARN("## GstPlayer_OnGstBufferUnderflowCb: Got Underflow message from %s type %d ##", GST_ELEMENT_NAME(object), type); privatePlayer->gstPrivateContext->stream[type].bufferUnderrun = true; #ifdef PLAYER_TELEMETRY_SUPPORT std::map i; @@ -4124,17 +4124,29 @@ static void GstPlayer_OnGstPtsErrorCb(GstElement *object, guint arg0, gpointer a { InterfacePlayerPriv* privatePlayer = pInterfacePlayerRDK->GetPrivatePlayer(); HANDLER_CONTROL_HELPER_CALLBACK_VOID(); - MW_LOG_ERR("Got PTS error message from %s", GST_ELEMENT_NAME(object)); + MW_LOG_ERR("GstPlayer_OnGstPtsErrorCb: Got PTS error message from %s", GST_ELEMENT_NAME(object)); bool isVideo = false; bool isAudioSink = false; -#if 0 - PlayerTelemetry2::send("MW_PTS_ERROR", - GST_ELEMENT_NAME(object), - isVideo, - isAudioSink, - privatePlayer->gstPrivateContext->lastKnownPTS, - privatePlayer->gstPrivateContext->ptsUpdatedTimeMS); +#ifdef PLAYER_TELEMETRY_SUPPORT + std::map i; + std::map s; + std::map f; + + // String values + s["elem"] = GST_ELEMENT_NAME(object); + + // Integer values + i["vid"] = isVideo ? 1 : 0; + i["aud"] = isAudioSink ? 1 : 0; + + // Float values + f["pts"] = static_cast(privatePlayer->gstPrivateContext->lastKnownPTS); + f["ptsUpd"] = static_cast(privatePlayer->gstPrivateContext->ptsUpdatedTimeMS); + + PlayerTelemetry2 telemetry; + telemetry.send("MW_PTS_ERROR", i, s, f); #endif + if (privatePlayer->socInterface->IsVideoSinkHandleErrors()) { isVideo = GstPlayer_isVideoSink(GST_ELEMENT_NAME(object), pInterfacePlayerRDK); @@ -4164,12 +4176,24 @@ static void GstPlayer_OnGstDecodeErrorCb(GstElement* object, guint arg0, gpointe HANDLER_CONTROL_HELPER_CALLBACK_VOID(); long long deltaMS = NOW_STEADY_TS_MS - privatePlayer->gstPrivateContext->decodeErrorMsgTimeMS; privatePlayer->gstPrivateContext->decodeErrorCBCount += 1; -#if 0 - PlayerTelemetry2::send("MW_DECODE_ERROR", - GST_ELEMENT_NAME(object), - privatePlayer->gstPrivateContext->decodeErrorCBCount, - deltaMS, - privatePlayer->gstPrivateContext->rate); + +#ifdef PLAYER_TELEMETRY_SUPPORT + std::map i; + std::map s; + std::map f; + + // String values + s["elem"] = GST_ELEMENT_NAME(object); + + // Integer values + i["cnt"] = privatePlayer->gstPrivateContext->decodeErrorCBCount; + + // Float values + f["delta"] = static_cast(deltaMS); + f["rate"] = privatePlayer->gstPrivateContext->rate; + + PlayerTelemetry2 telemetry; + telemetry.send("MW_DECODE_ERROR", i, s, f); #endif if (deltaMS >= GST_MIN_DECODE_ERROR_INTERVAL) { @@ -4207,12 +4231,21 @@ static gboolean bus_message(GstBus * bus, GstMessage * msg, InterfacePlayerRDK * { case GST_MESSAGE_ERROR: gst_message_parse_error(msg, &error, &dbg_info); -#if 0 - PlayerTelemetry2::send("MW_GST_ERROR", - GST_OBJECT_NAME(msg->src), - error->message, - dbg_info ? dbg_info : "", - privatePlayer->gstPrivateContext->rate); +#ifdef PLAYER_TELEMETRY_SUPPORT + std::map i; + std::map s; + std::map f; + + // String values + s["elem"] = GST_OBJECT_NAME(msg->src); + s["err"] = error->message ? error->message : ""; + s["dbg"] = dbg_info ? dbg_info : ""; + + // Float values + f["rate"] = privatePlayer->gstPrivateContext->rate; + + PlayerTelemetry2 telemetry; + telemetry.send("MW_GST_ERROR", i, s, f); #endif MW_LOG_ERR("GST_MESSAGE_ERROR %s: %s\n", GST_OBJECT_NAME(msg->src), error->message); busEvent.msgType = MESSAGE_ERROR; From e4d686e4d25e41e51df6391c1f3c908b17119de5 Mon Sep 17 00:00:00 2001 From: deepikasri Date: Thu, 5 Mar 2026 00:02:46 +0530 Subject: [PATCH 08/46] resolved compilation isseus --- InterfacePlayerRDK.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/InterfacePlayerRDK.cpp b/InterfacePlayerRDK.cpp index f21899cf..19de182d 100644 --- a/InterfacePlayerRDK.cpp +++ b/InterfacePlayerRDK.cpp @@ -1308,8 +1308,8 @@ static GstStateChangeReturn SetStateWithWarnings(GstElement *element, GstState t #endif MW_LOG_ERR("InterfacePlayerRDK: %s is in FAILURE state : current %s pending %s", SafeName(element).c_str(),gst_element_state_get_name(current), gst_element_state_get_name(pending)); LogStatus(element); - } break; + } case GST_STATE_CHANGE_SUCCESS: MW_LOG_DEBUG("InterfacePlayerRDK: %s is in success state : current %s pending %s", SafeName(element).c_str(),gst_element_state_get_name(current), gst_element_state_get_name(pending)); break; From 9148d7e55ed2333e9163fde0aa55c47f959d546e Mon Sep 17 00:00:00 2001 From: deepikasri Date: Thu, 5 Mar 2026 14:38:18 +0530 Subject: [PATCH 09/46] resolved compilation issues --- InterfacePlayerRDK.cpp | 57 +++++++++++++++++++++--------------------- 1 file changed, 29 insertions(+), 28 deletions(-) diff --git a/InterfacePlayerRDK.cpp b/InterfacePlayerRDK.cpp index 19de182d..7ff269d1 100644 --- a/InterfacePlayerRDK.cpp +++ b/InterfacePlayerRDK.cpp @@ -4230,40 +4230,41 @@ static gboolean bus_message(GstBus * bus, GstMessage * msg, InterfacePlayerRDK * switch (GST_MESSAGE_TYPE(msg)) { case GST_MESSAGE_ERROR: - gst_message_parse_error(msg, &error, &dbg_info); + { + gst_message_parse_error(msg, &error, &dbg_info); #ifdef PLAYER_TELEMETRY_SUPPORT - std::map i; - std::map s; - std::map f; + std::map i; + std::map s; + std::map f; - // String values - s["elem"] = GST_OBJECT_NAME(msg->src); - s["err"] = error->message ? error->message : ""; - s["dbg"] = dbg_info ? dbg_info : ""; + // String values + s["elem"] = GST_OBJECT_NAME(msg->src); + s["err"] = error->message ? error->message : ""; + s["dbg"] = dbg_info ? dbg_info : ""; - // Float values - f["rate"] = privatePlayer->gstPrivateContext->rate; + // Float values + f["rate"] = privatePlayer->gstPrivateContext->rate; - PlayerTelemetry2 telemetry; - telemetry.send("MW_GST_ERROR", i, s, f); + PlayerTelemetry2 telemetry; + telemetry.send("MW_GST_ERROR", i, s, f); #endif - MW_LOG_ERR("GST_MESSAGE_ERROR %s: %s\n", GST_OBJECT_NAME(msg->src), error->message); - busEvent.msgType = MESSAGE_ERROR; - busEvent.msg = error->message; - if(dbg_info) - { - busEvent.dbg_info = dbg_info; - } - else - { - busEvent.dbg_info[0] = '\0'; + MW_LOG_ERR("GST_MESSAGE_ERROR %s: %s\n", GST_OBJECT_NAME(msg->src), error->message); + busEvent.msgType = MESSAGE_ERROR; + busEvent.msg = error->message; + if(dbg_info) + { + busEvent.dbg_info = dbg_info; + } + else + { + busEvent.dbg_info[0] = '\0'; + } + pInterfacePlayerRDK->busMessageCallback(std::move(busEvent)); + MW_LOG_ERR("Debug Info: %s\n", (dbg_info) ? dbg_info : "none"); + g_clear_error(&error); + g_free(dbg_info); + break; } - pInterfacePlayerRDK->busMessageCallback(std::move(busEvent)); - MW_LOG_ERR("Debug Info: %s\n", (dbg_info) ? dbg_info : "none"); - g_clear_error(&error); - g_free(dbg_info); - break; - case GST_MESSAGE_WARNING: gst_message_parse_warning(msg, &error, &dbg_info); MW_LOG_ERR("GST_MESSAGE_WARNING %s: %s\n", GST_OBJECT_NAME(msg->src), error->message); From 1692915aff9a8572397011eeb6b723854b662d89 Mon Sep 17 00:00:00 2001 From: deepikasri Date: Fri, 6 Mar 2026 14:37:23 +0530 Subject: [PATCH 10/46] removed additional logic handled --- InterfacePlayerRDK.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/InterfacePlayerRDK.cpp b/InterfacePlayerRDK.cpp index 7ff269d1..3623f48b 100644 --- a/InterfacePlayerRDK.cpp +++ b/InterfacePlayerRDK.cpp @@ -1290,7 +1290,7 @@ static GstStateChangeReturn SetStateWithWarnings(GstElement *element, GstState t { -#ifdef PLAYER_TELEMETRY_SUPPORT +#if 0 std::map i; std::map s; std::map f; @@ -4127,7 +4127,7 @@ static void GstPlayer_OnGstPtsErrorCb(GstElement *object, guint arg0, gpointer a MW_LOG_ERR("GstPlayer_OnGstPtsErrorCb: Got PTS error message from %s", GST_ELEMENT_NAME(object)); bool isVideo = false; bool isAudioSink = false; -#ifdef PLAYER_TELEMETRY_SUPPORT +#if 0 std::map i; std::map s; std::map f; @@ -4177,7 +4177,7 @@ static void GstPlayer_OnGstDecodeErrorCb(GstElement* object, guint arg0, gpointe long long deltaMS = NOW_STEADY_TS_MS - privatePlayer->gstPrivateContext->decodeErrorMsgTimeMS; privatePlayer->gstPrivateContext->decodeErrorCBCount += 1; -#ifdef PLAYER_TELEMETRY_SUPPORT +#if 0 std::map i; std::map s; std::map f; @@ -4232,7 +4232,7 @@ static gboolean bus_message(GstBus * bus, GstMessage * msg, InterfacePlayerRDK * case GST_MESSAGE_ERROR: { gst_message_parse_error(msg, &error, &dbg_info); -#ifdef PLAYER_TELEMETRY_SUPPORT +#if 0 std::map i; std::map s; std::map f; From 3a28ef60234d13a4d0ba80bd93fc95cb775ffb28 Mon Sep 17 00:00:00 2001 From: deepikasri Date: Fri, 6 Mar 2026 17:28:16 +0530 Subject: [PATCH 11/46] added prints --- PlayerTelemetry2.cpp | 1 + 1 file changed, 1 insertion(+) diff --git a/PlayerTelemetry2.cpp b/PlayerTelemetry2.cpp index 7668c1eb..002b6eea 100644 --- a/PlayerTelemetry2.cpp +++ b/PlayerTelemetry2.cpp @@ -40,6 +40,7 @@ PlayerTelemetry2::PlayerTelemetry2( const std::string &appName) : appName(appNam } bool PlayerTelemetry2::send( const std::string &markerName, const std::map& intData, const std::map& stringData, const std::map& floatData ) { + MW_LOG_ERR("[M] Marker Name: %s value:%s", markerName.c_str(),jsonString); bool bRet = false; if(mInitializer.isInitialized() ) { From 0ccd026f6c43d3b8a81f3e8dadede3c907c8dd07 Mon Sep 17 00:00:00 2001 From: deepikasri Date: Fri, 6 Mar 2026 22:41:44 +0530 Subject: [PATCH 12/46] fixed compilation issues --- PlayerTelemetry2.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/PlayerTelemetry2.cpp b/PlayerTelemetry2.cpp index 002b6eea..68e35667 100644 --- a/PlayerTelemetry2.cpp +++ b/PlayerTelemetry2.cpp @@ -40,7 +40,7 @@ PlayerTelemetry2::PlayerTelemetry2( const std::string &appName) : appName(appNam } bool PlayerTelemetry2::send( const std::string &markerName, const std::map& intData, const std::map& stringData, const std::map& floatData ) { - MW_LOG_ERR("[M] Marker Name: %s value:%s", markerName.c_str(),jsonString); + MW_LOG_ERR("[M] Marker Name: %s ", markerName.c_str()); bool bRet = false; if(mInitializer.isInitialized() ) { From 3c90d8a32060db2826384970f584fd8a6389cd72 Mon Sep 17 00:00:00 2001 From: deepikasri Date: Thu, 12 Mar 2026 13:02:24 +0530 Subject: [PATCH 13/46] added debug --- PlayerTelemetry2.cpp | 65 ++++++++++++++++++++++++++++++++------------ 1 file changed, 47 insertions(+), 18 deletions(-) diff --git a/PlayerTelemetry2.cpp b/PlayerTelemetry2.cpp index 68e35667..ac147c23 100644 --- a/PlayerTelemetry2.cpp +++ b/PlayerTelemetry2.cpp @@ -40,51 +40,80 @@ PlayerTelemetry2::PlayerTelemetry2( const std::string &appName) : appName(appNam } bool PlayerTelemetry2::send( const std::string &markerName, const std::map& intData, const std::map& stringData, const std::map& floatData ) { - MW_LOG_ERR("[M] Marker Name: %s ", markerName.c_str()); + MW_LOG_ERR("[M] Marker Name: %s %d", markerName.c_str(), mInitializer.isInitialized()); bool bRet = false; - if(mInitializer.isInitialized() ) + + // Log entry and initializer status + MW_LOG_ERR("[M] Entered send() | marker: %s | initializer: %d", + markerName.c_str(), mInitializer.isInitialized()); + + bool init = mInitializer.isInitialized(); + if(init) { + MW_LOG_ERR("[M] Inside initializer block"); + cJSON *root = cJSON_CreateObject(); + if(!root) + { + MW_LOG_ERR("[M] cJSON_CreateObject failed"); + return false; + } + + MW_LOG_ERR("[M] JSON object created"); cJSON_AddStringToObject(root, "app", appName.c_str()); + MW_LOG_ERR("[M] appName added: %s", appName.c_str()); - for (const auto& pair : intData) { - std::string key = pair.first; - int value = pair.second; - cJSON_AddNumberToObject(root, key.c_str(), value); + for (const auto& pair : intData) + { + MW_LOG_ERR("[M] int key=%s value=%d", pair.first.c_str(), pair.second); + cJSON_AddNumberToObject(root, pair.first.c_str(), pair.second); } - for (const auto& pair : stringData) { - std::string key = pair.first; - std::string value = pair.second; - cJSON_AddStringToObject(root, key.c_str(), value.c_str()); + for (const auto& pair : stringData) + { + MW_LOG_ERR("[M] string key=%s value=%s", pair.first.c_str(), pair.second.c_str()); + cJSON_AddStringToObject(root, pair.first.c_str(), pair.second.c_str()); } - for (const auto& pair : floatData) { - std::string key = pair.first; - float value = pair.second; - cJSON_AddNumberToObject(root, key.c_str(), value); + for (const auto& pair : floatData) + { + MW_LOG_ERR("[M] float key=%s value=%f", pair.first.c_str(), pair.second); + cJSON_AddNumberToObject(root, pair.first.c_str(), pair.second); } - //lets use cJSON_PrintUnformatted , cJSON_Print is formated adds whitespace n hence takes more memory also eats up more logs if logged. char *jsonString = cJSON_PrintUnformatted(root); + if(!jsonString) + { + MW_LOG_ERR("[M] cJSON_PrintUnformatted failed"); + cJSON_Delete(root); + return false; + } - MW_LOG_INFO("[M] Marker Name: %s value:%s", markerName.c_str(),jsonString); + MW_LOG_ERR("[M] Marker Name: %s | JSON: %s", markerName.c_str(), jsonString); - T2ERROR t2Error = t2_event_s( (char *)markerName.c_str(),jsonString); + T2ERROR t2Error = t2_event_s((char *)markerName.c_str(), jsonString); + MW_LOG_ERR("[M] t2_event_s returned: %d", t2Error); if(T2ERROR_SUCCESS == t2Error) { + MW_LOG_ERR("[M] Telemetry event sent successfully"); bRet = true; } else { - MW_LOG_ERR("t2_event_s map failed:%d ", t2Error); + MW_LOG_ERR("[M] Telemetry event failed: %d", t2Error); } + cJSON_free(jsonString); cJSON_Delete(root); } + else + { + MW_LOG_ERR("[M] Telemetry initializer not ready"); + } + MW_LOG_ERR("[M] Exiting send() | marker: %s", markerName.c_str()); return bRet; } From 16117e19f3fd23057f57bd425e2e93212a1005fd Mon Sep 17 00:00:00 2001 From: deepikasri Date: Wed, 25 Mar 2026 11:27:21 +0530 Subject: [PATCH 14/46] added few telemetry markers --- InterfacePlayerRDK.cpp | 26 +++++++++++++------------- 1 file changed, 13 insertions(+), 13 deletions(-) diff --git a/InterfacePlayerRDK.cpp b/InterfacePlayerRDK.cpp index d7f4c750..a5f32c04 100644 --- a/InterfacePlayerRDK.cpp +++ b/InterfacePlayerRDK.cpp @@ -1290,7 +1290,7 @@ static GstStateChangeReturn SetStateWithWarnings(GstElement *element, GstState t { -#if 0 +#ifdef PLAYER_TELEMETRY_SUPPORT std::map i; std::map s; std::map f; @@ -1299,7 +1299,7 @@ static GstStateChangeReturn SetStateWithWarnings(GstElement *element, GstState t s["cur"] = gst_element_state_get_name(current); s["pen"] = gst_element_state_get_name(pending); - // GstState is an enum; transmit numeric value (stable for decoding on the backend) + /** GstState is an enum; transmit numeric value (stable for decoding on the backend) */ i["tgt"] = static_cast(targetState); PlayerTelemetry2 telemetry; @@ -4127,19 +4127,19 @@ static void GstPlayer_OnGstPtsErrorCb(GstElement *object, guint arg0, gpointer a MW_LOG_ERR("GstPlayer_OnGstPtsErrorCb: Got PTS error message from %s", GST_ELEMENT_NAME(object)); bool isVideo = false; bool isAudioSink = false; -#if 0 +#ifdef PLAYER_TELEMETRY_SUPPORT std::map i; std::map s; std::map f; - // String values + /** String values */ s["elem"] = GST_ELEMENT_NAME(object); - // Integer values + /** Integer values */ i["vid"] = isVideo ? 1 : 0; i["aud"] = isAudioSink ? 1 : 0; - // Float values + /** Float values */ f["pts"] = static_cast(privatePlayer->gstPrivateContext->lastKnownPTS); f["ptsUpd"] = static_cast(privatePlayer->gstPrivateContext->ptsUpdatedTimeMS); @@ -4177,18 +4177,18 @@ static void GstPlayer_OnGstDecodeErrorCb(GstElement* object, guint arg0, gpointe long long deltaMS = NOW_STEADY_TS_MS - privatePlayer->gstPrivateContext->decodeErrorMsgTimeMS; privatePlayer->gstPrivateContext->decodeErrorCBCount += 1; -#if 0 +#ifdef PLAYER_TELEMETRY_SUPPORT std::map i; std::map s; std::map f; - // String values + /** String values */ s["elem"] = GST_ELEMENT_NAME(object); - // Integer values + /** Integer values */ i["cnt"] = privatePlayer->gstPrivateContext->decodeErrorCBCount; - // Float values + /** Float values */ f["delta"] = static_cast(deltaMS); f["rate"] = privatePlayer->gstPrivateContext->rate; @@ -4232,17 +4232,17 @@ static gboolean bus_message(GstBus * bus, GstMessage * msg, InterfacePlayerRDK * case GST_MESSAGE_ERROR: { gst_message_parse_error(msg, &error, &dbg_info); -#if 0 +#ifdef PLAYER_TELEMETRY_SUPPORT std::map i; std::map s; std::map f; - // String values + /** String values */ s["elem"] = GST_OBJECT_NAME(msg->src); s["err"] = error->message ? error->message : ""; s["dbg"] = dbg_info ? dbg_info : ""; - // Float values + /** Float values */ f["rate"] = privatePlayer->gstPrivateContext->rate; PlayerTelemetry2 telemetry; From 4f6db42b46f67234134cb9c823163fe24dc42566 Mon Sep 17 00:00:00 2001 From: deepikasri Date: Tue, 31 Mar 2026 12:52:14 +0530 Subject: [PATCH 15/46] added new set of markers --- GstHandlerControl.cpp | 8 + InterfacePlayerRDK.cpp | 86 +++++++++++ PlayerTelemetry.h | 183 +++++++++++++++++++++++ TelemetryMarkers.h | 72 +++++++++ drm/DrmSessionManager.cpp | 36 +++++ drm/ocdm/opencdmsessionadapter.cpp | 13 ++ gst-plugins/drm/gst/gstcdmidecryptor.cpp | 18 +++ 7 files changed, 416 insertions(+) create mode 100644 PlayerTelemetry.h create mode 100644 TelemetryMarkers.h diff --git a/GstHandlerControl.cpp b/GstHandlerControl.cpp index 11f15198..163c81f1 100644 --- a/GstHandlerControl.cpp +++ b/GstHandlerControl.cpp @@ -19,6 +19,8 @@ #include "GstHandlerControl.h" #include "PlayerLogManager.h" +#include "TelemetryMarkers.h" +#include "PlayerTelemetry.h" #include #include @@ -75,6 +77,12 @@ bool GstHandlerControl::waitForDone(int MaximumDelayMilliseconds, std::string na { MW_LOG_ERR("GstPlayer: %d instance%s of %s running", mInstanceCount, mInstanceCount?"s":"", name.c_str()); + { + TelemetryPayload handlerPayload; + handlerPayload.add("handler", name); + handlerPayload.add("count", mInstanceCount); + PlayerTelemetry::sendEvent(TELEMETRY_EVENT_HANDLER_TIMEOUT, handlerPayload); + } return false; } else diff --git a/InterfacePlayerRDK.cpp b/InterfacePlayerRDK.cpp index a5f32c04..b9cc5b01 100644 --- a/InterfacePlayerRDK.cpp +++ b/InterfacePlayerRDK.cpp @@ -38,6 +38,8 @@ #include "player-xternal-stats.h" #endif #include "PlayerUtils.h" +#include "TelemetryMarkers.h" +#include "PlayerTelemetry.h" #define DEFAULT_BUFFERING_TO_MS 10 /**< TimeOut interval to check buffer fullness */ #define DEFAULT_BUFFERING_MAX_MS (1000) /**< max buffering time */ @@ -102,11 +104,13 @@ mSourceSetupCV(), mScheduler(), callbackMap(), setupStreamCallbackMap(), mDrmSys pthread_mutex_init(&interfacePlayerPriv->gstPrivateContext->stream[i].sourceLock, NULL); // start Scheduler Worker for task handling mScheduler.StartScheduler(); + PlayerTelemetry::sendEvent(TELEMETRY_EVENT_INITIALIZED); } /* InterfacePlayerRDK destructor*/ InterfacePlayerRDK::~InterfacePlayerRDK() { + PlayerTelemetry::sendEvent(TELEMETRY_EVENT_SHUTDOWN); DestroyPipeline(); if (mDrmSystem) { @@ -418,6 +422,12 @@ void InterfacePlayerRDK::ConfigurePipeline(int format, int audioFormat, int subF if (!configureStream[i] && bESChangeStatus && (eGST_MEDIATYPE_AUDIO == i)) { MW_LOG_MIL("AudioType Changed. Force configure pipeline"); + { + TelemetryPayload trackSwitchedPayload; + trackSwitchedPayload.add("trackType", "audio"); + trackSwitchedPayload.add("trackId", trackId); + PlayerTelemetry::sendEvent(TELEMETRY_EVENT_TRACK_SWITCHED, trackSwitchedPayload); + } configureStream[i] = true; } @@ -487,6 +497,13 @@ void InterfacePlayerRDK::ConfigurePipeline(int format, int audioFormat, int subF if (SetStateWithWarnings(interfacePlayerPriv->gstPrivateContext->pipeline, GST_STATE_PAUSED) == GST_STATE_CHANGE_FAILURE) { MW_LOG_ERR("InterfacePlayerRDK: GST_STATE_PAUSED failed"); + { + TelemetryPayload pauseOnStartPayload; + pauseOnStartPayload.add("fromState", "NULL"); + pauseOnStartPayload.add("toState", "PAUSED"); + pauseOnStartPayload.add("context", "ConfigurePipeline_pauseOnStart"); + PlayerTelemetry::sendEvent(TELEMETRY_EVENT_PIPELINE_STATE_CHANGE_FAILURE, pauseOnStartPayload); + } } } /* If buffering is enabled, set the pipeline in Paused state, once sufficient content has been buffered the pipeline will be set to GST_STATE_PLAYING */ @@ -500,6 +517,17 @@ void InterfacePlayerRDK::ConfigurePipeline(int format, int audioFormat, int subF if (SetStateWithWarnings(interfacePlayerPriv->gstPrivateContext->pipeline, GST_STATE_PAUSED) == GST_STATE_CHANGE_FAILURE) { MW_LOG_ERR("InterfacePlayerRDK_Configure GST_STATE_PAUSED failed"); + { + TelemetryPayload bufferingPausePayload; + bufferingPausePayload.add("fromState", "NULL"); + bufferingPausePayload.add("toState", "PAUSED"); + bufferingPausePayload.add("context", "ConfigurePipeline_buffering"); + PlayerTelemetry::sendEvent(TELEMETRY_EVENT_PIPELINE_STATE_CHANGE_FAILURE, bufferingPausePayload); + } + } + else + { + PlayerTelemetry::sendEvent(TELEMETRY_EVENT_BUFFERING_STARTED); } interfacePlayerPriv->gstPrivateContext->pendingPlayState = false; interfacePlayerPriv->gstPrivateContext->paused = false; @@ -510,6 +538,17 @@ void InterfacePlayerRDK::ConfigurePipeline(int format, int audioFormat, int subF if (SetStateWithWarnings(interfacePlayerPriv->gstPrivateContext->pipeline, GST_STATE_PLAYING) == GST_STATE_CHANGE_FAILURE) { MW_LOG_ERR("InterfacePlayerRDK: GST_STATE_PLAYING failed"); + { + TelemetryPayload playingFailPayload; + playingFailPayload.add("fromState", "PAUSED"); + playingFailPayload.add("toState", "PLAYING"); + playingFailPayload.add("context", "ConfigurePipeline"); + PlayerTelemetry::sendEvent(TELEMETRY_EVENT_PIPELINE_STATE_CHANGE_FAILURE, playingFailPayload); + } + } + else + { + PlayerTelemetry::sendEvent(TELEMETRY_EVENT_PLAYBACK_STARTED); } interfacePlayerPriv->gstPrivateContext->pendingPlayState = false; interfacePlayerPriv->gstPrivateContext->paused = false; @@ -1419,6 +1458,7 @@ void InterfacePlayerRDK::TearDownStream(int type) void InterfacePlayerRDK::Stop(bool keepLastFrame) { std::lock_guard lock(mMutex); + PlayerTelemetry::sendEvent(TELEMETRY_EVENT_PLAYBACK_STOPPED); /* make the execution of this function more deterministic and * reduce scope for potential pipeline lockups*/ @@ -1685,6 +1725,12 @@ bool InterfacePlayerRDK::Flush(double position, int rate, bool shouldTearDown, b */ ResetGstEvents(); MW_LOG_INFO("InterfacePlayerRDK: Pipeline flush seek - start = %f rate = %d", position, rate); + { + TelemetryPayload seekStartedPayload; + seekStartedPayload.add("position", position); + seekStartedPayload.add("rate", rate); + PlayerTelemetry::sendEvent(TELEMETRY_EVENT_SEEK_STARTED, seekStartedPayload); + } double playRate = 1.0; if (eGST_MEDIAFORMAT_PROGRESSIVE == static_cast(m_gstConfigParam->media)) { @@ -1707,6 +1753,13 @@ bool InterfacePlayerRDK::Flush(double position, int rate, bool shouldTearDown, b //Save the updated seek position SetSeekPosition(position); } + else + { + TelemetryPayload seekCompletedPayload; + seekCompletedPayload.add("position", position); + seekCompletedPayload.add("rate", rate); + PlayerTelemetry::sendEvent(TELEMETRY_EVENT_SEEK_COMPLETED, seekCompletedPayload); + } if ((interfacePlayerPriv->gstPrivateContext->usingRialtoSink) && (interfacePlayerPriv->gstPrivateContext->audio_sink) && @@ -2920,6 +2973,7 @@ bool InterfacePlayerRDK::StopBuffering(bool forceStop, bool &isPlaying) if (current == GST_STATE_PLAYING) { sendEndEvent = true; + PlayerTelemetry::sendEvent(TELEMETRY_EVENT_BUFFERING_ENDED); } } } @@ -3381,11 +3435,31 @@ bool InterfacePlayerRDK::Pause(bool pause , bool forceStopGstreamerPreBuffering) if (nextState != validateStateWithMsTimeout(this,nextState, 100)) { MW_LOG_ERR("InterfacePlayerRDK_Pause - validateStateWithMsTimeout - FAILED GstState %d", nextState); + { + TelemetryPayload pauseTimeoutPayload; + pauseTimeoutPayload.add("toState", pause ? "PAUSED" : "PLAYING"); + pauseTimeoutPayload.add("context", "Pause_timeout"); + PlayerTelemetry::sendEvent(TELEMETRY_EVENT_PIPELINE_STATE_CHANGE_FAILURE, pauseTimeoutPayload); + } + } + else + { + PlayerTelemetry::sendEvent(pause ? TELEMETRY_EVENT_PLAYBACK_PAUSED : TELEMETRY_EVENT_PLAYBACK_RESUMED); } } else if (GST_STATE_CHANGE_SUCCESS != rc) { MW_LOG_ERR("InterfacePlayerRDK_Pause - gst_element_set_state - FAILED rc %d", rc); + { + TelemetryPayload pauseFailPayload; + pauseFailPayload.add("toState", pause ? "PAUSED" : "PLAYING"); + pauseFailPayload.add("context", "Pause_failure"); + PlayerTelemetry::sendEvent(TELEMETRY_EVENT_PIPELINE_STATE_CHANGE_FAILURE, pauseFailPayload); + } + } + else + { + PlayerTelemetry::sendEvent(pause ? TELEMETRY_EVENT_PLAYBACK_PAUSED : TELEMETRY_EVENT_PLAYBACK_RESUMED); } interfacePlayerPriv->gstPrivateContext->buffering_target_state = nextState; @@ -4200,6 +4274,12 @@ static void GstPlayer_OnGstDecodeErrorCb(GstElement* object, guint arg0, gpointe pInterfacePlayerRDK->OnGstDecodeErrorCb(privatePlayer->gstPrivateContext->decodeErrorCBCount); privatePlayer->gstPrivateContext->decodeErrorMsgTimeMS = NOW_STEADY_TS_MS; MW_LOG_ERR("Got Decode Error message from %s total_cb=%d timeMs=%d", GST_ELEMENT_NAME(object), privatePlayer->gstPrivateContext->decodeErrorCBCount, GST_MIN_DECODE_ERROR_INTERVAL); + { + TelemetryPayload decodeErrPayload; + decodeErrPayload.add("element", GST_ELEMENT_NAME(object) ? GST_ELEMENT_NAME(object) : "unknown"); + decodeErrPayload.add("count", privatePlayer->gstPrivateContext->decodeErrorCBCount); + PlayerTelemetry::sendEvent(TELEMETRY_EVENT_DECODE_ERROR, decodeErrPayload); + } privatePlayer->gstPrivateContext->decodeErrorCBCount = 0; #ifdef USE_EXTERNAL_STATS INC_DECODE_ERROR(); // Increment the decoder error for low level AV metric @@ -4464,6 +4544,11 @@ static gboolean bus_message(GstBus * bus, GstMessage * msg, InterfacePlayerRDK * busEvent.dbg_info = "N/A"; pInterfacePlayerRDK->busMessageCallback(std::move(busEvent)); MW_LOG_MIL("GST_MESSAGE_EOS"); + { + TelemetryPayload eosPayload; + eosPayload.add("element", GST_OBJECT_NAME(msg->src) ? GST_OBJECT_NAME(msg->src) : "unknown"); + PlayerTelemetry::sendEvent(TELEMETRY_EVENT_EOS_DETECTED, eosPayload); + } pInterfacePlayerRDK->NotifyEOS(); break; @@ -5055,6 +5140,7 @@ void InterfacePlayerRDK::NotifyEOS() interfacePlayerPriv->gstPrivateContext->eosCallbackIdleTaskPending = true; // eosSignalled is reset once the async task is completed either in Configure/Flush/ResetEOSSignalled, so set the flag before scheduling the task interfacePlayerPriv->gstPrivateContext->eosSignalled = true; + PlayerTelemetry::sendEvent(TELEMETRY_EVENT_PLAYBACK_COMPLETED); interfacePlayerPriv->gstPrivateContext->eosCallbackIdleTaskId = mScheduler.ScheduleTask(PlayerAsyncTaskObj(IdleCallbackOnEOS, (void *)this, "IdleCallbackOnEOS")); if (interfacePlayerPriv->gstPrivateContext->eosCallbackIdleTaskId == PLAYER_TASK_ID_INVALID && true == interfacePlayerPriv->gstPrivateContext->eosCallbackIdleTaskPending) { diff --git a/PlayerTelemetry.h b/PlayerTelemetry.h new file mode 100644 index 00000000..b8eef291 --- /dev/null +++ b/PlayerTelemetry.h @@ -0,0 +1,183 @@ +/* + * If not stated otherwise in this file or this component's license file the + * following copyright and licenses apply: + * + * Copyright 2024 RDK Management + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#pragma once + +/** + * @file PlayerTelemetry.h + * @brief Lightweight telemetry emission utility for the middleware player interface. + * + * Provides a TelemetryPayload builder and PlayerTelemetry::sendEvent() overloads. + * TelemetryPayload::add() accepts string, integer, and floating-point values so + * call sites do not need manual std::to_string() conversions. + * + * Usage: + * @code + * TelemetryPayload payload; + * payload.add("systemId", systemId); + * payload.add("retryCount", retryCount); // int — no std::to_string needed + * PlayerTelemetry::sendEvent(TELEMETRY_EVENT_DRM_HELPER_NOT_FOUND, payload); + * @endcode + * + * When PLAYER_TELEMETRY_SUPPORT is NOT defined at compile time every call is + * compiled away to a no-op — zero overhead, no dependency on or logging + * headers in non-telemetry builds. Enable telemetry by passing + * -DPLAYER_TELEMETRY_SUPPORT (or setting CMAKE_PLAYER_TELEMETRY_SUPPORT) at + * build time. + */ + +#ifdef PLAYER_TELEMETRY_SUPPORT + +#include +#include +#include "PlayerLogManager.h" + +/** + * @class TelemetryPayload + * @brief Key/value container for telemetry event context data. + * + * Accepts string, integer, and floating-point values via the add() method, + * converting numeric types to their string representation automatically so + * that call sites do not need explicit std::to_string() calls. + */ +class TelemetryPayload +{ +public: + /** @brief Add a string field. */ + TelemetryPayload& add(const std::string& key, const std::string& value) + { + m_fields[key] = value; + return *this; + } + + /** @brief Add an integer field (converted to decimal string). */ + TelemetryPayload& add(const std::string& key, int value) + { + m_fields[key] = std::to_string(value); + return *this; + } + + /** @brief Add a long integer field (converted to decimal string). */ + TelemetryPayload& add(const std::string& key, long value) + { + m_fields[key] = std::to_string(value); + return *this; + } + + /** @brief Add a float field (converted to decimal string). */ + TelemetryPayload& add(const std::string& key, float value) + { + m_fields[key] = std::to_string(value); + return *this; + } + + /** @brief Add a double field (converted to decimal string). */ + TelemetryPayload& add(const std::string& key, double value) + { + m_fields[key] = std::to_string(value); + return *this; + } + + /** @brief Read-only access to the internal map for sendEvent(). */ + const std::map& fields() const { return m_fields; } + +private: + std::map m_fields; +}; + +/** + * @class PlayerTelemetry + * @brief Static helper for emitting named telemetry events with optional payload data. + * + * Active implementation compiled when PLAYER_TELEMETRY_SUPPORT is defined. + */ +class PlayerTelemetry +{ +public: + /** + * @brief Emit a telemetry event with no additional payload. + * @param[in] eventName One of the TELEMETRY_EVENT_* markers from TelemetryMarkers.h. + */ + static void sendEvent(const std::string& eventName) + { + MW_LOG_MIL("[TELEMETRY] event=%s", eventName.c_str()); + } + + /** + * @brief Emit a telemetry event with a structured key/value payload. + * @param[in] eventName One of the TELEMETRY_EVENT_* markers from TelemetryMarkers.h. + * @param[in] payload Additional context data built with TelemetryPayload::add(). + */ + static void sendEvent(const std::string& eventName, const TelemetryPayload& payload) + { + std::string fields; + for (const auto& kv : payload.fields()) + { + if (!fields.empty()) + { + fields += ' '; + } + fields += kv.first + '=' + kv.second; + } + MW_LOG_MIL("[TELEMETRY] event=%s %s", eventName.c_str(), fields.c_str()); + } + +private: + PlayerTelemetry() = delete; +}; + +#else /* PLAYER_TELEMETRY_SUPPORT not defined */ + +#include + +/** + * @class TelemetryPayload + * @brief No-op stub compiled when PLAYER_TELEMETRY_SUPPORT is not defined. + * + * All add() methods are empty inline functions eliminated by the compiler. + * Call sites compile without change and require no #ifdef guards. + */ +class TelemetryPayload +{ +public: + TelemetryPayload& add(const std::string& /*key*/, const std::string& /*value*/) { return *this; } + TelemetryPayload& add(const std::string& /*key*/, int /*value*/) { return *this; } + TelemetryPayload& add(const std::string& /*key*/, long /*value*/) { return *this; } + TelemetryPayload& add(const std::string& /*key*/, float /*value*/) { return *this; } + TelemetryPayload& add(const std::string& /*key*/, double /*value*/) { return *this; } +}; + +/** + * @class PlayerTelemetry + * @brief No-op stub compiled when PLAYER_TELEMETRY_SUPPORT is not defined. + * + * All methods are empty inline functions so the compiler eliminates them + * entirely. Call sites require no #ifdef guards. + */ +class PlayerTelemetry +{ +public: + static void sendEvent(const std::string& /*eventName*/) {} + static void sendEvent(const std::string& /*eventName*/, const TelemetryPayload& /*payload*/) {} + +private: + PlayerTelemetry() = delete; +}; + +#endif /* PLAYER_TELEMETRY_SUPPORT */ diff --git a/TelemetryMarkers.h b/TelemetryMarkers.h new file mode 100644 index 00000000..7f893d1a --- /dev/null +++ b/TelemetryMarkers.h @@ -0,0 +1,72 @@ +/* + * If not stated otherwise in this file or this component's license file the + * following copyright and licenses apply: + * + * Copyright 2024 RDK Management + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#pragma once + +/** + * @file TelemetryMarkers.h + * @brief Telemetry event marker definitions for the middleware player interface. + * + * Each macro defines the string key used when emitting a telemetry event via + * PlayerTelemetry::sendEvent(). Markers are grouped by category to match the + * lifecycle of a GStreamer-based playback session. + */ + +/* ── Playback events ──────────────────────────────────────────────────────── */ +#define TELEMETRY_EVENT_PLAYBACK_STARTED "PLAYBACK_STARTED" /**< Pipeline transitions to PLAYING */ +#define TELEMETRY_EVENT_PLAYBACK_PAUSED "PLAYBACK_PAUSED" /**< Pipeline transitions to PAUSED on user request */ +#define TELEMETRY_EVENT_PLAYBACK_RESUMED "PLAYBACK_RESUMED" /**< Pipeline transitions back to PLAYING from PAUSED */ +#define TELEMETRY_EVENT_PLAYBACK_STOPPED "PLAYBACK_STOPPED" /**< Stop() tears down the pipeline */ +#define TELEMETRY_EVENT_PLAYBACK_COMPLETED "PLAYBACK_COMPLETED" /**< End-of-stream reached and EOS callback scheduled */ + +/* ── Media / buffering events ─────────────────────────────────────────────── */ +#define TELEMETRY_EVENT_BUFFERING_STARTED "BUFFERING_STARTED" /**< Pre-roll buffering begins */ +#define TELEMETRY_EVENT_BUFFERING_ENDED "BUFFERING_ENDED" /**< Sufficient frames buffered; pipeline unpaused */ +#define TELEMETRY_EVENT_SEEK_STARTED "SEEK_STARTED" /**< Flush seek requested */ +#define TELEMETRY_EVENT_SEEK_COMPLETED "SEEK_COMPLETED" /**< gst_element_seek() succeeded */ + +/* ── Error events ─────────────────────────────────────────────────────────── */ +#define TELEMETRY_EVENT_ERROR "ERROR" /**< Generic GStreamer pipeline error (GST_MESSAGE_ERROR) */ +#define TELEMETRY_EVENT_DECODE_ERROR "DECODE_ERROR" /**< Decoder reported a decode-error-callback */ +#define TELEMETRY_EVENT_NETWORK_ERROR "NETWORK_ERROR" /**< Resource/stream error that indicates a network fault */ + +/* ── Pipeline state change failure ───────────────────────────────────────── */ +#define TELEMETRY_EVENT_PIPELINE_STATE_CHANGE_FAILURE "MW_PIPELINE_STATE_CHANGE_FAILURE" /**< gst_element_set_state() returned GST_STATE_CHANGE_FAILURE */ + +/* ── Lifecycle events ─────────────────────────────────────────────────────── */ +#define TELEMETRY_EVENT_INITIALIZED "INTERFACE_INITIALIZED" /**< InterfacePlayerRDK constructor completed */ +#define TELEMETRY_EVENT_SHUTDOWN "INTERFACE_SHUTDOWN" /**< InterfacePlayerRDK destructor entered */ + +/* ── Miscellaneous events ─────────────────────────────────────────────────── */ +#define TELEMETRY_EVENT_EOS_DETECTED "END_OF_STREAM_DETECTED" /**< GST_MESSAGE_EOS received on the pipeline bus */ +#define TELEMETRY_EVENT_TRACK_SWITCHED "TRACK_SWITCHED" /**< Mid-stream audio/video track change */ + +/* ── DRM / Content protection events ─────────────────────────────────────── */ +#define TELEMETRY_EVENT_DRM_HELPER_NOT_FOUND "DRM_HELPER_NOT_FOUND" /**< No DRM helper found for the content protection system */ +#define TELEMETRY_EVENT_DRM_PSSH_PARSE_FAILED "DRM_PSSH_PARSE_FAILED" /**< Failed to parse PSSH data from DRM init data */ +#define TELEMETRY_EVENT_DRM_SESSION_CREATE_FAILED "DRM_SESSION_CREATE_FAILED" /**< DRM session creation returned null / invalid params */ +#define TELEMETRY_EVENT_DRM_SESSION_INIT_FAILED "DRM_SESSION_INIT_FAILED" /**< DRM session OCDM initialisation failed */ +#define TELEMETRY_EVENT_OCDM_SYSTEM_CREATE_FAILED "OCDM_SYSTEM_CREATE_FAILED" /**< opencdm_create_system() returned null */ +#define TELEMETRY_EVENT_OCDM_SESSION_CREATE_FAILED "OCDM_SESSION_CREATE_FAILED" /**< opencdm_construct_session() returned an error */ +#define TELEMETRY_EVENT_HDCP_PROTECTION_FAILURE "HDCP_PROTECTION_FAILURE" /**< HDCP output protection failure detected */ +#define TELEMETRY_EVENT_HDCP_COMPLIANCE_FAILURE "HDCP_COMPLIANCE_FAILURE" /**< HDCP compliance check failure (2.2 vs 1.4) */ +#define TELEMETRY_EVENT_DECRYPT_FAILURE "DECRYPT_FAILURE" /**< Decryption failure threshold exceeded */ + +/* ── Handler / concurrency events ────────────────────────────────────────── */ +#define TELEMETRY_EVENT_HANDLER_TIMEOUT "HANDLER_TIMEOUT" /**< A GStreamer bus/callback handler did not complete before timeout */ diff --git a/drm/DrmSessionManager.cpp b/drm/DrmSessionManager.cpp index 8b9a197e..6773fcc5 100755 --- a/drm/DrmSessionManager.cpp +++ b/drm/DrmSessionManager.cpp @@ -30,6 +30,8 @@ #include #include "PlayerUtils.h" #include "ContentSecurityManager.h" +#include "TelemetryMarkers.h" +#include "PlayerTelemetry.h" #define DRM_METADATA_TAG_START "" #define DRM_METADATA_TAG_END "" #define SESSION_TOKEN_URL "http://localhost:50050/authService/getSessionToken" @@ -412,6 +414,11 @@ DrmSession * DrmSessionManager::createDrmSession( int& responseCode, if (!DrmHelperEngine::getInstance().hasDRM(drmInfo)) { MW_LOG_ERR(" Failed to locate DRM helper"); + { + TelemetryPayload drmHelperPayload; + drmHelperPayload.add("systemId", systemId); + PlayerTelemetry::sendEvent(TELEMETRY_EVENT_DRM_HELPER_NOT_FOUND, drmHelperPayload); + } } else { @@ -426,6 +433,12 @@ DrmSession * DrmSessionManager::createDrmSession( int& responseCode, if (!drmHelper->parsePssh(initDataPtr, initDataLen)) { MW_LOG_ERR(" Failed to Parse PSSH from the DRM InitData"); + { + TelemetryPayload psshPayload; + psshPayload.add("systemId", systemId); + psshPayload.add("initDataLen", static_cast(initDataLen)); + PlayerTelemetry::sendEvent(TELEMETRY_EVENT_DRM_PSSH_PARSE_FAILED, psshPayload); + } err = MW_CORRUPT_DRM_METADATA; } else @@ -446,6 +459,11 @@ DrmSession* DrmSessionManager::createDrmSession(int &responseCode, int &err, std /* This should never happen, since the caller should have already ensure the provided DRMInfo is supported using hasDRM */ MW_LOG_ERR(" Failed to create DRM Session invalid parameters "); + { + TelemetryPayload drmSessionPayload; + drmSessionPayload.add("reason", "invalid_parameters"); + PlayerTelemetry::sendEvent(TELEMETRY_EVENT_DRM_SESSION_CREATE_FAILED, drmSessionPayload); + } return nullptr; } @@ -928,15 +946,33 @@ KeyState DrmSessionManager::initializeDrmSession(std::shared_ptr drmH { MW_LOG_ERR("DRM session ID is empty: Key State %d ", code); err = MW_DRM_SESSIONID_EMPTY; + { + TelemetryPayload emptySessionPayload; + emptySessionPayload.add("reason", "empty_session_id"); + emptySessionPayload.add("keyState", static_cast(code)); + PlayerTelemetry::sendEvent(TELEMETRY_EVENT_DRM_SESSION_INIT_FAILED, emptySessionPayload); + } } else if (code == KEY_ERROR_SESSION_CREATE_FAILED) { MW_LOG_ERR("OCDM session construction failed: Key State %d ", code); err = MW_DRM_SESSION_CREATE_FAILED; + { + TelemetryPayload ocdmCreateFailedPayload; + ocdmCreateFailedPayload.add("reason", "ocdm_session_create_failed"); + ocdmCreateFailedPayload.add("keyState", static_cast(code)); + PlayerTelemetry::sendEvent(TELEMETRY_EVENT_DRM_SESSION_INIT_FAILED, ocdmCreateFailedPayload); + } } else { err= MW_DRM_DATA_BIND_FAILED; + { + TelemetryPayload dataBindPayload; + dataBindPayload.add("reason", "data_bind_failed"); + dataBindPayload.add("keyState", static_cast(code)); + PlayerTelemetry::sendEvent(TELEMETRY_EVENT_DRM_SESSION_INIT_FAILED, dataBindPayload); + } } } diff --git a/drm/ocdm/opencdmsessionadapter.cpp b/drm/ocdm/opencdmsessionadapter.cpp index e45ca119..d129e455 100644 --- a/drm/ocdm/opencdmsessionadapter.cpp +++ b/drm/ocdm/opencdmsessionadapter.cpp @@ -25,6 +25,8 @@ #include "DrmHelper.h" #include "PlayerUtils.h" +#include "TelemetryMarkers.h" +#include "PlayerTelemetry.h" #include "ProcessHandler.h" #include "PlayerExternalsInterface.h" @@ -96,6 +98,11 @@ void OCDMSessionAdapter::initDRMSystem() #endif if (m_pOpenCDMSystem == nullptr) { MW_LOG_ERR("opencdm_create_system() FAILED"); + { + TelemetryPayload ocdmSystemPayload; + ocdmSystemPayload.add("keySystem", m_keySystem); + PlayerTelemetry::sendEvent(TELEMETRY_EVENT_OCDM_SYSTEM_CREATE_FAILED, ocdmSystemPayload); + } } } MW_LOG_WARN("initDRMSystem :: exit "); @@ -168,6 +175,12 @@ void OCDMSessionAdapter::generateDRMSession(const uint8_t *f_pbInitData, { MW_LOG_ERR("Error constructing OCDM session. OCDM err=0x%x", ocdmRet); m_eKeyState = KEY_ERROR_SESSION_CREATE_FAILED; + { + TelemetryPayload ocdmSessionPayload; + ocdmSessionPayload.add("keySystem", m_keySystem); + ocdmSessionPayload.add("errorCode", static_cast(ocdmRet)); + PlayerTelemetry::sendEvent(TELEMETRY_EVENT_OCDM_SESSION_CREATE_FAILED, ocdmSessionPayload); + } } } } diff --git a/gst-plugins/drm/gst/gstcdmidecryptor.cpp b/gst-plugins/drm/gst/gstcdmidecryptor.cpp index 1666b529..da82d349 100755 --- a/gst-plugins/drm/gst/gstcdmidecryptor.cpp +++ b/gst-plugins/drm/gst/gstcdmidecryptor.cpp @@ -26,6 +26,8 @@ #include #include "DrmConstants.h" #include "SocInterface.h" +#include "TelemetryMarkers.h" +#include "PlayerTelemetry.h" GST_DEBUG_CATEGORY_STATIC ( gst_cdmidecryptor_debug_category); #define GST_CAT_DEFAULT gst_cdmidecryptor_debug_category @@ -650,6 +652,11 @@ static GstFlowReturn gst_cdmidecryptor_transform_ip( if(cdmidecryptor->hdcpOpProtectionFailCount >= DECRYPT_FAILURE_THRESHOLD) { GstStructure *newmsg = gst_structure_new("HDCPProtectionFailure", "message", G_TYPE_STRING,"HDCP Output Protection Error", NULL); gst_element_post_message(reinterpret_cast(cdmidecryptor),gst_message_new_application (GST_OBJECT (cdmidecryptor), newmsg)); + { + TelemetryPayload hdcpProtPayload; + hdcpProtPayload.add("failCount", cdmidecryptor->hdcpOpProtectionFailCount); + PlayerTelemetry::sendEvent(TELEMETRY_EVENT_HDCP_PROTECTION_FAILURE, hdcpProtPayload); + } } cdmidecryptor->hdcpOpProtectionFailCount = 0; } @@ -665,10 +672,21 @@ static GstFlowReturn gst_cdmidecryptor_transform_ip( { // Failure - 2.2 vs 1.4 HDCP error = g_error_new(GST_STREAM_ERROR , GST_STREAM_ERROR_FAILED, "HDCP Compliance Check Failure"); + { + TelemetryPayload hdcpCompPayload; + hdcpCompPayload.add("failCount", cdmidecryptor->decryptFailCount); + PlayerTelemetry::sendEvent(TELEMETRY_EVENT_HDCP_COMPLIANCE_FAILURE, hdcpCompPayload); + } } else { error = g_error_new(GST_STREAM_ERROR , GST_STREAM_ERROR_FAILED, "Decrypt Error: code %d", errorCode); + { + TelemetryPayload decryptFailPayload; + decryptFailPayload.add("errorCode", errorCode); + decryptFailPayload.add("failCount", cdmidecryptor->decryptFailCount); + PlayerTelemetry::sendEvent(TELEMETRY_EVENT_DECRYPT_FAILURE, decryptFailPayload); + } } gst_element_post_message(reinterpret_cast(cdmidecryptor), gst_message_new_error (GST_OBJECT (cdmidecryptor), error, "Decrypt Failed")); g_error_free(error); From 24b2f089491ab73cf961b3c8c4c6f0d24e9ead43 Mon Sep 17 00:00:00 2001 From: deepikasri Date: Thu, 4 Jun 2026 09:00:19 +0530 Subject: [PATCH 16/46] added t2_event_d commands --- PlayerTelemetry.h | 1 + 1 file changed, 1 insertion(+) diff --git a/PlayerTelemetry.h b/PlayerTelemetry.h index b8eef291..66a5b126 100644 --- a/PlayerTelemetry.h +++ b/PlayerTelemetry.h @@ -117,6 +117,7 @@ class PlayerTelemetry static void sendEvent(const std::string& eventName) { MW_LOG_MIL("[TELEMETRY] event=%s", eventName.c_str()); + T2ERROR t2Error = t2_event_d(&marker[0], 1); } /** From 1de869e9c9896c09cad82ef2aaa10233baed9801 Mon Sep 17 00:00:00 2001 From: dp0000 <53818367+dp0000@users.noreply.github.com> Date: Fri, 5 Jun 2026 11:45:32 +0530 Subject: [PATCH 17/46] Update PlayerTelemetry.h --- PlayerTelemetry.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/PlayerTelemetry.h b/PlayerTelemetry.h index 66a5b126..d5a6cea6 100644 --- a/PlayerTelemetry.h +++ b/PlayerTelemetry.h @@ -117,7 +117,7 @@ class PlayerTelemetry static void sendEvent(const std::string& eventName) { MW_LOG_MIL("[TELEMETRY] event=%s", eventName.c_str()); - T2ERROR t2Error = t2_event_d(&marker[0], 1); + t2_event_d(&marker[0], 1); } /** From 4769534ac018cbbe97356e930963c13372c3b464 Mon Sep 17 00:00:00 2001 From: dp0000 <53818367+dp0000@users.noreply.github.com> Date: Fri, 5 Jun 2026 12:40:10 +0530 Subject: [PATCH 18/46] Update PlayerTelemetry.h --- PlayerTelemetry.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/PlayerTelemetry.h b/PlayerTelemetry.h index d5a6cea6..90318e4b 100644 --- a/PlayerTelemetry.h +++ b/PlayerTelemetry.h @@ -116,8 +116,8 @@ class PlayerTelemetry */ static void sendEvent(const std::string& eventName) { - MW_LOG_MIL("[TELEMETRY] event=%s", eventName.c_str()); - t2_event_d(&marker[0], 1); + MW_LOG_MIL("[TELEMETRY] event=%s", eventName.c_str()); + t2_event_d(eventName.c_str(), 1); } /** From 627c301c594d28cf3feaf907aab19d5d3fdbcd8e Mon Sep 17 00:00:00 2001 From: deepikasri Date: Fri, 5 Jun 2026 13:01:06 +0530 Subject: [PATCH 19/46] added compilation issue fix --- PlayerTelemetry.h | 6 +----- PlayerTelemetry2.cpp | 5 +++++ 2 files changed, 6 insertions(+), 5 deletions(-) diff --git a/PlayerTelemetry.h b/PlayerTelemetry.h index 90318e4b..25298c5c 100644 --- a/PlayerTelemetry.h +++ b/PlayerTelemetry.h @@ -114,11 +114,7 @@ class PlayerTelemetry * @brief Emit a telemetry event with no additional payload. * @param[in] eventName One of the TELEMETRY_EVENT_* markers from TelemetryMarkers.h. */ - static void sendEvent(const std::string& eventName) - { - MW_LOG_MIL("[TELEMETRY] event=%s", eventName.c_str()); - t2_event_d(eventName.c_str(), 1); - } + static void sendEvent(const std::string& eventName); /** * @brief Emit a telemetry event with a structured key/value payload. diff --git a/PlayerTelemetry2.cpp b/PlayerTelemetry2.cpp index ac147c23..dc361e3f 100644 --- a/PlayerTelemetry2.cpp +++ b/PlayerTelemetry2.cpp @@ -136,3 +136,8 @@ bool PlayerTelemetry2::send( const std::string &markerName, const char * data) } return bRet; } +void PlayerTelemetry::sendEvent(const std::string& eventName) +{ + MW_LOG_MIL("[TELEMETRY] event=%s", eventName.c_str()); + t2_event_d(const_cast(eventName.c_str()), 1); +} From de2bf29d522bb14b4def6a3d9fc24a62bb229d1b Mon Sep 17 00:00:00 2001 From: deepikasri Date: Fri, 5 Jun 2026 13:12:31 +0530 Subject: [PATCH 20/46] added com fix --- PlayerTelemetry2.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/PlayerTelemetry2.cpp b/PlayerTelemetry2.cpp index dc361e3f..ef9839ac 100644 --- a/PlayerTelemetry2.cpp +++ b/PlayerTelemetry2.cpp @@ -136,7 +136,7 @@ bool PlayerTelemetry2::send( const std::string &markerName, const char * data) } return bRet; } -void PlayerTelemetry::sendEvent(const std::string& eventName) +void PlayerTelemetry2::sendEvent(const std::string& eventName) { MW_LOG_MIL("[TELEMETRY] event=%s", eventName.c_str()); t2_event_d(const_cast(eventName.c_str()), 1); From b3b6a2f8e7d4476de0f0c5cc01b97cb60a7614fd Mon Sep 17 00:00:00 2001 From: deepikasri Date: Fri, 5 Jun 2026 14:49:10 +0530 Subject: [PATCH 21/46] added com fix --- PlayerTelemetry.h | 8 +++++++- PlayerTelemetry2.cpp | 5 ----- 2 files changed, 7 insertions(+), 6 deletions(-) diff --git a/PlayerTelemetry.h b/PlayerTelemetry.h index 25298c5c..5d189a2a 100644 --- a/PlayerTelemetry.h +++ b/PlayerTelemetry.h @@ -48,6 +48,7 @@ #include #include "PlayerLogManager.h" +#include /** * @class TelemetryPayload * @brief Key/value container for telemetry event context data. @@ -114,7 +115,12 @@ class PlayerTelemetry * @brief Emit a telemetry event with no additional payload. * @param[in] eventName One of the TELEMETRY_EVENT_* markers from TelemetryMarkers.h. */ - static void sendEvent(const std::string& eventName); + static void sendEvent(const std::string& eventName) + { + MW_LOG_MIL("[TELEMETRY] event=%s", eventName.c_str()); + t2_event_d(const_cast(eventName.c_str()), 1); + + } /** * @brief Emit a telemetry event with a structured key/value payload. diff --git a/PlayerTelemetry2.cpp b/PlayerTelemetry2.cpp index ef9839ac..ac147c23 100644 --- a/PlayerTelemetry2.cpp +++ b/PlayerTelemetry2.cpp @@ -136,8 +136,3 @@ bool PlayerTelemetry2::send( const std::string &markerName, const char * data) } return bRet; } -void PlayerTelemetry2::sendEvent(const std::string& eventName) -{ - MW_LOG_MIL("[TELEMETRY] event=%s", eventName.c_str()); - t2_event_d(const_cast(eventName.c_str()), 1); -} From 80f07bb6d6f2aea71bb497d500ee279723506210 Mon Sep 17 00:00:00 2001 From: deepikasri Date: Fri, 5 Jun 2026 17:03:05 +0530 Subject: [PATCH 22/46] com issue fixed --- InterfacePlayerRDK.cpp | 8 ++++++++ PlayerTelemetry2.cpp | 6 ++++++ PlayerTelemetry2.hpp | 2 ++ 3 files changed, 16 insertions(+) diff --git a/InterfacePlayerRDK.cpp b/InterfacePlayerRDK.cpp index a279564b..d9547c68 100644 --- a/InterfacePlayerRDK.cpp +++ b/InterfacePlayerRDK.cpp @@ -106,6 +106,10 @@ trickTeardown(false), mFirstFrameRequired(false), mResumeInjector(false), Pipeli pthread_mutex_init(&interfacePlayerPriv->gstPrivateContext->stream[i].sourceLock, NULL); // start Scheduler Worker for task handling mScheduler.StartScheduler(); +#ifdef PLAYER_TELEMETRY_SUPPORT + PlayerTelemetry2 telemetry; + telemetry.sendEvent(TELEMETRY_EVENT_INITIALIZED); +#endif PlayerTelemetry::sendEvent(TELEMETRY_EVENT_INITIALIZED); } @@ -572,6 +576,10 @@ void InterfacePlayerRDK::ConfigurePipeline(int format, int audioFormat, int subF } else { +#ifdef PLAYER_TELEMETRY_SUPPORT + PlayerTelemetry2 Telemetry; + Telemetry.SendEvent(ELEMETRY_EVENT_PLAYBACK_STARTED); +#endif PlayerTelemetry::sendEvent(TELEMETRY_EVENT_PLAYBACK_STARTED); } interfacePlayerPriv->gstPrivateContext->pendingPlayState = false; diff --git a/PlayerTelemetry2.cpp b/PlayerTelemetry2.cpp index ac147c23..105e74c8 100644 --- a/PlayerTelemetry2.cpp +++ b/PlayerTelemetry2.cpp @@ -136,3 +136,9 @@ bool PlayerTelemetry2::send( const std::string &markerName, const char * data) } return bRet; } +void PlayerTelemetry2::sendEvent(const std::string& eventName) +{ + bool init = mInitializer.isInitialized(); + MW_LOG_MIL("[TELEMETRY] event=%s", eventName.c_str()); + t2_event_d(const_cast(eventName.c_str()), 1); +} diff --git a/PlayerTelemetry2.hpp b/PlayerTelemetry2.hpp index ea5833ee..37df3424 100644 --- a/PlayerTelemetry2.hpp +++ b/PlayerTelemetry2.hpp @@ -62,6 +62,8 @@ class PlayerTelemetry2 { * @param[in] data - Data to be sent */ bool send(const std::string &markerName, const char * data); + + void sendEvent(const std::string& eventName); }; #endif // __PLAYER_TELEMETRY_2_H__ From 02546031f90c723fe6bbefd5c73eff961627a09a Mon Sep 17 00:00:00 2001 From: deepikasri Date: Fri, 5 Jun 2026 17:21:42 +0530 Subject: [PATCH 23/46] speeling check --- InterfacePlayerRDK.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/InterfacePlayerRDK.cpp b/InterfacePlayerRDK.cpp index d9547c68..cd729c03 100644 --- a/InterfacePlayerRDK.cpp +++ b/InterfacePlayerRDK.cpp @@ -578,7 +578,7 @@ void InterfacePlayerRDK::ConfigurePipeline(int format, int audioFormat, int subF { #ifdef PLAYER_TELEMETRY_SUPPORT PlayerTelemetry2 Telemetry; - Telemetry.SendEvent(ELEMETRY_EVENT_PLAYBACK_STARTED); + Telemetry.sendEvent(ELEMETRY_EVENT_PLAYBACK_STARTED); #endif PlayerTelemetry::sendEvent(TELEMETRY_EVENT_PLAYBACK_STARTED); } From 0f1e3640e1734bb1e6bfe8aa2849f5b714932424 Mon Sep 17 00:00:00 2001 From: deepikasri Date: Fri, 5 Jun 2026 18:54:02 +0530 Subject: [PATCH 24/46] spell check --- InterfacePlayerRDK.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/InterfacePlayerRDK.cpp b/InterfacePlayerRDK.cpp index cd729c03..51258eda 100644 --- a/InterfacePlayerRDK.cpp +++ b/InterfacePlayerRDK.cpp @@ -578,7 +578,7 @@ void InterfacePlayerRDK::ConfigurePipeline(int format, int audioFormat, int subF { #ifdef PLAYER_TELEMETRY_SUPPORT PlayerTelemetry2 Telemetry; - Telemetry.sendEvent(ELEMETRY_EVENT_PLAYBACK_STARTED); + Telemetry.sendEvent(TELEMETRY_EVENT_PLAYBACK_STARTED); #endif PlayerTelemetry::sendEvent(TELEMETRY_EVENT_PLAYBACK_STARTED); } From 4db99b2a1ef301639388d268fe356200bb9a760c Mon Sep 17 00:00:00 2001 From: Deepikasri N Date: Thu, 2 Jul 2026 16:05:19 +0530 Subject: [PATCH 25/46] resolving compilation failures --- InterfacePlayerRDK.cpp | 12 ------------ 1 file changed, 12 deletions(-) diff --git a/InterfacePlayerRDK.cpp b/InterfacePlayerRDK.cpp index 4b9c4e0c..19b9b53b 100644 --- a/InterfacePlayerRDK.cpp +++ b/InterfacePlayerRDK.cpp @@ -600,18 +600,6 @@ void InterfacePlayerRDK::ConfigurePipeline(int format, int audioFormat, int subF Telemetry.sendEvent(TELEMETRY_EVENT_PLAYBACK_STARTED); #endif PlayerTelemetry::sendEvent(TELEMETRY_EVENT_PLAYBACK_STARTED); - MW_LOG_WARN("seekPausedState active - deferring transition to PLAYING, marking pendingPlayState"); - interfacePlayerPriv->gstPrivateContext->buffering_target_state = GST_STATE_PLAYING; - interfacePlayerPriv->gstPrivateContext->pendingPlayState = true; - /* Ensure pipeline is left/returned to PAUSED to avoid accidental play */ - if (SetStateWithWarnings(interfacePlayerPriv->gstPrivateContext->pipeline, GST_STATE_PAUSED) == GST_STATE_CHANGE_FAILURE) - { - MW_LOG_ERR("InterfacePlayerRDK: GST_STATE_PAUSED failed while deferring PLAYING"); - } - interfacePlayerPriv->gstPrivateContext->paused = true; - } - else - { if (SetStateWithWarnings(interfacePlayerPriv->gstPrivateContext->pipeline, GST_STATE_PLAYING) == GST_STATE_CHANGE_FAILURE) { MW_LOG_ERR("InterfacePlayerRDK: GST_STATE_PLAYING failed"); From a210add8c16c352820de8a5197823c5958138326 Mon Sep 17 00:00:00 2001 From: dp0000 <53818367+dp0000@users.noreply.github.com> Date: Fri, 3 Jul 2026 16:51:11 +0530 Subject: [PATCH 26/46] Update PlayerTelemetry.h --- PlayerTelemetry.h | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/PlayerTelemetry.h b/PlayerTelemetry.h index 5d189a2a..270fc814 100644 --- a/PlayerTelemetry.h +++ b/PlayerTelemetry.h @@ -139,7 +139,16 @@ class PlayerTelemetry fields += kv.first + '=' + kv.second; } MW_LOG_MIL("[TELEMETRY] event=%s %s", eventName.c_str(), fields.c_str()); - } + + // Fallback so value is never empty (optional but useful) + if (fields.empty()) + { + fields = "empty_payload=true"; + } + + t2_event_s(const_cast(eventName.c_str()), + const_cast(fields.c_str())); +} private: PlayerTelemetry() = delete; From 2a06647c55ef3a52e2e9aa4967d6010c3a4b0840 Mon Sep 17 00:00:00 2001 From: dp0000 <53818367+dp0000@users.noreply.github.com> Date: Fri, 3 Jul 2026 16:56:46 +0530 Subject: [PATCH 27/46] Update InterfacePlayerRDK.cpp --- InterfacePlayerRDK.cpp | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/InterfacePlayerRDK.cpp b/InterfacePlayerRDK.cpp index 19b9b53b..57e96d8f 100644 --- a/InterfacePlayerRDK.cpp +++ b/InterfacePlayerRDK.cpp @@ -110,7 +110,13 @@ trickTeardown(false), mFirstFrameRequired(false), mResumeInjector(false), Pipeli PlayerTelemetry2 telemetry; telemetry.sendEvent(TELEMETRY_EVENT_INITIALIZED); #endif - PlayerTelemetry::sendEvent(TELEMETRY_EVENT_INITIALIZED); + //PlayerTelemetry::sendEvent(TELEMETRY_EVENT_INITIALIZED); + + TelemetryPayload initPayload; + initPayload.add("component", "InterfacePlayerRDK"); + initPayload.add("action", "constructor"); + initPayload.add("isRialto", isRialto ? 1 : 0); + PlayerTelemetry::sendEvent(TELEMETRY_EVENT_INITIALIZED, initPayload); } /* InterfacePlayerRDK destructor*/ From 51e41399c764d43c7b1918446c644be4882a9925 Mon Sep 17 00:00:00 2001 From: deepikasri Date: Wed, 15 Jul 2026 01:53:57 -0400 Subject: [PATCH 28/46] removed entry markers --- TelemetryMarkers.h | 18 ------------------ 1 file changed, 18 deletions(-) diff --git a/TelemetryMarkers.h b/TelemetryMarkers.h index 7f893d1a..8abb020f 100644 --- a/TelemetryMarkers.h +++ b/TelemetryMarkers.h @@ -28,18 +28,9 @@ * lifecycle of a GStreamer-based playback session. */ -/* ── Playback events ──────────────────────────────────────────────────────── */ -#define TELEMETRY_EVENT_PLAYBACK_STARTED "PLAYBACK_STARTED" /**< Pipeline transitions to PLAYING */ -#define TELEMETRY_EVENT_PLAYBACK_PAUSED "PLAYBACK_PAUSED" /**< Pipeline transitions to PAUSED on user request */ -#define TELEMETRY_EVENT_PLAYBACK_RESUMED "PLAYBACK_RESUMED" /**< Pipeline transitions back to PLAYING from PAUSED */ -#define TELEMETRY_EVENT_PLAYBACK_STOPPED "PLAYBACK_STOPPED" /**< Stop() tears down the pipeline */ -#define TELEMETRY_EVENT_PLAYBACK_COMPLETED "PLAYBACK_COMPLETED" /**< End-of-stream reached and EOS callback scheduled */ - /* ── Media / buffering events ─────────────────────────────────────────────── */ #define TELEMETRY_EVENT_BUFFERING_STARTED "BUFFERING_STARTED" /**< Pre-roll buffering begins */ #define TELEMETRY_EVENT_BUFFERING_ENDED "BUFFERING_ENDED" /**< Sufficient frames buffered; pipeline unpaused */ -#define TELEMETRY_EVENT_SEEK_STARTED "SEEK_STARTED" /**< Flush seek requested */ -#define TELEMETRY_EVENT_SEEK_COMPLETED "SEEK_COMPLETED" /**< gst_element_seek() succeeded */ /* ── Error events ─────────────────────────────────────────────────────────── */ #define TELEMETRY_EVENT_ERROR "ERROR" /**< Generic GStreamer pipeline error (GST_MESSAGE_ERROR) */ @@ -49,13 +40,6 @@ /* ── Pipeline state change failure ───────────────────────────────────────── */ #define TELEMETRY_EVENT_PIPELINE_STATE_CHANGE_FAILURE "MW_PIPELINE_STATE_CHANGE_FAILURE" /**< gst_element_set_state() returned GST_STATE_CHANGE_FAILURE */ -/* ── Lifecycle events ─────────────────────────────────────────────────────── */ -#define TELEMETRY_EVENT_INITIALIZED "INTERFACE_INITIALIZED" /**< InterfacePlayerRDK constructor completed */ -#define TELEMETRY_EVENT_SHUTDOWN "INTERFACE_SHUTDOWN" /**< InterfacePlayerRDK destructor entered */ - -/* ── Miscellaneous events ─────────────────────────────────────────────────── */ -#define TELEMETRY_EVENT_EOS_DETECTED "END_OF_STREAM_DETECTED" /**< GST_MESSAGE_EOS received on the pipeline bus */ -#define TELEMETRY_EVENT_TRACK_SWITCHED "TRACK_SWITCHED" /**< Mid-stream audio/video track change */ /* ── DRM / Content protection events ─────────────────────────────────────── */ #define TELEMETRY_EVENT_DRM_HELPER_NOT_FOUND "DRM_HELPER_NOT_FOUND" /**< No DRM helper found for the content protection system */ @@ -68,5 +52,3 @@ #define TELEMETRY_EVENT_HDCP_COMPLIANCE_FAILURE "HDCP_COMPLIANCE_FAILURE" /**< HDCP compliance check failure (2.2 vs 1.4) */ #define TELEMETRY_EVENT_DECRYPT_FAILURE "DECRYPT_FAILURE" /**< Decryption failure threshold exceeded */ -/* ── Handler / concurrency events ────────────────────────────────────────── */ -#define TELEMETRY_EVENT_HANDLER_TIMEOUT "HANDLER_TIMEOUT" /**< A GStreamer bus/callback handler did not complete before timeout */ From df904f537fb83cbed827f36950565e3dc432eaeb Mon Sep 17 00:00:00 2001 From: deepikasri Date: Wed, 15 Jul 2026 05:18:03 -0400 Subject: [PATCH 29/46] telemetry marker verification --- GstHandlerControl.cpp | 6 ------ InterfacePlayerRDK.cpp | 1 - 2 files changed, 7 deletions(-) diff --git a/GstHandlerControl.cpp b/GstHandlerControl.cpp index ee8966c1..31a105f4 100644 --- a/GstHandlerControl.cpp +++ b/GstHandlerControl.cpp @@ -84,12 +84,6 @@ bool GstHandlerControl::waitForDone(int MaximumDelayMilliseconds, std::string na { MW_LOG_ERR("GstPlayer: %d instance%s of %s running", mInstanceCount, mInstanceCount?"s":"", name.c_str()); - { - TelemetryPayload handlerPayload; - handlerPayload.add("handler", name); - handlerPayload.add("count", mInstanceCount); - PlayerTelemetry::sendEvent(TELEMETRY_EVENT_HANDLER_TIMEOUT, handlerPayload); - } return false; } else diff --git a/InterfacePlayerRDK.cpp b/InterfacePlayerRDK.cpp index 57e96d8f..63e1a24e 100644 --- a/InterfacePlayerRDK.cpp +++ b/InterfacePlayerRDK.cpp @@ -110,7 +110,6 @@ trickTeardown(false), mFirstFrameRequired(false), mResumeInjector(false), Pipeli PlayerTelemetry2 telemetry; telemetry.sendEvent(TELEMETRY_EVENT_INITIALIZED); #endif - //PlayerTelemetry::sendEvent(TELEMETRY_EVENT_INITIALIZED); TelemetryPayload initPayload; initPayload.add("component", "InterfacePlayerRDK"); From 3b02f23fecd6d6f7347957d0615fdb714dad4e69 Mon Sep 17 00:00:00 2001 From: dp0000 <53818367+dp0000@users.noreply.github.com> Date: Wed, 15 Jul 2026 18:26:03 +0530 Subject: [PATCH 30/46] Update TelemetryMarkers.h --- TelemetryMarkers.h | 30 ++++++++++++++++++++++++++++++ 1 file changed, 30 insertions(+) diff --git a/TelemetryMarkers.h b/TelemetryMarkers.h index 8abb020f..5507618b 100644 --- a/TelemetryMarkers.h +++ b/TelemetryMarkers.h @@ -28,6 +28,36 @@ * lifecycle of a GStreamer-based playback session. */ + +/* ── Playback events ──────────────────────────────────────────────────────── */ +#define TELEMETRY_EVENT_PLAYBACK_STARTED "PLAYBACK_STARTED" /**< Pipeline transitions to PLAYING */ +#define TELEMETRY_EVENT_PLAYBACK_PAUSED "PLAYBACK_PAUSED" /**< Pipeline transitions to PAUSED on user request */ +#define TELEMETRY_EVENT_PLAYBACK_RESUMED "PLAYBACK_RESUMED" /**< Pipeline transitions back to PLAYING from PAUSED */ +#define TELEMETRY_EVENT_PLAYBACK_STOPPED "PLAYBACK_STOPPED" /**< Stop() tears down the pipeline */ +#define TELEMETRY_EVENT_PLAYBACK_COMPLETED "PLAYBACK_COMPLETED" /**< End-of-stream reached and EOS callback scheduled */ + +/* ── Media / buffering events ─────────────────────────────────────────────── */ +#define TELEMETRY_EVENT_BUFFERING_STARTED "BUFFERING_STARTED" /**< Pre-roll buffering begins */ +#define TELEMETRY_EVENT_BUFFERING_ENDED "BUFFERING_ENDED" /**< Sufficient frames buffered; pipeline unpaused */ +#define TELEMETRY_EVENT_SEEK_STARTED "SEEK_STARTED" /**< Flush seek requested */ +#define TELEMETRY_EVENT_SEEK_COMPLETED "SEEK_COMPLETED" /**< gst_element_seek() succeeded */ + +/* ── Error events ─────────────────────────────────────────────────────────── */ +#define TELEMETRY_EVENT_ERROR "ERROR" /**< Generic GStreamer pipeline error (GST_MESSAGE_ERROR) */ +#define TELEMETRY_EVENT_DECODE_ERROR "DECODE_ERROR" /**< Decoder reported a decode-error-callback */ +#define TELEMETRY_EVENT_NETWORK_ERROR "NETWORK_ERROR" /**< Resource/stream error that indicates a network fault */ + +/* ── Pipeline state change failure ───────────────────────────────────────── */ +#define TELEMETRY_EVENT_PIPELINE_STATE_CHANGE_FAILURE "MW_PIPELINE_STATE_CHANGE_FAILURE" /**< gst_element_set_state() returned GST_STATE_CHANGE_FAILURE */ + +/* ── Lifecycle events ─────────────────────────────────────────────────────── */ +#define TELEMETRY_EVENT_INITIALIZED "INTERFACE_INITIALIZED" /**< InterfacePlayerRDK constructor completed */ +#define TELEMETRY_EVENT_SHUTDOWN "INTERFACE_SHUTDOWN" /**< InterfacePlayerRDK destructor entered */ + +/* ── Miscellaneous events ─────────────────────────────────────────────────── */ +#define TELEMETRY_EVENT_EOS_DETECTED "END_OF_STREAM_DETECTED" /**< GST_MESSAGE_EOS received on the pipeline bus */ +#define TELEMETRY_EVENT_TRACK_SWITCHED "TRACK_SWITCHED" /**< Mid-stream audio/video track change */ + /* ── Media / buffering events ─────────────────────────────────────────────── */ #define TELEMETRY_EVENT_BUFFERING_STARTED "BUFFERING_STARTED" /**< Pre-roll buffering begins */ #define TELEMETRY_EVENT_BUFFERING_ENDED "BUFFERING_ENDED" /**< Sufficient frames buffered; pipeline unpaused */ From c807cf218d3d8e463fe37213e56ed24756f44964 Mon Sep 17 00:00:00 2001 From: deepikasri Date: Thu, 16 Jul 2026 02:51:09 -0400 Subject: [PATCH 31/46] added initial prints --- InterfacePlayerRDK.cpp | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/InterfacePlayerRDK.cpp b/InterfacePlayerRDK.cpp index 63e1a24e..5e1929bc 100644 --- a/InterfacePlayerRDK.cpp +++ b/InterfacePlayerRDK.cpp @@ -116,6 +116,18 @@ trickTeardown(false), mFirstFrameRequired(false), mResumeInjector(false), Pipeli initPayload.add("action", "constructor"); initPayload.add("isRialto", isRialto ? 1 : 0); PlayerTelemetry::sendEvent(TELEMETRY_EVENT_INITIALIZED, initPayload); +#ifdef PLAYER_TELEMETRY_SUPPORT + std::map intMetrics; + std::map stringMetrics; + std::map floatMetrics; + + intMetrics["isRialto"] = isRialto ? 1 : 0; + stringMetrics["component"] = "InterfacePlayerRDK"; + stringMetrics["action"] = "constructor"; + + PlayerTelemetry2 telemetry; + telemetry.send(TELEMETRY_EVENT_INITIALIZED, intMetrics, stringMetrics, floatMetrics); +#endif } /* InterfacePlayerRDK destructor*/ From daf6ce8f7957d583756ab6b7f55639c390c02bdd Mon Sep 17 00:00:00 2001 From: dp0000 <53818367+dp0000@users.noreply.github.com> Date: Thu, 16 Jul 2026 13:44:19 +0530 Subject: [PATCH 32/46] Update InterfacePlayerRDK.cpp --- InterfacePlayerRDK.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/InterfacePlayerRDK.cpp b/InterfacePlayerRDK.cpp index 5e1929bc..d847c9c4 100644 --- a/InterfacePlayerRDK.cpp +++ b/InterfacePlayerRDK.cpp @@ -125,7 +125,7 @@ trickTeardown(false), mFirstFrameRequired(false), mResumeInjector(false), Pipeli stringMetrics["component"] = "InterfacePlayerRDK"; stringMetrics["action"] = "constructor"; - PlayerTelemetry2 telemetry; + telemetry.send(TELEMETRY_EVENT_INITIALIZED, intMetrics, stringMetrics, floatMetrics); #endif } From 5373b66034a167dd7a732fe822c0832f75b7763c Mon Sep 17 00:00:00 2001 From: dp0000 <53818367+dp0000@users.noreply.github.com> Date: Mon, 20 Jul 2026 14:24:06 +0530 Subject: [PATCH 33/46] Update opencdmsessionadapter.cpp --- drm/ocdm/opencdmsessionadapter.cpp | 14 +------------- 1 file changed, 1 insertion(+), 13 deletions(-) diff --git a/drm/ocdm/opencdmsessionadapter.cpp b/drm/ocdm/opencdmsessionadapter.cpp index d129e455..fb22501b 100644 --- a/drm/ocdm/opencdmsessionadapter.cpp +++ b/drm/ocdm/opencdmsessionadapter.cpp @@ -25,8 +25,7 @@ #include "DrmHelper.h" #include "PlayerUtils.h" -#include "TelemetryMarkers.h" -#include "PlayerTelemetry.h" + #include "ProcessHandler.h" #include "PlayerExternalsInterface.h" @@ -98,11 +97,6 @@ void OCDMSessionAdapter::initDRMSystem() #endif if (m_pOpenCDMSystem == nullptr) { MW_LOG_ERR("opencdm_create_system() FAILED"); - { - TelemetryPayload ocdmSystemPayload; - ocdmSystemPayload.add("keySystem", m_keySystem); - PlayerTelemetry::sendEvent(TELEMETRY_EVENT_OCDM_SYSTEM_CREATE_FAILED, ocdmSystemPayload); - } } } MW_LOG_WARN("initDRMSystem :: exit "); @@ -175,12 +169,6 @@ void OCDMSessionAdapter::generateDRMSession(const uint8_t *f_pbInitData, { MW_LOG_ERR("Error constructing OCDM session. OCDM err=0x%x", ocdmRet); m_eKeyState = KEY_ERROR_SESSION_CREATE_FAILED; - { - TelemetryPayload ocdmSessionPayload; - ocdmSessionPayload.add("keySystem", m_keySystem); - ocdmSessionPayload.add("errorCode", static_cast(ocdmRet)); - PlayerTelemetry::sendEvent(TELEMETRY_EVENT_OCDM_SESSION_CREATE_FAILED, ocdmSessionPayload); - } } } } From 0a1d1464ed63388eba1f0f7248cd8a438523c7ad Mon Sep 17 00:00:00 2001 From: dp0000 <53818367+dp0000@users.noreply.github.com> Date: Mon, 20 Jul 2026 14:24:32 +0530 Subject: [PATCH 34/46] Update opencdmsessionadapter.cpp --- drm/ocdm/opencdmsessionadapter.cpp | 1 - 1 file changed, 1 deletion(-) diff --git a/drm/ocdm/opencdmsessionadapter.cpp b/drm/ocdm/opencdmsessionadapter.cpp index fb22501b..e45ca119 100644 --- a/drm/ocdm/opencdmsessionadapter.cpp +++ b/drm/ocdm/opencdmsessionadapter.cpp @@ -26,7 +26,6 @@ #include "DrmHelper.h" #include "PlayerUtils.h" - #include "ProcessHandler.h" #include "PlayerExternalsInterface.h" #include From 35ccd298f05891a25797e094b9cba03b9724a3ba Mon Sep 17 00:00:00 2001 From: dp0000 <53818367+dp0000@users.noreply.github.com> Date: Mon, 20 Jul 2026 14:26:06 +0530 Subject: [PATCH 35/46] Potential fix for pull request finding Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com> --- GstHandlerControl.cpp | 2 -- 1 file changed, 2 deletions(-) diff --git a/GstHandlerControl.cpp b/GstHandlerControl.cpp index 31a105f4..f5ae2192 100644 --- a/GstHandlerControl.cpp +++ b/GstHandlerControl.cpp @@ -19,8 +19,6 @@ #include "GstHandlerControl.h" #include "PlayerLogManager.h" -#include "TelemetryMarkers.h" -#include "PlayerTelemetry.h" #include #include From e55bf1aa45b08d1e3b8ea989a4d07aa96d12fbd8 Mon Sep 17 00:00:00 2001 From: dp0000 <53818367+dp0000@users.noreply.github.com> Date: Mon, 20 Jul 2026 14:27:29 +0530 Subject: [PATCH 36/46] Potential fix for pull request finding Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com> --- InterfacePlayerRDK.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/InterfacePlayerRDK.cpp b/InterfacePlayerRDK.cpp index d847c9c4..38aa88c6 100644 --- a/InterfacePlayerRDK.cpp +++ b/InterfacePlayerRDK.cpp @@ -393,9 +393,9 @@ void InterfacePlayerRDK::ConfigurePipeline(int format, int audioFormat, int subF { #ifdef PLAYER_TELEMETRY_SUPPORT /** verifying telemetry support*/ - MW_LOG_MIL("PLAYER_TELEMETRY_SUPPORT is enabled at runtime"); + MW_LOG_MIL("PLAYER_TELEMETRY_SUPPORT is enabled at compile time"); #else - MW_LOG_MIL("PLAYER_TELEMETRY_SUPPORT is NOT enabled at runtime"); + MW_LOG_MIL("PLAYER_TELEMETRY_SUPPORT is NOT enabled at compile time"); #endif MW_LOG_MIL("Nitz : Create pipeline %s (pipeline %p bus %p)", pipelineName, interfacePlayerPriv->gstPrivateContext->pipeline, interfacePlayerPriv->gstPrivateContext->bus); CreatePipeline(pipelineName, PipelinePriority); /*Create a new pipeline if pipeline or the message bus does not exist*/ From ba6fe0a99a602ae7f6eb3cf0e5411b002a502f93 Mon Sep 17 00:00:00 2001 From: dp0000 <53818367+dp0000@users.noreply.github.com> Date: Mon, 20 Jul 2026 14:28:10 +0530 Subject: [PATCH 37/46] Potential fix for pull request finding Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com> --- PlayerTelemetry.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/PlayerTelemetry.h b/PlayerTelemetry.h index 270fc814..c457b0ec 100644 --- a/PlayerTelemetry.h +++ b/PlayerTelemetry.h @@ -37,8 +37,8 @@ * * When PLAYER_TELEMETRY_SUPPORT is NOT defined at compile time every call is * compiled away to a no-op — zero overhead, no dependency on or logging - * headers in non-telemetry builds. Enable telemetry by passing - * -DPLAYER_TELEMETRY_SUPPORT (or setting CMAKE_PLAYER_TELEMETRY_SUPPORT) at + * headers in non-telemetry builds. Enable telemetry by passing + * -DPLAYER_TELEMETRY_SUPPORT (or setting CMAKE_TELEMETRY_2_0_REQUIRED) at * build time. */ From 881c70a3d36775e90c8642c96a7ce83e8f6b513b Mon Sep 17 00:00:00 2001 From: dp0000 <53818367+dp0000@users.noreply.github.com> Date: Mon, 20 Jul 2026 14:30:01 +0530 Subject: [PATCH 38/46] Update InterfacePlayerRDK.cpp Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> --- InterfacePlayerRDK.cpp | 8 +------- 1 file changed, 1 insertion(+), 7 deletions(-) diff --git a/InterfacePlayerRDK.cpp b/InterfacePlayerRDK.cpp index 38aa88c6..094d38e5 100644 --- a/InterfacePlayerRDK.cpp +++ b/InterfacePlayerRDK.cpp @@ -3499,13 +3499,7 @@ void InterfacePlayerRDK::QueueProtectionEvent(const std::string& formatType, con } else { -#if 0 - PlayerTelemetry2::send("MW_PROTECTION_EVENT_FAILED", - formatType, - protSystemId ? protSystemId : "", - mediaType, - initDataSize); -#endif + // No protection event is queued when initData is invalid or empty. } } From 4e25993422b51416f3869e38194422876d46583b Mon Sep 17 00:00:00 2001 From: dp0000 <53818367+dp0000@users.noreply.github.com> Date: Mon, 20 Jul 2026 14:35:15 +0530 Subject: [PATCH 39/46] Potential fix for pull request finding Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com> --- PlayerTelemetry2.hpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/PlayerTelemetry2.hpp b/PlayerTelemetry2.hpp index 37df3424..746df7af 100644 --- a/PlayerTelemetry2.hpp +++ b/PlayerTelemetry2.hpp @@ -66,4 +66,4 @@ class PlayerTelemetry2 { void sendEvent(const std::string& eventName); }; -#endif // __PLAYER_TELEMETRY_2_H__ +#endif // PLAYER_TELEMETRY_2_H From 4d5d38bcb478356f3deca240e6fb93a6b6e17b6b Mon Sep 17 00:00:00 2001 From: deepikasri Date: Mon, 20 Jul 2026 12:44:11 -0400 Subject: [PATCH 40/46] added few markers --- InterfacePlayerRDK.cpp | 48 ++++++++++++++++++++++++++++++-- drm/helper/WidevineDrmHelper.cpp | 33 +++++++++++++++++++++- 2 files changed, 78 insertions(+), 3 deletions(-) diff --git a/InterfacePlayerRDK.cpp b/InterfacePlayerRDK.cpp index b0e165a4..040908f8 100644 --- a/InterfacePlayerRDK.cpp +++ b/InterfacePlayerRDK.cpp @@ -587,7 +587,22 @@ void InterfacePlayerRDK::ConfigurePipeline(int format, int audioFormat, int subF } else { - PlayerTelemetry::sendEvent(TELEMETRY_EVENT_BUFFERING_STARTED); +#ifdef PLAYER_TELEMETRY_SUPPORT + { + std::map intMetrics; + std::map stringMetrics; + std::map floatMetrics; + + intMetrics["mediaFormat"] = (int)m_gstConfigParam->media; + intMetrics["maxBufferingTimeoutMs"] = DEFAULT_BUFFERING_MAX_MS; + intMetrics["framesToQueue"] = (int)m_gstConfigParam->framesToQueue; + intMetrics["isRialto"] = interfacePlayerPriv->gstPrivateContext->usingRialtoSink ? 1 : 0; + stringMetrics["state"] = "started"; + + PlayerTelemetry2 telemetry; + telemetry.send(TELEMETRY_EVENT_BUFFERING_STARTED, intMetrics, stringMetrics, floatMetrics); + } +#endif } interfacePlayerPriv->gstPrivateContext->pendingPlayState = false; interfacePlayerPriv->gstPrivateContext->paused = false; @@ -3091,7 +3106,21 @@ bool InterfacePlayerRDK::StopBuffering(bool forceStop, bool &isPlaying) if (current == GST_STATE_PLAYING) { sendEndEvent = true; - PlayerTelemetry::sendEvent(TELEMETRY_EVENT_BUFFERING_ENDED); +#ifdef PLAYER_TELEMETRY_SUPPORT + { + std::map intMetrics; + std::map stringMetrics; + std::map floatMetrics; + + intMetrics["frames"] = frames; + intMetrics["forceStop"] = forceStop ? 1 : 0; + stringMetrics["state"] = "ended"; + stringMetrics["source"] = "stopBuffering"; + + PlayerTelemetry2 telemetry; + telemetry.send(TELEMETRY_EVENT_BUFFERING_ENDED, intMetrics, stringMetrics, floatMetrics); + } +#endif } } } @@ -5064,6 +5093,21 @@ static gboolean buffering_timeout (gpointer data) privatePlayer->gstPrivateContext->buffering_in_progress = false; isPlayerReady = true; +#ifdef PLAYER_TELEMETRY_SUPPORT + { + std::map intMetrics; + std::map stringMetrics; + std::map floatMetrics; + + intMetrics["frames"] = frames; + intMetrics["bufferingTimeoutCnt"] = (int)original_buffering_timeout_cnt; + stringMetrics["state"] = "ended"; + stringMetrics["source"] = "timeout"; + + PlayerTelemetry2 telemetry; + telemetry.send(TELEMETRY_EVENT_BUFFERING_ENDED, intMetrics, stringMetrics, floatMetrics); + } +#endif } } if (!privatePlayer->gstPrivateContext->buffering_in_progress) diff --git a/drm/helper/WidevineDrmHelper.cpp b/drm/helper/WidevineDrmHelper.cpp index 7447fd70..4168a79a 100755 --- a/drm/helper/WidevineDrmHelper.cpp +++ b/drm/helper/WidevineDrmHelper.cpp @@ -187,6 +187,12 @@ void WidevineDrmHelper::setDefaultKeyID(const std::string& cencData) { mDefaultKeySlot = -1; std::vector defaultKeyID(cencData.begin(), cencData.end()); + // Telemetry: log cencData format to check if UUID-to-binary conversion is needed + bool isUuidFormat = (cencData.size() == 36 && cencData[8] == '-' && cencData[13] == '-' && cencData[18] == '-' && cencData[23] == '-'); + MW_LOG_WARN("setDefaultKeyID: cencData size=%zu isUuidFormat=%d data=%s", + cencData.size(), isUuidFormat, PlayerLogManager::getHexDebugStr(defaultKeyID).c_str()); + +#if 0 //dn808 // Also convert UUID string (e.g. "f3dff538-b8c9-58e4-e8cd-96cf811d32dc") to 16-byte binary // for comparison against binary keyIDs parsed from PSSH std::vector defaultKeyIDBinary; @@ -216,11 +222,12 @@ void WidevineDrmHelper::setDefaultKeyID(const std::string& cencData) defaultKeyIDBinary.push_back(static_cast(v)); } } +#endif if(!mKeyIDs.empty()) { for(auto& it : mKeyIDs) { - if(defaultKeyID == it.second || defaultKeyIDBinary == it.second) + if(defaultKeyID == it.second ) { mDefaultKeySlot = it.first; MW_LOG_WARN("setDefaultKeyID : %s slot : %d", PlayerLogManager::getHexDebugStr(it.second).c_str(), mDefaultKeySlot); @@ -230,6 +237,30 @@ void WidevineDrmHelper::setDefaultKeyID(const std::string& cencData) } if (mDefaultKeySlot < 0 && !mKeyIDs.empty()) { + // Telemetry: log when no match found - indicates UUID binary comparison may be needed + MW_LOG_ERR("setDefaultKeyID: TELEMETRY - no key match for cencData=%s isUuidFormat=%d keyIDCount=%zu", + cencData.c_str(), isUuidFormat, mKeyIDs.size()); + for (const auto& it : mKeyIDs) + { + MW_LOG_ERR("setDefaultKeyID: TELEMETRY - available keyID[%d]=%s", it.first, PlayerLogManager::getHexDebugStr(it.second).c_str()); + } +#ifdef PLAYER_TELEMETRY_SUPPORT + { + std::map intMetrics; + std::map stringMetrics; + std::map floatMetrics; + + intMetrics["isUuidFormat"] = isUuidFormat ? 1 : 0; + intMetrics["keyIDCount"] = (int)mKeyIDs.size(); + intMetrics["cencDataSize"] = (int)cencData.size(); + stringMetrics["cencData"] = cencData; + stringMetrics["defaultKeyHex"] = PlayerLogManager::getHexDebugStr(defaultKeyID); + stringMetrics["source"] = "setDefaultKeyID_noMatch"; + + PlayerTelemetry2 telemetry; + telemetry.send(TELEMETRY_EVENT_DRM_KEY_MISMATCH, intMetrics, stringMetrics, floatMetrics); + } +#endif mDefaultKeySlot = mKeyIDs.begin()->first; MW_LOG_WARN("setDefaultKeyID: no match found for cencData, defaulting to first slot %d", mDefaultKeySlot); } From 2fae7ff68b9b61302cf3bfa036eadf50f826c318 Mon Sep 17 00:00:00 2001 From: deepikasri Date: Fri, 24 Jul 2026 04:52:56 -0400 Subject: [PATCH 41/46] added headers --- drm/helper/WidevineDrmHelper.cpp | 1 + 1 file changed, 1 insertion(+) diff --git a/drm/helper/WidevineDrmHelper.cpp b/drm/helper/WidevineDrmHelper.cpp index 4168a79a..d175b738 100755 --- a/drm/helper/WidevineDrmHelper.cpp +++ b/drm/helper/WidevineDrmHelper.cpp @@ -30,6 +30,7 @@ #include "DrmUtils.h" #include "PlayerLogManager.h" #include "DrmConstants.h" +#include "PlayerTelemetry2.hpp" #define MultiChar_Constant(TEXT) ( \ (static_cast(TEXT[0]) << 0x18) | \ From 502e85b0e480daea68dfe9fb4f06315dfb5362e9 Mon Sep 17 00:00:00 2001 From: deepikasri Date: Fri, 24 Jul 2026 06:23:43 -0400 Subject: [PATCH 42/46] added markers for drm mismatch --- TelemetryMarkers.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/TelemetryMarkers.h b/TelemetryMarkers.h index 5507618b..784cff10 100644 --- a/TelemetryMarkers.h +++ b/TelemetryMarkers.h @@ -81,4 +81,4 @@ #define TELEMETRY_EVENT_HDCP_PROTECTION_FAILURE "HDCP_PROTECTION_FAILURE" /**< HDCP output protection failure detected */ #define TELEMETRY_EVENT_HDCP_COMPLIANCE_FAILURE "HDCP_COMPLIANCE_FAILURE" /**< HDCP compliance check failure (2.2 vs 1.4) */ #define TELEMETRY_EVENT_DECRYPT_FAILURE "DECRYPT_FAILURE" /**< Decryption failure threshold exceeded */ - +#define TELEMETRY_EVENT_DRM_KEY_MISMATCH "DRM_KEY_MISMATCH" From d90ea3ae22176e09d5d11ae8c9164f4529eab93b Mon Sep 17 00:00:00 2001 From: deepikasri Date: Fri, 24 Jul 2026 06:42:11 -0400 Subject: [PATCH 43/46] relevant headers added --- drm/helper/WidevineDrmHelper.cpp | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/drm/helper/WidevineDrmHelper.cpp b/drm/helper/WidevineDrmHelper.cpp index d175b738..91eb53e7 100755 --- a/drm/helper/WidevineDrmHelper.cpp +++ b/drm/helper/WidevineDrmHelper.cpp @@ -30,7 +30,12 @@ #include "DrmUtils.h" #include "PlayerLogManager.h" #include "DrmConstants.h" + +#ifdef PLAYER_TELEMETRY_SUPPORT #include "PlayerTelemetry2.hpp" +#endif //PLAYER_TELEMETRY_SUPPORT +#include "TelemetryMarkers.h" +#include "PlayerTelemetry.h" #define MultiChar_Constant(TEXT) ( \ (static_cast(TEXT[0]) << 0x18) | \ From 7ad007a5d214a40b4e5e6b93e129ed6d0a86f0ca Mon Sep 17 00:00:00 2001 From: dp0000 <53818367+dp0000@users.noreply.github.com> Date: Wed, 5 Aug 2026 13:27:16 +0530 Subject: [PATCH 44/46] Update DrmSessionManager.cpp for watermarking telemetry condition added --- drm/DrmSessionManager.cpp | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/drm/DrmSessionManager.cpp b/drm/DrmSessionManager.cpp index 3157e86d..1661de00 100755 --- a/drm/DrmSessionManager.cpp +++ b/drm/DrmSessionManager.cpp @@ -226,6 +226,23 @@ void DrmSessionManager::setVideoWindowSize(int width, int height) if(localSession.isSessionValid()) { MW_LOG_WARN("In DrmSessionManager:: valid session ID. Calling setVideoWindowSize()."); + if (width == 0 || height == 0) + { + + std::map intMetrics; + std::map stringMetrics; + std::map floatMetrics; + + intMetrics["width"] = width; + intMetrics["height"] = height; + intMetrics["isRialto"] = isRialto ? 1 : 0; // keep only if isRialto is available in scope + + stringMetrics["component"] = "AampLicenseManager"; + stringMetrics["action"] = "setVideoWindowSize"; + stringMetrics["reason"] = "watermark_enabled_zero_dimension"; + + telemetry.send("TELEMETRY_WATERMARK_ZERO_DIMENSION", intMetrics, stringMetrics, floatMetrics); + } ContentSecurityManager::GetInstance()->setVideoWindowSize(localSession.getSessionID(), width, height); } } From 71bbb77f273fcc12727f20d7227d5cedf9e78225 Mon Sep 17 00:00:00 2001 From: Deepikasri N Date: Wed, 5 Aug 2026 15:13:29 +0530 Subject: [PATCH 45/46] added telemetry for watermarking scenario --- drm/DrmSessionManager.cpp | 38 ++++++++++++++++++++++---------------- 1 file changed, 22 insertions(+), 16 deletions(-) diff --git a/drm/DrmSessionManager.cpp b/drm/DrmSessionManager.cpp index 1c7b25c8..74137315 100755 --- a/drm/DrmSessionManager.cpp +++ b/drm/DrmSessionManager.cpp @@ -39,6 +39,11 @@ #define INVALID_SESSION_SLOT -1 #define DEFAULT_CDM_WAIT_TIMEOUT_MS 2000 +#ifdef PLAYER_TELEMETRY_SUPPORT +#include "PlayerTelemetry2.hpp" +#endif +#include "TelemetryMarkers.h" +#include "PlayerTelemetry.h" /** * @brief KeyIdEntries constructor. */ @@ -233,22 +238,23 @@ void DrmSessionManager::setVideoWindowSize(int width, int height) { MW_LOG_WARN("In DrmSessionManager:: valid session ID. Calling setVideoWindowSize()."); if (width == 0 || height == 0) - { - - std::map intMetrics; - std::map stringMetrics; - std::map floatMetrics; - - intMetrics["width"] = width; - intMetrics["height"] = height; - intMetrics["isRialto"] = isRialto ? 1 : 0; // keep only if isRialto is available in scope - - stringMetrics["component"] = "AampLicenseManager"; - stringMetrics["action"] = "setVideoWindowSize"; - stringMetrics["reason"] = "watermark_enabled_zero_dimension"; - - telemetry.send("TELEMETRY_WATERMARK_ZERO_DIMENSION", intMetrics, stringMetrics, floatMetrics); - } + { + +#ifdef PLAYER_TELEMETRY_SUPPORT + std::map intMetrics; + std::map stringMetrics; + std::map floatMetrics; + + intMetrics["width"] = width; + intMetrics["height"] = height; + + stringMetrics["component"] = "AampLicenseManager"; + stringMetrics["action"] = "setVideoWindowSize"; + stringMetrics["reason"] = "watermark_enabled_zero_dimension"; + + telemetry.send("TELEMETRY_WATERMARK_ZERO_DIMENSION", intMetrics, stringMetrics, floatMetrics); +#endif + } ContentSecurityManager::GetInstance()->setVideoWindowSize(localSession.getSessionID(), width, height); } } From 983b43f9794c0ed9e38521e6ddaa5cbd361e3eac Mon Sep 17 00:00:00 2001 From: Deepikasri N Date: Wed, 5 Aug 2026 17:17:25 +0530 Subject: [PATCH 46/46] initialisation missed --- drm/DrmSessionManager.cpp | 1 + 1 file changed, 1 insertion(+) diff --git a/drm/DrmSessionManager.cpp b/drm/DrmSessionManager.cpp index 74137315..c46a9234 100755 --- a/drm/DrmSessionManager.cpp +++ b/drm/DrmSessionManager.cpp @@ -252,6 +252,7 @@ void DrmSessionManager::setVideoWindowSize(int width, int height) stringMetrics["action"] = "setVideoWindowSize"; stringMetrics["reason"] = "watermark_enabled_zero_dimension"; + PlayerTelemetry2 telemetry; telemetry.send("TELEMETRY_WATERMARK_ZERO_DIMENSION", intMetrics, stringMetrics, floatMetrics); #endif }