summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorZhijun He <zhijunhe@google.com>2013-09-09 15:48:58 -0700
committerZhijun He <zhijunhe@google.com>2013-09-09 17:24:06 -0700
commit7f9551f75eedb3e4e1fe8feaaba48d8080635fc4 (patch)
tree2723b3ac82ab83025a52fbc8462f58875df0d94c
parent6220f993541b0317e6ace3c410dd35a8d76e30bc (diff)
downloadframeworks_av-7f9551f75eedb3e4e1fe8feaaba48d8080635fc4.zip
frameworks_av-7f9551f75eedb3e4e1fe8feaaba48d8080635fc4.tar.gz
frameworks_av-7f9551f75eedb3e4e1fe8feaaba48d8080635fc4.tar.bz2
MediaMuxer: Hook up setLocation method
This method is needed when mediamuxer is used for camera video recording. Bug: 10594784 Change-Id: I9bd006a07e5e2ac7019849e3f4f7cf7b8356d669
-rw-r--r--include/media/stagefright/MediaMuxer.h10
-rw-r--r--media/libstagefright/MediaMuxer.cpp10
2 files changed, 20 insertions, 0 deletions
diff --git a/include/media/stagefright/MediaMuxer.h b/include/media/stagefright/MediaMuxer.h
index c1fdbad..ff6a66e 100644
--- a/include/media/stagefright/MediaMuxer.h
+++ b/include/media/stagefright/MediaMuxer.h
@@ -79,6 +79,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
* much data is bufferred internally, the time needed for stopping
diff --git a/media/libstagefright/MediaMuxer.cpp b/media/libstagefright/MediaMuxer.cpp
index 94ce5de..d87e910 100644
--- a/media/libstagefright/MediaMuxer.cpp
+++ b/media/libstagefright/MediaMuxer.cpp
@@ -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) {