Internal change
PiperOrigin-RevId: 521981387
This commit is contained in:
parent
46f9270788
commit
05801b9945
|
@ -578,7 +578,7 @@ mediapipe::GpuResources* Graph::GetGpuResources() const {
|
||||||
}
|
}
|
||||||
#endif // !MEDIAPIPE_DISABLE_GPU
|
#endif // !MEDIAPIPE_DISABLE_GPU
|
||||||
|
|
||||||
absl::Status Graph::SetParentGlContext(int64 java_gl_context) {
|
absl::Status Graph::SetParentGlContext(int64_t java_gl_context) {
|
||||||
#if MEDIAPIPE_DISABLE_GPU
|
#if MEDIAPIPE_DISABLE_GPU
|
||||||
LOG(FATAL) << "GPU support has been disabled in this build!";
|
LOG(FATAL) << "GPU support has been disabled in this build!";
|
||||||
#else
|
#else
|
||||||
|
|
|
@ -132,7 +132,8 @@ CreateImageFrameFromByteBuffer(JNIEnv* env, jobject byte_buffer, jint width,
|
||||||
// code might expect to be able to overwrite the buffer after creating an
|
// code might expect to be able to overwrite the buffer after creating an
|
||||||
// ImageFrame from it.
|
// ImageFrame from it.
|
||||||
image_frame->CopyPixelData(
|
image_frame->CopyPixelData(
|
||||||
format, width, height, width_step, static_cast<const uint8*>(buffer_data),
|
format, width, height, width_step,
|
||||||
|
static_cast<const uint8_t*>(buffer_data),
|
||||||
mediapipe::ImageFrame::kGlDefaultAlignmentBoundary);
|
mediapipe::ImageFrame::kGlDefaultAlignmentBoundary);
|
||||||
|
|
||||||
return image_frame;
|
return image_frame;
|
||||||
|
|
|
@ -65,12 +65,12 @@ bool CopyImageDataToByteBuffer(JNIEnv* env, const mediapipe::ImageFrame& image,
|
||||||
|
|
||||||
switch (image.ByteDepth()) {
|
switch (image.ByteDepth()) {
|
||||||
case 1: {
|
case 1: {
|
||||||
uint8* data = static_cast<uint8*>(buffer_data);
|
uint8_t* data = static_cast<uint8_t*>(buffer_data);
|
||||||
image.CopyToBuffer(data, expected_buffer_size);
|
image.CopyToBuffer(data, expected_buffer_size);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
case 2: {
|
case 2: {
|
||||||
uint16* data = static_cast<uint16*>(buffer_data);
|
uint16_t* data = static_cast<uint16_t*>(buffer_data);
|
||||||
image.CopyToBuffer(data, expected_buffer_size);
|
image.CopyToBuffer(data, expected_buffer_size);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
@ -503,8 +503,8 @@ JNIEXPORT jbyteArray JNICALL PACKET_GETTER_METHOD(nativeGetAudioData)(
|
||||||
int offset = 0;
|
int offset = 0;
|
||||||
for (int sample = 0; sample < num_samples; ++sample) {
|
for (int sample = 0; sample < num_samples; ++sample) {
|
||||||
for (int channel = 0; channel < num_channels; ++channel) {
|
for (int channel = 0; channel < num_channels; ++channel) {
|
||||||
int16 value =
|
int16_t value =
|
||||||
static_cast<int16>(audio_mat(channel, sample) * kMultiplier);
|
static_cast<int16_t>(audio_mat(channel, sample) * kMultiplier);
|
||||||
// The java and native has the same byte order, by default is little
|
// The java and native has the same byte order, by default is little
|
||||||
// Endian, we can safely copy data directly, we have tests to cover
|
// Endian, we can safely copy data directly, we have tests to cover
|
||||||
// this.
|
// this.
|
||||||
|
|
Loading…
Reference in New Issue
Block a user