Skip to content
Open
Show file tree
Hide file tree
Changes from 4 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions media/client/ipc/include/MediaPipelineIpc.h
Original file line number Diff line number Diff line change
Expand Up @@ -93,6 +93,8 @@ class MediaPipelineIpc : public IMediaPipelineIpc, public IpcModule

bool setImmediateOutput(int32_t sourceId, bool immediateOutput) override;

bool setReportDecodeErrors(int32_t sourceId, bool reportDecodeErrors) override;

bool getImmediateOutput(int32_t sourceId, bool &immediateOutput) override;

bool getStats(int32_t sourceId, uint64_t &renderedFrames, uint64_t &droppedFrames) override;
Expand Down
12 changes: 12 additions & 0 deletions media/client/ipc/interface/IMediaPipelineIpc.h
Original file line number Diff line number Diff line change
Expand Up @@ -188,6 +188,18 @@ class IMediaPipelineIpc
*/
virtual bool setImmediateOutput(int32_t sourceId, bool immediateOutput) = 0;

/**
* @brief Sets the "Report Decode Errors" property for this source.
*
* This method is asynchronous, it will set the "Report Decode Errors" property
*
* @param[in] sourceId : The source id. Value should be set to the MediaSource.id returned after attachSource()
* @param[in] immediateOutput : Set Report Decode Errors mode on the sink
Copy link

Copilot AI Jan 28, 2026

Choose a reason for hiding this comment

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

The parameter name in the documentation is incorrect. It should be "reportDecodeErrors" instead of "immediateOutput" to match the actual parameter name.

Suggested change
* @param[in] immediateOutput : Set Report Decode Errors mode on the sink
* @param[in] reportDecodeErrors : Set Report Decode Errors mode on the sink

Copilot uses AI. Check for mistakes.
*
* @retval true on success.
*/
virtual bool setReportDecodeErrors(int32_t sourceId, bool reportDecodeErrors) = 0;

/**
* @brief Gets the "Immediate Output" property for this source.
*
Expand Down
32 changes: 32 additions & 0 deletions media/client/ipc/source/MediaPipelineIpc.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -567,6 +567,38 @@ bool MediaPipelineIpc::setImmediateOutput(int32_t sourceId, bool immediateOutput
return true;
}

bool MediaPipelineIpc::setReportDecodeErrors(int32_t sourceId, bool reportDecodeErrors)
{
if (!reattachChannelIfRequired())
{
RIALTO_CLIENT_LOG_ERROR("Reattachment of the ipc channel failed, ipc disconnected");
return false;
}

firebolt::rialto::ReportDecodeErrorsRequest request;

request.set_session_id(m_sessionId);
request.set_source_id(sourceId);
request.set_report_decode_errors(reportDecodeErrors);

firebolt::rialto::ReportDecodeErrorsResponse response;
auto ipcController = m_ipc.createRpcController();
auto blockingClosure = m_ipc.createBlockingClosure();
m_mediaPipelineStub->setReportDecodeErrors(ipcController.get(), &request, &response, blockingClosure.get());

// wait for the call to complete
blockingClosure->wait();

// check the result
if (ipcController->Failed())
{
RIALTO_CLIENT_LOG_ERROR("failed to set report decode error due to '%s'", ipcController->ErrorText().c_str());
return false;
}

return true;
}
Comment on lines +570 to +600
Copy link

Copilot AI Feb 3, 2026

Choose a reason for hiding this comment

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

The new setReportDecodeErrors method is missing unit test coverage. Test files should be added similar to SetImmediateOutputTest.cpp to verify success, failure, channel disconnection, and reconnection scenarios.

Copilot uses AI. Check for mistakes.

bool MediaPipelineIpc::getImmediateOutput(int32_t sourceId, bool &immediateOutput)
{
if (!reattachChannelIfRequired())
Expand Down
2 changes: 2 additions & 0 deletions media/client/main/include/MediaPipeline.h
Original file line number Diff line number Diff line change
Expand Up @@ -132,6 +132,8 @@ class MediaPipeline : public IMediaPipelineAndIControlClient, public IMediaPipel

bool setImmediateOutput(int32_t sourceId, bool immediateOutput) override;

bool setReportDecodeErrors(int32_t sourceId, bool reportDecodeErrors) override;

bool getImmediateOutput(int32_t sourceId, bool &immediateOutput) override;

bool getStats(int32_t sourceId, uint64_t &renderedFrames, uint64_t &droppedFrames) override;
Expand Down
4 changes: 4 additions & 0 deletions media/client/main/include/MediaPipelineProxy.h
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,10 @@ class MediaPipelineProxy : public IMediaPipelineAndIControlClient
{
return m_mediaPipeline->setImmediateOutput(sourceId, immediateOutput);
}
bool setReportDecodeErrors(int32_t sourceId, bool reportDecodeErrors)
{
return m_mediaPipeline->setReportDecodeErrors(sourceId, reportDecodeErrors);
}
bool getImmediateOutput(int32_t sourceId, bool &immediateOutput)
{
return m_mediaPipeline->getImmediateOutput(sourceId, immediateOutput);
Expand Down
5 changes: 5 additions & 0 deletions media/client/main/source/MediaPipeline.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -313,6 +313,11 @@ bool MediaPipeline::setImmediateOutput(int32_t sourceId, bool immediateOutput)
return m_mediaPipelineIpc->setImmediateOutput(sourceId, immediateOutput);
}

bool MediaPipeline::setReportDecodeErrors(int32_t sourceId, bool reportDecodeErrors)
{
return m_mediaPipelineIpc->setReportDecodeErrors(sourceId, reportDecodeErrors);
}

bool MediaPipeline::getImmediateOutput(int32_t sourceId, bool &immediateOutput)
{
return m_mediaPipelineIpc->getImmediateOutput(sourceId, immediateOutput);
Expand Down
12 changes: 12 additions & 0 deletions media/public/include/IMediaPipeline.h
Original file line number Diff line number Diff line change
Expand Up @@ -1227,6 +1227,18 @@ class IMediaPipeline
*/
virtual bool setImmediateOutput(int32_t sourceId, bool immediateOutput) = 0;

