diff --git a/mediapipe/examples/desktop/autoflip/calculators/border_detection_calculator.cc b/mediapipe/examples/desktop/autoflip/calculators/border_detection_calculator.cc index caaa368a7..238bcf8be 100644 --- a/mediapipe/examples/desktop/autoflip/calculators/border_detection_calculator.cc +++ b/mediapipe/examples/desktop/autoflip/calculators/border_detection_calculator.cc @@ -214,7 +214,7 @@ double BorderDetectionCalculator::ColorCount(const Color& mask_color, const cv::Mat& image) const { int background_count = 0; for (int i = 0; i < image.rows; i++) { - const uint8* row_ptr = image.ptr(i); + const uint8_t* row_ptr = image.ptr(i); for (int j = 0; j < image.cols * 3; j += 3) { if (std::abs(mask_color.r() - static_cast(row_ptr[j + 2])) <= options_.color_tolerance() && diff --git a/mediapipe/examples/desktop/autoflip/calculators/content_zooming_calculator.cc b/mediapipe/examples/desktop/autoflip/calculators/content_zooming_calculator.cc index 823080786..5241f56e4 100644 --- a/mediapipe/examples/desktop/autoflip/calculators/content_zooming_calculator.cc +++ b/mediapipe/examples/desktop/autoflip/calculators/content_zooming_calculator.cc @@ -142,7 +142,7 @@ class ContentZoomingCalculator : public CalculatorBase { // Stores the first crop rectangle. mediapipe::NormalizedRect first_rect_; // Stores the time of the last "only_required" input. - int64 last_only_required_detection_; + int64_t last_only_required_detection_; // Rect values of last message with detection(s). int last_measured_height_; int last_measured_x_offset_; @@ -500,7 +500,7 @@ bool ContentZoomingCalculator::IsAnimatingToFirstRect( return false; } - const int64 delta_us = (timestamp - first_rect_timestamp_).Value(); + const int64_t delta_us = (timestamp - first_rect_timestamp_).Value(); return (0 <= delta_us && delta_us <= options_.us_to_first_rect()); } @@ -522,8 +522,8 @@ absl::StatusOr ContentZoomingCalculator::GetAnimationRect( RET_CHECK(IsAnimatingToFirstRect(timestamp)) << "Must only be called if animating to first rect."; - const int64 delta_us = (timestamp - first_rect_timestamp_).Value(); - const int64 delay = options_.us_to_first_rect_delay(); + const int64_t delta_us = (timestamp - first_rect_timestamp_).Value(); + const int64_t delay = options_.us_to_first_rect_delay(); const double interpolation = easeInOutQuad(std::max( 0.0, (delta_us - delay) / static_cast(options_.us_to_first_rect() - delay))); diff --git a/mediapipe/examples/desktop/autoflip/calculators/content_zooming_calculator_test.cc b/mediapipe/examples/desktop/autoflip/calculators/content_zooming_calculator_test.cc index 48e4a28a8..0e817b260 100644 --- a/mediapipe/examples/desktop/autoflip/calculators/content_zooming_calculator_test.cc +++ b/mediapipe/examples/desktop/autoflip/calculators/content_zooming_calculator_test.cc @@ -226,7 +226,7 @@ struct AddDetectionFlags { std::optional max_zoom_factor_percent; }; -void AddDetectionFrameSize(const cv::Rect_& position, const int64 time, +void AddDetectionFrameSize(const cv::Rect_& position, const int64_t time, const int width, const int height, CalculatorRunner* runner, const AddDetectionFlags& flags = {}) { @@ -275,7 +275,7 @@ void AddDetectionFrameSize(const cv::Rect_& position, const int64 time, } } -void AddDetection(const cv::Rect_& position, const int64 time, +void AddDetection(const cv::Rect_& position, const int64_t time, CalculatorRunner* runner) { AddDetectionFrameSize(position, time, 1000, 1000, runner); } diff --git a/mediapipe/examples/desktop/autoflip/calculators/scene_cropping_calculator.cc b/mediapipe/examples/desktop/autoflip/calculators/scene_cropping_calculator.cc index 7e286b743..f4cc98674 100644 --- a/mediapipe/examples/desktop/autoflip/calculators/scene_cropping_calculator.cc +++ b/mediapipe/examples/desktop/autoflip/calculators/scene_cropping_calculator.cc @@ -200,7 +200,7 @@ absl::Status ParseAspectRatioString(const std::string& aspect_ratio_string, } void ConstructExternalRenderMessage( const cv::Rect& crop_from_location, const cv::Rect& render_to_location, - const cv::Scalar& padding_color, const uint64 timestamp_us, + const cv::Scalar& padding_color, const uint64_t timestamp_us, ExternalRenderFrame* external_render_message, int frame_width, int frame_height) { auto crop_from_message = @@ -717,7 +717,7 @@ absl::Status SceneCroppingCalculator::FormatAndOutputCroppedFrames( for (int i = 0; i < num_frames; ++i) { // Set default padding color to white. cv::Scalar padding_color_to_add = cv::Scalar(255, 255, 255); - const int64 time_ms = scene_frame_timestamps_[i]; + const int64_t time_ms = scene_frame_timestamps_[i]; if (*apply_padding) { if (has_solid_background_) { double lab[3]; @@ -747,7 +747,7 @@ absl::Status SceneCroppingCalculator::FormatAndOutputCroppedFrames( // Resizes cropped frames, pads frames, and output frames. for (int i = 0; i < num_frames; ++i) { - const int64 time_ms = scene_frame_timestamps_[i]; + const int64_t time_ms = scene_frame_timestamps_[i]; const Timestamp timestamp(time_ms); auto scaled_frame = absl::make_unique( frame_format_, scaled_width, scaled_height); diff --git a/mediapipe/examples/desktop/autoflip/calculators/scene_cropping_calculator_test.cc b/mediapipe/examples/desktop/autoflip/calculators/scene_cropping_calculator_test.cc index c3285ea58..74535022d 100644 --- a/mediapipe/examples/desktop/autoflip/calculators/scene_cropping_calculator_test.cc +++ b/mediapipe/examples/desktop/autoflip/calculators/scene_cropping_calculator_test.cc @@ -175,7 +175,7 @@ constexpr int kMinNumDetections = 0; constexpr int kMaxNumDetections = 10; constexpr int kDownSampleRate = 4; -constexpr int64 kTimestampDiff = 20000; +constexpr int64_t kTimestampDiff = 20000; // Returns a singleton random engine for generating random values. The seed is // fixed for reproducibility. @@ -254,7 +254,7 @@ std::unique_ptr MakeImageFrameFromColor(const cv::Scalar& color, // Randomly generates a number of detections in the range of kMinNumDetections // and kMaxNumDetections. Optionally add a key image frame of random solid color // and given size. -void AddKeyFrameFeatures(const int64 time_ms, const int key_frame_width, +void AddKeyFrameFeatures(const int64_t time_ms, const int key_frame_width, const int key_frame_height, bool randomize, CalculatorRunner::StreamContentsSet* inputs) { Timestamp timestamp(time_ms); @@ -286,7 +286,7 @@ void AddScene(const int start_frame_index, const int num_scene_frames, const int key_frame_width, const int key_frame_height, const int DownSampleRate, CalculatorRunner::StreamContentsSet* inputs) { - int64 time_ms = start_frame_index * kTimestampDiff; + int64_t time_ms = start_frame_index * kTimestampDiff; for (int i = 0; i < num_scene_frames; ++i) { Timestamp timestamp(time_ms); if (inputs->HasTag(kVideoFramesTag)) { @@ -657,7 +657,7 @@ TEST(SceneCroppingCalculatorTest, PadsWithSolidColorFromStaticFeatures) { // Add inputs. auto* inputs = runner->MutableInputs(); - int64 time_ms = 0; + int64_t time_ms = 0; int num_static_features = 0; for (int i = 0; i < kSceneSize; ++i) { Timestamp timestamp(time_ms);