Loading app/src/androidTest/java/net/sourceforge/opencamera/test/MainActivityTest.java +2 −1 Original line number Diff line number Diff line Loading @@ -15,6 +15,7 @@ import net.sourceforge.opencamera.HDRProcessor; import net.sourceforge.opencamera.HDRProcessorException; import net.sourceforge.opencamera.MainActivity; import net.sourceforge.opencamera.PreferenceKeys; import net.sourceforge.opencamera.Preview.VideoProfile; import net.sourceforge.opencamera.SaveLocationHistory; import net.sourceforge.opencamera.CameraController.CameraController; import net.sourceforge.opencamera.Preview.Preview; Loading Loading @@ -790,7 +791,7 @@ public class MainActivityTest extends ActivityInstrumentationTestCase2<MainActiv clickView(switchVideoButton); waitUntilCameraOpened(); assertTrue(mPreview.isVideo()); Preview.VideoProfile profile = mPreview.getVideoProfile(); VideoProfile profile = mPreview.getVideoProfile(); CameraController.Size video_preview_size = mPreview.getCameraController().getPreviewSize(); //targetRatio = mPreview.getTargetRatioForPreview(display_size); targetRatio = mPreview.getTargetRatio(); Loading app/src/main/java/net/sourceforge/opencamera/MainActivity.java +3 −2 Original line number Diff line number Diff line Loading @@ -3,6 +3,7 @@ package net.sourceforge.opencamera; import net.sourceforge.opencamera.CameraController.CameraController; import net.sourceforge.opencamera.CameraController.CameraControllerManager2; import net.sourceforge.opencamera.Preview.Preview; import net.sourceforge.opencamera.Preview.VideoProfile; import net.sourceforge.opencamera.UI.FolderChooserDialog; import net.sourceforge.opencamera.UI.MainUI; Loading Loading @@ -1336,7 +1337,7 @@ public class MainActivity extends Activity implements AudioListener.AudioListene if( preview.getVideoQualityHander().getCurrentVideoQuality() != null ) { bundle.putString("current_video_quality", preview.getVideoQualityHander().getCurrentVideoQuality()); } Preview.VideoProfile camcorder_profile = preview.getVideoProfile(); VideoProfile camcorder_profile = preview.getVideoProfile(); bundle.putInt("video_frame_width", camcorder_profile.videoFrameWidth); bundle.putInt("video_frame_height", camcorder_profile.videoFrameHeight); bundle.putInt("video_bit_rate", camcorder_profile.videoBitRate); Loading Loading @@ -2858,7 +2859,7 @@ public class MainActivity extends Activity implements AudioListener.AudioListene SharedPreferences sharedPreferences = PreferenceManager.getDefaultSharedPreferences(this); boolean simple = true; if( preview.isVideo() ) { Preview.VideoProfile profile = preview.getVideoProfile(); VideoProfile profile = preview.getVideoProfile(); String bitrate_string; if( profile.videoBitRate >= 10000000 ) bitrate_string = profile.videoBitRate/1000000 + "Mbps"; Loading app/src/main/java/net/sourceforge/opencamera/MyApplicationInterface.java +3 −3 Original line number Diff line number Diff line Loading @@ -15,6 +15,7 @@ import java.util.TimerTask; import net.sourceforge.opencamera.CameraController.CameraController; import net.sourceforge.opencamera.Preview.ApplicationInterface; import net.sourceforge.opencamera.Preview.Preview; import net.sourceforge.opencamera.Preview.VideoProfile; import net.sourceforge.opencamera.UI.DrawPreview; import android.annotation.TargetApi; Loading @@ -29,7 +30,6 @@ import android.graphics.Paint; import android.graphics.Rect; import android.hardware.camera2.DngCreator; import android.location.Location; import android.media.CamcorderProfile; import android.media.Image; import android.media.MediaMetadataRetriever; import android.media.MediaRecorder; Loading Loading @@ -1325,7 +1325,7 @@ public class MyApplicationInterface implements ApplicationInterface { } @Override public void onVideoRecordStartError(Preview.VideoProfile profile) { public void onVideoRecordStartError(VideoProfile profile) { if( MyDebug.LOG ) Log.d(TAG, "onVideoRecordStartError"); String error_message; Loading @@ -1344,7 +1344,7 @@ public class MyApplicationInterface implements ApplicationInterface { } @Override public void onVideoRecordStopError(Preview.VideoProfile profile) { public void onVideoRecordStopError(VideoProfile profile) { if( MyDebug.LOG ) Log.d(TAG, "onVideoRecordStopError"); //main_activity.getPreview().showToast(null, R.string.failed_to_record_video); Loading app/src/main/java/net/sourceforge/opencamera/Preview/ApplicationInterface.java +2 −2 Original line number Diff line number Diff line Loading @@ -113,8 +113,8 @@ public interface ApplicationInterface { void onPhotoError(); // callback for failing to take a photo void onVideoInfo(int what, int extra); // callback for info when recording video (see MediaRecorder.OnInfoListener) void onVideoError(int what, int extra); // callback for errors when recording video (see MediaRecorder.OnErrorListener) void onVideoRecordStartError(Preview.VideoProfile profile); // callback for video recording failing to start void onVideoRecordStopError(Preview.VideoProfile profile); // callback for video recording being corrupted void onVideoRecordStartError(VideoProfile profile); // callback for video recording failing to start void onVideoRecordStopError(VideoProfile profile); // callback for video recording being corrupted void onFailedReconnectError(); // failed to reconnect camera after stopping video recording void onFailedCreateVideoFileError(); // callback if unable to create file for recording video void hasPausedPreview(boolean paused); // called when the preview is paused or unpaused (due to getPausePreviewPref()) Loading app/src/main/java/net/sourceforge/opencamera/Preview/Preview.java +0 −45 Original line number Diff line number Diff line Loading @@ -293,51 +293,6 @@ public class Preview implements SurfaceHolder.Callback, TextureView.SurfaceTextu public volatile boolean test_video_failure; public volatile boolean test_ticker_called; // set from MySurfaceView or CanvasView /** This is essentially similar to CamcorderProfile in that it encapsulates a set of video settings * to be passed to MediaRecorder, but allows us to create values without having to create a * CamcorderProfile (needed for slow motion / high speed video recording). */ public class VideoProfile { final CamcorderProfile camcorderProfile; public final int audioCodec; public final int fileFormat; public final int videoBitRate; public final int videoCodec; public final int videoFrameHeight; public final int videoFrameRate; public final int videoFrameWidth; VideoProfile(CamcorderProfile camcorderProfile) { this.camcorderProfile = camcorderProfile; this.audioCodec = camcorderProfile.audioCodec; this.fileFormat = camcorderProfile.fileFormat; this.videoBitRate = camcorderProfile.videoBitRate; this.videoCodec = camcorderProfile.videoCodec; this.videoFrameHeight = camcorderProfile.videoFrameHeight; this.videoFrameRate = camcorderProfile.videoFrameRate; this.videoFrameWidth = camcorderProfile.videoFrameWidth; } VideoProfile(int audioCodec, int fileFormat, int videoBitRate, int videoCodec, int videoFrameHeight, int videoFrameRate, int videoFrameWidth) { this.camcorderProfile = null; this.audioCodec = audioCodec; this.fileFormat = fileFormat; this.videoBitRate = videoBitRate; this.videoCodec = videoCodec; this.videoFrameHeight = videoFrameHeight; this.videoFrameRate = videoFrameRate; this.videoFrameWidth = videoFrameWidth; } /** Returns the CamcorderProfile this VideoProfile was created with, or null if it was not * created with a CamcorderProfile. */ CamcorderProfile getCamcorderProfile() { return this.camcorderProfile; } } public Preview(ApplicationInterface applicationInterface, ViewGroup parent) { if( MyDebug.LOG ) { Log.d(TAG, "new Preview"); Loading Loading
app/src/androidTest/java/net/sourceforge/opencamera/test/MainActivityTest.java +2 −1 Original line number Diff line number Diff line Loading @@ -15,6 +15,7 @@ import net.sourceforge.opencamera.HDRProcessor; import net.sourceforge.opencamera.HDRProcessorException; import net.sourceforge.opencamera.MainActivity; import net.sourceforge.opencamera.PreferenceKeys; import net.sourceforge.opencamera.Preview.VideoProfile; import net.sourceforge.opencamera.SaveLocationHistory; import net.sourceforge.opencamera.CameraController.CameraController; import net.sourceforge.opencamera.Preview.Preview; Loading Loading @@ -790,7 +791,7 @@ public class MainActivityTest extends ActivityInstrumentationTestCase2<MainActiv clickView(switchVideoButton); waitUntilCameraOpened(); assertTrue(mPreview.isVideo()); Preview.VideoProfile profile = mPreview.getVideoProfile(); VideoProfile profile = mPreview.getVideoProfile(); CameraController.Size video_preview_size = mPreview.getCameraController().getPreviewSize(); //targetRatio = mPreview.getTargetRatioForPreview(display_size); targetRatio = mPreview.getTargetRatio(); Loading
app/src/main/java/net/sourceforge/opencamera/MainActivity.java +3 −2 Original line number Diff line number Diff line Loading @@ -3,6 +3,7 @@ package net.sourceforge.opencamera; import net.sourceforge.opencamera.CameraController.CameraController; import net.sourceforge.opencamera.CameraController.CameraControllerManager2; import net.sourceforge.opencamera.Preview.Preview; import net.sourceforge.opencamera.Preview.VideoProfile; import net.sourceforge.opencamera.UI.FolderChooserDialog; import net.sourceforge.opencamera.UI.MainUI; Loading Loading @@ -1336,7 +1337,7 @@ public class MainActivity extends Activity implements AudioListener.AudioListene if( preview.getVideoQualityHander().getCurrentVideoQuality() != null ) { bundle.putString("current_video_quality", preview.getVideoQualityHander().getCurrentVideoQuality()); } Preview.VideoProfile camcorder_profile = preview.getVideoProfile(); VideoProfile camcorder_profile = preview.getVideoProfile(); bundle.putInt("video_frame_width", camcorder_profile.videoFrameWidth); bundle.putInt("video_frame_height", camcorder_profile.videoFrameHeight); bundle.putInt("video_bit_rate", camcorder_profile.videoBitRate); Loading Loading @@ -2858,7 +2859,7 @@ public class MainActivity extends Activity implements AudioListener.AudioListene SharedPreferences sharedPreferences = PreferenceManager.getDefaultSharedPreferences(this); boolean simple = true; if( preview.isVideo() ) { Preview.VideoProfile profile = preview.getVideoProfile(); VideoProfile profile = preview.getVideoProfile(); String bitrate_string; if( profile.videoBitRate >= 10000000 ) bitrate_string = profile.videoBitRate/1000000 + "Mbps"; Loading
app/src/main/java/net/sourceforge/opencamera/MyApplicationInterface.java +3 −3 Original line number Diff line number Diff line Loading @@ -15,6 +15,7 @@ import java.util.TimerTask; import net.sourceforge.opencamera.CameraController.CameraController; import net.sourceforge.opencamera.Preview.ApplicationInterface; import net.sourceforge.opencamera.Preview.Preview; import net.sourceforge.opencamera.Preview.VideoProfile; import net.sourceforge.opencamera.UI.DrawPreview; import android.annotation.TargetApi; Loading @@ -29,7 +30,6 @@ import android.graphics.Paint; import android.graphics.Rect; import android.hardware.camera2.DngCreator; import android.location.Location; import android.media.CamcorderProfile; import android.media.Image; import android.media.MediaMetadataRetriever; import android.media.MediaRecorder; Loading Loading @@ -1325,7 +1325,7 @@ public class MyApplicationInterface implements ApplicationInterface { } @Override public void onVideoRecordStartError(Preview.VideoProfile profile) { public void onVideoRecordStartError(VideoProfile profile) { if( MyDebug.LOG ) Log.d(TAG, "onVideoRecordStartError"); String error_message; Loading @@ -1344,7 +1344,7 @@ public class MyApplicationInterface implements ApplicationInterface { } @Override public void onVideoRecordStopError(Preview.VideoProfile profile) { public void onVideoRecordStopError(VideoProfile profile) { if( MyDebug.LOG ) Log.d(TAG, "onVideoRecordStopError"); //main_activity.getPreview().showToast(null, R.string.failed_to_record_video); Loading
app/src/main/java/net/sourceforge/opencamera/Preview/ApplicationInterface.java +2 −2 Original line number Diff line number Diff line Loading @@ -113,8 +113,8 @@ public interface ApplicationInterface { void onPhotoError(); // callback for failing to take a photo void onVideoInfo(int what, int extra); // callback for info when recording video (see MediaRecorder.OnInfoListener) void onVideoError(int what, int extra); // callback for errors when recording video (see MediaRecorder.OnErrorListener) void onVideoRecordStartError(Preview.VideoProfile profile); // callback for video recording failing to start void onVideoRecordStopError(Preview.VideoProfile profile); // callback for video recording being corrupted void onVideoRecordStartError(VideoProfile profile); // callback for video recording failing to start void onVideoRecordStopError(VideoProfile profile); // callback for video recording being corrupted void onFailedReconnectError(); // failed to reconnect camera after stopping video recording void onFailedCreateVideoFileError(); // callback if unable to create file for recording video void hasPausedPreview(boolean paused); // called when the preview is paused or unpaused (due to getPausePreviewPref()) Loading
app/src/main/java/net/sourceforge/opencamera/Preview/Preview.java +0 −45 Original line number Diff line number Diff line Loading @@ -293,51 +293,6 @@ public class Preview implements SurfaceHolder.Callback, TextureView.SurfaceTextu public volatile boolean test_video_failure; public volatile boolean test_ticker_called; // set from MySurfaceView or CanvasView /** This is essentially similar to CamcorderProfile in that it encapsulates a set of video settings * to be passed to MediaRecorder, but allows us to create values without having to create a * CamcorderProfile (needed for slow motion / high speed video recording). */ public class VideoProfile { final CamcorderProfile camcorderProfile; public final int audioCodec; public final int fileFormat; public final int videoBitRate; public final int videoCodec; public final int videoFrameHeight; public final int videoFrameRate; public final int videoFrameWidth; VideoProfile(CamcorderProfile camcorderProfile) { this.camcorderProfile = camcorderProfile; this.audioCodec = camcorderProfile.audioCodec; this.fileFormat = camcorderProfile.fileFormat; this.videoBitRate = camcorderProfile.videoBitRate; this.videoCodec = camcorderProfile.videoCodec; this.videoFrameHeight = camcorderProfile.videoFrameHeight; this.videoFrameRate = camcorderProfile.videoFrameRate; this.videoFrameWidth = camcorderProfile.videoFrameWidth; } VideoProfile(int audioCodec, int fileFormat, int videoBitRate, int videoCodec, int videoFrameHeight, int videoFrameRate, int videoFrameWidth) { this.camcorderProfile = null; this.audioCodec = audioCodec; this.fileFormat = fileFormat; this.videoBitRate = videoBitRate; this.videoCodec = videoCodec; this.videoFrameHeight = videoFrameHeight; this.videoFrameRate = videoFrameRate; this.videoFrameWidth = videoFrameWidth; } /** Returns the CamcorderProfile this VideoProfile was created with, or null if it was not * created with a CamcorderProfile. */ CamcorderProfile getCamcorderProfile() { return this.camcorderProfile; } } public Preview(ApplicationInterface applicationInterface, ViewGroup parent) { if( MyDebug.LOG ) { Log.d(TAG, "new Preview"); Loading