summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rwxr-xr-xinclude/videodev2_samsung.h2
-rwxr-xr-xlibcamera/SecCamera.cpp57
2 files changed, 58 insertions, 1 deletions
diff --git a/include/videodev2_samsung.h b/include/videodev2_samsung.h
index 0d4dcc9..6c3fd7f 100755
--- a/include/videodev2_samsung.h
+++ b/include/videodev2_samsung.h
@@ -320,6 +320,8 @@ enum v4l2_vintage_mode {
#define V4L2_CID_CAMERA_GPS_TIMESTAMP (V4L2_CID_CAMERA_CLASS_BASE + 32)
#define V4L2_CID_CAMERA_GPS_ALTITUDE (V4L2_CID_CAMERA_CLASS_BASE + 33)
#define V4L2_CID_CAMERA_EXIF_TIME_INFO (V4L2_CID_CAMERA_CLASS_BASE + 34)
+#define V4L2_CID_CAMERA_GPS_PROCESSINGMETHOD \
+ (V4L2_CID_CAMERA_CLASS_BASE + 35)
#define V4L2_CID_CAMERA_ZOOM (V4L2_CID_PRIVATE_BASE + 90)
enum v4l2_zoom_level {
ZOOM_LEVEL_0 = 0,
diff --git a/libcamera/SecCamera.cpp b/libcamera/SecCamera.cpp
index cb6ad10..7ea19e8 100755
--- a/libcamera/SecCamera.cpp
+++ b/libcamera/SecCamera.cpp
@@ -1208,7 +1208,20 @@ int SecCamera::setSnapshotCmd(void)
CHECK(ret);
// Additional calls needed for CE147
- // TODO: GPS
+
+ // GPS
+ ret = fimc_v4l2_s_ext_ctrl(m_cam_fd, V4L2_CID_CAMERA_GPS_LATITUDE, &gpsInfoLatitude);
+ CHECK(ret);
+ ret = fimc_v4l2_s_ext_ctrl(m_cam_fd, V4L2_CID_CAMERA_GPS_LONGITUDE, &gpsInfoLongitude);
+ CHECK(ret);
+ ret = fimc_v4l2_s_ext_ctrl(m_cam_fd, V4L2_CID_CAMERA_GPS_ALTITUDE, &gpsInfoAltitude);
+ CHECK(ret);
+ ret = fimc_v4l2_s_ext_ctrl(m_cam_fd, V4L2_CID_CAMERA_GPS_PROCESSINGMETHOD,
+ mExifInfo.gps_processing_method);
+ CHECK(ret);
+ unsigned long temp = m_gps_timestamp;
+ ret = fimc_v4l2_s_ext_ctrl(m_cam_fd, V4L2_CID_CAMERA_GPS_TIMESTAMP, &temp);
+ CHECK(ret);
// Time
time_t rawtime;
@@ -2520,6 +2533,23 @@ int SecCamera::setGPSLatitude(const char *gps_latitude)
m_gps_latitude = lround(strtod(gps_latitude, NULL) * 10000000);
}
+ if (m_camera_id == CAMERA_ID_BACK) {
+ if (m_gps_enabled) {
+ long tmp = (m_gps_latitude >= 0) ? m_gps_latitude : -m_gps_latitude;
+ gpsInfoLatitude.north_south = m_gps_latitude < 0;
+ gpsInfoLatitude.dgree = tmp / 10000000;
+ tmp = (tmp % 10000000) * 60;
+ gpsInfoLatitude.minute = tmp / 10000000;
+ gpsInfoLatitude.second = (tmp % 10000000) * 60 / 10000000;
+ }
+ else {
+ gpsInfoLatitude.north_south = 0;
+ gpsInfoLatitude.dgree = 0;
+ gpsInfoLatitude.minute = 0;
+ gpsInfoLatitude.second = 0;
+ }
+ }
+
LOGV("%s(m_gps_latitude(%ld))", __func__, m_gps_latitude);
return 0;
}
@@ -2534,6 +2564,23 @@ int SecCamera::setGPSLongitude(const char *gps_longitude)
m_gps_longitude = lround(strtod(gps_longitude, NULL) * 10000000);
}
+ if (m_camera_id == CAMERA_ID_BACK) {
+ if (m_gps_enabled) {
+ long tmp = (m_gps_longitude >= 0) ? m_gps_longitude : -m_gps_longitude;
+ gpsInfoLongitude.east_west = m_gps_longitude < 0;
+ gpsInfoLongitude.dgree = tmp / 10000000;
+ tmp = (tmp % 10000000) * 60;
+ gpsInfoLongitude.minute = tmp / 10000000;
+ gpsInfoLongitude.second = (tmp % 10000000) * 60 / 10000000;
+ }
+ else {
+ gpsInfoLongitude.east_west = 0;
+ gpsInfoLongitude.dgree = 0;
+ gpsInfoLongitude.minute = 0;
+ gpsInfoLongitude.second = 0;
+ }
+ }
+
LOGV("%s(m_gps_longitude(%ld))", __func__, m_gps_longitude);
return 0;
}
@@ -2547,6 +2594,14 @@ int SecCamera::setGPSAltitude(const char *gps_altitude)
m_gps_altitude = lround(strtod(gps_altitude, NULL) * 100);
}
+ if (m_camera_id == CAMERA_ID_BACK) {
+ gpsInfoAltitude.plus_minus = (m_gps_altitude >= 0);
+ long tmp = gpsInfoAltitude.plus_minus ? m_gps_altitude : -m_gps_altitude;
+ gpsInfoAltitude.dgree = tmp / 100;
+ gpsInfoAltitude.minute = tmp % 100;
+ gpsInfoAltitude.second = 0;
+ }
+
LOGV("%s(m_gps_altitude(%ld))", __func__, m_gps_altitude);
return 0;
}