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

Commit fc88be84 authored by Kim Sungyeon's avatar Kim Sungyeon Committed by Lajos Molnar
Browse files

VT: Player/Recoder gets its SSRC ID from param



UE should have its own SSRC ID when exchange RTP packet.
It is UE level id so Rx/Tx should have same ID.
Recorder/Player are implemented separately and didn't have any method to sync the ID.
So upper Java Layer would send unique ID as param.

Merged-in: I11248eada31f50d278ab299f57ee42d9a3ce79be
Change-Id: I11248eada31f50d278ab299f57ee42d9a3ce79be
Signed-off-by: default avatarKim Sungyeon <sy85.kim@samsung.com>
parent e40c5df0
Loading
Loading
Loading
Loading
+15 −0
Original line number Diff line number Diff line
@@ -818,6 +818,13 @@ 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::setParameter(
        const String8 &key, const String8 &value) {
    ALOGV("setParameter: key (%s) => value (%s)", key.string(), value.string());
@@ -940,6 +947,13 @@ 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 {
        ALOGE("setParameter: failed to find key %s", key.string());
    }
@@ -1106,6 +1120,7 @@ status_t StagefrightRecorder::start() {
            sp<MetaData> meta = new MetaData;
            int64_t startTimeUs = systemTime() / 1000;
            meta->setInt64(kKeyTime, startTimeUs);
            meta->setInt32(kKeySelfID, mSelfID);
            status = mWriter->start(meta.get());
            break;
        }
+2 −0
Original line number Diff line number Diff line
@@ -142,6 +142,7 @@ private:
    String8 mRemoteIp;
    int32_t mLocalPort;
    int32_t mRemotePort;
    int32_t mSelfID;

    int64_t mDurationRecordedUs;
    int64_t mStartedRecordingUs;
@@ -227,6 +228,7 @@ 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);
    void clipVideoBitRate();
    void clipVideoFrameRate();
    void clipVideoFrameWidth();
+3 −0
Original line number Diff line number Diff line
@@ -109,6 +109,7 @@ void NuPlayer::RTPSource::prepareAsync() {
        notify->setSize("trackIndex", i);
        // index(i) should be started from 1. 0 is reserved for [root]
        mRTPConn->addStream(sockRtp, sockRtcp, desc, i + 1, notify, false);
        mRTPConn->setSelfID(info->mSelfID);

        info->mRTPSocket = sockRtp;
        info->mRTCPSocket = sockRtcp;
@@ -662,6 +663,8 @@ status_t NuPlayer::RTPSource::setParameter(const String8 &key, const String8 &va
    } else if (key == "rtp-param-rtp-timeout") {
    } else if (key == "rtp-param-rtcp-timeout") {
    } else if (key == "rtp-param-time-scale") {
    } else if (key == "rtp-param-self-id") {
        info->mSelfID = atoi(value);
    }

    return OK;
+3 −0
Original line number Diff line number Diff line
@@ -112,6 +112,9 @@ private:
        int32_t mTimeScale;
        int32_t mAS;

        /* Unique ID indicates itself */
        uint32_t mSelfID;

        /* a copy of TrackInfo in RTSPSource */
        sp<AnotherPacketSource> mSource;
        uint32_t mRTPTime;
+1 −0
Original line number Diff line number Diff line
@@ -249,6 +249,7 @@ enum {
    kKeyEmptyTrackMalFormed = 'nemt', // bool (int32_t)
    kKeySps              = 'sSps', // int32_t, indicates that a buffer is sps.
    kKeyPps              = 'sPps', // int32_t, indicates that a buffer is pps.
    kKeySelfID           = 'sfid', // int32_t, source ID to identify itself on RTP protocol.
};

enum {
Loading