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

Commit 729bbecb authored by Lajos Molnar's avatar Lajos Molnar Committed by Gerrit Code Review
Browse files

Merge "VT: Add FIR, PLI reaction"

parents d5a24879 4b08d94c
Loading
Loading
Loading
Loading
+12 −0
Original line number Diff line number Diff line
@@ -861,6 +861,16 @@ status_t StagefrightRecorder::setRTPCVODegrees(int32_t cvoDegrees) {
    return OK;
}

status_t StagefrightRecorder::requestIDRFrame() {
    status_t ret = BAD_VALUE;
    if (mVideoEncoderSource != NULL) {
        ret = mVideoEncoderSource->requestIDRFrame();
    } else {
        ALOGV("requestIDRFrame: Encoder not ready");
    }
    return ret;
}

status_t StagefrightRecorder::setParameter(
        const String8 &key, const String8 &value) {
    ALOGV("setParameter: key (%s) => value (%s)", key.string(), value.string());
@@ -1005,6 +1015,8 @@ status_t StagefrightRecorder::setParameter(
        if (safe_strtoi32(value.string(), &degrees)) {
            return setRTPCVODegrees(degrees);
        }
    } else if (key == "video-param-request-i-frame") {
        return requestIDRFrame();
    } else {
        ALOGE("setParameter: failed to find key %s", key.string());
    }
+1 −0
Original line number Diff line number Diff line
@@ -237,6 +237,7 @@ private:
    status_t setParamPayloadType(int32_t payloadType);
    status_t setRTPCVOExtMap(int32_t extmap);
    status_t setRTPCVODegrees(int32_t cvoDegrees);
    status_t requestIDRFrame();
    void clipVideoBitRate();
    void clipVideoFrameRate();
    void clipVideoFrameWidth();
+10 −0
Original line number Diff line number Diff line
@@ -449,6 +449,16 @@ status_t MediaCodecSource::setEncodingBitrate(int32_t bitRate) {
    return mEncoder->setParameters(params);
}

status_t MediaCodecSource::requestIDRFrame() {
    if (mEncoder == NULL) {
        ALOGW("requestIDRFrame : mEncoder is null");
        return BAD_VALUE;
    } else {
        mEncoder->requestIDRFrame();
        return OK;
    }
}

MediaCodecSource::MediaCodecSource(
        const sp<ALooper> &looper,
        const sp<AMessage> &outputFormat,
+2 −0
Original line number Diff line number Diff line
@@ -71,6 +71,8 @@ struct MediaCodecSource : public MediaSource,



    status_t requestIDRFrame();

protected:
    virtual ~MediaCodecSource();

+14 −0
Original line number Diff line number Diff line
@@ -948,6 +948,20 @@ status_t ARTPConnection::parsePSFB(
            ALOGI("PLI detected.");
            break;
        }
        case 4:     // Full Intra Request (FIR)
        {
            uint32_t requestedId = u32at(&data[12]);
            if (requestedId == (uint32_t)mSelfID) {
                sp<AMessage> notify = s->mNotifyMsg->dup();
                notify->setInt32("IMS-Rx-notice", 1);
                notify->setInt32("payload-type", 206);
                notify->setInt32("feedback-type", msgType);
                notify->setInt32("sender", id);
                notify->post();
                ALOGI("FIR detected.");
            }
            break;
        }
        default:
        {
            ALOGI("Not supported PSFB type %d", msgType);