diff options
author | Andy Huibers <andyhuibers@google.com> | 2014-05-19 13:59:01 -0700 |
---|---|---|
committer | Andy Huibers <andyhuibers@google.com> | 2014-05-19 21:10:17 -0700 |
commit | 203abe5913394239a1e888d71d56597b68f84f62 (patch) | |
tree | 2ea9f61c239355f200fd04a2667156ef1e8335a7 /src/com/android/camera/VideoModule.java | |
parent | 29a2914d2e943e1ccc5bd3d3721a100c98617267 (diff) | |
download | android_packages_apps_Camera2-203abe5913394239a1e888d71d56597b68f84f62.tar.gz android_packages_apps_Camera2-203abe5913394239a1e888d71d56597b68f84f62.tar.bz2 android_packages_apps_Camera2-203abe5913394239a1e888d71d56597b68f84f62.zip |
Add grid lines and flash states to capture logging.
Bug: 14364757
Change-Id: Ibf40c041d508f4406ead273dfdcb1c051a6f83a2
Diffstat (limited to 'src/com/android/camera/VideoModule.java')
-rw-r--r-- | src/com/android/camera/VideoModule.java | 40 |
1 files changed, 35 insertions, 5 deletions
diff --git a/src/com/android/camera/VideoModule.java b/src/com/android/camera/VideoModule.java index 64e7ad8b5..0c6b565b7 100644 --- a/src/com/android/camera/VideoModule.java +++ b/src/com/android/camera/VideoModule.java @@ -836,6 +836,21 @@ public class VideoModule extends CameraModule mAppController.updatePreviewAspectRatio(aspectRatio); } + /** + * Returns current Zoom value, with 1.0 as the value for no zoom. + */ + private float currentZoomValue() { + float zoomValue = 1.0f; + if (mCameraCapabilities.supports(CameraCapabilities.Feature.ZOOM)) { + int zoomIndex = mParameters.getZoom(); + List<Integer> zoomRatios = mParameters.getZoomRatios(); + if (zoomRatios != null && zoomIndex < zoomRatios.size()) { + zoomValue = 0.01f * zoomRatios.get(zoomIndex); + } + } + return zoomValue; + } + @Override public int onZoomChanged(int index) { // Not useful to change zoom value when the activity is paused. @@ -1173,6 +1188,18 @@ public class VideoModule extends CameraModule Log.v(TAG, "New video filename: " + mVideoFilename); } + private void logVideoCapture(long duration) { + String flashSetting = mActivity.getSettingsManager() + .get(SettingsManager.SETTING_VIDEOCAMERA_FLASH_MODE); + boolean gridLinesOn = mActivity.getSettingsManager().areGridLinesOn(); + int width = (Integer) mCurrentVideoValues.get(Video.Media.WIDTH); + int height = (Integer) mCurrentVideoValues.get(Video.Media.HEIGHT); + long size = new File(mCurrentVideoFilename).length(); + String name = new File(mCurrentVideoValues.getAsString(Video.Media.DATA)).getName(); + UsageStatistics.instance().videoCaptureDoneEvent(name, duration, isCameraFrontFacing(), + currentZoomValue(), width, height, size, flashSetting, gridLinesOn); + } + private void saveVideo() { if (mVideoFileDescriptor == null) { long duration = SystemClock.uptimeMillis() - mRecordingStartTime; @@ -1183,9 +1210,11 @@ public class VideoModule extends CameraModule } else { Log.w(TAG, "Video duration <= 0 : " + duration); } + mCurrentVideoValues.put(Video.Media.SIZE, new File(mCurrentVideoFilename).length()); + mCurrentVideoValues.put(Video.Media.DURATION, duration); getServices().getMediaSaver().addVideo(mCurrentVideoFilename, - duration, isCameraFrontFacing(), mCurrentVideoValues, - mOnVideoSavedListener, mContentResolver); + mCurrentVideoValues, mOnVideoSavedListener, mContentResolver); + logVideoCapture(duration); } mCurrentVideoValues = null; } @@ -1807,11 +1836,12 @@ public class VideoModule extends CameraModule ExifInterface exif = Exif.getExif(data); int orientation = Exif.getOrientation(exif); - int zoomIndex = mParameters.getZoom(); - float zoomValue = 0.01f * mParameters.getZoomRatios().get(zoomIndex); + String flashSetting = + mActivity.getSettingsManager().get(SettingsManager.SETTING_VIDEOCAMERA_FLASH_MODE); + Boolean gridLinesOn = mActivity.getSettingsManager().areGridLinesOn(); UsageStatistics.instance().photoCaptureDoneEvent( eventprotos.NavigationChange.Mode.VIDEO_STILL, title + ".jpeg", exif, - isCameraFrontFacing(), false, zoomValue); + isCameraFrontFacing(), false, currentZoomValue(), flashSetting, gridLinesOn); getServices().getMediaSaver().addImage( data, title, dateTaken, loc, orientation, |