Agora Java API Reference for Android
Public Member Functions | Static Public Member Functions | List of all members
io.agora.streaming.internal.StreamingKitImpl Class Reference
Inheritance diagram for io.agora.streaming.internal.StreamingKitImpl:
io.agora.streaming.StreamingKit

Public Member Functions

 StreamingKitImpl (StreamingContext streamingContext) throws Exception
 
synchronized void doDestroy ()
 
synchronized int enableAudioRecording (boolean enabled)
 
synchronized int enableVideoCapturing (boolean enabled)
 
synchronized int startStreaming (String publishUrl)
 
synchronized int stopStreaming ()
 
synchronized int muteAudioStream (boolean muted)
 
synchronized int muteVideoStream (boolean muted)
 
synchronized int setAudioStreamConfiguration (AudioStreamConfiguration config)
 
synchronized int setVideoStreamConfiguration (VideoStreamConfiguration config)
 
synchronized int switchResolution (int width, int height)
 
synchronized int switchCamera ()
 
synchronized int snapshot (SnapshotCallback snapshotCallback)
 
synchronized boolean addVideoFilter (VideoFilter videoFilter)
 
synchronized boolean removeVideoFilter (VideoFilter videoFilter)
 
synchronized int adjustRecordingSignalVolume (int volume)
 
synchronized AgoraCameraCapturer getCameraCapture ()
 
synchronized VideoPreviewRenderer getVideoPreviewRenderer ()
 
synchronized int registerVideoFrameObserver (VideoFrameObserver observer)
 
synchronized void unregisterVideoFrameObserver (VideoFrameObserver observer)
 
synchronized int registerAudioFrameObserver (AudioFrameObserver observer)
 
synchronized void unregisterAudioFrameObserver (AudioFrameObserver observer)
 
synchronized int setLogFile (String filePath)
 
synchronized int setLogFilter (@LogFilter int filter)
 
synchronized int setLogFileSize (int fileSizeInKBytes)
 
int startScreenCapture (Intent intent, int width, int height)
 
void stopScreenCapture ()
 

Static Public Member Functions

static synchronized boolean initializeNativeLibs ()
 
static native String nativeGetSdkVersion ()
 
- Static Public Member Functions inherited from io.agora.streaming.StreamingKit
static synchronized StreamingKit create (StreamingContext streamingContext) throws Exception
 
static synchronized void destroy ()
 
static String getSdkVersion ()
 

Member Function Documentation

◆ enableAudioRecording()

synchronized int io.agora.streaming.internal.StreamingKitImpl.enableAudioRecording ( boolean  enabled)

Enables or disables audio recording.

Parameters
enabledDetermines whether to disable or re-enable audio recording:
  • true: (Default) Re-enable audio recording.
  • false: Disable audio recording.
Returns
  • 0: Success.
  • < 0: Failure.

Reimplemented from io.agora.streaming.StreamingKit.

◆ enableVideoCapturing()

synchronized int io.agora.streaming.internal.StreamingKitImpl.enableVideoCapturing ( boolean  enabled)

Enables or disables video capturing.

Parameters
enabledDetermines whether to disable or re-enable video capturing:
  • true: (Default) Re-enable video capturing.
  • false: Disable video capturing.
Returns
  • 0: Success.
  • < 0: Failure.

Reimplemented from io.agora.streaming.StreamingKit.

◆ startStreaming()

synchronized int io.agora.streaming.internal.StreamingKitImpl.startStreaming ( String  publishUrl)

Start media streaming

Parameters
publishUrlThe CDN streaming URL in the RTMP format. The maximum length of this parameter is 1024 bytes. The URL address must not contain special characters, such as Chinese language characters.
Returns
  • 0: Success.
  • < 0: Failure.

Reimplemented from io.agora.streaming.StreamingKit.

◆ stopStreaming()

synchronized int io.agora.streaming.internal.StreamingKitImpl.stopStreaming ( )

stop media streaming

Returns
  • 0: Success.
  • < 0: Failure.

Reimplemented from io.agora.streaming.StreamingKit.

◆ muteAudioStream()

synchronized int io.agora.streaming.internal.StreamingKitImpl.muteAudioStream ( boolean  muted)

Stops or resumes publishing the audio stream.

Parameters
mutedDetermines whether to publish or stop publishing the audio stream:
  • true: Stop publishing the audio stream.
  • false: (Default) Publish the audio stream.
Returns
  • 0: Success.
  • < 0: Failure.

