summaryrefslogtreecommitdiffstats
path: root/tests/camera2
diff options
context:
space:
mode:
authorDan Stoza <stoza@google.com>2014-04-07 13:39:37 -0700
committerDan Stoza <stoza@google.com>2014-04-07 13:39:37 -0700
commit5dce9e4f26a2f227eeb4607128e3c3a92a277ae6 (patch)
tree0a8b87cd98221408dcf5b78f48471aa4fb0cba93 /tests/camera2
parentd5aa52756fe21c23096e333afc74e3589a11d216 (diff)
downloadhardware_libhardware-5dce9e4f26a2f227eeb4607128e3c3a92a277ae6.zip
hardware_libhardware-5dce9e4f26a2f227eeb4607128e3c3a92a277ae6.tar.gz
hardware_libhardware-5dce9e4f26a2f227eeb4607128e3c3a92a277ae6.tar.bz2
Remove deprecated BufferQueue constructor
Bug: 13415624 Change-Id: Ia2ed4b5bc7289f8d8ab6e6a431746b43c81842bc
Diffstat (limited to 'tests/camera2')
-rw-r--r--tests/camera2/CameraMultiStreamTests.cpp8
-rw-r--r--tests/camera2/CameraStreamFixture.h8
-rw-r--r--tests/camera2/camera2.cpp24
3 files changed, 25 insertions, 15 deletions
diff --git a/tests/camera2/CameraMultiStreamTests.cpp b/tests/camera2/CameraMultiStreamTests.cpp
index a78950c..75c7139 100644
--- a/tests/camera2/CameraMultiStreamTests.cpp
+++ b/tests/camera2/CameraMultiStreamTests.cpp
@@ -181,11 +181,13 @@ public:
mHeight(height) {
mFormat = param.mFormat;
if (useCpuConsumer) {
- sp<BufferQueue> bq = new BufferQueue();
- mCpuConsumer = new CpuConsumer(bq, param.mHeapCount);
+ sp<IGraphicBufferProducer> producer;
+ sp<IGraphicBufferConsumer> consumer;
+ BufferQueue::createBufferQueue(&producer, &consumer);
+ mCpuConsumer = new CpuConsumer(consumer, param.mHeapCount);
mCpuConsumer->setName(String8(
"CameraMultiStreamTest::mCpuConsumer"));
- mNativeWindow = new Surface(bq);
+ mNativeWindow = new Surface(producer);
} else {
// Render the stream to screen.
mCpuConsumer = NULL;
diff --git a/tests/camera2/CameraStreamFixture.h b/tests/camera2/CameraStreamFixture.h
index a1f3aae..12b1971 100644
--- a/tests/camera2/CameraStreamFixture.h
+++ b/tests/camera2/CameraStreamFixture.h
@@ -161,11 +161,13 @@ protected:
sp<CameraDeviceBase> device = mDevice;
CameraStreamParams p = mParam;
- sp<BufferQueue> bq = new BufferQueue();
- mCpuConsumer = new CpuConsumer(bq, p.mHeapCount);
+ sp<IGraphicBufferProducer> producer;
+ sp<IGraphicBufferConsumer> consumer;
+ BufferQueue::createBufferQueue(&producer, &consumer);
+ mCpuConsumer = new CpuConsumer(consumer, p.mHeapCount);
mCpuConsumer->setName(String8("CameraStreamTest::mCpuConsumer"));
- mNativeWindow = new Surface(bq);
+ mNativeWindow = new Surface(producer);
int format = MapAutoFormat(p.mFormat);
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);