Repository navigation
Add Player Interface CLI simulator - #322
TanujSharma369 wants to merge 1 commit into
Conversation
3061175 to
6b6c3f6
Compare
There was a problem hiding this comment.
🟡 Changes recommended
Approval is blocked by an active build-configuration failure and a critical cleanup path that can terminate the process by destroying a joinable thread.
2 open issues
What changed in this PR
Adds an FFmpeg-backed pi-player-simulator CLI for exercising InterfacePlayerRDK with HLS and DASH streams, including playback controls, track selection, trick play, ABR, and DASH resource handling.
Changes:
- Adds FFmpeg demuxing, sample normalization, bounded queues, seeking, source switching, and playback controls.
- Adds DASH manifest filtering, track cataloging, segment prefetching/caching, and bandwidth-based ABR.
- Replaces the legacy CLI and Docker workflow with standalone build/run scripts, documentation, and an implementation plan.
This pull request requires changes.
| File | Description |
|---|---|
test/pi-cli/src/main.cpp |
Validates the stream URL and launches the simulator. |
test/pi-cli/src/console/ConsolePlayer.h |
Declares the console frontend. |
test/pi-cli/src/console/ConsolePlayer.cpp |
Implements command parsing, playback controls, status output, and input polling. |
test/pi-cli/src/backend/PlayerBackend.h |
Defines playback state and source-management interfaces. |
test/pi-cli/src/backend/MediaTrackCatalog.h |
Defines media track metadata and catalog structures. |
test/pi-cli/src/backend/MediaTrackCatalog.cpp |
Discovers and selects DASH and FFmpeg tracks. |
test/pi-cli/src/backend/FfmpegDemuxSource.h |
Declares FFmpeg demuxing, queueing, seeking, and sample delivery. |
test/pi-cli/src/backend/FfmpegDemuxSource.cpp |
Implements HLS/DASH ingest, packet normalization, seeking, and bounded queues. |
test/pi-cli/src/backend/DashResourceProxy.h |
Declares the in-memory DASH resource proxy. |
test/pi-cli/src/backend/DashResourceProxy.cpp |
Implements DASH filtering, segment prefetching, caching, loopback serving, and bandwidth measurement. |
test/pi-cli/src/backend/AbrController.h |
Defines ABR decision state and controller APIs. |
test/pi-cli/src/backend/AbrController.cpp |
Implements bandwidth-based representation selection. |
test/pi-cli/run.sh |
Configures runtime library paths and launches the simulator. |
test/pi-cli/README.md |
Documents architecture, controls, setup, limitations, and validation. |
test/pi-cli/main.cpp |
Removes the obsolete CLI entry point. |
test/pi-cli/Dockerfile |
Removes the obsolete Docker-based workflow. |
test/pi-cli/commandProcessing.h |
Removes legacy command declarations. |
test/pi-cli/commandProcessing.cpp |
Removes the legacy command executor and implementations. |
test/pi-cli/CMakeLists.txt |
Defines the simulator target and native dependencies. |
test/pi-cli/build.sh |
Checks dependencies and builds the simulator. |
PLAYER-SIMULATOR-PLAN.md |
Documents simulator goals, design, implementation phases, and validation gates. |
DemuxDataTypes.h |
Updates MediaCodecInfo initialization. |
Review effort: Lite
| StopTrickModePrewarming(); | ||
| if (player_ != nullptr && !stopped_) { | ||
| player_->Stop(true); | ||
| stopped_ = true; |
| add_executable(pi-cli | ||
| main.cpp | ||
| commandProcessing.cpp | ||
| pkg_check_modules(PLAYERGSTINTERFACE REQUIRED IMPORTED_TARGET libplayergstinterface) |
| target_link_libraries(pi-player-simulator PRIVATE | ||
| PkgConfig::PLAYERGSTINTERFACE | ||
| PkgConfig::GLIB | ||
| PkgConfig::FFMPEG | ||
| PkgConfig::LIBXML2 | ||
| ) |
| if (!playing_ || source_ == nullptr) { | ||
| return; | ||
| } |
6b6c3f6 to
2f93a2d
Compare
2f93a2d to
bf35200
Compare
There was a problem hiding this comment.
🟡 Changes recommended
Several unresolved critical issues can cause build failures, dangling-reference crashes, incomplete worker teardown, continued invalid feeding after pipeline errors, and unrestricted non-HTTP resource access.
8 open issues
Avoid dangling source reference in the EOS callback · New Stop source feeding after a player bus error · New Restrict resolved DASH resources to HTTP(S) · New Link the simulator against the platform thread library Ingest failure skips cleanup and can terminate on joinable threads Select the lowest-bandwidth DASH representation by default · New Complete audio switches when playback is paused or stopped Top-level build cannot find the in-tree playergstinterface package
Review effort: Lite
| [this, &source](int mediaType, uint64_t seekGeneration) { | ||
| if (seekGeneration != source.GetSeekGeneration()) { |
| switch (event.msgType) { | ||
| case MESSAGE_ERROR: | ||
| LogStartupMilestone("player-interface-error: " + event.msg + | ||
| " | debug: " + event.dbg_info); | ||
| statusMessage_ = event.msg.empty() ? "Playback error" : event.msg; | ||
| pendingPlayerEos_ = false; | ||
| endOfStream_ = false; | ||
| playing_ = false; |
| std::string ResolveHttpUrl(const std::string& baseUrl, | ||
| const std::string& reference) | ||
| { | ||
| if (reference.empty()) { | ||
| return baseUrl; | ||
| } | ||
| if (reference.find("://") != std::string::npos) { | ||
| return reference; | ||
| } |
| for (xmlNodePtr child = adaptationSet->children; | ||
| child != nullptr; | ||
| child = child->next) { | ||
| if (child->type == XML_ELEMENT_NODE && | ||
| xmlStrEqual(child->name, BAD_CAST "Representation")) { | ||
| selectedRepresentation = child; | ||
| break; |
bf35200 to
7b5f397
Compare
There was a problem hiding this comment.
🟡 Changes recommended
Approval is blocked by four unresolved critical issues affecting clean configuration, complete shutdown on ingest failure, HTTP(S)-only resource enforcement, and progress on oversized packets.
9 open issues
Oversized packets can block the demux thread indefinitely · New Restrict resolved DASH resources to HTTP(S) Stop source feeding after a player bus error Avoid dangling source reference in the EOS callback Link the simulator against the platform thread library Ingest failure skips cleanup and can terminate on joinable threads Select the lowest-bandwidth DASH representation by default Complete audio switches when playback is paused or stopped Top-level build cannot find the in-tree playergstinterface package
Review effort: Lite
Add the FFmpeg-backed pi-cli test player, playback controls, DASH support, and usage documentation.
7b5f397 to
a882283
Compare
There was a problem hiding this comment.
🟡 Changes recommended
Active moderate and critical findings remain, including a dangling callback reference, an unbounded oversized queue packet, incorrect initial representation selection, and a root-build pkg-config failure.
10 open issues
Oversized packets can block the demux thread indefinitely Restrict resolved DASH resources to HTTP(S) Stop source feeding after a player bus error Avoid dangling source reference in the EOS callback Link the simulator against the platform thread library Ingest failure skips cleanup and can terminate on joinable threads Reject packets larger than the queue limit · New Select the lowest-bandwidth DASH representation by default Complete audio switches when playback is paused or stopped Top-level build cannot find the in-tree playergstinterface package
Review effort: Lite
| (track.packets.size() < kMaximumQueuedPackets && | ||
| (track.queuedBytes == 0 || | ||
| packet.data.size() <= | ||
| kMaximumQueuedBytes - | ||
| std::min(track.queuedBytes, kMaximumQueuedBytes))); |
There was a problem hiding this comment.
🟡 Changes recommended
Several critical correctness and security issues remain, including a root-build configuration failure, incomplete cleanup on trick-play errors, and unrestricted non-HTTP resource access, along with moderate ABR and oversized-packet deadlocks.
10 open issues
Restrict resolved DASH resources to HTTP(S) Stop source feeding after a player bus error Avoid dangling source reference in the EOS callback Link the simulator against the platform thread library Ingest failure skips cleanup and can terminate on joinable threads ABR remains enabled when no proxy bandwidth measurement is available · New Reject packets larger than the queue limit Select the lowest-bandwidth DASH representation by default Complete audio switches when playback is paused or stopped Top-level build cannot find the in-tree playergstinterface package
1 resolved since last review
Review effort: Lite
| return dashResourceProxy_ == nullptr | ||
| ? 0 | ||
| : dashResourceProxy_->GetEstimatedBandwidthBitsPerSecond(); |


Add the FFmpeg-backed pi-cli test player, playback controls, DASH support, and usage documentation.