/**
* @brief Sets the "Report Decode Errors" property for this source.
*
* This method is asynchronous, it will set the "Report Decode Errors" property
*
* @param[in] sourceId : The source id. Value should be set to the MediaSource.id returned after attachSource()
* @param[in] immediateOutput : Set Report Decode Errors mode on the sink
Copy link

Copilot AI Jan 28, 2026

Choose a reason for hiding this comment

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

The parameter name in the documentation is incorrect. It should be "reportDecodeErrors" instead of "immediateOutput" to match the actual parameter name.

Suggested change
* @param[in] immediateOutput : Set Report Decode Errors mode on the sink
* @param[in] reportDecodeErrors : Set Report Decode Errors mode on the sink

Copilot uses AI. Check for mistakes.
*
* @retval true on success.
*/
virtual bool setReportDecodeErrors(int32_t sourceId, bool reportDecodeErrors) = 0;

/**
* @brief Gets the "Immediate Output" property for this source.
*
Expand Down
1 change: 1 addition & 0 deletions media/server/gstplayer/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,7 @@ add_library(
source/tasks/generic/SetMute.cpp
source/tasks/generic/SetPlaybackRate.cpp
source/tasks/generic/SetPosition.cpp
source/tasks/generic/SetReportDecodeErrors.cpp
source/tasks/generic/SetSourcePosition.cpp
source/tasks/generic/SetSubtitleOffset.cpp
source/tasks/generic/SetStreamSyncMode.cpp
Expand Down
2 changes: 2 additions & 0 deletions media/server/gstplayer/include/GstGenericPlayer.h
Original file line number Diff line number Diff line change
Expand Up @@ -120,6 +120,7 @@ class GstGenericPlayer : public IGstGenericPlayer, public IGstGenericPlayerPriva
void setPlaybackRate(double rate) override;
bool getPosition(std::int64_t &position) override;
bool setImmediateOutput(const MediaSourceType &mediaSourceType, bool immediateOutput) override;
bool setReportDecodeErrors(const MediaSourceType &mediaSourceType, bool reportDecodeErrors) override;
bool getImmediateOutput(const MediaSourceType &mediaSourceType, bool &immediateOutput) override;
bool getStats(const MediaSourceType &mediaSourceType, uint64_t &renderedFrames, uint64_t &droppedFrames) override;
void setVolume(double targetVolume, uint32_t volumeDuration, firebolt::rialto::EaseType easeType) override;
Expand Down Expand Up @@ -154,6 +155,7 @@ class GstGenericPlayer : public IGstGenericPlayer, public IGstGenericPlayerPriva
void scheduleAllSourcesAttached() override;
bool setVideoSinkRectangle() override;
bool setImmediateOutput() override;
bool setReportDecodeErrors(bool reportDecodeErrors) override;
bool setShowVideoWindow() override;
bool setLowLatency() override;
bool setSync() override;
Expand Down
7 changes: 7 additions & 0 deletions media/server/gstplayer/include/IGstGenericPlayerPrivate.h
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,13 @@ class IGstGenericPlayerPrivate
*/
virtual bool setImmediateOutput() = 0;