Reimplemented from io.agora.streaming.StreamingKit.

◆ muteVideoStream()

synchronized int io.agora.streaming.internal.StreamingKitImpl.muteVideoStream ( boolean  muted)

Stops or resumes publishing the video stream.

Parameters
mutedDetermines whether to publish or stop publishing the video stream:
  • true: Stop publishing the video stream.
  • false: (Default) Publish the video stream.
Returns
  • 0: Success.
  • < 0: Failure.

Reimplemented from io.agora.streaming.StreamingKit.

◆ switchResolution()

synchronized int io.agora.streaming.internal.StreamingKitImpl.switchResolution ( int  width,
int  height 
)

Sets the audio stream configuration.

Each configuration corresponds to a set of audio parameters, including the audio sample rate, bytes per sample, number of channels, and bitrate.

Parameters
configThe audio stream configuration: AudioStreamConfiguration.
Returns
  • 0: Success.
  • < 0: Failure. Sets the video stream configuration.

Each configuration corresponds to a set of video parameters, including the resolution, frame rate, and bitrate.

Parameters
configThe video stream configuration: VideoStreamConfiguration.
Returns
  • 0: Success.
  • < 0: Failure. Switches video resolution when pushing stream.

Minimum resolution support 64*64 Maximum resolution support 1920*1080

Parameters
widthThe width of video stream
heightThe height of video stream
Returns
  • 0: Success.
  • < 0: Failure.

Reimplemented from io.agora.streaming.StreamingKit.

◆ switchCamera()

synchronized int io.agora.streaming.internal.StreamingKitImpl.switchCamera ( )

Switches between front and rear cameras.

Note
This method applies to Android and iOS only.
Returns
  • 0: Success.
  • < 0: Failure.

Reimplemented from io.agora.streaming.StreamingKit.

◆ snapshot()

synchronized int io.agora.streaming.internal.StreamingKitImpl.snapshot ( SnapshotCallback  snapshotCallback)

snapshot a video frame when pushing stream.

@notes This method just callback onSnapshot of bitmap once.

Parameters
snapshotCallbackThe width of video stream
Returns
  • 0: Success.
  • < 0: Failure.

Reimplemented from io.agora.streaming.StreamingKit.

◆ addVideoFilter()

synchronized boolean io.agora.streaming.internal.StreamingKitImpl.addVideoFilter ( VideoFilter  videoFilter)

Adds a video filter to the video track.

Parameters
videoFilterThe video filter that you want to add to the video track: VideoFilter.
Returns
  • true: The video filter is added successfully.
  • false: The video filter fails to be added.

Reimplemented from io.agora.streaming.StreamingKit.

◆ removeVideoFilter()

synchronized boolean io.agora.streaming.internal.StreamingKitImpl.removeVideoFilter ( VideoFilter  videoFilter)

Removes the video filter added by addVideoFilter() from the video track.

Parameters
videoFilterThe video filter that you want to remove.
Returns
  • true: The video filter is removed successfully.
  • false: The video filter fails to be removed.

Reimplemented from io.agora.streaming.StreamingKit.

◆ adjustRecordingSignalVolume()

synchronized int io.agora.streaming.internal.StreamingKitImpl.adjustRecordingSignalVolume ( int  volume)

Adjusts the recording volume.

Parameters
volumeThe recording volume, which ranges from 0 to 400:
  • 0: Mute the recoridng volume.
  • 100: The Original volume.
  • 400: (Maximum) Four times the original volume with signal clipping protection.
Returns
  • 0: Success.
  • < 0: Failure.

Reimplemented from io.agora.streaming.StreamingKit.

◆ getCameraCapture()

synchronized AgoraCameraCapturer io.agora.streaming.internal.StreamingKitImpl.getCameraCapture ( )

Get the camera capturer

Returns
  • Returns an CameraCapturer object (single instance) that provides the method to manger the camera capturer when the call succeeds.
  • Returns null when the call fails.

Reimplemented from io.agora.streaming.StreamingKit.

◆ getVideoPreviewRenderer()

synchronized VideoPreviewRenderer io.agora.streaming.internal.StreamingKitImpl.getVideoPreviewRenderer ( )

Get the video preview renderer

Returns
  • Returns an VideoPreviewRenderer object (single instance) that provides the method to manger the video preview rendering when the call succeeds.
  • Returns null when the call fails.

Reimplemented from io.agora.streaming.StreamingKit.

