Skip to content
Open
Show file tree
Hide file tree
Changes from 13 commits
Commits
Show all changes
24 commits
Select commit Hold shift + click to select a range
4d930b2
Changed Wayland Display for TextTrack (#434)
aczs Jan 14, 2026
6a01b68
Removed gstreamer interaction during RemoveSource (#445)
aczs Feb 13, 2026
c960761
Allow to switch audio codec, when audio is re-attached (#448)
skywojciechowskim Feb 18, 2026
654c3a2
Asure correct data & flush order during multiple flushes (#466)
skywojciechowskim Mar 19, 2026
41507fa
Removed blocking get_state calls from aml codec switch (#480)
smudri85 Apr 15, 2026
cad26f1
Fixed initialisation of playbackGroup elements in GenericPlayerContex…
skywojciechowskim Apr 20, 2026
ae413b0
Do not treat server as deadlocked when outdated acks are received (#495)
skywojciechowskim May 8, 2026
84496a2
HDCP retry to rialto
Lekshmi-Mohan533 May 20, 2026
31c94c5
Adding dlopen()
Lekshmi-Mohan533 May 20, 2026
1467ce8
More logging for keyStatus
Lekshmi-Mohan533 May 20, 2026
ffee15b
Update MediaKeysServerInternal.cpp
balasaraswathy-n May 21, 2026
881e843
Revert interval time changes
Lekshmi-Mohan533 May 21, 2026
f9fd54a
Reverting the interval change
Lekshmi-Mohan533 May 21, 2026
c60ab3c
Increase the priority of ping routine
Lekshmi-Mohan533 May 22, 2026
004ba6d
Update MediaKeysServerInternal.cpp
varatharajan568 May 22, 2026
06af362
Update MediaKeysServerInternal.cpp
varatharajan568 May 22, 2026
d831226
Comment the mutex for ping
Lekshmi-Mohan533 May 22, 2026
7f1c8ef
Uncommenting the mutex with ping
Lekshmi-Mohan533 May 22, 2026
88573ba
Commenting the mutex with ping
Lekshmi-Mohan533 May 22, 2026
e0a350d
Handling ping and decrypt with rialto
Lekshmi-Mohan533 May 22, 2026
acce42d
Handling corner cases especially crash
Lekshmi-Mohan533 May 22, 2026
bca5ce1
Update OcdmSession.cpp
balasaraswathy-n May 25, 2026
9574d44
Update MediaKeysServerInternal.cpp
balasaraswathy-n May 25, 2026
a483e98
Update MediaKeysServerInternal.cpp
balasaraswathy-n May 25, 2026
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: 1 addition & 1 deletion media/client/ipc/include/MediaPipelineIpc.h
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ class MediaPipelineIpc : public IMediaPipelineIpc, public IpcModule

bool setVideoWindow(uint32_t x, uint32_t y, uint32_t width, uint32_t height) override;

bool play() override;
bool play(bool &async) override;

bool pause() override;

Expand Down
4 changes: 3 additions & 1 deletion media/client/ipc/interface/IMediaPipelineIpc.h
Original file line number Diff line number Diff line change
Expand Up @@ -126,9 +126,11 @@ class IMediaPipelineIpc
/**
* @brief Request play on the playback session.
*
* @param[out] async : True if play method call is asynchronous
*
* @retval true on success.
*/
virtual bool play() = 0;
virtual bool play(bool &async) = 0;

/**
* @brief Request pause on the playback session.
Expand Down
7 changes: 6 additions & 1 deletion media/client/ipc/source/MediaKeysIpc.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -123,6 +123,10 @@ const char *toString(const firebolt::rialto::MediaKeyErrorStatus &errorStatus)
{
return "FAIL";
}
case firebolt::rialto::MediaKeyErrorStatus::OUTPUT_RESTRICTED:
{
return "OUTPUT_RESTRICTED";
}
}
return "UNKNOWN";
}
Expand Down Expand Up @@ -334,7 +338,7 @@ bool MediaKeysIpc::containsKey(int32_t keySessionId, const std::vector<uint8_t>
}

MediaKeyErrorStatus MediaKeysIpc::createKeySession(KeySessionType sessionType, std::weak_ptr<IMediaKeysClient> client,
bool isLDL, int32_t &keySessionId)
bool isLDL, int32_t &keySessionId)
{
if (!reattachChannelIfRequired())
{
Expand Down Expand Up @@ -415,6 +419,7 @@ MediaKeyErrorStatus MediaKeysIpc::generateRequest(int32_t keySessionId, InitData
break;
}


firebolt::rialto::GenerateRequestRequest request;
request.set_media_keys_handle(m_mediaKeysHandle);
request.set_key_session_id(keySessionId);
Expand Down
4 changes: 3 additions & 1 deletion media/client/ipc/source/MediaPipelineIpc.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -348,7 +348,7 @@ bool MediaPipelineIpc::setVideoWindow(uint32_t x, uint32_t y, uint32_t width, ui
return true;
}

bool MediaPipelineIpc::play()
bool MediaPipelineIpc::play(bool &async)
{
if (!reattachChannelIfRequired())
{
Expand All @@ -375,6 +375,8 @@ bool MediaPipelineIpc::play()
return false;
}

async = response.async();

return true;
}

Expand Down
2 changes: 1 addition & 1 deletion media/client/main/include/MediaPipeline.h
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,7 @@ class MediaPipeline : public IMediaPipelineAndIControlClient, public IMediaPipel

bool allSourcesAttached() override;

bool play() override;
bool play(bool &async) override;

bool pause() override;

Expand Down
2 changes: 1 addition & 1 deletion media/client/main/include/MediaPipelineProxy.h
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ class MediaPipelineProxy : public IMediaPipelineAndIControlClient

bool allSourcesAttached() override { return m_mediaPipeline->allSourcesAttached(); }

bool play() override { return m_mediaPipeline->play(); }
bool play(bool &async) override { return m_mediaPipeline->play(async); }

bool pause() override { return m_mediaPipeline->pause(); }

Expand Down
4 changes: 2 additions & 2 deletions media/client/main/source/MediaPipeline.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -252,11 +252,11 @@ bool MediaPipeline::allSourcesAttached()
return m_mediaPipelineIpc->allSourcesAttached();
}

bool MediaPipeline::play()
bool MediaPipeline::play(bool &async)
{
RIALTO_CLIENT_LOG_DEBUG("entry:");

return m_mediaPipelineIpc->play();
return m_mediaPipelineIpc->play(async);
}

bool MediaPipeline::pause()
Expand Down
7 changes: 3 additions & 4 deletions media/public/include/IMediaPipeline.h
Original file line number Diff line number Diff line change
Expand Up @@ -1119,16 +1119,15 @@ class IMediaPipeline
/**
* @brief Starts playback of the media.
*
* This method is considered to be asynchronous and MUST NOT block
* but should request playback and then return.
*
* Once the backend is successfully playing it should notify the
* media player client of playback state
* IMediaPipelineClient::PlaybackState::PLAYING.
*
* @param[out] async : True if play method call is asynchronous
*
* @retval true on success.
*/
virtual bool play() = 0;
virtual bool play(bool &async) = 0;

/**
* @brief Pauses playback of the media.
Expand Down
4 changes: 3 additions & 1 deletion media/public/include/MediaCommon.h
Original file line number Diff line number Diff line change
Expand Up @@ -292,7 +292,8 @@ enum class MediaKeyErrorStatus
NOT_SUPPORTED, /**< The request parameters are not supported. */
INVALID_STATE, /**< The object is in an invalid state for the operation. */
INTERFACE_NOT_IMPLEMENTED, /**< The interface is not implemented. */
BUFFER_TOO_SMALL /**< The size of the buffer is too small. */
BUFFER_TOO_SMALL, /**< The size of the buffer is too small. */
OUTPUT_RESTRICTED
Comment on lines +295 to +296
};

/**
Expand Down Expand Up @@ -473,6 +474,7 @@ struct PlaybackInfo
int64_t currentPosition{-1}; /**< The current playback position */
double volume{1.0}; /**< The current volume */
};

} // namespace firebolt::rialto

#endif // FIREBOLT_RIALTO_MEDIA_COMMON_H_
1 change: 0 additions & 1 deletion media/server/gstplayer/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,6 @@ add_library(
source/tasks/generic/Play.cpp
source/tasks/generic/ProcessAudioGap.cpp
source/tasks/generic/ReadShmDataAndAttachSamples.cpp
source/tasks/generic/RemoveSource.cpp
source/tasks/generic/RenderFrame.cpp
source/tasks/generic/ReportPosition.cpp
source/tasks/generic/SetBufferingLimit.cpp
Expand Down
10 changes: 7 additions & 3 deletions media/server/gstplayer/include/FlushOnPrerollController.h
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@
#define FIREBOLT_RIALTO_SERVER_FLUSH_ONPREROLL_CONTROLLER_H_

#include "IFlushOnPrerollController.h"
#include <condition_variable>
#include <mutex>
#include <optional>
#include <set>
Expand All @@ -37,13 +38,16 @@ class FlushOnPrerollController : public IFlushOnPrerollController
FlushOnPrerollController() = default;
~FlushOnPrerollController() override = default;

bool shouldPostponeFlush(const MediaSourceType &type) const override;
void setFlushing(const MediaSourceType &type, const GstState &currentPipelineState) override;
void waitIfRequired(const MediaSourceType &type) override;
void setFlushing(const MediaSourceType &type) override;
void setPrerolling() override;
void stateReached(const GstState &newPipelineState) override;
void setTargetState(const GstState &state) override;
void reset() override;

private:
mutable std::mutex m_mutex{};
std::mutex m_mutex{};
std::condition_variable m_conditionVariable{};
std::set<MediaSourceType> m_flushingSources{};
std::optional<GstState> m_targetState{std::nullopt};
bool m_isPrerolled{false};
Expand Down
9 changes: 1 addition & 8 deletions media/server/gstplayer/include/GenericPlayerContext.h
Original file line number Diff line number Diff line change
Expand Up @@ -206,13 +206,6 @@ struct GenericPlayerContext
*/
IDecryptionService *decryptionService{nullptr};

/**
* @brief Flag used to check, if audio source has been recently removed
*
* Flag can be used only in worker thread
*/
bool audioSourceRemoved{false};

/**
* @brief Audio elements of gst pipeline.
*
Expand Down Expand Up @@ -270,7 +263,7 @@ struct GenericPlayerContext
/**
* @brief Workaround for the gstreamer flush issue
*/
FlushOnPrerollController flushOnPrerollController;
std::shared_ptr<IFlushOnPrerollController> flushOnPrerollController{std::make_shared<FlushOnPrerollController>()};
};
} // namespace firebolt::rialto::server

Expand Down
7 changes: 7 additions & 0 deletions media/server/gstplayer/include/GstDispatcherThread.h
Original file line number Diff line number Diff line change
Expand Up @@ -34,13 +34,15 @@ class GstDispatcherThreadFactory : public IGstDispatcherThreadFactory
~GstDispatcherThreadFactory() override = default;
std::unique_ptr<IGstDispatcherThread>
createGstDispatcherThread(IGstDispatcherThreadClient &client, GstElement *pipeline,
const std::shared_ptr<IFlushOnPrerollController> &flushOnPrerollController,
const std::shared_ptr<firebolt::rialto::wrappers::IGstWrapper> &gstWrapper) const override;
};

class GstDispatcherThread : public IGstDispatcherThread
{
public:
GstDispatcherThread(IGstDispatcherThreadClient &client, GstElement *pipeline,
const std::shared_ptr<IFlushOnPrerollController> &flushOnPrerollController,
const std::shared_ptr<firebolt::rialto::wrappers::IGstWrapper> &gstWrapper);
~GstDispatcherThread() override;

Expand All @@ -58,6 +60,11 @@ class GstDispatcherThread : public IGstDispatcherThread
*/
IGstDispatcherThreadClient &m_client;

/**
* @brief The flush on preroll controller.
*/
std::shared_ptr<IFlushOnPrerollController> m_flushOnPrerollController;

/**
* @brief The gstreamer wrapper object.
*/
Expand Down
75 changes: 67 additions & 8 deletions media/server/gstplayer/include/GstGenericPlayer.h
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@
#include "tasks/IGenericPlayerTaskFactory.h"
#include "tasks/IPlayerTask.h"
#include <IMediaPipeline.h>
#include <atomic>
#include <memory>
#include <string>
#include <utility>
Expand Down Expand Up @@ -106,9 +107,8 @@ class GstGenericPlayer : public IGstGenericPlayer, public IGstGenericPlayerPriva
virtual ~GstGenericPlayer();

void attachSource(const std::unique_ptr<IMediaPipeline::MediaSource> &mediaSource) override;
void removeSource(const MediaSourceType &mediaSourceType) override;
void allSourcesAttached() override;
void play() override;
void play(bool &async) override;
void pause() override;
void stop() override;
void attachSamples(const IMediaPipeline::MediaSegmentVector &mediaSegments) override;
Expand Down Expand Up @@ -168,7 +168,7 @@ class GstGenericPlayer : public IGstGenericPlayer, public IGstGenericPlayerPriva
void updateVideoCaps(int32_t width, int32_t height, Fraction frameRate,
const std::shared_ptr<CodecData> &codecData) override;
void addAudioClippingToBuffer(GstBuffer *buffer, uint64_t clippingStart, uint64_t clippingEnd) const override;
bool changePipelineState(GstState newState) override;
GstStateChangeReturn changePipelineState(GstState newState) override;
int64_t getPosition(GstElement *element) override;
void startPositionReportingAndCheckAudioUnderflowTimer() override;
void stopPositionReportingAndCheckAudioUnderflowTimer() override;
Expand All @@ -185,15 +185,12 @@ class GstGenericPlayer : public IGstGenericPlayer, public IGstGenericPlayerPriva
void addAutoAudioSinkChild(GObject *object) override;
void removeAutoVideoSinkChild(GObject *object) override;
void removeAutoAudioSinkChild(GObject *object) override;
void setPlaybinFlags(bool enableAudio = true) override;
void pushSampleIfRequired(GstElement *source, const std::string &typeStr) override;
bool reattachSource(const std::unique_ptr<IMediaPipeline::MediaSource> &source) override;
bool hasSourceType(const MediaSourceType &mediaSourceType) const override;
GstElement *getSink(const MediaSourceType &mediaSourceType) const override;
void setSourceFlushed(const MediaSourceType &mediaSourceType) override;
bool isAsync(const MediaSourceType &mediaSourceType) const;
void postponeFlush(const MediaSourceType &mediaSourceType, bool resetTime) override;
void executePostponedFlushes() override;
void notifyPlaybackInfo() override;

private:
Expand Down Expand Up @@ -324,6 +321,61 @@ class GstGenericPlayer : public IGstGenericPlayer, public IGstGenericPlayerPriva
std::optional<firebolt::rialto::wrappers::AudioAttributesPrivate>
createAudioAttributes(const std::unique_ptr<IMediaPipeline::MediaSource> &source) const;

/**
* @brief Configures audio caps based on audio attributes.
* Called by worker thread only!
*
* @param[in] pAttrib : The audio attributes.
* @param[out] audioaac : Set to true if AAC, false otherwise.
* @param[in] svpenabled : Whether SVP is enabled.
* @param[in,out] appsrcCaps : The caps to configure.
*/
void configAudioCap(firebolt::rialto::wrappers::AudioAttributesPrivate *pAttrib, bool *audioaac, bool svpenabled,
GstCaps **appsrcCaps);

/**
* @brief Halts audio playback by setting playsink to READY and decodebin to PAUSED.
* Called by worker thread only!
*/
void haltAudioPlayback();

/**
* @brief Resumes audio playback by syncing playsink and decodebin with parent.
* Called by worker thread only!
*/
void resumeAudioPlayback();

/**
* @brief First-time codec switch from AC3 to AAC when no decoder exists yet.
* Called by worker thread only!
*
* @param[in] newAudioCaps : The new audio caps to apply.
*/
void firstTimeSwitchFromAC3toAAC(GstCaps *newAudioCaps);

/**
* @brief Switches the audio codec by unlinking old parser/decoder and linking new ones.
* Called by worker thread only!
*
* @param[in] isAudioAAC : Whether the new codec is AAC.
* @param[in] newAudioCaps : The new audio caps to apply.
*
* @retval true if codec was switched, false if same codec.
*/
bool switchAudioCodec(bool isAudioAAC, GstCaps *newAudioCaps);

/**
* @brief Top-level audio track codec channel switch, ported from rdk_gstreamer_utils_soc.
* Called by worker thread only!
*/
bool performAudioTrackCodecChannelSwitch(const void *pSampleAttr,
firebolt::rialto::wrappers::AudioAttributesPrivate *pAudioAttr,
uint32_t *pStatus, unsigned int *pui32Delay,
long long *pAudioChangeTargetPts, // NOLINT(runtime/int)
const long long *pcurrentDispPts, // NOLINT(runtime/int)
unsigned int *audioChangeStage, GstCaps **appsrcCaps, bool *audioaac,
bool svpenabled, GstElement *aSrc, bool *ret);

/**
* @brief Sets text track position before pushing data
*
Expand All @@ -340,6 +392,13 @@ class GstGenericPlayer : public IGstGenericPlayer, public IGstGenericPlayerPriva
*/
void pushAdditionalSegmentIfRequired(GstElement *source);

/**
* @brief Sets the audio and video flags on the pipeline based on the input.
*
* @param[in] enableAudio : Whether to enable audio flags.
*/
void setPlaybinFlags(bool enableAudio = true);

private:
/**
* @brief The player context.
Expand Down Expand Up @@ -424,9 +483,9 @@ class GstGenericPlayer : public IGstGenericPlayer, public IGstGenericPlayerPriva
std::unique_ptr<IFlushWatcher> m_flushWatcher;

/**
* @brief The postponed flush tasks
* @brief The ongoing state change operations counter
*/
std::vector<std::pair<MediaSourceType, bool>> m_postponedFlushes{};
std::atomic<uint32_t> m_ongoingStateChangesNumber{0};
};

} // namespace firebolt::rialto::server
Expand Down
6 changes: 4 additions & 2 deletions media/server/gstplayer/include/IFlushOnPrerollController.h
Original file line number Diff line number Diff line change
Expand Up @@ -34,9 +34,11 @@ class IFlushOnPrerollController
public:
virtual ~IFlushOnPrerollController() = default;

