Skip to content

Add support for 'first-audio-frame-callback' signal#552

Open
Koky2701 wants to merge 3 commits into
masterfrom
feature/RDKEMW-17882_v2
Open

Add support for 'first-audio-frame-callback' signal#552
Koky2701 wants to merge 3 commits into
masterfrom
feature/RDKEMW-17882_v2

Conversation

@Koky2701

Copy link
Copy Markdown
Contributor
Summary: Add support for 'first-audio-frame-callback' signal to Rialto sink
Type: Fix
Test Plan: UT/CT, Fullstack
Jira: RDKEMW-17882

Copilot AI review requested due to automatic review settings June 30, 2026 12:35
@github-actions

Copy link
Copy Markdown

Pull request must be merged with a description containing the required fields,

Summary:
Type: Feature/Fix/Cleanup
Test Plan:
Jira:

If there is no jira releated to this change, please put 'Jira: NO-JIRA'.

Description can be changed by editing the top comment on your pull request and making a new commit.

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 extends Rialto’s existing “first video frame received” notification pipeline to also support the first audio frame, including support for the first-audio-frame-callback signal and a fallback sink-pad probe when the callback signal is unavailable, while reusing the existing FirstFrameReceivedEvent / notifyFirstFrameReceived(...) contract end-to-end.

Changes:

  • Add audio first-frame detection during GStreamer element setup (signal hookup + sink fallback probe) and schedule the existing first-frame task path using MediaSourceType::AUDIO.
  • Add lifecycle cleanup/reset for audio first-frame state (attach/reattach/flush/stop/term).
  • Add/update unit + component tests and add spec-driven documentation (openspec change).

Reviewed changes

Copilot reviewed 24 out of 24 changed files in this pull request and generated 4 comments.

Show a summary per file
File Description
tests/unittests/media/server/mocks/gstplayer/GstGenericPlayerPrivateMock.h Extends private-player mock with audio first-frame scheduling/probe APIs.
tests/unittests/media/server/gstplayer/genericPlayer/tasksTests/SetupElementTest.cpp Adds UT for first-audio-frame signal hookup behavior.
tests/unittests/media/server/gstplayer/genericPlayer/tasksTests/FirstFrameReceivedTest.cpp Adds UT coverage for notifying first frame received for audio.
tests/unittests/media/server/gstplayer/genericPlayer/GstGenericPlayerPrivateTest.cpp Adds UT for scheduling first audio frame received task.
tests/unittests/media/server/gstplayer/genericPlayer/common/GenericTasksTestsContext.h Adds audio first-frame callback storage for UT harness.
tests/unittests/media/server/gstplayer/genericPlayer/common/GenericTasksTestsBase.h Adds UT helpers for audio first-frame signal/trigger paths.
tests/unittests/media/server/gstplayer/genericPlayer/common/GenericTasksTestsBase.cpp Implements UT helper expectations and triggers for audio first-frame.
tests/componenttests/server/tests/mediaPipeline/FirstFrameNotificationTest.cpp Adds server CT covering end-to-end audio first-frame notification.
tests/componenttests/client/tests/mse/FirstFrameNotificationTest.cpp Extends client CT to validate both video and audio first-frame notifications.
tests/componenttests/client/tests/base/MediaPipelineTestMethods.h Adds client CT helper declarations for audio first-frame notification.
tests/componenttests/client/tests/base/MediaPipelineTestMethods.cpp Implements client CT helpers to expect/send audio first-frame events.
openspec/changes/audio-first-frame/tasks.md Adds implementation/validation task checklist for the change.
openspec/changes/audio-first-frame/specs/audio-first-frame/spec.md Adds formal requirements for audio first-frame detection + one-shot guard.
openspec/changes/audio-first-frame/proposal.md Documents motivation and scope of the audio first-frame change.
openspec/changes/audio-first-frame/design.md Documents detection strategy, fallback probing, and one-shot emission design.
openspec/changes/audio-first-frame/.openspec.yaml Adds openspec metadata for the new change package.
media/server/gstplayer/source/Utils.cpp Extends first-frame signal name detection set to include audio signals.
media/server/gstplayer/source/tasks/generic/Stop.cpp Resets audio first-frame state and clears fallback probe on stop.
media/server/gstplayer/source/tasks/generic/SetupElement.cpp Wires first-audio-frame signal callback + installs sink fallback probe when needed.
media/server/gstplayer/source/tasks/generic/AttachSource.cpp Resets audio first-frame state on (re)attach.
media/server/gstplayer/source/GstGenericPlayer.cpp Implements scheduling guard + probe state management/cleanup for audio first-frame.
media/server/gstplayer/include/IGstGenericPlayerPrivate.h Extends private interface for audio first-frame scheduling and probe lifecycle control.
media/server/gstplayer/include/GstGenericPlayer.h Declares new private-interface methods on the concrete player.
media/server/gstplayer/include/GenericPlayerContext.h Adds audio first-frame one-shot flag + fallback probe state to context.

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

