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

Commit 75c7f5cf authored by Android Build Coastguard Worker's avatar Android Build Coastguard Worker
Browse files

Snap for 13410570 from ac4517fe to 25Q3-release

Change-Id: If0f03db443af85630c18399300c99d829d612b13
parents 5f651d03 ac4517fe
Loading
Loading
Loading
Loading
+37 −14
Original line number Diff line number Diff line
@@ -98,21 +98,44 @@ public:
            return C2_CORRUPTED;
        }

#if COM_ANDROID_GRAPHICS_LIBGUI_FLAGS(WB_PLATFORM_API_IMPROVEMENTS)
        {
            native_window_set_usage(mSurface.get(), usage);
            native_window_set_buffers_format(mSurface.get(), format);
            native_window_set_buffers_dimensions(mSurface.get(), width, height);

        ::android::status_t res;
        std::vector<Surface::BatchBuffer> buffers(1);
        res = mSurface->dequeueBuffers(&buffers);
            sp<GraphicBuffer> gb;
            ::android::status_t res = mSurface->dequeueBuffer(&gb, fence);
            if (res != ::android::OK) {
            ALOGE("dequeueBuffers failed from PlaceHolderSurface %d", res);
                ALOGE("dequeueBuffer failed from PlaceHolderSurface %d", res);
                return C2_CORRUPTED;
            }
        sp<GraphicBuffer> gb = GraphicBuffer::from(buffers[0].buffer);
            (void)mSurface->detachBuffer(gb);
            *pBuf = AHardwareBuffer_from_GraphicBuffer(gb.get());
            AHardwareBuffer_acquire(*pBuf);
        *fence = new Fence(buffers[0].fenceFd);
        }
#else
        // NOTE: This should be obsolete from 25Q2.
        {
            sp<IGraphicBufferProducer> producer = mSurface->getIGraphicBufferProducer();
            int slot;
            ::android::status_t res = producer->dequeueBuffer(
                    &slot, fence, width, height, format, usage, nullptr, nullptr);
            if (res < 0) {
                ALOGE("Producer::dequeueBuffer failed from PlaceHolderSurface %d", res);
                return C2_CORRUPTED;
            }
            sp<GraphicBuffer> gb;
            res = producer->requestBuffer(slot, &gb);
            if (res != ::android::OK) {
                ALOGE("Producer::requestBuffer failed from PlaceHolderSurface %d", res);
                return C2_CORRUPTED;
            }
            (void)producer->detachBuffer(slot);
            *pBuf = AHardwareBuffer_from_GraphicBuffer(gb.get());
            AHardwareBuffer_acquire(*pBuf);
        }
#endif
        return C2_OK;
    }

+12 −0
Original line number Diff line number Diff line
@@ -1937,6 +1937,12 @@ status_t StagefrightRecorder::setupCameraSource(
        }

#if WB_LIBCAMERASERVICE_WITH_DEPENDENCIES
        if (!mPreviewSurface) {
            // `Surface(...)` below does not support nullptr in its ctor
            ALOGE("mPreviewSurface is null. Forgot to call setPreviewSurface?");
            return INVALID_OPERATION;
        }

        sp<Surface> surface = new Surface(mPreviewSurface);
        mCameraSourceTimeLapse = CameraSourceTimeLapse::CreateFromCamera(
                mCamera, mCameraProxy, mCameraId, clientName, uid, pid,
@@ -1951,6 +1957,12 @@ status_t StagefrightRecorder::setupCameraSource(
        *cameraSource = mCameraSourceTimeLapse;
    } else {
#if WB_LIBCAMERASERVICE_WITH_DEPENDENCIES
        if (!mPreviewSurface) {
            // `Surface(...)` below does not support nullptr in its ctor
            ALOGE("mPreviewSurface is null. Forgot to call setPreviewSurface?");
            return INVALID_OPERATION;
        }

        sp<Surface> surface = new Surface(mPreviewSurface);
        *cameraSource = CameraSource::CreateFromCamera(
                mCamera, mCameraProxy, mCameraId, clientName, uid, pid,
+8 −0
Original line number Diff line number Diff line
@@ -28,6 +28,14 @@ cc_defaults {
        "media_plugin_headers",
    ],

    static_libs: [
        "libguiflags",
    ],

    export_static_lib_headers: [
        "libguiflags",
    ],

    shared_libs: [
        "libbase",
        "libcutils",
Loading