You've already forked openscreen

This patch contains fixes to the Cast Streaming statistics logic, with the goal of providing higher quality statistics with less tech debt. 1. Accurate calculation of last receiver response time. Previously this stat used the event timestamp, which may be in the future (e.g. for frame playout events, some receivers provide a future timestamp), or may be old by the time the receiver replies. In either case, not super helpful. 2. Refactors to the statistics code itself. PacketEvent and FrameEvent now have a common base class, StatisticsEvent, which allows them to be treated more similarly and results in less duplicate code. 3. A new type, AVPair, is introduced to remove a lot of the boilerplate in the StatisticsAnalyzer around accessing the audio or video instance of a type. 4. SimpleHistogram serialization has been improved, so it no longer horribly spams the logs. The logic is now similar to how chrome://media-router-internals serializes it. 5. More test coverage! Bug: b/299016384 Change-Id: I3b245727fc7c5a6c652762ae606fa52e68713a85 Reviewed-on: https://chromium-review.googlesource.com/c/openscreen/+/4865375 Reviewed-by: Mark Foltz <mfoltz@chromium.org> Commit-Queue: Jordan Bayles <jophba@chromium.org>
21 lines
442 B
C++
21 lines
442 B
C++
// Copyright 2023 The Chromium Authors
|
|
// Use of this source code is governed by a BSD-style license that can be
|
|
// found in the LICENSE file.
|
|
|
|
#include "util/std_util.h"
|
|
|
|
#include <algorithm>
|
|
#include <cctype>
|
|
#include <string>
|
|
|
|
#include "util/osp_logging.h"
|
|
|
|
namespace openscreen {
|
|
|
|
std::string& RemoveWhitespace(std::string& s) {
|
|
s.erase(std::remove_if(s.begin(), s.end(), ::isspace), s.end());
|
|
return s;
|
|
}
|
|
|
|
} // namespace openscreen
|