Rename (IF_)LOGE(_IF) to (IF_)ALOGE(_IF) DO NOT MERGE

See https://android-git.corp.google.com/g/#/c/157220

Bug: 5449033
Change-Id: Ic6cac56d137f705dfa7266f21e9b0269219bd5d1
This commit is contained in:
Steve Block
2012-01-06 19:17:48 +00:00
parent 2a184c2ce5
commit 5a622cba8c
28 changed files with 200 additions and 199 deletions

View File

@@ -44,11 +44,11 @@ static int registerNativeMethods(JNIEnv* env, const char* className,
clazz = env->FindClass(className);
if (clazz == NULL) {
LOGE("Native registration unable to find class '%s'", className);
ALOGE("Native registration unable to find class '%s'", className);
return JNI_FALSE;
}
if (env->RegisterNatives(clazz, gMethods, numMethods) < 0) {
LOGE("RegisterNatives failed for '%s'", className);
ALOGE("RegisterNatives failed for '%s'", className);
return JNI_FALSE;
}
@@ -92,13 +92,13 @@ jint JNI_OnLoad(JavaVM* vm, void* reserved)
ALOGI("JNI_OnLoad");
if (vm->GetEnv(&uenv.venv, JNI_VERSION_1_4) != JNI_OK) {
LOGE("ERROR: GetEnv failed");
ALOGE("ERROR: GetEnv failed");
goto bail;
}
env = uenv.env;
if (registerNatives(env) != JNI_TRUE) {
LOGE("ERROR: registerNatives failed");
ALOGE("ERROR: registerNatives failed");
goto bail;
}

View File

@@ -462,7 +462,8 @@ int ApiGen::genEncoderImpl(const std::string &filename)
size_t n = size();
// unsupport printout
fprintf(fp, "static void enc_unsupported()\n{\n\tLOGE(\"Function is unsupported\\n\");\n}\n\n");
fprintf(fp,
"static void enc_unsupported()\n{\n\tALOGE(\"Function is unsupported\\n\");\n}\n\n");
// entry points;
for (size_t i = 0; i < n; i++) {

View File

@@ -18,7 +18,7 @@
#if (HAVE_ANDROID_OS == 1)
# include <cutils/log.h>
# define ERR(...) LOGE(__VA_ARGS__)
# define ERR(...) ALOGE(__VA_ARGS__)
# ifdef EMUGL_DEBUG
# define DBG(...) ALOGD(__VA_ARGS__)
# else

View File

@@ -23,12 +23,12 @@ static EGLClient_glesInterface * s_gl = NULL;
#define DEFINE_AND_VALIDATE_HOST_CONNECTION(ret) \
HostConnection *hostCon = HostConnection::get(); \
if (!hostCon) { \
LOGE("egl: Failed to get host connection\n"); \
ALOGE("egl: Failed to get host connection\n"); \
return ret; \
} \
renderControl_encoder_context_t *rcEnc = hostCon->rcEncoder(); \
if (!rcEnc) { \
LOGE("egl: Failed to get renderControl encoder context\n"); \
ALOGE("egl: Failed to get renderControl encoder context\n"); \
return ret; \
}

View File

@@ -30,14 +30,14 @@ static GLubyte *gVersionString= (GLubyte *) "OpenGL ES-CM 1.0";
static GLubyte *gExtensionsString= (GLubyte *) ""; // no extensions at this point;
#define SET_ERROR_IF(condition,err) if((condition)) { \
LOGE("%s:%s:%d GL error 0x%x\n", __FILE__, __FUNCTION__, __LINE__, err); \
ALOGE("%s:%s:%d GL error 0x%x\n", __FILE__, __FUNCTION__, __LINE__, err); \
ctx->setError(err); \
return; \
}
#define RET_AND_SET_ERROR_IF(condition,err,ret) if((condition)) { \
LOGE("%s:%s:%d GL error 0x%x\n", __FILE__, __FUNCTION__, __LINE__, err); \
ALOGE("%s:%s:%d GL error 0x%x\n", __FILE__, __FUNCTION__, __LINE__, err); \
ctx->setError(err); \
return ret; \
}
@@ -537,7 +537,7 @@ void GLEncoder::s_glDrawElements(void *self, GLenum mode, GLsizei count, GLenum
}
if (!has_immediate_arrays && !has_indirect_arrays) {
LOGE("glDrawElements: no data bound to the command - ignoring\n");
ALOGE("glDrawElements: no data bound to the command - ignoring\n");
return;
}
@@ -580,7 +580,7 @@ void GLEncoder::s_glDrawElements(void *self, GLenum mode, GLsizei count, GLenum
}
break;
default:
LOGE("unsupported index buffer type %d\n", type);
ALOGE("unsupported index buffer type %d\n", type);
}
if (has_indirect_arrays || 1) {
ctx->sendVertexData(minIndex, maxIndex - minIndex + 1);
@@ -593,7 +593,7 @@ void GLEncoder::s_glDrawElements(void *self, GLenum mode, GLsizei count, GLenum
} else {
// we are all direct arrays and immidate mode index array -
// rebuild the arrays and the index array;
LOGE("glDrawElements: direct index & direct buffer data - will be implemented in later versions;\n");
ALOGE("glDrawElements: direct index & direct buffer data - will be implemented in later versions;\n");
}
}
}
@@ -605,7 +605,7 @@ void GLEncoder::s_glActiveTexture(void* self, GLenum texture)
GLenum err;
if ((err = state->setActiveTextureUnit(texture)) != GL_NO_ERROR) {
LOGE("%s:%s:%d GL error %#x\n", __FILE__, __FUNCTION__, __LINE__, err);
ALOGE("%s:%s:%d GL error %#x\n", __FILE__, __FUNCTION__, __LINE__, err);
ctx->setError(err);
return;
}
@@ -621,7 +621,7 @@ void GLEncoder::s_glBindTexture(void* self, GLenum target, GLuint texture)
GLboolean firstUse;
if ((err = state->bindTexture(target, texture, &firstUse)) != GL_NO_ERROR) {
LOGE("%s:%s:%d GL error %#x\n", __FILE__, __FUNCTION__, __LINE__, err);
ALOGE("%s:%s:%d GL error %#x\n", __FILE__, __FUNCTION__, __LINE__, err);
ctx->setError(err);
return;
}

View File

@@ -23,12 +23,12 @@ static EGLClient_glesInterface * s_gl = NULL;
#define DEFINE_AND_VALIDATE_HOST_CONNECTION(ret) \
HostConnection *hostCon = HostConnection::get(); \
if (!hostCon) { \
LOGE("egl: Failed to get host connection\n"); \
ALOGE("egl: Failed to get host connection\n"); \
return ret; \
} \
renderControl_encoder_context_t *rcEnc = hostCon->rcEncoder(); \
if (!rcEnc) { \
LOGE("egl: Failed to get renderControl encoder context\n"); \
ALOGE("egl: Failed to get renderControl encoder context\n"); \
return ret; \
}

View File

@@ -8,14 +8,14 @@ static GLubyte *gVersionString= (GLubyte *) "OpenGL ES 2.0";
static GLubyte *gExtensionsString= (GLubyte *) ""; // no extensions at this point;
#define SET_ERROR_IF(condition,err) if((condition)) { \
LOGE("%s:%s:%d GL error 0x%x\n", __FILE__, __FUNCTION__, __LINE__, err); \
ALOGE("%s:%s:%d GL error 0x%x\n", __FILE__, __FUNCTION__, __LINE__, err); \
ctx->setError(err); \
return; \
}
#define RET_AND_SET_ERROR_IF(condition,err,ret) if((condition)) { \
LOGE("%s:%s:%d GL error 0x%x\n", __FILE__, __FUNCTION__, __LINE__, err); \
ALOGE("%s:%s:%d GL error 0x%x\n", __FILE__, __FUNCTION__, __LINE__, err); \
ctx->setError(err); \
return ret; \
}
@@ -355,7 +355,7 @@ void GL2Encoder::s_glDrawElements(void *self, GLenum mode, GLsizei count, GLenum
}
if (!has_immediate_arrays && !has_indirect_arrays) {
LOGE("glDrawElements: no data bound to the command - ignoring\n");
ALOGE("glDrawElements: no data bound to the command - ignoring\n");
return;
}
@@ -398,7 +398,7 @@ void GL2Encoder::s_glDrawElements(void *self, GLenum mode, GLsizei count, GLenum
}
break;
default:
LOGE("unsupported index buffer type %d\n", type);
ALOGE("unsupported index buffer type %d\n", type);
}
if (has_indirect_arrays || 1) {
ctx->sendVertexAttributes(minIndex, maxIndex - minIndex + 1);
@@ -411,7 +411,7 @@ void GL2Encoder::s_glDrawElements(void *self, GLenum mode, GLsizei count, GLenum
} else {
// we are all direct arrays and immidate mode index array -
// rebuild the arrays and the index array;
LOGE("glDrawElements: direct index & direct buffer data - will be implemented in later versions;\n");
ALOGE("glDrawElements: direct index & direct buffer data - will be implemented in later versions;\n");
}
}
}

View File

