Skip to content

RDKEMW-20661: Bring in fix for WPEWebProcess crashed with fingerprint 80095400 to develop#203

Open
nejuma1 wants to merge 2 commits into
developfrom
feature/RDKEMW-20661
Open

RDKEMW-20661: Bring in fix for WPEWebProcess crashed with fingerprint 80095400 to develop#203
nejuma1 wants to merge 2 commits into
developfrom
feature/RDKEMW-20661

Conversation

@nejuma1

@nejuma1 nejuma1 commented Jul 15, 2026

Copy link
Copy Markdown

RDKEMW-20661: Bring in fix for WPEWebProcess crashed with fingerprint 80095400 to develop
Reason for change : Added fix for the race condition by using weakpointer instead of raw pointer
Priority : P1
Test Steps: Mentioned in ticket
Signed off by : Nejuma T N nejumatn28@gmail.com

… 80095400 to 8.6

Reason for change : Added fix for the race condition by using weakpointer instead of raw pointer
Priority : P1
Test Steps: Mentioned in ticket
Signed off by : Nejuma T N <nejumatn28@gmail.com>
Copilot AI review requested due to automatic review settings July 15, 2026 09:14
@nejuma1
nejuma1 requested a review from a team as a code owner July 15, 2026 09:14

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 primarily addresses teardown-time races by making the periodic progress timer callback stop using a raw InterfacePlayerRDK* user pointer, and adds several related fixes/improvements across subtitle timing, DRM decryptor caps handling, and Darwin build/link behavior.

Changes:

  • Replace raw-pointer timer user_data with a weak-pointer context + add g_timeout_add_full() support so timer user_data can be safely destroyed during teardown.
  • Add a subtitle PTS offset API and implement it for the WebVTT Subtec parser (signed offset support).
  • Improve robustness in DRM decryptor caps negotiation (wait/guard against sinkCaps == NULL) and adjust multiple CMake Darwin link behaviors to prefer full-path _LINK_LIBRARIES.

Reviewed changes

Copilot reviewed 17 out of 18 changed files in this pull request and generated 5 comments.

Show a summary per file
File Description
test/utests/mocks/MockGLib.h Adds g_timeout_add_full to the GLib mock API used by unit tests.
test/utests/fakes/FakeGLib.cpp Routes g_timeout_add_full through the GLib mock instead of returning a stub value.
subtitle/subtitleParser.h Adds new virtual setPtsOffset(double) hook for subtitle timing alignment.
subtec/subtecparser/WebVttSubtecParser.hpp Declares setPtsOffset override and changes offset type to signed.
subtec/subtecparser/WebVttSubtecParser.cpp Applies time_offset_ms_ to sent packets and implements setPtsOffset conversion/negation logic.
InterfacePlayerRDK.h Introduces ProgressCallbackContext, new timer destroy-notify support, and progress callback context helpers.
InterfacePlayerRDK.cpp Implements weak-context-based progress timer callback, context cancellation/wait logic, timer destroy-notify support, scheduler stop/start changes in Stop(), safer rectangle parsing, and safer callback invocation.
gst-plugins/gst_subtec/CMakeLists.txt Updates include paths and uses _LINK_LIBRARIES to avoid Darwin link_directories() issues.
gst-plugins/drm/gst/gstcdmidecryptor.h Adds a condition variable for waiting on sink caps negotiation.
gst-plugins/drm/gst/gstcdmidecryptor.cpp Signals/waits for sinkCaps readiness and guards decrypt paths against null caps.
gst-plugins/CMakeLists.txt Adjusts Darwin linking to avoid link_directories() warnings and uses UUID pkg-config.
externals/CMakeLists.txt Switches Darwin externals to use pkg-config full-path link libraries instead of GStreamer.framework.
drm/PlayerHlsDrmSessionInterface.h Declares a destructor for cleanup of the DRM session manager (non-adapter builds).
drm/PlayerHlsDrmSessionInterface.cpp Implements destructor cleanup logic.
drm/ocdm/OcdmGstSessionAdapter.cpp Adds a null check before caps type/emptiness checks.
drm/DrmSessionManager.h Adds move ctor/assignment and includes <utility>.
CMakeLists.txt Adjusts include dirs and Darwin linking to use _LINK_LIBRARIES variables.
.gitignore Ignores build_aamp/ output directory.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread InterfacePlayerRDK.cpp
Comment on lines +3827 to +3834
this->TimerRemove(interfacePlayerPriv->gstPrivateContext->periodicProgressCallbackIdleTaskId, "periodicProgressCallbackIdleTaskId");
std::unique_lock<std::mutex> lock(callbackContext->mutex);
if (!callbackContext->cv.wait_for(lock, std::chrono::seconds(5), [&callbackContext]() {
return 0 == callbackContext->activeCallbacks;
})) {
MW_LOG_WARN("Teardown timeout: callback context still has active callbacks (%zu). Possible I/O blockage or deadlock detected.", callbackContext->activeCallbacks);
}
lock.unlock();
Comment on lines +48 to +55
PlayerHlsDrmSessionInterface::~PlayerHlsDrmSessionInterface()
{
#ifndef USE_OPENCDM_ADAPTER
if(m_pHlsDrmSessionManager != nullptr)
{
delete m_pHlsDrmSessionManager;
m_pHlsDrmSessionManager = nullptr;
}
Comment thread InterfacePlayerRDK.cpp
Comment on lines +3854 to +3858
if (destroyNotify)
{
taskId = g_timeout_add_full(G_PRIORITY_DEFAULT, repeatTimeout, funcPtr, user_data, destroyNotify);
if (0 == taskId)
{
Comment on lines +74 to +86
m_channel->SendDataPacket(std::move(data), time_offset_ms_);

return true;
}

void WebVTTSubtecParser::setPtsOffset(double ptsOffsetSec)
{
// Subtec's display_time = media_PTS - time_offset_ms (subtraction
// convention shared with Rialto SetSubtitlePtsOffset). The HLS
// restamped video PTS is media_PTS + ptsOffsetSec, so we negate
// here to make subtec add the offset on the subtitle path.
time_offset_ms_ = -static_cast<std::int64_t>(std::llround(ptsOffsetSec * 1000.0));
}
Comment thread subtitle/subtitleParser.h
Comment on lines +96 to +104
/**
* @brief Set a per-fragment PTS offset (seconds) that the parser
* applies when forwarding cue data to its subtitle sink.
*
* Used by the HLS PTS-restamp path to align subtitle display time
* with the restamped video PTS without rewriting MPEGTS in the
* VTT header. Default no-op; parsers that need this behavior override.
*/
virtual void setPtsOffset(double ptsOffsetSec) {}
Comment thread InterfacePlayerRDK.cpp
{
mProgressCallbackContext.reset();
}
}
@dp0000
dp0000 changed the base branch from main to develop July 15, 2026 10:06
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.

5 participants