Conversation
|
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
Adds additional logging around buffer underflow notifications across gstplayer → server internal → client pipeline to help trace the underflow notification flow.
Changes:
- Add detailed trace logs in
MediaPipelineServerInternal::notifyBufferUnderflowbefore/after enqueuing and notifying the client. - Add additional logs in
tasks::generic::Underflow::executeto trace underflow gating, streamInfo state, and client notification. - Add logs in client
MediaPipeline::notifyBufferUnderflowaround forwarding to the application client.
Reviewed changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated 7 comments.
| File | Description |
|---|---|
| media/server/main/source/MediaPipelineServerInternal.cpp | Adds trace logging around underflow notification enqueueing and dispatch to the IPC client. |
| media/server/gstplayer/source/tasks/generic/Underflow.cpp | Adds trace logging around underflow detection and notification triggering in the gstplayer task. |
| media/client/main/source/MediaPipeline.cpp | Adds logs when forwarding underflow notifications to the application client. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
You can also share your feedback on Copilot code review. Take the survey.
| StreamInfo &streamInfo = elem->second; | ||
| if (streamInfo.underflowOccured) | ||
| { | ||
| RIALTO_SERVER_LOG_WARN("Underflow OCCURED"); |
There was a problem hiding this comment.
The log message contains a spelling error: "OCCURED" should be "OCCURRED".
| RIALTO_SERVER_LOG_WARN("Underflow OCCURED"); | |
| RIALTO_SERVER_LOG_WARN("Underflow OCCURRED"); |
| @@ -50,15 +51,29 @@ void Underflow::execute() const | |||
| StreamInfo &streamInfo = elem->second; | |||
| if (streamInfo.underflowOccured) | |||
| { | |||
| RIALTO_SERVER_LOG_WARN("Underflow OCCURED"); | |||
| return; | |||
| } | |||
| else | |||
| { | |||
| RIALTO_SERVER_LOG_WARN("Underflow did not occur, should set to true"); | |||
| } | |||
|
|
|||
| streamInfo.underflowOccured = true; | |||
|
|
|||
| if (m_gstPlayerClient) | |||
| { | |||
| RIALTO_SERVER_LOG_WARN("Underflow: Client exists and it is notified"); | |||
| m_gstPlayerClient->notifyBufferUnderflow(m_sourceType); | |||
| } | |||
| else | |||
| { | |||
| RIALTO_SERVER_LOG_WARN("Underflow: Client is not valid"); | |||
| } | |||
There was a problem hiding this comment.
Most of the new logs in Underflow::execute are WARN-level but describe normal control flow (task executing, underflow not enabled, client exists, etc.). Since the underflow task may run repeatedly, this can generate large volumes of WARN logs in normal operation. Consider using DEBUG for flow tracing and reserving WARN for genuine issues (e.g., streamInfo not found, client missing when underflow is enabled).
| } | ||
| else | ||
| { | ||
| RIALTO_SERVER_LOG_WARN("Underflow did not occur, should set to true"); |
There was a problem hiding this comment.
This message is misleading: the branch is entered when underflowOccured is false, but it logs "Underflow did not occur" right before setting underflowOccured = true. Consider rewording to reflect the actual state (e.g., first underflow for this source / marking underflow occurred), otherwise the logs are hard to interpret during debugging.
| RIALTO_SERVER_LOG_WARN("Underflow did not occur, should set to true"); | |
| RIALTO_SERVER_LOG_WARN("Underflow not previously recorded, marking as occurred"); |
| RIALTO_SERVER_LOG_WARN("notifyBufferUnderflow called for source %s", | ||
| common::convertMediaSourceType(mediaSourceType)); | ||
|
|
There was a problem hiding this comment.
PR title/description mention adding debug logs, but most newly added trace messages are logged at WARN level. If the intent is temporary debugging, consider using DEBUG (or gating behind a runtime flag) so these don’t ship as high-severity warnings.
| RIALTO_SERVER_LOG_WARN("MediaPipeline::notifyBufferUnderflow: sending notify underflow"); | ||
| client->notifyBufferUnderflow(sourceId); | ||
| } | ||
| else | ||
| { | ||
| RIALTO_SERVER_LOG_WARN("MediaPipeline::notifyBufferUnderflow: client is invalid"); |
There was a problem hiding this comment.
These new log lines use RIALTO_SERVER_LOG_WARN, but this is client-side code (includes RialtoClientLogging.h) and the rest of this file uses RIALTO_CLIENT_LOG_*. This is likely to misroute logs and may not compile if server logging macros are not available here. Use the client logging macro (RIALTO_CLIENT_LOG_WARN/DEBUG) instead.
| RIALTO_SERVER_LOG_WARN("MediaPipeline::notifyBufferUnderflow: sending notify underflow"); | |
| client->notifyBufferUnderflow(sourceId); | |
| } | |
| else | |
| { | |
| RIALTO_SERVER_LOG_WARN("MediaPipeline::notifyBufferUnderflow: client is invalid"); | |
| RIALTO_CLIENT_LOG_WARN("MediaPipeline::notifyBufferUnderflow: sending notify underflow"); | |
| client->notifyBufferUnderflow(sourceId); | |
| } | |
| else | |
| { | |
| RIALTO_CLIENT_LOG_WARN("MediaPipeline::notifyBufferUnderflow: client is invalid"); |
| if (!m_mediaPipelineClient) | ||
| { | ||
| RIALTO_SERVER_LOG_WARN("notifyBufferUnderflow: m_mediaPipelineClient is NULL"); | ||
| } | ||
| else | ||
| { | ||
| RIALTO_SERVER_LOG_DEBUG("notifyBufferUnderflow: m_mediaPipelineClient is valid"); | ||
| } | ||
|
|
There was a problem hiding this comment.
notifyBufferUnderflow is invoked from the gstplayer worker thread (via the Underflow task) and is expected to just enqueue work onto m_mainThread. The new pre-enqueue m_mediaPipelineClient checks/logs access shared state on the worker thread, which can break the existing thread-confinement pattern used by other notify* methods in this file. Move these client validity logs inside the enqueued task (main thread), or otherwise synchronize access if it must be read on the calling thread.
| if (!m_mediaPipelineClient) | |
| { | |
| RIALTO_SERVER_LOG_WARN("notifyBufferUnderflow: m_mediaPipelineClient is NULL"); | |
| } | |
| else | |
| { | |
| RIALTO_SERVER_LOG_DEBUG("notifyBufferUnderflow: m_mediaPipelineClient is valid"); | |
| } |
| @@ -1590,10 +1603,24 @@ void MediaPipelineServerInternal::notifyBufferUnderflow(MediaSourceType mediaSou | |||
| common::convertMediaSourceType(mediaSourceType)); | |||
| return; | |||
| } | |||
|
|
|||
| RIALTO_SERVER_LOG_WARN("Buffer underflow sending to client, sourceId=%d (%s)", | |||
| kSourceIter->second, | |||
| common::convertMediaSourceType(mediaSourceType)); | |||
|
|
|||
| m_mediaPipelineClient->notifyBufferUnderflow(kSourceIter->second); | |||
|
|
|||
| RIALTO_SERVER_LOG_WARN("Buffer underflow notification SENT to client"); | |||
| } | |||
There was a problem hiding this comment.
Several of these newly added messages are emitted at WARN level even though they are trace-style flow logs (e.g., "called", "task executing", "notification SENT"). Buffer underflow can happen frequently, so WARN-level tracing here is likely to flood production logs and trigger alerting. Consider downgrading these to DEBUG (and keep WARN for actual abnormal/error cases like missing sourceId or null client).
07570f7 to
f0df10f
Compare
|
Coverage statistics of your commit: |
[DO NOT MERGE] adding debug logs