Class BaseVideoCapturer

    • Constructor Detail

      • BaseVideoCapturer

        public BaseVideoCapturer()
    • Method Detail

      • init

        public abstract void init()
        Initializes the video capturer.
      • startCapture

        public abstract int startCapture()
        Starts capturing video.
      • stopCapture

        public abstract int stopCapture()
        Stops capturing video.
      • destroy

        public abstract void destroy()
        Destroys the BaseVideoCapturer object.
      • isCaptureStarted

        public abstract boolean isCaptureStarted()
        Whether video is being captured (true) or not (false).
      • onPause

        public abstract void onPause()
        Call this method when the activity pauses. When you override this method, implement code to respond to the activity being paused. For example, you may pause capturing audio or video.
        See Also:
        onResume()
      • onResume

        public abstract void onResume()
        Call this method when the activity resumes. When you override this method, implement code to respond to the activity being resumed. For example, you may resume capturing audio or video.
        See Also:
        onPause()
      • onStop

        public void onStop()
        Call this method when the activity stops. When you override this method, implement code to respond to the activity being stopped. For example, you may release all the resources this capture owns like the camera capturing session.
        See Also:
        onRestart()
      • onRestart

        public void onRestart()
        Call this method when the activity is restarted. When you override this method, implement code to respond to the activity being restarted. For example, you may restart video capturing.
        See Also:
        onStop()
      • provideByteArrayFrame

        public void provideByteArrayFrame​(byte[] data,
                                          int format,
                                          int width,
                                          int height,
                                          int rotation,
                                          boolean mirrorX)
        Provide a frame of video as a byte array.
        Parameters:
        data - The video frame data, as a byte array.
        format - The video format, as defined by the ARGB and NV21 constants.
        width - The width of the video frame, in pixels.
        height - The height of the video frame, in pixels.
        rotation - The rotation of the video frame. Valid values are defined by constants in the android.view.Surface class.
        mirrorX - Whether to mirror the video on the x-axis (true) or not (false).
      • provideByteArrayFrame

        public void provideByteArrayFrame​(byte[] data,
                                          int format,
                                          int width,
                                          int height,
                                          int rotation,
                                          boolean mirrorX,
                                          byte[] metadata)
        Provide a frame of video as a byte array.
        Parameters:
        data - The video frame data, as a byte array.
        format - The video format, as defined by the ARGB and NV21 constants.
        width - The width of the video frame, in pixels.
        height - The height of the video frame, in pixels.
        rotation - The rotation of the video frame. Valid values are defined by constants in the android.view.Surface class.
        mirrorX - Whether to mirror the video on the x-axis (true) or not (false).
        metadata - The video frame metadata to be associated with the frame, as a byte array. The maximum size allowed is 32 bytes.
      • provideIntArrayFrame

        public void provideIntArrayFrame​(int[] data,
                                         int format,
                                         int width,
                                         int height,
                                         int rotation,
                                         boolean mirrorX)
        Provide a frame of video as an array of integers.
        Parameters:
        data - The video frame data, as an array of integers.
        format - The video format, as defined by the ARGB and NV21 constants.
        width - The width of the video frame, in pixels.
        height - The height of the video frame, in pixels.
        rotation - The rotation of the video frame. Valid values are defined by constants in the android.view.Surface class.
        mirrorX - Whether to mirror the video on the x-axis (true) or not (false).
      • provideIntArrayFrame

        public void provideIntArrayFrame​(int[] data,
                                         int format,
                                         int width,
                                         int height,
                                         int rotation,
                                         boolean mirrorX,
                                         byte[] metadata)
        Provide a frame of video as an array of integers.
        Parameters:
        data - The video frame data, as an array of integers.
        format - The video format, as defined by the ARGB and NV21 constants.
        width - The width of the video frame, in pixels.
        height - The height of the video frame, in pixels.
        rotation - The rotation of the video frame. Valid values are defined by constants in the android.view.Surface class.
        mirrorX - Whether to mirror the video on the x-axis (true) or not (false).
        metadata - The video frame metadata to be associated with the frame, as a byte array. The maximum size allowed is 32 bytes.
      • provideBufferFrame

        public void provideBufferFrame​(java.nio.ByteBuffer buffer,
                                       int format,
                                       int width,
                                       int height,
                                       int rotation,
                                       boolean mirrorX)
        Provide a frame of video as a byte buffer.
        Parameters:
        buffer - The video frame data, as a byte buffer.
        format - The video format, as defined by the ARGB and NV21 constants.
        width - The width of the video frame, in pixels.
        height - The height of the video frame, in pixels.
        rotation - The rotation of the video frame. Valid values are defined by constants in the android.view.Surface class.
        mirrorX - Whether to mirror the video on the x-axis (true) or not (false).
      • provideBufferFrame

        public void provideBufferFrame​(java.nio.ByteBuffer buffer,
                                       int format,
                                       int width,
                                       int height,
                                       int rotation,
                                       boolean mirrorX,
                                       byte[] metadata)
        Provide a frame of video as a byte buffer. This version of the method includes a metadata parameter, for including frame metadata.
        Parameters:
        buffer - The video frame data, as a byte buffer.
        format - The video format, as defined by the ARGB and NV21 constants.
        width - The width of the video frame, in pixels.
        height - The height of the video frame, in pixels.
        rotation - The rotation of the video frame. Valid values are defined by constants in the android.view.Surface class.
        mirrorX - Whether to mirror the video on the x-axis (true) or not (false).
        metadata - The video frame metadata to be associated with the frame, as a byte array. The maximum size allowed is 32 bytes.
      • provideBufferFramePlanar

        public void provideBufferFramePlanar​(java.nio.ByteBuffer yplane,
                                             java.nio.ByteBuffer uplane,
                                             java.nio.ByteBuffer vplane,
                                             int yPixelStride,
                                             int yRowStride,
                                             int uPixelStride,
                                             int uRowStride,
                                             int vPixelStride,
                                             int vRowStride,
                                             int width,
                                             int height,
                                             int rotation,
                                             boolean mirrorX)
        Provide a frame of video as 3 bytebuffer planes.
        Parameters:
        yplane - The y video frame data, as a byte buffer.
        uplane - The u video frame data, as a byte buffer.
        vplane - The v video frame data, as a byte buffer.
        yPixelStride - The y pixel stride, in bytes.
        yRowStride - The y row stride, in bytes.
        uPixelStride - The u pixel stride, in bytes.
        uRowStride - The u row stride, in bytes.
        vPixelStride - The v pixel stride, in bytes.
        vRowStride - The v row stride, in bytes.
        width - The width of the video frame, in pixels.
        height - The height of the video frame, in pixels.
        rotation - The rotation of the video frame. Valid values are defined by constants in the android.view.Surface class.
        mirrorX - Whether to mirror the video on the x-axis (true) or not (false).
      • provideBufferFramePlanar

        public void provideBufferFramePlanar​(java.nio.ByteBuffer yplane,
                                             java.nio.ByteBuffer uplane,
                                             java.nio.ByteBuffer vplane,
                                             int yPixelStride,
                                             int yRowStride,
                                             int uPixelStride,
                                             int uRowStride,
                                             int vPixelStride,
                                             int vRowStride,
                                             int width,
                                             int height,
                                             int rotation,
                                             boolean mirrorX,
                                             byte[] metadata)
        Provide a frame of video as 3 bytebuffer planes. This version of the method includes a metadata parameter, for including frame metadata.
        Parameters:
        yplane - The y video frame data, as a byte buffer.
        uplane - The u video frame data, as a byte buffer.
        vplane - The v video frame data, as a byte buffer.
        yPixelStride - The y pixel stride, in bytes.
        yRowStride - The y row stride, in bytes.
        uPixelStride - The u pixel stride, in bytes.
        uRowStride - The u row stride, in bytes.
        vPixelStride - The v pixel stride, in bytes.
        vRowStride - The v row stride, in bytes.
        width - The width of the video frame, in pixels.
        height - The height of the video frame, in pixels.
        rotation - The rotation of the video frame. Valid values are defined by constants in the android.view.Surface class.
        mirrorX - Whether to mirror the video on the x-axis (true) or not (false).
        metadata - The video frame metadata to be associated with the frame, as a byte array. The maximum size allowed is 32 bytes.
      • setPublisherKit

        protected void setPublisherKit​(PublisherKit publisher)