From 5fc0d26d8d382cc13ae6852e52e8a28297abb6fd Mon Sep 17 00:00:00 2001 From: MediaPipe Team Date: Fri, 14 Apr 2023 21:31:09 -0700 Subject: [PATCH] Internal change PiperOrigin-RevId: 524457848 --- .../core/constant_side_packet_calculator.cc | 4 +- .../calculators/core/gate_calculator_test.cc | 68 +++++++++---------- .../core/string_to_int_calculator.cc | 8 +-- 3 files changed, 40 insertions(+), 40 deletions(-) diff --git a/mediapipe/calculators/core/constant_side_packet_calculator.cc b/mediapipe/calculators/core/constant_side_packet_calculator.cc index 45ff07110..509f7e9dd 100644 --- a/mediapipe/calculators/core/constant_side_packet_calculator.cc +++ b/mediapipe/calculators/core/constant_side_packet_calculator.cc @@ -78,7 +78,7 @@ class ConstantSidePacketCalculator : public CalculatorBase { } else if (packet_options.has_string_value()) { packet.Set(); } else if (packet_options.has_uint64_value()) { - packet.Set(); + packet.Set(); } else if (packet_options.has_classification_list_value()) { packet.Set(); } else if (packet_options.has_landmark_list_value()) { @@ -112,7 +112,7 @@ class ConstantSidePacketCalculator : public CalculatorBase { } else if (packet_options.has_string_value()) { packet.Set(MakePacket(packet_options.string_value())); } else if (packet_options.has_uint64_value()) { - packet.Set(MakePacket(packet_options.uint64_value())); + packet.Set(MakePacket(packet_options.uint64_value())); } else if (packet_options.has_classification_list_value()) { packet.Set(MakePacket( packet_options.classification_list_value())); diff --git a/mediapipe/calculators/core/gate_calculator_test.cc b/mediapipe/calculators/core/gate_calculator_test.cc index c734ddb5f..192019820 100644 --- a/mediapipe/calculators/core/gate_calculator_test.cc +++ b/mediapipe/calculators/core/gate_calculator_test.cc @@ -35,14 +35,14 @@ class GateCalculatorTest : public ::testing::Test { } // Use this when ALLOW/DISALLOW input is provided as a side packet. - void RunTimeStep(int64 timestamp, bool stream_payload) { + void RunTimeStep(int64_t timestamp, bool stream_payload) { runner_->MutableInputs()->Get("", 0).packets.push_back( MakePacket(stream_payload).At(Timestamp(timestamp))); MP_ASSERT_OK(runner_->Run()) << "Calculator execution failed."; } // Use this when ALLOW/DISALLOW input is provided as an input stream. - void RunTimeStep(int64 timestamp, const std::string& control_tag, + void RunTimeStep(int64_t timestamp, const std::string& control_tag, bool control) { runner_->MutableInputs()->Get("", 0).packets.push_back( MakePacket(true).At(Timestamp(timestamp))); @@ -134,9 +134,9 @@ TEST_F(GateCalculatorTest, AllowByALLOWOptionToTrue) { } )"); - constexpr int64 kTimestampValue0 = 42; + constexpr int64_t kTimestampValue0 = 42; RunTimeStep(kTimestampValue0, true); - constexpr int64 kTimestampValue1 = 43; + constexpr int64_t kTimestampValue1 = 43; RunTimeStep(kTimestampValue1, false); const std::vector& output = runner()->Outputs().Get("", 0).packets; @@ -159,9 +159,9 @@ TEST_F(GateCalculatorTest, DisallowByALLOWOptionSetToFalse) { } )"); - constexpr int64 kTimestampValue0 = 42; + constexpr int64_t kTimestampValue0 = 42; RunTimeStep(kTimestampValue0, true); - constexpr int64 kTimestampValue1 = 43; + constexpr int64_t kTimestampValue1 = 43; RunTimeStep(kTimestampValue1, false); const std::vector& output = runner()->Outputs().Get("", 0).packets; @@ -175,9 +175,9 @@ TEST_F(GateCalculatorTest, DisallowByALLOWOptionNotSet) { output_stream: "test_output" )"); - constexpr int64 kTimestampValue0 = 42; + constexpr int64_t kTimestampValue0 = 42; RunTimeStep(kTimestampValue0, true); - constexpr int64 kTimestampValue1 = 43; + constexpr int64_t kTimestampValue1 = 43; RunTimeStep(kTimestampValue1, false); const std::vector& output = runner()->Outputs().Get("", 0).packets; @@ -193,9 +193,9 @@ TEST_F(GateCalculatorTest, AllowByALLOWSidePacketSetToTrue) { )"); runner()->MutableSidePackets()->Tag(kAllowTag) = Adopt(new bool(true)); - constexpr int64 kTimestampValue0 = 42; + constexpr int64_t kTimestampValue0 = 42; RunTimeStep(kTimestampValue0, true); - constexpr int64 kTimestampValue1 = 43; + constexpr int64_t kTimestampValue1 = 43; RunTimeStep(kTimestampValue1, false); const std::vector& output = runner()->Outputs().Get("", 0).packets; @@ -215,9 +215,9 @@ TEST_F(GateCalculatorTest, AllowByDisallowSidePacketSetToFalse) { )"); runner()->MutableSidePackets()->Tag(kDisallowTag) = Adopt(new bool(false)); - constexpr int64 kTimestampValue0 = 42; + constexpr int64_t kTimestampValue0 = 42; RunTimeStep(kTimestampValue0, true); - constexpr int64 kTimestampValue1 = 43; + constexpr int64_t kTimestampValue1 = 43; RunTimeStep(kTimestampValue1, false); const std::vector& output = runner()->Outputs().Get("", 0).packets; @@ -237,9 +237,9 @@ TEST_F(GateCalculatorTest, DisallowByALLOWSidePacketSetToFalse) { )"); runner()->MutableSidePackets()->Tag(kAllowTag) = Adopt(new bool(false)); - constexpr int64 kTimestampValue0 = 42; + constexpr int64_t kTimestampValue0 = 42; RunTimeStep(kTimestampValue0, true); - constexpr int64 kTimestampValue1 = 43; + constexpr int64_t kTimestampValue1 = 43; RunTimeStep(kTimestampValue1, false); const std::vector& output = runner()->Outputs().Get("", 0).packets; @@ -255,9 +255,9 @@ TEST_F(GateCalculatorTest, DisallowByDISALLOWSidePacketSetToTrue) { )"); runner()->MutableSidePackets()->Tag(kDisallowTag) = Adopt(new bool(true)); - constexpr int64 kTimestampValue0 = 42; + constexpr int64_t kTimestampValue0 = 42; RunTimeStep(kTimestampValue0, true); - constexpr int64 kTimestampValue1 = 43; + constexpr int64_t kTimestampValue1 = 43; RunTimeStep(kTimestampValue1, false); const std::vector& output = runner()->Outputs().Get("", 0).packets; @@ -272,13 +272,13 @@ TEST_F(GateCalculatorTest, Allow) { output_stream: "test_output" )"); - constexpr int64 kTimestampValue0 = 42; + constexpr int64_t kTimestampValue0 = 42; RunTimeStep(kTimestampValue0, "ALLOW", true); - constexpr int64 kTimestampValue1 = 43; + constexpr int64_t kTimestampValue1 = 43; RunTimeStep(kTimestampValue1, "ALLOW", false); - constexpr int64 kTimestampValue2 = 44; + constexpr int64_t kTimestampValue2 = 44; RunTimeStep(kTimestampValue2, "ALLOW", true); - constexpr int64 kTimestampValue3 = 45; + constexpr int64_t kTimestampValue3 = 45; RunTimeStep(kTimestampValue3, "ALLOW", false); const std::vector& output = runner()->Outputs().Get("", 0).packets; @@ -297,13 +297,13 @@ TEST_F(GateCalculatorTest, Disallow) { output_stream: "test_output" )"); - constexpr int64 kTimestampValue0 = 42; + constexpr int64_t kTimestampValue0 = 42; RunTimeStep(kTimestampValue0, "DISALLOW", true); - constexpr int64 kTimestampValue1 = 43; + constexpr int64_t kTimestampValue1 = 43; RunTimeStep(kTimestampValue1, "DISALLOW", false); - constexpr int64 kTimestampValue2 = 44; + constexpr int64_t kTimestampValue2 = 44; RunTimeStep(kTimestampValue2, "DISALLOW", true); - constexpr int64 kTimestampValue3 = 45; + constexpr int64_t kTimestampValue3 = 45; RunTimeStep(kTimestampValue3, "DISALLOW", false); const std::vector& output = runner()->Outputs().Get("", 0).packets; @@ -323,13 +323,13 @@ TEST_F(GateCalculatorTest, AllowWithStateChange) { output_stream: "STATE_CHANGE:state_changed" )"); - constexpr int64 kTimestampValue0 = 42; + constexpr int64_t kTimestampValue0 = 42; RunTimeStep(kTimestampValue0, "ALLOW", false); - constexpr int64 kTimestampValue1 = 43; + constexpr int64_t kTimestampValue1 = 43; RunTimeStep(kTimestampValue1, "ALLOW", true); - constexpr int64 kTimestampValue2 = 44; + constexpr int64_t kTimestampValue2 = 44; RunTimeStep(kTimestampValue2, "ALLOW", true); - constexpr int64 kTimestampValue3 = 45; + constexpr int64_t kTimestampValue3 = 45; RunTimeStep(kTimestampValue3, "ALLOW", false); const std::vector& output = @@ -379,13 +379,13 @@ TEST_F(GateCalculatorTest, DisallowWithStateChange) { output_stream: "STATE_CHANGE:state_changed" )"); - constexpr int64 kTimestampValue0 = 42; + constexpr int64_t kTimestampValue0 = 42; RunTimeStep(kTimestampValue0, "DISALLOW", true); - constexpr int64 kTimestampValue1 = 43; + constexpr int64_t kTimestampValue1 = 43; RunTimeStep(kTimestampValue1, "DISALLOW", false); - constexpr int64 kTimestampValue2 = 44; + constexpr int64_t kTimestampValue2 = 44; RunTimeStep(kTimestampValue2, "DISALLOW", false); - constexpr int64 kTimestampValue3 = 45; + constexpr int64_t kTimestampValue3 = 45; RunTimeStep(kTimestampValue3, "DISALLOW", true); const std::vector& output = @@ -432,7 +432,7 @@ TEST_F(GateCalculatorTest, DisallowInitialNoStateTransition) { output_stream: "STATE_CHANGE:state_changed" )"); - constexpr int64 kTimestampValue0 = 42; + constexpr int64_t kTimestampValue0 = 42; RunTimeStep(kTimestampValue0, "DISALLOW", false); const std::vector& output = @@ -450,7 +450,7 @@ TEST_F(GateCalculatorTest, AllowInitialNoStateTransition) { output_stream: "STATE_CHANGE:state_changed" )"); - constexpr int64 kTimestampValue0 = 42; + constexpr int64_t kTimestampValue0 = 42; RunTimeStep(kTimestampValue0, "ALLOW", true); const std::vector& output = diff --git a/mediapipe/calculators/core/string_to_int_calculator.cc b/mediapipe/calculators/core/string_to_int_calculator.cc index ecd55afb6..fa67aa8e5 100644 --- a/mediapipe/calculators/core/string_to_int_calculator.cc +++ b/mediapipe/calculators/core/string_to_int_calculator.cc @@ -64,16 +64,16 @@ REGISTER_CALCULATOR(StringToIntCalculator); using StringToUintCalculator = StringToIntCalculatorTemplate; REGISTER_CALCULATOR(StringToUintCalculator); -using StringToInt32Calculator = StringToIntCalculatorTemplate; +using StringToInt32Calculator = StringToIntCalculatorTemplate; REGISTER_CALCULATOR(StringToInt32Calculator); -using StringToUint32Calculator = StringToIntCalculatorTemplate; +using StringToUint32Calculator = StringToIntCalculatorTemplate; REGISTER_CALCULATOR(StringToUint32Calculator); -using StringToInt64Calculator = StringToIntCalculatorTemplate; +using StringToInt64Calculator = StringToIntCalculatorTemplate; REGISTER_CALCULATOR(StringToInt64Calculator); -using StringToUint64Calculator = StringToIntCalculatorTemplate; +using StringToUint64Calculator = StringToIntCalculatorTemplate; REGISTER_CALCULATOR(StringToUint64Calculator); } // namespace mediapipe