Skip to content

Add PLAYER_TELEMETRY_SUPPORT guards around std::map telemetry blocks in pipeline state changes#120

Draft
Copilot wants to merge 2 commits intomainfrom
copilot/add-player-telemetry-support
Draft

Add PLAYER_TELEMETRY_SUPPORT guards around std::map telemetry blocks in pipeline state changes#120
Copilot wants to merge 2 commits intomainfrom
copilot/add-player-telemetry-support

Conversation

Copy link
Copy Markdown

Copilot AI commented Mar 26, 2026

Pipeline state change handling in SetStateWithWarnings lacked telemetry instrumentation, and no mechanism existed to conditionally compile telemetry support.

Changes

  • PlayerTelemetry.h — New PlayerTelemetry2 class with send(marker, iMap, sMap, fMap) accepting typed std::map payloads for int, string, and float values
  • PlayerTelemetry.cpp — Default implementation logging all telemetry entries via MW_LOG_MIL
  • InterfacePlayerRDK.cpp — Telemetry blocks added under #ifdef PLAYER_TELEMETRY_SUPPORT in every case of the SetStateWithWarnings switch, mapping current/pending/target state into typed maps before dispatch:
#ifdef PLAYER_TELEMETRY_SUPPORT
    {
        std::map<std::string, int> i;
        std::map<std::string, std::string> s;
        std::map<std::string, float> f;
        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<int>(targetState);
        PlayerTelemetry2 telemetry;
        telemetry.send("MW_PIPELINE_STATE_CHANGE_FAILURE", i, s, f);
    }
#endif

Covered cases: FAILURE, SUCCESS, ASYNC, and default (→ MW_PIPELINE_STATE_CHANGE_UNKNOWN).

  • CMakeLists.txtCMAKE_PLAYER_TELEMETRY_SUPPORT option conditionally appends PlayerTelemetry.cpp and defines -DPLAYER_TELEMETRY_SUPPORT; PlayerTelemetry.h added to headers and install target

💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.

- Create PlayerTelemetry.h with PlayerTelemetry2 class declaration
- Create PlayerTelemetry.cpp with PlayerTelemetry2::send implementation
- Add #ifdef PLAYER_TELEMETRY_SUPPORT guards with std::map declarations in
  SetStateWithWarnings for all pipeline state change cases (FAILURE, SUCCESS,
  ASYNC, UNKNOWN)
- Update CMakeLists.txt to conditionally compile PlayerTelemetry.cpp and add
  PlayerTelemetry.h to headers/install list

Co-authored-by: dp0000 <53818367+dp0000@users.noreply.github.com>
Agent-Logs-Url: https://github.com/rdkcentral/middleware-player-interface/sessions/3d5f3dc4-bf47-4991-9822-0ba1e6d6e045
Copilot AI changed the title [WIP] Add player telemetry support in pipeline state changes Add PLAYER_TELEMETRY_SUPPORT guards around std::map telemetry blocks in pipeline state changes Mar 26, 2026
Copilot AI requested a review from dp0000 March 26, 2026 11:09
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