From 01f4439d83008b4333f6375422689eb4b679e2f5 Mon Sep 17 00:00:00 2001 From: MediaPipe Team Date: Wed, 19 Apr 2023 03:30:43 -0700 Subject: [PATCH] Internal change PiperOrigin-RevId: 525399975 --- .../core/matrix_to_vector_calculator_test.cc | 2 +- .../core/packet_resampler_calculator_test.cc | 20 +++++++++---------- .../core/previous_loopback_calculator_test.cc | 6 +++--- .../core/side_packet_to_stream_calculator.cc | 6 +++--- 4 files changed, 17 insertions(+), 17 deletions(-) diff --git a/mediapipe/calculators/core/matrix_to_vector_calculator_test.cc b/mediapipe/calculators/core/matrix_to_vector_calculator_test.cc index 1f994cbed..8b4254cbc 100644 --- a/mediapipe/calculators/core/matrix_to_vector_calculator_test.cc +++ b/mediapipe/calculators/core/matrix_to_vector_calculator_test.cc @@ -35,7 +35,7 @@ class MatrixToVectorCalculatorTest void SetUp() override { calculator_name_ = "MatrixToVectorCalculator"; } void AppendInput(const std::vector& column_major_data, - int64 timestamp) { + int64_t timestamp) { ASSERT_EQ(num_input_samples_ * num_input_channels_, column_major_data.size()); Eigen::Map data_map(&column_major_data[0], diff --git a/mediapipe/calculators/core/packet_resampler_calculator_test.cc b/mediapipe/calculators/core/packet_resampler_calculator_test.cc index f02da0d18..d80793da4 100644 --- a/mediapipe/calculators/core/packet_resampler_calculator_test.cc +++ b/mediapipe/calculators/core/packet_resampler_calculator_test.cc @@ -51,9 +51,9 @@ class SimpleRunner : public CalculatorRunner { virtual ~SimpleRunner() {} - void SetInput(const std::vector& timestamp_list) { + void SetInput(const std::vector& timestamp_list) { MutableInputs()->Index(0).packets.clear(); - for (const int64 ts : timestamp_list) { + for (const int64_t ts : timestamp_list) { MutableInputs()->Index(0).packets.push_back( Adopt(new std::string(absl::StrCat("Frame #", ts))) .At(Timestamp(ts))); @@ -72,8 +72,8 @@ class SimpleRunner : public CalculatorRunner { } void CheckOutputTimestamps( - const std::vector& expected_frames, - const std::vector& expected_timestamps) const { + const std::vector& expected_frames, + const std::vector& expected_timestamps) const { EXPECT_EQ(expected_frames.size(), Outputs().Index(0).packets.size()); EXPECT_EQ(expected_timestamps.size(), Outputs().Index(0).packets.size()); int count = 0; @@ -112,7 +112,7 @@ MATCHER_P2(PacketAtTimestamp, payload, timestamp, *result_listener << "at incorrect timestamp = " << arg.Timestamp().Value(); return false; } - int64 actual_payload = arg.template Get(); + int64_t actual_payload = arg.template Get(); if (actual_payload != payload) { *result_listener << "with incorrect payload = " << actual_payload; return false; @@ -137,18 +137,18 @@ class ReproducibleJitterWithReflectionStrategyForTesting // // An EXPECT will fail if sequence is less than the number requested during // processing. - static std::vector random_sequence; + static std::vector random_sequence; protected: - virtual uint64 GetNextRandom(uint64 n) { + virtual uint64_t GetNextRandom(uint64_t n) { EXPECT_LT(sequence_index_, random_sequence.size()); return random_sequence[sequence_index_++] % n; } private: - int32 sequence_index_ = 0; + int32_t sequence_index_ = 0; }; -std::vector +std::vector ReproducibleJitterWithReflectionStrategyForTesting::random_sequence; // PacketResamplerCalculator child class which injects a specified stream @@ -469,7 +469,7 @@ TEST(PacketResamplerCalculatorTest, SetVideoHeader) { } )pb")); - for (const int64 ts : {0, 5000, 10010, 15001, 19990}) { + for (const int64_t ts : {0, 5000, 10010, 15001, 19990}) { runner.MutableInputs()->Tag(kDataTag).packets.push_back( Adopt(new std::string(absl::StrCat("Frame #", ts))).At(Timestamp(ts))); } diff --git a/mediapipe/calculators/core/previous_loopback_calculator_test.cc b/mediapipe/calculators/core/previous_loopback_calculator_test.cc index 563417669..d8c358909 100644 --- a/mediapipe/calculators/core/previous_loopback_calculator_test.cc +++ b/mediapipe/calculators/core/previous_loopback_calculator_test.cc @@ -43,8 +43,8 @@ constexpr char kDisallowTag[] = "DISALLOW"; // Returns the timestamp values for a vector of Packets. // TODO: puth this kind of test util in a common place. -std::vector TimestampValues(const std::vector& packets) { - std::vector result; +std::vector TimestampValues(const std::vector& packets) { + std::vector result; for (const Packet& packet : packets) { result.push_back(packet.Timestamp().Value()); } @@ -371,7 +371,7 @@ TEST(PreviousLoopbackCalculator, EmptyLoopForever) { for (int main_ts = 0; main_ts < 50; ++main_ts) { send_packet("in", main_ts); MP_EXPECT_OK(graph_.WaitUntilIdle()); - std::vector ts_values = TimestampValues(outputs); + std::vector ts_values = TimestampValues(outputs); EXPECT_EQ(ts_values.size(), main_ts + 1); for (int j = 0; j < main_ts + 1; ++j) { EXPECT_EQ(ts_values[j], j); diff --git a/mediapipe/calculators/core/side_packet_to_stream_calculator.cc b/mediapipe/calculators/core/side_packet_to_stream_calculator.cc index ed89889df..311f7d815 100644 --- a/mediapipe/calculators/core/side_packet_to_stream_calculator.cc +++ b/mediapipe/calculators/core/side_packet_to_stream_calculator.cc @@ -121,7 +121,7 @@ absl::Status SidePacketToStreamCalculator::GetContract(CalculatorContract* cc) { if (cc->Outputs().HasTag(kTagAtTimestamp)) { RET_CHECK_EQ(num_entries + 1, cc->InputSidePackets().NumEntries()) << "For AT_TIMESTAMP tag, 2 input side packets are required."; - cc->InputSidePackets().Tag(kTagSideInputTimestamp).Set(); + cc->InputSidePackets().Tag(kTagSideInputTimestamp).Set(); } else { RET_CHECK_EQ(num_entries, cc->InputSidePackets().NumEntries()) << "Same number of input side packets and output streams is required."; @@ -178,8 +178,8 @@ absl::Status SidePacketToStreamCalculator::Close(CalculatorContext* cc) { .AddPacket(cc->InputSidePackets().Index(i).At(timestamp)); } } else if (cc->Outputs().HasTag(kTagAtTimestamp)) { - int64 timestamp = - cc->InputSidePackets().Tag(kTagSideInputTimestamp).Get(); + int64_t timestamp = + cc->InputSidePackets().Tag(kTagSideInputTimestamp).Get(); for (int i = 0; i < cc->Outputs().NumEntries(output_tag_); ++i) { cc->Outputs() .Get(output_tag_, i)