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

Commit 3879f37c authored by Lajos Molnar's avatar Lajos Molnar Committed by Automerger Merge Worker
Browse files

Merge changes I426dc1f7,I7502f09f am: ec895dd8

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

MUST ONLY BE SUBMITTED BY AUTOMERGER

Change-Id: I17e8647885e257617ed8f6f30dc40332a0de9ad8
parents 813b34fd ec895dd8
Loading
Loading
Loading
Loading
+29 −0
Original line number Diff line number Diff line
@@ -66,6 +66,7 @@ enum {
    ENABLE_AUDIO_DEVICE_CALLBACK,
    GET_ACTIVE_MICROPHONES,
    GET_PORT_ID,
    GET_RTP_DATA_USAGE,
    SET_PREFERRED_MICROPHONE_DIRECTION,
    SET_PREFERRED_MICROPHONE_FIELD_DIMENSION,
    SET_PRIVACY_SENSITIVE,
@@ -476,6 +477,23 @@ public:
        *portId = (audio_port_handle_t)reply.readInt32();
        return NO_ERROR;
    }

    status_t getRtpDataUsage(uint64_t *bytes)
    {
        ALOGV("getRtpDataUsage");
        if (bytes == nullptr) {
            return BAD_VALUE;
        }
        Parcel data, reply;
        data.writeInterfaceToken(IMediaRecorder::getInterfaceDescriptor());
        status_t status = remote()->transact(GET_RTP_DATA_USAGE, data, &reply);
        if (status != OK
                || (status = (status_t)reply.readInt32()) != NO_ERROR) {
            *bytes = 0;
            return status;
        }
        return reply.readUint64(bytes);
    }
};

IMPLEMENT_META_INTERFACE(MediaRecorder, "android.media.IMediaRecorder");
@@ -759,6 +777,17 @@ status_t BnMediaRecorder::onTransact(
            }
            return NO_ERROR;
        }
        case GET_RTP_DATA_USAGE: {
            ALOGV("GET_RTP_DATA_USAGE");
            CHECK_INTERFACE(IMediaRecorder, data, reply);
            uint64_t bytes;
            status_t status = getRtpDataUsage(&bytes);
            reply->writeInt32(status);
            if (status == NO_ERROR) {
                reply->writeUint64(bytes);
            }
            return NO_ERROR;
        }
        case SET_PREFERRED_MICROPHONE_DIRECTION: {
            ALOGV("SET_PREFERRED_MICROPHONE_DIRECTION");
            CHECK_INTERFACE(IMediaRecorder, data, reply);
+1 −0
Original line number Diff line number Diff line
@@ -78,6 +78,7 @@ public:
    virtual status_t setPreferredMicrophoneDirection(audio_microphone_direction_t direction) = 0;
    virtual status_t setPreferredMicrophoneFieldDimension(float zoom) = 0;
    virtual status_t getPortId(audio_port_handle_t *portId) = 0;
    virtual status_t getRtpDataUsage(uint64_t *bytes) = 0;
};

// ----------------------------------------------------------------------------
+1 −0
Original line number Diff line number Diff line
@@ -77,6 +77,7 @@ struct MediaRecorderBase {
    virtual status_t setPreferredMicrophoneDirection(audio_microphone_direction_t direction) = 0;
    virtual status_t setPreferredMicrophoneFieldDimension(float zoom) = 0;
    virtual status_t getPortId(audio_port_handle_t *portId) const = 0;
    virtual status_t getRtpDataUsage(uint64_t *bytes) = 0;



+1 −0
Original line number Diff line number Diff line
@@ -270,6 +270,7 @@ public:
    status_t    setPreferredMicrophoneFieldDimension(float zoom);

    status_t    getPortId(audio_port_handle_t *portId) const;
    status_t    getRtpDataUsage(uint64_t *bytes);

private:
    void                    doCleanUp();
+10 −0
Original line number Diff line number Diff line
@@ -913,4 +913,14 @@ status_t MediaRecorder::getPortId(audio_port_handle_t *portId) const
    return mMediaRecorder->getPortId(portId);
}

status_t MediaRecorder::getRtpDataUsage(uint64_t *bytes)
{
    ALOGV("getRtpDataUsage");

    if (mMediaRecorder == NULL) {
        ALOGE("media recorder is not initialized yet");
        return INVALID_OPERATION;
    }
    return mMediaRecorder->getRtpDataUsage(bytes);
}
} // namespace android
Loading