diff options
author | Dan Stoza <stoza@google.com> | 2014-04-08 18:29:56 +0000 |
---|---|---|
committer | Android (Google) Code Review <android-gerrit@google.com> | 2014-04-08 18:29:56 +0000 |
commit | 692231f348076dc98724342e21ac9e67c7b0334e (patch) | |
tree | b232531b13a2c530616d2983c996a82fe552a8cd | |
parent | 46781fd8f60ed0eea0cc2c8c751eb62c4aac5d84 (diff) | |
parent | 5dce9e4f26a2f227eeb4607128e3c3a92a277ae6 (diff) | |
download | hardware_libhardware-692231f348076dc98724342e21ac9e67c7b0334e.zip hardware_libhardware-692231f348076dc98724342e21ac9e67c7b0334e.tar.gz hardware_libhardware-692231f348076dc98724342e21ac9e67c7b0334e.tar.bz2 |
Merge "Remove deprecated BufferQueue constructor"
-rw-r--r-- | tests/camera2/CameraMultiStreamTests.cpp | 8 | ||||
-rw-r--r-- | tests/camera2/CameraStreamFixture.h | 8 | ||||
-rw-r--r-- | tests/camera2/camera2.cpp | 24 |
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); |