public abstract class BaseVideoCapturer
extends java.lang.Object
PublisherKit
object.PublisherKit.getCapturer()
Modifier and Type | Class and Description |
---|---|
static class |
BaseVideoCapturer.CaptureSettings
Defines the capture settings for a video capturer.
|
static interface |
BaseVideoCapturer.CaptureSwitch
An interface for defining how the
BaseVideoCapturer.CaptureSwitch.cycleCamera()
method of a Publisher object that implements a custom video capturer. |
Modifier and Type | Field and Description |
---|---|
static int |
ARGB
Defines the value for the ARGB pixel format used by the
BaseVideoCapturer.CaptureSettings.format property. |
static int |
NV21
Defines the value for the NV21 pixel format used by the
BaseVideoCapturer.CaptureSettings.format property. |
Constructor and Description |
---|
BaseVideoCapturer() |
Modifier and Type | Method and Description |
---|---|
abstract void |
destroy()
Destroys the BaseVideoCapturer object.
|
protected void |
finalize() |
abstract BaseVideoCapturer.CaptureSettings |
getCaptureSettings()
Returns the settings for the video capturer.
|
abstract void |
init()
Initializes the video capturer.
|
abstract boolean |
isCaptureStarted()
Whether video is being captured (true) or not (false).
|
abstract void |
onPause()
Call this method when the activity pauses.
|
abstract void |
onResume()
Call this method when the activity resumes.
|
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.
|
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) |
void |
provideByteArrayFrame(byte[] data,
int format,
int width,
int height,
int rotation,
boolean mirrorX)
Provide a frame of video as a byte array.
|
void |
provideIntArrayFrame(int[] data,
int format,
int width,
int height,
int rotation,
boolean mirrorX)
Provide a frame of video as an array of integers.
|
protected void |
setPublisherKit(PublisherKit publisher) |
abstract int |
startCapture()
Starts capturing video.
|
abstract int |
stopCapture()
Stops capturing video.
|
public static final int NV21
BaseVideoCapturer.CaptureSettings.format
property.public static final int ARGB
BaseVideoCapturer.CaptureSettings.format
property.public abstract void init()
public abstract int startCapture()
public abstract int stopCapture()
public abstract void destroy()
public abstract boolean isCaptureStarted()
public abstract BaseVideoCapturer.CaptureSettings getCaptureSettings()
public abstract void onPause()
onResume()
public abstract void onResume()
onPause()
public void provideByteArrayFrame(byte[] data, int format, int width, int height, int rotation, boolean mirrorX)
data
- The video frame data, as 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).public void provideIntArrayFrame(int[] data, int format, int width, int height, int rotation, boolean mirrorX)
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).public void provideBufferFrame(java.nio.ByteBuffer buffer, int format, int width, int height, int rotation, boolean mirrorX)
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).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)
protected void finalize() throws java.lang.Throwable
finalize
in class java.lang.Object
java.lang.Throwable
protected void setPublisherKit(PublisherKit publisher)