From 52e934a53940634bdb2ccf982ec4982d21baecc1 Mon Sep 17 00:00:00 2001 From: MediaPipe Team Date: Tue, 11 Apr 2023 23:11:35 -0700 Subject: [PATCH] Internal change PiperOrigin-RevId: 523611358 --- .../core/clip_vector_size_calculator_test.cc | 2 +- .../concatenate_proto_list_calculator_test.cc | 4 +- .../core/concatenate_vector_calculator.cc | 4 +- .../concatenate_vector_calculator_test.cc | 10 ++-- .../core/flow_limiter_calculator_test.cc | 44 ++++++++-------- .../core/graph_profile_calculator_test.cc | 8 +-- .../core/immediate_mux_calculator_test.cc | 8 +-- .../core/packet_thinner_calculator_test.cc | 38 +++++++------- .../real_time_flow_limiter_calculator_test.cc | 50 +++++++++---------- .../side_packet_to_stream_calculator_test.cc | 8 +-- .../core/split_proto_list_calculator.cc | 6 +-- 11 files changed, 91 insertions(+), 91 deletions(-) diff --git a/mediapipe/calculators/core/clip_vector_size_calculator_test.cc b/mediapipe/calculators/core/clip_vector_size_calculator_test.cc index d9852d5a..19e84534 100644 --- a/mediapipe/calculators/core/clip_vector_size_calculator_test.cc +++ b/mediapipe/calculators/core/clip_vector_size_calculator_test.cc @@ -30,7 +30,7 @@ namespace mediapipe { typedef ClipVectorSizeCalculator TestClipIntVectorSizeCalculator; REGISTER_CALCULATOR(TestClipIntVectorSizeCalculator); -void AddInputVector(const std::vector& input, int64 timestamp, +void AddInputVector(const std::vector& input, int64_t timestamp, CalculatorRunner* runner) { runner->MutableInputs()->Index(0).packets.push_back( MakePacket>(input).At(Timestamp(timestamp))); diff --git a/mediapipe/calculators/core/concatenate_proto_list_calculator_test.cc b/mediapipe/calculators/core/concatenate_proto_list_calculator_test.cc index 2167cd9d..4abcdae0 100644 --- a/mediapipe/calculators/core/concatenate_proto_list_calculator_test.cc +++ b/mediapipe/calculators/core/concatenate_proto_list_calculator_test.cc @@ -63,7 +63,7 @@ void ValidateCombinedLandmarks( void AddInputLandmarkLists( const std::vector& input_landmarks_vec, - int64 timestamp, CalculatorRunner* runner) { + int64_t timestamp, CalculatorRunner* runner) { for (int i = 0; i < input_landmarks_vec.size(); ++i) { runner->MutableInputs()->Index(i).packets.push_back( MakePacket(input_landmarks_vec[i]) @@ -73,7 +73,7 @@ void AddInputLandmarkLists( void AddInputClassificationLists( const std::vector& input_classifications_vec, - int64 timestamp, CalculatorRunner* runner) { + int64_t timestamp, CalculatorRunner* runner) { for (int i = 0; i < input_classifications_vec.size(); ++i) { runner->MutableInputs()->Index(i).packets.push_back( MakePacket(input_classifications_vec[i]) diff --git a/mediapipe/calculators/core/concatenate_vector_calculator.cc b/mediapipe/calculators/core/concatenate_vector_calculator.cc index 1a6f9c36..0079aa98 100644 --- a/mediapipe/calculators/core/concatenate_vector_calculator.cc +++ b/mediapipe/calculators/core/concatenate_vector_calculator.cc @@ -46,10 +46,10 @@ MEDIAPIPE_REGISTER_NODE(ConcatenateFloatVectorCalculator); // input_stream: "int32_vector_2" // output_stream: "concatenated_int32_vector" // } -typedef ConcatenateVectorCalculator ConcatenateInt32VectorCalculator; +typedef ConcatenateVectorCalculator ConcatenateInt32VectorCalculator; MEDIAPIPE_REGISTER_NODE(ConcatenateInt32VectorCalculator); -typedef ConcatenateVectorCalculator ConcatenateUInt64VectorCalculator; +typedef ConcatenateVectorCalculator ConcatenateUInt64VectorCalculator; MEDIAPIPE_REGISTER_NODE(ConcatenateUInt64VectorCalculator); typedef ConcatenateVectorCalculator ConcatenateBoolVectorCalculator; diff --git a/mediapipe/calculators/core/concatenate_vector_calculator_test.cc b/mediapipe/calculators/core/concatenate_vector_calculator_test.cc index b71dadf0..5510b98a 100644 --- a/mediapipe/calculators/core/concatenate_vector_calculator_test.cc +++ b/mediapipe/calculators/core/concatenate_vector_calculator_test.cc @@ -30,26 +30,26 @@ namespace mediapipe { typedef ConcatenateVectorCalculator TestConcatenateIntVectorCalculator; MEDIAPIPE_REGISTER_NODE(TestConcatenateIntVectorCalculator); -void AddInputVector(int index, const std::vector& input, int64 timestamp, +void AddInputVector(int index, const std::vector& input, int64_t timestamp, CalculatorRunner* runner) { runner->MutableInputs()->Index(index).packets.push_back( MakePacket>(input).At(Timestamp(timestamp))); } void AddInputVectors(const std::vector>& inputs, - int64 timestamp, CalculatorRunner* runner) { + int64_t timestamp, CalculatorRunner* runner) { for (int i = 0; i < inputs.size(); ++i) { AddInputVector(i, inputs[i], timestamp, runner); } } -void AddInputItem(int index, int input, int64 timestamp, +void AddInputItem(int index, int input, int64_t timestamp, CalculatorRunner* runner) { runner->MutableInputs()->Index(index).packets.push_back( MakePacket(input).At(Timestamp(timestamp))); } -void AddInputItems(const std::vector& inputs, int64 timestamp, +void AddInputItems(const std::vector& inputs, int64_t timestamp, CalculatorRunner* runner) { for (int i = 0; i < inputs.size(); ++i) { AddInputItem(i, inputs[i], timestamp, runner); @@ -279,7 +279,7 @@ TEST(TestConcatenateIntVectorCalculatorTest, MixedVectorsAndItemsAnother) { } void AddInputVectors(const std::vector>& inputs, - int64 timestamp, CalculatorRunner* runner) { + int64_t timestamp, CalculatorRunner* runner) { for (int i = 0; i < inputs.size(); ++i) { runner->MutableInputs()->Index(i).packets.push_back( MakePacket>(inputs[i]).At(Timestamp(timestamp))); diff --git a/mediapipe/calculators/core/flow_limiter_calculator_test.cc b/mediapipe/calculators/core/flow_limiter_calculator_test.cc index 5d0594de..803474c9 100644 --- a/mediapipe/calculators/core/flow_limiter_calculator_test.cc +++ b/mediapipe/calculators/core/flow_limiter_calculator_test.cc @@ -61,8 +61,8 @@ class AtomicSemaphore { }; // Returns the timestamp values for a vector of Packets. -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()); } @@ -180,9 +180,9 @@ TEST_F(FlowLimiterCalculatorSemaphoreTest, FramesDropped) { InitializeGraph(1); MP_ASSERT_OK(graph_.StartRun({})); - auto send_packet = [this](const std::string& input_name, int64 n) { + auto send_packet = [this](const std::string& input_name, int64_t n) { MP_EXPECT_OK(graph_.AddPacketToInputStream( - input_name, MakePacket(n).At(Timestamp(n)))); + input_name, MakePacket(n).At(Timestamp(n)))); }; Packet allow_packet; @@ -207,12 +207,12 @@ TEST_F(FlowLimiterCalculatorSemaphoreTest, FramesDropped) { EXPECT_EQ(10, out_1_packets_.size()); // Timestamps have not been altered. - EXPECT_EQ(PacketValues(out_1_packets_), + EXPECT_EQ(PacketValues(out_1_packets_), TimestampValues(out_1_packets_)); // Extra inputs on in_1 have been dropped. EXPECT_EQ(TimestampValues(out_1_packets_), - (std::vector{0, 10, 20, 30, 40, 50, 60, 70, 80, 90})); + (std::vector{0, 10, 20, 30, 40, 50, 60, 70, 80, 90})); } // A calculator that sleeps during Process. @@ -221,8 +221,8 @@ class SleepCalculator : public CalculatorBase { static absl::Status GetContract(CalculatorContract* cc) { cc->Inputs().Tag(kPacketTag).SetAny(); cc->Outputs().Tag(kPacketTag).SetSameAs(&cc->Inputs().Tag(kPacketTag)); - cc->InputSidePackets().Tag(kSleepTimeTag).Set(); - cc->InputSidePackets().Tag(kWarmupTimeTag).Set(); + cc->InputSidePackets().Tag(kSleepTimeTag).Set(); + cc->InputSidePackets().Tag(kWarmupTimeTag).Set(); cc->InputSidePackets().Tag(kClockTag).Set(); cc->SetTimestampOffset(0); return absl::OkStatus(); @@ -237,8 +237,8 @@ class SleepCalculator : public CalculatorBase { ++packet_count; absl::Duration sleep_time = absl::Microseconds( packet_count == 1 - ? cc->InputSidePackets().Tag(kWarmupTimeTag).Get() - : cc->InputSidePackets().Tag(kSleepTimeTag).Get()); + ? cc->InputSidePackets().Tag(kWarmupTimeTag).Get() + : cc->InputSidePackets().Tag(kSleepTimeTag).Get()); clock_->Sleep(sleep_time); cc->Outputs() .Tag(kPacketTag) @@ -375,8 +375,8 @@ TEST_F(FlowLimiterCalculatorTest, FinishedTimestamps) { std::map side_packets = { {"limiter_options", MakePacket(limiter_options)}, - {"warmup_time", MakePacket(22000)}, - {"sleep_time", MakePacket(22000)}, + {"warmup_time", MakePacket(22000)}, + {"sleep_time", MakePacket(22000)}, {"drop_timesamps", MakePacket(false)}, {"clock", MakePacket(clock_)}, }; @@ -447,8 +447,8 @@ TEST_F(FlowLimiterCalculatorTest, FinishedLost) { std::map side_packets = { {"limiter_options", MakePacket(limiter_options)}, - {"warmup_time", MakePacket(22000)}, - {"sleep_time", MakePacket(22000)}, + {"warmup_time", MakePacket(22000)}, + {"sleep_time", MakePacket(22000)}, {"drop_timesamps", MakePacket(true)}, {"clock", MakePacket(clock_)}, }; @@ -511,8 +511,8 @@ TEST_F(FlowLimiterCalculatorTest, FinishedDelayed) { std::map side_packets = { {"limiter_options", MakePacket(limiter_options)}, - {"warmup_time", MakePacket(500000)}, - {"sleep_time", MakePacket(22000)}, + {"warmup_time", MakePacket(500000)}, + {"sleep_time", MakePacket(22000)}, {"drop_timesamps", MakePacket(false)}, {"clock", MakePacket(clock_)}, }; @@ -606,8 +606,8 @@ TEST_F(FlowLimiterCalculatorTest, TwoInputStreams) { std::map side_packets = { {"limiter_options", MakePacket(limiter_options)}, - {"warmup_time", MakePacket(22000)}, - {"sleep_time", MakePacket(22000)}, + {"warmup_time", MakePacket(22000)}, + {"sleep_time", MakePacket(22000)}, {"drop_timesamps", MakePacket(true)}, {"clock", MakePacket(clock_)}, }; @@ -715,8 +715,8 @@ TEST_F(FlowLimiterCalculatorTest, ZeroQueue) { std::map side_packets = { {"limiter_options", MakePacket(limiter_options)}, - {"warmup_time", MakePacket(12000)}, - {"sleep_time", MakePacket(12000)}, + {"warmup_time", MakePacket(12000)}, + {"sleep_time", MakePacket(12000)}, {"drop_timesamps", MakePacket(true)}, {"clock", MakePacket(clock_)}, }; @@ -862,9 +862,9 @@ TEST_F(FlowLimiterCalculatorTest, AuxiliaryInputs) { std::map side_packets = { // Fake processing lazy initialization time in microseconds. - {"warmup_time", MakePacket(22000)}, + {"warmup_time", MakePacket(22000)}, // Fake processing duration in microseconds. - {"sleep_time", MakePacket(22000)}, + {"sleep_time", MakePacket(22000)}, // The SimulationClock to count virtual elapsed time. {"clock", MakePacket(clock_)}, }; diff --git a/mediapipe/calculators/core/graph_profile_calculator_test.cc b/mediapipe/calculators/core/graph_profile_calculator_test.cc index 6696b802..2ad54338 100644 --- a/mediapipe/calculators/core/graph_profile_calculator_test.cc +++ b/mediapipe/calculators/core/graph_profile_calculator_test.cc @@ -94,17 +94,17 @@ class GraphProfileCalculatorTest : public ::testing::Test { &graph_config_)); } - static Packet PacketAt(int64 ts) { - return Adopt(new int64(999)).At(Timestamp(ts)); + static Packet PacketAt(int64_t ts) { + return Adopt(new int64_t(999)).At(Timestamp(ts)); } static Packet None() { return Packet().At(Timestamp::OneOverPostStream()); } static bool IsNone(const Packet& packet) { return packet.Timestamp() == Timestamp::OneOverPostStream(); } // Return the values of the timestamps of a vector of Packets. - static std::vector TimestampValues( + static std::vector TimestampValues( const std::vector& packets) { - std::vector result; + std::vector result; for (const Packet& p : packets) { result.push_back(p.Timestamp().Value()); } diff --git a/mediapipe/calculators/core/immediate_mux_calculator_test.cc b/mediapipe/calculators/core/immediate_mux_calculator_test.cc index 6913fd00..4ceb4090 100644 --- a/mediapipe/calculators/core/immediate_mux_calculator_test.cc +++ b/mediapipe/calculators/core/immediate_mux_calculator_test.cc @@ -191,17 +191,17 @@ class ImmediateMuxCalculatorTest : public ::testing::Test { &graph_config_)); } - static Packet PacketAt(int64 ts) { - return Adopt(new int64(999)).At(Timestamp(ts)); + static Packet PacketAt(int64_t ts) { + return Adopt(new int64_t(999)).At(Timestamp(ts)); } static Packet None() { return Packet().At(Timestamp::OneOverPostStream()); } static bool IsNone(const Packet& packet) { return packet.Timestamp() == Timestamp::OneOverPostStream(); } // Return the values of the timestamps of a vector of Packets. - static std::vector TimestampValues( + static std::vector TimestampValues( const std::vector& packets) { - std::vector result; + std::vector result; for (const Packet& p : packets) { result.push_back(p.Timestamp().Value()); } diff --git a/mediapipe/calculators/core/packet_thinner_calculator_test.cc b/mediapipe/calculators/core/packet_thinner_calculator_test.cc index 3522488e..09de0ca7 100644 --- a/mediapipe/calculators/core/packet_thinner_calculator_test.cc +++ b/mediapipe/calculators/core/packet_thinner_calculator_test.cc @@ -61,8 +61,8 @@ class SimpleRunner : public CalculatorRunner { MutableInputs()->Index(0).header = Adopt(video_header.release()); } - std::vector GetOutputTimestamps() const { - std::vector timestamps; + std::vector GetOutputTimestamps() const { + std::vector timestamps; for (const Packet& packet : Outputs().Index(0).packets) { timestamps.emplace_back(packet.Timestamp().Value()); } @@ -90,7 +90,7 @@ TEST(PacketThinnerCalculatorTest, StartAndEndTimeTest) { runner.SetInput({2, 3, 5, 7, 11, 13, 17, 19, 23, 29}); MP_ASSERT_OK(runner.Run()); - const std::vector expected_timestamps = {5, 11}; + const std::vector expected_timestamps = {5, 11}; EXPECT_EQ(expected_timestamps, runner.GetOutputTimestamps()); } @@ -104,7 +104,7 @@ TEST(PacketThinnerCalculatorTest, AsyncUniformStreamThinningTest) { runner.SetInput({2, 4, 6, 8, 10, 12, 14}); MP_ASSERT_OK(runner.Run()); - const std::vector expected_timestamps = {2, 8, 14}; + const std::vector expected_timestamps = {2, 8, 14}; EXPECT_EQ(expected_timestamps, runner.GetOutputTimestamps()); } @@ -123,10 +123,10 @@ TEST(PacketThinnerCalculatorTest, ASyncUniformStreamThinningTestBySidePacket) { SimpleRunner runner(node); runner.SetInput({2, 4, 6, 8, 10, 12, 14}); - runner.MutableSidePackets()->Tag(kPeriodTag) = MakePacket(5); + runner.MutableSidePackets()->Tag(kPeriodTag) = MakePacket(5); MP_ASSERT_OK(runner.Run()); - const std::vector expected_timestamps = {2, 8, 14}; + const std::vector expected_timestamps = {2, 8, 14}; EXPECT_EQ(expected_timestamps, runner.GetOutputTimestamps()); } @@ -143,7 +143,7 @@ TEST(PacketThinnerCalculatorTest, SyncUniformStreamThinningTest1) { runner.SetInput({2, 4, 6, 8, 10, 12, 14}); MP_ASSERT_OK(runner.Run()); - const std::vector expected_timestamps = {2, 6, 10, 14}; + const std::vector expected_timestamps = {2, 6, 10, 14}; EXPECT_EQ(expected_timestamps, runner.GetOutputTimestamps()); } @@ -162,10 +162,10 @@ TEST(PacketThinnerCalculatorTest, SyncUniformStreamThinningTestBySidePacket1) { SimpleRunner runner(node); runner.SetInput({2, 4, 6, 8, 10, 12, 14}); - runner.MutableSidePackets()->Tag(kPeriodTag) = MakePacket(5); + runner.MutableSidePackets()->Tag(kPeriodTag) = MakePacket(5); MP_ASSERT_OK(runner.Run()); - const std::vector expected_timestamps = {2, 6, 10, 14}; + const std::vector expected_timestamps = {2, 6, 10, 14}; EXPECT_EQ(expected_timestamps, runner.GetOutputTimestamps()); } @@ -182,7 +182,7 @@ TEST(PacketThinnerCalculatorTest, SyncUniformStreamThinningTest2) { runner.SetInput({2, 4, 6, 8, 10, 12, 14}); MP_ASSERT_OK(runner.Run()); - const std::vector expected_timestamps = {0, 5, 10, 15}; + const std::vector expected_timestamps = {0, 5, 10, 15}; EXPECT_EQ(expected_timestamps, runner.GetOutputTimestamps()); } @@ -200,7 +200,7 @@ TEST(PacketThinnerCalculatorTest, PrimeStreamThinningTest1) { runner.SetInput({2, 3, 5, 7, 11, 13, 17, 19, 23, 29}); MP_ASSERT_OK(runner.Run()); - const std::vector expected_timestamps = {2, 7, 13, 19, 29}; + const std::vector expected_timestamps = {2, 7, 13, 19, 29}; EXPECT_EQ(expected_timestamps, runner.GetOutputTimestamps()); } @@ -217,7 +217,7 @@ TEST(PacketThinnerCalculatorTest, PrimeStreamThinningTest2) { runner.SetInput({2, 3, 5, 7, 11, 13, 17, 19, 23, 29}); MP_ASSERT_OK(runner.Run()); - const std::vector expected_timestamps = {2, 5, 11, 17, 19, 23, 29}; + const std::vector expected_timestamps = {2, 5, 11, 17, 19, 23, 29}; EXPECT_EQ(expected_timestamps, runner.GetOutputTimestamps()); } @@ -236,7 +236,7 @@ TEST(PacketThinnerCalculatorTest, BoundaryTimestampTest1) { runner.SetInput({2, 3}); MP_ASSERT_OK(runner.Run()); - const std::vector expected_timestamps = {0, 5}; + const std::vector expected_timestamps = {0, 5}; EXPECT_EQ(expected_timestamps, runner.GetOutputTimestamps()); } @@ -254,7 +254,7 @@ TEST(PacketThinnerCalculatorTest, BoundaryTimestampTest2) { runner.SetInput({-4, -3, 8, 9}); MP_ASSERT_OK(runner.Run()); - const std::vector expected_timestamps = {-6, 0, 6, 12}; + const std::vector expected_timestamps = {-6, 0, 6, 12}; EXPECT_EQ(expected_timestamps, runner.GetOutputTimestamps()); } @@ -270,7 +270,7 @@ TEST(PacketThinnerCalculatorTest, FrameRateTest1) { runner.SetFrameRate(1000000.0 / 2); MP_ASSERT_OK(runner.Run()); - const std::vector expected_timestamps = {2, 8, 14}; + const std::vector expected_timestamps = {2, 8, 14}; EXPECT_EQ(expected_timestamps, runner.GetOutputTimestamps()); // The true sampling period is 6. EXPECT_DOUBLE_EQ(1000000.0 / 6, runner.GetFrameRate()); @@ -287,7 +287,7 @@ TEST(PacketThinnerCalculatorTest, FrameRateTest2) { runner.SetInput({8, 16, 24, 32, 40, 48, 56}); runner.SetFrameRate(1000000.0 / 8); MP_ASSERT_OK(runner.Run()); - const std::vector expected_timestamps = {8, 16, 24, 32, 40, 48, 56}; + const std::vector expected_timestamps = {8, 16, 24, 32, 40, 48, 56}; EXPECT_EQ(expected_timestamps, runner.GetOutputTimestamps()); // The true sampling period is still 8. EXPECT_DOUBLE_EQ(1000000.0 / 8, runner.GetFrameRate()); @@ -308,7 +308,7 @@ TEST(PacketThinnerCalculatorTest, FrameRateTest3) { runner.SetFrameRate(1000000.0 / 2); MP_ASSERT_OK(runner.Run()); - const std::vector expected_timestamps = {2, 6, 10, 14}; + const std::vector expected_timestamps = {2, 6, 10, 14}; EXPECT_EQ(expected_timestamps, runner.GetOutputTimestamps()); // The true (long-run) sampling period is 5. EXPECT_DOUBLE_EQ(1000000.0 / 5, runner.GetFrameRate()); @@ -329,7 +329,7 @@ TEST(PacketThinnerCalculatorTest, FrameRateTest4) { runner.SetFrameRate(1000000.0 / 2); MP_ASSERT_OK(runner.Run()); - const std::vector expected_timestamps = {0, 5, 10, 15}; + const std::vector expected_timestamps = {0, 5, 10, 15}; EXPECT_EQ(expected_timestamps, runner.GetOutputTimestamps()); // The true (long-run) sampling period is 5. EXPECT_DOUBLE_EQ(1000000.0 / 5, runner.GetFrameRate()); @@ -349,7 +349,7 @@ TEST(PacketThinnerCalculatorTest, FrameRateTest5) { runner.SetFrameRate(1000000.0 / 8); MP_ASSERT_OK(runner.Run()); - const std::vector expected_timestamps = {10, 15, 25, 30, 40, 50, 55}; + const std::vector expected_timestamps = {10, 15, 25, 30, 40, 50, 55}; EXPECT_EQ(expected_timestamps, runner.GetOutputTimestamps()); // The true (long-run) sampling period is 8. EXPECT_DOUBLE_EQ(1000000.0 / 8, runner.GetFrameRate()); diff --git a/mediapipe/calculators/core/real_time_flow_limiter_calculator_test.cc b/mediapipe/calculators/core/real_time_flow_limiter_calculator_test.cc index 7fddd7fd..a7d7d321 100644 --- a/mediapipe/calculators/core/real_time_flow_limiter_calculator_test.cc +++ b/mediapipe/calculators/core/real_time_flow_limiter_calculator_test.cc @@ -52,8 +52,8 @@ class AtomicSemaphore { }; // Returns the timestamp values for a vector of Packets. -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()); } @@ -283,9 +283,9 @@ TEST_F(RealTimeFlowLimiterCalculatorTest, BackEdgeCloses) { InitializeGraph(1); MP_ASSERT_OK(graph_.StartRun({})); - auto send_packet = [this](const std::string& input_name, int64 n) { + auto send_packet = [this](const std::string& input_name, int64_t n) { MP_EXPECT_OK(graph_.AddPacketToInputStream( - input_name, MakePacket(n).At(Timestamp(n)))); + input_name, MakePacket(n).At(Timestamp(n)))); }; for (int i = 0; i < 10; i++) { @@ -307,14 +307,14 @@ TEST_F(RealTimeFlowLimiterCalculatorTest, BackEdgeCloses) { EXPECT_EQ(10, out_2_packets_.size()); // Timestamps have not been messed with. - EXPECT_EQ(PacketValues(out_1_packets_), + EXPECT_EQ(PacketValues(out_1_packets_), TimestampValues(out_1_packets_)); - EXPECT_EQ(PacketValues(out_2_packets_), + EXPECT_EQ(PacketValues(out_2_packets_), TimestampValues(out_2_packets_)); // Extra inputs on in_1 have been dropped EXPECT_EQ(TimestampValues(out_1_packets_), - (std::vector{0, 10, 20, 30, 40, 50, 60, 70, 80, 90})); + (std::vector{0, 10, 20, 30, 40, 50, 60, 70, 80, 90})); EXPECT_EQ(TimestampValues(out_1_packets_), TimestampValues(out_2_packets_)); // The closing of the stream has been propagated. @@ -339,7 +339,7 @@ TEST_F(RealTimeFlowLimiterCalculatorTest, AllStreamsClose) { EXPECT_EQ(TimestampValues(out_1_packets_), TimestampValues(out_2_packets_)); EXPECT_EQ(TimestampValues(out_1_packets_), - (std::vector{0, 1, 2, 3, 4, 5, 6, 7, 8, 9})); + (std::vector{0, 1, 2, 3, 4, 5, 6, 7, 8, 9})); EXPECT_EQ(1, close_count_); } @@ -392,50 +392,50 @@ TEST(RealTimeFlowLimiterCalculator, TwoStreams) { send_packet("in_a", 1); MP_EXPECT_OK(graph_.WaitUntilIdle()); EXPECT_EQ(allow, false); - EXPECT_EQ(TimestampValues(a_passed), (std::vector{1})); - EXPECT_EQ(TimestampValues(b_passed), (std::vector{})); + EXPECT_EQ(TimestampValues(a_passed), (std::vector{1})); + EXPECT_EQ(TimestampValues(b_passed), (std::vector{})); send_packet("in_a", 2); send_packet("in_b", 1); MP_EXPECT_OK(graph_.WaitUntilIdle()); - EXPECT_EQ(TimestampValues(a_passed), (std::vector{1})); - EXPECT_EQ(TimestampValues(b_passed), (std::vector{1})); + EXPECT_EQ(TimestampValues(a_passed), (std::vector{1})); + EXPECT_EQ(TimestampValues(b_passed), (std::vector{1})); EXPECT_EQ(allow, false); send_packet("finished", 1); MP_EXPECT_OK(graph_.WaitUntilIdle()); - EXPECT_EQ(TimestampValues(a_passed), (std::vector{1})); - EXPECT_EQ(TimestampValues(b_passed), (std::vector{1})); + EXPECT_EQ(TimestampValues(a_passed), (std::vector{1})); + EXPECT_EQ(TimestampValues(b_passed), (std::vector{1})); EXPECT_EQ(allow, true); send_packet("in_b", 2); MP_EXPECT_OK(graph_.WaitUntilIdle()); - EXPECT_EQ(TimestampValues(a_passed), (std::vector{1})); - EXPECT_EQ(TimestampValues(b_passed), (std::vector{1})); + EXPECT_EQ(TimestampValues(a_passed), (std::vector{1})); + EXPECT_EQ(TimestampValues(b_passed), (std::vector{1})); EXPECT_EQ(allow, true); send_packet("in_b", 3); MP_EXPECT_OK(graph_.WaitUntilIdle()); - EXPECT_EQ(TimestampValues(a_passed), (std::vector{1})); - EXPECT_EQ(TimestampValues(b_passed), (std::vector{1, 3})); + EXPECT_EQ(TimestampValues(a_passed), (std::vector{1})); + EXPECT_EQ(TimestampValues(b_passed), (std::vector{1, 3})); EXPECT_EQ(allow, false); send_packet("in_b", 4); MP_EXPECT_OK(graph_.WaitUntilIdle()); - EXPECT_EQ(TimestampValues(a_passed), (std::vector{1})); - EXPECT_EQ(TimestampValues(b_passed), (std::vector{1, 3})); + EXPECT_EQ(TimestampValues(a_passed), (std::vector{1})); + EXPECT_EQ(TimestampValues(b_passed), (std::vector{1, 3})); EXPECT_EQ(allow, false); send_packet("in_a", 3); MP_EXPECT_OK(graph_.WaitUntilIdle()); - EXPECT_EQ(TimestampValues(a_passed), (std::vector{1, 3})); - EXPECT_EQ(TimestampValues(b_passed), (std::vector{1, 3})); + EXPECT_EQ(TimestampValues(a_passed), (std::vector{1, 3})); + EXPECT_EQ(TimestampValues(b_passed), (std::vector{1, 3})); EXPECT_EQ(allow, false); send_packet("finished", 3); MP_EXPECT_OK(graph_.WaitUntilIdle()); - EXPECT_EQ(TimestampValues(a_passed), (std::vector{1, 3})); - EXPECT_EQ(TimestampValues(b_passed), (std::vector{1, 3})); + EXPECT_EQ(TimestampValues(a_passed), (std::vector{1, 3})); + EXPECT_EQ(TimestampValues(b_passed), (std::vector{1, 3})); EXPECT_EQ(allow, true); MP_EXPECT_OK(graph_.CloseAllInputStreams()); @@ -486,7 +486,7 @@ TEST(RealTimeFlowLimiterCalculator, CanConsume) { send_packet("in", 1); MP_EXPECT_OK(graph_.WaitUntilIdle()); EXPECT_EQ(allow, false); - EXPECT_EQ(TimestampValues(in_sampled_packets_), (std::vector{1})); + EXPECT_EQ(TimestampValues(in_sampled_packets_), (std::vector{1})); MP_EXPECT_OK(in_sampled_packets_[0].Consume()); diff --git a/mediapipe/calculators/core/side_packet_to_stream_calculator_test.cc b/mediapipe/calculators/core/side_packet_to_stream_calculator_test.cc index 22c27940..086b73fc 100644 --- a/mediapipe/calculators/core/side_packet_to_stream_calculator_test.cc +++ b/mediapipe/calculators/core/side_packet_to_stream_calculator_test.cc @@ -322,10 +322,10 @@ TEST(SidePacketToStreamCalculator, AtTimestamp) { MP_ASSERT_OK(graph.Initialize(graph_config)); const int expected_value = 20; - const int64 expected_timestamp = 5; + const int64_t expected_timestamp = 5; MP_ASSERT_OK( graph.StartRun({{"side_packet", MakePacket(expected_value)}, - {"timestamp", MakePacket(expected_timestamp)}})); + {"timestamp", MakePacket(expected_timestamp)}})); MP_ASSERT_OK(graph.WaitUntilDone()); @@ -360,11 +360,11 @@ TEST(SidePacketToStreamCalculator, AtTimestamp_MultipleOutputs) { MP_ASSERT_OK(graph.Initialize(graph_config)); const int expected_value0 = 20; const int expected_value1 = 15; - const int64 expected_timestamp = 5; + const int64_t expected_timestamp = 5; MP_ASSERT_OK( graph.StartRun({{"side_packet0", MakePacket(expected_value0)}, {"side_packet1", MakePacket(expected_value1)}, - {"timestamp", MakePacket(expected_timestamp)}})); + {"timestamp", MakePacket(expected_timestamp)}})); MP_ASSERT_OK(graph.WaitUntilDone()); diff --git a/mediapipe/calculators/core/split_proto_list_calculator.cc b/mediapipe/calculators/core/split_proto_list_calculator.cc index df6156e7..fc1fd4df 100644 --- a/mediapipe/calculators/core/split_proto_list_calculator.cc +++ b/mediapipe/calculators/core/split_proto_list_calculator.cc @@ -156,9 +156,9 @@ class SplitListsCalculator : public CalculatorBase { virtual ItemType* AddItem(ListType& list) const = 0; private: - std::vector> ranges_; - int32 max_range_end_ = -1; - int32 total_elements_ = 0; + std::vector> ranges_; + int32_t max_range_end_ = -1; + int32_t total_elements_ = 0; bool element_only_ = false; bool combine_outputs_ = false; };