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

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

Use incremental updates sent by surface flinger

instead of running at a fixed framerate.

Change-Id: Ia3f36aa449e2e952bf3263ffbb709a9b79b09c26
related-to-bug: 7266398
parent b72d42c7
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -132,7 +132,7 @@ status_t Converter::initEncoder() {
        mOutputFormat->setInt32("bitrate", audioBitrate);
    } else {
        mOutputFormat->setInt32("bitrate", videoBitrate);
        mOutputFormat->setInt32("frame-rate", 24);
        mOutputFormat->setInt32("frame-rate", 60);
        mOutputFormat->setInt32("i-frame-interval", 1);  // Iframes every 1 secs
        // mOutputFormat->setInt32("prepend-sps-pps-to-idr-frames", 1);
    }
+3 −5
Original line number Diff line number Diff line
@@ -267,7 +267,7 @@ WifiDisplaySource::PlaybackSession::PlaybackSession(
      mSendSRPending(false),
      mHistoryLength(0)
#if TRACK_BANDWIDTH
      ,mFirstPacketTimeUs(-1ll),
      ,mFirstPacketTimeUs(-1ll)
      ,mTotalBytesSent(0ll)
#endif
#if LOG_TRANSPORT_STREAM
@@ -885,10 +885,8 @@ status_t WifiDisplaySource::PlaybackSession::addVideoSource() {

    source->setUseAbsoluteTimestamps();

    sp<MediaSource> videoSource = new RepeaterSource(source, 24.0f);

    size_t numInputBuffers;
    status_t err = addSource(true /* isVideo */, videoSource, &numInputBuffers);
    status_t err = addSource(true /* isVideo */, source, &numInputBuffers);

    if (err != OK) {
        return err;
@@ -1122,7 +1120,7 @@ ssize_t WifiDisplaySource::PlaybackSession::appendTSData(
            int64_t delayUs = ALooper::GetNowUs() - mFirstPacketTimeUs;

            if (delayUs > 0ll) {
                ALOGV("approx. net bandwidth used: %.2f Mbit/sec",
                ALOGI("approx. net bandwidth used: %.2f Mbit/sec",
                        mTotalBytesSent * 8.0 / delayUs);
            }
#endif
+1 −1
Original line number Diff line number Diff line
@@ -539,7 +539,7 @@ status_t WifiDisplaySource::sendM4(int32_t sessionID) {
    //   use "78 00 02 02 00008000 00000000 00000000 00 0000 0000 00 none none\r\n"
    AString body = StringPrintf(
        "wfd_video_formats: "
        "78 00 02 02 00008000 00000000 00000000 00 0000 0000 00 none none\r\n"
        "30 00 02 02 00000040 00000000 00000000 00 0000 0000 00 none none\r\n"
        "wfd_audio_codecs: AAC 00000001 00\r\n"  // 2 ch AAC 48kHz
        "wfd_presentation_URL: rtsp://%s/wfd1.0/streamid=0 none\r\n"
        "wfd_client_rtp_ports: RTP/AVP/%s;unicast 19000 0 mode=play\r\n",