public static class StreamConfig.Builder extends Object
Constructor and Description |
---|
Builder() |
Modifier and Type | Method and Description |
---|---|
StreamConfig |
build() |
StreamConfig.Builder |
camera(int camera)
Sets which is the default camera.
|
StreamConfig.Builder |
fitAllCamera(boolean fitAllCamera)
Sets if the final resolution should fit all camera in current device.
|
StreamConfig.Builder |
fps(int fps)
Sets the video frame rate in format frames/sec.
|
StreamConfig.Builder |
frontCameraFlipHorizontally(boolean flip)
If you enable this, you will stream the horizontally flipped screen of preview when you
use the
StreamConfig.CAMERA_FRONT . |
StreamConfig.Builder |
highestResolution(Resolution resolution)
Deprecated.
|
StreamConfig.Builder |
maxBitrate(Integer maxBitrate)
Sets the maximum video bitrate in bits/sec.
|
StreamConfig.Builder |
maxVideoHeight(int height)
Sets the max video height in pixel, which the video height will be limited by.
|
StreamConfig.Builder |
videoResolution(int width,
int height)
Sets video resolution for live stream, this means the resolution that audience can see.
|
public StreamConfig.Builder videoResolution(int width, int height)
StreamManager.prepare(StreamConfig, TextureView)
.width
- video widthheight
- video heighthighestResolution(Resolution)
,
fitAllCamera(boolean)
public StreamConfig.Builder fitAllCamera(boolean fitAllCamera)
videoResolution(int, int)
} is not called. The default value
is true.fitAllCamera
- true if you to enable this.@Deprecated public StreamConfig.Builder highestResolution(Resolution resolution)
maxVideoHeight(int)
videoResolution(int, int)
} is bigger than this, the
final resolution will be shrank to match the highest resolution with the sample aspect ratio.
The default value isResolution._720p
.resolution
- highest resolutionpublic StreamConfig.Builder maxVideoHeight(int height) throws IllegalArgumentException
profile of the live event
you want to stream to. For example, you should set the max video height to 360 if you
want to stream to a live event with profile Profile._360P
.
The default value 720 and min value is 240.height
- video height in pixelIllegalArgumentException
- if the height is less than 240public StreamConfig.Builder camera(int camera)
camera
- see StreamConfig.CAMERA_TYPE
public StreamConfig.Builder frontCameraFlipHorizontally(boolean flip)
StreamConfig.CAMERA_FRONT
. So, the preview you watch and the video audiences watch
won't the same. And the front camera always shows like a mirror. That means, the
audiences won't see everything like a mirror. It helps when you want to let your
audiences see the word. The default value is true.flip
- true if you want to enable thispublic StreamConfig.Builder fps(int fps) throws IllegalArgumentException
fps
- video frame rate in format frames/sec, can only be 20 or 30IllegalArgumentException
- if fps is invalidpublic StreamConfig.Builder maxBitrate(Integer maxBitrate) throws IllegalArgumentException
maxBitrate
- the video bitrate in bits/secIllegalArgumentException
- if max bitrate if invalidpublic StreamConfig build()