Skip to content

RDKEMW-24194 Display SRCREV/TAG details fo player-Interface component - #236

Open
dp0000 wants to merge 6 commits into
0.2.0-8.6_VIPAfrom
feature/RDKEMW-24194
Open

dp0000 wants to merge 6 commits into
0.2.0-8.6_VIPAfrom
feature/RDKEMW-24194

Conversation

@dp0000

@dp0000 dp0000 commented Aug 28, 2026

Copy link
Copy Markdown
Contributor

RDKEMW-24194: [8.6_vipa]Display SRCREV/TAG details of Player-Interface component
Reason for change : Src rev is not been known in the sw loaded .

Priority : P0
Test steps : check all the apps on the version info of player-interface component.
Signed off by: Deepikasri N Deepikasri_n@comcast.com

@dp0000
dp0000 requested a review from a team as a code owner August 28, 2026 11:25
Copilot AI lite review requested due to automatic review settings August 28, 2026 11:25

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR adds build-time version/Git metadata for the Player-Interface component (to surface SRCREV/TAG details at runtime), and wires that information into the player’s startup path. It also refactors SoC interface initialization to support a two-phase platform detection flow (device.properties first, optional plugin scan later) and updates related call sites.

Changes:

  • Generate and install a version.h header from CMake containing version, git revision, tag, and branch metadata.
  • Add PrintPlayerInterfaceVersion() and invoke it during player construction to display the baked-in metadata.
  • Refactor SocInterface initialization into a guarded singleton with optional phase-2 platform detection and update call sites accordingly (plus a public API signature change to Flush()).

Reviewed changes

Copilot reviewed 8 out of 10 changed files in this pull request and generated 6 comments.

Show a summary per file
File Description
version.h.in New CMake-configured header template for version/Git metadata macros.
CMakeLists.txt Collect Git metadata at configure time, generate/install version.h, and expose build dir includes.
PlayerUtils.h Declare PrintPlayerInterfaceVersion().
PlayerUtils.cpp Include generated version.h and implement version/Git metadata printing.
InterfacePlayerRDK.cpp Call PrintPlayerInterfaceVersion() during construction; adjust SocInterface usage via accessor.
InterfacePlayerRDK.h Update Flush() signature (removes keepPausedSeek).
InterfacePlayerPriv.h Remove cached SocInterface pointer; add GetSocInterface() accessor; make using_westerossink atomic.
vendor/SocInterface.h Add InitializePlatformFromPlugins() API for phase-2 initialization.
vendor/SocInterface.cpp Implement two-phase singleton initialization with synchronization primitives.
SocUtils.cpp Stop caching SocInterface in SocUtils and always resolve via CreateSocInterface().

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

Comment thread PlayerUtils.cpp Outdated
Comment thread PlayerUtils.cpp
Comment thread InterfacePlayerRDK.cpp
Comment thread InterfacePlayerRDK.cpp
Comment thread CMakeLists.txt
Comment thread InterfacePlayerRDK.h
…e component

Reason for change : Src rev is not been known in the sw loaded .

Priority : P0
Test steps : check all the apps on the version info of player-interface component.
Signed off by: Deepikasri N Deepikasri_n@comcast.com
Copilot AI review requested due to automatic review settings August 28, 2026 12:00

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 8 out of 10 changed files in this pull request and generated 3 comments.

Suppressed comments (3)

Previously missed (1) — in code that hasn't changed since the last review.

InterfacePlayerRDK.cpp:333

  • GetSocInterface() ultimately locks g_socMutex on every call. In this block it's called 3+ times back-to-back; caching the pointer locally avoids repeated locking and makes the logic easier to read.
	bool useWesterosSink = m_gstConfigParam->useWesterosSink;
	if (!useWesterosSink && !m_gstConfigParam->useRialtoSink && interfacePlayerPriv->GetSocInterface()->UseWesterosSink())
	{
		MW_LOG_WARN("Platform requires westerossink; correcting cached sink state");
		useWesterosSink = true;
	}

	if(!useWesterosSink)
	{
		interfacePlayerPriv->gstPrivateContext->using_westerossink = false;
		interfacePlayerPriv->GetSocInterface()->SetWesterosSinkState(false);
		interfacePlayerPriv->gstPrivateContext->firstTuneWithWesterosSinkOff = interfacePlayerPriv->GetSocInterface()->IsFirstTuneWithWesteros();
	}

