io.agora.rtc

## Class AgoraVideoMixer

- java.lang.Object
- - io.agora.rtc.AgoraVideoMixer

-     public class AgoraVideoMixer
      extends java.lang.Object

  Wrapper for video mixer functionality.

- - ### Field Summary

    Fields
    Modifier and Type | Field and Description
    --- | ---
    `private long` | `cptr` Native pointer to the video mixer instance.

  - ### Constructor Summary

    Constructors
    Constructor and Description
    `AgoraVideoMixer(long cptr)` Constructs a video mixer.

  - ### Method Summary

    All Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `void` | `addImageSource(java.lang.String id, MixerLayoutConfig config, int type)` Adds an image source to the mixer.
    `void` | `addVideoTrack(java.lang.String id, AgoraVideoTrack agora_video_track)` Adds a video track to the mixer.
    `void` | `delStreamLayout(java.lang.String id)` Deletes a stream layout.
    `void` | `destroy()` Destroys the video mixer and releases native resources.
    `private void` | `ndestroy()` Destroys the native video mixer.
    `void` | `refresh()` Refreshes the mixer output.
    `void` | `removeVideoTrack(java.lang.String id, AgoraVideoTrack agora_video_track)` Removes a video track from the mixer.
    `void` | `setBackgroundColor(int width, int height, int fps, int color_argb)` Sets the background color for the mixer.
    `void` | `setBackgroundUrl(int width, int height, int fps, java.lang.String url)` Sets the background image URL for the mixer.
    `void` | `setRotation(byte rotation)` Sets the rotation for the mixer output.
    `void` | `setStreamLayout(java.lang.String id, MixerLayoutConfig config)` Sets the stream layout configuration.

    - ### Methods inherited from class java.lang.Object

      `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- - ### Field Detail

    - #### cptr

          private long cptr

      Native pointer to the video mixer instance.

  - ### Constructor Detail

    - #### AgoraVideoMixer

          public AgoraVideoMixer(long cptr)

      Constructs a video mixer.
      Parameters:
        `cptr` - Native pointer to the video mixer instance

  - ### Method Detail

    - #### ndestroy

          private void ndestroy()

      Destroys the native video mixer.

    - #### destroy

          public void destroy()

      Destroys the video mixer and releases native resources.

    - #### addVideoTrack

          public void addVideoTrack(java.lang.String id,
                                    AgoraVideoTrack agora_video_track)

      Adds a video track to the mixer.
      Parameters:
        `id` - Track ID
        `agora_video_track` - Video track to add

    - #### removeVideoTrack

          public void removeVideoTrack(java.lang.String id,
                                       AgoraVideoTrack agora_video_track)

      Removes a video track from the mixer.
      Parameters:
        `id` - Track ID
        `agora_video_track` - Video track to remove

    - #### setStreamLayout

          public void setStreamLayout(java.lang.String id,
                                      MixerLayoutConfig config)

      Sets the stream layout configuration.
      Parameters:
        `id` - Stream ID
        `config` - Layout configuration

    - #### delStreamLayout

          public void delStreamLayout(java.lang.String id)

      Deletes a stream layout.
      Parameters:
        `id` - Stream ID

    - #### addImageSource

          public void addImageSource(java.lang.String id,
                                     MixerLayoutConfig config,
                                     int type)

      Adds an image source to the mixer.
      Parameters:
        `id` - Image source ID
        `config` - Layout configuration
        `type` - Image source type

    - #### refresh

          public void refresh()

      Refreshes the mixer output.

    - #### setBackgroundColor

          public void setBackgroundColor(int width,
                                         int height,
                                         int fps,
                                         int color_argb)

      Sets the background color for the mixer.
      Parameters:
        `width` - Output width
        `height` - Output height
        `fps` - Frame rate
        `color_argb` - Background color in ARGB format

    - #### setBackgroundUrl

          public void setBackgroundUrl(int width,
                                       int height,
                                       int fps,
                                       java.lang.String url)

      Sets the background image URL for the mixer.
      Parameters:
        `width` - Output width
        `height` - Output height
        `fps` - Frame rate
        `url` - Background image URL

    - #### setRotation

          public void setRotation(byte rotation)

      Sets the rotation for the mixer output.
      Parameters:
        `rotation` - Rotation value