}
if (mFormat == HAL_PIXEL_FORMAT_BLOB) {
- res = native_window_set_buffers_geometry(mConsumerInterface.get(),
- mSize, 1, mFormat);
+ res = native_window_set_buffers_dimensions(mConsumerInterface.get(),
+ mSize, 1);
if (res != OK) {
- ALOGE("%s: Unable to configure compressed stream buffer geometry"
+ ALOGE("%s: Unable to configure compressed stream buffer dimensions"
" %d x %d, size %zu for stream %d",
__FUNCTION__, mWidth, mHeight, mSize, mId);
return res;
}
} else {
- res = native_window_set_buffers_geometry(mConsumerInterface.get(),
- mWidth, mHeight, mFormat);
+ res = native_window_set_buffers_dimensions(mConsumerInterface.get(),
+ mWidth, mHeight);
if (res != OK) {
- ALOGE("%s: Unable to configure stream buffer geometry"
- " %d x %d, format 0x%x for stream %d",
- __FUNCTION__, mWidth, mHeight, mFormat, mId);
+ ALOGE("%s: Unable to configure stream buffer dimensions"
+ " %d x %d for stream %d",
+ __FUNCTION__, mWidth, mHeight, mId);
return res;
}
}
+ res = native_window_set_buffers_format(mConsumerInterface.get(), mFormat);
+ if (res != OK) {
+ ALOGE("%s: Unable to configure stream buffer format"
+ " %#x for stream %d",
+ __FUNCTION__, mFormat, mId);
+ return res;
+ }
+
int maxConsumerBuffers;
res = mConsumerInterface->query(mConsumerInterface.get(),
NATIVE_WINDOW_MIN_UNDEQUEUED_BUFFERS, &maxConsumerBuffers);
if (mMaxSize == 0) {
// For buffers of known size
- res = native_window_set_buffers_geometry(mConsumer.get(),
- camera3_stream::width, camera3_stream::height,
- camera3_stream::format);
+ res = native_window_set_buffers_dimensions(mConsumer.get(),
+ camera3_stream::width, camera3_stream::height);
} else {
// For buffers with bounded size
- res = native_window_set_buffers_geometry(mConsumer.get(),
- mMaxSize, 1,
- camera3_stream::format);
+ res = native_window_set_buffers_dimensions(mConsumer.get(),
+ mMaxSize, 1);
}
if (res != OK) {
- ALOGE("%s: Unable to configure stream buffer geometry"
- " %d x %d, format %x for stream %d",
+ ALOGE("%s: Unable to configure stream buffer dimensions"
+ " %d x %d (maxSize %zu) for stream %d",
__FUNCTION__, camera3_stream::width, camera3_stream::height,
- camera3_stream::format, mId);
+ mMaxSize, mId);
+ return res;
+ }
+ res = native_window_set_buffers_format(mConsumer.get(),
+ camera3_stream::format);
+ if (res != OK) {
+ ALOGE("%s: Unable to configure stream buffer format %#x for stream %d",
+ __FUNCTION__, camera3_stream::format, mId);
return res;
}