Comment thread media/server/gstplayer/include/IGstGenericPlayerPrivate.h
Comment thread tests/componenttests/server/tests/mediaPipeline/FirstFrameNotificationTest.cpp Outdated
Comment thread media/server/gstplayer/source/tasks/generic/SetupElement.cpp
@Koky2701 Koky2701 force-pushed the feature/RDKEMW-17882_v2 branch from fe8574e to 11dc49b Compare June 30, 2026 13:24
Copilot AI review requested due to automatic review settings June 30, 2026 14:04
@Koky2701 Koky2701 force-pushed the feature/RDKEMW-17882_v2 branch from 11dc49b to a4be17b Compare June 30, 2026 14:04

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 24 out of 24 changed files in this pull request and generated 2 comments.

Comment thread tests/componenttests/server/tests/mediaPipeline/FirstFrameNotificationTest.cpp Outdated
Comment thread media/server/gstplayer/include/IGstGenericPlayerPrivate.h
@Koky2701 Koky2701 force-pushed the feature/RDKEMW-17882_v2 branch from a4be17b to f276929 Compare June 30, 2026 14:24
@github-actions

Copy link
Copy Markdown

tests/unittests/media/server/gstplayer/genericPlayer/common/GenericTasksTestsBase.cpp:456:0: style: The function 'expectFirstAudioFrameSignalConnection' is never used. [unusedFunction]
void GenericTasksTestsBase::expectFirstAudioFrameSignalConnection(const char *signalName)
^
tests/unittests/media/server/gstplayer/genericPlayer/common/GenericTasksTestsBase.cpp:469:0: style: The function 'expectAudioUnderflowSignalConnection' is never used. [unusedFunction]
void GenericTasksTestsBase::expectAudioUnderflowSignalConnection()
^
nofile:0:0: information: Active checkers: 161/592 (use --checkers-report= to see details) [checkersReport]

Copilot AI review requested due to automatic review settings June 30, 2026 14:41
@Koky2701 Koky2701 force-pushed the feature/RDKEMW-17882_v2 branch from f276929 to 3dc70f5 Compare June 30, 2026 14:41

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 24 out of 24 changed files in this pull request and generated 2 comments.

Comment thread media/server/gstplayer/source/Utils.cpp
Comment thread media/server/gstplayer/source/GstGenericPlayer.cpp
@Koky2701 Koky2701 force-pushed the feature/RDKEMW-17882_v2 branch from 3dc70f5 to 5bef55c Compare June 30, 2026 15:07
@github-actions

Copy link
Copy Markdown

tests/unittests/media/server/gstplayer/genericPlayer/common/GenericTasksTestsBase.cpp:795:0: style: The function 'shouldSetupAudioSinkElementWithPendingLowLatency' is never used. [unusedFunction]
void GenericTasksTestsBase::shouldSetupAudioSinkElementWithPendingLowLatency()
^
nofile:0:0: information: Active checkers: 161/592 (use --checkers-report= to see details) [checkersReport]

Copilot AI review requested due to automatic review settings June 30, 2026 15:22
@Koky2701 Koky2701 force-pushed the feature/RDKEMW-17882_v2 branch from 5bef55c to e015fde Compare June 30, 2026 15:22
@rdkcmf-jenkins

Copy link
Copy Markdown
Contributor

b'## Blackduck scan failure details

Summary: 0 violations, 0 files pending approval, 1 file pending identification.

  • Protex Server Path: /home/blackduck/github/rialto/552/rdkcentral/rialto

  • Commit: e015fde

Report detail: gist'

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 25 out of 25 changed files in this pull request and generated 4 comments.

Comment thread media/server/gstplayer/source/GstGenericPlayer.cpp
Comment thread media/server/gstplayer/source/GstGenericPlayer.cpp
Comment thread media/server/gstplayer/source/GstGenericPlayer.cpp Outdated
@Koky2701 Koky2701 force-pushed the feature/RDKEMW-17882_v2 branch from e015fde to ba877b1 Compare June 30, 2026 15:34
Copilot AI review requested due to automatic review settings June 30, 2026 16:02
@Koky2701 Koky2701 force-pushed the feature/RDKEMW-17882_v2 branch from ba877b1 to a9c8627 Compare June 30, 2026 16:02

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 25 out of 25 changed files in this pull request and generated 2 comments.

