Skip to content

RTCVideoFilter

Adnan Elezović edited this page Jun 5, 2024 · 1 revision

implements VideoFilter



RTCVideoFilter(options)

Description

Creates a new instance of the RTCVideoFilter.

Arguments

  • options: RTCVideoFilterOptions - Additional optional configuration used for setting up the video filter. If not provided, a new instance with default settings will be used.

Returns

Example

// Retrieve an image from a URL and decode it into a Bitmap
URL url = new URL("https://images.unsplash.com/photo-1558882224-dda166733046");
Bitmap image = BitmapFactory.decodeStream(url.openConnection().getInputStream());

// Create a RTCVideoFilterOptions object and set the virtual background image
RTCVideoFilterOptions options = RTCVideoFilterOptions.builder()
        .mode(RTCVideoFilterMode.VIRTUAL_BACKGROUND)
        .virtualBackground(image)
        .build();

// Create the RTCVideoFilter object with created options
RTCVideoFilter videoFilter = new RTCVideoFilter(options);



setOptions(options)

Description

This method allows you to configure the video filter by specifying additional options.

Arguments

  • options: RTCVideoFilterOptions - An object containing the options used to customize the behavior of the video filter. These options can include settings such as background image selection, blur intensity, or any other parameters relevant to the video filter's functionality.

Returns

  • N/A

Example

// Create a RTCVideoFilterOptions object with default values
RTCVideoFilterOptions options = RTCVideoFilterOptions.builder().build();

// Set created options on existing video filter object
videoFilter.setOptions(options);