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

Commit 3a555c19 authored by Andreas Huber's avatar Andreas Huber Committed by Android (Google) Code Review
Browse files

Merge "Increase polling frequency again temporarily to fix A/V issues" into jb-mr1-dev

parents ee40d832 8d16bbc5
Loading
Loading
Loading
Loading
+15 −14
Original line number Diff line number Diff line
@@ -242,17 +242,19 @@ void Converter::onMessageReceived(const sp<AMessage> &msg) {
#if ENABLE_SILENCE_DETECTION
                if (!mIsVideo) {
                    if (IsSilence(accessUnit)) {
                        if (!mInSilentMode) {
                        if (mInSilentMode) {
                            break;
                        }

                        int64_t nowUs = ALooper::GetNowUs();

                        if (mFirstSilentFrameUs < 0ll) {
                            mFirstSilentFrameUs = nowUs;
                            } else if (nowUs >= mFirstSilentFrameUs + 1000000ll) {
                        } else if (nowUs >= mFirstSilentFrameUs + 10000000ll) {
                            mInSilentMode = true;
                            ALOGI("audio in silent mode now.");
                            break;
                        }
                        }
                    } else {
                        if (mInSilentMode) {
                            ALOGI("audio no longer in silent mode.");
@@ -326,7 +328,7 @@ void Converter::scheduleDoMoreWork() {
    }

    mDoMoreWorkPending = true;
    (new AMessage(kWhatDoMoreWork, id()))->post(mIsVideo ? 10000ll : 5000ll);
    (new AMessage(kWhatDoMoreWork, id()))->post(1000ll);
}

status_t Converter::feedEncoderInputBuffers() {
@@ -404,9 +406,8 @@ status_t Converter::doMoreWork() {
            sp<ABuffer> buffer = new ABuffer(size);
            buffer->meta()->setInt64("timeUs", timeUs);

            if (!mIsVideo) {
                ALOGV("audio time %lld us (%.2f secs)", timeUs, timeUs / 1E6);
            }
            ALOGV("[%s] time %lld us (%.2f secs)",
                  mIsVideo ? "video" : "audio", timeUs, timeUs / 1E6);

            memcpy(buffer->data(),
                   mEncoderOutputBuffers.itemAt(bufferIndex)->base() + offset,
+9 −0
Original line number Diff line number Diff line
@@ -919,13 +919,22 @@ status_t WifiDisplaySource::PlaybackSession::addVideoSource() {

    source->setUseAbsoluteTimestamps();

#if 1
    sp<RepeaterSource> videoSource =
        new RepeaterSource(source, 30.0 /* rateHz */);
#endif

#if 1
    size_t numInputBuffers;
    status_t err = addSource(
            true /* isVideo */, videoSource, true /* isRepeaterSource */,
            &numInputBuffers);
#else
    size_t numInputBuffers;
    status_t err = addSource(
            true /* isVideo */, source, false /* isRepeaterSource */,
            &numInputBuffers);
#endif

    if (err != OK) {
        return err;