Comment thread media/server/gstplayer/source/GstGenericPlayer.cpp Outdated
Comment thread media/server/gstplayer/source/GstGenericPlayer.cpp
@Koky2701 Koky2701 force-pushed the feature/RDKEMW-17882_v2 branch from a9c8627 to 3e3e9f1 Compare July 1, 2026 11:07
@github-actions

github-actions Bot commented Jul 1, 2026

Copy link
Copy Markdown

tests/unittests/media/server/gstplayer/genericPlayer/common/GenericTasksTestsBase.cpp:750:0: style: The function 'shouldSetupAudioDecoderElementWithFirstAudioFrameCallback' is never used. [unusedFunction]
void GenericTasksTestsBase::shouldSetupAudioDecoderElementWithFirstAudioFrameCallback()
^
tests/unittests/media/server/gstplayer/genericPlayer/common/GenericTasksTestsBase.cpp:1061:0: style: The function 'shouldSetFirstAudioFrameCallback' is never used. [unusedFunction]
void GenericTasksTestsBase::shouldSetFirstAudioFrameCallback()
^
tests/unittests/media/server/gstplayer/genericPlayer/common/GenericTasksTestsBase.cpp:1086:0: style: The function 'triggerFirstAudioFrameCallback' is never used. [unusedFunction]
void GenericTasksTestsBase::triggerFirstAudioFrameCallback()
^
nofile:0:0: information: Active checkers: 161/592 (use --checkers-report= to see details) [checkersReport]

Copilot AI review requested due to automatic review settings July 1, 2026 11:51
    Summary: Fixing tests and coverage report
    Type: Fix
    Test Plan: UT/CT, Fullstack
    Jira: RDKEMW-17882
@Koky2701 Koky2701 force-pushed the feature/RDKEMW-17882_v2 branch from aa2b391 to d282892 Compare July 2, 2026 08:40
@github-actions

github-actions Bot commented Jul 2, 2026

Copy link
Copy Markdown

Coverage statistics of your commit:
Lines coverage stays unchanged and is: 84.3%
Functions coverage stays unchanged and is: 92.6%

Copilot AI review requested due to automatic review settings July 2, 2026 11:22
@Koky2701 Koky2701 force-pushed the feature/RDKEMW-17882_v2 branch from d282892 to 19ac4d0 Compare July 2, 2026 11:22

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 26 out of 26 changed files in this pull request and generated 3 comments.

Comment thread media/server/gstplayer/source/tasks/generic/SetupElement.cpp
Copilot AI review requested due to automatic review settings July 2, 2026 11:29

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 26 out of 26 changed files in this pull request and generated 5 comments.

Comment thread media/server/gstplayer/include/GenericPlayerContext.h
Comment thread media/server/gstplayer/source/GstGenericPlayer.cpp
Comment thread media/server/gstplayer/source/GstGenericPlayer.cpp Outdated
@Koky2701 Koky2701 force-pushed the feature/RDKEMW-17882_v2 branch from 04c11b0 to e54cbf9 Compare July 2, 2026 11:37
Copilot AI review requested due to automatic review settings July 2, 2026 11:42
@Koky2701 Koky2701 force-pushed the feature/RDKEMW-17882_v2 branch from e54cbf9 to 6960791 Compare July 2, 2026 11:42
@Koky2701 Koky2701 force-pushed the feature/RDKEMW-17882_v2 branch from 6960791 to d282892 Compare July 2, 2026 11:44

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 26 out of 26 changed files in this pull request and generated 5 comments.

Comment thread media/server/gstplayer/include/GenericPlayerContext.h Outdated
Comment thread media/server/gstplayer/source/GstGenericPlayer.cpp
Comment thread media/server/gstplayer/include/IGstGenericPlayerPrivate.h
Comment on lines 20 to +26
#include "ExpectMessage.h"
#include "Matchers.h"
#include "MediaPipelineTest.h"
#include <gst/gst.h>

#include <functional>

Copilot AI review requested due to automatic review settings July 2, 2026 11:47

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 26 out of 26 changed files in this pull request and generated 4 comments.

