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

Commit fbd89226 authored by Shalaj Jain's avatar Shalaj Jain
Browse files

stagefright: Fix startup latency profiling

Start first frame profiling before the 1st ETB. Also move the
setDataSource profiling to after reset.

Change-Id: I6ea6c3da838e5dda1f73ec1c0070c72492383227
parent 908070d0
Loading
Loading
Loading
Loading
+7 −2
Original line number Original line Diff line number Diff line
@@ -355,6 +355,10 @@ status_t AwesomePlayer::setDataSource_l(
        const KeyedVector<String8, String8> *headers) {
        const KeyedVector<String8, String8> *headers) {
    reset_l();
    reset_l();


    ExtendedStats::AutoProfile autoProfile(STATS_PROFILE_SET_DATA_SOURCE,
                                            mPlayerExtendedStats->getProfileTimes());
    PLAYER_STATS(profileStart, STATS_PROFILE_START_LATENCY);

    mHTTPService = httpService;
    mHTTPService = httpService;
    mUri = uri;
    mUri = uri;


@@ -394,11 +398,13 @@ status_t AwesomePlayer::setDataSource_l(
status_t AwesomePlayer::setDataSource(
status_t AwesomePlayer::setDataSource(
        int fd, int64_t offset, int64_t length) {
        int fd, int64_t offset, int64_t length) {
    Mutex::Autolock autoLock(mLock);
    Mutex::Autolock autoLock(mLock);

    reset_l();

    ExtendedStats::AutoProfile autoProfile(STATS_PROFILE_SET_DATA_SOURCE,
    ExtendedStats::AutoProfile autoProfile(STATS_PROFILE_SET_DATA_SOURCE,
                                            mPlayerExtendedStats->getProfileTimes());
                                            mPlayerExtendedStats->getProfileTimes());
    PLAYER_STATS(profileStart, STATS_PROFILE_START_LATENCY);
    PLAYER_STATS(profileStart, STATS_PROFILE_START_LATENCY);


    reset_l();
    if (fd) {
    if (fd) {
       printFileName(fd);
       printFileName(fd);
    }
    }
@@ -2015,7 +2021,6 @@ void AwesomePlayer::onVideoEvent() {
                    seekmode);
                    seekmode);
        }
        }
        for (;;) {
        for (;;) {
            PLAYER_STATS(profileStartOnce, STATS_PROFILE_FIRST_BUFFER(true) /* video */);
            status_t err = mVideoSource->read(&mVideoBuffer, &options);
            status_t err = mVideoSource->read(&mVideoBuffer, &options);
            options.clearSeekTo();
            options.clearSeekTo();


+1 −0
Original line number Original line Diff line number Diff line
@@ -3539,6 +3539,7 @@ bool OMXCodec::drainInputBuffer(BufferInfo *info) {
        info = findEmptyInputBuffer();
        info = findEmptyInputBuffer();
    }
    }


    PLAYER_STATS(profileStartOnce, STATS_PROFILE_FIRST_BUFFER(mIsVideo));
    CODEC_LOGV("Calling emptyBuffer on buffer %p (length %d), "
    CODEC_LOGV("Calling emptyBuffer on buffer %p (length %d), "
               "timestamp %lld us (%.2f secs)",
               "timestamp %lld us (%.2f secs)",
               info->mBuffer, offset,
               info->mBuffer, offset,