Merge "ImageWriter: Do not override UNKNOWN format twice" into qt-qpr1-dev
am: b78d7355b7
Change-Id: I7d1946267cfe2ea848850cac494dd2a8bd383755
This commit is contained in:
@@ -192,13 +192,15 @@ public class ImageWriter implements AutoCloseable {
|
|||||||
|
|
||||||
mMaxImages = maxImages;
|
mMaxImages = maxImages;
|
||||||
|
|
||||||
if (format == ImageFormat.UNKNOWN) {
|
|
||||||
format = SurfaceUtils.getSurfaceFormat(surface);
|
|
||||||
}
|
|
||||||
// Note that the underlying BufferQueue is working in synchronous mode
|
// Note that the underlying BufferQueue is working in synchronous mode
|
||||||
// to avoid dropping any buffers.
|
// to avoid dropping any buffers.
|
||||||
mNativeContext = nativeInit(new WeakReference<>(this), surface, maxImages, format);
|
mNativeContext = nativeInit(new WeakReference<>(this), surface, maxImages, format);
|
||||||
|
|
||||||
|
// nativeInit internally overrides UNKNOWN format. So does surface format query after
|
||||||
|
// nativeInit and before getEstimatedNativeAllocBytes().
|
||||||
|
if (format == ImageFormat.UNKNOWN) {
|
||||||
|
format = SurfaceUtils.getSurfaceFormat(surface);
|
||||||
|
}
|
||||||
// Estimate the native buffer allocation size and register it so it gets accounted for
|
// Estimate the native buffer allocation size and register it so it gets accounted for
|
||||||
// during GC. Note that this doesn't include the buffers required by the buffer queue
|
// during GC. Note that this doesn't include the buffers required by the buffer queue
|
||||||
// itself and the buffers requested by the producer.
|
// itself and the buffers requested by the producer.
|
||||||
|
|||||||
Reference in New Issue
Block a user