public class LocalVideoTrack extends VideoTrack
VideoCapturer
.Modifier and Type | Method and Description |
---|---|
void |
addRenderer(VideoRenderer videoRenderer)
Add a video renderer to get video from the video track.
|
static LocalVideoTrack |
create(android.content.Context context,
boolean enabled,
VideoCapturer videoCapturer)
Creates a local video track.
|
static LocalVideoTrack |
create(android.content.Context context,
boolean enabled,
VideoCapturer videoCapturer,
String name)
Creates a local video track.
|
static LocalVideoTrack |
create(android.content.Context context,
boolean enabled,
VideoCapturer videoCapturer,
VideoConstraints videoConstraints)
Creates a local video track.
|
static LocalVideoTrack |
create(android.content.Context context,
boolean enabled,
VideoCapturer videoCapturer,
VideoConstraints videoConstraints,
String name)
Creates a local video track.
|
void |
enable(boolean enabled)
Sets the state of the local video track.
|
String |
getName()
Returns the local video track name.
|
VideoCapturer |
getVideoCapturer()
Retrieves the
VideoCapturer associated with this video track. |
VideoConstraints |
getVideoConstraints()
Retrieves the video constraints associated with this track.
|
boolean |
isEnabled()
Check if the local video track is enabled.
|
void |
release()
Releases native memory owned by video track.
|
void |
removeRenderer(VideoRenderer videoRenderer)
Remove a video renderer to stop receiving video from the video track.
|
getRenderers
public static LocalVideoTrack create(android.content.Context context, boolean enabled, VideoCapturer videoCapturer)
VideoCapturer.getSupportedFormats()
to find the closest supported VideoFormat
to
640x480 at 30 frames per second. The closest format is used to apply default VideoConstraints
to the returned LocalVideoTrack
.context
- application context.enabled
- initial state of video track.videoCapturer
- capturer that provides video frames.public static LocalVideoTrack create(android.content.Context context, boolean enabled, VideoCapturer videoCapturer, VideoConstraints videoConstraints)
videoConstraints
compatible with videoCapturer
. Default constraints described in create(Context, boolean, VideoCapturer)
will be applied to the returned LocalVideoTrack
for the following conditions:
null
as videoConstraints
.
videoConstraints
are incompatible with videoCapturer
Video constraints are incompatible with a capturer if there is not at least one supported
VideoFormat
for which all the following conditions true:
VideoConstraints.minFps
and VideoConstraints.maxFps
are both less than
or equal supported capture format frame rate.
VideoConstraints.minVideoDimensions
width and height are less than or equal to
a supported capture format width and height.
VideoConstraints.maxVideoDimensions
width and height are greater than or equal
to a supported capture format width and height.
context
- application context.enabled
- initial state of video track.videoCapturer
- capturer that provides video frames.videoConstraints
- constraints to be applied on video track.public static LocalVideoTrack create(android.content.Context context, boolean enabled, VideoCapturer videoCapturer, String name)
VideoCapturer.getSupportedFormats()
to find the closest supported VideoFormat
to
640x480 at 30 frames per second. The closest format is used to apply default VideoConstraints
to the returned LocalVideoTrack
.context
- application context.enabled
- initial state of video track.videoCapturer
- capturer that provides video frames.name
- video track name.public static LocalVideoTrack create(android.content.Context context, boolean enabled, VideoCapturer videoCapturer, VideoConstraints videoConstraints, String name)
videoConstraints
compatible with videoCapturer
. Default constraints described in create(Context, boolean, VideoCapturer)
will be applied to the returned LocalVideoTrack
for the following conditions:
null
as videoConstraints
.
videoConstraints
are incompatible with videoCapturer
Video constraints are incompatible with a capturer if there is not at least one supported
VideoFormat
for which all the following conditions true:
VideoConstraints.minFps
and VideoConstraints.maxFps
are both less than
or equal supported capture format frame rate.
VideoConstraints.minVideoDimensions
width and height are less than or equal to
a supported capture format width and height.
VideoConstraints.maxVideoDimensions
width and height are greater than or equal
to a supported capture format width and height.
context
- application context.enabled
- initial state of video track.videoCapturer
- capturer that provides video frames.name
- video track name.public VideoCapturer getVideoCapturer()
VideoCapturer
associated with this video track.public VideoConstraints getVideoConstraints()
If you do not provide any video constraints, the default video constraints are set to a maximum video dimension size of 640x480 at a frame rate of 30 frames per second.
public void addRenderer(VideoRenderer videoRenderer)
VideoTrack
addRenderer
in class VideoTrack
videoRenderer
- video renderer that receives video.public void removeRenderer(VideoRenderer videoRenderer)
VideoTrack
removeRenderer
in class VideoTrack
videoRenderer
- the video renderer that should no longer receives video.public boolean isEnabled()
When the value is false, blank video frames are sent. When the value is true, frames from the video capturer are provided.
isEnabled
in interface Track
isEnabled
in class VideoTrack
public String getName()
getName
in interface Track
getName
in class VideoTrack
public void enable(boolean enabled)
enabled
- the desired state of the local video track.public void release()
5.13.0