diff --git a/CHANGELOG.md b/CHANGELOG.md index ab4fa1ab..e83b290e 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,6 +1,6 @@ * Set `pts` and `dts` for `AVPacket` in `FFmpegFrameRecorder.recordPacket()` ([pull #1097](https://github.com/bytedeco/javacv/pull/1097)) - * Prevent premature deallocations with `LeptonicaFrameConverter` ([issue bytedeco/javacpp#272](https://github.com/bytedeco/javacpp/issues/272)) + * Prevent premature deallocations with `LeptonicaFrameConverter` ([issue bytedeco/javacpp#272](https://github.com/bytedeco/javacpp/issues/272)) and `OpenCVFrameConverter.IplImage` ([issue #1101](https://github.com/bytedeco/javacv/issues/1101)) * Fix `OpenCVFrameGrabber` from crashing when in `ImageMode.GRAY` * Add support for multiple inputs to `FFmpegFrameFilter` ([issue #955](https://github.com/bytedeco/javacv/issues/955)) * Fix fps in output of `FFmpegFrameRecorder` by setting deprecated `AVStream.codec.time_base` ([issue #1069](https://github.com/bytedeco/javacv/issues/1069)) diff --git a/src/main/java/org/bytedeco/javacv/OpenCVFrameConverter.java b/src/main/java/org/bytedeco/javacv/OpenCVFrameConverter.java index 321fe142..316b45e8 100644 --- a/src/main/java/org/bytedeco/javacv/OpenCVFrameConverter.java +++ b/src/main/java/org/bytedeco/javacv/OpenCVFrameConverter.java @@ -96,8 +96,7 @@ public IplImage convertToIplImage(Frame frame) { return (IplImage)frame.opaque; } else if (!isEqual(frame, img)) { int depth = getIplImageDepth(frame.imageDepth); - img = depth < 0 ? null : IplImage.createHeader(frame.imageWidth, frame.imageHeight, depth, frame.imageChannels) - .imageData(new BytePointer(new Pointer(frame.image[0].position(0)))) + img = depth < 0 ? null : IplImage.create(frame.imageWidth, frame.imageHeight, depth, frame.imageChannels, new Pointer(frame.image[0].position(0))) .widthStep(frame.imageStride * Math.abs(frame.imageDepth) / 8) .imageSize(frame.image[0].capacity() * Math.abs(frame.imageDepth) / 8); }