Project import generated by Copybara.

PiperOrigin-RevId: 267274408
This commit is contained in:
MediaPipe Team
2019-09-04 19:00:29 -07:00
committed by jqtang
parent 731d2b9536
commit af67642055
80 changed files with 3181 additions and 0 deletions
@@ -154,8 +154,19 @@ class OpenCvVideoDecoderCalculator : public CalculatorBase {
cv::COLOR_BGRA2RGBA);
}
}
<<<<<<< HEAD
cc->Outputs().Tag("VIDEO").Add(image_frame.release(), timestamp);
decoded_frames_++;
=======
// If the timestamp of the current frame is not greater than the one of the
// previous frame, the new frame will be discarded.
if (prev_timestamp_ < timestamp) {
cc->Outputs().Tag("VIDEO").Add(image_frame.release(), timestamp);
prev_timestamp_ = timestamp;
decoded_frames_++;
}
>>>>>>> Project import generated by Copybara.
return ::mediapipe::OkStatus();
}
@@ -178,6 +189,10 @@ class OpenCvVideoDecoderCalculator : public CalculatorBase {
int frame_count_;
int decoded_frames_ = 0;
ImageFormat::Format format_;
<<<<<<< HEAD
=======
Timestamp prev_timestamp_ = Timestamp::Unset();
>>>>>>> Project import generated by Copybara.
};
REGISTER_CALCULATOR(OpenCvVideoDecoderCalculator);