Move FrameInstrumentation*Data structs to common_video

This enables usage in, e.g., `modules/rtp_rtcp`.

R=sprang@webrtc.org

Bug: webrtc:358039777
Change-Id: I0f8aafb75938d07f338bbf7acc4ff7c15a8b0baa
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/361285
Commit-Queue: Fanny Linderborg <linderborg@webrtc.org>
Reviewed-by: Erik Språng <sprang@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#42920}
This commit is contained in:
Fanny Linderborg 2024-09-02 15:50:55 +02:00 committed by WebRTC LUCI CQ
parent a82eb4e2a5
commit 5eb8588a65
6 changed files with 45 additions and 16 deletions

View File

@ -8,6 +8,10 @@
import("../webrtc.gni")
rtc_library("frame_instrumentation_data") {
sources = [ "frame_instrumentation_data.h" ]
}
rtc_library("common_video") {
visibility = [ "*" ]
@ -56,6 +60,7 @@ rtc_library("common_video") {
}
deps = [
":frame_instrumentation_data",
"../api:array_view",
"../api:make_ref_counted",
"../api:scoped_refptr",

View File

@ -0,0 +1,35 @@
/*
* Copyright 2024 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.
*/
#ifndef COMMON_VIDEO_FRAME_INSTRUMENTATION_DATA_H_
#define COMMON_VIDEO_FRAME_INSTRUMENTATION_DATA_H_
#include <vector>
namespace webrtc {
// TODO: b/358039777 - Error handling: negative values etc.
struct FrameInstrumentationSyncData {
int sequence_index;
bool is_key_frame;
};
struct FrameInstrumentationData {
int sequence_index;
bool is_key_frame;
double std_dev;
int luma_error_threshold;
int chroma_error_threshold;
std::vector<double> sample_values;
};
} // namespace webrtc
#endif // COMMON_VIDEO_FRAME_INSTRUMENTATION_DATA_H_

View File

@ -21,6 +21,7 @@ rtc_library("frame_instrumentation_generator") {
"../../api/video:video_frame",
"../../api/video:video_frame_type",
"../../api/video_codecs:video_codecs_api",
"../../common_video:frame_instrumentation_data",
"../../modules:module_api_public",
"../../modules/video_coding:video_coding_utility",
"../../rtc_base:logging",
@ -73,6 +74,7 @@ if (rtc_include_tests) {
"../../api/video:encoded_image",
"../../api/video:video_frame",
"../../api/video:video_frame_type",
"../../common_video:frame_instrumentation_data",
"../../test:test_support",
"//third_party/abseil-cpp/absl/types:variant",
]

View File

@ -25,6 +25,7 @@
#include "api/video/video_frame_buffer.h"
#include "api/video/video_frame_type.h"
#include "api/video_codecs/video_codec.h"
#include "common_video/frame_instrumentation_data.h"
#include "modules/include/module_common_types_public.h"
#include "modules/video_coding/utility/qp_parser.h"
#include "rtc_base/logging.h"

View File

@ -15,31 +15,16 @@
#include <map>
#include <optional>
#include <queue>
#include <vector>
#include "absl/types/variant.h"
#include "api/video/encoded_image.h"
#include "api/video/video_codec_type.h"
#include "api/video/video_frame.h"
#include "common_video/frame_instrumentation_data.h"
#include "video/corruption_detection/halton_frame_sampler.h"
namespace webrtc {
// TODO: b/358039777 - Error handling: negative values etc.
struct FrameInstrumentationSyncData {
int sequence_index;
bool is_key_frame;
};
struct FrameInstrumentationData {
int sequence_index;
bool is_key_frame;
double std_dev;
int luma_error_threshold;
int chroma_error_threshold;
std::vector<double> sample_values;
};
class FrameInstrumentationGenerator {
public:
FrameInstrumentationGenerator() = delete;

View File

@ -21,6 +21,7 @@
#include "api/video/video_codec_type.h"
#include "api/video/video_frame.h"
#include "api/video/video_frame_type.h"
#include "common_video/frame_instrumentation_data.h"
#include "test/gtest.h"
namespace webrtc {