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

Commit 5f4b6b4c authored by Lajos Molnar's avatar Lajos Molnar Committed by Gerrit Code Review
Browse files

Merge changes I49ab063d,I6d2d5013,I203ff502,I7c6f244c,I11248ead, ...

* changes:
  VT: SFR: H264: CVO implementation for Tx side.
  VT: Change socket option to REUSEADDR
  VT: Add TMMBR function on Rx
  VT: Recorder gets payload type value from param
  VT: Player/Recoder gets its SSRC ID from param
  VT: Add RTCP feedback message(TSFB & PSFB) parser to RTP source
parents 65f7dd43 6552d60d
Loading
Loading
Loading
Loading
+1 −0
Original line number Diff line number Diff line
@@ -62,6 +62,7 @@ enum media_event_type {
    MEDIA_META_DATA         = 202,
    MEDIA_DRM_INFO          = 210,
    MEDIA_TIME_DISCONTINUITY = 211,
    MEDIA_IMS_RX_NOTICE     = 300,
    MEDIA_AUDIO_ROUTING_CHANGED = 10000,
};

+3 −0
Original line number Diff line number Diff line
@@ -959,6 +959,9 @@ void MediaPlayer::notify(int msg, int ext1, int ext2, const Parcel *obj)
    case MEDIA_META_DATA:
        ALOGV("Received timed metadata message");
        break;
    case MEDIA_IMS_RX_NOTICE:
        ALOGV("Received IMS Rx notice message");
        break;
    default:
        ALOGV("unrecognized message: (%d, %d, %d)", msg, ext1, ext2);
        break;
+64 −0
Original line number Diff line number Diff line
@@ -117,6 +117,8 @@ StagefrightRecorder::StagefrightRecorder(const String16 &opPackageName)
      mAudioSource((audio_source_t)AUDIO_SOURCE_CNT), // initialize with invalid value
      mPrivacySensitive(PRIVACY_SENSITIVE_DEFAULT),
      mVideoSource(VIDEO_SOURCE_LIST_END),
      mRTPCVOExtMap(-1),
      mRTPCVODegrees(0),
      mStarted(false),
      mSelectedDeviceId(AUDIO_PORT_HANDLE_NONE),
      mDeviceCallbackEnabled(false),
@@ -818,6 +820,40 @@ status_t StagefrightRecorder::setParamRtpRemotePort(int32_t remotePort) {
    return OK;
}

status_t StagefrightRecorder::setParamSelfID(int32_t selfID) {
    ALOGV("setParamSelfID: %x", selfID);

    mSelfID = selfID;
    return OK;
}

status_t StagefrightRecorder::setParamPayloadType(int32_t payloadType) {
    ALOGV("setParamPayloadType: %x", payloadType);

    mPayloadType = payloadType;
    return OK;
}

status_t StagefrightRecorder::setRTPCVOExtMap(int32_t extmap) {
    ALOGV("setRtpCvoExtMap: %d", extmap);

    mRTPCVOExtMap = extmap;
    return OK;
}

status_t StagefrightRecorder::setRTPCVODegrees(int32_t cvoDegrees) {
    Mutex::Autolock autolock(mLock);
    ALOGV("setRtpCvoDegrees: %d", cvoDegrees);

    mRTPCVODegrees = cvoDegrees;

    if (mStarted && mOutputFormat == OUTPUT_FORMAT_RTP_AVP) {
        mWriter->updateCVODegrees(mRTPCVODegrees);
    }

    return OK;
}