/**
* @brief Sets report decode error. Called by the worker thread.
*
* @retval true on success.
*/
virtual bool setReportDecodeErrors(bool reportDecodeErrors) = 0;

/**
* @brief Sets the low latency property. Called by the worker thread.
*
Expand Down
15 changes: 15 additions & 0 deletions media/server/gstplayer/include/tasks/IGenericPlayerTaskFactory.h
Original file line number Diff line number Diff line change
Expand Up @@ -494,6 +494,21 @@ class IGenericPlayerTaskFactory
const firebolt::rialto::MediaSourceType &type,
bool immediateOutput) const = 0;

/**
* @brief Creates a setReportDecodeErrors task.
*
* @param[in] context : The GstPlayer context
* @param[in] player : The GstPlayer instance
* @param[in] type : The media source type
* @param[in] immediateOutput : the value to set for report decode error
Copy link

Copilot AI Jan 28, 2026

Choose a reason for hiding this comment

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

The parameter name in the documentation is incorrect. It should be "reportDecodeErrors" instead of "immediateOutput" to match the actual parameter name.

Suggested change
* @param[in] context : The GstPlayer context
* @param[in] player : The GstPlayer instance
* @param[in] type : The media source type
* @param[in] immediateOutput : the value to set for report decode error
* @param[in] context : The GstPlayer context
* @param[in] player : The GstPlayer instance
* @param[in] type : The media source type
* @param[in] reportDecodeErrors: the value to set for report decode errors

Copilot uses AI. Check for mistakes.
*
* @retval the new ProcessAudioGap task instance.
Copy link

Copilot AI Jan 28, 2026

Choose a reason for hiding this comment

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

The return value documentation is incorrect. It should describe what task instance is being returned (SetReportDecodeErrors task) rather than stating "the new ProcessAudioGap task instance". This appears to be copy-pasted from another method without being updated.

Suggested change
* @brief Creates a setReportDecodeErrors task.
*
* @param[in] context : The GstPlayer context
* @param[in] player : The GstPlayer instance
* @param[in] type : The media source type
* @param[in] immediateOutput : the value to set for report decode error
*
* @retval the new ProcessAudioGap task instance.
* @brief Creates a SetReportDecodeErrors task.
*
* @param[in] context : The GstPlayer context
* @param[in] player : The GstPlayer instance
* @param[in] type : The media source type
* @param[in] reportDecodeErrors: the value to set for report decode errors
*
* @retval the new SetReportDecodeErrors task instance.

Copilot uses AI. Check for mistakes.
*/
virtual std::unique_ptr<IPlayerTask> createSetReportDecodeErrors(GenericPlayerContext &context,
IGstGenericPlayerPrivate &player,
const firebolt::rialto::MediaSourceType &type,
bool reportDecodeErrors) const = 0;

