mirror of
https://github.com/Evolution-X/hardware_interfaces
synced 2026-02-02 12:55:23 +00:00
Remove color format constraints am: e6bb228dc6
Original change: https://android-review.googlesource.com/c/platform/hardware/interfaces/+/2188343 Change-Id: I4b4f0fa412a88763e506acb9d5f2ed83463ba1d6 Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
This commit is contained in:
@@ -96,14 +96,6 @@ typedef struct {
|
|||||||
} RawStreamConfig;
|
} RawStreamConfig;
|
||||||
constexpr const size_t kStreamCfgSz = sizeof(RawStreamConfig) / sizeof(int32_t);
|
constexpr const size_t kStreamCfgSz = sizeof(RawStreamConfig) / sizeof(int32_t);
|
||||||
|
|
||||||
const std::unordered_set<int32_t> gSupportedColorFormats ({
|
|
||||||
HAL_PIXEL_FORMAT_RGBA_8888,
|
|
||||||
HAL_PIXEL_FORMAT_BGRA_8888,
|
|
||||||
HAL_PIXEL_FORMAT_YCRCB_420_SP, // NV21
|
|
||||||
HAL_PIXEL_FORMAT_YV12, // YV12
|
|
||||||
HAL_PIXEL_FORMAT_YCBCR_422_I // YUY2
|
|
||||||
});
|
|
||||||
|
|
||||||
} // anonymous namespace
|
} // anonymous namespace
|
||||||
|
|
||||||
|
|
||||||
@@ -258,8 +250,7 @@ protected:
|
|||||||
// Stream configurations are found in metadata
|
// Stream configurations are found in metadata
|
||||||
RawStreamConfig *ptr = reinterpret_cast<RawStreamConfig *>(streamCfgs.data.i32);
|
RawStreamConfig *ptr = reinterpret_cast<RawStreamConfig *>(streamCfgs.data.i32);
|
||||||
for (unsigned offset = 0; offset < streamCfgs.count; offset += kStreamCfgSz) {
|
for (unsigned offset = 0; offset < streamCfgs.count; offset += kStreamCfgSz) {
|
||||||
if (ptr->direction == ANDROID_SCALER_AVAILABLE_STREAM_CONFIGURATIONS_OUTPUT &&
|
if (ptr->direction == ANDROID_SCALER_AVAILABLE_STREAM_CONFIGURATIONS_OUTPUT) {
|
||||||
isSupportedColorFormat(ptr->format)) {
|
|
||||||
targetCfg.width = ptr->width;
|
targetCfg.width = ptr->width;
|
||||||
targetCfg.height = ptr->height;
|
targetCfg.height = ptr->height;
|
||||||
targetCfg.format = static_cast<PixelFormat>(ptr->format);
|
targetCfg.format = static_cast<PixelFormat>(ptr->format);
|
||||||
@@ -272,10 +263,6 @@ protected:
|
|||||||
return targetCfg;
|
return targetCfg;
|
||||||
}
|
}
|
||||||
|
|
||||||
bool isSupportedColorFormat(int32_t format) {
|
|
||||||
return gSupportedColorFormats.find(format) != gSupportedColorFormats.end();
|
|
||||||
}
|
|
||||||
|
|
||||||
sp<IEvsEnumerator> pEnumerator; // Every test needs access to the service
|
sp<IEvsEnumerator> pEnumerator; // Every test needs access to the service
|
||||||
std::vector<CameraDesc> cameraInfo; // Empty unless/until loadCameraList() is called
|
std::vector<CameraDesc> cameraInfo; // Empty unless/until loadCameraList() is called
|
||||||
bool mIsHwModule; // boolean to tell current module under testing
|
bool mIsHwModule; // boolean to tell current module under testing
|
||||||
@@ -2033,9 +2020,7 @@ TEST_P(EvsHidlTest, CameraUseStreamConfigToDisplay) {
|
|||||||
// Stream configurations are found in metadata
|
// Stream configurations are found in metadata
|
||||||
RawStreamConfig *ptr = reinterpret_cast<RawStreamConfig *>(streamCfgs.data.i32);
|
RawStreamConfig *ptr = reinterpret_cast<RawStreamConfig *>(streamCfgs.data.i32);
|
||||||
for (unsigned offset = 0; offset < streamCfgs.count; offset += kStreamCfgSz) {
|
for (unsigned offset = 0; offset < streamCfgs.count; offset += kStreamCfgSz) {
|
||||||
if (ptr->direction == ANDROID_SCALER_AVAILABLE_STREAM_CONFIGURATIONS_OUTPUT &&
|
if (ptr->direction == ANDROID_SCALER_AVAILABLE_STREAM_CONFIGURATIONS_OUTPUT) {
|
||||||
isSupportedColorFormat(ptr->format)) {
|
|
||||||
|
|
||||||
if (ptr->width * ptr->height > maxArea &&
|
if (ptr->width * ptr->height > maxArea &&
|
||||||
ptr->framerate >= minReqFps) {
|
ptr->framerate >= minReqFps) {
|
||||||
targetCfg.width = ptr->width;
|
targetCfg.width = ptr->width;
|
||||||
@@ -2135,9 +2120,7 @@ TEST_P(EvsHidlTest, MultiCameraStreamUseConfig) {
|
|||||||
// Stream configurations are found in metadata
|
// Stream configurations are found in metadata
|
||||||
RawStreamConfig *ptr = reinterpret_cast<RawStreamConfig *>(streamCfgs.data.i32);
|
RawStreamConfig *ptr = reinterpret_cast<RawStreamConfig *>(streamCfgs.data.i32);
|
||||||
for (unsigned offset = 0; offset < streamCfgs.count; offset += kStreamCfgSz) {
|
for (unsigned offset = 0; offset < streamCfgs.count; offset += kStreamCfgSz) {
|
||||||
if (ptr->direction == ANDROID_SCALER_AVAILABLE_STREAM_CONFIGURATIONS_OUTPUT &&
|
if (ptr->direction == ANDROID_SCALER_AVAILABLE_STREAM_CONFIGURATIONS_OUTPUT) {
|
||||||
isSupportedColorFormat(ptr->format)) {
|
|
||||||
|
|
||||||
if (ptr->width * ptr->height > maxArea &&
|
if (ptr->width * ptr->height > maxArea &&
|
||||||
ptr->framerate >= minReqFps) {
|
ptr->framerate >= minReqFps) {
|
||||||
targetCfg.width = ptr->width;
|
targetCfg.width = ptr->width;
|
||||||
|
|||||||
Reference in New Issue
Block a user