Skip to content

Add PlayerTelemetry.cpp with Telemetry 2.0 integration and PLAYER_TELEMETRY_SUPPORT guards at all call sites#122

Draft
Copilot wants to merge 3 commits intocopilot/insert-runtime-telemetry-eventsfrom
copilot/add-ifdef-player-telemetry-support
Draft

Add PlayerTelemetry.cpp with Telemetry 2.0 integration and PLAYER_TELEMETRY_SUPPORT guards at all call sites#122
Copilot wants to merge 3 commits intocopilot/insert-runtime-telemetry-eventsfrom
copilot/add-ifdef-player-telemetry-support

Conversation

Copy link
Copy Markdown

Copilot AI commented Mar 26, 2026

Telemetry events were emitted via inline MW_LOG_MIL in the header with no call-site guards, coupling telemetry to the log subsystem and compiling all payload construction even in non-telemetry builds. This wires the implementation to the RDK Telemetry 2.0 framework (t2_event_s) and adds explicit #ifdef PLAYER_TELEMETRY_SUPPORT guards at every emission point.

PlayerTelemetry.cpp (new)

Implements PlayerTelemetry::sendEvent() using t2_event_s(), compiled only when PLAYER_TELEMETRY_SUPPORT is defined:

#ifdef PLAYER_TELEMETRY_SUPPORT
#include "PlayerTelemetry2.hpp"
#include <telemetry2_marker.h>

void PlayerTelemetry::sendEvent(const std::string& eventName)
{
    /* t2_event_s() is a C API that takes char* but does not modify the string. */
    t2_event_s(const_cast<char*>(eventName.c_str()), const_cast<char*>("1"));
}
// ...
#endif /* PLAYER_TELEMETRY_SUPPORT */

PlayerTelemetry.h

  • Removes #include "PlayerLogManager.h" from the active branch (no longer needed)
  • Changes PlayerTelemetry::sendEvent() from inline-defined to declared-only; the no-op #else stubs are retained for backward compatibility

Call-site guards (5 files)

All TelemetryPayload construction and PlayerTelemetry::sendEvent() calls in InterfacePlayerRDK.cpp, GstHandlerControl.cpp, drm/DrmSessionManager.cpp, drm/ocdm/opencdmsessionadapter.cpp, and gst-plugins/drm/gst/gstcdmidecryptor.cpp are wrapped:

#ifdef PLAYER_TELEMETRY_SUPPORT
{
    TelemetryPayload payload;
    payload.add("keySystem", m_keySystem);
    PlayerTelemetry::sendEvent(TELEMETRY_EVENT_OCDM_SYSTEM_CREATE_FAILED, payload);
}
#endif /* PLAYER_TELEMETRY_SUPPORT */

CMakeLists.txt

When CMAKE_PLAYER_TELEMETRY_SUPPORT is set: adds PlayerTelemetry.cpp to sources, resolves the telemetry2_marker.h include path, and links -ltelemetry2.


💬 Send tasks to Copilot coding agent from Slack and Teams to turn conversations into code. Copilot posts an update in your thread when it's finished.

Copilot AI and others added 2 commits March 26, 2026 17:42
…TELEMETRY_SUPPORT guards at all call sites

Agent-Logs-Url: https://github.com/rdkcentral/middleware-player-interface/sessions/14ef8a4a-739c-4644-9588-9e61e93269b6

Co-authored-by: dp0000 <53818367+dp0000@users.noreply.github.com>
Copilot AI changed the title [WIP] Add ifdef PLAYER_TELEMETRY_SUPPORT for telemetry events Add PlayerTelemetry.cpp with Telemetry 2.0 integration and PLAYER_TELEMETRY_SUPPORT guards at all call sites Mar 26, 2026
Copilot AI requested a review from dp0000 March 26, 2026 17:49
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants