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

Commit 7f9551f7 authored by Zhijun He's avatar Zhijun He
Browse files

MediaMuxer: Hook up setLocation method

This method is needed when mediamuxer is used for camera video recording.

Bug: 10594784
Change-Id: I9bd006a07e5e2ac7019849e3f4f7cf7b8356d669
parent 6220f993
Loading
Loading
Loading
Loading
+10 −0
Original line number Diff line number Diff line
@@ -78,6 +78,16 @@ public:
     */
    status_t setOrientationHint(int degrees);

    /**
     * Set the location.
     * @param latitude The latitude in degree x 1000. Its value must be in the range
     * [-900000, 900000].
     * @param longitude The longitude in degree x 1000. Its value must be in the range
     * [-1800000, 1800000].
     * @return OK if no error.
     */
    status_t setLocation(int latitude, int longitude);

    /**
     * Stop muxing.
     * This method is a blocking call. Depending on how
+10 −0
Original line number Diff line number Diff line
@@ -103,6 +103,16 @@ status_t MediaMuxer::setOrientationHint(int degrees) {
    return OK;
}

status_t MediaMuxer::setLocation(int latitude, int longitude) {
    Mutex::Autolock autoLock(mMuxerLock);
    if (mState != INITIALIZED) {
        ALOGE("setLocation() must be called before start().");
        return INVALID_OPERATION;
    }
    ALOGV("Setting location: latitude = %d, longitude = %d", latitude, longitude);
    return mWriter->setGeoData(latitude, longitude);
}

status_t MediaMuxer::start() {
    Mutex::Autolock autoLock(mMuxerLock);
    if (mState == INITIALIZED) {