status_t StagefrightRecorder::setParameter(
        const String8 &key, const String8 &value) {
    ALOGV("setParameter: key (%s) => value (%s)", key.string(), value.string());
@@ -940,6 +976,28 @@ status_t StagefrightRecorder::setParameter(
        if (safe_strtoi32(value.string(), &remotePort)) {
            return setParamRtpRemotePort(remotePort);
        }
    } else if (key == "rtp-param-self-id") {
        int32_t selfID;
        int64_t temp;
        if (safe_strtoi64(value.string(), &temp)) {
            selfID = static_cast<int32_t>(temp);
            return setParamSelfID(selfID);
        }
    } else if (key == "rtp-param-payload-type") {
        int32_t payloadType;
        if (safe_strtoi32(value.string(), &payloadType)) {
            return setParamPayloadType(payloadType);
        }
    } else if (key == "rtp-param-ext-cvo-extmap") {
        int32_t extmap;
        if (safe_strtoi32(value.string(), &extmap)) {
            return setRTPCVOExtMap(extmap);
        }
    } else if (key == "rtp-param-ext-cvo-degrees") {
        int32_t degrees;
        if (safe_strtoi32(value.string(), &degrees)) {
            return setRTPCVODegrees(degrees);
        }
    } else {
        ALOGE("setParameter: failed to find key %s", key.string());
    }
@@ -1106,6 +1164,12 @@ status_t StagefrightRecorder::start() {
            sp<MetaData> meta = new MetaData;
            int64_t startTimeUs = systemTime() / 1000;
            meta->setInt64(kKeyTime, startTimeUs);
            meta->setInt32(kKeySelfID, mSelfID);
            meta->setInt32(kKeyPayloadType, mPayloadType);
            if (mRTPCVOExtMap > 0) {
                meta->setInt32(kKeyRtpExtMap, mRTPCVOExtMap);
                meta->setInt32(kKeyRtpCvoDegrees, mRTPCVODegrees);
            }
            status = mWriter->start(meta.get());
            break;
        }
+8 −0
Original line number Diff line number Diff line
@@ -142,6 +142,10 @@ private:
    String8 mRemoteIp;
    int32_t mLocalPort;
    int32_t mRemotePort;
    int32_t mSelfID;
    int32_t mPayloadType;
    int32_t mRTPCVOExtMap;
    int32_t mRTPCVODegrees;

    int64_t mDurationRecordedUs;
    int64_t mStartedRecordingUs;
@@ -227,6 +231,10 @@ private:
    status_t setParamRtpLocalPort(int32_t localPort);
    status_t setParamRtpRemoteIp(const String8 &remoteIp);
    status_t setParamRtpRemotePort(int32_t remotePort);
    status_t setParamSelfID(int32_t selfID);
    status_t setParamPayloadType(int32_t payloadType);
    status_t setRTPCVOExtMap(int32_t extmap);
    status_t setRTPCVODegrees(int32_t cvoDegrees);
    void clipVideoBitRate();
    void clipVideoFrameRate();
    void clipVideoFrameWidth();
+40 −0
Original line number Diff line number Diff line
@@ -2727,6 +2727,14 @@ void NuPlayer::onSourceNotify(const sp<AMessage> &msg) {
            break;
        }

        case Source::kWhatIMSRxNotice:
        {
            sp<AMessage> IMSRxNotice;
            CHECK(msg->findMessage("message", &IMSRxNotice));
            sendIMSRxNotice(IMSRxNotice);
            break;
        }

        default:
            TRESPASS();
    }
@@ -2829,6 +2837,38 @@ void NuPlayer::sendTimedTextData(const sp<ABuffer> &buffer) {
    }
}

void NuPlayer::sendIMSRxNotice(const sp<AMessage> &msg) {
    int32_t notice, payloadType, feedbackType, id, bitrate;

    CHECK(msg->findInt32("IMS-Rx-notice", &notice));
    CHECK(msg->findInt32("payload-type", &payloadType));
    CHECK(msg->findInt32("feedback-type", &feedbackType));
    CHECK(msg->findInt32("sender", &id));

    Parcel in;
    in.writeInt32(payloadType);
    in.writeInt32(feedbackType);
    in.writeInt32(id);

    switch (payloadType) {
        case 205:   // TSFB
        {
            CHECK(msg->findInt32("bit-rate", &bitrate));
            in.writeInt32(bitrate);
            break;
        }
        case 206:   // PSFB
        {
            // nothing to do yet
            break;
        }
        default:
        break;
    }

    notifyListener(MEDIA_IMS_RX_NOTICE, 0, 0, &in);
}

const char *NuPlayer::getDataSourceType() {
    switch (mDataSourceType) {
        case DATA_SOURCE_TYPE_HTTP_LIVE:
Loading