/**
* @brief Creates a SetBufferingLimit task.
*
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -122,6 +122,9 @@ class GenericPlayerTaskFactory : public IGenericPlayerTaskFactory
std::unique_ptr<IPlayerTask> createSetImmediateOutput(GenericPlayerContext &context, IGstGenericPlayerPrivate &player,
const firebolt::rialto::MediaSourceType &type,
bool immediateOutput) const override;
std::unique_ptr<IPlayerTask> createSetReportDecodeErrors(GenericPlayerContext &context, IGstGenericPlayerPrivate &player,
const firebolt::rialto::MediaSourceType &type,
bool reportDecodeErrors) const override;
std::unique_ptr<IPlayerTask> createSetBufferingLimit(GenericPlayerContext &context, IGstGenericPlayerPrivate &player,
std::uint32_t limit) const override;
std::unique_ptr<IPlayerTask> createSetUseBuffering(GenericPlayerContext &context, IGstGenericPlayerPrivate &player,
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
/*
* If not stated otherwise in this file or this component's LICENSE file the
* following copyright and licenses apply:
*
* Copyright 2024 Sky UK
Copy link

Copilot AI Feb 11, 2026

Choose a reason for hiding this comment

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

Copyright year is incorrect. This file was created in 2025, but the copyright shows 2024. It should be "Copyright 2025 Sky UK" to match other new files in this PR like SetReportDecodeErrorsTest.cpp.

Suggested change
* Copyright 2024 Sky UK
* Copyright 2025 Sky UK

Copilot uses AI. Check for mistakes.
Copy link

Copilot AI Feb 13, 2026

Choose a reason for hiding this comment

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

The copyright year should be 2025, not 2024. This is inconsistent with other new files in this PR which use 2025.

Suggested change
* Copyright 2024 Sky UK
* Copyright 2025 Sky UK

Copilot uses AI. Check for mistakes.
Copy link
Contributor

Choose a reason for hiding this comment

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

wrong year

*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
Copy link

Copilot AI Feb 11, 2026

Choose a reason for hiding this comment

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

The copyright year is 2024, but other new files in this PR use 2026. This should be updated to 2026 for consistency with files like SetReportDecodeErrorsTest.cpp.

Suggested change
* Copyright 2024 Sky UK
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* Copyright 2026 Sky UK
*
* Licensed under the Apache License, Version 2.0 (the "License");
* You may not use this file except in compliance with the License.

Copilot uses AI. Check for mistakes.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/

#ifndef FIREBOLT_RIALTO_SERVER_TASKS_GENERIC_SET_REPORT_DECODE_ERROR_H_
#define FIREBOLT_RIALTO_SERVER_TASKS_GENERIC_SET_REPORT_DECODE_ERROR_H_
Copy link

Copilot AI Jan 28, 2026

Choose a reason for hiding this comment

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

The header guard name is inconsistent. It uses "SET_REPORT_DECODE_ERROR_H_" (singular) but should be "SET_REPORT_DECODE_ERRORS_H_" (plural) to match the class name SetReportDecodeErrors and follow the naming convention seen in other files.

Copilot uses AI. Check for mistakes.

#include "GenericPlayerContext.h"
#include "IGlibWrapper.h"
#include "IGstGenericPlayerPrivate.h"
#include "IGstWrapper.h"
#include "IPlayerTask.h"

#include <memory>

namespace firebolt::rialto::server::tasks::generic
{
class SetReportDecodeErrors : public IPlayerTask
{
public:
explicit SetReportDecodeErrors(GenericPlayerContext &context, IGstGenericPlayerPrivate &player,
const MediaSourceType &type, bool reportDecodeErrors);
~SetReportDecodeErrors() override;
void execute() const override;

private:
GenericPlayerContext &m_context;
IGstGenericPlayerPrivate &m_player;
const MediaSourceType m_type;
bool m_reportDecodeErrors;
};
} // namespace firebolt::rialto::server::tasks::generic

#endif // FIREBOLT_RIALTO_SERVER_TASKS_GENERIC_SET_REPORT_DECODE_ERROR_H_
Copy link

Copilot AI Jan 28, 2026

Choose a reason for hiding this comment

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

The header guard name is inconsistent. It uses "SET_REPORT_DECODE_ERROR_H_" (singular) but should be "SET_REPORT_DECODE_ERRORS_H_" (plural) to match the class name SetReportDecodeErrors and follow the naming convention seen in other files.

Copilot uses AI. Check for mistakes.
10 changes: 10 additions & 0 deletions media/server/gstplayer/interface/IGstGenericPlayer.h
Original file line number Diff line number Diff line change
Expand Up @@ -204,6 +204,16 @@ class IGstGenericPlayer
*/
virtual bool setImmediateOutput(const MediaSourceType &mediaSourceType, bool immediateOutput) = 0;

