diff options
Diffstat (limited to 'media/libstagefright/CameraSource.cpp')
-rwxr-xr-x | media/libstagefright/CameraSource.cpp | 82 |
1 files changed, 41 insertions, 41 deletions
diff --git a/media/libstagefright/CameraSource.cpp b/media/libstagefright/CameraSource.cpp index 57989c5..1850c9c 100755 --- a/media/libstagefright/CameraSource.cpp +++ b/media/libstagefright/CameraSource.cpp @@ -63,12 +63,12 @@ CameraSourceListener::~CameraSourceListener() { } void CameraSourceListener::notify(int32_t msgType, int32_t ext1, int32_t ext2) { - LOGV("notify(%d, %d, %d)", msgType, ext1, ext2); + ALOGV("notify(%d, %d, %d)", msgType, ext1, ext2); } void CameraSourceListener::postData(int32_t msgType, const sp<IMemory> &dataPtr, camera_frame_metadata_t *metadata) { - LOGV("postData(%d, ptr:%p, size:%d)", + ALOGV("postData(%d, ptr:%p, size:%d)", msgType, dataPtr->pointer(), dataPtr->size()); sp<CameraSource> source = mSource.promote(); @@ -111,7 +111,7 @@ static int32_t getColorFormat(const char* colorFormat) { return OMX_TI_COLOR_FormatYUV420PackedSemiPlanar; } - LOGE("Uknown color format (%s), please add it to " + ALOGE("Uknown color format (%s), please add it to " "CameraSource::getColorFormat", colorFormat); CHECK_EQ(0, "Unknown color format"); @@ -217,7 +217,7 @@ static bool isVideoSizeSupported( int32_t width, int32_t height, const Vector<Size>& supportedSizes) { - LOGV("isVideoSizeSupported"); + ALOGV("isVideoSizeSupported"); for (size_t i = 0; i < supportedSizes.size(); ++i) { if (width == supportedSizes[i].width && height == supportedSizes[i].height) { @@ -254,7 +254,7 @@ static void getSupportedVideoSizes( *isSetVideoSizeSupported = true; params.getSupportedVideoSizes(sizes); if (sizes.size() == 0) { - LOGD("Camera does not support setVideoSize()"); + ALOGD("Camera does not support setVideoSize()"); params.getSupportedPreviewSizes(sizes); *isSetVideoSizeSupported = false; } @@ -294,14 +294,14 @@ status_t CameraSource::configureCamera( CameraParameters* params, int32_t width, int32_t height, int32_t frameRate) { - LOGV("configureCamera"); + ALOGV("configureCamera"); Vector<Size> sizes; bool isSetVideoSizeSupportedByCamera = true; getSupportedVideoSizes(*params, &isSetVideoSizeSupportedByCamera, sizes); bool isCameraParamChanged = false; if (width != -1 && height != -1) { if (!isVideoSizeSupported(width, height, sizes)) { - LOGE("Video dimension (%dx%d) is unsupported", width, height); + ALOGE("Video dimension (%dx%d) is unsupported", width, height); return BAD_VALUE; } if (isSetVideoSizeSupportedByCamera) { @@ -314,7 +314,7 @@ status_t CameraSource::configureCamera( (width != -1 && height == -1)) { // If one and only one of the width and height is -1 // we reject such a request. - LOGE("Requested video size (%dx%d) is not supported", width, height); + ALOGE("Requested video size (%dx%d) is not supported", width, height); return BAD_VALUE; } else { // width == -1 && height == -1 // Do not configure the camera. @@ -326,11 +326,11 @@ status_t CameraSource::configureCamera( const char* supportedFrameRates = params->get(CameraParameters::KEY_SUPPORTED_PREVIEW_FRAME_RATES); CHECK(supportedFrameRates != NULL); - LOGV("Supported frame rates: %s", supportedFrameRates); + ALOGV("Supported frame rates: %s", supportedFrameRates); char buf[4]; snprintf(buf, 4, "%d", frameRate); if (strstr(supportedFrameRates, buf) == NULL) { - LOGE("Requested frame rate (%d) is not supported: %s", + ALOGE("Requested frame rate (%d) is not supported: %s", frameRate, supportedFrameRates); return BAD_VALUE; } @@ -347,7 +347,7 @@ status_t CameraSource::configureCamera( // Either frame rate or frame size needs to be changed. String8 s = params->flatten(); if (OK != mCamera->setParameters(s)) { - LOGE("Could not change settings." + ALOGE("Could not change settings." " Someone else is using camera %p?", mCamera.get()); return -EBUSY; } @@ -370,7 +370,7 @@ status_t CameraSource::checkVideoSize( const CameraParameters& params, int32_t width, int32_t height) { - LOGV("checkVideoSize"); + ALOGV("checkVideoSize"); // The actual video size is the same as the preview size // if the camera hal does not support separate video and // preview output. In this case, we retrieve the video @@ -387,7 +387,7 @@ status_t CameraSource::checkVideoSize( params.getVideoSize(&frameWidthActual, &frameHeightActual); } if (frameWidthActual < 0 || frameHeightActual < 0) { - LOGE("Failed to retrieve video frame size (%dx%d)", + ALOGE("Failed to retrieve video frame size (%dx%d)", frameWidthActual, frameHeightActual); return UNKNOWN_ERROR; } @@ -396,7 +396,7 @@ status_t CameraSource::checkVideoSize( // video frame size. if (width != -1 && height != -1) { if (frameWidthActual != width || frameHeightActual != height) { - LOGE("Failed to set video frame size to %dx%d. " + ALOGE("Failed to set video frame size to %dx%d. " "The actual video size is %dx%d ", width, height, frameWidthActual, frameHeightActual); return UNKNOWN_ERROR; @@ -422,17 +422,17 @@ status_t CameraSource::checkFrameRate( const CameraParameters& params, int32_t frameRate) { - LOGV("checkFrameRate"); + ALOGV("checkFrameRate"); int32_t frameRateActual = params.getPreviewFrameRate(); if (frameRateActual < 0) { - LOGE("Failed to retrieve preview frame rate (%d)", frameRateActual); + ALOGE("Failed to retrieve preview frame rate (%d)", frameRateActual); return UNKNOWN_ERROR; } // Check the actual video frame rate against the target/requested // video frame rate. if (frameRate != -1 && (frameRateActual - frameRate) != 0) { - LOGE("Failed to set preview frame rate to %d fps. The actual " + ALOGE("Failed to set preview frame rate to %d fps. The actual " "frame rate is %d", frameRate, frameRateActual); return UNKNOWN_ERROR; } @@ -468,7 +468,7 @@ status_t CameraSource::init( int32_t frameRate, bool storeMetaDataInVideoBuffers) { - LOGV("init"); + ALOGV("init"); status_t err = OK; int64_t token = IPCThreadState::self()->clearCallingIdentity(); err = initWithCameraAccess(camera, proxy, cameraId, @@ -485,11 +485,11 @@ status_t CameraSource::initWithCameraAccess( Size videoSize, int32_t frameRate, bool storeMetaDataInVideoBuffers) { - LOGV("initWithCameraAccess"); + ALOGV("initWithCameraAccess"); status_t err = OK; if ((err = isCameraAvailable(camera, proxy, cameraId)) != OK) { - LOGE("Camera connection could not be established."); + ALOGE("Camera connection could not be established."); return err; } CameraParameters params(mCamera->getParameters()); @@ -558,7 +558,7 @@ CameraSource::~CameraSource() { } void CameraSource::startCameraRecording() { - LOGV("startCameraRecording"); + ALOGV("startCameraRecording"); // Reset the identity to the current thread because media server owns the // camera and recording is started by the applications. The applications // will connect to the camera in ICameraRecordingProxy::startRecording. @@ -576,10 +576,10 @@ void CameraSource::startCameraRecording() { } status_t CameraSource::start(MetaData *meta) { - LOGV("start"); + ALOGV("start"); CHECK(!mStarted); if (mInitCheck != OK) { - LOGE("CameraSource is not initialized yet"); + ALOGE("CameraSource is not initialized yet"); return mInitCheck; } @@ -602,7 +602,7 @@ status_t CameraSource::start(MetaData *meta) { } void CameraSource::stopCameraRecording() { - LOGV("stopCameraRecording"); + ALOGV("stopCameraRecording"); if (mCameraFlags & FLAGS_HOT_CAMERA) { mCameraRecordingProxy->stopRecording(); } else { @@ -612,11 +612,11 @@ void CameraSource::stopCameraRecording() { } void CameraSource::releaseCamera() { - LOGV("releaseCamera"); + ALOGV("releaseCamera"); if (mCamera != 0) { int64_t token = IPCThreadState::self()->clearCallingIdentity(); if ((mCameraFlags & FLAGS_HOT_CAMERA) == 0) { - LOGV("Camera was cold when we started, stopping preview"); + ALOGV("Camera was cold when we started, stopping preview"); mCamera->stopPreview(); mCamera->disconnect(); } @@ -633,7 +633,7 @@ void CameraSource::releaseCamera() { } status_t CameraSource::stop() { - LOGD("stop: E"); + ALOGD("stop: E"); Mutex::Autolock autoLock(mLock); mStarted = false; mFrameAvailableCondition.signal(); @@ -649,7 +649,7 @@ status_t CameraSource::stop() { if (NO_ERROR != mFrameCompleteCondition.waitRelative(mLock, mTimeBetweenFrameCaptureUs * 1000LL + CAMERA_SOURCE_TIMEOUT_NS)) { - LOGW("Timed out waiting for outstanding frames being encoded: %d", + ALOGW("Timed out waiting for outstanding frames being encoded: %d", mFramesBeingEncoded.size()); } } @@ -660,22 +660,22 @@ status_t CameraSource::stop() { } if (mCollectStats) { - LOGI("Frames received/encoded/dropped: %d/%d/%d in %lld us", + ALOGI("Frames received/encoded/dropped: %d/%d/%d in %lld us", mNumFramesReceived, mNumFramesEncoded, mNumFramesDropped, mLastFrameTimestampUs - mFirstFrameTimeUs); } if (mNumGlitches > 0) { - LOGW("%d long delays between neighboring video frames", mNumGlitches); + ALOGW("%d long delays between neighboring video frames", mNumGlitches); } CHECK_EQ(mNumFramesReceived, mNumFramesEncoded + mNumFramesDropped); - LOGD("stop: X"); + ALOGD("stop: X"); return OK; } void CameraSource::releaseRecordingFrame(const sp<IMemory>& frame) { - LOGV("releaseRecordingFrame"); + ALOGV("releaseRecordingFrame"); if (mCameraRecordingProxy != NULL) { mCameraRecordingProxy->releaseRecordingFrame(frame); } else if (mCamera != NULL) { @@ -704,7 +704,7 @@ void CameraSource::releaseOneRecordingFrame(const sp<IMemory>& frame) { } void CameraSource::signalBufferReturned(MediaBuffer *buffer) { - LOGV("signalBufferReturned: %p", buffer->data()); + ALOGV("signalBufferReturned: %p", buffer->data()); Mutex::Autolock autoLock(mLock); for (List<sp<IMemory> >::iterator it = mFramesBeingEncoded.begin(); it != mFramesBeingEncoded.end(); ++it) { @@ -723,7 +723,7 @@ void CameraSource::signalBufferReturned(MediaBuffer *buffer) { status_t CameraSource::read( MediaBuffer **buffer, const ReadOptions *options) { - LOGV("read"); + ALOGV("read"); *buffer = NULL; @@ -744,10 +744,10 @@ status_t CameraSource::read( mTimeBetweenFrameCaptureUs * 1000LL + CAMERA_SOURCE_TIMEOUT_NS)) { if (mCameraRecordingProxy != 0 && !mCameraRecordingProxy->asBinder()->isBinderAlive()) { - LOGW("camera recording proxy is gone"); + ALOGW("camera recording proxy is gone"); return ERROR_END_OF_STREAM; } - LOGW("Timed out waiting for incoming camera video frames: %lld us", + ALOGW("Timed out waiting for incoming camera video frames: %lld us", mLastFrameTimestampUs); } } @@ -770,10 +770,10 @@ status_t CameraSource::read( void CameraSource::dataCallbackTimestamp(int64_t timestampUs, int32_t msgType, const sp<IMemory> &data) { - LOGV("dataCallbackTimestamp: timestamp %lld us", timestampUs); + ALOGV("dataCallbackTimestamp: timestamp %lld us", timestampUs); Mutex::Autolock autoLock(mLock); if (!mStarted || (mNumFramesReceived == 0 && timestampUs < mStartTimeUs)) { - LOGV("Drop frame at %lld/%lld us", timestampUs, mStartTimeUs); + ALOGV("Drop frame at %lld/%lld us", timestampUs, mStartTimeUs); releaseOneRecordingFrame(data); return; } @@ -812,13 +812,13 @@ void CameraSource::dataCallbackTimestamp(int64_t timestampUs, mFramesReceived.push_back(data); int64_t timeUs = mStartTimeUs + (timestampUs - mFirstFrameTimeUs); mFrameTimes.push_back(timeUs); - LOGV("initial delay: %lld, current time stamp: %lld", + ALOGV("initial delay: %lld, current time stamp: %lld", mStartTimeUs, timeUs); mFrameAvailableCondition.signal(); } bool CameraSource::isMetaDataStoredInVideoBuffers() const { - LOGV("isMetaDataStoredInVideoBuffers"); + ALOGV("isMetaDataStoredInVideoBuffers"); return mIsMetaDataStoredInVideoBuffers; } @@ -832,7 +832,7 @@ void CameraSource::ProxyListener::dataCallbackTimestamp( } void CameraSource::DeathNotifier::binderDied(const wp<IBinder>& who) { - LOGI("Camera recording proxy died"); + ALOGI("Camera recording proxy died"); } } // namespace android |