Skip to content

Commit

Permalink
No public description
Browse files Browse the repository at this point in the history
PiperOrigin-RevId: 711463273
  • Loading branch information
vrabaud authored and copybara-github committed Jan 2, 2025
1 parent 9d6d8f6 commit cf2021a
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -113,6 +113,7 @@ class OpenCvVideoDecoderCalculator : public CalculatorBase {
return mediapipe::InvalidArgumentErrorBuilder(MEDIAPIPE_LOC)
<< "Fail to open video file at " << input_file_path;
}
cap_->set(cv::CAP_PROP_ORIENTATION_AUTO, true);
width_ = static_cast<int>(cap_->get(cv::CAP_PROP_FRAME_WIDTH));
height_ = static_cast<int>(cap_->get(cv::CAP_PROP_FRAME_HEIGHT));
double fps = static_cast<double>(cap_->get(cv::CAP_PROP_FPS));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -446,7 +446,7 @@ JNIEXPORT jlong JNICALL PACKET_CREATOR_METHOD(nativeCreateFloat32Array)(
// The reinterpret_cast is needed to make the Adopt template recognize
// that this is an array - this way Holder will call delete[].
mediapipe::Packet packet =
mediapipe::Adopt(reinterpret_cast<float(*)[]>(floats));
mediapipe::Adopt(reinterpret_cast<float (*)[]>(floats));
return CreatePacketWithContext(context, packet);
}

Expand Down Expand Up @@ -479,7 +479,7 @@ JNIEXPORT jlong JNICALL PACKET_CREATOR_METHOD(nativeCreateInt32Array)(
// The reinterpret_cast is needed to make the Adopt template recognize
// that this is an array - this way Holder will call delete[].
mediapipe::Packet packet =
mediapipe::Adopt(reinterpret_cast<int32_t(*)[]>(ints));
mediapipe::Adopt(reinterpret_cast<int32_t (*)[]>(ints));
return CreatePacketWithContext(context, packet);
}

Expand Down
4 changes: 2 additions & 2 deletions mediapipe/python/pybind/packet_creator.cc
Original file line number Diff line number Diff line change
Expand Up @@ -390,7 +390,7 @@ void PublicPacketCreators(pybind11::module* m) {
[](const std::vector<int>& data) {
int* ints = new int[data.size()];
std::copy(data.begin(), data.end(), ints);
return Adopt(reinterpret_cast<int(*)[]>(ints));
return Adopt(reinterpret_cast<int (*)[]>(ints));
},
R"doc(Create a MediaPipe int array Packet from a list of integers.
Expand All @@ -413,7 +413,7 @@ void PublicPacketCreators(pybind11::module* m) {
[](const std::vector<float>& data) {
float* floats = new float[data.size()];
std::copy(data.begin(), data.end(), floats);
return Adopt(reinterpret_cast<float(*)[]>(floats));
return Adopt(reinterpret_cast<float (*)[]>(floats));
},
R"doc(Create a MediaPipe float array Packet from a list of floats.
Expand Down

0 comments on commit cf2021a

Please sign in to comment.