Skip to content

Conversation

@jolavillette
Copy link
Contributor

code and comment by Antigravity (under supervision)

Description
This PR introduces a proper "Smart Streaming" strategy for file transfers, designed to optimize MP4 video previewing, and cleans up the legacy naming confusion.

Key Changes:

Renamed Legacy Strategy: The old "Streaming" strategy (which was actually just downloading chunks 0, 1, 2...) has been correctly renamed to "Sequential". active everywhere (Settings, Context Menus, config files).

New "Streaming" Strategy: Implemented a new Smart Preview strategy. It behaves like Sequential (downloads from the start) but prioritizes MP4 index atoms (moov/cmov), which are often located at the end of the file. This allows video players to start playback immediately.

Windows Freeze Protection: Updated tooltips and warnings to inform users that both "Random" and "Streaming" strategies (which write to the end of the file) may cause temporary UI freezes on Windows during file allocation.

Modified files:

libretroshare/src/ft/ftcontroller.cc
: Migrated old "STREAMING" config values to the new "SEQUENTIAL" enum, while mapping the new Smart Streaming to its own ID.

libretroshare/src/retroshare/rstypes.h
: Added CHUNK_STRATEGY_STREAMING enum (id 3).

libretroshare/src/ft/ftchunkmap.cc/.h
: Implemented priority chunk logic for the new strategy.

libretroshare/src/ft/ftfilecreator.cc/.h
: Added MP4 atom parsing to detect and prioritize index chunks.
libretroshare/src/ft/ftcontroller.cc
: Updated save/load logic to handle new enum mapping and persistence strings.
GUI (retroshare-gui):

retroshare-gui/src/gui/FileTransfer/TransfersDialog.cpp/.h
: Updated context menus to include all 4 strategies (Sequential, Progressive, Random, Streaming).

retroshare-gui/src/gui/settings/TransferPage.cpp
: Handled settings persistence and Windows safety warnings.

retroshare-gui/src/gui/settings/TransferPage.ui
: Updated combo box items and tooltips with detailed explanations.
Web Interface (retroshare-webui):

retroshare-webui/webui-src/app/files/files_util.js
: Added the "Streaming" strategy to the JS mapping.

@jolavillette jolavillette force-pushed the OptimFileTransferStreamingMode branch from 3d338b1 to 1a806d7 Compare January 23, 2026 18:58
@jolavillette jolavillette force-pushed the OptimFileTransferStreamingMode branch from be8cac2 to faff8f5 Compare January 24, 2026 08:02
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant