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

Commit 42f407a0 authored by Android Build Coastguard Worker's avatar Android Build Coastguard Worker
Browse files

Snap for 8326520 from dbec2765 to tm-release

Change-Id: Id14811513adf3bd82fcf689ca872cab377c25852
parents 27f1aafb dbec2765
Loading
Loading
Loading
Loading
+2 −2
Original line number Diff line number Diff line
@@ -123,7 +123,7 @@ class C2SoftHevcEnc::IntfImpl : public SimpleInterface<void>::BaseParams {
        // matches size limits in codec library
        addParameter(
            DefineParam(mSize, C2_PARAMKEY_PICTURE_SIZE)
                .withDefault(new C2StreamPictureSizeInfo::input(0u, 320, 240))
                .withDefault(new C2StreamPictureSizeInfo::input(0u, 64, 64))
                .withFields({
                    C2F(mSize, width).inRange(2, 1920, 2),
                    C2F(mSize, height).inRange(2, 1088, 2),
@@ -133,7 +133,7 @@ class C2SoftHevcEnc::IntfImpl : public SimpleInterface<void>::BaseParams {

        addParameter(
            DefineParam(mFrameRate, C2_PARAMKEY_FRAME_RATE)
                .withDefault(new C2StreamFrameRateInfo::output(0u, 30.))
                .withDefault(new C2StreamFrameRateInfo::output(0u, 1.))
                .withFields({C2F(mFrameRate, value).greaterThan(0.)})
                .withSetter(
                    Setter<decltype(*mFrameRate)>::StrictValueWithNoDeps)
+4 −2
Original line number Diff line number Diff line
@@ -143,8 +143,9 @@ cc_library_shared {
        ":audio_core_hal_client_sources",
        ":audio_effect_hal_client_sources",
    ],
    shared_libs: [
    static_libs: [
        "android.hardware.audio.common@7.0",
        "android.hardware.audio.common@7.0-enums",
        "android.hardware.audio.common@7.0-util",
        "android.hardware.audio.effect@7.0",
        "android.hardware.audio.effect@7.0-util",
@@ -164,8 +165,9 @@ cc_library_shared {
    srcs: [
        ":audio_core_hal_client_sources",
    ],
    shared_libs: [
    static_libs: [
        "android.hardware.audio.common@7.0",
        "android.hardware.audio.common@7.1-enums",
        "android.hardware.audio.common@7.1-util",
        "android.hardware.audio@7.0",
        "android.hardware.audio@7.1",
+35 −0
Original line number Diff line number Diff line
@@ -117,6 +117,41 @@ protected:
    // Composite streams should behave accordingly.
    void enableErrorState();

    // Utility class to lock and unlock a GraphicBuffer
    class GraphicBufferLocker {
    public:
        GraphicBufferLocker(sp<GraphicBuffer> buffer) : _buffer(buffer) {}

        status_t lockAsync(void** dstBuffer, int fenceFd) {
            if (_buffer == nullptr) return BAD_VALUE;

            status_t res = OK;
            if (!_locked) {
                status_t res =  _buffer->lockAsync(GRALLOC_USAGE_SW_WRITE_OFTEN,
                        dstBuffer, fenceFd);
                if (res == OK) {
                    _locked = true;
                }
            }
            return res;
        }

        ~GraphicBufferLocker() {
            if (_locked && _buffer != nullptr) {
                auto res = _buffer->unlock();
                if (res != OK) {
                    ALOGE("%s: Error trying to unlock buffer: %s (%d)", __FUNCTION__,
                            strerror(-res), res);
                }
            }
        }

    private:
        sp<GraphicBuffer> _buffer;
        bool _locked = false;
    };


    wp<CameraDeviceBase>   mDevice;
    wp<camera3::StatusTracker> mStatusTracker;
    wp<hardware::camera2::ICameraDeviceCallbacks> mRemoteCallback;
+2 −1
Original line number Diff line number Diff line
@@ -297,7 +297,8 @@ status_t DepthCompositeStream::processInputFrame(nsecs_t ts, const InputFrame &i
    }

    sp<GraphicBuffer> gb = GraphicBuffer::from(anb);
    res = gb->lockAsync(GRALLOC_USAGE_SW_WRITE_OFTEN, &dstBuffer, fenceFd);
    GraphicBufferLocker gbLocker(gb);
    res = gbLocker.lockAsync(&dstBuffer, fenceFd);
    if (res != OK) {
        ALOGE("%s: Error trying to lock output buffer fence: %s (%d)", __FUNCTION__,
                strerror(-res), res);
+2 −1
Original line number Diff line number Diff line
@@ -1130,7 +1130,8 @@ status_t HeicCompositeStream::processCompletedInputFrame(int64_t frameNumber,
    // Copy the content of the file to memory.
    sp<GraphicBuffer> gb = GraphicBuffer::from(inputFrame.anb);
    void* dstBuffer;
    auto res = gb->lockAsync(GRALLOC_USAGE_SW_WRITE_OFTEN, &dstBuffer, inputFrame.fenceFd);
    GraphicBufferLocker gbLocker(gb);
    auto res = gbLocker.lockAsync(&dstBuffer, inputFrame.fenceFd);
    if (res != OK) {
        ALOGE("%s: Error trying to lock output buffer fence: %s (%d)", __FUNCTION__,
                strerror(-res), res);