CMakeLists.txt:49

  • git tag --points-at HEAD can return multiple tags separated by newlines; that newline will be embedded into PLAYERINTERFACE_GIT_TAG and will break log formatting (and the generated header becomes harder to consume). Normalizing to a single-line value avoids this.
    execute_process(
        COMMAND ${GIT_EXECUTABLE} tag --points-at HEAD
        WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}
        OUTPUT_VARIABLE PI_GIT_TAG
        OUTPUT_STRIP_TRAILING_WHITESPACE
        ERROR_QUIET
    )

InterfacePlayerRDK.cpp:3510

  • If SetStateWithWarnings() fails (non-success, non-async), this still returns true. Returning failure here is important for error handling by API consumers.
		else if (GST_STATE_CHANGE_SUCCESS != rc)
		{
			MW_LOG_ERR("InterfacePlayerRDK_Pause - gst_element_set_state - FAILED rc %d ", rc);
		}

Comment thread InterfacePlayerRDK.h
Comment thread InterfacePlayerRDK.cpp
Comment thread PlayerUtils.cpp
@dp0000
dp0000 changed the base branch from 0.2.0-8.6_VIPA to develop September 4, 2026 07:33
@dp0000
dp0000 changed the base branch from develop to 0.2.0-8.6_VIPA September 4, 2026 07:34
dp0000 and others added 2 commits September 4, 2026 14:30
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
Copilot AI review requested due to automatic review settings September 4, 2026 09:31
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟡 Changes recommended

The new version-printing path has correctness/behavior mismatches (commented-out fields and repeated logging) and the installed header name risks collisions, so the implementation should be adjusted before approval.

Once you've addressed the issues Copilot identified, you can request another Copilot review.

Review details

Suppressed comments (1)

PlayerUtils.cpp:308

  • PrintPlayerInterfaceVersion currently comments out the Version and Git Branch logs, which contradicts the function’s stated purpose; additionally, it can be called multiple times (e.g., per InterfacePlayerRDK construction) and will spam logs. Make the function idempotent and log all baked-in fields consistently.
    MW_LOG_MIL("###################################################\n");
 //   MW_LOG_MIL("[PlayerInterface] Version   : %s\n", PLAYERINTERFACE_VERSION);
    MW_LOG_MIL("[PlayerInterface] Git Rev   : %s\n", PLAYERINTERFACE_GIT_REVISION);
    MW_LOG_MIL("[PlayerInterface] Git Tag   : %s\n", PLAYERINTERFACE_GIT_TAG);
   // MW_LOG_MIL("[PlayerInterface] Git Branch: %s\n", PLAYERINTERFACE_GIT_BRANCH);
  • Files reviewed: 5/5 changed files
  • Comments generated: 5
  • Review effort level: Lite

Comment thread CMakeLists.txt
Comment on lines +283 to +284
install(FILES "${CMAKE_CURRENT_BINARY_DIR}/version.h"
DESTINATION include)
Comment thread PlayerUtils.cpp
Comment on lines 24 to +28
#include "PlayerUtils.h"
#include "_base64.h"
#include <cstdio>

#include "version.h"
Comment thread PlayerUtils.h
Comment on lines 37 to 39

#include <PlayerLogManager.h>
//Delete non-array object
Comment thread PlayerUtils.h
Comment on lines +114 to +118
/**
* @fn PrintPlayerInterfaceVersion
* @brief Prints PlayerInterface version, git revision, tag and branch to stdout.
* Call once during library initialisation.
*/
Comment thread version.h.in
Comment on lines +1 to +2

/*
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.

4 participants