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

Commit da0d8062 authored by Brian Lindahl's avatar Brian Lindahl Committed by Automerger Merge Worker
Browse files

Merge "Hide accurate onFrameRendered calls behind render metrics feature flag"...

Merge "Hide accurate onFrameRendered calls behind render metrics feature flag" into udc-qpr-dev am: aa7bf65e am: 0ce3098d

Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/av/+/24394290



Change-Id: Ic96fbf93566d35f78edb23448e473f8a58fcab30
Signed-off-by: default avatarAutomerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
parents 376e8e85 0ce3098d
Loading
Loading
Loading
Loading
+12 −1
Original line number Diff line number Diff line
@@ -65,11 +65,14 @@
#include "include/SharedMemoryBuffer.h"
#include <media/stagefright/omx/OMXUtils.h>

#include <server_configurable_flags/get_flags.h>

namespace android {

typedef hardware::media::omx::V1_0::IGraphicBufferSource HGraphicBufferSource;

using hardware::media::omx::V1_0::Status;
using server_configurable_flags::GetServerConfigurableFlag;

enum {
    kMaxIndicesToCheck = 32, // used when enumerating supported formats and profiles
@@ -82,6 +85,11 @@ constexpr char TUNNEL_PEEK_SET_LEGACY_KEY[] = "android._tunnel-peek-set-legacy";

}

static bool areRenderMetricsEnabled() {
    std::string v = GetServerConfigurableFlag("media_native", "render_metrics_enabled", "false");
    return v == "true";
}

// OMX errors are directly mapped into status_t range if
// there is no corresponding MediaError status code.
// Use the statusFromOMXError(int32_t omxError) function.
@@ -564,6 +572,9 @@ void ACodec::BufferInfo::checkReadFence(const char *dbg) {
ACodec::ACodec()
    : mSampleRate(0),
      mNodeGeneration(0),
      mAreRenderMetricsEnabled(areRenderMetricsEnabled()),
      mIsWindowToDisplay(false),
      mHasPresentFenceTimes(false),
      mUsingNativeWindow(false),
      mNativeWindowUsageBits(0),
      mLastNativeWindowDataSpace(HAL_DATASPACE_UNKNOWN),
@@ -6863,7 +6874,7 @@ void ACodec::BaseState::onOutputBufferDrained(const sp<AMessage> &msg) {

        int64_t mediaTimeUs = -1;
        buffer->meta()->findInt64("timeUs", &mediaTimeUs);
        if (mCodec->mIsWindowToDisplay) {
        if (mCodec->mAreRenderMetricsEnabled && mCodec->mIsWindowToDisplay) {
            mCodec->trackReleasedFrame(frameId, mediaTimeUs, timestampNs);
            mCodec->pollForRenderedFrames();
        } else {
+5 −3
Original line number Diff line number Diff line
@@ -258,10 +258,13 @@ private:
    int32_t mNodeGeneration;
    sp<TAllocator> mAllocator[2];

    bool mUsingNativeWindow;
    sp<ANativeWindow> mNativeWindow;
    std::deque<TrackedFrame> mTrackedFrames; // render information for buffers sent to a window
    bool mAreRenderMetricsEnabled;
    bool mIsWindowToDisplay;
    bool mHasPresentFenceTimes;

    bool mUsingNativeWindow;
    sp<ANativeWindow> mNativeWindow;
    int mNativeWindowUsageBits;
    android_native_rect_t mLastNativeWindowCrop;
    int32_t mLastNativeWindowDataSpace;
@@ -276,7 +279,6 @@ private:
    // format updates. This will equal to mOutputFormat until the first actual frame is received.
    sp<AMessage> mBaseOutputFormat;

    std::deque<TrackedFrame> mTrackedFrames; // render information for buffers sent to a window
    std::vector<BufferInfo> mBuffers[2];
    bool mPortEOS[2];
    status_t mInputEOSResult;