summaryrefslogtreecommitdiffstats
path: root/tests/camera2/camera2.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'tests/camera2/camera2.cpp')
-rw-r--r--tests/camera2/camera2.cpp24
1 files changed, 15 insertions, 9 deletions
diff --git a/tests/camera2/camera2.cpp b/tests/camera2/camera2.cpp
index 73f8c61..e3e7d9a 100644
--- a/tests/camera2/camera2.cpp
+++ b/tests/camera2/camera2.cpp
@@ -381,8 +381,10 @@ TEST_F(Camera2Test, Capture1Raw) {
ASSERT_NO_FATAL_FAILURE(setUpCamera(id));
- sp<BufferQueue> bq = new BufferQueue();
- sp<CpuConsumer> rawConsumer = new CpuConsumer(bq, 1);
+ sp<IGraphicBufferProducer> bqProducer;
+ sp<IGraphicBufferConsumer> bqConsumer;
+ BufferQueue::createBufferQueue(&bqProducer, &bqConsumer);
+ sp<CpuConsumer> rawConsumer = new CpuConsumer(bqConsumer, 1);
sp<FrameWaiter> rawWaiter = new FrameWaiter();
rawConsumer->setFrameAvailableListener(rawWaiter);
@@ -413,7 +415,7 @@ TEST_F(Camera2Test, Capture1Raw) {
int streamId;
ASSERT_NO_FATAL_FAILURE(
- setUpStream(bq, width, height, format, &streamId) );
+ setUpStream(bqProducer, width, height, format, &streamId) );
camera_metadata_t *request;
request = allocate_camera_metadata(20, 2000);
@@ -515,8 +517,10 @@ TEST_F(Camera2Test, CaptureBurstRaw) {
ASSERT_NO_FATAL_FAILURE(setUpCamera(id));
- sp<BufferQueue> bq = new BufferQueue();
- sp<CpuConsumer> rawConsumer = new CpuConsumer(bq, 1);
+ sp<IGraphicBufferProducer> bqProducer;
+ sp<IGraphicBufferConsumer> bqConsumer;
+ BufferQueue::createBufferQueue(&bqProducer, &bqConsumer);
+ sp<CpuConsumer> rawConsumer = new CpuConsumer(bqConsumer, 1);
sp<FrameWaiter> rawWaiter = new FrameWaiter();
rawConsumer->setFrameAvailableListener(rawWaiter);
@@ -547,7 +551,7 @@ TEST_F(Camera2Test, CaptureBurstRaw) {
int streamId;
ASSERT_NO_FATAL_FAILURE(
- setUpStream(bq, width, height, format, &streamId) );
+ setUpStream(bqProducer, width, height, format, &streamId) );
camera_metadata_t *request;
request = allocate_camera_metadata(20, 2000);
@@ -696,8 +700,10 @@ TEST_F(Camera2Test, Capture1Jpeg) {
ASSERT_NO_FATAL_FAILURE(setUpCamera(id));
- sp<BufferQueue> bq = new BufferQueue();
- sp<CpuConsumer> jpegConsumer = new CpuConsumer(bq, 1);
+ sp<IGraphicBufferProducer> bqProducer;
+ sp<IGraphicBufferConsumer> bqConsumer;
+ BufferQueue::createBufferQueue(&bqProducer, &bqConsumer);
+ sp<CpuConsumer> jpegConsumer = new CpuConsumer(bqConsumer, 1);
sp<FrameWaiter> jpegWaiter = new FrameWaiter();
jpegConsumer->setFrameAvailableListener(jpegWaiter);
@@ -716,7 +722,7 @@ TEST_F(Camera2Test, Capture1Jpeg) {
int streamId;
ASSERT_NO_FATAL_FAILURE(
- setUpStream(bq, width, height, format, &streamId) );
+ setUpStream(bqProducer, width, height, format, &streamId) );
camera_metadata_t *request;
request = allocate_camera_metadata(20, 2000);