Initial commit
This commit is contained in:
commit
3d53d40cd9
15 files changed
+1066
No files matched your search
@@ -0,0 +1,8 @@
|
||||
#pragma once
|
||||
|
||||
#include <string_view>
|
||||
|
||||
namespace rockstream {
|
||||
[[nodiscard]] std::string_view version() noexcept;
|
||||
[[nodiscard]] bool mpp_sdk_enabled() noexcept;
|
||||
} // namespace rockstream
|
||||
@@ -0,0 +1,45 @@
|
||||
#pragma once
|
||||
|
||||
#include <cstddef>
|
||||
#include <cstdint>
|
||||
#include <iosfwd>
|
||||
#include <span>
|
||||
#include <vector>
|
||||
|
||||
namespace rockstream {
|
||||
using Nanoseconds = std::int64_t;
|
||||
Nanoseconds monotonic_ns();
|
||||
|
||||
struct FrameTiming {
|
||||
std::uint64_t id = 0;
|
||||
Nanoseconds scheduled = 0;
|
||||
Nanoseconds submit = 0;
|
||||
Nanoseconds accepted = 0;
|
||||
Nanoseconds first = 0;
|
||||
Nanoseconds final = 0;
|
||||
Nanoseconds reclaimed = 0;
|
||||
std::size_t bytes = 0;
|
||||
std::size_t packets = 0;
|
||||
int intra = -1; // -1 when the SDK did not provide an indicator.
|
||||
};
|
||||
|
||||
// Frame identity is carried in MPP PTS; completion and reclamation are independent.
|
||||
class LatencyLog {
|
||||
public:
|
||||
explicit LatencyLog(std::size_t capacity);
|
||||
void submitted(std::uint64_t id, Nanoseconds scheduled, Nanoseconds begin, Nanoseconds end);
|
||||
void packet(std::uint64_t id, Nanoseconds observed, std::size_t bytes, bool eoi, int intra);
|
||||
void reclaimed(std::uint64_t id, Nanoseconds observed);
|
||||
[[nodiscard]] bool complete(std::uint64_t id) const;
|
||||
[[nodiscard]] const FrameTiming& at(std::uint64_t id) const;
|
||||
[[nodiscard]] std::span<const FrameTiming> frames() const { return frames_; }
|
||||
private:
|
||||
FrameTiming& checked(std::uint64_t id);
|
||||
std::vector<FrameTiming> frames_;
|
||||
};
|
||||
|
||||
// Nearest-rank percentile; sorts its own copy and rejects empty/invalid inputs.
|
||||
double percentile(std::vector<double> values, double percent);
|
||||
void print_latency_report(std::ostream& out, const LatencyLog& log, std::uint32_t warmup);
|
||||
void write_latency_csv(std::ostream& out, const LatencyLog& log, std::uint32_t warmup);
|
||||
} // namespace rockstream
|
||||
@@ -0,0 +1,33 @@
|
||||
#pragma once
|
||||
|
||||
#include <cstdint>
|
||||
#include <span>
|
||||
#include <string>
|
||||
#include <string_view>
|
||||
|
||||
namespace rockstream {
|
||||
struct ProbeOptions {
|
||||
std::uint32_t width = 3840;
|
||||
std::uint32_t height = 2160;
|
||||
std::uint32_t fps = 60;
|
||||
std::uint32_t bitrate = 25'000'000;
|
||||
std::uint32_t gop = 60;
|
||||
std::uint32_t frames = 600;
|
||||
std::uint32_t warmup = 60;
|
||||
std::uint32_t inflight = 1;
|
||||
std::uint32_t split_ctus = 0;
|
||||
std::uint32_t timeout_ms = 5000;
|
||||
bool tiles = true;
|
||||
bool paced = true;
|
||||
bool dry_run = false;
|
||||
std::string csv;
|
||||
std::string output;
|
||||
};
|
||||
|
||||
ProbeOptions parse_probe_options(std::span<const std::string_view> args);
|
||||
void validate_probe_options(const ProbeOptions& options);
|
||||
void print_probe_help();
|
||||
int run_probe(const ProbeOptions& options);
|
||||
// Implemented by the real backend only in MPP-enabled builds.
|
||||
int run_mpp_probe(const ProbeOptions& options);
|
||||
} // namespace rockstream
|
||||
Reference in new issue
Block a user