/* * Copyright (c) 2022 The WebRTC project authors. All Rights Reserved. * * Use of this source code is governed by a BSD-style license * that can be found in the LICENSE file in the root of the source * tree. An additional intellectual property rights grant can be found * in the file PATENTS. All contributing project authors may * be found in the AUTHORS file in the root of the source tree.
*/
// Returns frames for the slice specified by `filter`. If `merge` is true, // also merges frames belonging to the same temporal unit into one // superframe. virtual std::vector<Frame> Slice(Filter filter, bool merge) const = 0;
// Returns video statistics aggregated for the slice specified by `filter`. virtual Stream Aggregate(Filter filter) const = 0;
// Write metrics to a CSV file. virtualvoid LogMetrics(
absl::string_view csv_path,
std::vector<Frame> frames,
std::map<std::string, std::string> metadata) const = 0;
};
// Pacing settings for codec input. struct PacingSettings { enum PacingMode { // Pacing is not used. Frames are sent to codec back-to-back.
kNoPacing, // Pace with the rate equal to the target video frame rate. Pacing time is // derived from RTP timestamp.
kRealTime, // Pace with the explicitly provided rate.
kConstantRate,
};
PacingMode mode = PacingMode::kNoPacing; // Pacing rate for `kConstantRate` mode.
Frequency constant_rate = Frequency::Zero();
};
struct VideoSourceSettings {
std::string file_path;
Resolution resolution;
Frequency framerate;
};
// Interface for a coded video frames source. class CodedVideoSource { public: virtual ~CodedVideoSource() = default;
// Returns next frame. Returns `std::nullopt` if the end-of-stream is // reached. Frames should have RTP timestamps representing desired frame // rate. virtual std::optional<EncodedImage> PullFrame() = 0;
};
// A helper function that creates `EncodingSettings` from the given // parameters. `bitrate` is either total, or per-spatial layer or per-spatial // and per-temporal layer. If layer bitrates are not explicitly specified, // then the codec-specific rate allocators used to distribute the total // bitrate across spatial or/and temporal layers. static EncodingSettings CreateEncodingSettings(const Environment& env,
std::string codec_type,
std::string scalability_name, int width, int height,
std::vector<DataRate> bitrate,
Frequency framerate, bool screencast = false, bool frame_drop = true);
// A helper function that creates a map of RTP timestamps to // `EncodingSettings` for the given number of frames. static std::map<uint32_t, EncodingSettings> CreateFrameSettings( const EncodingSettings& encoding_settings, int num_frames,
uint32_t first_timestamp_rtp = 90000);
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.