Public Member Functions | |
boolean | onInitialize (IVideoFrameConsumer consumer) |
boolean | onStart () |
void | onStop () |
void | onDispose () |
int | getBufferType () |
int | getCaptureType () |
int | getContentHint () |
The IVideoSource interface. Used when calling setVideoSource
to set a custom video source.
boolean io.agora.rtc.mediaio.IVideoSource.onInitialize | ( | IVideoFrameConsumer | consumer | ) |
Notification for initializing the custom video source.
The SDK triggers this callback to remind you to initialize the custom video source. After receiving this callback, you can do some preparation, such as enabling the camera, and then use the return value to tell the SDK whether the custom video source is prepared.
getBufferType
method and pass the video source in the specified type to the SDK.consumer | An IVideoFrameConsumer object that the SDK passes to you. You need to reserve this object and use it to send the video frame to the SDK once the custom video source is started. |
true
: The custom video source is initialized.false
: The custom video source is not ready or fails to initialize. The SDK stops and reports the error. boolean io.agora.rtc.mediaio.IVideoSource.onStart | ( | ) |
Notification for starting the custom video source.
The SDK triggers this callback to remind you to start the custom video source for capturing video. The SDK uses IVideoFrameConsumer
to receive the video frame that you capture after the video source is started. You must use the return value to tell the SDK whether the custom video source is started.
true
: The custom video source is started.false
: The custom video source fails to start. The SDK stops and reports the error. void io.agora.rtc.mediaio.IVideoSource.onStop | ( | ) |
Notification for stopping capturing video.
The SDK triggers this callback to remind you to stop capturing video. This callback tells you that the SDK is about to stop using IVideoFrameConsumer
to receive the video frame that you capture.
void io.agora.rtc.mediaio.IVideoSource.onDispose | ( | ) |
Notification for disabling the custom video source.
The SDK triggers this callback to remind you to disable the custom video source device. This callback tells you that the SDK is about to release the IVideoFrameConsumer
object. Ensure that you no longer use IVideoFrameConsumer
after receiving this callback.
int io.agora.rtc.mediaio.IVideoSource.getBufferType | ( | ) |
Gets the video frame type.
Before you initialize the custom video source, the SDK triggers this callback to query the video frame type. You must specify the video frame type in the return value and then pass it to the SDK.
Video buffer type
. int io.agora.rtc.mediaio.IVideoSource.getCaptureType | ( | ) |
Gets the capture type of the custom video source.
Before you initialize the custom video source, the SDK triggers this callback to query the capture type of the video source. You must specify the capture type in the return value and then pass it to the SDK. The SDK enables the corresponding video processing algorithm according to the capture type after receiving the video frame.
Video capture type
. int io.agora.rtc.mediaio.IVideoSource.getContentHint | ( | ) |
Gets the content hint of the custom video source.
If you specify the custom video source as a screen-sharing video, the SDK triggers this callback to query the content hint of the video source before you initialize the video source. You must specify the content hint in the return value and then pass it to the SDK. The SDK enables the corresponding video processing algorithm according to the content hint after receiving the video frame.
Video content hint
.