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

Commit 8243e247 authored by Lajos Molnar's avatar Lajos Molnar Committed by Android (Google) Code Review
Browse files

Merge changes from topic "200609_ViLTE_sync"

* changes:
  Miscellaneous fixups for VT contribution update.
  VT: ARTPWriter: Introduce Moderator logic
  VT: ARTPWriter: Add traffic recorder
  VT: Migration AAVCAssembler patches to AHEVCAssembler.
  VT: Enhancements on RTP depacketizer (2)
  VT: Refine codes in AAVCAssembler.
  VT: RTCP:NACK implementation. (RFC-4585)
  VT: Report all data about packet receiving up to application
  VT: Enhancements on RTP depacketizer
  VT: Enhancements on RTP packetizer.
  VT: Added an interface to set JitterBufferTime.
  VT: Some parameters not provided to encoder if source is surface.
  VT: H265: prepend VPS/SPS/PPS to I-frame.
  VT: Change to KMP algorithm for searching H.264 start prefix code
  VT: ARTPWriter: StripStartcode() & SpsPpsParser() bug fix
  revert ARTPWriter StripStartcode fix
parents a4d71c3d ed809da3
Loading
Loading
Loading
Loading
+4 −1
Original line number Diff line number Diff line
@@ -178,7 +178,10 @@ enum media_parameter_keys {
    KEY_PARAMETER_PLAYBACK_RATE_PERMILLE = 1300,                // set only

    // Set a Parcel containing the value of a parcelled Java AudioAttribute instance
    KEY_PARAMETER_AUDIO_ATTRIBUTES = 1400                       // set only
    KEY_PARAMETER_AUDIO_ATTRIBUTES = 1400,                       // set only

    // Set a Parcel containing the values of RTP attribute
    KEY_PARAMETER_RTP_ATTRIBUTES = 2000                       // set only
};

// Keep INVOKE_ID_* in sync with MediaPlayer.java.
+11 −5
Original line number Diff line number Diff line
@@ -17,6 +17,9 @@
//#define LOG_NDEBUG 0
#define LOG_TAG "StagefrightRecorder"
#include <inttypes.h>
// TODO/workaround: including base logging now as it conflicts with ADebug.h
// and it must be included first.
#include <android-base/logging.h>
#include <utils/Log.h>

#include "WebmWriter.h"
@@ -575,12 +578,14 @@ status_t StagefrightRecorder::setParamVideoEncodingBitRate(int32_t bitRate) {
    mVideoBitRate = bitRate;

    // A new bitrate(TMMBR) should be applied on runtime as well if OutputFormat is RTP_AVP
    if (mOutputFormat == OUTPUT_FORMAT_RTP_AVP && mStarted && mPauseStartTimeUs == 0) {
    if (mOutputFormat == OUTPUT_FORMAT_RTP_AVP) {
        // Regular I frames may overload the network so we reduce the bitrate to allow
        // margins for the I frame overruns.
        // Still send requested bitrate (TMMBR) in the reply (TMMBN).
        const float coefficient = 0.8f;
        mVideoBitRate = (bitRate * coefficient) / 1000 * 1000;
    }
    if (mOutputFormat == OUTPUT_FORMAT_RTP_AVP && mStarted && mPauseStartTimeUs == 0) {
        mVideoEncoderSource->setEncodingBitrate(mVideoBitRate);
        ARTPWriter* rtpWriter  = static_cast<ARTPWriter*>(mWriter.get());
        rtpWriter->setTMMBNInfo(mOpponentID, bitRate);
@@ -1967,10 +1972,6 @@ status_t StagefrightRecorder::setupVideoEncoder(
        format->setInt32("stride", stride);
        format->setInt32("slice-height", sliceHeight);
        format->setInt32("color-format", colorFormat);
        if (mOutputFormat == OUTPUT_FORMAT_RTP_AVP) {
            // This indicates that a raw image provided to encoder needs to be rotated.
            format->setInt32("rotation-degrees", mRotationDegrees);
        }
    } else {
        format->setInt32("width", mVideoWidth);
        format->setInt32("height", mVideoHeight);
@@ -1988,6 +1989,11 @@ status_t StagefrightRecorder::setupVideoEncoder(
        }
    }

    if (mOutputFormat == OUTPUT_FORMAT_RTP_AVP) {
        // This indicates that a raw image provided to encoder needs to be rotated.
        format->setInt32("rotation-degrees", mRotationDegrees);
    }

    format->setInt32("bitrate", mVideoBitRate);
    format->setInt32("bitrate-mode", mVideoBitRateMode);
    format->setInt32("frame-rate", mFrameRate);
+27 −0
Original line number Diff line number Diff line
@@ -1702,6 +1702,12 @@ void NuPlayer::updateInternalTimers() {
    updateRebufferingTimer(false /* stopping */, false /* exiting */);
}

void NuPlayer::setTargetBitrate(int bitrate) {
    if (mSource != NULL) {
        mSource->setTargetBitrate(bitrate);
    }
}

void NuPlayer::onPause() {

    updatePlaybackTimer(true /* stopping */, "onPause");
@@ -2868,6 +2874,27 @@ void NuPlayer::sendIMSRxNotice(const sp<AMessage> &msg) {
            }
            break;
        }
        case NuPlayer::RTPSource::RTP_QUALITY:
        {
            int32_t feedbackType, bitrate;
            int32_t highestSeqNum, baseSeqNum, prevExpected;
            int32_t numBufRecv, prevNumBufRecv;
            CHECK(msg->findInt32("feedback-type", &feedbackType));
            CHECK(msg->findInt32("bit-rate", &bitrate));
            CHECK(msg->findInt32("highest-seq-num", &highestSeqNum));
            CHECK(msg->findInt32("base-seq-num", &baseSeqNum));
            CHECK(msg->findInt32("prev-expected", &prevExpected));
            CHECK(msg->findInt32("num-buf-recv", &numBufRecv));
            CHECK(msg->findInt32("prev-num-buf-recv", &prevNumBufRecv));
            in.writeInt32(feedbackType);
            in.writeInt32(bitrate);
            in.writeInt32(highestSeqNum);
            in.writeInt32(baseSeqNum);
            in.writeInt32(prevExpected);
            in.writeInt32(numBufRecv);
            in.writeInt32(prevNumBufRecv);
            break;
        }
        case NuPlayer::RTPSource::RTP_CVO:
        {
            int32_t cvo;
+2 −0
Original line number Diff line number Diff line
@@ -102,6 +102,8 @@ struct NuPlayer : public AHandler {

    void updateInternalTimers();

    void setTargetBitrate(int bitrate /* bps */);

protected:
    virtual ~NuPlayer();

+5 −1
Original line number Diff line number Diff line
@@ -817,7 +817,11 @@ void NuPlayerDriver::setAudioSink(const sp<AudioSink> &audioSink) {
}

status_t NuPlayerDriver::setParameter(
        int /* key */, const Parcel & /* request */) {
        int key, const Parcel &request ) {
    if (key == KEY_PARAMETER_RTP_ATTRIBUTES) {
        mPlayer->setTargetBitrate(request.readInt32());
        return OK;
    }
    return INVALID_OPERATION;
}

Loading