Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 05786cac authored by Igor Murashkin's avatar Igor Murashkin Committed by Android (Google) Code Review
Browse files

Merge "Camera2: Compile with warnings, fix warnings"

parents b6cf07ba ddf3c502
Loading
Loading
Loading
Loading
+3 −0
Original line number Diff line number Diff line
@@ -40,6 +40,9 @@ LOCAL_C_INCLUDES += \
    system/media/camera/include \
    external/jpeg


LOCAL_CFLAGS += -Wall -Wextra

LOCAL_MODULE:= libcameraservice

include $(BUILD_SHARED_LIBRARY)
+7 −8
Original line number Diff line number Diff line
@@ -37,10 +37,6 @@ static int getCallingPid() {
    return IPCThreadState::self()->getCallingPid();
}

static int getCallingUid() {
    return IPCThreadState::self()->getCallingUid();
}

// Interface used by CameraService

Camera2Client::Camera2Client(const sp<CameraService>& cameraService,
@@ -370,7 +366,6 @@ status_t Camera2Client::dump(int fd, const Vector<String16>& args) {
void Camera2Client::disconnect() {
    ATRACE_CALL();
    Mutex::Autolock icl(mICameraLock);
    status_t res;

    // Allow both client and the media server to disconnect at all times
    int callingPid = getCallingPid();
@@ -575,7 +570,7 @@ void Camera2Client::setPreviewCallbackFlag(int flag) {
    ATRACE_CALL();
    ALOGV("%s: Camera %d: Flag 0x%x", __FUNCTION__, mCameraId, flag);
    Mutex::Autolock icl(mICameraLock);
    status_t res;

    if ( checkPid(__FUNCTION__) != OK) return;

    SharedParameters::Lock l(mParameters);
@@ -1062,7 +1057,7 @@ status_t Camera2Client::cancelAutoFocus() {
    return OK;
}

status_t Camera2Client::takePicture(int msgType) {
status_t Camera2Client::takePicture(int /*msgType*/) {
    ATRACE_CALL();
    Mutex::Autolock icl(mICameraLock);
    status_t res;
@@ -1244,7 +1239,7 @@ status_t Camera2Client::commandPlayRecordingSoundL() {
    return OK;
}

status_t Camera2Client::commandStartFaceDetectionL(int type) {
status_t Camera2Client::commandStartFaceDetectionL(int /*type*/) {
    ALOGV("%s: Camera %d: Starting face detection",
          __FUNCTION__, mCameraId);
    status_t res;
@@ -1331,6 +1326,8 @@ void Camera2Client::notifyError(int errorCode, int arg1, int arg2) {
}

void Camera2Client::notifyShutter(int frameNumber, nsecs_t timestamp) {
    (void)frameNumber;
    (void)timestamp;
    ALOGV("%s: Shutter notification for frame %d at time %lld", __FUNCTION__,
            frameNumber, timestamp);
}
@@ -1452,6 +1449,8 @@ void Camera2Client::notifyAutoExposure(uint8_t newState, int triggerId) {
}

void Camera2Client::notifyAutoWhitebalance(uint8_t newState, int triggerId) {
    (void)newState;
    (void)triggerId;
    ALOGV("%s: Auto-whitebalance state now %d, last trigger %d",
            __FUNCTION__, newState, triggerId);
}
+7 −7
Original line number Diff line number Diff line
@@ -765,7 +765,6 @@ status_t Camera2Device::MetadataQueue::setStreamSlot(
    ATRACE_CALL();
    ALOGV("%s: E", __FUNCTION__);
    Mutex::Autolock l(mMutex);
    status_t res;

    if (mStreamSlotCount > 0) {
        freeBuffers(mStreamSlot.begin(), mStreamSlot.end());
@@ -785,7 +784,7 @@ status_t Camera2Device::MetadataQueue::setStreamSlot(
}

status_t Camera2Device::MetadataQueue::dump(int fd,
        const Vector<String16>& args) {
        const Vector<String16>& /*args*/) {
    ATRACE_CALL();
    String8 result;
    status_t notLocked;
@@ -894,12 +893,13 @@ int Camera2Device::MetadataQueue::consumer_free(
{
    ATRACE_CALL();
    MetadataQueue *queue = getInstance(q);
    (void)queue;
    free_camera_metadata(old_buffer);
    return OK;
}

int Camera2Device::MetadataQueue::producer_dequeue(
        const camera2_frame_queue_dst_ops_t *q,
        const camera2_frame_queue_dst_ops_t * /*q*/,
        size_t entries, size_t bytes,
        camera_metadata_t **buffer)
{
@@ -912,7 +912,7 @@ int Camera2Device::MetadataQueue::producer_dequeue(
}

int Camera2Device::MetadataQueue::producer_cancel(
        const camera2_frame_queue_dst_ops_t *q,
        const camera2_frame_queue_dst_ops_t * /*q*/,
        camera_metadata_t *old_buffer)
{
    ATRACE_CALL();
@@ -1184,7 +1184,7 @@ status_t Camera2Device::StreamAdapter::setTransform(int transform) {
}

status_t Camera2Device::StreamAdapter::dump(int fd,
        const Vector<String16>& args) {
        const Vector<String16>& /*args*/) {
    ATRACE_CALL();
    String8 result = String8::format("      Stream %d: %d x %d, format 0x%x\n",
            mId, mWidth, mHeight, mFormat);
@@ -1423,7 +1423,7 @@ status_t Camera2Device::ReprocessStreamAdapter::pushIntoStream(
}

status_t Camera2Device::ReprocessStreamAdapter::dump(int fd,
        const Vector<String16>& args) {
        const Vector<String16>& /*args*/) {
    ATRACE_CALL();
    String8 result =
            String8::format("      Reprocess stream %d: %d x %d, fmt 0x%x\n",
@@ -1444,7 +1444,7 @@ int Camera2Device::ReprocessStreamAdapter::acquire_buffer(
    const camera2_stream_in_ops_t *w,
        buffer_handle_t** buffer) {
    ATRACE_CALL();
    int res;

    ReprocessStreamAdapter* stream =
            const_cast<ReprocessStreamAdapter*>(
                static_cast<const ReprocessStreamAdapter*>(w));
+0 −4
Original line number Diff line number Diff line
@@ -34,10 +34,6 @@ static int getCallingPid() {
    return IPCThreadState::self()->getCallingPid();
}

static int getCallingUid() {
    return IPCThreadState::self()->getCallingUid();
}

CameraClient::CameraClient(const sp<CameraService>& cameraService,
        const sp<ICameraClient>& cameraClient,
        int cameraId, int cameraFacing, int clientPid, int servicePid):
+3 −2
Original line number Diff line number Diff line
@@ -427,7 +427,7 @@ public:
    /**
     * Dump state of the camera hardware
     */
    status_t dump(int fd, const Vector<String16>& args) const
    status_t dump(int fd, const Vector<String16>& /*args*/) const
    {
        ALOGV("%s(%s)", __FUNCTION__, mName.string());
        if (mDevice->ops->dump)
@@ -584,9 +584,10 @@ private:
#endif

    static int __lock_buffer(struct preview_stream_ops* w,
                      buffer_handle_t* buffer)
                      buffer_handle_t* /*buffer*/)
    {
        ANativeWindow *a = anw(w);
        (void)a;
        return 0;
    }

Loading