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. |
static class |
BaseVideoCapturer.VideoContentHint
Defines the content hint settings for a video capturer.
|
Modifier and Type | Field and Description |
---|---|
static int |
ABGR
Defines the value for the ABGR pixel format used by the
BaseVideoCapturer.CaptureSettings.format property. |
static int |
ARGB
Defines the value for the ARGB pixel format used by the
BaseVideoCapturer.CaptureSettings.format property. |
static int |
BGRA
Defines the value for the BGRA pixel format used by the
BaseVideoCapturer.CaptureSettings.format property. |
static int |
MJPEG
Defines the value for the MJPEG pixel format used by the
BaseVideoCapturer.CaptureSettings.format property. |
static int |
NV12
Defines the value for the NV12 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. |
static int |
RGB
Defines the value for the RGB pixel format used by the
BaseVideoCapturer.CaptureSettings.format property. |
static int |
RGBA
Defines the value for the RGBA pixel format used by the
BaseVideoCapturer.CaptureSettings.format property. |
static int |
UYVY
Defines the value for the UYVY pixel format used by the
BaseVideoCapturer.CaptureSettings.format property. |
static int |
YUV420P
Defines the value for the YUV420P pixel format used by the
BaseVideoCapturer.CaptureSettings.format property. |
static int |
YUY2
Defines the value for the YUY2 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.
|
abstract BaseVideoCapturer.CaptureSettings |
getCaptureSettings()
Returns the settings for the video capturer.
|
BaseVideoCapturer.VideoContentHint |
getVideoContentHint()
Returns the video content hint setting.
|
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.
|
void |
onRestart()
Call this method when the activity is restarted.
|
abstract void |
onResume()
Call this method when the activity resumes.
|
void |
onStop()
Call this method when the activity stops.
|
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 |
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.
|
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.
|
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.
|
void |
provideByteArrayFrame(byte[] data,
int format,
int width,
int height,
int rotation,
boolean mirrorX)
Provide a frame of video as a byte array.
|
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.
|
void |
provideIntArrayFrame(int[] data,
int format,
int width,
int height,
int rotation,
boolean mirrorX)
Provide a frame of video as an array of integers.
|
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.
|
protected void |
setPublisherKit(PublisherKit publisher) |
void |
setVideoContentHint(BaseVideoCapturer.VideoContentHint contentHint)
Sets the video content hint.
|
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 static final int YUV420P
BaseVideoCapturer.CaptureSettings.format
property.public static final int NV12
BaseVideoCapturer.CaptureSettings.format
property.public static final int YUY2
BaseVideoCapturer.CaptureSettings.format
property.public static final int UYVY
BaseVideoCapturer.CaptureSettings.format
property.public static final int BGRA
BaseVideoCapturer.CaptureSettings.format
property.public static final int RGB
BaseVideoCapturer.CaptureSettings.format
property.public static final int MJPEG
BaseVideoCapturer.CaptureSettings.format
property.public static final int ABGR
BaseVideoCapturer.CaptureSettings.format
property.public static final int RGBA
BaseVideoCapturer.CaptureSettings.format
property.public void setVideoContentHint(BaseVideoCapturer.VideoContentHint contentHint)
BaseVideoCapturer.VideoContentHint
enum.
The default setting is BaseVideoCapturer.VideoContentHint.NONE
.
This is a beta feature.
contentHint
- The video content hint.public BaseVideoCapturer.VideoContentHint getVideoContentHint()
BaseVideoCapturer.VideoContentHint
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 onStop()
onRestart()
public void onRestart()
onStop()
public void provideByteArrayFrame(byte[] data, int format, int width, int height, int rotation, boolean mirrorX)
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).public void provideByteArrayFrame(byte[] data, int format, int width, int height, int rotation, boolean mirrorX, byte[] metadata)
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.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 provideIntArrayFrame(int[] data, int format, int width, int height, int rotation, boolean mirrorX, byte[] metadata)
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.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 provideBufferFrame(java.nio.ByteBuffer buffer, int format, int width, int height, int rotation, boolean mirrorX, byte[] metadata)
metadata
parameter, for including frame metadata.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.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)
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).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)
metadata
parameter, for including
frame metadata.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.protected void setPublisherKit(PublisherKit publisher)