Skip to content

Commit

Permalink
Static factory method to get default CaptureConfiguration
Browse files Browse the repository at this point in the history
  • Loading branch information
Jeroen Mols committed Mar 12, 2017
1 parent 23520da commit f87d402
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ public class CaptureConfigurationTest {

@Test
public void defaultConfiguration() throws Exception {
final CaptureConfiguration config = new CaptureConfiguration();
final CaptureConfiguration config = CaptureConfiguration.getDefault();

checkConfiguration(config, CaptureResolution.RES_720P.width, CaptureResolution.RES_720P.height,
CaptureResolution.RES_720P.getBitrate(CaptureQuality.HIGH), CaptureConfiguration.NO_DURATION_LIMIT,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -204,7 +204,7 @@ public void onSaveInstanceState(Bundle savedInstanceState) {
protected CaptureConfiguration generateCaptureConfiguration() {
CaptureConfiguration returnConfiguration = this.getIntent().getParcelableExtra(EXTRA_CAPTURE_CONFIGURATION);
if (returnConfiguration == null) {
returnConfiguration = new CaptureConfiguration();
returnConfiguration = CaptureConfiguration.getDefault();
CLog.d(CLog.ACTIVITY, "No captureconfiguration passed - using default configuration");
}
return returnConfiguration;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,10 @@ public class CaptureConfiguration implements Parcelable {
private int VIDEO_SOURCE = MediaRecorder.VideoSource.CAMERA;
private int VIDEO_ENCODER = MediaRecorder.VideoEncoder.H264;

public static CaptureConfiguration getDefault() {
return new CaptureConfiguration();
}

private CaptureConfiguration() {
// Default configuration
}
Expand Down

0 comments on commit f87d402

Please sign in to comment.