/**
* @brief Sets the "Report Decode Error" property for this source.
*
* @param[in] mediaSourceType : The media source type
* @param[in] reportDecodeErrors : Set report decode error
*
* @retval true on success.
*/
virtual bool setReportDecodeErrors(const MediaSourceType &mediaSourceType, bool reportDecodeErrors) = 0;

/**
* @brief Gets the "Immediate Output" property for this source.
*
Expand Down
37 changes: 37 additions & 0 deletions media/server/gstplayer/source/GstGenericPlayer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -654,6 +654,16 @@ bool GstGenericPlayer::setImmediateOutput(const MediaSourceType &mediaSourceType
return true;
}

bool GstGenericPlayer::setReportDecodeErrors(const MediaSourceType &mediaSourceType, bool reportDecodeErrors)
{
if (!m_workerThread)
return false;

m_workerThread->enqueueTask(
m_taskFactory->createSetReportDecodeErrors(m_context, *this, mediaSourceType, reportDecodeErrors));
return true;
}

bool GstGenericPlayer::getImmediateOutput(const MediaSourceType &mediaSourceType, bool &immediateOutputRef)
{
bool returnValue{false};
Expand Down Expand Up @@ -1360,6 +1370,33 @@ bool GstGenericPlayer::setImmediateOutput()
return result;
}

bool GstGenericPlayer::setReportDecodeErrors(bool reportDecodeErrors)
{
bool result{false};
GstElement *decoder = getDecoder(MediaSourceType::VIDEO);
Copy link

Copilot AI Feb 3, 2026

Choose a reason for hiding this comment

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

The implementation hardcodes MediaSourceType::VIDEO, but the public API accepts a mediaSourceType parameter. This creates an inconsistency where the caller can specify any source type, but it will always be applied to the VIDEO decoder. Either the implementation should respect the mediaSourceType parameter, or the API should not accept it at all.

Suggested change
bool GstGenericPlayer::setReportDecodeErrors(bool reportDecodeErrors)
{
bool result{false};
GstElement *decoder = getDecoder(MediaSourceType::VIDEO);
bool GstGenericPlayer::setReportDecodeErrors(MediaSourceType mediaSourceType, bool reportDecodeErrors)
{
bool result{false};
GstElement *decoder = getDecoder(mediaSourceType);

Copilot uses AI. Check for mistakes.
Copy link

Copilot AI Feb 20, 2026

Choose a reason for hiding this comment

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

The PR description mentions "report_decode_errors property missing from RialtoMSEVideoSink" which suggests this property should be on the video sink. However, the implementation sets this property on the video decoder (via getDecoder(MediaSourceType::VIDEO) in GstGenericPlayer.cpp line 1394), not the sink. This creates confusion about where the property actually belongs. Please verify whether the property should be on the decoder or the sink, and update either the PR description or the implementation accordingly.

Copilot uses AI. Check for mistakes.
if (decoder)
{
RIALTO_SERVER_LOG_DEBUG("Set report decode errors to %s", reportDecodeErrors ? "TRUE" : "FALSE");

if (m_glibWrapper->gObjectClassFindProperty(G_OBJECT_GET_CLASS(decoder), "report_decode_errors"))
{
gboolean reportDecodeErrorsGboolean{reportDecodeErrors ? TRUE : FALSE};
m_glibWrapper->gObjectSet(decoder, "report_decode_errors", reportDecodeErrorsGboolean, nullptr);
result = true;
}
else
{
RIALTO_SERVER_LOG_ERROR("Failed to set report_decode_errors property on decoder '%s'", GST_ELEMENT_NAME(decoder));
}
m_gstWrapper->gstObjectUnref(decoder);
}
else
{
RIALTO_SERVER_LOG_DEBUG("Pending an report_decode_errors, decoder is NULL");
Copy link

Copilot AI Jan 28, 2026

Choose a reason for hiding this comment

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

Grammar error in the log message. It should be "Pending a report_decode_errors" instead of "Pending an report_decode_errors" since "report" starts with a consonant sound.

Suggested change
RIALTO_SERVER_LOG_DEBUG("Pending an report_decode_errors, decoder is NULL");
RIALTO_SERVER_LOG_DEBUG("Pending a report_decode_errors, decoder is NULL");

Copilot uses AI. Check for mistakes.
}
return result;
}

bool GstGenericPlayer::setShowVideoWindow()
{
if (!m_context.pendingShowVideoWindow.has_value())
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@
#include "tasks/generic/ReportPosition.h"
#include "tasks/generic/SetBufferingLimit.h"
#include "tasks/generic/SetImmediateOutput.h"
#include "tasks/generic/SetReportDecodeErrors.h"
#include "tasks/generic/SetLowLatency.h"
#include "tasks/generic/SetMute.h"
#include "tasks/generic/SetPlaybackRate.h"
Expand Down Expand Up @@ -334,6 +335,14 @@ GenericPlayerTaskFactory::createSetImmediateOutput(GenericPlayerContext &context
return std::make_unique<tasks::generic::SetImmediateOutput>(context, player, type, immediateOutput);
}

std::unique_ptr<IPlayerTask>
GenericPlayerTaskFactory::createSetReportDecodeErrors(GenericPlayerContext &context, IGstGenericPlayerPrivate &player,
const firebolt::rialto::MediaSourceType &type,
bool reportDecodeErrors) const
{
return std::make_unique<tasks::generic::SetReportDecodeErrors>(context, player, type, reportDecodeErrors);
}

std::unique_ptr<IPlayerTask> GenericPlayerTaskFactory::createSetBufferingLimit(GenericPlayerContext &context,
IGstGenericPlayerPrivate &player,
std::uint32_t limit) const
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
/*
* If not stated otherwise in this file or this component's LICENSE file the
* following copyright and licenses apply:
*
* Copyright 2024 Sky UK
Copy link

Copilot AI Feb 11, 2026

Choose a reason for hiding this comment

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

Copyright year is incorrect. This file was created in 2025 (as indicated by the test plan summary and Jira reference RDKEMW-12692), but the copyright shows 2024. It should be "Copyright 2025 Sky UK" to be consistent with other new files in this PR.

Suggested change
* Copyright 2024 Sky UK
* Copyright 2025 Sky UK

Copilot uses AI. Check for mistakes.
Copy link

Copilot AI Feb 12, 2026

Choose a reason for hiding this comment

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

The copyright year should be 2025 to match the PR creation date and the pattern used in other new files in this PR (like SetReportDecodeErrorsTest.cpp). Using 2024 is inconsistent.

Suggested change
* Copyright 2024 Sky UK
* Copyright 2025 Sky UK

Copilot uses AI. Check for mistakes.
Copy link

Copilot AI Feb 13, 2026

Choose a reason for hiding this comment

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

The copyright year should be 2025, not 2024. This is inconsistent with other new files in this PR which use 2025.

Suggested change
* Copyright 2024 Sky UK
* Copyright 2025 Sky UK

Copilot uses AI. Check for mistakes.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
Comment on lines +5 to +8
Copy link

Copilot AI Feb 11, 2026

Choose a reason for hiding this comment

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

The copyright year is 2024, but other new files in this PR use 2026. This should be updated to 2026 for consistency with files like SetReportDecodeErrorsTest.cpp.

Suggested change
* Copyright 2024 Sky UK
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* Copyright 2026 Sky UK
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may use this file except in compliance with the License.

Copilot uses AI. Check for mistakes.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/

#include "SetReportDecodeErrors.h"
#include "RialtoServerLogging.h"
#include "TypeConverters.h"

namespace firebolt::rialto::server::tasks::generic
{
SetReportDecodeErrors::SetReportDecodeErrors(GenericPlayerContext &context, IGstGenericPlayerPrivate &player,
const MediaSourceType &type, bool reportDecodeErrors)
: m_context{context}, m_player(player), m_type{type}, m_reportDecodeErrors{reportDecodeErrors}
{
RIALTO_SERVER_LOG_DEBUG("Constructing SetReportDecodeErrors");
}

SetReportDecodeErrors::~SetReportDecodeErrors()
{
RIALTO_SERVER_LOG_DEBUG("SetReportDecodeErrors finished");
}

void SetReportDecodeErrors::execute() const
{
RIALTO_SERVER_LOG_DEBUG("Executing SetReportDecodeErrors for %s source", common::convertMediaSourceType(m_type));

if (m_type != MediaSourceType::VIDEO)
Copy link
Contributor

Choose a reason for hiding this comment

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

Do we actually need MediaSourceType in such case? If we will need to expand to audio in the future, we will just expand the API.

{
RIALTO_SERVER_LOG_ERROR("SetReportDecodeErrors not currently supported for non-video");
}

if (m_context.pipeline)
Copy link
Contributor

Choose a reason for hiding this comment

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

I think it's not correct and should be !m_context.pipeline. The log should be on WARN level.

{
m_player.setReportDecodeErrors(m_reportDecodeErrors);
}
Copy link

Copilot AI Jan 28, 2026

Choose a reason for hiding this comment

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

The function logs an error when the media source type is not VIDEO but continues execution and calls m_player.setReportDecodeErrors anyway. This appears to be a logic error. If the feature is not supported for non-video sources, the function should return early after logging the error, similar to how validation is typically handled.

Copilot uses AI. Check for mistakes.
Copy link

Copilot AI Feb 3, 2026

Choose a reason for hiding this comment

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

The implementation doesn't check if the type is VIDEO (like SetImmediateOutput does for its type parameter), and directly calls setReportDecodeErrors without storing it in a pending variable. This is inconsistent with the SetImmediateOutput task pattern. If report_decode_errors is only applicable to VIDEO sources, this should be validated. Additionally, if the decoder is not yet available when this is called, there's no pending mechanism to retry later, unlike the immediate-output property which uses pendingImmediateOutputForVideo.

Suggested change
if (m_context.pipeline)
{
m_player.setReportDecodeErrors(m_reportDecodeErrors);
}
// report_decode_errors is only applicable to VIDEO sources, mirror SetImmediateOutput pattern
if (m_type != MediaSourceType::VIDEO)
{
RIALTO_SERVER_LOG_WARN("SetReportDecodeErrors ignored for non-video source type: %s",
common::convertMediaSourceType(m_type));
return;
}
if (!m_context.pipeline)
{
RIALTO_SERVER_LOG_DEBUG("Pipeline not available yet - cannot apply report-decode-errors setting");
return;
}
m_player.setReportDecodeErrors(m_reportDecodeErrors);

Copilot uses AI. Check for mistakes.
}
} // namespace firebolt::rialto::server::tasks::generic
Comment on lines 1 to 52
Copy link

Copilot AI Feb 3, 2026

Choose a reason for hiding this comment

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

The new SetReportDecodeErrors task is missing unit test coverage. A test file should be added similar to SetImmediateOutputTest.cpp to verify the task's behavior.

Copilot uses AI. Check for mistakes.
4 changes: 4 additions & 0 deletions media/server/ipc/include/MediaPipelineModuleService.h
Original file line number Diff line number Diff line change
Expand Up @@ -88,6 +88,10 @@ class MediaPipelineModuleService : public IMediaPipelineModuleService
const ::firebolt::rialto::SetImmediateOutputRequest *request,
::firebolt::rialto::SetImmediateOutputResponse *response,
::google::protobuf::Closure *done) override;
void setReportDecodeErrors(::google::protobuf::RpcController *controller,
const ::firebolt::rialto::ReportDecodeErrorsRequest *request,
::firebolt::rialto::ReportDecodeErrorsResponse *response,
::google::protobuf::Closure *done) override;
void getImmediateOutput(::google::protobuf::RpcController *controller,
const ::firebolt::rialto::GetImmediateOutputRequest *request,
::firebolt::rialto::GetImmediateOutputResponse *response,
Expand Down
Loading
Loading