author | Brian Zhu <brian.zhu@amlogic.com> | 2015-09-06 11:15:55 (GMT) |
---|---|---|
committer | Brian Zhu <brian.zhu@amlogic.com> | 2015-09-06 11:29:26 (GMT) |
commit | 07df6456e0dea378b352ecbd8cafb622f9bbf2bf (patch) | |
tree | 6d1c58b815e37c83bc21a54a02581b1a8ad85016 | |
parent | 8031844c3121f418b93722683a3d96a09f83cee1 (diff) | |
download | camera-07df6456e0dea378b352ecbd8cafb622f9bbf2bf.zip camera-07df6456e0dea378b352ecbd8cafb622f9bbf2bf.tar.gz camera-07df6456e0dea378b352ecbd8cafb622f9bbf2bf.tar.bz2 |
PD#112225 camera: fix overwrite issue
Change-Id: I9806ef857bd5489da88ae425a837caaa5373f4fd
-rw-r--r-- | v3/fake-pipeline2/Sensor.cpp | 12 |
1 files changed, 8 insertions, 4 deletions
diff --git a/v3/fake-pipeline2/Sensor.cpp b/v3/fake-pipeline2/Sensor.cpp index bd4ab5b..a651a5f 100644 --- a/v3/fake-pipeline2/Sensor.cpp +++ b/v3/fake-pipeline2/Sensor.cpp @@ -1486,15 +1486,19 @@ int Sensor::getStreamConfigurationDurations(uint32_t picSizes[], int64_t duratio memset(duration, 0 ,sizeof(int64_t)*ARRAY_SIZE(duration)); int pixelfmt_tbl[] = { V4L2_PIX_FMT_MJPEG, - V4L2_PIX_FMT_YVU420, - V4L2_PIX_FMT_NV21, + V4L2_PIX_FMT_YVU420, + V4L2_PIX_FMT_NV21, V4L2_PIX_FMT_RGB24, V4L2_PIX_FMT_YUYV, - // V4L2_PIX_FMT_YVU420 + //V4L2_PIX_FMT_YVU420 }; for( i = 0; i < (int) ARRAY_SIZE(pixelfmt_tbl); i++) { + /* we got all duration for each resolution for prev format*/ + if (count >= tmp_size) + break; + for( ; size > 0; size-=4) { memset(&fival, 0, sizeof(fival)); @@ -1535,7 +1539,7 @@ int Sensor::getStreamConfigurationDurations(uint32_t picSizes[], int64_t duratio } } else { if (j > 0) { - if (count > tmp_size) + if (count >= tmp_size) break; duration[count+0] = (int64_t)(picSizes[size-4]); duration[count+1] = (int64_t)(picSizes[size-3]); |