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

Commit dca35288 authored by Andreas Huber's avatar Andreas Huber
Browse files

Better video bandwidth utilization by not lying about the frame rate.

log network bandwidth used (for data traffic).

Change-Id: I043018624b3f02d94fa9c0cb9d15a6b2f2bd2eab
parent a438123b
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -116,7 +116,7 @@ status_t Converter::initEncoder() {
        mOutputFormat->setInt32("bitrate", audioBitrate);
    } else {
        mOutputFormat->setInt32("bitrate", videoBitrate);
        mOutputFormat->setInt32("frame-rate", 60);
        mOutputFormat->setInt32("frame-rate", 30);
        mOutputFormat->setInt32("i-frame-interval", 3);  // Iframes every 3 secs
    }

+10 −1
Original line number Diff line number Diff line
@@ -193,7 +193,8 @@ WifiDisplaySource::PlaybackSession::PlaybackSession(
      mNumSRsSent(0),
      mSendSRPending(false),
      mFirstPacketTimeUs(-1ll),
      mHistoryLength(0)
      mHistoryLength(0),
      mTotalBytesSent(0ll)
#if LOG_TRANSPORT_STREAM
      ,mLogFile(NULL)
#endif
@@ -1023,6 +1024,14 @@ ssize_t WifiDisplaySource::PlaybackSession::appendTSData(
        } else {
            mNetSession->sendRequest(
                    mRTPSessionID, rtp, mTSQueue->size());

            mTotalBytesSent += mTSQueue->size();
            int64_t delayUs = ALooper::GetNowUs() - mFirstPacketTimeUs;

            if (delayUs > 0ll) {
                ALOGV("approx. net bandwidth used: %.2f Mbit/sec",
                        mTotalBytesSent * 8.0 / delayUs);
            }
        }

        mTSQueue->setInt32Data(mRTPSeqNo - 1);
+2 −0
Original line number Diff line number Diff line
@@ -127,6 +127,8 @@ private:
    List<sp<ABuffer> > mHistory;
    size_t mHistoryLength;

    uint64_t mTotalBytesSent;

#if LOG_TRANSPORT_STREAM
    FILE *mLogFile;
#endif