Comment thread media/server/gstplayer/include/GenericPlayerContext.h
Comment thread media/server/gstplayer/include/IGstGenericPlayerPrivate.h

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 26 out of 26 changed files in this pull request and generated 3 comments.

Comment thread media/server/gstplayer/source/GstGenericPlayer.cpp
Comment thread media/server/gstplayer/source/GstGenericPlayer.cpp Outdated
Comment thread media/server/gstplayer/include/IGstGenericPlayerPrivate.h
@github-actions

github-actions Bot commented Jul 2, 2026

Copy link
Copy Markdown

Coverage statistics of your commit:
Lines coverage stays unchanged and is: 84.3%
Functions coverage stays unchanged and is: 92.7%

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 26 out of 26 changed files in this pull request and generated 11 comments.

Comment thread media/server/gstplayer/source/GstGenericPlayer.cpp
Comment thread media/server/gstplayer/source/GstGenericPlayer.cpp
Comment thread media/server/gstplayer/source/GstGenericPlayer.cpp
Comment thread media/server/gstplayer/source/GstGenericPlayer.cpp
Comment thread media/server/gstplayer/source/GstGenericPlayer.cpp
Comment on lines 83 to 87
if (m_attachedSource->getType() == MediaSourceType::AUDIO)
{
m_context.firstAudioFrameReceived = false;
RIALTO_SERVER_LOG_MIL("Adding Audio appsrc with caps %s", capsStr);
appSrc = m_gstWrapper->gstElementFactoryMake("appsrc", "audsrc");

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.

In one of the comments above there will be a fix for this problem :)

Comment thread media/server/gstplayer/source/tasks/generic/AttachSource.cpp
Comment on lines 115 to +121
void firstVideoFrameReceived()
{
if (!m_firstVideoFrameCallback || !m_firstVideoFrameData)
{
return;
}

@github-actions

github-actions Bot commented Jul 2, 2026

Copy link
Copy Markdown

Coverage statistics of your commit:
Lines coverage stays unchanged and is: 84.3%
Functions coverage stays unchanged and is: 92.7%

Comment thread media/server/gstplayer/include/IGstGenericPlayerPrivate.h
Comment thread media/server/gstplayer/source/tasks/generic/AttachSource.cpp
Comment on lines 83 to 87
if (m_attachedSource->getType() == MediaSourceType::AUDIO)
{
m_context.firstAudioFrameReceived = false;
RIALTO_SERVER_LOG_MIL("Adding Audio appsrc with caps %s", capsStr);
appSrc = m_gstWrapper->gstElementFactoryMake("appsrc", "audsrc");

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.

In one of the comments above there will be a fix for this problem :)

Comment thread media/server/gstplayer/source/tasks/generic/AttachSource.cpp
Comment thread media/server/gstplayer/source/tasks/generic/SetupElement.cpp
Comment thread media/server/gstplayer/source/GstGenericPlayer.cpp
Comment thread media/server/gstplayer/source/GstGenericPlayer.cpp
Comment thread media/server/gstplayer/source/GstGenericPlayer.cpp
Comment thread media/server/gstplayer/source/Utils.cpp
Comment thread media/server/gstplayer/source/Utils.cpp

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 29 out of 29 changed files in this pull request and generated 6 comments.

Comment thread media/server/gstplayer/source/GstGenericPlayer.cpp
Comment thread media/server/gstplayer/source/GstGenericPlayer.cpp
Comment thread media/server/gstplayer/source/GstGenericPlayer.cpp
Comment thread media/server/gstplayer/source/tasks/generic/Stop.cpp
Comment thread media/server/gstplayer/source/tasks/generic/RemoveSource.cpp
Comment thread media/server/gstplayer/source/tasks/generic/AttachSource.cpp
@github-actions

github-actions Bot commented Jul 3, 2026

Copy link
Copy Markdown

Coverage statistics of your commit:
Lines coverage stays unchanged and is: 84.3%
Functions coverage stays unchanged and is: 92.7%

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 29 out of 29 changed files in this pull request and generated 1 comment.

Comment thread media/server/gstplayer/source/GstGenericPlayer.cpp
@github-actions

github-actions Bot commented Jul 3, 2026

Copy link
Copy Markdown

Coverage statistics of your commit:
Lines coverage stays unchanged and is: 84.3%
Functions coverage stays unchanged and is: 92.7%

@github-actions

github-actions Bot commented Jul 3, 2026

Copy link
Copy Markdown

Coverage statistics of your commit:
Lines coverage stays unchanged and is: 84.3%
Functions coverage stays unchanged and is: 92.7%

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