◆ registerVideoFrameObserver()

synchronized int io.agora.streaming.internal.StreamingKitImpl.registerVideoFrameObserver ( VideoFrameObserver  observer)

Registers a video frame observer object.

Parameters
observerA VideoFrameObserver object.
Returns
  • 0: Success.
  • < 0: Failure.

Reimplemented from io.agora.streaming.StreamingKit.

◆ unregisterVideoFrameObserver()

synchronized void io.agora.streaming.internal.StreamingKitImpl.unregisterVideoFrameObserver ( VideoFrameObserver  observer)

Unregisters a video frame observer object.

Parameters
observerA VideoFrameObserver object.

Reimplemented from io.agora.streaming.StreamingKit.

◆ registerAudioFrameObserver()

synchronized int io.agora.streaming.internal.StreamingKitImpl.registerAudioFrameObserver ( AudioFrameObserver  observer)

Registers an audio frame observer object.

Parameters
observerAn AudioFrameObserver object.
Returns
  • 0: Success.
  • < 0: Failure.

Reimplemented from io.agora.streaming.StreamingKit.

◆ unregisterAudioFrameObserver()

synchronized void io.agora.streaming.internal.StreamingKitImpl.unregisterAudioFrameObserver ( AudioFrameObserver  observer)

Unregisters an audio frame observer object.

Parameters
observerAn AudioFrameObserver object.

Reimplemented from io.agora.streaming.StreamingKit.

◆ setLogFile()

synchronized int io.agora.streaming.internal.StreamingKitImpl.setLogFile ( String  filePath)

Specifies an output log file for the streaming kit.

The log file records all log data for the kit's operation. Ensure that the directory for the log file exists and is writable.

Note
Ensure that you call this method immediately after create, or the output log may not be complete.
Parameters
filePathFile path of the log file.
Returns
  • 0: Success.
  • < 0: Failure.

Reimplemented from io.agora.streaming.StreamingKit.

◆ setLogFilter()

synchronized int io.agora.streaming.internal.StreamingKitImpl.setLogFilter ( @LogFilter int  filter)

Sets the output log level of the kit.

You can use one or a combination of the filters. The log level follows the sequence of OFF, CRITICAL, ERROR, WARNING, INFO, and DEBUG. Choose a level and you will see logs preceding that level. For example, if you set the log level to WARNING, you see the logs within levels CRITICAL, ERROR, and WARNING.

Parameters
filterSets the log filter level:
  • LOG_FILTER_DEBUG: Output all API logs. Set your log filter as DEBUG if you want to get the most complete log file.
  • LOG_FILTER_INFO: Output logs of the CRITICAL, ERROR, WARNING, and INFO level. We recommend setting your log filter as this level.
  • LOG_FILTER_WARNING: Output logs of the CRITICAL, ERROR, and WARNING level.
  • LOG_FILTER_ERROR: Output logs of the CRITICAL and ERROR level.
  • LOG_FILTER_CRITICAL: Output logs of the CRITICAL level.
  • LOG_FILTER_OFF: Do not output any log.
Returns
  • 0: Success.
  • < 0: Failure.

Reimplemented from io.agora.streaming.StreamingKit.

◆ setLogFileSize()

synchronized int io.agora.streaming.internal.StreamingKitImpl.setLogFileSize ( int  fileSizeInKBytes)

Sets the log file size (KB).

The SDK has two log files, each with a default size of 512 KB. If you set fileSizeInBytes as 1024 KB, the SDK outputs log files with a total maximum size of 2 MB. If the total size of the log files exceed the set value, the new output log files overwrite the old output log files.

Parameters
fileSizeInKBytesThe SDK log file size (KB).
Returns
  • 0: Success.
  • <0: Failure.

Reimplemented from io.agora.streaming.StreamingKit.

◆ startScreenCapture()

int io.agora.streaming.internal.StreamingKitImpl.startScreenCapture ( Intent  intent,
int  width,
int  height 
)

start screen capture for android

Parameters
Intentandroid screen share system serverice Intent
intscreen dimension witch
intscreen dimension height
Returns
int < 0 FAILED 0 SUCCESS

Reimplemented from io.agora.streaming.StreamingKit.

◆ stopScreenCapture()

void io.agora.streaming.internal.StreamingKitImpl.stopScreenCapture ( )

stop screen capture for android

Parameters
none
Returns
none

Reimplemented from io.agora.streaming.StreamingKit.