mirror of
https://github.com/Pixelplanet/Pixel-VR-Player.git
synced 2026-10-21 01:01:30 +02:00
Smooth decode-fps stat (EMA) and enlarge SMB prefetch to 64 MiB for high-bitrate streaming
This commit is contained in:
1 parent
00591b6e4e
commit
fd2fcbc57d
3 files changed
+4
-2
No files matched your search
+2
-1
@@ -213,6 +213,7 @@ void App::updateStats() {
|
||||
const double fps = statsFrameAccum_ / elapsed;
|
||||
const uint64_t dec = media_.decodedFrames();
|
||||
const double decFps = static_cast<double>(dec - statsLastDecoded_) / elapsed;
|
||||
decFpsEma_ = (decFpsEma_ > 0.0) ? decFpsEma_ * 0.6 + decFps * 0.4 : decFps;
|
||||
statsFrameAccum_ = 0;
|
||||
statsLastDecoded_ = dec;
|
||||
lastStatsUpdate_ = now;
|
||||
@@ -272,7 +273,7 @@ void App::updateStats() {
|
||||
std::snprintf(buf, sizeof(buf), "Video %dx%d %s", media_.width(),
|
||||
media_.height(), media_.codecName().c_str());
|
||||
statsLines_.emplace_back(buf);
|
||||
std::snprintf(buf, sizeof(buf), "Decode %.1f / %.2f fps", decFps,
|
||||
std::snprintf(buf, sizeof(buf), "Decode %.1f / %.2f fps", decFpsEma_,
|
||||
media_.frameRate());
|
||||
statsLines_.emplace_back(buf);
|
||||
}
|
||||
|
||||
@@ -63,6 +63,7 @@ private:
|
||||
std::chrono::steady_clock::time_point lastStatsUpdate_{};
|
||||
int statsFrameAccum_ = 0;
|
||||
uint64_t statsLastDecoded_ = 0;
|
||||
double decFpsEma_ = 0.0; // smoothed decode fps (the raw window is bursty)
|
||||
unsigned long long cpuPrevIdle_ = 0;
|
||||
unsigned long long cpuPrevTotal_ = 0;
|
||||
std::vector<std::string> statsLines_;
|
||||
|
||||
@@ -60,7 +60,7 @@ void smb_auth(SMBCCTX*, const char*, const char*, char*, int, char* un, int unle
|
||||
// Only the prefetch thread touches the SMB handle (read/lseek); the AVIO
|
||||
// callbacks only touch the ring and request seeks.
|
||||
struct SmbReadAhead {
|
||||
static constexpr std::size_t kCapacity = 32u << 20; // 32 MiB cushion
|
||||
static constexpr std::size_t kCapacity = 64u << 20; // 64 MiB cushion
|
||||
static constexpr std::size_t kChunk = 256u << 10; // 256 KiB network reads
|
||||
|
||||
SMBCCTX* ctx = nullptr;
|
||||
|
||||
Reference in new issue
Block a user