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

Commit f0d68993 authored by Lajos Molnar's avatar Lajos Molnar
Browse files

Revert "HLS: QCom enhancements"

This is to restore patch attributions

This reverts commit f580806d.

Bug: 18821145
Change-Id: Idc49385fffccfde2a3915388fe3fe4e2b740d787
parent c84bc78d
Loading
Loading
Loading
Loading
+2 −7
Original line number Diff line number Diff line
@@ -36,8 +36,7 @@ HTTPBase::HTTPBase()
      mTotalTransferBytes(0),
      mPrevBandwidthMeasureTimeUs(0),
      mPrevEstimatedBandWidthKbps(0),
      mBandWidthCollectFreqMs(5000),
      mMaxBandwidthHistoryItems(100) {
      mBandWidthCollectFreqMs(5000) {
}

void HTTPBase::addBandwidthMeasurement(
@@ -51,7 +50,7 @@ void HTTPBase::addBandwidthMeasurement(
    mTotalTransferBytes += numBytes;

    mBandwidthHistory.push_back(entry);
    if (++mNumBandwidthHistoryItems > mMaxBandwidthHistoryItems) {
    if (++mNumBandwidthHistoryItems > 100) {
        BandwidthEntry *entry = &*mBandwidthHistory.begin();
        mTotalTransferTimeUs -= entry->mDelayUs;
        mTotalTransferBytes -= entry->mNumBytes;
@@ -105,10 +104,6 @@ status_t HTTPBase::setBandwidthStatCollectFreq(int32_t freqMs) {
    return OK;
}

void HTTPBase::setBandwidthHistorySize(size_t numHistoryItems) {
    mMaxBandwidthHistoryItems = numHistoryItems;
}

// static
void HTTPBase::RegisterSocketUserTag(int sockfd, uid_t uid, uint32_t kTag) {
    int res = qtaguid_tagSocket(sockfd, kTag, uid);
+2 −30
Original line number Diff line number Diff line
@@ -49,9 +49,6 @@

namespace android {

// Number of recently-read bytes to use for bandwidth estimation
const size_t LiveSession::kBandwidthHistoryBytes = 200 * 1024;

LiveSession::LiveSession(
        const sp<AMessage> &notify, uint32_t flags,
        const sp<IMediaHTTPService> &httpService)
@@ -87,13 +84,6 @@ LiveSession::LiveSession(
        mPacketSources2.add(indexToType(i), new AnotherPacketSource(NULL /* meta */));
        mBuffering[i] = false;
    }

    size_t numHistoryItems = kBandwidthHistoryBytes /
            PlaylistFetcher::kDownloadBlockSize + 1;
    if (numHistoryItems < 5) {
        numHistoryItems = 5;
    }
    mHTTPDataSource->setBandwidthHistorySize(numHistoryItems);
}

LiveSession::~LiveSession() {
@@ -155,24 +145,10 @@ status_t LiveSession::dequeueAccessUnit(
        }
    }

    int32_t targetDuration = 0;
    sp<AMessage> meta = packetSource->getLatestEnqueuedMeta();
    if (meta != NULL) {
        meta->findInt32("targetDuration", &targetDuration);
    }

    int64_t targetDurationUs = targetDuration * 1000000ll;
    if (targetDurationUs == 0 ||
            targetDurationUs > PlaylistFetcher::kMinBufferedDurationUs) {
        // Fetchers limit buffering to
        // min(3 * targetDuration, kMinBufferedDurationUs)
        targetDurationUs = PlaylistFetcher::kMinBufferedDurationUs;
    }

    if (mBuffering[idx]) {
        if (mSwitchInProgress
                || packetSource->isFinished(0)
                || packetSource->getEstimatedDurationUs() > targetDurationUs) {
                || packetSource->getEstimatedDurationUs() > 10000000ll) {
            mBuffering[idx] = false;
        }
    }
@@ -883,11 +859,7 @@ ssize_t LiveSession::fetchFile(
        // Only resize when we don't know the size.
        size_t bufferRemaining = buffer->capacity() - buffer->size();
        if (bufferRemaining == 0 && getSizeErr != OK) {
            size_t bufferIncrement = buffer->size() / 2;
            if (bufferIncrement < 32768) {
                bufferIncrement = 32768;
            }
            bufferRemaining = bufferIncrement;
            bufferRemaining = 32768;

            ALOGV("increasing download buffer to %zu bytes",
                 buffer->size() + bufferRemaining);
+0 −2
Original line number Diff line number Diff line
@@ -114,8 +114,6 @@ private:
        kWhatSwitchDown                 = 'sDwn',
    };

    static const size_t kBandwidthHistoryBytes;

    struct BandwidthItem {
        size_t mPlaylistIndex;
        unsigned long mBandwidth;
+5 −16
Original line number Diff line number Diff line
@@ -49,9 +49,8 @@ namespace android {
// static
const int64_t PlaylistFetcher::kMinBufferedDurationUs = 10000000ll;
const int64_t PlaylistFetcher::kMaxMonitorDelayUs = 3000000ll;
// LCM of 188 (size of a TS packet) & 1k works well
const int32_t PlaylistFetcher::kDownloadBlockSize = 47 * 1024;
const int32_t PlaylistFetcher::kNumSkipFrames = 5;
const int32_t PlaylistFetcher::kDownloadBlockSize = 2048;
const int32_t PlaylistFetcher::kNumSkipFrames = 10;

PlaylistFetcher::PlaylistFetcher(
        const sp<AMessage> &notify,
@@ -562,7 +561,7 @@ status_t PlaylistFetcher::onResumeUntil(const sp<AMessage> &msg) {
        // Don't resume if we would stop within a resume threshold.
        int32_t discontinuitySeq;
        int64_t latestTimeUs = 0, stopTimeUs = 0;
        sp<AMessage> latestMeta = packetSource->getLatestEnqueuedMeta();
        sp<AMessage> latestMeta = packetSource->getLatestDequeuedMeta();
        if (latestMeta != NULL
                && latestMeta->findInt32("discontinuitySeq", &discontinuitySeq)
                && discontinuitySeq == mDiscontinuitySeq
@@ -611,12 +610,7 @@ void PlaylistFetcher::onMonitorQueue() {
    int32_t targetDurationSecs;
    int64_t targetDurationUs = kMinBufferedDurationUs;
    if (mPlaylist != NULL) {
        if (mPlaylist->meta() == NULL || !mPlaylist->meta()->findInt32(
                "target-duration", &targetDurationSecs)) {
            ALOGE("Playlist is missing required EXT-X-TARGETDURATION tag");
            notifyError(ERROR_MALFORMED);
            return;
        }
        CHECK(mPlaylist->meta()->findInt32("target-duration", &targetDurationSecs));
        targetDurationUs = targetDurationSecs * 1000000ll;
    }

@@ -1165,11 +1159,6 @@ const sp<ABuffer> &PlaylistFetcher::setAccessUnitProperties(
        accessUnit->meta()->setInt32("discard", discard);
    }

    int32_t targetDurationSecs;
    if (mPlaylist->meta()->findInt32("target-duration", &targetDurationSecs)) {
        accessUnit->meta()->setInt32("targetDuration", targetDurationSecs);
    }

    accessUnit->meta()->setInt32("discontinuitySeq", mDiscontinuitySeq);
    accessUnit->meta()->setInt64("segmentStartTimeUs", getSegmentStartTimeUs(mSeqNumber));
    return accessUnit;
@@ -1679,7 +1668,7 @@ void PlaylistFetcher::updateDuration() {

int64_t PlaylistFetcher::resumeThreshold(const sp<AMessage> &msg) {
    int64_t durationUs, threshold;
    if (msg->findInt64("durationUs", &durationUs) && durationUs > 0) {
    if (msg->findInt64("durationUs", &durationUs)) {
        return kNumSkipFrames * durationUs;
    }

+2 −3
Original line number Diff line number Diff line
@@ -34,9 +34,6 @@ struct M3UParser;
struct String8;

struct PlaylistFetcher : public AHandler {
    static const int64_t kMinBufferedDurationUs;
    static const int32_t kDownloadBlockSize;

    enum {
        kWhatStarted,
        kWhatPaused,
@@ -95,7 +92,9 @@ private:
        kWhatDownloadNext   = 'dlnx',
    };

    static const int64_t kMinBufferedDurationUs;
    static const int64_t kMaxMonitorDelayUs;
    static const int32_t kDownloadBlockSize;
    static const int32_t kNumSkipFrames;

    static bool bufferStartsWithTsSyncByte(const sp<ABuffer>& buffer);
Loading