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

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

Snap for 10132053 from 13e40cb2 to udc-release

Change-Id: I8a91546fa1977046e05e0815edc4571583bc6c37
parents 4e411c01 13e40cb2
Loading
Loading
Loading
Loading
+0 −47
Original line number Diff line number Diff line
@@ -2569,43 +2569,6 @@ status_t CCodec::configureTunneledVideoPlayback(
}

void CCodec::initiateReleaseIfStuck() {
    bool tunneled = false;
    bool isMediaTypeKnown = false;
    {
        static const std::set<std::string> kKnownMediaTypes{
            MIMETYPE_VIDEO_VP8,
            MIMETYPE_VIDEO_VP9,
            MIMETYPE_VIDEO_AV1,
            MIMETYPE_VIDEO_AVC,
            MIMETYPE_VIDEO_HEVC,
            MIMETYPE_VIDEO_MPEG4,
            MIMETYPE_VIDEO_H263,
            MIMETYPE_VIDEO_MPEG2,
            MIMETYPE_VIDEO_RAW,
            MIMETYPE_VIDEO_DOLBY_VISION,

            MIMETYPE_AUDIO_AMR_NB,
            MIMETYPE_AUDIO_AMR_WB,
            MIMETYPE_AUDIO_MPEG,
            MIMETYPE_AUDIO_AAC,
            MIMETYPE_AUDIO_QCELP,
            MIMETYPE_AUDIO_VORBIS,
            MIMETYPE_AUDIO_OPUS,
            MIMETYPE_AUDIO_G711_ALAW,
            MIMETYPE_AUDIO_G711_MLAW,
            MIMETYPE_AUDIO_RAW,
            MIMETYPE_AUDIO_FLAC,
            MIMETYPE_AUDIO_MSGSM,
            MIMETYPE_AUDIO_AC3,
            MIMETYPE_AUDIO_EAC3,

            MIMETYPE_IMAGE_ANDROID_HEIC,
        };
        Mutexed<std::unique_ptr<Config>>::Locked configLocked(mConfig);
        const std::unique_ptr<Config> &config = *configLocked;
        tunneled = config->mTunneled;
        isMediaTypeKnown = (kKnownMediaTypes.count(config->mCodingMediaType) != 0);
    }
    std::string name;
    bool pendingDeadline = false;
    {
@@ -2617,16 +2580,6 @@ void CCodec::initiateReleaseIfStuck() {
            pendingDeadline = true;
        }
    }
    if (!tunneled && isMediaTypeKnown && name.empty()) {
        constexpr std::chrono::steady_clock::duration kWorkDurationThreshold = 3s;
        std::chrono::steady_clock::duration elapsed = mChannel->elapsed();
        if (elapsed >= kWorkDurationThreshold) {
            name = "queue";
        }
        if (elapsed > 0s) {
            pendingDeadline = true;
        }
    }
    if (name.empty()) {
        // We're not stuck.
        if (pendingDeadline) {
+13 −0
Original line number Diff line number Diff line
@@ -86,6 +86,11 @@ void mediametrics_setRate(mediametrics_handle_t handle, attr_t attr,
    if (item != NULL) item->setRate(attr, count, duration);
}

void mediametrics_setString(mediametrics_handle_t handle, attr_t attr,
                                 const std::string &string) {
    mediametrics_setCString(handle, attr, string.c_str());
}

void mediametrics_setCString(mediametrics_handle_t handle, attr_t attr,
                                 const char *value) {
    Item *item = (Item *) handle;
@@ -152,6 +157,14 @@ bool mediametrics_getRate(mediametrics_handle_t handle, attr_t attr,
    return item->getRate(attr, count, duration, rate);
}

bool mediametrics_getString(mediametrics_handle_t handle, attr_t attr,
                                 std::string *string) {
    Item *item = (Item *) handle;
    if (item == NULL) return false;

    return item->getString(attr, string);
}

// NB: caller owns the string that comes back, is responsible for freeing it
bool mediametrics_getCString(mediametrics_handle_t handle, attr_t attr,
                                 char **value) {
+8 −1
Original line number Diff line number Diff line
@@ -95,4 +95,11 @@ bool mediametrics_getAttributes(mediametrics_handle_t handle, char **buffer, siz

__END_DECLS

#ifdef __cplusplus
#include <string>
void mediametrics_setString(mediametrics_handle_t handle, attr_t attr,
                            const std::string &value);
bool mediametrics_getString(mediametrics_handle_t handle, attr_t attr, std::string *value);
#endif // __cplusplus

#endif
+3 −3
Original line number Diff line number Diff line
@@ -1048,6 +1048,9 @@ public:
        }
        return true;
    }
    bool getString(const char *key, std::string *value) const {
        return get(key, value);
    }
    // Caller owns the returned string
    bool getCString(const char *key, char **value) const {
        std::string s;
@@ -1057,9 +1060,6 @@ public:
        }
        return false;
    }
    bool getString(const char *key, std::string *value) const {
        return get(key, value);
    }

    const Prop::Elem* get(const char *key) const {
        const Prop *prop = findProp(key);
+1 −0
Original line number Diff line number Diff line
@@ -270,6 +270,7 @@ cc_library {
        "SurfaceUtils.cpp",
        "ThrottledSource.cpp",
        "Utils.cpp",
        "VideoRenderQualityTracker.cpp",
        "VideoFrameSchedulerBase.cpp",
        "VideoFrameScheduler.cpp",
    ],
Loading