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

Commit 7e548ec4 authored by Sungtak Lee's avatar Sungtak Lee Committed by Gerrit Code Review
Browse files

Merge changes from topic "c2inputsurface-1-2nd" into main

* changes:
  Reapply "InputSurface: update InputSurfaceSource"
  Reapply "InputSurface: InputSurfaceSource from bqhelper"
parents b223c2c0 bd5cecef
Loading
Loading
Loading
Loading
+3 −0
Original line number Diff line number Diff line
@@ -161,8 +161,10 @@ cc_library {
        "Configurable.cpp",
        "InputBufferManager.cpp",
        "ParamTypes.cpp",
        "inputsurface/FrameDropper.cpp",
        "inputsurface/InputSurface.cpp",
        "inputsurface/InputSurfaceConnection.cpp",
        "inputsurface/InputSurfaceSource.cpp",
    ],

    header_libs: [
@@ -186,6 +188,7 @@ cc_library {
        "libmediandk",
        "libstagefright_aidl_bufferpool2",
        "libstagefright_bufferpool@2.0.1",
        "libstagefright_foundation",
        "libui",
        "libutils",
    ],
+57 −0
Original line number Diff line number Diff line
/*
 * Copyright (C) 2024 The Android Open Source Project
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *      http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

#pragma once

#include <utils/Errors.h>

#include <media/stagefright/foundation/ABase.h>

#include <C2.h>

namespace aidl::android::hardware::media::c2::implementation {

/**
 * The class decides whether to drop a frame or not for InputSurface and
 * InputSurfaceConnection.
 */
struct FrameDropper {
    FrameDropper();

    ~FrameDropper();

    /**
     * Sets max frame rate, which is based on for deciding frame drop.
     *
     * @param[in] maxFrameRate  negative value means there is no drop
     *                          zero value is ignored
     */
    void setMaxFrameRate(float maxFrameRate);

    /** Returns false if max frame rate has not been set via setMaxFrameRate. */
    bool shouldDrop(int64_t timeUs);

    /** Returns true if all frame drop logic should be disabled. */
    bool disabled() { return (mMinIntervalUs == -1ll); }

private:
    int64_t mDesiredMinTimeUs;
    int64_t mMinIntervalUs;

    DISALLOW_EVIL_CONSTRUCTORS(FrameDropper);
};

}  // namespace aidl::android::hardware::media::c2::implementation
+529 −0

File added.

Preview size limit exceeded, changes collapsed.

+77 −0

File added.

Preview size limit exceeded, changes collapsed.

+1572 −0

File added.

Preview size limit exceeded, changes collapsed.