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

Commit d2e75ec2 authored by Byeongjo Park's avatar Byeongjo Park Committed by Automerger Merge Worker
Browse files

VT: SFR: added parameters to handle RTP IP Addresses through setParameters(). am: 27b1c0b6

Original change: https://android-review.googlesource.com/c/platform/frameworks/av/+/952478

MUST ONLY BE SUBMITTED BY AUTOMERGER

Change-Id: I30c5dab1cba2d3c7fd7bc4a1522c024f741e9326
parents dabe7858 27b1c0b6
Loading
Loading
Loading
Loading
+43 −1
Original line number Diff line number Diff line
@@ -779,6 +779,34 @@ status_t StagefrightRecorder::setParamGeoDataLatitude(
    return OK;
}

status_t StagefrightRecorder::setParamRtpLocalIp(const String8 &localIp) {
    ALOGV("setParamVideoLocalIp: %s", localIp.string());

    mLocalIp.setTo(localIp.string());
    return OK;
}

status_t StagefrightRecorder::setParamRtpLocalPort(int32_t localPort) {
    ALOGV("setParamVideoLocalPort: %d", localPort);

    mLocalPort = localPort;
    return OK;
}

status_t StagefrightRecorder::setParamRtpRemoteIp(const String8 &remoteIp) {
    ALOGV("setParamVideoRemoteIp: %s", remoteIp.string());

    mRemoteIp.setTo(remoteIp.string());
    return OK;
}

status_t StagefrightRecorder::setParamRtpRemotePort(int32_t remotePort) {
    ALOGV("setParamVideoRemotePort: %d", remotePort);

    mRemotePort = remotePort;
    return OK;
}

status_t StagefrightRecorder::setParameter(
        const String8 &key, const String8 &value) {
    ALOGV("setParameter: key (%s) => value (%s)", key.string(), value.string());
@@ -887,6 +915,20 @@ status_t StagefrightRecorder::setParameter(
        if (safe_strtod(value.string(), &fps)) {
            return setParamCaptureFps(fps);
        }
    } else if (key == "rtp-param-local-ip") {
        return setParamRtpLocalIp(value);
    } else if (key == "rtp-param-local-port") {
        int32_t localPort;
        if (safe_strtoi32(value.string(), &localPort)) {
            return setParamRtpLocalPort(localPort);
        }
    } else if (key == "rtp-param-remote-ip") {
        return setParamRtpRemoteIp(value);
    } else if (key == "rtp-param-remote-port") {
        int32_t remotePort;
        if (safe_strtoi32(value.string(), &remotePort)) {
            return setParamRtpRemotePort(remotePort);
        }
    } else {
        ALOGE("setParameter: failed to find key %s", key.string());
    }
@@ -1333,7 +1375,7 @@ status_t StagefrightRecorder::setupRTPRecording() {
        mVideoEncoderSource = source;
    }

    mWriter = new ARTPWriter(mOutputFd);
    mWriter = new ARTPWriter(mOutputFd, mLocalIp, mLocalPort, mRemoteIp, mRemotePort);
    mWriter->addSource(source);
    mWriter->setListener(mListener);

+8 −0
Original line number Diff line number Diff line
@@ -138,6 +138,10 @@ private:
    int32_t mLongitudex10000;
    int32_t mStartTimeOffsetMs;
    int32_t mTotalBitRate;
    String8 mLocalIp;
    String8 mRemoteIp;
    int32_t mLocalPort;
    int32_t mRemotePort;

    int64_t mDurationRecordedUs;
    int64_t mStartedRecordingUs;
@@ -219,6 +223,10 @@ private:
    status_t setParamMovieTimeScale(int32_t timeScale);
    status_t setParamGeoDataLongitude(int64_t longitudex10000);
    status_t setParamGeoDataLatitude(int64_t latitudex10000);
    status_t setParamRtpLocalIp(const String8 &localIp);
    status_t setParamRtpLocalPort(int32_t localPort);
    status_t setParamRtpRemoteIp(const String8 &remoteIp);
    status_t setParamRtpRemotePort(int32_t remotePort);
    void clipVideoBitRate();
    void clipVideoFrameRate();
    void clipVideoFrameWidth();