virtual bool shouldPostponeFlush(const MediaSourceType &type) const = 0;
virtual void setFlushing(const MediaSourceType &type, const GstState &currentPipelineState) = 0;
virtual void waitIfRequired(const MediaSourceType &type) = 0;
virtual void setFlushing(const MediaSourceType &type) = 0;
virtual void setPrerolling() = 0;
virtual void stateReached(const GstState &newPipelineState) = 0;
virtual void setTargetState(const GstState &state) = 0;
virtual void reset() = 0;
};
} // namespace firebolt::rialto::server
Expand Down
2 changes: 2 additions & 0 deletions media/server/gstplayer/include/IGstDispatcherThread.h
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@
#ifndef FIREBOLT_RIALTO_SERVER_I_GST_DISPATCHER_THREAD_H_
#define FIREBOLT_RIALTO_SERVER_I_GST_DISPATCHER_THREAD_H_

#include "IFlushOnPrerollController.h"
#include "IGstDispatcherThreadClient.h"
#include "IGstWrapper.h"
#include <memory>
Expand All @@ -36,6 +37,7 @@ class IGstDispatcherThreadFactory

virtual std::unique_ptr<IGstDispatcherThread>
createGstDispatcherThread(IGstDispatcherThreadClient &client, GstElement *pipeline,
const std::shared_ptr<IFlushOnPrerollController> &flushOnPrerollController,
const std::shared_ptr<firebolt::rialto::wrappers::IGstWrapper> &gstWrapper) const = 0;
};

Expand Down
Loading
Loading