Skip to content

Commit 05616f0

Browse files
ラムダ形式になっていない箇所の修正。
1 parent ac60cbe commit 05616f0

1 file changed

Lines changed: 10 additions & 19 deletions

File tree

  • dConnectDevicePlugin/dConnectDeviceHost/app/src/main/java/org/deviceconnect/android/deviceplugin/host/recorder/camera

dConnectDevicePlugin/dConnectDeviceHost/app/src/main/java/org/deviceconnect/android/deviceplugin/host/recorder/camera/DefaultSurfaceRecorder.java

Lines changed: 10 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -101,6 +101,7 @@ private void setUpMediaRecorder(final File outputFile) throws IOException {
101101
mMediaRecorder.setVideoSource(MediaRecorder.VideoSource.SURFACE);
102102
mMediaRecorder.setOutputFormat(MediaRecorder.OutputFormat.MPEG_4);
103103
mMediaRecorder.setOutputFile(outputFile.getAbsolutePath());
104+
104105
mMediaRecorder.setVideoEncodingBitRate(10000000);
105106
mMediaRecorder.setVideoFrameRate(30);
106107
mMediaRecorder.setVideoSize(mVideoSize.getWidth(), mVideoSize.getHeight());
@@ -163,25 +164,17 @@ public synchronized void start(final OnRecordingStartListener listener) {
163164
Runnable r;
164165
if (!mIsRecording) {
165166
mIsRecording = true;
166-
r = new Runnable() {
167-
@Override
168-
public void run() {
169-
try {
170-
setUpMediaRecorder(mOutputFile);
171-
mMediaRecorder.start();
172-
listener.onRecordingStart();
173-
} catch (IllegalStateException | IOException e) {
174-
listener.onRecordingStartError(e);
175-
}
176-
}
177-
};
178-
} else {
179-
r = new Runnable() {
180-
@Override
181-
public void run() {
167+
r = () -> {
168+
try {
169+
setUpMediaRecorder(mOutputFile);
170+
mMediaRecorder.start();
182171
listener.onRecordingStart();
172+
} catch (IllegalStateException | IOException e) {
173+
listener.onRecordingStartError(e);
183174
}
184175
};
176+
} else {
177+
r = listener::onRecordingStart;
185178
}
186179
mRecorderThread.post(r);
187180
}
@@ -197,9 +190,7 @@ public synchronized void stop(final OnRecordingStopListener listener) {
197190
listener.onRecordingStop();
198191
};
199192
} else {
200-
r = () -> {
201-
listener.onRecordingStop();
202-
};
193+
r = listener::onRecordingStop;
203194
}
204195
mRecorderThread.post(r);
205196
}

0 commit comments

Comments
 (0)