@@ -63,12 +63,12 @@ HostConnection *HostConnection::get()
if (useQemuPipe) {
QemuPipeStream *stream = new QemuPipeStream(STREAM_BUFFER_SIZE);
if (!stream) {
LOGE("Failed to create QemuPipeStream for host connection!!!\n");
ALOGE("Failed to create QemuPipeStream for host connection!!!\n");
delete con;
return NULL;
}
if (stream->connect() < 0) {
LOGE("Failed to connect to host (QemuPipeStream)!!!\n");
ALOGE("Failed to connect to host (QemuPipeStream)!!!\n");
delete stream;
delete con;
return NULL;
@@ -79,13 +79,13 @@ HostConnection *HostConnection::get()
{
TcpStream *stream = new TcpStream(STREAM_BUFFER_SIZE);
if (!stream) {
LOGE("Failed to create TcpStream for host connection!!!\n");
ALOGE("Failed to create TcpStream for host connection!!!\n");
delete con;
return NULL;
}
if (stream->connect("10.0.2.2", STREAM_PORT_NUM) < 0) {
LOGE("Failed to connect to host (TcpStream)!!!\n");
ALOGE("Failed to connect to host (TcpStream)!!!\n");
delete stream;
delete con;
return NULL;

View File

@@ -65,12 +65,12 @@ const char * eglStrError(EGLint err)
#define setErrorReturn(error, retVal) \
{ \
LOGE("tid %d: %s(%d): error 0x%x (%s)", gettid(), __FUNCTION__, __LINE__, error, eglStrError(error)); \
ALOGE("tid %d: %s(%d): error 0x%x (%s)", gettid(), __FUNCTION__, __LINE__, error, eglStrError(error)); \
return setErrorFunc(error, retVal); \
}
#define RETURN_ERROR(ret,err) \
LOGE("tid %d: %s(%d): error 0x%x (%s)", gettid(), __FUNCTION__, __LINE__, err, eglStrError(err)); \
ALOGE("tid %d: %s(%d): error 0x%x (%s)", gettid(), __FUNCTION__, __LINE__, err, eglStrError(err)); \
getEGLThreadInfo()->eglError = err; \
return ret;
@@ -107,12 +107,12 @@ const char * eglStrError(EGLint err)
#define DEFINE_AND_VALIDATE_HOST_CONNECTION(ret) \
HostConnection *hostCon = HostConnection::get(); \
if (!hostCon) { \
LOGE("egl: Failed to get host connection\n"); \
ALOGE("egl: Failed to get host connection\n"); \
return ret; \
} \
renderControl_encoder_context_t *rcEnc = hostCon->rcEncoder(); \
if (!rcEnc) { \
LOGE("egl: Failed to get renderControl encoder context\n"); \
ALOGE("egl: Failed to get renderControl encoder context\n"); \
return ret; \
}
@@ -282,7 +282,7 @@ EGLBoolean egl_window_surface_t::rcCreate()
DEFINE_AND_VALIDATE_HOST_CONNECTION(EGL_FALSE);
rcSurface = rcEnc->rcCreateWindowSurface(rcEnc, (uint32_t)config, getWidth(), getHeight());
if (!rcSurface) {
LOGE("rcCreateWindowSurface returned 0");
ALOGE("rcCreateWindowSurface returned 0");
return EGL_FALSE;
}
valid = EGL_TRUE;
@@ -292,7 +292,7 @@ EGLBoolean egl_window_surface_t::rcCreate()
EGLBoolean egl_window_surface_t::rcDestroy()
{
if (!rcSurface) {
LOGE("rcDestroy called on invalid rcSurface");
ALOGE("rcDestroy called on invalid rcSurface");
return EGL_FALSE;
}
@@ -395,12 +395,12 @@ EGLBoolean egl_pbuffer_surface_t::rcCreate()
DEFINE_AND_VALIDATE_HOST_CONNECTION(EGL_FALSE);
rcSurface = rcEnc->rcCreateWindowSurface(rcEnc, (uint32_t)config, getWidth(), getHeight());
if (!rcSurface) {
LOGE("rcCreateWindowSurface returned 0");
ALOGE("rcCreateWindowSurface returned 0");
return EGL_FALSE;
}
rcColorBuffer = rcEnc->rcCreateColorBuffer(rcEnc, getWidth(), getHeight(), format);
if (!rcColorBuffer) {
LOGE("rcCreateColorBuffer returned 0");
ALOGE("rcCreateColorBuffer returned 0");
return EGL_FALSE;
}
@@ -411,7 +411,7 @@ EGLBoolean egl_pbuffer_surface_t::rcCreate()
EGLBoolean egl_pbuffer_surface_t::rcDestroy()
{
if ((!rcSurface)||(!rcColorBuffer)) {
LOGE("destroyRc called on invalid rcSurface");
ALOGE("destroyRc called on invalid rcSurface");
return EGL_FALSE;
}
@@ -782,7 +782,7 @@ EGLBoolean eglQuerySurface(EGLDisplay dpy, EGLSurface eglSurface, EGLint attribu
break;
//TODO: complete other attributes
default:
LOGE("eglQuerySurface %x EGL_BAD_ATTRIBUTE", attribute);
ALOGE("eglQuerySurface %x EGL_BAD_ATTRIBUTE", attribute);
ret = setErrorFunc(EGL_BAD_ATTRIBUTE, EGL_FALSE);
break;
}
@@ -900,7 +900,7 @@ EGLContext eglCreateContext(EGLDisplay dpy, EGLConfig config, EGLContext share_c
DEFINE_AND_VALIDATE_HOST_CONNECTION(EGL_NO_CONTEXT);
uint32_t rcContext = rcEnc->rcCreateContext(rcEnc, (uint32_t)config, rcShareCtx, version);
if (!rcContext) {
LOGE("rcCreateContext returned 0");
ALOGE("rcCreateContext returned 0");
setErrorReturn(EGL_BAD_ALLOC, EGL_NO_CONTEXT);
}
@@ -972,7 +972,7 @@ EGLBoolean eglMakeCurrent(EGLDisplay dpy, EGLSurface draw, EGLSurface read, EGLC
DEFINE_AND_VALIDATE_HOST_CONNECTION(EGL_FALSE);
if (rcEnc->rcMakeCurrent(rcEnc, ctxHandle, drawHandle, readHandle) == EGL_FALSE) {
LOGE("rcMakeCurrent returned EGL_FALSE");
ALOGE("rcMakeCurrent returned EGL_FALSE");
setErrorReturn(EGL_BAD_CONTEXT, EGL_FALSE);
}
@@ -1098,7 +1098,7 @@ EGLBoolean eglQueryContext(EGLDisplay dpy, EGLContext ctx, EGLint attribute, EGL
*value = EGL_BACK_BUFFER; //single buffer not supported
break;
default:
LOGE("eglQueryContext %x EGL_BAD_ATTRIBUTE", attribute);
ALOGE("eglQueryContext %x EGL_BAD_ATTRIBUTE", attribute);
setErrorReturn(EGL_BAD_ATTRIBUTE, EGL_FALSE);
break;
}

View File

@@ -88,7 +88,7 @@ bool eglDisplay::initialize(EGLClient_eglInterface *eglIface)
&s_gles_lib);
if (!m_gles_iface) {
pthread_mutex_unlock(&m_lock);
LOGE("Failed to load gles1 iface");
ALOGE("Failed to load gles1 iface");
return false;
}
@@ -106,7 +106,7 @@ bool eglDisplay::initialize(EGLClient_eglInterface *eglIface)
HostConnection *hcon = HostConnection::get();
if (!hcon) {
pthread_mutex_unlock(&m_lock);
LOGE("Failed to establish connection with the host\n");
ALOGE("Failed to establish connection with the host\n");
return false;
}
@@ -116,7 +116,7 @@ bool eglDisplay::initialize(EGLClient_eglInterface *eglIface)
renderControl_encoder_context_t *rcEnc = hcon->rcEncoder();
if (!rcEnc) {
pthread_mutex_unlock(&m_lock);
LOGE("Failed to get renderControl encoder instance");
ALOGE("Failed to get renderControl encoder instance");
return false;
}
@@ -228,13 +228,13 @@ EGLClient_glesInterface *eglDisplay::loadGLESClientAPI(const char *libName,
{
void *lib = dlopen(libName, RTLD_NOW);
if (!lib) {
LOGE("Failed to dlopen %s", libName);
ALOGE("Failed to dlopen %s", libName);
return NULL;
}
init_emul_gles_t init_gles_func = (init_emul_gles_t)dlsym(lib,"init_emul_gles");
if (!init_gles_func) {
LOGE("Failed to find init_emul_gles");
ALOGE("Failed to find init_emul_gles");
dlclose((void*)lib);
return NULL;
}
@@ -385,7 +385,7 @@ const char *eglDisplay::queryString(EGLint name)
return m_extensionString;
}
else {
LOGE("[%s] Unknown name %d\n", __FUNCTION__, name);
ALOGE("[%s] Unknown name %d\n", __FUNCTION__, name);
return NULL;
}
}
@@ -397,7 +397,7 @@ EGLBoolean eglDisplay::getAttribValue(EGLConfig config, EGLint attribIdx, EGLint
{
if (attribIdx == ATTRIBUTE_NONE)
{
LOGE("[%s] Bad attribute idx\n", __FUNCTION__);
ALOGE("[%s] Bad attribute idx\n", __FUNCTION__);
return EGL_FALSE;
}
*value = *(m_configs + (int)config*m_numConfigAttribs + attribIdx);
@@ -430,7 +430,7 @@ EGLBoolean eglDisplay::setAttribValue(EGLConfig config, EGLint attribIdx, EGLint
{
if (attribIdx == ATTRIBUTE_NONE)
{
LOGE("[%s] Bad attribute idx\n", __FUNCTION__);
ALOGE("[%s] Bad attribute idx\n", __FUNCTION__);
return EGL_FALSE;
}
*(m_configs + (int)config*m_numConfigAttribs + attribIdx) = value;
@@ -456,7 +456,7 @@ EGLBoolean eglDisplay::getConfigNativePixelFormat(EGLConfig config, PixelFormat
getAttribValue(config, m_attribs.valueFor(EGL_GREEN_SIZE), &greenSize) &&
getAttribValue(config, m_attribs.valueFor(EGL_ALPHA_SIZE), &alphaSize)) )
{
LOGE("Couldn't find value for one of the pixel format attributes");
ALOGE("Couldn't find value for one of the pixel format attributes");
return EGL_FALSE;
}
@@ -480,7 +480,7 @@ EGLBoolean eglDisplay::getConfigGLPixelFormat(EGLConfig config, GLenum * format)
getAttribValue(config, m_attribs.valueFor(EGL_GREEN_SIZE), &greenSize) &&
getAttribValue(config, m_attribs.valueFor(EGL_ALPHA_SIZE), &alphaSize)) )
{
LOGE("Couldn't find value for one of the pixel format attributes");
ALOGE("Couldn't find value for one of the pixel format attributes");
return EGL_FALSE;
}

View File

@@ -113,12 +113,12 @@ static int map_buffer(cb_handle_t *cb, void **vaddr)
#define DEFINE_AND_VALIDATE_HOST_CONNECTION \
HostConnection *hostCon = HostConnection::get(); \
if (!hostCon) { \
LOGE("gralloc: Failed to get host connection\n"); \
ALOGE("gralloc: Failed to get host connection\n"); \
return -EIO; \
} \
renderControl_encoder_context_t *rcEnc = hostCon->rcEncoder(); \
if (!rcEnc) { \
LOGE("gralloc: Failed to get renderControl encoder context\n"); \
ALOGE("gralloc: Failed to get renderControl encoder context\n"); \
return -EIO; \
}
@@ -209,7 +209,7 @@ static int gralloc_alloc(alloc_device_t* dev,
fd = ashmem_create_region("gralloc-buffer", ashmem_size);
if (fd < 0) {
LOGE("gralloc_alloc failed to create ashmem region: %s\n", strerror(errno));
ALOGE("gralloc_alloc failed to create ashmem region: %s\n", strerror(errno));
return -errno;
}
}
@@ -503,7 +503,7 @@ static int gralloc_lock(gralloc_module_t const* module,
private_module_t *gr = (private_module_t *)module;
cb_handle_t *cb = (cb_handle_t *)handle;
if (!gr || !cb_handle_t::validate(cb)) {
LOGE("gralloc_lock bad handle\n");
ALOGE("gralloc_lock bad handle\n");
return -EINVAL;
}
@@ -522,7 +522,7 @@ static int gralloc_lock(gralloc_module_t const* module,
(!sw_read && !sw_write) ||
(sw_read && !sw_read_allowed) ||
(sw_write && !sw_write_allowed) ) {
LOGE("gralloc_lock usage mismatch usage=0x%x cb->usage=0x%x\n", usage, cb->usage);
ALOGE("gralloc_lock usage mismatch usage=0x%x cb->usage=0x%x\n", usage, cb->usage);
return -EINVAL;
}
@@ -559,7 +559,7 @@ static int gralloc_lock(gralloc_module_t const* module,
if (hostSyncStatus < 0) {
// host failed the color buffer sync - probably since it was already
// locked for write access. fail the lock.
LOGE("gralloc_lock cacheFlush failed postCount=%d sw_read=%d\n",
ALOGE("gralloc_lock cacheFlush failed postCount=%d sw_read=%d\n",
postCount, sw_read);
return -EBUSY;
}
@@ -669,7 +669,7 @@ static int gralloc_device_open(const hw_module_t* module,
// return error if connection with host can not be established
HostConnection *hostCon = HostConnection::get();
if (!hostCon) {
LOGE("gralloc: failed to get host connection while opening %s\n", name);
ALOGE("gralloc: failed to get host connection while opening %s\n", name);
return -EIO;
}
@@ -814,6 +814,6 @@ fallback_init(void)
}
}
if (sFallback == NULL) {
LOGE("Could not find software fallback module!?");
ALOGE("Could not find software fallback module!?");
}
}

View File

@@ -83,7 +83,7 @@ int ServerConnection::create(size_t bufsize,
QemuPipeStream* pipeStream = new QemuPipeStream(bufsize);
if (pipeStream->connect() < 0) {
LOGE("couldn't connect to host server\n");
ALOGE("couldn't connect to host server\n");
delete pipeStream;
return -1;
}
@@ -102,7 +102,7 @@ int ServerConnection::create(size_t bufsize,
}
if (tcpStream->connect(hostname, CODEC_SERVER_PORT) < 0) {
LOGE("couldn't connect to %s\n", hostname);
ALOGE("couldn't connect to %s\n", hostname);
free(hostname);
delete tcpStream;
return -1;

View File

@@ -58,7 +58,7 @@ int initApi(const char *driverLibName, const char *implLibName, T **dispatchTabl
{
void *driverLib = dlopen(driverLibName, RTLD_NOW | RTLD_LOCAL);
if (driverLib == NULL) {
LOGE("failed to load %s : %s\n", driverLibName, dlerror());
ALOGE("failed to load %s : %s\n", driverLibName, dlerror());
return -1;
}
@@ -66,13 +66,13 @@ int initApi(const char *driverLibName, const char *implLibName, T **dispatchTabl
createFcn_t createFcn;
createFcn = (createFcn_t) dlsym(driverLib, "createFromLib");
if (createFcn == NULL) {
LOGE("failed to load createFromLib constructor function\n");
ALOGE("failed to load createFromLib constructor function\n");
return -1;
}
void *implLib = dlopen(implLibName, RTLD_NOW | RTLD_LOCAL);
if (implLib == NULL) {
LOGE("couldn't open %s", implLibName);
ALOGE("couldn't open %s", implLibName);
return -2;
}
*dispatchTable = createFcn(implLib, accessor);
@@ -112,20 +112,20 @@ const char *getProcName()
// we need to obtain our process name from the command line;
FILE *fp = fopen("/proc/self/cmdline", "rt");
if (fp == NULL) {
LOGE("couldn't open /proc/self/cmdline\n");
ALOGE("couldn't open /proc/self/cmdline\n");
return NULL;
}
char line[1000];
if (fgets(line, sizeof(line), fp) == NULL) {
LOGE("couldn't read the self cmdline from \n");
ALOGE("couldn't read the self cmdline from \n");
fclose(fp);
return NULL;
}
fclose(fp);
if (line[0] == '\0') {
LOGE("cmdline is empty\n");
ALOGE("cmdline is empty\n");
return NULL;
}
@@ -159,7 +159,7 @@ bool isNeedEncode()
// check on our whitelist
FILE *fp = fopen(GLES_EMUL_TARGETS_FILE, "rt");
if (fp == NULL) {
LOGE("couldn't open %s\n", GLES_EMUL_TARGETS_FILE);
ALOGE("couldn't open %s\n", GLES_EMUL_TARGETS_FILE);
return false;
}
@@ -213,7 +213,7 @@ void initDispatchTables()
// initialize a connection to the server, and the GLESv1/v2 encoders;
ServerConnection * connection = ServerConnection::s_getServerConnection();
if (connection == NULL) {
LOGE("couldn't create server connection\n");
ALOGE("couldn't create server connection\n");
s_needEncode = false;
}
}

View File

@@ -27,7 +27,7 @@ void init_gles(void *gles_android)
{
s_dispatch = create_gles_dispatch(gles_android);
if (s_dispatch == NULL) {
LOGE("failed to create gles dispatch\n");
ALOGE("failed to create gles dispatch\n");
}
}

View File

@@ -215,7 +215,7 @@ void CallbackNotifier::onNextFrameAvailable(const void* frame,
mDataCBTimestamp(timestamp, CAMERA_MSG_VIDEO_FRAME,
cam_buff, 0, mCBOpaque);
} else {
LOGE("%s: Memory failure in CAMERA_MSG_VIDEO_FRAME", __FUNCTION__);
ALOGE("%s: Memory failure in CAMERA_MSG_VIDEO_FRAME", __FUNCTION__);
}
}
@@ -227,7 +227,7 @@ void CallbackNotifier::onNextFrameAvailable(const void* frame,
mDataCB(CAMERA_MSG_PREVIEW_FRAME, cam_buff, 0, NULL, mCBOpaque);
cam_buff->release(cam_buff);
} else {
LOGE("%s: Memory failure in CAMERA_MSG_PREVIEW_FRAME", __FUNCTION__);
ALOGE("%s: Memory failure in CAMERA_MSG_PREVIEW_FRAME", __FUNCTION__);
}
}
@@ -261,10 +261,10 @@ void CallbackNotifier::onNextFrameAvailable(const void* frame,
mDataCB(CAMERA_MSG_COMPRESSED_IMAGE, jpeg_buff, 0, NULL, mCBOpaque);
jpeg_buff->release(jpeg_buff);
} else {
LOGE("%s: Memory failure in CAMERA_MSG_VIDEO_FRAME", __FUNCTION__);
ALOGE("%s: Memory failure in CAMERA_MSG_VIDEO_FRAME", __FUNCTION__);
}
} else {
LOGE("%s: Compression failure in CAMERA_MSG_VIDEO_FRAME", __FUNCTION__);
ALOGE("%s: Compression failure in CAMERA_MSG_VIDEO_FRAME", __FUNCTION__);
}
}
}

View File

@@ -198,7 +198,7 @@ status_t EmulatedCamera::connectCamera(hw_device_t** device)
status_t res = EINVAL;
EmulatedCameraDevice* const camera_dev = getCameraDevice();
LOGE_IF(camera_dev == NULL, "%s: No camera device instance.", __FUNCTION__);
ALOGE_IF(camera_dev == NULL, "%s: No camera device instance.", __FUNCTION__);
if (camera_dev != NULL) {
/* Connect to the camera device. */
@@ -358,7 +358,7 @@ status_t EmulatedCamera::takePicture()
/* We only have JPEG converted for NV21 format. */
org_fmt = V4L2_PIX_FMT_NV21;
} else {
LOGE("%s: Unsupported pixel format %s", __FUNCTION__, pix_fmt);
ALOGE("%s: Unsupported pixel format %s", __FUNCTION__, pix_fmt);
return EINVAL;
}
/* Get JPEG quality. */
@@ -496,7 +496,7 @@ char* EmulatedCamera::getParameters()
strncpy(ret_str, params.string(), params.length()+1);
return ret_str;
} else {
LOGE("%s: Unable to allocate string for %s", __FUNCTION__, params.string());
ALOGE("%s: Unable to allocate string for %s", __FUNCTION__, params.string());
/* Apparently, we can't return NULL fron this routine. */
return &lNoParam;
}
@@ -590,7 +590,7 @@ status_t EmulatedCamera::doStartPreview()
pix_fmt = mParameters.getPreviewFormat();
}
if (pix_fmt == NULL) {
LOGE("%s: Unable to obtain video format", __FUNCTION__);
ALOGE("%s: Unable to obtain video format", __FUNCTION__);
mPreviewWindow.stopPreview();
return EINVAL;
}
@@ -604,7 +604,7 @@ status_t EmulatedCamera::doStartPreview()
} else if (strcmp(pix_fmt, CameraParameters::PIXEL_FORMAT_YUV420SP) == 0) {
org_fmt = V4L2_PIX_FMT_NV21;
} else {
LOGE("%s: Unsupported pixel format %s", __FUNCTION__, pix_fmt);
ALOGE("%s: Unsupported pixel format %s", __FUNCTION__, pix_fmt);
mPreviewWindow.stopPreview();
return EINVAL;
}
@@ -695,7 +695,7 @@ int EmulatedCamera::set_preview_window(struct camera_device* dev,
{
EmulatedCamera* ec = reinterpret_cast<EmulatedCamera*>(dev->priv);
if (ec == NULL) {
LOGE("%s: Unexpected NULL camera device", __FUNCTION__);
ALOGE("%s: Unexpected NULL camera device", __FUNCTION__);
return -EINVAL;
}
return ec->setPreviewWindow(window);
@@ -711,7 +711,7 @@ void EmulatedCamera::set_callbacks(
{
EmulatedCamera* ec = reinterpret_cast<EmulatedCamera*>(dev->priv);
if (ec == NULL) {
LOGE("%s: Unexpected NULL camera device", __FUNCTION__);
ALOGE("%s: Unexpected NULL camera device", __FUNCTION__);
return;
}
ec->setCallbacks(notify_cb, data_cb, data_cb_timestamp, get_memory, user);
@@ -721,7 +721,7 @@ void EmulatedCamera::enable_msg_type(struct camera_device* dev, int32_t msg_type
{
EmulatedCamera* ec = reinterpret_cast<EmulatedCamera*>(dev->priv);
if (ec == NULL) {
LOGE("%s: Unexpected NULL camera device", __FUNCTION__);
ALOGE("%s: Unexpected NULL camera device", __FUNCTION__);
return;
}
ec->enableMsgType(msg_type);
@@ -731,7 +731,7 @@ void EmulatedCamera::disable_msg_type(struct camera_device* dev, int32_t msg_typ
{
EmulatedCamera* ec = reinterpret_cast<EmulatedCamera*>(dev->priv);
if (ec == NULL) {
LOGE("%s: Unexpected NULL camera device", __FUNCTION__);
ALOGE("%s: Unexpected NULL camera device", __FUNCTION__);
return;
}
ec->disableMsgType(msg_type);
@@ -741,7 +741,7 @@ int EmulatedCamera::msg_type_enabled(struct camera_device* dev, int32_t msg_type
{
EmulatedCamera* ec = reinterpret_cast<EmulatedCamera*>(dev->priv);
if (ec == NULL) {
LOGE("%s: Unexpected NULL camera device", __FUNCTION__);
ALOGE("%s: Unexpected NULL camera device", __FUNCTION__);
return -EINVAL;
}
return ec->isMsgTypeEnabled(msg_type);
@@ -751,7 +751,7 @@ int EmulatedCamera::start_preview(struct camera_device* dev)
{
EmulatedCamera* ec = reinterpret_cast<EmulatedCamera*>(dev->priv);
if (ec == NULL) {
LOGE("%s: Unexpected NULL camera device", __FUNCTION__);
ALOGE("%s: Unexpected NULL camera device", __FUNCTION__);
return -EINVAL;
}
return ec->startPreview();
@@ -761,7 +761,7 @@ void EmulatedCamera::stop_preview(struct camera_device* dev)
{
EmulatedCamera* ec = reinterpret_cast<EmulatedCamera*>(dev->priv);
if (ec == NULL) {
LOGE("%s: Unexpected NULL camera device", __FUNCTION__);
ALOGE("%s: Unexpected NULL camera device", __FUNCTION__);
return;
}
ec->stopPreview();
@@ -771,7 +771,7 @@ int EmulatedCamera::preview_enabled(struct camera_device* dev)
{
EmulatedCamera* ec = reinterpret_cast<EmulatedCamera*>(dev->priv);
if (ec == NULL) {
LOGE("%s: Unexpected NULL camera device", __FUNCTION__);
ALOGE("%s: Unexpected NULL camera device", __FUNCTION__);
return -EINVAL;
}
return ec->isPreviewEnabled();
@@ -782,7 +782,7 @@ int EmulatedCamera::store_meta_data_in_buffers(struct camera_device* dev,
{
EmulatedCamera* ec = reinterpret_cast<EmulatedCamera*>(dev->priv);
if (ec == NULL) {
LOGE("%s: Unexpected NULL camera device", __FUNCTION__);
ALOGE("%s: Unexpected NULL camera device", __FUNCTION__);
return -EINVAL;
}
return ec->storeMetaDataInBuffers(enable);
@@ -792,7 +792,7 @@ int EmulatedCamera::start_recording(struct camera_device* dev)
{
EmulatedCamera* ec = reinterpret_cast<EmulatedCamera*>(dev->priv);
if (ec == NULL) {
LOGE("%s: Unexpected NULL camera device", __FUNCTION__);
ALOGE("%s: Unexpected NULL camera device", __FUNCTION__);
return -EINVAL;
}
return ec->startRecording();
@@ -802,7 +802,7 @@ void EmulatedCamera::stop_recording(struct camera_device* dev)
{
EmulatedCamera* ec = reinterpret_cast<EmulatedCamera*>(dev->priv);
if (ec == NULL) {
LOGE("%s: Unexpected NULL camera device", __FUNCTION__);
ALOGE("%s: Unexpected NULL camera device", __FUNCTION__);
return;
}
ec->stopRecording();
@@ -812,7 +812,7 @@ int EmulatedCamera::recording_enabled(struct camera_device* dev)
{
EmulatedCamera* ec = reinterpret_cast<EmulatedCamera*>(dev->priv);
if (ec == NULL) {
LOGE("%s: Unexpected NULL camera device", __FUNCTION__);
ALOGE("%s: Unexpected NULL camera device", __FUNCTION__);
return -EINVAL;
}
return ec->isRecordingEnabled();
@@ -823,7 +823,7 @@ void EmulatedCamera::release_recording_frame(struct camera_device* dev,
{
EmulatedCamera* ec = reinterpret_cast<EmulatedCamera*>(dev->priv);
if (ec == NULL) {
LOGE("%s: Unexpected NULL camera device", __FUNCTION__);
ALOGE("%s: Unexpected NULL camera device", __FUNCTION__);
return;
}
ec->releaseRecordingFrame(opaque);
@@ -833,7 +833,7 @@ int EmulatedCamera::auto_focus(struct camera_device* dev)
{
EmulatedCamera* ec = reinterpret_cast<EmulatedCamera*>(dev->priv);
if (ec == NULL) {
LOGE("%s: Unexpected NULL camera device", __FUNCTION__);
ALOGE("%s: Unexpected NULL camera device", __FUNCTION__);
return -EINVAL;
}
return ec->setAutoFocus();
@@ -843,7 +843,7 @@ int EmulatedCamera::cancel_auto_focus(struct camera_device* dev)
{
EmulatedCamera* ec = reinterpret_cast<EmulatedCamera*>(dev->priv);
if (ec == NULL) {
LOGE("%s: Unexpected NULL camera device", __FUNCTION__);
ALOGE("%s: Unexpected NULL camera device", __FUNCTION__);
return -EINVAL;
}
return ec->cancelAutoFocus();
@@ -853,7 +853,7 @@ int EmulatedCamera::take_picture(struct camera_device* dev)
{
EmulatedCamera* ec = reinterpret_cast<EmulatedCamera*>(dev->priv);
if (ec == NULL) {
LOGE("%s: Unexpected NULL camera device", __FUNCTION__);
ALOGE("%s: Unexpected NULL camera device", __FUNCTION__);
return -EINVAL;
}
return ec->takePicture();
@@ -863,7 +863,7 @@ int EmulatedCamera::cancel_picture(struct camera_device* dev)
{
EmulatedCamera* ec = reinterpret_cast<EmulatedCamera*>(dev->priv);
if (ec == NULL) {
LOGE("%s: Unexpected NULL camera device", __FUNCTION__);
ALOGE("%s: Unexpected NULL camera device", __FUNCTION__);
return -EINVAL;
}
return ec->cancelPicture();
@@ -873,7 +873,7 @@ int EmulatedCamera::set_parameters(struct camera_device* dev, const char* parms)
{
EmulatedCamera* ec = reinterpret_cast<EmulatedCamera*>(dev->priv);
if (ec == NULL) {
LOGE("%s: Unexpected NULL camera device", __FUNCTION__);
ALOGE("%s: Unexpected NULL camera device", __FUNCTION__);
return -EINVAL;
}
return ec->setParameters(parms);
@@ -883,7 +883,7 @@ char* EmulatedCamera::get_parameters(struct camera_device* dev)
{
EmulatedCamera* ec = reinterpret_cast<EmulatedCamera*>(dev->priv);
if (ec == NULL) {
LOGE("%s: Unexpected NULL camera device", __FUNCTION__);
ALOGE("%s: Unexpected NULL camera device", __FUNCTION__);
return NULL;
}
return ec->getParameters();
@@ -893,7 +893,7 @@ void EmulatedCamera::put_parameters(struct camera_device* dev, char* params)
{
EmulatedCamera* ec = reinterpret_cast<EmulatedCamera*>(dev->priv);
if (ec == NULL) {
LOGE("%s: Unexpected NULL camera device", __FUNCTION__);
ALOGE("%s: Unexpected NULL camera device", __FUNCTION__);
return;
}
ec->putParameters(params);
@@ -906,7 +906,7 @@ int EmulatedCamera::send_command(struct camera_device* dev,
{
EmulatedCamera* ec = reinterpret_cast<EmulatedCamera*>(dev->priv);
if (ec == NULL) {
LOGE("%s: Unexpected NULL camera device", __FUNCTION__);
ALOGE("%s: Unexpected NULL camera device", __FUNCTION__);
return -EINVAL;
}
return ec->sendCommand(cmd, arg1, arg2);
@@ -916,7 +916,7 @@ void EmulatedCamera::release(struct camera_device* dev)
{
EmulatedCamera* ec = reinterpret_cast<EmulatedCamera*>(dev->priv);
if (ec == NULL) {
LOGE("%s: Unexpected NULL camera device", __FUNCTION__);
ALOGE("%s: Unexpected NULL camera device", __FUNCTION__);
return;
}
ec->releaseCamera();
@@ -926,7 +926,7 @@ int EmulatedCamera::dump(struct camera_device* dev, int fd)
{
EmulatedCamera* ec = reinterpret_cast<EmulatedCamera*>(dev->priv);
if (ec == NULL) {
LOGE("%s: Unexpected NULL camera device", __FUNCTION__);
ALOGE("%s: Unexpected NULL camera device", __FUNCTION__);
return -EINVAL;
}
return ec->dumpCamera(fd);
@@ -937,7 +937,7 @@ int EmulatedCamera::close(struct hw_device_t* device)
EmulatedCamera* ec =
reinterpret_cast<EmulatedCamera*>(reinterpret_cast<struct camera_device*>(device)->priv);
if (ec == NULL) {
LOGE("%s: Unexpected NULL camera device", __FUNCTION__);
ALOGE("%s: Unexpected NULL camera device", __FUNCTION__);
return -EINVAL;
}
return ec->closeCamera();
@@ -997,7 +997,7 @@ static char* AddValue(const char* param, const char* val)
const size_t len1 = strlen(param);
const size_t len2 = strlen(val);
char* ret = reinterpret_cast<char*>(malloc(len1 + len2 + 2));
LOGE_IF(ret == NULL, "%s: Memory failure", __FUNCTION__);
ALOGE_IF(ret == NULL, "%s: Memory failure", __FUNCTION__);
if (ret != NULL) {
memcpy(ret, param, len1);
ret[len1] = ',';

View File

@@ -73,7 +73,7 @@ status_t EmulatedCameraDevice::Initialize()
/* Instantiate worker thread object. */
mWorkerThread = new WorkerThread(this);
if (getWorkerThread() == NULL) {
LOGE("%s: Unable to instantiate worker thread object", __FUNCTION__);
ALOGE("%s: Unable to instantiate worker thread object", __FUNCTION__);
return ENOMEM;
}
@@ -87,13 +87,13 @@ status_t EmulatedCameraDevice::startDeliveringFrames(bool one_burst)
ALOGV("%s", __FUNCTION__);
if (!isStarted()) {
LOGE("%s: Device is not started", __FUNCTION__);
ALOGE("%s: Device is not started", __FUNCTION__);
return EINVAL;
}
/* Frames will be delivered from the thread routine. */
const status_t res = startWorkerThread(one_burst);
LOGE_IF(res != NO_ERROR, "%s: startWorkerThread failed", __FUNCTION__);
ALOGE_IF(res != NO_ERROR, "%s: startWorkerThread failed", __FUNCTION__);
return res;
}
@@ -107,7 +107,7 @@ status_t EmulatedCameraDevice::stopDeliveringFrames()
}
const status_t res = stopWorkerThread();
LOGE_IF(res != NO_ERROR, "%s: startWorkerThread failed", __FUNCTION__);
ALOGE_IF(res != NO_ERROR, "%s: startWorkerThread failed", __FUNCTION__);
return res;
}
@@ -158,11 +158,11 @@ void EmulatedCameraDevice::changeWhiteBalance(uint8_t& y,
status_t EmulatedCameraDevice::getCurrentPreviewFrame(void* buffer)
{
if (!isStarted()) {
LOGE("%s: Device is not started", __FUNCTION__);
ALOGE("%s: Device is not started", __FUNCTION__);
return EINVAL;
}
if (mCurrentFrame == NULL || buffer == NULL) {
LOGE("%s: No framebuffer", __FUNCTION__);
ALOGE("%s: No framebuffer", __FUNCTION__);
return EINVAL;
}
@@ -182,7 +182,7 @@ status_t EmulatedCameraDevice::getCurrentPreviewFrame(void* buffer)
return NO_ERROR;
default:
LOGE("%s: Unknown pixel format %.4s",
ALOGE("%s: Unknown pixel format %.4s",
__FUNCTION__, reinterpret_cast<const char*>(&mPixelFormat));
return EINVAL;
}
@@ -206,7 +206,7 @@ status_t EmulatedCameraDevice::commonStartDevice(int width,
break;
default:
LOGE("%s: Unknown pixel format %.4s",
ALOGE("%s: Unknown pixel format %.4s",
__FUNCTION__, reinterpret_cast<const char*>(&pix_fmt));
return EINVAL;
}
@@ -220,7 +220,7 @@ status_t EmulatedCameraDevice::commonStartDevice(int width,
/* Allocate framebuffer. */
mCurrentFrame = new uint8_t[mFrameBufferSize];
if (mCurrentFrame == NULL) {
LOGE("%s: Unable to allocate framebuffer", __FUNCTION__);
ALOGE("%s: Unable to allocate framebuffer", __FUNCTION__);
return ENOMEM;
}
ALOGV("%s: Allocated %p %d bytes for %d pixels in %.4s[%dx%d] frame",
@@ -249,12 +249,12 @@ status_t EmulatedCameraDevice::startWorkerThread(bool one_burst)
ALOGV("%s", __FUNCTION__);
if (!isInitialized()) {
LOGE("%s: Emulated camera device is not initialized", __FUNCTION__);
ALOGE("%s: Emulated camera device is not initialized", __FUNCTION__);
return EINVAL;
}
const status_t res = getWorkerThread()->startThread(one_burst);
LOGE_IF(res != NO_ERROR, "%s: Unable to start worker thread", __FUNCTION__);
ALOGE_IF(res != NO_ERROR, "%s: Unable to start worker thread", __FUNCTION__);
return res;
}
@@ -263,12 +263,12 @@ status_t EmulatedCameraDevice::stopWorkerThread()
ALOGV("%s", __FUNCTION__);
if (!isInitialized()) {
LOGE("%s: Emulated camera device is not initialized", __FUNCTION__);
ALOGE("%s: Emulated camera device is not initialized", __FUNCTION__);
return EINVAL;
}
const status_t res = getWorkerThread()->stopThread();
LOGE_IF(res != NO_ERROR, "%s: Unable to stop worker thread", __FUNCTION__);
ALOGE_IF(res != NO_ERROR, "%s: Unable to stop worker thread", __FUNCTION__);
return res;
}
@@ -297,7 +297,7 @@ status_t EmulatedCameraDevice::WorkerThread::readyToRun()
ALOGV("Emulated device's worker thread has been started.");
return NO_ERROR;
} else {
LOGE("%s: Unable to create thread control FDs: %d -> %s",
ALOGE("%s: Unable to create thread control FDs: %d -> %s",
__FUNCTION__, errno, strerror(errno));
return errno;
}
@@ -328,16 +328,16 @@ status_t EmulatedCameraDevice::WorkerThread::stopThread()
}
ALOGV("Emulated camera device's worker thread has been stopped.");
} else {
LOGE("%s: requestExitAndWait failed: %d -> %s",
ALOGE("%s: requestExitAndWait failed: %d -> %s",
__FUNCTION__, res, strerror(-res));
}
} else {
LOGE("%s: Unable to send THREAD_STOP message: %d -> %s",
ALOGE("%s: Unable to send THREAD_STOP message: %d -> %s",
__FUNCTION__, errno, strerror(errno));
res = errno ? errno : EINVAL;
}
} else {
LOGE("%s: Thread control FDs are not opened", __FUNCTION__);
ALOGE("%s: Thread control FDs are not opened", __FUNCTION__);
}
return res;
@@ -363,7 +363,7 @@ EmulatedCameraDevice::WorkerThread::Select(int fd, int timeout)
}
int res = TEMP_FAILURE_RETRY(select(fd_num, fds, NULL, NULL, tvp));
if (res < 0) {
LOGE("%s: select returned %d and failed: %d -> %s",
ALOGE("%s: select returned %d and failed: %d -> %s",
__FUNCTION__, res, errno, strerror(errno));
return ERROR;
} else if (res == 0) {
@@ -374,7 +374,7 @@ EmulatedCameraDevice::WorkerThread::Select(int fd, int timeout)
ControlMessage msg;
res = TEMP_FAILURE_RETRY(read(mControlFD, &msg, sizeof(msg)));
if (res != sizeof(msg)) {
LOGE("%s: Unexpected message size %d, or an error %d -> %s",
ALOGE("%s: Unexpected message size %d, or an error %d -> %s",
__FUNCTION__, res, errno, strerror(errno));
return ERROR;
}
@@ -383,7 +383,7 @@ EmulatedCameraDevice::WorkerThread::Select(int fd, int timeout)
ALOGV("%s: THREAD_STOP message is received", __FUNCTION__);
return EXIT_THREAD;
} else {
LOGE("Unknown worker thread message %d", msg);
ALOGE("Unknown worker thread message %d", msg);
return ERROR;
}
} else {

View File

@@ -192,7 +192,7 @@ public:
*/
inline int getFrameWidth() const
{
LOGE_IF(!isStarted(), "%s: Device is not started", __FUNCTION__);
ALOGE_IF(!isStarted(), "%s: Device is not started", __FUNCTION__);
return mFrameWidth;
}
@@ -204,7 +204,7 @@ public:
*/
inline int getFrameHeight() const
{
LOGE_IF(!isStarted(), "%s: Device is not started", __FUNCTION__);
ALOGE_IF(!isStarted(), "%s: Device is not started", __FUNCTION__);
return mFrameHeight;
}
@@ -215,7 +215,7 @@ public:
*/
inline size_t getFrameBufferSize() const
{
LOGE_IF(!isStarted(), "%s: Device is not started", __FUNCTION__);
ALOGE_IF(!isStarted(), "%s: Device is not started", __FUNCTION__);
return mFrameBufferSize;
}
@@ -226,7 +226,7 @@ public:
*/
inline int getPixelNum() const
{
LOGE_IF(!isStarted(), "%s: Device is not started", __FUNCTION__);
ALOGE_IF(!isStarted(), "%s: Device is not started", __FUNCTION__);
return mTotalPixels;
}
@@ -252,7 +252,7 @@ public:
*/
inline uint32_t getOriginalPixelFormat() const
{
LOGE_IF(!isStarted(), "%s: Device is not started", __FUNCTION__);
ALOGE_IF(!isStarted(), "%s: Device is not started", __FUNCTION__);
return mPixelFormat;
}

View File

@@ -61,7 +61,7 @@ EmulatedCameraFactory::EmulatedCameraFactory()
if (mEmulatedCameras == NULL) {
mEmulatedCameras = new EmulatedCamera*[mEmulatedCameraNum];
if (mEmulatedCameras == NULL) {
LOGE("%s: Unable to allocate emulated camera array for %d entries",
ALOGE("%s: Unable to allocate emulated camera array for %d entries",
__FUNCTION__, mEmulatedCameraNum);
return;
}
@@ -80,7 +80,7 @@ EmulatedCameraFactory::EmulatedCameraFactory()
} else {
mEmulatedCameras--;
mFakeCameraID = -1;
LOGE("%s: Unable to instantiate fake camera class", __FUNCTION__);
ALOGE("%s: Unable to instantiate fake camera class", __FUNCTION__);
}
} else {
ALOGD("Fake camera emulation is disabled.");
@@ -119,12 +119,12 @@ int EmulatedCameraFactory::cameraDeviceOpen(int camera_id, hw_device_t** device)
*device = NULL;
if (!isConstructedOK()) {
LOGE("%s: EmulatedCameraFactory has failed to initialize", __FUNCTION__);
ALOGE("%s: EmulatedCameraFactory has failed to initialize", __FUNCTION__);
return -EINVAL;
}
if (camera_id < 0 || camera_id >= getEmulatedCameraNum()) {
LOGE("%s: Camera id %d is out of bounds (%d)",
ALOGE("%s: Camera id %d is out of bounds (%d)",
__FUNCTION__, camera_id, getEmulatedCameraNum());
return -EINVAL;
}
@@ -137,12 +137,12 @@ int EmulatedCameraFactory::getCameraInfo(int camera_id, struct camera_info* info
ALOGV("%s: id = %d", __FUNCTION__, camera_id);
if (!isConstructedOK()) {
LOGE("%s: EmulatedCameraFactory has failed to initialize", __FUNCTION__);
ALOGE("%s: EmulatedCameraFactory has failed to initialize", __FUNCTION__);
return -EINVAL;
}
if (camera_id < 0 || camera_id >= getEmulatedCameraNum()) {
LOGE("%s: Camera id %d is out of bounds (%d)",
ALOGE("%s: Camera id %d is out of bounds (%d)",
__FUNCTION__, camera_id, getEmulatedCameraNum());
return -EINVAL;
}
@@ -164,12 +164,12 @@ int EmulatedCameraFactory::device_open(const hw_module_t* module,
*/
if (module != &HAL_MODULE_INFO_SYM.common) {
LOGE("%s: Invalid module %p expected %p",
ALOGE("%s: Invalid module %p expected %p",
__FUNCTION__, module, &HAL_MODULE_INFO_SYM.common);
return -EINVAL;
}
if (name == NULL) {
LOGE("%s: NULL name is not expected here", __FUNCTION__);
ALOGE("%s: NULL name is not expected here", __FUNCTION__);
return -EINVAL;
}
@@ -233,7 +233,7 @@ void EmulatedCameraFactory::createQemuCameras()
* one more entry for the fake camera emulation. */
mEmulatedCameras = new EmulatedCamera*[num + 1];
if (mEmulatedCameras == NULL) {
LOGE("%s: Unable to allocate emulated camera array for %d entries",
ALOGE("%s: Unable to allocate emulated camera array for %d entries",
__FUNCTION__, num + 1);
free(camera_list);
return;
@@ -292,7 +292,7 @@ void EmulatedCameraFactory::createQemuCameras()
delete qemu_cam;
}
} else {
LOGE("%s: Unable to instantiate EmulatedQemuCamera",
ALOGE("%s: Unable to instantiate EmulatedQemuCamera",
__FUNCTION__);
}
} else {

View File

@@ -67,7 +67,7 @@ status_t EmulatedFakeCameraDevice::connectDevice()
Mutex::Autolock locker(&mObjectLock);
if (!isInitialized()) {
LOGE("%s: Fake camera device is not initialized.", __FUNCTION__);
ALOGE("%s: Fake camera device is not initialized.", __FUNCTION__);
return EINVAL;
}
if (isConnected()) {
@@ -91,7 +91,7 @@ status_t EmulatedFakeCameraDevice::disconnectDevice()
return NO_ERROR;
}
if (isStarted()) {
LOGE("%s: Cannot disconnect from the started device.", __FUNCTION__);
ALOGE("%s: Cannot disconnect from the started device.", __FUNCTION__);
return EINVAL;
}
@@ -109,11 +109,11 @@ status_t EmulatedFakeCameraDevice::startDevice(int width,
Mutex::Autolock locker(&mObjectLock);
if (!isConnected()) {
LOGE("%s: Fake camera device is not connected.", __FUNCTION__);
ALOGE("%s: Fake camera device is not connected.", __FUNCTION__);
return EINVAL;
}
if (isStarted()) {
LOGE("%s: Fake camera device is already started.", __FUNCTION__);
ALOGE("%s: Fake camera device is already started.", __FUNCTION__);
return EINVAL;
}
@@ -154,7 +154,7 @@ status_t EmulatedFakeCameraDevice::startDevice(int width,
break;
default:
LOGE("%s: Unknown pixel format %.4s", __FUNCTION__,
ALOGE("%s: Unknown pixel format %.4s", __FUNCTION__,
reinterpret_cast<const char*>(&mPixelFormat));
return EINVAL;
}
@@ -162,7 +162,7 @@ status_t EmulatedFakeCameraDevice::startDevice(int width,
mUVInRow = (width / 2) * mUVStep;
mState = ECDS_STARTED;
} else {
LOGE("%s: commonStartDevice failed", __FUNCTION__);
ALOGE("%s: commonStartDevice failed", __FUNCTION__);
}
return res;

View File

@@ -94,7 +94,7 @@ status_t EmulatedQemuCamera::Initialize(const char* device_name,
/* Width and height are separated with 'x' */
char* sep = strchr(first_dim, 'x');
if (sep == NULL) {
LOGE("%s: Invalid first dimension format in %s",
ALOGE("%s: Invalid first dimension format in %s",
__FUNCTION__, frame_dims);
return EINVAL;
}

View File

@@ -78,7 +78,7 @@ status_t EmulatedQemuCameraDevice::connectDevice()
Mutex::Autolock locker(&mObjectLock);
if (!isInitialized()) {
LOGE("%s: Qemu camera device is not initialized.", __FUNCTION__);
ALOGE("%s: Qemu camera device is not initialized.", __FUNCTION__);
return EINVAL;
}
if (isConnected()) {
@@ -94,7 +94,7 @@ status_t EmulatedQemuCameraDevice::connectDevice()
__FUNCTION__, (const char*)mDeviceName);
mState = ECDS_CONNECTED;
} else {
LOGE("%s: Connection to device '%s' failed",
ALOGE("%s: Connection to device '%s' failed",
__FUNCTION__, (const char*)mDeviceName);
}
@@ -112,7 +112,7 @@ status_t EmulatedQemuCameraDevice::disconnectDevice()
return NO_ERROR;
}
if (isStarted()) {
LOGE("%s: Cannot disconnect from the started device '%s.",
ALOGE("%s: Cannot disconnect from the started device '%s.",
__FUNCTION__, (const char*)mDeviceName);
return EINVAL;
}
@@ -124,7 +124,7 @@ status_t EmulatedQemuCameraDevice::disconnectDevice()
__FUNCTION__, (const char*)mDeviceName);
mState = ECDS_INITIALIZED;
} else {
LOGE("%s: Disconnection from device '%s' failed",
ALOGE("%s: Disconnection from device '%s' failed",
__FUNCTION__, (const char*)mDeviceName);
}
@@ -139,7 +139,7 @@ status_t EmulatedQemuCameraDevice::startDevice(int width,
Mutex::Autolock locker(&mObjectLock);
if (!isConnected()) {
LOGE("%s: Qemu camera device '%s' is not connected.",
ALOGE("%s: Qemu camera device '%s' is not connected.",
__FUNCTION__, (const char*)mDeviceName);
return EINVAL;
}
@@ -151,7 +151,7 @@ status_t EmulatedQemuCameraDevice::startDevice(int width,
status_t res = EmulatedCameraDevice::commonStartDevice(width, height, pix_fmt);
if (res != NO_ERROR) {
LOGE("%s: commonStartDevice failed", __FUNCTION__);
ALOGE("%s: commonStartDevice failed", __FUNCTION__);
return res;
}
@@ -160,7 +160,7 @@ status_t EmulatedQemuCameraDevice::startDevice(int width,
* RGB32 only.*/
mPreviewFrame = new uint32_t[mTotalPixels];
if (mPreviewFrame == NULL) {
LOGE("%s: Unable to allocate %d bytes for preview frame",
ALOGE("%s: Unable to allocate %d bytes for preview frame",
__FUNCTION__, mTotalPixels);
return ENOMEM;
}
@@ -174,7 +174,7 @@ status_t EmulatedQemuCameraDevice::startDevice(int width,
mFrameWidth, mFrameHeight);
mState = ECDS_STARTED;
} else {
LOGE("%s: Unable to start device '%s' for %.4s[%dx%d] frames",
ALOGE("%s: Unable to start device '%s' for %.4s[%dx%d] frames",
__FUNCTION__, (const char*)mDeviceName,
reinterpret_cast<const char*>(&pix_fmt), width, height);
}
@@ -205,7 +205,7 @@ status_t EmulatedQemuCameraDevice::stopDevice()
ALOGV("%s: Qemu camera device '%s' is stopped",
__FUNCTION__, (const char*)mDeviceName);
} else {
LOGE("%s: Unable to stop device '%s'",
ALOGE("%s: Unable to stop device '%s'",
__FUNCTION__, (const char*)mDeviceName);
}
@@ -255,7 +255,7 @@ bool EmulatedQemuCameraDevice::inWorkerThread()
mCameraHAL->onNextFrameAvailable(mCurrentFrame, mCurFrameTimestamp, this);
return true;
} else {
LOGE("%s: Unable to get current video frame: %s",
ALOGE("%s: Unable to get current video frame: %s",
__FUNCTION__, strerror(query_res));
mCameraHAL->onCameraDeviceError(CAMERA_ERROR_SERVER_DIED);
return false;

View File

@@ -56,7 +56,7 @@ status_t NV21JpegCompressor::compressRawImage(const void* image,
__FUNCTION__, (width * height * 12) / 8, width, height, mStream.getOffset());
return NO_ERROR;
} else {
LOGE("%s: JPEG compression failed", __FUNCTION__);
ALOGE("%s: JPEG compression failed", __FUNCTION__);
return errno ? errno : EINVAL;
}
}

View File

@@ -70,7 +70,7 @@ status_t PreviewWindow::setPreviewWindow(struct preview_stream_ops* window,
} else {
window = NULL;
res = -res; // set_usage returns a negative errno.
LOGE("%s: Error setting preview window usage %d -> %s",
ALOGE("%s: Error setting preview window usage %d -> %s",
__FUNCTION__, res, strerror(res));
}
}
@@ -125,7 +125,7 @@ void PreviewWindow::onNextFrameAvailable(const void* frame,
mPreviewFrameHeight,
HAL_PIXEL_FORMAT_RGBA_8888);
if (res != NO_ERROR) {
LOGE("%s: Error in set_buffers_geometry %d -> %s",
ALOGE("%s: Error in set_buffers_geometry %d -> %s",
__FUNCTION__, -res, strerror(-res));
return;
}
@@ -140,7 +140,7 @@ void PreviewWindow::onNextFrameAvailable(const void* frame,
int stride = 0;
res = mPreviewWindow->dequeue_buffer(mPreviewWindow, &buffer, &stride);
if (res != NO_ERROR || buffer == NULL) {
LOGE("%s: Unable to dequeue preview window buffer: %d -> %s",
ALOGE("%s: Unable to dequeue preview window buffer: %d -> %s",
__FUNCTION__, -res, strerror(-res));
return;
}
@@ -148,7 +148,7 @@ void PreviewWindow::onNextFrameAvailable(const void* frame,
/* Let the preview window to lock the buffer. */
res = mPreviewWindow->lock_buffer(mPreviewWindow, buffer);
if (res != NO_ERROR) {
LOGE("%s: Unable to lock preview window buffer: %d -> %s",
ALOGE("%s: Unable to lock preview window buffer: %d -> %s",
__FUNCTION__, -res, strerror(-res));
mPreviewWindow->cancel_buffer(mPreviewWindow, buffer);
return;
@@ -161,7 +161,7 @@ void PreviewWindow::onNextFrameAvailable(const void* frame,
GraphicBufferMapper& grbuffer_mapper(GraphicBufferMapper::get());
res = grbuffer_mapper.lock(*buffer, GRALLOC_USAGE_SW_WRITE_OFTEN, rect, &img);
if (res != NO_ERROR) {
LOGE("%s: grbuffer_mapper.lock failure: %d -> %s",
ALOGE("%s: grbuffer_mapper.lock failure: %d -> %s",
__FUNCTION__, res, strerror(res));
mPreviewWindow->cancel_buffer(mPreviewWindow, buffer);
return;
@@ -174,7 +174,7 @@ void PreviewWindow::onNextFrameAvailable(const void* frame,
/* Show it. */
mPreviewWindow->enqueue_buffer(mPreviewWindow, buffer);
} else {
LOGE("%s: Unable to obtain preview frame: %d", __FUNCTION__, res);
ALOGE("%s: Unable to obtain preview frame: %d", __FUNCTION__, res);
mPreviewWindow->cancel_buffer(mPreviewWindow, buffer);
}
grbuffer_mapper.unlock(*buffer);

View File

@@ -86,7 +86,7 @@ status_t QemuQuery::createQuery(const char* name, const char* param)
/* Query name cannot be NULL or an empty string. */
if (name == NULL || *name == '\0') {
LOGE("%s: NULL or an empty string is passed as query name.",
ALOGE("%s: NULL or an empty string is passed as query name.",
__FUNCTION__);
mQueryDeliveryStatus = EINVAL;
return EINVAL;
@@ -100,7 +100,7 @@ status_t QemuQuery::createQuery(const char* name, const char* param)
/* Preallocated buffer was too small. Allocate a bigger query buffer. */
mQuery = new char[required];
if (mQuery == NULL) {
LOGE("%s: Unable to allocate %d bytes for query buffer",
ALOGE("%s: Unable to allocate %d bytes for query buffer",
__FUNCTION__, required);
mQueryDeliveryStatus = ENOMEM;
return ENOMEM;
@@ -131,7 +131,7 @@ status_t QemuQuery::completeQuery(status_t status)
* with a ':'. If there is no more data in the reply, the prefix will be
* zero-terminated, and the terminator will be inculded in the reply. */
if (mReplyBuffer == NULL || mReplySize < 3) {
LOGE("%s: Invalid reply to the query", __FUNCTION__);
ALOGE("%s: Invalid reply to the query", __FUNCTION__);
mQueryDeliveryStatus = EINVAL;
return EINVAL;
}
@@ -142,7 +142,7 @@ status_t QemuQuery::completeQuery(status_t status)
} else if (!memcmp(mReplyBuffer, "ko", 2)) {
mReplyStatus = 0;
} else {
LOGE("%s: Invalid query reply: '%s'", __FUNCTION__, mReplyBuffer);
ALOGE("%s: Invalid query reply: '%s'", __FUNCTION__, mReplyBuffer);
mQueryDeliveryStatus = EINVAL;
return EINVAL;
}
@@ -152,7 +152,7 @@ status_t QemuQuery::completeQuery(status_t status)
/* There are extra data. Make sure they are separated from the status
* with a ':' */
if (mReplyBuffer[2] != ':') {
LOGE("%s: Invalid query reply: '%s'", __FUNCTION__, mReplyBuffer);
ALOGE("%s: Invalid query reply: '%s'", __FUNCTION__, mReplyBuffer);
mQueryDeliveryStatus = EINVAL;
return EINVAL;
}
@@ -162,7 +162,7 @@ status_t QemuQuery::completeQuery(status_t status)
/* Make sure reply buffer containing just 'ok'/'ko' ends with
* zero-terminator. */
if (mReplyBuffer[2] != '\0') {
LOGE("%s: Invalid query reply: '%s'", __FUNCTION__, mReplyBuffer);
ALOGE("%s: Invalid query reply: '%s'", __FUNCTION__, mReplyBuffer);
mQueryDeliveryStatus = EINVAL;
return EINVAL;
}
@@ -216,7 +216,7 @@ status_t QemuClient::connectClient(const char* param)
/* Make sure that client is not connected already. */
if (mPipeFD >= 0) {
LOGE("%s: Qemu client is already connected", __FUNCTION__);
ALOGE("%s: Qemu client is already connected", __FUNCTION__);
return EINVAL;
}
@@ -237,7 +237,7 @@ status_t QemuClient::connectClient(const char* param)
delete[] connection_str;
}
if (mPipeFD < 0) {
LOGE("%s: Unable to connect to the camera service '%s': %s",
ALOGE("%s: Unable to connect to the camera service '%s': %s",
__FUNCTION__, param ? param : "Factory", strerror(errno));
return errno ? errno : EINVAL;
}
@@ -258,7 +258,7 @@ void QemuClient::disconnectClient()
status_t QemuClient::sendMessage(const void* data, size_t data_size)
{
if (mPipeFD < 0) {
LOGE("%s: Qemu client is not connected", __FUNCTION__);
ALOGE("%s: Qemu client is not connected", __FUNCTION__);
return EINVAL;
}
@@ -270,7 +270,7 @@ status_t QemuClient::sendMessage(const void* data, size_t data_size)
if (written == data_size) {
return NO_ERROR;
} else {
LOGE("%s: Error sending data via qemu pipe: '%s'",
ALOGE("%s: Error sending data via qemu pipe: '%s'",
__FUNCTION__, strerror(errno));
return errno ? errno : EIO;
}
@@ -282,7 +282,7 @@ status_t QemuClient::receiveMessage(void** data, size_t* data_size)
*data_size = 0;
if (mPipeFD < 0) {
LOGE("%s: Qemu client is not connected", __FUNCTION__);
ALOGE("%s: Qemu client is not connected", __FUNCTION__);
return EINVAL;
}
@@ -294,7 +294,7 @@ status_t QemuClient::receiveMessage(void** data, size_t* data_size)
char payload_size_str[9];
int rd_res = qemud_fd_read(mPipeFD, payload_size_str, 8);
if (rd_res != 8) {
LOGE("%s: Unable to obtain payload size: %s",
ALOGE("%s: Unable to obtain payload size: %s",
__FUNCTION__, strerror(errno));
return errno ? errno : EIO;
}
@@ -304,14 +304,14 @@ status_t QemuClient::receiveMessage(void** data, size_t* data_size)
payload_size_str[8] = '\0';
payload_size = strtol(payload_size_str, NULL, 16);
if (errno) {
LOGE("%s: Invalid payload size '%s'", __FUNCTION__, payload_size_str);
ALOGE("%s: Invalid payload size '%s'", __FUNCTION__, payload_size_str);
return EIO;
}
/* Allocate payload data buffer, and read the payload there. */
*data = malloc(payload_size);
if (*data == NULL) {
LOGE("%s: Unable to allocate %d bytes payload buffer",
ALOGE("%s: Unable to allocate %d bytes payload buffer",
__FUNCTION__, payload_size);
return ENOMEM;
}
@@ -320,7 +320,7 @@ status_t QemuClient::receiveMessage(void** data, size_t* data_size)
*data_size = payload_size;
return NO_ERROR;
} else {
LOGE("%s: Read size %d doesnt match expected payload size %d: %s",
ALOGE("%s: Read size %d doesnt match expected payload size %d: %s",
__FUNCTION__, rd_res, payload_size, strerror(errno));
free(*data);
*data = NULL;
@@ -332,7 +332,7 @@ status_t QemuClient::doQuery(QemuQuery* query)
{
/* Make sure that query has been successfuly constructed. */
if (query->mQueryDeliveryStatus != NO_ERROR) {
LOGE("%s: Query is invalid", __FUNCTION__);
ALOGE("%s: Query is invalid", __FUNCTION__);
return query->mQueryDeliveryStatus;
}
@@ -348,17 +348,17 @@ status_t QemuClient::doQuery(QemuQuery* query)
LOGQ("Response to query '%s': Status = '%.2s', %d bytes in response",
query->mQuery, query->mReplyBuffer, query->mReplySize);
} else {
LOGE("%s Response to query '%s' has failed: %s",
ALOGE("%s Response to query '%s' has failed: %s",
__FUNCTION__, query->mQuery, strerror(res));
}
} else {
LOGE("%s: Send query '%s' failed: %s",
ALOGE("%s: Send query '%s' failed: %s",
__FUNCTION__, query->mQuery, strerror(res));
}
/* Complete the query, and return its completion handling status. */
const status_t res1 = query->completeQuery(res);
LOGE_IF(res1 != NO_ERROR && res1 != res,
ALOGE_IF(res1 != NO_ERROR && res1 != res,
"%s: Error %d in query '%s' completion",
__FUNCTION__, res1, query->mQuery);
return res1;
@@ -390,14 +390,14 @@ status_t FactoryQemuClient::listCameras(char** list)
QemuQuery query(mQueryList);
if (doQuery(&query) || !query.isQuerySucceeded()) {
LOGE("%s: List cameras query failed: %s", __FUNCTION__,
ALOGE("%s: List cameras query failed: %s", __FUNCTION__,
query.mReplyData ? query.mReplyData : "No error message");
return query.getCompletionStatus();
}
/* Make sure there is a list returned. */
if (query.mReplyDataSize == 0) {
LOGE("%s: No camera list is returned.", __FUNCTION__);
ALOGE("%s: No camera list is returned.", __FUNCTION__);
return EINVAL;
}
@@ -408,7 +408,7 @@ status_t FactoryQemuClient::listCameras(char** list)
ALOGD("Emulated camera list: %s", *list);
return NO_ERROR;
} else {
LOGE("%s: Unable to allocate %d bytes",
ALOGE("%s: Unable to allocate %d bytes",
__FUNCTION__, query.mReplyDataSize);
return ENOMEM;
}
@@ -450,7 +450,7 @@ status_t CameraQemuClient::queryConnect()
QemuQuery query(mQueryConnect);
doQuery(&query);
const status_t res = query.getCompletionStatus();
LOGE_IF(res != NO_ERROR, "%s: Query failed: %s",
ALOGE_IF(res != NO_ERROR, "%s: Query failed: %s",
__FUNCTION__, query.mReplyData ? query.mReplyData :
"No error message");
return res;
@@ -463,7 +463,7 @@ status_t CameraQemuClient::queryDisconnect()
QemuQuery query(mQueryDisconnect);
doQuery(&query);
const status_t res = query.getCompletionStatus();
LOGE_IF(res != NO_ERROR, "%s: Query failed: %s",
ALOGE_IF(res != NO_ERROR, "%s: Query failed: %s",
__FUNCTION__, query.mReplyData ? query.mReplyData :
"No error message");
return res;
@@ -481,7 +481,7 @@ status_t CameraQemuClient::queryStart(uint32_t pixel_format,
QemuQuery query(query_str);
doQuery(&query);
const status_t res = query.getCompletionStatus();
LOGE_IF(res != NO_ERROR, "%s: Query failed: %s",
ALOGE_IF(res != NO_ERROR, "%s: Query failed: %s",
__FUNCTION__, query.mReplyData ? query.mReplyData :
"No error message");
return res;
@@ -494,7 +494,7 @@ status_t CameraQemuClient::queryStop()
QemuQuery query(mQueryStop);
doQuery(&query);
const status_t res = query.getCompletionStatus();
LOGE_IF(res != NO_ERROR, "%s: Query failed: %s",
ALOGE_IF(res != NO_ERROR, "%s: Query failed: %s",
__FUNCTION__, query.mReplyData ? query.mReplyData :
"No error message");
return res;
@@ -520,7 +520,7 @@ status_t CameraQemuClient::queryFrame(void* vframe,
doQuery(&query);
const status_t res = query.getCompletionStatus();
if( res != NO_ERROR) {
LOGE("%s: Query failed: %s",
ALOGE("%s: Query failed: %s",
__FUNCTION__, query.mReplyData ? query.mReplyData :
"No error message");
return res;
@@ -536,7 +536,7 @@ status_t CameraQemuClient::queryFrame(void* vframe,
memcpy(vframe, frame, vframe_size);
cur_offset += vframe_size;
} else {
LOGE("%s: Reply %d bytes is to small to contain %d bytes video frame",
ALOGE("%s: Reply %d bytes is to small to contain %d bytes video frame",
__FUNCTION__, query.mReplyDataSize - cur_offset, vframe_size);
return EINVAL;
}
@@ -547,7 +547,7 @@ status_t CameraQemuClient::queryFrame(void* vframe,
memcpy(pframe, frame + cur_offset, pframe_size);
cur_offset += pframe_size;
} else {
LOGE("%s: Reply %d bytes is to small to contain %d bytes preview frame",
ALOGE("%s: Reply %d bytes is to small to contain %d bytes preview frame",
__FUNCTION__, query.mReplyDataSize - cur_offset, pframe_size);
return EINVAL;
}

View File

@@ -686,13 +686,13 @@ gps_state_thread( void* arg )
nevents = epoll_wait( epoll_fd, events, 2, -1 );
if (nevents < 0) {
if (errno != EINTR)
LOGE("epoll_wait() unexpected error: %s", strerror(errno));
ALOGE("epoll_wait() unexpected error: %s", strerror(errno));
continue;
}
D("gps thread received %d events", nevents);
for (ne = 0; ne < nevents; ne++) {
if ((events[ne].events & (EPOLLERR|EPOLLHUP)) != 0) {
LOGE("EPOLLERR or EPOLLHUP after epoll_wait() !?");
ALOGE("EPOLLERR or EPOLLHUP after epoll_wait() !?");
return;
}
if ((events[ne].events & EPOLLIN) != 0) {
@@ -738,7 +738,7 @@ gps_state_thread( void* arg )
if (errno == EINTR)
continue;
if (errno != EWOULDBLOCK)
LOGE("error while reading from gps daemon socket: %s:", strerror(errno));
ALOGE("error while reading from gps daemon socket: %s:", strerror(errno));
break;
}
D("received %d bytes: %.*s", ret, ret, buff);
@@ -749,7 +749,7 @@ gps_state_thread( void* arg )
}
else
{
LOGE("epoll_wait() returned unkown fd %d ?", fd);
ALOGE("epoll_wait() returned unkown fd %d ?", fd);
}
}
}
@@ -775,14 +775,14 @@ gps_state_init( GpsState* state, GpsCallbacks* callbacks )
D("gps emulation will read from '%s' qemud channel", QEMU_CHANNEL_NAME );
if ( socketpair( AF_LOCAL, SOCK_STREAM, 0, state->control ) < 0 ) {
LOGE("could not create thread control socket pair: %s", strerror(errno));
ALOGE("could not create thread control socket pair: %s", strerror(errno));
goto Fail;
}
state->thread = callbacks->create_thread_cb( "gps_state_thread", gps_state_thread, state );
if ( !state->thread ) {
LOGE("could not create gps thread: %s", strerror(errno));
ALOGE("could not create gps thread: %s", strerror(errno));
goto Fail;
}

View File

@@ -49,7 +49,7 @@
# define D(...) do{}while(0)
#endif
#define E(...) LOGE(__VA_ARGS__)
#define E(...) ALOGE(__VA_ARGS__)
/* Get brightness(0~255) from state. */
static int

View File

@@ -44,7 +44,7 @@
#define D(...) ((void)0)
#endif
#define E(...) LOGE(__VA_ARGS__)
#define E(...) ALOGE(__VA_ARGS__)
#include <hardware/qemud.h>
@@ -281,7 +281,7 @@ pick_sensor(SensorPoll* data,
return i;
}
}
LOGE("No sensor to return!!! pendingSensors=%08x", data->pendingSensors);
ALOGE("No sensor to return!!! pendingSensors=%08x", data->pendingSensors);
// we may end-up in a busy loop, slow things down, just in case.
usleep(100000);
return -EINVAL;