Skip to content

Commit

Permalink
add rotation to streamBase prepareVideo
Browse files Browse the repository at this point in the history
  • Loading branch information
pedroSG94 committed Nov 2, 2023
1 parent ed8c6d9 commit 6e864a3
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 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 @@ -84,11 +84,12 @@ abstract class StreamBase(
*/
@JvmOverloads
fun prepareVideo(width: Int, height: Int, bitrate: Int, fps: Int = 30, iFrameInterval: Int = 2,
avcProfile: Int = -1, avcProfileLevel: Int = -1): Boolean {
rotation: Int = 0, avcProfile: Int = -1, avcProfileLevel: Int = -1): Boolean {
val videoResult = videoManager.createVideoManager(width, height, fps)
if (videoResult) {
glInterface.setEncoderSize(width, height)
return videoEncoder.prepareVideoEncoder(width, height, fps, bitrate, 0,
if (rotation == 90 || rotation == 270) glInterface.setEncoderSize(height, width)
else glInterface.setEncoderSize(width, height) //0, 180
return videoEncoder.prepareVideoEncoder(width, height, fps, bitrate, rotation,
iFrameInterval, FormatVideoEncoder.SURFACE, avcProfile, avcProfileLevel)
}
return videoResult
Expand Down

0 comments on commit 6e864a3

Please sign in to comment.