Add support for 'first-audio-frame-callback' signal#552
Conversation
Koky2701
commented
Jun 30, 2026
|
Pull request must be merged with a description containing the required fields, Summary: 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. |
There was a problem hiding this comment.
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.
fe8574e to
11dc49b
Compare
11dc49b to
a4be17b
Compare
a4be17b to
f276929
Compare
|
tests/unittests/media/server/gstplayer/genericPlayer/common/GenericTasksTestsBase.cpp:456:0: style: The function 'expectFirstAudioFrameSignalConnection' is never used. [unusedFunction] |
f276929 to
3dc70f5
Compare
3dc70f5 to
5bef55c
Compare
|
tests/unittests/media/server/gstplayer/genericPlayer/common/GenericTasksTestsBase.cpp:795:0: style: The function 'shouldSetupAudioSinkElementWithPendingLowLatency' is never used. [unusedFunction] |
5bef55c to
e015fde
Compare
e015fde to
ba877b1
Compare
ba877b1 to
a9c8627
Compare
a9c8627 to
3e3e9f1
Compare
|
tests/unittests/media/server/gstplayer/genericPlayer/common/GenericTasksTestsBase.cpp:750:0: style: The function 'shouldSetupAudioDecoderElementWithFirstAudioFrameCallback' is never used. [unusedFunction] |
Summary: Fixing tests and coverage report
Type: Fix
Test Plan: UT/CT, Fullstack
Jira: RDKEMW-17882
aa2b391 to
d282892
Compare
|
Coverage statistics of your commit: |
d282892 to
19ac4d0
Compare
04c11b0 to
e54cbf9
Compare
e54cbf9 to
6960791
Compare
6960791 to
d282892
Compare
| #include "ExpectMessage.h" | ||
| #include "Matchers.h" | ||
| #include "MediaPipelineTest.h" | ||
| #include <gst/gst.h> | ||
|
|
||
| #include <functional> | ||
|
|
|
Coverage statistics of your commit: |
| 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"); |
There was a problem hiding this comment.
In one of the comments above there will be a fix for this problem :)
| void firstVideoFrameReceived() | ||
| { | ||
| if (!m_firstVideoFrameCallback || !m_firstVideoFrameData) | ||
| { | ||
| return; | ||
| } | ||
|
|
|
Coverage statistics of your commit: |
| 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"); |
There was a problem hiding this comment.
In one of the comments above there will be a fix for this problem :)
|
Coverage statistics of your commit: |
|
Coverage statistics of your commit: |
|
Coverage statistics of your commit: |