Class LocalVideoTrack

    • Method Detail

      • create

        @Nullable
        public static LocalVideoTrack create​(@NonNull
                                             android.content.Context context,
                                             boolean enabled,
                                             @NonNull
                                             VideoCapturer videoCapturer)
        Creates a local video track.

        If the capturer is an instance of VideoCapturer then VideoCapturer.startCapture(int, int, int) will be called with the result of VideoCapturer.getCaptureFormat(). This behavior allows VideoCapturer implementations to provide a better default capture format. For example, the ScreenCapturer provides a resolution derived from the device's screen dimensions.

        If the capturer is an instance of VideoCapturer then the default format of 640x480 at 30 FPS will be used.

        Parameters:
        context - application context.
        enabled - initial state of video track.
        videoCapturer - capturer that provides video frames.
        Returns:
        local video track if successfully added or null if video track could not be created.
      • create

        @Nullable
        public static LocalVideoTrack create​(@NonNull
                                             android.content.Context context,
                                             boolean enabled,
                                             @NonNull
                                             VideoCapturer videoCapturer,
                                             @Nullable
                                             VideoFormat videoFormat)
        Creates a local video track.

        The video capturer will be instructed to capture at the provided VideoFormat.

        Parameters:
        context - application context.
        enabled - initial state of video track.
        videoCapturer - capturer that provides video frames.
        videoFormat - format to capture frames.
        Returns:
        local video track if successfully added or null if video track could not be created.
      • create

        @Nullable
        public static LocalVideoTrack create​(@NonNull
                                             android.content.Context context,
                                             boolean enabled,
                                             @NonNull
                                             VideoCapturer videoCapturer,
                                             @Nullable
                                             java.lang.String name)
        Creates a local video track.

        If the capturer is an instance of VideoCapturer then VideoCapturer.startCapture(int, int, int) will be called with the result of VideoCapturer.getCaptureFormat(). This behavior allows VideoCapturer implementations to provide a better default capture format. For example, the ScreenCapturer provides a resolution derived from the device's screen dimensions.

        If the capturer is an instance of VideoCapturer then the default format of 640x480 at 30 FPS will be used.

        Parameters:
        context - application context.
        enabled - initial state of video track.
        videoCapturer - capturer that provides video frames.
        name - video track name.
        Returns:
        local video track if successfully added or null if video track could not be created.
      • create

        @Nullable
        public static LocalVideoTrack create​(@NonNull
                                             android.content.Context context,
                                             boolean enabled,
                                             @NonNull
                                             VideoCapturer videoCapturer,
                                             @Nullable
                                             VideoFormat videoFormat,
                                             @Nullable
                                             java.lang.String name)
        Creates a local video track.

        The video capturer will be instructed to capture at the provided VideoFormat.

        Parameters:
        context - application context.
        enabled - initial state of video track.
        videoCapturer - capturer that provides video frames.
        videoFormat - format to capture frames.
        name - video track name.
        Returns:
        local video track if successfully added or null if video track could not be created.
      • getVideoSource

        @NonNull
        public VideoSource getVideoSource()
        Returns the VideoSource associated with this video track.
      • addSink

        public void addSink​(@NonNull
                            VideoSink videoSink)
        Description copied from class: VideoTrack
        Add a video sink to receive frames from the video track.
        Overrides:
        addSink in class VideoTrack
        Parameters:
        videoSink - video sink that receives video.
      • removeSink

        public void removeSink​(@NonNull
                               VideoSink videoSink)
        Description copied from class: VideoTrack
        Remove a video sink to stop receiving video from the video track.
        Overrides:
        removeSink in class VideoTrack
        Parameters:
        videoSink - the video sink that should no longer receives video.
      • isEnabled

        public boolean isEnabled()
        Check if the local video track is enabled.

        When the value is false, blank video frames are sent. When the value is true, frames from the video capturer are provided.

        Specified by:
        isEnabled in interface Track
        Overrides:
        isEnabled in class VideoTrack
        Returns:
        true if the local video is enabled.
      • getName

        @NonNull
        public java.lang.String getName()
        Returns the local video track name. A pseudo random string is returned if no track name was specified.
        Specified by:
        getName in interface Track
        Overrides:
        getName in class VideoTrack
      • enable

        public void enable​(boolean enabled)
        Sets the state of the local video track. The results of this operation are signaled to other Participants in the same Room. When a video track is disabled, blank frames are sent in place of video frames from a video capturer.
        Parameters:
        enabled - the desired state of the local video track.
      • release

        public void release()
        Releases native memory owned by video track.