summaryrefslogtreecommitdiff
authorguosong.zhou <guosong.zhou@amlogic.com>2014-11-17 08:01:35 (GMT)
committer guosong.zhou <guosong.zhou@amlogic.com>2014-11-17 08:01:35 (GMT)
commitd98bb2eaf9998862c8ad2885db2a5b3f2b022ab2 (patch)
tree30f0b6617f6e87a854a73e92c659bc657487795b
parent99b488fbefd98d15ffb488028e04a8badfdd7ff4 (diff)
downloadcamera-d98bb2eaf9998862c8ad2885db2a5b3f2b022ab2.zip
camera-d98bb2eaf9998862c8ad2885db2a5b3f2b022ab2.tar.gz
camera-d98bb2eaf9998862c8ad2885db2a5b3f2b022ab2.tar.bz2
delete HAL3.2 warning
Diffstat
-rwxr-xr-xv3/Android.mk3
-rwxr-xr-xv3/EmulatedCameraFactory.cpp4
-rwxr-xr-xv3/EmulatedFakeCamera3.cpp16
-rwxr-xr-xv3/EmulatedFakeCamera3.h6
-rwxr-xr-xv3/EmulatedFakeCamera3Info.cpp3
-rwxr-xr-xv3/fake-pipeline2/JpegCompressor.h16
-rwxr-xr-xv3/fake-pipeline2/NV12_resize.c4
-rwxr-xr-xv3/fake-pipeline2/Sensor.cpp48
-rwxr-xr-xv3/fake-pipeline2/Sensor.h8
-rwxr-xr-xv3/fake-pipeline2/camera_hw.cpp14
10 files changed, 59 insertions, 63 deletions
diff --git a/v3/Android.mk b/v3/Android.mk
index d735144..5fd8344 100755
--- a/v3/Android.mk
+++ b/v3/Android.mk
@@ -92,9 +92,6 @@ LOCAL_SRC_FILES := \
CallbackNotifier.cpp \
QemuClient.cpp \
JpegCompressor.cpp \
- EmulatedCamera2.cpp \
- EmulatedFakeCamera2.cpp \
- EmulatedQemuCamera2.cpp \
fake-pipeline2/Scene.cpp \
fake-pipeline2/Sensor.cpp \
fake-pipeline2/JpegCompressor.cpp \
diff --git a/v3/EmulatedCameraFactory.cpp b/v3/EmulatedCameraFactory.cpp
index c232e85..237362d 100755
--- a/v3/EmulatedCameraFactory.cpp
+++ b/v3/EmulatedCameraFactory.cpp
@@ -82,11 +82,13 @@ EmulatedCameraFactory::EmulatedCameraFactory()
&HAL_MODULE_INFO_SYM.common);
DBG_LOGA("attention should not go into this func");
break;
+#if 0
case 2:
mEmulatedCameras[camera_id] =
new EmulatedFakeCamera2(camera_id, true,
&HAL_MODULE_INFO_SYM.common);
break;
+#endif
case 3:
mEmulatedCameras[camera_id] =
new EmulatedFakeCamera3(camera_id, true,
@@ -138,11 +140,13 @@ EmulatedCameraFactory::EmulatedCameraFactory()
new EmulatedFakeCamera(camera_id, false,
&HAL_MODULE_INFO_SYM.common);
break;
+#if 0
case 2:
mEmulatedCameras[camera_id] =
new EmulatedFakeCamera2(camera_id, false,
&HAL_MODULE_INFO_SYM.common);
break;
+#endif
case 3:
mEmulatedCameras[camera_id] =
new EmulatedFakeCamera3(camera_id, false,
diff --git a/v3/EmulatedFakeCamera3.cpp b/v3/EmulatedFakeCamera3.cpp
index 7dc3f97..8419275 100755
--- a/v3/EmulatedFakeCamera3.cpp
+++ b/v3/EmulatedFakeCamera3.cpp
@@ -125,12 +125,12 @@ const float EmulatedFakeCamera3::kExposureWanderMax = 1;
* Camera device lifecycle methods
*/
static const ssize_t kMinJpegBufferSize = 256 * 1024 + sizeof(camera3_jpeg_blob);
-jpegsize EmulatedFakeCamera3::getMaxJpegResolution(int32_t picSizes[],int count) {
- int32_t maxJpegWidth = 0, maxJpegHeight = 0;
+jpegsize EmulatedFakeCamera3::getMaxJpegResolution(uint32_t picSizes[],int count) {
+ uint32_t maxJpegWidth = 0, maxJpegHeight = 0;
jpegsize maxJpegResolution;
for (int i=0; i < count; i+= 4) {
- int32_t width = picSizes[i+1];
- int32_t height = picSizes[i+2];
+ uint32_t width = picSizes[i+1];
+ uint32_t height = picSizes[i+2];
if (picSizes[i+0] == HAL_PIXEL_FORMAT_BLOB &&
(width * height > maxJpegWidth * maxJpegHeight)) {
maxJpegWidth = width;
@@ -327,7 +327,7 @@ status_t EmulatedFakeCamera3::getCameraInfo(struct camera_info *info) {
status_t EmulatedFakeCamera3::configureStreams(
camera3_stream_configuration *streamList) {
Mutex::Autolock l(mLock);
- int width, height, pixelfmt;
+ uint32_t width, height,pixelfmt;
bool isRestart = false;
DBG_LOGB("%s: %d streams", __FUNCTION__, streamList->num_streams);
@@ -426,7 +426,7 @@ status_t EmulatedFakeCamera3::configureStreams(
if (height < newStream->height)
height = newStream->height;
- pixelfmt = newStream->format;
+ pixelfmt = (uint32_t)newStream->format;
}
}
@@ -1435,7 +1435,7 @@ void EmulatedFakeCamera3::updateCameraMetaData(CameraMetadata *info) {
status_t EmulatedFakeCamera3::constructStaticInfo() {
CameraMetadata info;
- int32_t picSizes[64 * 8];
+ uint32_t picSizes[64 * 8];
int64_t duration[36];
int count, duration_count;
uint8_t maxCount = 10;
@@ -1580,7 +1580,7 @@ status_t EmulatedFakeCamera3::constructStaticInfo() {
count = s->getStreamConfigurations(picSizes, kAvailableFormats, count);
info.update(ANDROID_SCALER_AVAILABLE_STREAM_CONFIGURATIONS,
- picSizes, count);
+ (int32_t*)picSizes, count);
maxJpegResolution = getMaxJpegResolution(picSizes,count);
int32_t full_size[4];
diff --git a/v3/EmulatedFakeCamera3.h b/v3/EmulatedFakeCamera3.h
index ab3d6fd..87f8ff0 100755
--- a/v3/EmulatedFakeCamera3.h
+++ b/v3/EmulatedFakeCamera3.h
@@ -43,8 +43,8 @@ namespace android {
* response to hw_module_methods_t::open, and camera_device::close callbacks.
*/
struct jpegsize {
- int width;
- int height;
+ uint32_t width;
+ uint32_t height;
};
class EmulatedFakeCamera3 : public EmulatedCamera3,
private Sensor::SensorListener {
@@ -147,7 +147,7 @@ private:
static const struct KeyInfo_s sKeyInfoResult[];
static const struct KeyInfo_s sKeyBackwardCompat[];
jpegsize maxJpegResolution;
- jpegsize getMaxJpegResolution(int32_t picSizes[],int count);
+ jpegsize getMaxJpegResolution(uint32_t picSizes[],int count);
ssize_t getJpegBufferSize(int width, int height);
/**
* Run the fake 3A algorithms as needed. May override/modify settings
diff --git a/v3/EmulatedFakeCamera3Info.cpp b/v3/EmulatedFakeCamera3Info.cpp
index 7abd7b2..403be4e 100755
--- a/v3/EmulatedFakeCamera3Info.cpp
+++ b/v3/EmulatedFakeCamera3Info.cpp
@@ -19,11 +19,10 @@
* functionality of an advanced fake camera.
*/
-
+#define LOG_TAG "EmulatedCamera_FakeCamera3Info"
#include <camera/CameraMetadata.h>
#include "EmulatedFakeCamera3.h"
#include "inc/DebugUtils.h"
-#define LOG_TAG "EmulatedCamera_FakeCamera3Info"
namespace android {
diff --git a/v3/fake-pipeline2/JpegCompressor.h b/v3/fake-pipeline2/JpegCompressor.h
index 0a57f04..9bb6cb7 100755
--- a/v3/fake-pipeline2/JpegCompressor.h
+++ b/v3/fake-pipeline2/JpegCompressor.h
@@ -135,21 +135,17 @@ class JpegCompressor: private Thread, public virtual RefBase {
bool mSynchronous;
Mutex mMutex;
-
- Buffers *mBuffers;
- JpegListener *mListener;
-
- StreamBuffer mJpegBuffer, mAuxBuffer;
- bool mFoundJpeg, mFoundAux;
-
+
bool mNeedexif;
bool mNeedThumbnail;
-
-
int mMainJpegSize, mThumbJpegSize;
- struct ExifInfo mInfo;
uint8_t *mSrcThumbBuffer;
uint8_t *mDstThumbBuffer;
+ Buffers *mBuffers;
+ JpegListener *mListener;
+ struct ExifInfo mInfo;
+ StreamBuffer mJpegBuffer, mAuxBuffer;
+ bool mFoundJpeg, mFoundAux;
jpeg_compress_struct mCInfo;
diff --git a/v3/fake-pipeline2/NV12_resize.c b/v3/fake-pipeline2/NV12_resize.c
index 4fc0443..23eee0b 100755
--- a/v3/fake-pipeline2/NV12_resize.c
+++ b/v3/fake-pipeline2/NV12_resize.c
@@ -1,8 +1,8 @@
+//#define LOG_NDEBUG 0
+#define LOG_TAG "CAMHAL_NV12_resize"
#include "NV12_resize.h"
#include "DebugUtils.h"
-//#define LOG_NDEBUG 0
-#define LOG_TAG "CAMHAL_NV12_resize "
#define STRIDE 4096
#include <utils/Log.h>
diff --git a/v3/fake-pipeline2/Sensor.cpp b/v3/fake-pipeline2/Sensor.cpp
index 7358da5..76d3f0b 100755
--- a/v3/fake-pipeline2/Sensor.cpp
+++ b/v3/fake-pipeline2/Sensor.cpp
@@ -199,7 +199,7 @@ bool Sensor::isStreaming() {
return vinfo->isStreaming;
}
-bool Sensor::isNeedRestart(int width, int height, int pixelformat)
+bool Sensor::isNeedRestart(uint32_t width, uint32_t height, uint32_t pixelformat)
{
if ((vinfo->preview.format.fmt.pix.width != width)
||(vinfo->preview.format.fmt.pix.height != height)
@@ -253,7 +253,7 @@ int Sensor::getOutputFormat()
* trasform HAL format to v4l2 format then check whether
* it is supported.
*/
-int Sensor::halFormatToSensorFormat(int pixelfmt)
+int Sensor::halFormatToSensorFormat(uint32_t pixelfmt)
{
struct v4l2_fmtdesc fmt;
int ret;
@@ -1001,7 +1001,7 @@ bool Sensor::threadLoop() {
return true;
};
-int Sensor::getStreamConfigurations(int32_t picSizes[], const int32_t kAvailableFormats[], int size) {
+int Sensor::getStreamConfigurations(uint32_t picSizes[], const int32_t kAvailableFormats[], int size) {
int res;
int i, j, k, START;
int count = 0;
@@ -1173,7 +1173,7 @@ int Sensor::getStreamConfigurations(int32_t picSizes[], const int32_t kAvailable
};
START = count;
- for (j = 0; j<(sizeof(jpgSrcfmt)/sizeof(jpgSrcfmt[0])); j++) {
+ for (j = 0; j<(int)(sizeof(jpgSrcfmt)/sizeof(jpgSrcfmt[0])); j++) {
memset(&frmsize,0,sizeof(frmsize));
frmsize.pixel_format = jpgSrcfmt[j];
@@ -1232,7 +1232,7 @@ int Sensor::getStreamConfigurations(int32_t picSizes[], const int32_t kAvailable
}
-int Sensor::getStreamConfigurationDurations(int32_t picSizes[], int64_t duration[], int size)
+int Sensor::getStreamConfigurationDurations(uint32_t picSizes[], int64_t duration[], int size)
{
int ret=0; int framerate=0; int temp_rate=0;
struct v4l2_frmivalenum fival;
@@ -1494,7 +1494,7 @@ void Sensor::captureRGB(uint8_t *img, uint32_t gain, uint32_t stride) {
#else
uint8_t *src;
int ret,rotate;
- int width,height;
+ uint32_t width,height;
rotate = getPictureRotate();
width = vinfo->picture.format.fmt.pix.width;
height = vinfo->picture.format.fmt.pix.height;
@@ -1642,17 +1642,17 @@ void Sensor::captureNV21(StreamBuffer b, uint32_t gain) {
if (vinfo->preview.format.fmt.pix.pixelformat == V4L2_PIX_FMT_NV21) {
ALOGI("Sclale NV21 frame down \n");
//memcpy(b.img, src, 200 * 100 * 3 / 2 /*vinfo->preview.buf.length*/);
- structConvImage input = {vinfo->preview.format.fmt.pix.width,
- vinfo->preview.format.fmt.pix.height,
- vinfo->preview.format.fmt.pix.width,
+ structConvImage input = {(mmInt32)vinfo->preview.format.fmt.pix.width,
+ (mmInt32)vinfo->preview.format.fmt.pix.height,
+ (mmInt32)vinfo->preview.format.fmt.pix.width,
IC_FORMAT_YCbCr420_lp,
(mmByte *) src,
(mmByte *) src + vinfo->preview.format.fmt.pix.width * vinfo->preview.format.fmt.pix.height,
0};
- structConvImage output = {b.width,
- b.height,
- b.width,
+ structConvImage output = {(mmInt32)b.width,
+ (mmInt32)b.height,
+ (mmInt32)b.width,
IC_FORMAT_YCbCr420_lp,
(mmByte *) b.img,
(mmByte *) b.img + b.width * b.height,
@@ -1672,17 +1672,17 @@ void Sensor::captureNV21(StreamBuffer b, uint32_t gain) {
YUYVToNV21(src, tmp_buffer, width, height);
- structConvImage input = {width,
- height,
- width,
+ structConvImage input = {(mmInt32)width,
+ (mmInt32)height,
+ (mmInt32)width,
IC_FORMAT_YCbCr420_lp,
(mmByte *) tmp_buffer,
(mmByte *) tmp_buffer + width * height,
0};
- structConvImage output = {b.width,
- b.height,
- b.width,
+ structConvImage output = {(mmInt32)b.width,
+ (mmInt32)b.height,
+ (mmInt32)b.width,
IC_FORMAT_YCbCr420_lp,
(mmByte *) b.img,
(mmByte *) b.img + b.width * b.height,
@@ -1709,17 +1709,17 @@ void Sensor::captureNV21(StreamBuffer b, uint32_t gain) {
DBG_LOGA("Decode MJPEG frame failed\n");
}
- structConvImage input = {width,
- height,
- width,
+ structConvImage input = {(mmInt32)width,
+ (mmInt32)height,
+ (mmInt32)width,
IC_FORMAT_YCbCr420_lp,
(mmByte *) tmp_buffer,
(mmByte *) tmp_buffer + width * height,
0};
- structConvImage output = {b.width,
- b.height,
- b.width,
+ structConvImage output = {(mmInt32)b.width,
+ (mmInt32)b.height,
+ (mmInt32)b.width,
IC_FORMAT_YCbCr420_lp,
(mmByte *) b.img,
(mmByte *) b.img + b.width * b.height,
diff --git a/v3/fake-pipeline2/Sensor.h b/v3/fake-pipeline2/Sensor.h
index c67897f..2c7e0ad 100755
--- a/v3/fake-pipeline2/Sensor.h
+++ b/v3/fake-pipeline2/Sensor.h
@@ -164,7 +164,7 @@ class Sensor: private Thread, public virtual RefBase {
status_t shutDown();
int getOutputFormat();
- int halFormatToSensorFormat(int pixelfmt);
+ int halFormatToSensorFormat(uint32_t pixelfmt);
status_t setOutputFormat(int width, int height, int pixelformat);
void setPictureRotate(int rotate);
int getPictureRotate();
@@ -173,10 +173,10 @@ class Sensor: private Thread, public virtual RefBase {
status_t streamOff();
int getPictureSizes(int32_t picSizes[], int size, bool preview);
- int getStreamConfigurations(int32_t picSizes[], const int32_t kAvailableFormats[], int size);
- int getStreamConfigurationDurations(int32_t picSizes[], int64_t duration[], int size);
+ int getStreamConfigurations(uint32_t picSizes[], const int32_t kAvailableFormats[], int size);
+ int getStreamConfigurationDurations(uint32_t picSizes[], int64_t duration[], int size);
bool isStreaming();
- bool isNeedRestart(int width, int height, int pixelformat);
+ bool isNeedRestart(uint32_t width, uint32_t height, uint32_t pixelformat);
/*
* Access to scene
*/
diff --git a/v3/fake-pipeline2/camera_hw.cpp b/v3/fake-pipeline2/camera_hw.cpp
index 277bef3..5d9dd38 100755
--- a/v3/fake-pipeline2/camera_hw.cpp
+++ b/v3/fake-pipeline2/camera_hw.cpp
@@ -111,7 +111,7 @@ int start_capturing(struct VideoInfo *vinfo)
return -EINVAL;
}
- for (i = 0; i < vinfo->preview.rb.count; ++i) {
+ for (i = 0; i < (int)vinfo->preview.rb.count; ++i) {
CLEAR(vinfo->preview.buf);
@@ -135,7 +135,7 @@ int start_capturing(struct VideoInfo *vinfo)
}
}
////////////////////////////////
- for (i = 0; i < vinfo->preview.rb.count; ++i) {
+ for (i = 0; i < (int)vinfo->preview.rb.count; ++i) {
CLEAR(buf);
buf.type = V4L2_BUF_TYPE_VIDEO_CAPTURE;
@@ -170,7 +170,7 @@ int stop_capturing(struct VideoInfo *vinfo)
res = -1;
}
- for (i = 0; i < vinfo->preview.rb.count; ++i) {
+ for (i = 0; i < (int)vinfo->preview.rb.count; ++i) {
if (-1 == munmap(vinfo->mem[i], vinfo->preview.buf.length)) {
DBG_LOGB("munmap failed errno=%d", errno);
res = -1;
@@ -255,7 +255,7 @@ int start_picture(struct VideoInfo *vinfo, int rotate)
}
//step 3: mmap buffer
- for (i = 0; i < vinfo->picture.rb.count; ++i) {
+ for (i = 0; i < (int)vinfo->picture.rb.count; ++i) {
CLEAR(vinfo->picture.buf);
@@ -280,7 +280,7 @@ int start_picture(struct VideoInfo *vinfo, int rotate)
//step 4 : QBUF
////////////////////////////////
- for (i = 0; i < vinfo->picture.rb.count; ++i) {
+ for (i = 0; i < (int)vinfo->picture.rb.count; ++i) {
CLEAR(buf);
buf.type = V4L2_BUF_TYPE_VIDEO_CAPTURE;
@@ -339,7 +339,7 @@ void stop_picture(struct VideoInfo *vinfo)
return ;
//QBUF
- for (i = 0; i < vinfo->picture.rb.count; ++i) {
+ for (i = 0; i < (int)vinfo->picture.rb.count; ++i) {
CLEAR(buf);
buf.type = V4L2_BUF_TYPE_VIDEO_CAPTURE;
buf.memory = V4L2_MEMORY_MMAP;
@@ -353,7 +353,7 @@ void stop_picture(struct VideoInfo *vinfo)
if (-1 == ioctl(vinfo->fd, VIDIOC_STREAMOFF, &type))
DBG_LOGB("VIDIOC_STREAMOFF, errno=%d", errno);
- for (i = 0; i < vinfo->picture.rb.count; i++)
+ for (i = 0; i < (int)vinfo->picture.rb.count; i++)
{
if (-1 == munmap(vinfo->mem_pic[i], vinfo->picture.buf.length))
DBG_LOGB("munmap failed errno=%d", errno);