Skip to content
Open
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
11 changes: 10 additions & 1 deletion common/src/main/java/com/pedro/common/Extensions.kt
Original file line number Diff line number Diff line change
Expand Up @@ -149,7 +149,16 @@ fun Throwable.validMessage(): String {
return (message ?: "").ifEmpty { javaClass.simpleName }
}

fun MediaCodec.BufferInfo.toMediaFrameInfo() = MediaFrame.Info(offset, size, presentationTimeUs, isKeyframe())
fun MediaCodec.BufferInfo.toMediaFrameInfo() = MediaFrame.Info(offset, size, presentationTimeUs, isKeyframe(), flags)

fun MediaFrame.Info.toMediaCodecBufferInfo() = MediaCodec.BufferInfo().apply {
set(
this@toMediaCodecBufferInfo.offset,
this@toMediaCodecBufferInfo.size,
this@toMediaCodecBufferInfo.timestamp,
this@toMediaCodecBufferInfo.flags
)
}

fun ByteBuffer.clone(): ByteBuffer = ByteBuffer.wrap(toByteArray())

Expand Down
3 changes: 2 additions & 1 deletion common/src/main/java/com/pedro/common/frame/MediaFrame.kt
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,8 @@ data class MediaFrame(
val offset: Int,
val size: Int,
val timestamp: Long,
val isKeyFrame: Boolean
val isKeyFrame: Boolean,
val flags: Int = 0
)

enum class Type {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ public abstract class BaseRecordController implements RecordController {

protected static final String TAG = "RecordController";

protected Status status = Status.STOPPED;
protected volatile Status status = Status.STOPPED;
protected VideoCodec videoCodec = VideoCodec.H264;
protected AudioCodec audioCodec = AudioCodec.AAC;
protected long pauseMoment = 0;
Expand Down

This file was deleted.

Loading