Skip to content

Commit

Permalink
fix force fps limit in prepareVideo
Browse files Browse the repository at this point in the history
  • Loading branch information
pedroSG94 committed Dec 2, 2024
1 parent aaf2244 commit ec02c81
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions library/src/main/java/com/pedro/library/base/StreamBase.kt
Original file line number Diff line number Diff line change
Expand Up @@ -140,8 +140,10 @@ abstract class StreamBase(
iFrameInterval, FormatVideoEncoder.SURFACE, profile, level)
if (!result) return false
}
return videoEncoder.prepareVideoEncoder(width, height, fps, bitrate, rotation,
val result = videoEncoder.prepareVideoEncoder(width, height, fps, bitrate, rotation,
iFrameInterval, FormatVideoEncoder.SURFACE, profile, level)
forceFpsLimit(true)
return result
}
return false
}
Expand Down Expand Up @@ -205,9 +207,9 @@ abstract class StreamBase(

/**
* Force stream to work with fps selected in prepareVideo method. Must be called before prepareVideo.
* This is not recommend because could produce fps problems.
* Must be called after prepareVideo
*
* @param enabled true to enabled, false to disable, disabled by default.
* @param enabled true to enabled, false to disable, enabled by default.
*/
fun forceFpsLimit(enabled: Boolean) {
val fps = if (enabled) videoEncoder.fps else 0
Expand Down

0 comments on commit ec02c81

Please sign in to comment.