Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions app/src/main/java/com/tgc/sky/SystemIO_android.java
Original file line number Diff line number Diff line change
Expand Up @@ -647,7 +647,7 @@ public boolean StartRecording(String str, int i, int i2, int i3, boolean z, int
if (this.m_videoRecorder == null) {
return false;
}
return this.m_videoRecorder.startRecordingWithFilename(str, i, i2, str2, i4, z2, i5, z3);
return this.m_videoRecorder.startRecordingWithFilename(str, i, i2, str2, i4, z2, i5, z3, z4);
}

public boolean StartRecording(String str, int i, int i2, int i3, boolean z, int i4, boolean z2, int i5, boolean z3) {
Expand All @@ -664,7 +664,7 @@ public boolean StartRecording(String str, int i, int i2, int i3, int i4, boolean
if (this.m_videoRecorder == null) {
return false;
}
return this.m_videoRecorder.startRecordingWithFilename(str, i, i2, str2, i4, z, i5, z2);
return this.m_videoRecorder.startRecordingWithFilename(str, i, i2, str2, i4, z, i5, z2, false);
}


Expand Down
11 changes: 6 additions & 5 deletions app/src/main/java/com/tgc/sky/ui/NtVideoRecorder.java
Original file line number Diff line number Diff line change
Expand Up @@ -280,13 +280,14 @@ private boolean createVideoCodec(String str, int i, int i2) {
}
}

private boolean createAudioCodec() {
this.m_audioByteBuffer = ByteBuffer.allocateDirect(2048);
private boolean createAudioCodec(boolean z) {
int i = z ? 1024 : 2048;
this.m_audioByteBuffer = ByteBuffer.allocateDirect(i);
this.m_audioBufferInfo = new MediaCodec.BufferInfo();
MediaFormat createAudioFormat = MediaFormat.createAudioFormat("audio/mp4a-latm", 24000, 2);
createAudioFormat.setInteger("bitrate", 768000);
createAudioFormat.setInteger("aac-profile", 2);
createAudioFormat.setInteger("max-input-size", 2048);
createAudioFormat.setInteger("max-input-size", i);
try {
MediaCodec createEncoderByType = MediaCodec.createEncoderByType("audio/mp4a-latm");
this.m_audioCodec = createEncoderByType;
Expand All @@ -297,7 +298,7 @@ private boolean createAudioCodec() {
}
}

public boolean startRecordingWithFilename(String str, int i, int i2, String str2, int i3, boolean z, int i4, boolean z2) {
public boolean startRecordingWithFilename(String str, int i, int i2, String str2, int i3, boolean z, int i4, boolean z2, boolean z3) {
if (this.m_isRecording || str == null || !str.endsWith(".mp4")) {
return false;
}
Expand All @@ -309,7 +310,7 @@ public boolean startRecordingWithFilename(String str, int i, int i2, String str2
if (findCurrentFileName == "" || !createOrRecreateFile(findCurrentFileName) || !createVideoCodec(findCurrentFileName, i3, i4)) {
return false;
}
if (this.m_isRecordAudio && !createAudioCodec()) {
if (this.m_isRecordAudio && !createAudioCodec(z3)) {
return false;
}
this.m_videoCodec.start();
Expand Down
Loading