Camera: Update stream consumer usage flag

It is possible that the current default consumer usage
flag may not be supported by some provider implementations.
Use either HW composer or some other flag that is appropriate
for the specific use case.

Merged-In: I04f89bf67166805191d6d40e5bd93c15ebc97ea6
Bug: 63913159
Test: vts-tradefed run commandAndExit vts --skip-all-system-status-check
--skip-preconditions --primary-abi-only --module
VtsHalCameraProviderV2_4Target -l INFO

Change-Id: I04f89bf67166805191d6d40e5bd93c15ebc97ea6
This commit is contained in:
Emilian Peev 2017-07-26 09:46:38 +01:00
parent 1bef889c75
commit 7596b25bf9

View file

@ -2442,7 +2442,8 @@ TEST_F(CameraHidlTest, configureStreamsAvailableOutputs) {
Stream stream = {streamId, StreamType::OUTPUT,
static_cast<uint32_t> (it.width),
static_cast<uint32_t> (it.height),
static_cast<PixelFormat> (it.format), 0, 0,
static_cast<PixelFormat> (it.format),
GRALLOC1_CONSUMER_USAGE_HWCOMPOSER, 0,
StreamRotation::ROTATION_0};
::android::hardware::hidl_vec<Stream> streams = {stream};
StreamConfiguration config = {streams,
@ -2491,7 +2492,8 @@ TEST_F(CameraHidlTest, configureStreamsInvalidOutputs) {
static_cast<uint32_t> (0),
static_cast<uint32_t> (0),
static_cast<PixelFormat> (outputStreams[0].format),
0, 0, StreamRotation::ROTATION_0};
GRALLOC1_CONSUMER_USAGE_HWCOMPOSER, 0,
StreamRotation::ROTATION_0};
::android::hardware::hidl_vec<Stream> streams = {stream};
StreamConfiguration config = {streams,
StreamConfigurationMode::NORMAL_MODE};
@ -2506,7 +2508,8 @@ TEST_F(CameraHidlTest, configureStreamsInvalidOutputs) {
static_cast<uint32_t> (UINT32_MAX),
static_cast<uint32_t> (UINT32_MAX),
static_cast<PixelFormat> (outputStreams[0].format),
0, 0, StreamRotation::ROTATION_0};
GRALLOC1_CONSUMER_USAGE_HWCOMPOSER, 0,
StreamRotation::ROTATION_0};
streams[0] = stream;
config = {streams,
StreamConfigurationMode::NORMAL_MODE};
@ -2521,7 +2524,8 @@ TEST_F(CameraHidlTest, configureStreamsInvalidOutputs) {
static_cast<uint32_t> (it.width),
static_cast<uint32_t> (it.height),
static_cast<PixelFormat> (UINT32_MAX),
0, 0, StreamRotation::ROTATION_0};
GRALLOC1_CONSUMER_USAGE_HWCOMPOSER, 0,
StreamRotation::ROTATION_0};
streams[0] = stream;
config = {streams,
StreamConfigurationMode::NORMAL_MODE};
@ -2535,7 +2539,8 @@ TEST_F(CameraHidlTest, configureStreamsInvalidOutputs) {
static_cast<uint32_t> (it.width),
static_cast<uint32_t> (it.height),
static_cast<PixelFormat> (it.format),
0, 0, static_cast<StreamRotation> (UINT32_MAX)};
GRALLOC1_CONSUMER_USAGE_HWCOMPOSER, 0,
static_cast<StreamRotation> (UINT32_MAX)};
streams[0] = stream;
config = {streams,
StreamConfigurationMode::NORMAL_MODE};
@ -2617,7 +2622,8 @@ TEST_F(CameraHidlTest, configureStreamsZSLInputOutputs) {
Stream outputStream = {streamId++, StreamType::OUTPUT,
static_cast<uint32_t> (outputIter.width),
static_cast<uint32_t> (outputIter.height),
static_cast<PixelFormat> (outputIter.format), 0, 0,
static_cast<PixelFormat> (outputIter.format),
GRALLOC1_CONSUMER_USAGE_HWCOMPOSER, 0,
StreamRotation::ROTATION_0};
::android::hardware::hidl_vec<Stream> streams = {
@ -2679,12 +2685,14 @@ TEST_F(CameraHidlTest, configureStreamsPreviewStillOutputs) {
Stream previewStream = {streamId++, StreamType::OUTPUT,
static_cast<uint32_t> (previewIter.width),
static_cast<uint32_t> (previewIter.height),
static_cast<PixelFormat> (previewIter.format), 0, 0,
static_cast<PixelFormat> (previewIter.format),
GRALLOC1_CONSUMER_USAGE_HWCOMPOSER, 0,
StreamRotation::ROTATION_0};
Stream blobStream = {streamId++, StreamType::OUTPUT,
static_cast<uint32_t> (blobIter.width),
static_cast<uint32_t> (blobIter.height),
static_cast<PixelFormat> (blobIter.format), 0, 0,
static_cast<PixelFormat> (blobIter.format),
GRALLOC1_CONSUMER_USAGE_CPU_READ, 0,
StreamRotation::ROTATION_0};
::android::hardware::hidl_vec<Stream> streams = {
previewStream, blobStream};
@ -2740,7 +2748,8 @@ TEST_F(CameraHidlTest, configureStreamsConstrainedOutputs) {
Stream stream = {streamId, StreamType::OUTPUT,
static_cast<uint32_t> (hfrStream.width),
static_cast<uint32_t> (hfrStream.height),
static_cast<PixelFormat> (hfrStream.format), 0, 0,
static_cast<PixelFormat> (hfrStream.format),
GRALLOC1_CONSUMER_USAGE_VIDEO_ENCODER, 0,
StreamRotation::ROTATION_0};
::android::hardware::hidl_vec<Stream> streams = {stream};
StreamConfiguration config = {streams,
@ -2756,7 +2765,8 @@ TEST_F(CameraHidlTest, configureStreamsConstrainedOutputs) {
stream = {streamId++, StreamType::OUTPUT,
static_cast<uint32_t> (0),
static_cast<uint32_t> (0),
static_cast<PixelFormat> (hfrStream.format), 0, 0,
static_cast<PixelFormat> (hfrStream.format),
GRALLOC1_CONSUMER_USAGE_VIDEO_ENCODER, 0,
StreamRotation::ROTATION_0};
streams[0] = stream;
config = {streams,
@ -2771,7 +2781,8 @@ TEST_F(CameraHidlTest, configureStreamsConstrainedOutputs) {
stream = {streamId++, StreamType::OUTPUT,
static_cast<uint32_t> (UINT32_MAX),
static_cast<uint32_t> (UINT32_MAX),
static_cast<PixelFormat> (hfrStream.format), 0, 0,
static_cast<PixelFormat> (hfrStream.format),
GRALLOC1_CONSUMER_USAGE_VIDEO_ENCODER, 0,
StreamRotation::ROTATION_0};
streams[0] = stream;
config = {streams,
@ -2785,7 +2796,8 @@ TEST_F(CameraHidlTest, configureStreamsConstrainedOutputs) {
stream = {streamId++, StreamType::OUTPUT,
static_cast<uint32_t> (hfrStream.width),
static_cast<uint32_t> (hfrStream.height),
static_cast<PixelFormat> (UINT32_MAX), 0, 0,
static_cast<PixelFormat> (UINT32_MAX),
GRALLOC1_CONSUMER_USAGE_VIDEO_ENCODER, 0,
StreamRotation::ROTATION_0};
streams[0] = stream;
config = {streams,
@ -2843,12 +2855,13 @@ TEST_F(CameraHidlTest, configureStreamsVideoStillOutputs) {
static_cast<uint32_t> (videoIter.width),
static_cast<uint32_t> (videoIter.height),
static_cast<PixelFormat> (videoIter.format),
0, 0, StreamRotation::ROTATION_0};
GRALLOC1_CONSUMER_USAGE_VIDEO_ENCODER, 0,
StreamRotation::ROTATION_0};
Stream blobStream = {streamId++, StreamType::OUTPUT,
static_cast<uint32_t> (blobIter.width),
static_cast<uint32_t> (blobIter.height),
static_cast<PixelFormat> (blobIter.format),
GRALLOC_USAGE_HW_VIDEO_ENCODER, 0,
GRALLOC1_CONSUMER_USAGE_CPU_READ, 0,
StreamRotation::ROTATION_0};
::android::hardware::hidl_vec<Stream> streams = {
videoStream, blobStream};
@ -3570,7 +3583,7 @@ void CameraHidlTest::configurePreviewStream(const std::string &name,
static_cast<uint32_t> (outputPreviewStreams[0].width),
static_cast<uint32_t> (outputPreviewStreams[0].height),
static_cast<PixelFormat> (outputPreviewStreams[0].format),
0, 0, StreamRotation::ROTATION_0};
GRALLOC1_CONSUMER_USAGE_HWCOMPOSER, 0, StreamRotation::ROTATION_0};
::android::hardware::hidl_vec<Stream> streams = {*previewStream};
StreamConfiguration config = {streams,
StreamConfigurationMode::NORMAL_MODE};